function openWin(winName, url, winwidth, winheight){
	usrwidth = screen.width;
	usrheight = screen.height;

	var X = (usrwidth - winwidth) / 2;
	var Y = (usrheight - winheight) / 2;

	properties = "toolbar=no,location=no,directories=no,status=yes,scrollbars=yes,resizable=yes,copyhistory=no,width="+winwidth+",height="+winheight+",";

	checkie = navigator.appName.indexOf("icrosoft");
	if(checkie == -1)
		properties = properties+"screenX="+X+",screenY="+Y;
	else
		properties = properties+"left="+X+",top="+Y;
	
	if(winName == "basket"){
		if(top.tuning){
			top.tuning.basketWin = window.open(url,winName,properties);
			top.tuning.basketWin.focus();
		}else{
			basketWin = window.open(url,winName,properties);
			basketWin.focus();
		}
	}else{
		CheckWin = window.open(url,winName,properties);
		CheckWin.focus();
	}
}
var galDetailsWin = null;
function galDetails(url, winwidth, winheight){
	if(!galDetailsWin || galDetailsWin.closed){
		usrwidth = screen.width;
		usrheight = screen.height;
	
		var X = (usrwidth - winwidth) / 2;
		var Y = (usrheight - winheight) / 2;
	
		properties = "toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,copyhistory=no,width="+winwidth+",height="+winheight+",";
	
		checkie = navigator.appName.indexOf("icrosoft");
		if(checkie == -1)
			properties = properties+"screenX="+X+",screenY="+Y;
		else
			properties = properties+"left="+X+",top="+Y;
			
		galDetailsWin = window.open(url,'galDetailsWin',properties);
	}else{
		galDetailsWin.close();
		galDetails(url, winwidth, winheight);
	}
}
function updateImg(id, img){
	document[id].src = img;
	return;
}
function getCookie (coknam) {
	var doccok = document.cookie; 
	coknam = coknam + "=";
	var coklen = doccok.length;
	var cokbgn = 0;
	while (cokbgn < coklen) {
		var varbgn = cokbgn + coknam.length;
		if (doccok.substring(cokbgn, varbgn) == coknam) { 
		var varend = doccok.indexOf (";", varbgn);
		if (varend == -1) varend = coklen;
		return unescape(doccok.substring(varbgn, varend));
		}
		cokbgn = doccok.indexOf(" ", cokbgn) + 1;
		if (cokbgn == 0) break;
	}
	return "";
}
function setCookie (coknam, value, expires){
	if(!expires){
		expires = new Date();
		expires.setTime (expires.getTime() + (1000 * 60 * 60 * 24 * 31));
	}
	document.cookie = coknam + "=" + escape (value) + "; expires=" + expires.toGMTString() +  "; path=/";
	return null;
}