function createCartSummary(iFrameWidth, iFrameHeight) {
	document.write('<iframe width="' + iFrameWidth + '" height="' + iFrameHeight + '" name=cartsummary id=cartsummary marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=no src=http'); if(location.protocol == 'https:') 
	document.write('s'); 
	document.write('://www.shopcreator.com/mall/simplecartsummary.cfm?store=' + companyName + '></iframe>');
}

function refreshCartSummary(currency, bgColour) {
	// Currency expects a currency code like GBP, USD, EUR
	// bgColour is a hex colour for the background of the temporary page while it reloads
	//if (isDefined(top.frames['cartsummaryx'])) {
		var theURL = 'http://www.shopcreator.com/mall/SimpleCartSummaryCurrencyUpdater.cfm?store=' + companyName + '&currency=' + currency + '&bgcol=' + bgColour;
		top.frames['cartsummary'].location.replace(theURL);
	//}
}

function logout() {
	popup = window.open("https://www.shopcreator.com/mall/secure/Quicklogout.cfm?store=artondemand2","looutwin","height=100,width=100,top=2000,left=2000,scrollbars=no");
}

function login() {
	popup = window.open("https://www.shopcreator.com/mall/secure/QuickReg.cfm?store=artondemand2&amp;LOC_HEF=no&backto=tag.robbiewilliams.com/mall/infopageviewer.cfm?","regwin","height=620,width=588,top=10,left=10,scrollbars=yes");
	if (!popup) {
		alert("Sorry, you must have popup windows enabled for this site to log in.");
	}
}

function cartSummaryLink() {
	var backto; 
	window.location.href.lastIndexOf("tplsearchstore") > 0 ? backto = "/mall/departmentpage.cfm/" + companyName : backto = window.location.href;
	window.location.href = "https://www.shopcreator.com/mall/shopcreatorcart/shoppingcart.cfm?store=" + companyName + "&action=review&backto=" + backto;
}


function isDefined(variable) {
    return (typeof(window[variable]) == "undefined") ?  false : true;
}

function addtowishlist() {
	document.le_form.target = "_self";
	var newaction = window.location;
	document.le_form.action = newaction
	document.le_form.addproducttowishlist.value = "y";
	document.le_form.submit();
}

function viewcart(){
	if (document.le_form)
	{
		for(i=0;i<document.le_form.CurrencyCode.length;i++)
		{
			if (document.le_form.CurrencyCode[i].checked)
			{
				var thecurrency=document.le_form.CurrencyCode[i].value;
			}
		}
	}	
	else
	{
		tmpcookiename = "currency" + companyName;
		thecurrency=GetCookie(tmpcookiename.toUpperCase());	
	}
	location.href = httpscompanywebaddress + "/mall/shopcreatorcart/shoppingcart.cfm?store=" + companyName + "&action=review&CurrencyCode="+ thecurrency + "&backto=" + companyWebAddress;
}


function openhelp(){
	popup = window.open("/mall/infopageviewer.cfm/" + companyName + "/helpframer","","height=600,width=780, top=10, left=10, scrollbars=yes");
}

function openterms(){
	popup = window.open("/mall/infopageviewer.cfm/" + companyName + "/Terms","","height=450,width=510,top=10,left=10,scrollbars=yes");
}

function openPrivacyPolicy(){
	popup = window.open("/mall/infopageviewer.cfm/" + companyName + "/PrivacyPolicy","","height=450,width=445,top=10, left=10,scrollbars=yes");
}


function openyourimagepopup(store,prodid)
{
	popup = window.open("/mall/descriptionviewer.cfm?store=" + companyName + "&product=" + prodid ,"","height=220,width=420, top=10, left=10, scrollbars=no")
}

function openmedia()
{
	popup = window.open("/mall/infopageviewer.cfm?store=" + companyName + "&pagename=media","","height=460,width=650, top=10, left=10, scrollbars=no")
}

function openmedia2(){
	popup = window.open("/mall/infopageviewer.cfm?store=" + companyName + "&pagename=media2","","height=630,width=650, top=10, left=10, scrollbars=yes")
}

function whatis() {
	popup = window.open("/mall/infopageviewer.cfm?store=" + companyName + "&pagename=galleryexplained","","resizable=1,height=380,width=460, top=10, left=10, scrollbars=1");
}

function login() {
	popup = window.open("https://www.shopcreator.com/mall/secure/QuickReg.cfm?store=" + companyName + "&amp;LOC_HEF=no&backto=" + companyWebAddress + "/mall/infopageviewer.cfm?","regwin","height=650,width=588,top=10,left=10,scrollbars=yes");
	if (!popup) {
		alert("Please login");
	}
}

function openWallColour(){
	var srcImage = escape(document.images.previewimage.src);
	popup = window.open("/mall/" + companyName + "/wallcolour.htm?img=" + srcImage,"","height=480,width=612,top=10,left=10,scrollbars=no");
}


function jumpMenu(selObj){ //v3.0
	if(selObj.options[selObj.selectedIndex].value!=""){
		if(selObj.options[selObj.selectedIndex].value.indexOf('javascript')>-1){
			eval(selObj.options[selObj.selectedIndex].value);
		}else{
			eval("window.location='"+selObj.options[selObj.selectedIndex].value+"'");
		}
	}
}