if(!typeof(w3url)=='string'||typeof(w3url)=='undefined'||!w3url.substring(0,4)=='http') {
	var w3url; // this should come in from user web page but if not, set it to default w3shoppingcart
	(location.href.substring(0,5)=="https")?w3url="https://w3safesecure.com/w3shoppingcart":w3url="http://www.w3shoppingcart.com";	 
} 
// for new popup images in css / js
document.write('<link rel="stylesheet" type="text/css" href="'+w3url+'/srv/css/preview_templates.css">');
document.write('<sc');document.write('ript language="javascript" type="text/javascript" src="'+w3url+'/srv/js/loader.js"></s');document.write('cript>');
document.write('<sc');document.write('ript language="javascript" type="text/javascript" src="'+w3url+'/srv/js/preview_templates.js"></s');document.write('cript>');
// for validating forms:
document.write('<sc');document.write('ript language="javascript" type="text/javascript" src="'+w3url+'/srv/js/master.js"></s');document.write('cript>');
// vars for create target js vars
var myHeight = self.screen.height-25;
var myWidth = 660;
var isResizable = true;    
function sForm(theForm) {  // pop
	if (!formValidate(theForm)) return false;
	createTarget(theForm);
	return true; 
} 
function sFormFull(theForm) {  // full and frame-in
	if (!formValidate(theForm)) return false; 
	return true; 
} 
function createTarget(form) {  
	form.target = "foobar";// change the target of the form
	var attribs="height="+myHeight+",width="+myWidth+",left=0,top=0,scrollbars=1,menu=0,location=0,toolbar=1,resizable=1,status=1";
	var zwin = window.open("",form.target,attribs);  
	if(typeof(focus)=="function") zwin.focus();	 
	return true;
} 
function popUpImage(sImgPath, iImgW, iImgH, windo, idescr) { 
	if (!windo) windo='wr' + Math.floor(Math.random()*10001); // random number 0 - 10000
	var zPopWidth=iImgW+20;
	var zPopHeight=iImgH+75; 
	var hasDescription=false; 
	if (idescr && idescr.length > 0) {
		hasDescription=true;
		zPopHeight=zPopHeight+35;
	}
	// align center screen
	var pTop=  (screen.height - (zPopHeight+50)) / 2; // wTop = document.body.scrollTop+50;  
	var pLeft =  (screen.width - (zPopWidth+50)) / 2;    
	var sHeader = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n<html>\n<head>\n<title>Enlarged Image</title>\n<script language=\"javascript\" type=\"text/javascript\">\n<!--\nwindow.focus();\n//-->\n</script></head>\n<body>\n"; 
	var sFooter = "</body>\n</html>";
	var oWin = window.open(windo, null, "width=" + zPopWidth + ",height=" + zPopHeight + ",left=" + pLeft + ",top=" + pTop + ",directories=0,location=0,menubar=0,resizable=1,scrollbars=0,status=0,toolbar=0"); 
	oWin.document.open();
	oWin.document.write(sHeader);
	if (hasDescription)  {
		oWin.document.write("<div align=left style=\"font-family:arial,helvetica,sans-serif;font-size:12px;color:black;margin-bottom:2px;\">" + idescr + "</div>\n"); 
	}
	oWin.document.write("<div align=center><IMG SRC=\"" + sImgPath + "\" width=" + iImgW + " height=" + iImgH + ">\n"); 
	oWin.document.write("<div style=\"margin:3px;\"><a href=\"javascript:window.close();\" style=\"font-size:10px;font-weight:normal;font-family:arial,helvetica,sans-serif;color:blue\">CLOSE WINDOW</a></div></div>");
	oWin.document.write(sFooter);
	oWin.document.close();
}  
function switchCatGroup(group) {  
	if (document.getElementById) {
		ck_navgp="navDiv" + group;
		ck_bodgp="group" + group;
		ck_nav=document.getElementById(ck_navgp).innerHTML;
		ck_bod=document.getElementById(ck_bodgp).innerHTML;
		document.getElementById("navDivTop").innerHTML=ck_nav;
		document.getElementById("navDivBottom").innerHTML=ck_nav;
		document.getElementById("prodDiv").innerHTML=ck_bod;
	}
	else {
		ck_navTop="navDivTop.innerHTML=navDiv" + group + ".innerHTML";
		ck_navBottom="navDivBottom.innerHTML=navDiv" + group + ".innerHTML";
		ck_bod="prodDiv.innerHTML=group" + group + ".innerHTML";
		eval(ck_bod);
		eval(ck_navTop);
		eval(ck_navBottom);
	}
}   

