function browse_check() {
	this.ver=navigator.appVersion; this.agent=navigator.userAgent; this.dom=document.getElementById?1:0;
	this.opera5=(window.opera&&this.dom)?1:0; this.opera6=(this.opera5&&window.print)?1:0;
	this.opera7=(this.opera5&&document.readyState)?1:0;
	this.ie5=(this.ver.indexOf("MSIE 5")>-1&&this.dom&&!this.opera5)?1:0;
	this.ie6=(this.ver.indexOf("MSIE 6")>-1&&this.dom&&!this.opera5)?1:0;
	this.ie4=(document.all&&!this.dom&&!this.opera5)?1:0;
	this.ie=this.ie4||this.ie5||this.ie6; this.mac=this.agent.indexOf("Mac")>-1;
	this.ns6=(this.dom&&parseInt(this.ver)>=5)?1:0;
	this.ns4=(document.layers&&!this.dom)?1:0;
	this.bw=(this.ie6||this.ie5||this.ie4||this.ns4||this.ns6||this.opera5||this.opera6||this.opera7); return this;
}
bw=new browse_check();

// Альфа-канал на слоган
function sAlpha() {
	sImg=document.images["pic-slogan"];
	if (bw.ie6) {
		sImg.src="/i/p.gif";
		sImg.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/i/slogan.png')";
	}
	sImg.style.visibility="visible";
}

// Горизонтальное меню (индикация)
function hm() {
	aHover=document.getElementById("hmenu").getElementsByTagName("a");
	for (i=0;i<aHover.length;i++) {
		if (aHover[i].parentNode.className!="on") {
			aHover[i].onmouseover=function() {
				this.parentNode.className="on";
				lHover=this.parentNode.previousSibling;
				if (lHover) { (lHover.nodeName=="li"||lHover.nodeName=="LI")&&lHover.className!="on"?lHover.className="no":null; }
			}
			aHover[i].onmouseout=function() {
				lHover=this.parentNode.previousSibling;
				nHover=this.parentNode.nextSibling;
				if (nHover) {
					(nHover.nodeName=="li"||nHover.nodeName=="LI")&&nHover.className!="on"?this.parentNode.className="": this.parentNode.className="no";
				} else { this.parentNode.className=""; }
				if (lHover) { (lHover.nodeName=="li"||lHover.nodeName=="LI")&&lHover.className!="on"?lHover.className="":null; }
			}
		} else {
			lHover=aHover[i].parentNode.previousSibling;
			if (lHover) {
				(lHover.nodeName=="li"||lHover.nodeName=="LI")?lHover.className="no":null;
			}
		}
	}
}

// Вертикальное меню (каталог)
function vm() {
	liHover=document.getElementById("vmenu").getElementsByTagName("li");
	for (i=0;i<liHover.length;i++) {
		if (liHover[i].className!="on") {
			liHover[i].onmouseover=function() { this.className="on"; }
			liHover[i].onmouseout=function() { this.className=""; }
		}
	}
}

// Позиционирование цветного блока (слева)
function findPos(o) {
	this.x=0; this.y=0; this.h=0; var el,temp;
	el=document.getElementById(o);
	if( el ) {
      this.h=el.offsetHeight;
   	if (el.offsetParent) { temp=el;
   		while(temp.offsetParent) { temp=temp.offsetParent; this.x+=temp.offsetLeft; this.y+=temp.offsetTop; }
   	}
   	this.x+=el.offsetLeft; this.y+=el.offsetTop;
   }
 	return this;
}

function fPos(pDiv,box,x,h,y,w) {
	x?null:x=0; h?null:h=0; y?null:y=0; w?null:w=0;
	pos=new findPos(box);
	sDiv=document.getElementById(pDiv);
   sDiv.style.left=0+x+"px"; sDiv.style.top=pos.y+y+"px";
	sDiv.style.height=pos.h+h+"px"; sDiv.style.width=pos.x+w+"px";
	sDiv.style.visibility="visible";
}

// Rollover для таблицы каталога
function sCat() {
	tdHover=document.getElementById("cat-pic").getElementsByTagName("a");
	for (i=0;i<tdHover.length;i++) {
		tdHover[i].onmouseover=function() {
			this.parentNode.className="on";
			r=/.jpg/; iName=this.firstChild.src; iName=iName.replace(r,""); this.firstChild.src=iName+"-c.jpg";
		}
		tdHover[i].onmouseout=function() {
			this.parentNode.className="";
			r=/\-c.jpg/; iName=this.firstChild.src; iName=iName.replace(r,""); this.firstChild.src=iName+".jpg";
		}
	}
}
