	var dom = document.getElementById?1:0;
	var ie4 = document.all && document.all.item;
	var opera = window.opera;
	var ie5 = dom && ie4 && !opera;
	timerID = 0;
	function getLayer(layerName){
	  if(dom) return document.getElementById(layerName);
	  if(ie4 || ie5) return document.all[layerName];
	}
	function block_hide(){clearTimeout(timerID);}
	function hide(name){timerID = setTimeout("hideObject(\'" + name + "\')", 100);}
	function hide_all(){
	  for(i=1; 1; i++){
	    hide_all_sub('Nav'+i);
	    obj = getLayer('Nav'+i);
		
		
	      if(null != obj){obj.style.display='none';}
		  else{break;}
	  }
	}
	function hide_all_sub(prefix){
	  for(i1=1; 1; i1++){
	    obj1 = getLayer(prefix+i1);
		//alert(prefix+i);
	      if(null != obj1){obj1.style.display='none'; }
		  else{break;}
	  }
	}
	function showObject(x) {
	  hide_all();
	  clearTimeout(timerID);
	  obj=getLayer(x);
	  obj.style.display='block';		
	}
	function showSubObject(x,prefix) {
	  hide_all_sub(prefix);
	  clearTimeout(timerID);
	  obj=getLayer(x);
	  obj.style.display='block';		
	}
	function hideObject(x) {
	  hide_all_sub(x);
	  obj=getLayer(x);
	  obj.style.display='none';
	}

nn4 = (document.layers) ? true : false;
ie4 = (document.all) ? true : false;
dom = (document.createTextNode)? true : false;


function showimg(imgPath, comment) {
	var comm = (comment)? comment : 'Большая фотография';
	s = window.open('','preview','width=50,height=50,left=500,top=300,screenX=0,screenY=0,resizable=1,scrollbar=0,status=0');
	winDoc = s.document;
	s.document.writeln('<html><head><title>'+comm+'</title></head><body bgcolor=ffffff onload="window.self.focus();return true;" leftMargin="0" topMargin="0" marginheight="0" marginwidth="0"><table cellcpacing="0" cellpadding="5" border="0" width="100%" height="100%"><tr><td align="center"><a href="javascript:window.close()"><img id="image" src="' + imgPath + '" border="0" alt="Закрыть окно"></a></td></tr></table></body></html>');
    	winDoc.body.onload = function()
	{
		obj = winDoc.getElementById('image');
    		w = obj.width;
    		h = obj.height;
    		w1 = (self.opera ? 35 : 25);
    		h1 = (self.opera ? 70 : 45);
    		if (window.navigator.userAgent.indexOf("Gecko") >=0 ) { h1 = 100; }
		iHeight = (self.opera ? document.body.clientHeight : screen.availHeight);
		iWidth = (self.opera ? self.innerWidth : screen.availWidth);
    		var left = iWidth/2 - w/2;
	    	var top =  iHeight/2 - h/2;
    		setTimeout('s.resizeTo(w+w1, h+h1)', 2000);
		s.moveTo(left, top);
	}
     	s.onload = winDoc.body.onload;
	s.document.close();
	s.focus();
}

function popupWindow(fileUrl, winW, winH, winN, scrollB) {
	var winWidth = (winW)? winW : 740;
	var winHeight = (winH)? winH : 520;
	var winName = (winN)? winN : 'popupWin'
	var scrollBars = (scrollB)? scrollB : 'auto'
	if (nn4 || ie4 || dom) {
		if (screen.width < winWidth + 50) { winWidth = screen.width - 50; scrollbars = 'yes' }
		if (screen.height < winHeight + 100) { winHeight = screen.height - 100; scrollbars = 'yes' }
		posX = Math.round((screen.width - winWidth) / 2);
		posY = Math.round((screen.height - winHeight) / 2);
		posCode = (nn4 || dom)? "screenX="+posX+",screenY="+posY : "left="+posX+",top="+posY;
	} else {
		posCode = "";
	}
	var popupWin = window.open(fileUrl, winName,"menubar=no,toolbar=no,scrollbars=" + scrollBars + ",status=yes,resizable=yes,width=" + winWidth + ",height=" + winHeight + "," + posCode);
	if (popupWin) popupWin.focus();
}

function remove(element) {
	var parent = element.parentNode;
	while (element.firstChild)
		parent.insertBefore(element.firstChild, element);
	parent.removeChild(element);
}
