	var nav_id = -1;
	var __nav = navigator.appName;
	var __ver = navigator.appVersion;
	if(__nav.indexOf("Microsoft Internet Explorer") != -1) nav_id = 0;
	if(navigator.userAgent.indexOf("Opera") != -1) nav_id = 1;
	if(__nav.indexOf("Netscape") != -1) nav_id = 2;
    if(navigator.userAgent.indexOf("Netscape6") != -1) nav_id = 3;
	
	
	function getForIeX(El) {
	  var X = 0;
	  
	  do { 
		X += El.offsetLeft;
		
		} while ((El = El.offsetParent) != null);
	  return X;
	}
	
	function getForIeY(El) {
	  var Y = 0;
	  do { Y += El.offsetTop } while ((El = El.offsetParent) != null);
	  return Y;
	}


	function ShowVMenu(divid){
	    if (document.layers){
		document.layers[divid].visibility="show";
		}else if (document.all){
		document.all[divid].style.visibility="visible";
		}else{
		document.getElementById(divid).style.visibility="visible";
		}
	}

	function HideVMenu(divid){
	    if (document.layers){
		document.layers[divid].visibility="hide";
		}else if (document.all){
		document.all[divid].style.visibility="hidden";
		}else{
		document.getElementById(divid).style.visibility="hidden";
		}
	}

	function zxcLeft(zxc){
		zxcObjLeft=zxc.offsetLeft;
		while(zxc.offsetParent!=null){
			zxcObjParent=zxc.offsetParent;
			zxcObjLeft+=zxcObjParent.offsetLeft;
			zxc=zxcObjParent;
		}
		return zxcObjLeft;
	}
	
	function ShowMenu(divid, el){
	//скрыть селект
	//if (divid=='subm2'||divid=='subm3'){
	

	//}
		if(el){
		    if (document.layers) {
		    	MenuX = el.x;
		    	MenuY = el.y;
		    }
		    else {
		    	MenuX = getForIeX(el);
				MenuY = getForIeY(el);
		    }
			

			if(divid == "langs")
			{
				MenuY+=el.height;
				document.getElementById(divid).style.width = '140px';
				document.getElementById(divid).style.left = MenuX+'px';
				document.getElementById(divid).style.top = MenuY+' px';
			}
			else
			{
				MenuY+=el.height-8;
				document.getElementById(divid).style.left = MenuX-25+3+'px';				
				document.getElementById(divid).style.top = MenuY+'px';
			}
	
			
		}
		
		
		
		
		
			//window.status=el.outerHTML
			
				
			

		
/*		
			if(divid == "lang") {
				if(nav_id == 0){
					document.getElementById(divid).style.top = '345px';
					document.getElementById(divid).style.left = zxcLeft(el)+'px';
				}
				if(nav_id == 1){
					document.getElementById(divid).style.top = '335px';
					document.getElementById(divid).style.left = zxcLeft(el)+3+'px';
				}
				if(nav_id == 2){
					document.getElementById(divid).style.top = '344px';
					document.getElementById(divid).style.left = zxcLeft(el)+'px';
				}
				if(nav_id == 3){
					document.getElementById(divid).style.top = '339px';
					document.getElementById(divid).style.left = zxcLeft(el)+'px';
				}
				
				
			}
		}
		
			else{
			}		
		if (document.getElementById('sel'))
			if (true)
				document.getElementById('sel').style.visibility='hidden';
*/				
		
		document.getElementById(divid).style.visibility = "visible";
	}

function VisEl(divid){
	document.getElementById(divid).style.visibility = "visible";
}
	
		function ShowMenulev3(divid, el){
		if(el){
		    if (document.layers) {
		    	MenuX = el.x;
		    	MenuY = el.y;
		    }
		    else {
		    	MenuX = getForIeX(el);
				MenuY = getForIeY(el);
		    }
			
			MenuY+=el.height;

			if(divid == "lang")
			{
			
				document.getElementById(divid).style.left = MenuX+'px';				
				document.getElementById(divid).style.top = MenuY+' px';
			}
			else
			{
			
				
				
				document.getElementById(divid).style.left = MenuX+133+'px';
				
				//высота окна браузера			
				wHeight=WindowHeight();
				
				//высота дива
				elHeight=document.getElementById(divid).offsetHeight;
				
				
				//window.status=parseInt(MenuY)+parseInt(elHeight);
				totalHeight=parseInt(MenuY)+parseInt(elHeight);
					if (totalHeight>wHeight){
					//alert(totalHeight);
						YMenuPos=parseInt(MenuY)-(totalHeight-parseInt(wHeight));
					}else{
						YMenuPos=MenuY;
					}
								
				document.getElementById(divid).style.top = YMenuPos-35+'px';
			}
	
			
		}		
				
		document.getElementById(divid).style.visibility = "visible";
	}
	
	

function WindowHeight(){// Высота  окна браузера
	if (document.all){// Internet Explorer
		return document.body.offsetHeight + document.body.scrollTop -4;
	}else{// Netscape Navigator
		return window.pageYOffset + window.innerHeight;
	}
}
	

	function HideMenu(divid){
	//показать селект
	//if (document.getElementById('sel'))		
		//document.getElementById('sel').style.visibility='visible';
	document.getElementById(divid).style.visibility="hidden";
	}

function popItUp() {
    var newWindow = open("/rules.php", "secondWindow", "scrollbars,resizable,width=400,height=250");
}

function PrintVersionOpener (obj,w,h) {
	window.open (obj,"displayPrntWindow","width="+w+",height="+h+",screenX=50,screenY=50,left=50,top=50,toolbar=1,scrollbars=1,menubar=0,status=1,resizable=no");
	}

var msgPicWindow;
function PicOpener (obj,w,h) {
	if (msgPicWindow) {msgPicWindow.close()}
	msgPicWindow=window.open ("about:blank","displayPicWindow","width="+w+",height="+h+",screenX=50,screenY=50,left=50,top=50,toolbar=0,scrollbars=0,menubar=0,status=no,resizable=no");
	msgPicWindow.document.writeln ("<html><head><title></title></head><body leftmargin=0 marginheight=0 marginwidth=0 topmargin=0 bgcolor=\"#ffffff\" text=\"#000000\" link=\"#658790\" vlink=\"#658790\" alink=\"#000000\"><a href=\"javascript:window.close()\"><img src=\"/files/"+obj+"\" width="+w+" height="+h+" border=\"0\"></a></body></html>");
	}
