var speed = 400;
var timer_name = null;
var timer_value = null;
var layerRef="null", styleSwitch="null"; var Browser="null";
if (navigator.appName == "Netscape") Browser="NC";
if (navigator.appName == "Microsoft Internet Explorer") Browser="IE";

function show_win(item) {
    
    win = window.open("", "Info", "'toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=0,left="+(screen.availWidth/2-350/2)+",top=410,width=350,height=300");
	win.document.open();
    switch (item) {
        case "newsletter": 
           title = "Newsletter Info";
           text = "<ul>Subscribe to Wargaming.net&rsquo;s monthly newsletter to receive info about our games and other corporate news.<br><br>If you want to unsubscribe, please, email at: <a href='mailto:morda@wargaming.net'>morda@wargaming.net</a> with &quot;Unsubscribe&quot; Subject.<br><br></ul>";
           break;
    };
    
	win.document.write("<html><head><title>"+title+"</title><link rel='STYLESHEET' type='text/css' href='css/style.css'></head>");
	win.document.write("<body bgcolor=67696D marginheight=0 marginwidth=0 topmargin=0 leftmargin=0><br>");
	win.document.write("<table align=center bgcolor=000000 width='90%' cellpadding=10 cellspacing=1 border=0>");
	win.document.write("<tr><td bgcolor=E5D3B0>");
	win.document.write(text);
	win.document.write("</td></tr>");
	win.document.write("</table>");
	win.document.write("<p align=center><input type=Button onclick='javascript: window.close()' value='Close'></p>");
	win.document.write("</body></html>");
	win.document.close();
    window.win.focus();
}

function show(_name){
clearTimeout(timer_value);
divinit();
if(document.layers){
document.layers[_name].visibility = "show";
document.layers[_name].left = divlinepos;
} 
else {
	document.getElementById(_name).style.visibility = "visible";
    document.getElementById(_name).style.left = divlinepos;
}
 if(timer_name == _name){
 }
 else {
 hide_menu();
 }
}

function sb_show(_name1,_name2){
clearTimeout(timer_value);
if(document.layers){
document.layers[_name1].visibility = "show";
document.layers[_name2].visibility = "show";
} 
else {
	document.getElementById(_name1).style.visibility = "visible";
	document.getElementById(_name2).style.visibility = "visible";
}
 if(timer_name != _name1){ hide_menu(); }
}

function hide(_name){
timer_value = setTimeout("hide_menu()", speed);
timer_name = _name;
}

function hide_menu(){
if(timer_name){
	if(document.layers){
		document.layers[timer_name].visibility = "hide";
	}
	else {
		document.getElementById(timer_name).style.visibility = "hidden";
  	}
 }
}

function win_resize(){
	if(document.layers){
	document.location.reload();
	 }
}

function init()
{
  if (Browser == "NC") {
    layerRef="document.layers";
    styleSwitch="";
  }else{
    layerRef="document.all";
    styleSwitch=".style";
  }
}

function divinit()
{
if (Browser=="NC") 
	{divwidth=window.innerWidth;}
if (Browser=="IE")
	{
    divwidth = document.body.clientWidth; 
    }

divpos = Math.round(divwidth/2)-260;
if (divpos<130) divpos=130;
divlinepos = divpos;

}  
//window.onresize = win_resize;
