D=document, W=window, IS_OLEG=0;

W.onload=function(){enableTooltips('shContainer')};
//function $(s){return D.getElementById(s)};
function $S(s){return D.getElementById(s).style};
function bookMarkPage(){
	var r=0, title=$IS_SHOP_NAME+' - '+D.title, url=W.location.href;
	if(W.sidebar)W.sidebar.addPanel(title,url,"");
	else if(W.opera && W.print)r=1;
	else if(D.all)W.external.AddFavorite(url, title);
	event.returnValue=r;
}

//position(); 
function noBub(){event.cancelBubble=true}
function noRet(){event.returnValue=false}
//function $(id){return D.getElementById(id)}
function _(s){D.write(s)}
function __(s){D.writeln(s)}
B=navigator.appName;
switch(B){
	case "Opera": B="Op"; break;
	case "Microsoft Internet Explorer": B='IE'; break;
	case "Netscape": 
		B=(navigator.userAgent.toLowerCase().indexOf('chrome')>-1)?'CR':'NS';
		break;
	default: B='';
}
if(B=='IE'){
	BVer=4;
	if(navigator.appVersion.indexOf("MSIE")!=-1)BVer=parseFloat(navigator.appVersion.split("MSIE")[1]);    
}else{
	BVer=parseFloat(navigator.appVersion);
}

function getPos(o){
	var x=y=0;
	try{
		if(o.offsetParent)do{x+=o.offsetLeft;y+=o.offsetTop}while(o=o.offsetParent);
	}catch(e){}
	return [x,y];
}

//-
function popupWindow(url) {
  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,left=150')
}
function popupWindowPrice(url) {
  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=600,height=400,screenX=150,screenY=150,top=150,left=150')
}

//- ISCookie -
function ISCookie(n,v,d){
	this.name='ISCookieDef';
	if(typeof(n)!='undefined')this.name=n;
	if(typeof(v)!='undefined'){
		this.set(v,n,d);
	}
	ISCookie.prototype.get = function(n){
		if(typeof(n)!='undefined')this.name=n;
		var nEQ=this.name+"=";
		var ca=D.cookie.split(";");
		for(var i=0;i<ca.length;i++) {
			var c=ca[i];
			while(c.charAt(0)==" ") c=c.substring(1,c.length);
			if (c.indexOf(nEQ)==0) 
				return c.substring(nEQ.length,c.length);
		}
		return null;
	}
	ISCookie.prototype.set = function(v,n,days){
		if(typeof(n)!='undefined')this.name=n;
		var ex="";
		if(typeof(days)=='undefined')days=356;
		if(days){
			var d=new Date();
			d.setTime(d.getTime()+(days*86400000));
			ex="; expires="+d.toGMTString();
		}
		D.cookie=this.name+"="+v+ex;
	}
}

//-
var cVMBlockId='ProdMenuBlock0';
function chVisMenuBlock(bId,f){
	var eM=$('#li'+bId),eB=$('#'+bId);
	try{
		if(cVMBlockId!=eB[0].id){
			$('#li'+cVMBlockId)[0].className=''; $('#'+cVMBlockId).hide();
		}
	}catch(e){}
	try{
		if(eM[0].className=='selected'){
			eM[0].className=''; eB.hide();
		}else{
			eM[0].className='selected';	eB.show(); //eB.slideToggle("show");
		}
		cVMBlockId=bId;
	}catch(e){}
}
//-
function backInStockFormSubmit(){
	back_in_stock_notification.cofnospam.value=back_in_stock_notification.email.value;
}
function showBackInStockForm(f){
	var e=$("#backInStockNotificationForm");
	if(f){
		var p=$("#backInStockNotificationLink").position();
		e[0].style.left=(p.left-60)+"px";
		e[0].style.top=(p.top)+"px";
		e.slideToggle("show");
	}else{
		e.slideToggle("hide")
	}
}
