var delay					= 0;
var cH						= 0;
var cP						= 0;
var imgPrefix			= "hmenu";
var subMenuPrefix	= "sm";

var timeout;
var ie4=(navigator.appVersion.indexOf("MSIE")!=-1 && parseFloat(navigator.appVersion)>=4)?true:false;
var nn4=(navigator.appName=="Netscape" && parseFloat(navigator.appVersion)<5)?true:false;
var nn6=(navigator.appName=="Netscape" && parseFloat(navigator.appVersion)>=5)?true:false;

function OpenWindow(id,name,width,height) {
	style			=',scrolling=yes,resizable=yes,scrollbars=yes,status=yes,statusbar=yes'
	var Left	= (screen.width  - width) / 2 ;
	var Top		= (screen.height - height) / 2 ;
	window[id] = window.open('',name,'width='+width+',height='+height+',left='+ Left +',top='+ Top +style);
	return false;
}

function ow(isrc,ititle) {
	mwin = window.open('','','width=510,height=340,scrolling=no,resizable=yes');
	mwin.document.open();
	mwin.document.write('<html><head><title>'+ititle+'</title></head><body bgcolor="#FFFFFF" style="margin:0px; padding:0px;">');
	mwin.document.write('<a href="#" onclick="window.close(); return false" title="Кликните, чтобы закрыть окно"><img src="'+isrc+'" border="0" onload="window.resizeTo(this.width+8,this.height+30);"></a></body></html>');
}
function sMShow(i) {
var sm, obj, obj1, x = 0, y = 0;
	sMClear();
	sm		= subMenuPrefix + i;
	obj		= document.getElementById(imgPrefix + i);
	obj1	= obj;
	while(obj != null) {
		y	+=	obj.offsetTop;
		x	+=	obj.offsetLeft;
		obj	=	obj.offsetParent;
	}

	var el = document.getElementById(sm);
	/*el.style.top					= 1 + y + obj1.offsetHeight + "px";
	el.style.left					= x - 103 + obj1.offsetWidth/2 + "px";*/
	el.style.display			= "block";
	el.style.zIndex			= 1001;
	el.style.visibility		= "visible";

	cP = i;
}
function sMHide() {
	if (cP != null && cP != 0) {
		document.getElementById(subMenuPrefix + cP).style.visibility = "hidden";
		document.getElementById(subMenuPrefix + cP).style.zIndex = 1001;
		document.getElementById(subMenuPrefix + cP).style.display = "none";
		cP = 0;
	}
}
function sMClear() {
	if(delay != 0 && delay != null) window.clearTimeout(delay);
	delay = 0;
}
function sMHider() {
	sMClear();
	delay	= window.setTimeout('sMHide()',500);
}












var bScrolling = true;
function OnScrollerMouseOver(){
    bScrolling = false;
}

function OnScrollerMouseOut(){
    bScrolling = true;
}

function OnTimer(){
    if(!bScrolling)
        return;
  oText.style.top = nPos.toString() + "px";

    if(--nPos < -nHeight)
        nPos = oContainer.offsetHeight;
}




var hide=true;

function movePic(set){

if (window.ActiveXObject) {
evt=window.event;
//Snd = 'block';
   } else {
//Snd = 'table-row-group';
evt=this;
   }


//alert(window.event.clientY + ' ' + document.body.scrollTop);
_fh=document.getElementById('alt'+set).offsetHeight;
_fw=document.getElementById('alt'+set).offsetWidth;

_x=evt.clientX - _fw*2;
_y=evt.clientY - _fh*2;
_by=document.body.scrollTop;
_bx=document.body.scrollLeft;
//alert(_by + ' ' + _bx);
_dx=5;
left=false;
right=false;
document.getElementById('alt'+set).style.left=_bx + (_x + _fw) +'px';
document.getElementById('alt'+set).style.top= _by + (_y + _fh) +'px';

if(hide){
document.getElementById('alt'+set).style.visibility="visible";
 }
hide=false;
//status='_x'+ _x +' _y '+ _y +' _bx '+ _bx +' _by '+ _by;
//window.status = _fh +'  '+_fw;

}



function hidePic(set){
document.getElementById('alt'+set).style.visibility="hidden";
document.getElementById('alt'+set).style.top=0 + 'px';
document.getElementById('alt'+set).style.left=0 + 'px';
hide=true;
}



