function IEPngFix( pngimg, gifimg, width, height, unique_name )
{
	var code = '<img src="'+ gifimg +'" width="' + width + '" height="' + height + '" border="0" id="'+ unique_name +'" style="background:url('+pngimg+') no-repeat 0px 0px;" alt="'+unique_name+'"/>';
	if( navigator.userAgent.indexOf("Opera") > 1 ) document.write(code);
	else
		if( navigator.userAgent.indexOf("MSIE 6") > 1 ) document.write('<img src="'+gifimg+'" width="' + width + '" height="' + height + '" border="0" alt="'+unique_name+'" id="'+ unique_name +'" style="filter: progid:DXImageTransform.Microsoft.AlphaImageLoader (src=' + pngimg + ' , sizingMethod=crop );"/>');
		else
			if(navigator.userAgent.indexOf("MSIE 5") != -1) document.write(code);
			else document.write(code);
}




cm=null;					// ID видимого слоя
hide_delay=500;		// задержка
tstat=0;					// статус меню.

isNS4 = (document.layers) ? true : false;
isIE4 = (document.all && !document.getElementById) ? true : false;
isIE5 = (document.all && document.getElementById) ? true : false;
isNS6 = (!document.all && document.getElementById) ? true : false;

// 
function switchDiv(objElement,bolVisible){
if(isNS4||isIE4){
     if(!bolVisible) {
       objElement.visibility ="hidden"
     } else {
       objElement.visibility ="visible"
     }     
 } else if (isIE5 || isNS6) {
      if(!bolVisible){
         objElement.style.display = "none";
         
      } else {
        objElement.style.display = "";
        
        }

      }

return 1;
}

// возвращает положение обьекта
function getPos(el,sProp) {
	var iPos = 0;
	while (el!=null) {
		iPos+=el["offset" + sProp]
		el = el.offsetParent
	}
	return iPos

}

// возвращает обьект по ID
function getelementbyid(myid) {
   if (isNS4){
        objElement = document.layers[myid];
     }else if (isIE4) {
        objElement = document.all[myid];
     }else if (isIE5 || isNS6) {
             objElement = document.getElementById(myid);
     }
return(objElement);
}

// скрыть или показать слой
function show(el,m) {
	if (cm!=null) {
		switchDiv(cm,false);
	}
	if (m!=null) {
		m=getelementbyid(m);
		m.style.left = getPos(el,"Left")+"px";
		m.style.top =  getPos(el,"Top")+el.offsetHeight+"px";
		switchDiv(m,true);
		cm=m;
	}
}

// закрывает меню
function hidemenu() {
	timer1=setTimeout("show(null,null)",hide_delay);
	tstat=1;
	return 1;
}

// отключает таймер если меню еше активно
function cancelhide() {
	if (tstat==1) {
		clearTimeout(timer1);
		tstat=0;
	}
	return 1;
}





function lmshow(obj) {
	obj.style.background = "url(img/m_over.gif) repeat-y 0px 0px";
}
function lmhide(obj) {
	obj.style.background = "";
}






