var closeInt=0;
var scriptCounter=0;
var oldIE=false;
var viewportwidth;
var viewportheight;
 
 // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
 
 if (typeof window.innerWidth != 'undefined') {
      viewportwidth = window.innerWidth,
      viewportheight = window.innerHeight
 }
 
// IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)

 else if (typeof document.documentElement != 'undefined'
     && typeof document.documentElement.clientWidth !=
     'undefined' && document.documentElement.clientWidth != 0)
 {
       viewportwidth = document.documentElement.clientWidth,
       viewportheight = document.documentElement.clientHeight
 }
 
 // older versions of IE
 
 else
 {
	 	oldIE=true;
       var viewportwidth = window.innerWidth;
       var viewportheight = window.innerHeight;
 }

function openMenu(id,x) {
	var menu=document.getElementById('submenu'+id);
	if (menu) {
		menu.style.display='block';
		menu.style.left=x+'px';
		if (oldIE) {
			menu.style.left=x-720+"px";
		}
		menu.onmouseover=function() {
			menu.mouseover=true;
			SendDataToFlashMovie('activeSubMenu',id);
		}
		document.getElementById('content').onmouseover=function() {
			menu.mouseover=false;
			closeMenu(id);
		}
		document.getElementById('functions').onmouseover=document.getElementById('content').onmouseover;
		document.getElementById('scripts').onmouseover=document.getElementById('content').onmouseover;
		document.getElementById('contactInfo').onmouseover=document.getElementById('content').onmouseover;
	}
	SendDataToFlashMovie('activeSubMenu',id);
}
function closeMenu(id) {
	closeMenuForReal(id);
}
function closeMenuForReal(id) {
	var menu=document.getElementById('submenu'+id);
	if (menu) {
		if (!menu.mouseover) {
			menu.style.display='none';
			SendDataToFlashMovie('activeSubMenu',0)
		}
	}
}

function closeAllMenus() {
	for (i=0;i<12;i++) {
		if (document.getElementById('submenu'+i)) {
			document.getElementById('submenu'+i).style.display='none';
		}
	}
	//SendDataToFlashMovie('activeSubMenu',0)
}