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"


if (document.images) {
  btnon = new Array() 
  btnoff = new Array()
     
  newson = new Image();
  newson.src = "menu/bt_news_over1x1.gif";
  newsoff = new Image();
  newsoff.src = "menu/bt_news1x1.gif";

  presson = new Image();
  presson.src = "menu/bt_press_over1x1.gif";
  pressoff = new Image();
  pressoff.src = "menu/bt_press1x1.gif";

  contacton = new Image();
  contacton.src = "menu/bt_contact_over1x1.gif";
  contactoff = new Image();
  contactoff.src = "menu/bt_contact1x1.gif";

  bt1on = new Image();
  bt1on.src = "menu/bt_gameinfo_over1x1.gif";
  bt1off = new Image();
  bt1off.src = "menu/bt_gameinfo1x1.gif";
  
  bt2on = new Image();
  bt2on.src = "menu/bt_overview_over1x1.gif";
  bt2off = new Image();
  bt2off.src = "menu/bt_overview1x1.gif";
  
  bt3on = new Image();
  bt3on.src = "menu/bt_story_over1x1.gif";
  bt3off = new Image();
  bt3off.src = "menu/bt_story1x1.gif";
  
  bt4on = new Image();
  bt4on.src = "menu/bt_features_over1x1.gif";
  bt4off = new Image();
  bt4off.src = "menu/bt_features1x1.gif";
  
  bt5on = new Image();
  bt5on.src = "menu/bt_requirements_over1x1.gif";
  bt5off = new Image();
  bt5off.src = "menu/bt_requirements1x1.gif";
  
  bt6on = new Image();
  bt6on.src = "menu/bt_gallery_over1x1.gif";
  bt6off = new Image();
  bt6off.src = "menu/bt_gallery1x1.gif";
  
  bt7on = new Image();
  bt7on.src = "menu/bt_screenshots_over1x1.gif";
  bt7off = new Image();
  bt7off.src = "menu/bt_screenshots1x1.gif";
  
  bt8on = new Image();
  bt8on.src = "menu/bt_artworks_over1x1.gif";
  bt8off = new Image();
  bt8off.src = "menu/bt_artworks1x1.gif";
  
  communityon = new Image();
  communityon.src = "menu/bt_community_over1x1.gif";
  communityoff = new Image();
  communityoff.src = "menu/bt_community1x1.gif";

  
  
  
  
}



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(_name0,_name1,_name2,num,num2){
poses = new Array();
poses[0] = 131;
poses[1] = 228;
poses[2] = 544;
clearTimeout(timer_value);
divinit();
if(document.layers){
document.layers[_name0].visibility = "show";
document.layers[_name0].left = divlinepos+poses[num];
document.layers[_name0].top = num2;
document.images[_name1].src="menu/bt_"+_name1+"_over1x1.gif";
document.images[_name2].src="menu/bt_"+_name2+"_over1x1.gif";
} 
else {
	document.getElementById(_name0).style.visibility = "visible";
    document.getElementById(_name0).style.left = divlinepos+poses[num];
    document.getElementById(_name0).style.top = num2;
    document.images[_name1].src="menu/bt_"+_name1+"_over1x1.gif";
    document.images[_name2].src="menu/bt_"+_name2+"_over1x1.gif";
}
 if(timer_name == _name0){
 }
 else {
 hide_menu();
 }
}


function hide(_name0, _name1, _name2){
timer_value = setTimeout("hide_menu()", speed);
timer_name = _name0;
document.images[_name1].src="menu/bt_"+_name1+"1x1.gif";
document.images[_name2].src="menu/bt_"+_name2+"1x1.gif";
}

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=bbody.clientWidth;}
divpos=Math.round(divwidth/2)-390;
//if (divpos<130) divpos=130;
divlinepos=divpos;

}  
window.onresize = win_resize;