var index = 0;
var xmlhttp = new Array();

function change_banner(){
	if(window.XMLHttpRequest){
     	xmlhttp.push(new XMLHttpRequest());
	}
	else if(window.ActiveXObject){
	     xmlhttp.push(new ActiveXObject("Microsoft.XMLHTTP"));
	}
	index = xmlhttp.length - 1;
     if(xmlhttp[index]){
     	var obj = document.getElementById("banner_place");
          xmlhttp[index].open("GET", "./inc/main_banner.inc?ajax=true", true);
          xmlhttp[index].onreadystatechange = function() {
               if(xmlhttp[index].readyState == 4 && xmlhttp[index].status == 200){
                    obj.innerHTML = xmlhttp[index].responseText;
               }
          }
          xmlhttp[index].send(null);
     }
}

/*====================================AJAX==========================================*/

function writeEmbedFlash(file, width, height)
{
  document.write('<embed src="'+file+'" width="'+width+'" height="'+height+'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent"></embed>');
}

var countMenu = 6;

function menu_on(id)
{
	for(i=1;i<=countMenu;i++) {
	if(i!=id) {
		document.getElementById('menu'+String(i)).style.visibility="hidden";
		}
	}
	document.getElementById('menu'+String(id)).style.visibility="visible";
}

function menu_off(id)
{
	document.getElementById('menu'+String(id)).style.visibility="hidden";
}

function menu_off_all(id)
{
	for(i=1;i<=countMenu;i++){
		if(i!=id) {
			document.getElementById('menu'+String(i)).style.visibility="hidden";
		}
	}
}

function MWWstate_on(id)
{
	document.getElementById('MWWstate'+String(id)).style.visibility="visible";
}

function MWWstate_off(id)
{
	document.getElementById('MWWstate'+String(id)).style.visibility="hidden";
}

function tooltipWindow()
{
	window.open("","toolTip",'toolbar=0,location=0,scrollbars=auto,width=360,height=180,resizable=0,top=20,left=20');
}
