var isIE4=(navigator.appVersion.indexOf("MSIE")!=-1 && parseFloat(navigator.appVersion)>=4)?true:false;
var isNN4=(navigator.appName=="Netscape" && parseFloat(navigator.appVersion)<5)?true:false;
var isNN6=(navigator.appName=="Netscape" && parseFloat(navigator.appVersion)>=5)?true:false;
var isOPERA=(navigator.appName=="Opera" && parseFloat(navigator.appVersion)>=7)?true:false;

var timeout;
var DivSet="div1";

function ShowIt (parametr,div,div2) {
	if (parametr == true) {
		clearTimeout(timeout);hide();
		x=getDivX(div);
		y=getDivY(div);
		shiftY=getDivHeight(div);
		setDivX(div2,x,y+shiftY);
		DivSet=div2;
	}
	if (parametr == false) {
		timeout=setTimeout('hide()',500);
	}
}

function getDivHeight(divName){
	if( isIE4 ) {
		return document.all[divName].offsetHeight;
	}
	if( isNN6 || isOPERA ) {
		return document.getElementById(divName).offsetHeight;
	}
}


// get X coordinate of element's upper-left corner
function getDivX( szDivName )
{
	if( isIE4 )
	{
		var nPos = 0;
		objCurrent = document.all[ szDivName ];
		while( objCurrent != null )
		{
			nPos += objCurrent.offsetLeft;
			objCurrent = objCurrent.offsetParent;
		}
		return nPos;
	}
	if( isNN4 )
		return document.layers[ szDivName ].pageX; 
	if( isNN6 || isOPERA )
		return document.getElementById( szDivName ).offsetLeft;
	return 0;
}		

// get Y coordinate of element's upper-left corner
function getDivY( szDivName )
{
	if( isIE4 )
	{
		var nPos = 0;
		objCurrent = document.all[ szDivName ];
	
		// prevent relative Y positioning problems in IE55 and IE6:
		if( objCurrent.style.position.toLowerCase() != "absolute" )
			objCurrent.style.position = "static";
	
		while( objCurrent != null )
		{
			nPos += objCurrent.offsetTop;
			objCurrent = objCurrent.offsetParent;
		}

		return nPos;
	}
	if( isNN4 )
		return document.layers[ szDivName ].pageY; 
	if( isNN6 || isOPERA)
		return document.getElementById( szDivName ).offsetTop;
	return 0;
}

function setDivX(DivName,x,y){
 if(isIE4){
 document.all[DivName].style.left=x-5+"px";
 document.all[DivName].style.top=y+"px";
 document.all[DivName].style.visibility="visible";
 }
 if(isNN4){
 document.layers[DivName].pageX=x-5;
 document.layers[DivName].pageY=y;
 document.layers[DivName].visibility="show";
 }
 if(isNN6 || isOPERA){
 document.getElementById(DivName).style.left=x-5;
 document.getElementById(DivName).style.top=y;
 document.getElementById(DivName).style.visibility="visible";
 }
}

function hide(){
 if(isIE4){
 document.all[DivSet].style.visibility="hidden";
 }
 if(isNN4){
 document.layers[DivSet].visibility="hidden";
 }
 if(isNN6 || isOPERA){
 document.getElementById(DivSet).style.visibility="hidden";
 } 
}


/*function Big(shot) {
	var ScrWindow;
	ScrWindow=window.open("zoom.html","","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,left=15,top=15,width=400,height=400");
	if (ScrWindow != null && ScrWindow.opener == null) ScrWindow.opener=window;
	ScrWindow.document.open();
	ScrWindow.document.writeln ("<html><head><title>&nbsp </title></head><body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 bgcolor='#ffffff' TEXT='#E2E294'>"+
	"<img src='Img/"+shot+"'>"+
	"</body></html>");
	ScrWindow.document.close();
	return false;
}

function Menu(imgName,menuName){
if(document.images){eval('document.menu' + imgName + '.src="pictures/menu00' + menuName + '.gif"');}
}

function BigXY(shot,X,Y) {
	var ScrWindow;
	var tmp = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,left=15,top=15,width="+X+",height="+Y;
	ScrWindow=window.open("zoom.html","",tmp);
	if (ScrWindow != null && ScrWindow.opener == null) ScrWindow.opener=window;
	ScrWindow.document.open();
	ScrWindow.document.writeln ("<html><head><title>&nbsp</title></head><body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 bgcolor='#ffffff' TEXT='#E2E294'>"+
	"<img src='"+shot+"'>"+
	"</body></html>");
	ScrWindow.document.close();
	return false;
}
function UseXY(page,X,Y) {
	var ScrWindow;
	var tmp = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,left=15,top=15,width="+X+",height="+Y;
	
	ScrWindow=window.open(page,"",tmp);
	return false;
}*/
