var dom = (document.getElementById)? true : false;
var ns4 = (document.layers)? true : false;
var ie4 = (!dom && document.all)? true : false;
var BV=parseInt(navigator.appVersion.indexOf("MSIE")>0?navigator.appVersion.split(";")[1].substr(6):navigator.appVersion);
var OP=(navigator.userAgent.indexOf('Opera')!=-1&&BV>=4)?true:false;
var IE=(navigator.userAgent.indexOf('MSIE')!=-1)?true:false;
if (OP) {IE=true;}
//document.writeln(IE);

function free_line() {
alert("Почтовая система с бесплатной линии не доступна.");
return false;
}

function create_window () {
  myWin= open("/shcart/?step=0","shcart","WIDTH=200,height=141,resizable=no,toolbar=no,menubar=no,location=no,scrollbars=no");

//  myWin.document.open();
//  myWin.document.write("<html><head><title>Информация");
//  myWin.document.write("</title></head><body bgcolor=\"#FFFFFF\">");
//  myWin.document.write("<center>подождите, пожалуйста</center>");
//  myWin.document.write("</body></html>");
//  myWin.document.close();  
//  
  myWin.window.focus();
}

function create_shcart(url){
	myWin = open("","shcart","WIDTH=200,height=137,resizable=no,toolbar=no,menubar=no,location=no,scrollbars=no");
	myWin.document.write("<html><head><title>Информация");
	myWin.document.write("</title></head><body bgcolor=\"#FFFFFF\">");
	myWin.document.write("<center>подождите, пожалуйста</center>");
	myWin.document.write("</body></html>");
	myWin.document.location.href=url;
	myWin.window.focus();
}

function winopen(url,width,height){
var www = top.window.open(url,'www', 'resizable=yes,scrollbars=yes,menubar=yes,width='+width+',height='+height+'');
}

function tocart(ent,id){

if (!IE)	 {
create_window();
}
else {
		cart_add('flying_cart','');
//document.writeln('\\variables\cgi_url\?mode=shcart&add='+id+'&step=1&frame=yes');
//		BackHistoryCount++; // added by MJ 28.07.00
//		if (BackHistoryCount > 1) {
//			history.go(-1); // added by MJ 28.07.00
//			BackHistoryCount--;
//		}
}
		return false;
	

}

function showcart(x,y){

	
		//alert('x='+x+'; y='+y+'\n innerHeight='+innerHeight); //NN only
		if(x&&y){
			flying_cart.setLeft(x-151);
			flying_cart.setTop(y-14);
		}
		flying_cart.setSrc('\\variables\cgi_url\?mode=shcart&step=1&frame=yes');
		cart_show('flying_cart','\\variables\cgi_url\?mode=shcart&step=1&frame=yes');
		return false;
	

}
function swapImages(img,fileSm, fileLg, widthSm, widthLg){
	if (img.src.indexOf('/small/') > 0){
		img.src=fileLg;
		img.alt="Уменьшить";
		img.width=widthLg;
	}else{
		img.src=fileSm;
		img.alt="Увеличить";
		img.width=widthSm;
	}
	return false;
}




