function PopupPic(sPicURL) {
	window.open( "/+/_js/popup.htm?"+sPicURL, "", "resizable=1,HEIGHT=200,WIDTH=200");
}

function zoom(img) {
	var win = window.open('','preview','width=700,height=700,left=0,top=0,screenX=0,screenY=0,resizable=1,scrollbar=0,status=0');
	var winDoc = win.document;
	var content = '<html><body style="margin:0; padding:0"><table width="700" height="700"><tr><td style="text-align:center">' +
	'<img alt="" id="image" src="' + img + '" /></td></tr></table></body></html>';
	win.document.write(content);
	if (winDoc.body) {
	winDoc.body.onload = function() {
		var obj = winDoc.getElementById('image');
		var w = obj.width, h = obj.height;
		var iHeight= document.body.clientHeight, iWidth = self.innerWidth;
		var left = (self.opera ? iWidth : screen.availWidth)/2 - w/2;
		var top = (self.opera ? iHeight : screen.availHeight)/2 - h/2;
		win.resizeTo(w+10+2*shift/10, h+26+2*shift/10+shift*1.5);
		/* win.moveTo(left, top); */
	}
	//win.onload = winDoc.body.onload();
	}	

	win.document.close();
	win.focus();
	return false;
}

function zoom2(img,w,h) {
	var win = window.open('','preview','width='+w+',height='+h+',left=0,top=0,screenX=0,screenY=0,resizable=1,scrollbar=0,status=0');
	var winDoc = win.document;
	var content = '<html><body style="margin:0; padding:0">' +
	'<img alt="" id="image" src="' + img + '" /></body></html>';
	win.document.write(content);
	if (winDoc.body) {
	winDoc.body.onload = function() {
		var obj = winDoc.getElementById('image');
		var w = obj.width, h = obj.height;
		var iHeight= document.body.clientHeight, iWidth = self.innerWidth;
		var left = (self.opera ? iWidth : screen.availWidth)/2 - w/2;
		var top = (self.opera ? iHeight : screen.availHeight)/2 - h/2;
		win.resizeTo(w+10+2*shift/10, h+26+2*shift/10+shift*1.5);
		/* win.moveTo(left, top); */
	}
	//win.onload = winDoc.body.onload();
	}	

	win.document.close();
	win.focus();
	return false;
}

function zoom_title(img,title) {
	var win = window.open('','preview','width=700,height=700,left=0,top=0,screenX=0,screenY=0,resizable=1,scrollbar=0,status=0');
	var winDoc = win.document;
	var a = title.indexOf('.jpg');
	if (a!=-1) title = title.substring(0,a);
	
	var content = '<html><body><link rel="stylesheet" type="text/css" href="/+/_css/main.css" /><table width="700" height="700"><tr><td style="text-align:center">' +
	'<h1>'+title+'</h1><img alt="" id="image" src="' + img + '" /></td></tr></table></body></html>';
	win.document.write(content);
	if (winDoc.body) {
	winDoc.body.onload = function() {
		var obj = winDoc.getElementById('image');
		var w = obj.width, h = obj.height;
		var iHeight= document.body.clientHeight, iWidth = self.innerWidth;
		var left = (self.opera ? iWidth : screen.availWidth)/2 - w/2;
		var top = (self.opera ? iHeight : screen.availHeight)/2 - h/2;
		win.resizeTo(w+10+2*shift/10, h+26+2*shift/10+shift*1.5);
		/* win.moveTo(left, top); */
	}
	//win.onload = winDoc.body.onload();
	}	

	win.document.close();
	win.focus();
	return false;
}

function zoom_texture(img) {
	var win = window.open('','preview','width=550,height=570,left=0,top=0,screenX=0,screenY=0,resizable=1,scrollbar=0,status=0');
	var winDoc = win.document;
	var content = '<html><body style="margin:0; padding:0"><table height="570" align="center"><tr><td><img alt="" id="image" src="' + img + '" /></td></tr></table></body></html>';
	win.document.write(content);
	win.document.close();
	win.focus();
	return false;
}

function zoom_bigimg(imgid) {
//	var o = document.getElementById('bigimg');
//	o.src = img;
	var big = document.getElementById('bigimg');
	var theimg = document.getElementById(imgid);
	var theold = document.getElementById(oldopen);
	thesrc = theimg.src;
	thesrc = thesrc.substring(0,thesrc.indexOf('/small'))+thesrc.substring(thesrc.indexOf('/small')+6);
	big.src = thesrc;
	theimg.className = "selected";
	theold.className = "";
	oldopen = imgid;
	return false;
}

function zoom_products(what) {
	if (what.substring(what.length-3)!='jpg') what = ''+ what + '&popup';
	//alert(what.length-3);
	//alert(what);
	var win = window.open(what,'','width=500,height=500,left=0,top=0,screenX=0,screenY=0,resizable=1,scrollbar=1,status=0');
	win.focus();
	return false;
}

