if(typeof deconcept=="undefined"){var deconcept=new Object();}
if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}
if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}
deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a,_b){
if(!document.createElement||!document.getElementById){return;}
this.DETECT_KEY=_b?_b:"detectflash";
this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);
this.params=new Object();
this.variables=new Object();
this.attributes=new Array();
if(_1){this.setAttribute("swf",_1);}
if(id){this.setAttribute("id",id);}
if(w){this.setAttribute("width",w);}
if(h){this.setAttribute("height",h);}
this.setAttribute("vmode","transparent");
if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}
this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion(this.getAttribute("version"),_7);
if(c){this.addParam("bgcolor",c);}
var q=_8?_8:"high";
this.addParam("quality",q);
this.setAttribute("useExpressInstall",_7);
this.setAttribute("doExpressInstall",false);
var _d=(_9)?_9:window.location;
this.setAttribute("xiRedirectUrl",_d);
this.setAttribute("redirectUrl","");
if(_a){this.setAttribute("redirectUrl",_a);}};
deconcept.SWFObject.prototype={setAttribute:function(_e,_f){
this.attributes[_e]=_f;
},getAttribute:function(_10){
return this.attributes[_10];
},addParam:function(_11,_12){
this.params[_11]=_12;
},getParams:function(){
return this.params;
},addVariable:function(_13,_14){
this.variables[_13]=_14;
},getVariable:function(_15){
return this.variables[_15];
},getVariables:function(){
return this.variables;
},getVariablePairs:function(){
var _16=new Array();
var key;
var _18=this.getVariables();
for(key in _18){
_16.push(key+"="+_18[key]);}
return _16;
},getSWFHTML:function(){
var _19="";
if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){
if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");}
_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\"";
_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";
var _1a=this.getParams();
for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}
var _1c=this.getVariablePairs().join("&");
if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}
_19+="/>";
}else{
if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");}
_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\">";
_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";
var _1d=this.getParams();
for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}
var _1f=this.getVariablePairs().join("&");
if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}
_19+="</object>";}
return _19;
},write:function(_20){
if(this.getAttribute("useExpressInstall")){
var _21=new deconcept.PlayerVersion([6,0,65]);
if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){
this.setAttribute("doExpressInstall",true);
this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));
document.title=document.title.slice(0,47)+" - Flash Player Installation";
this.addVariable("MMdoctitle",document.title);}}
if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){
var n=(typeof _20=="string")?document.getElementById(_20):_20;
n.innerHTML=this.getSWFHTML();
return true;
}else{
if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}
return false;}};
deconcept.SWFObjectUtil.getPlayerVersion=function(_23,_24){
var _25=new deconcept.PlayerVersion([0,0,0]);
if(navigator.plugins&&navigator.mimeTypes.length){
var x=navigator.plugins["Shockwave Flash"];
if(x&&x.description){_25=new deconcept.PlayerVersion(x.description.replace(/([a-z]|[A-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}
}else{try{
var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
for(var i=3;axo!=null;i++){
axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+i);
_25=new deconcept.PlayerVersion([i,0,0]);}}
catch(e){}
if(_23&&_25.major>_23.major){return _25;}
if(!_23||((_23.minor!=0||_23.rev!=0)&&_25.major==_23.major)||_25.major!=6||_24){
try{_25=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}
catch(e){}}}
return _25;};
deconcept.PlayerVersion=function(_29){
this.major=parseInt(_29[0])!=null?parseInt(_29[0]):0;
this.minor=parseInt(_29[1])||0;
this.rev=parseInt(_29[2])||0;};
deconcept.PlayerVersion.prototype.versionIsValid=function(fv){
if(this.major<fv.major){return false;}
if(this.major>fv.major){return true;}
if(this.minor<fv.minor){return false;}
if(this.minor>fv.minor){return true;}
if(this.rev<fv.rev){return false;}return true;};
deconcept.util={getRequestParameter:function(_2b){
var q=document.location.search||document.location.hash;
if(q){
var _2d=q.indexOf(_2b+"=");
var _2e=(q.indexOf("&",_2d)>-1)?q.indexOf("&",_2d):q.length;
if(q.length>1&&_2d>-1){
return q.substring(q.indexOf("=",_2d)+1,_2e);
}}return "";}};
if(Array.prototype.push==null){
Array.prototype.push=function(_2f){
this[this.length]=_2f;
return this.length;};}
var getQueryParamValue=deconcept.util.getRequestParameter;
var FlashObject=deconcept.SWFObject; // for backwards compatibility
var SWFObject=deconcept.SWFObject;


function echeck(str){
	var at="@";
	var dot=".";
	var lat=str.indexOf(at);
	var lstr=str.length;
	var ldot=str.indexOf(dot);
	if (str.indexOf(at)==-1){
	   return false;
	}
	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
	   return false;
	}
	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
	    return false;
	}
	if (str.indexOf(at,(lat+1))!=-1){
	    return false;
	}
	if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
	    return false;
	}
	if (str.indexOf(dot,(lat+2))==-1){
	    return false;
	}
	if (str.indexOf(" ")!=-1){
	    return false;
	}
	return true;
}


function toggleLayer(whichLayer,m){
	
	if (document.getElementById){
		var style2 = document.getElementById(whichLayer).style;
	}else if (document.all){
		var style2 = document.all[whichLayer].style;
	}else if (document.layers){
		var style2 = document.layers[whichLayer].style;
	}
	if (style2.display=="" && m==1){
		if (whichLayer=="searchbyartistwindow"){
			toggleLayer("searchbythemewindow",0);
			toggleLayer("searchbystylewindow",0);
		}else if(whichLayer=="searchbythemewindow"){
			toggleLayer("searchbyartistwindow",0);
			toggleLayer("searchbystylewindow",0);
		}else if(whichLayer=="searchbystylewindow"){
			toggleLayer("searchbyartistwindow",0);
			toggleLayer("searchbythemewindow",0);
		}
	}
	if (m==1){
		if (style2.display=="block"){
			style2.display='none';
			if (gblDisable=='latestnews'){
				document.getElementById("latestnewstxtinner").style.display = "block";
			}
			if (gblPage=='home' || gblPage=='story' || gblPage=='checkout'){  
				document.getElementById("gdlogo").style.display = "block";
			}
		}else{
			style2.display='block';
			if (gblDisable=='latestnews'){
				document.getElementById("latestnewstxtinner").style.display = "none";
			}
			if (gblPage=='home' || gblPage=='story' || gblPage=='checkout'){
				document.getElementById("gdlogo").style.display = "none";
			}
		}
		
	}else{
		style2.display = "";
	}
}
function toggleLayerOff(whichLayer,m){
	if (document.getElementById){
		var style2 = document.getElementById(whichLayer).style;
	}else if (document.all){
		var style2 = document.all[whichLayer].style;
	}else if (document.layers){
		var style2 = document.layers[whichLayer].style;
	}
	style2.display = "none";
	
	if (gblDisable=='latestnews'){
		document.getElementById("latestnewstxtinner").style.display = "block";
	}
	if (gblPage=='home'){
		document.getElementById("gdlogo").style.display = "block";
	}
}
function changeStyle(El,newStyle){
	El.className = newStyle;
}
function showShoppingAssistant(){
	//document.getElementById('');
}
function popupWindow(page,w,h){
	window.open(page,"clickpopup","menubar=no,width="+w+",height="+h+",toolbar=no");
}
function popWindow(url) {
	sealWin=window.open(url,"clickforart",'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=250,height=400');
	self.name = "keynoteWin";
}
function popbannerWindow(url) {
	sealWin=window.open(url,"clickforart",'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=450,height=400');
	self.name = "keynoteWin";
}
function togglePopups(whichWindow,m){
	if (document.getElementById){
		var style2 = document.getElementById(whichWindow).style;
	}else if (document.all){
		var style2 = document.all[whichWindow].style;
	}else if (document.layers){
		var style2 = document.layers[whichWindow].style;
	}
	if (style2.display=="" && m==1){
		if (whichWindow=="termswindowcont"){
			toggleLayer("privacywindowcont",0);
			toggleLayer("contactwindowcont",0);
			toggleLayer("assistantwindowcont",0);
		}else if(whichWindow=="privacywindowcont"){
			toggleLayer("termswindowcont",0);
			toggleLayer("contactwindowcont",0);
			toggleLayer("assistantwindowcont",0);
		}else if(whichWindow=="contactwindowcont"){
			toggleLayer("termswindowcont",0);
			toggleLayer("privacywindowcont",0);
			toggleLayer("assistantwindowcont",0);
		}else if(whichWindow=="assistantwindowcont"){
			toggleLayer("termswindowcont",0);
			toggleLayer("privacywindowcont",0);
			toggleLayer("contactwindowcont",0);
		}
	}
	if (m==1){
		if (style2.display=="block"){
			style2.display='none';
			if (document.OrderQuantity){
				document.OrderQuantity.BillingCountry.style.display = "block";
				document.OrderQuantity.ShippingCountry.style.display = "block";
			}
		}else{
			style2.display='block';
			if (document.OrderQuantity){
				document.OrderQuantity.BillingCountry.style.display = "none";
				document.OrderQuantity.ShippingCountry.style.display = "none";
			}
		}
		
	}else{
		style2.display = "";
		if (document.OrderQuantity){
			document.OrderQuantity.BillingCountry.style.display = "block";
			document.OrderQuantity.ShippingCountry.style.display = "block";
		}
	}
}

function toggleStoryText(whichStory,page,m,mainimage){
	//Turn off all
	turnoffStoryText("storyitem1txtinner");
	turnoffStoryText("storyitem2txtinner");
	turnoffStoryText("storyitem3txtinner");
	turnoffStoryText("storyitem4txtinner");
	
	if (document.getElementById){
		var style2 = document.getElementById(whichStory).style;
	}else if (document.all){
		var style2 = document.all[whichStory].style;
	}else if (document.layers){
		var style2 = document.layers[whichStory].style;
	}
	
	if (m==1){
		if (whichStory=="storyitem1txtinner"){
			document.getElementById("storyscrollheader").style.background='#c2397d url(/graphics/'+page+'header1.gif) no-repeat';
		}else if(whichStory=="storyitem2txtinner"){
			document.getElementById("storyscrollheader").style.background='#c2397d url(/graphics/'+page+'header2.gif) no-repeat';
		}else if(whichStory=="storyitem3txtinner"){
			document.getElementById("storyscrollheader").style.background='#c2397d url(/graphics/'+page+'header3.gif) no-repeat';
		}else if(whichStory=="storyitem4txtinner"){
			document.getElementById("storyscrollheader").style.background='#c2397d url(/graphics/'+page+'header4.gif) no-repeat';
		}
	}
	style2.display = "block";
	
	//clear paging
	document.getElementById("storyPaging").innerHTML = "";
	
	var arrMainImages = mainimage.split(",");
	for (x=1; x <= arrMainImages.length; x++){ 
		document.getElementById("storyPaging").innerHTML = "<a href=\"#\" onclick=\"storychangeMainImage('" + arrMainImages[x-1] + "')\">" + x + "</a>" + document.getElementById("storyPaging").innerHTML;
		if (x==1){
			document.storymainimage.src = '/graphics/' + arrMainImages[x-1];
		}
	}
	if (arrMainImages.length==1){
		document.getElementById("storyPaging").innerHTML = "";
	}
}
function storychangeMainImage(ImageIn){
	document.storymainimage.src = '/graphics/' + ImageIn;
}

function turnoffStoryText(whichStory){
	if (document.getElementById){
		var style2 = document.getElementById(whichStory).style;
	}else if (document.all){
		var style2 = document.all[whichStory].style;
	}else if (document.layers){
		var style2 = document.layers[whichStory].style;
	}
	style2.display = "none";
}

function preloadImages() {
      if (document.images) {
            for (var i = 0; i < preloadImages.arguments.length; i++) {
                  (new Image()).src = "/graphics/" + preloadImages.arguments[i];
            }
      }
}

function calcSubTotal(){
	var subTotal=0;
	var linePrice = 0;
	var lineQty = 0;
	var orderTotal = 0;
	var totalWeight = 0;
	
	var totalProducts = document.OrderQuantity.totalProducts.value;
	if (totalProducts > 0){
		for (var i = 1; i <= totalProducts; i++){
			lineQty = parseInt(document.getElementById('Qty'+i).value);
			eval("linePrice = parseInt(document.OrderQuantity.Price" + i + ".value);");
			subTotal = parseFloat(subTotal) + parseFloat(linePrice) * parseInt(lineQty);
			totalWeight = parseFloat(totalWeight) + (parseFloat(document.getElementById('Weight'+i).value) * parseInt(document.getElementById('Qty'+i).value));
		}
		document.getElementById('itemsTotal').innerHTML = "£"+subTotal.toFixed(2);
		document.OrderQuantity.hiddenItemTotal.value = subTotal.toFixed(2);
		document.OrderQuantity.hiddenTotalWeight.value = totalWeight;
		//document.getElementById('weightTotal').innerHTML = totalWeight;
	}
}

function ukSetMaxPrice(ukMaxPrice,newprice){
	if (ukMaxPrice <= newprice){
		return newprice;
	}else{
		return ukMaxPrice;
	}
}

function calcOrderTotals(){
	var frmIn = document.OrderQuantity;
	var selectedCountry="";
	var shippingDD=frmIn.ShippingCountry.value;
	var billingDD=frmIn.BillingCountry.value;
	var totalProducts=frmIn.hiddenTotalProducts.value;
	var selectedRegion="";
	var shippingCost=0.00;
	var lineHiddenSize;
	var lineHiddenFrame;
	var voucherDetected = 0;
	var printDetected = 0;
	var ukMaxPrice = 0;
	var ukProductCount = 0;

    
	for (var i = 0; i <= arrHSBCRegion.length-1; i++){
		if (frmIn.hiddenbillingasshipping.checked==true){
		    if (arrHSBCRegion[i][0]==billingDD){
			    selectedRegion = arrHSBCRegion[i][1];
		    }
		}else{
		    if (arrHSBCRegion[i][0]==shippingDD){
			    selectedRegion = arrHSBCRegion[i][1];
		    }
		}
	}

	for (var i = 0; i <= arrRegionPrice.length-1; i++){
		if (arrRegionPrice[i][0]==selectedRegion){
			shippingCost = parseFloat(arrRegionPrice[i][1]);
		}
	}


	if (selectedRegion=="UK"){
		shippingCost=0.00; 
		
		for (var i = 1; i <= totalProducts; i++){
			
			eval("lineHiddenFrame = frmIn.hiddenFrame"+i+".value");
			eval("lineHiddenSize = frmIn.hiddenSize"+i+".value");

			
			if(lineHiddenFrame==20 || lineHiddenFrame==21 || lineHiddenFrame==22){
				if (voucherDetected==0){
					shippingCost = shippingCost + 2.95;
					voucherDetected = 1;
				}
			}else if(lineHiddenFrame==10){
				if (printDetected==0){
					shippingCost = shippingCost + 6.95;
					printDetected = 1;
				}
			}else{
				eval("ukProductCount = ukProductCount + (parseInt(frmIn.hiddenQty"+i+".value))");
				
				if (lineHiddenFrame==1){
					if (lineHiddenSize==1 || lineHiddenSize == 10){
						ukMaxPrice = ukSetMaxPrice(ukMaxPrice,6.95);
					} else if (lineHiddenSize==9){
						ukMaxPrice = ukSetMaxPrice(ukMaxPrice,29.95);
					} else {
						ukMaxPrice = ukSetMaxPrice(ukMaxPrice,15.95);
					}
				} else if (lineHiddenFrame==18){
					ukMaxPrice = ukSetMaxPrice(ukMaxPrice,6.95);
				} else if (lineHiddenFrame==24 || lineHiddenFrame==25 || lineHiddenFrame==26){
					ukMaxPrice = ukSetMaxPrice(ukMaxPrice,3.95);
				} else if (lineHiddenSize==3 || lineHiddenSize==4 || lineHiddenSize==6 || lineHiddenSize==13){
					ukMaxPrice = ukSetMaxPrice(ukMaxPrice,19.95);
				}else{
					ukMaxPrice = ukSetMaxPrice(ukMaxPrice,15.95);
				}
			}
			
		}
		
		if (ukProductCount > 1){
			ukProductCount=ukProductCount-1;
			shippingCost = shippingCost + (6.95 * ukProductCount);
		}
		shippingCost = shippingCost + ukMaxPrice;
		
		
	}else{
		for (var i = 1; i <= totalProducts; i++){
			eval("lineHiddenFrame = frmIn.hiddenFrame"+i+".value");
			if (lineHiddenFrame==10){
				eval("shippingCost = shippingCost + (frmIn.hiddenQty"+i+".value * 6.95)");
			}else if (lineHiddenFrame==18){
				eval("shippingCost = shippingCost + (frmIn.hiddenQty"+i+".value * 9.95)");
			}else if((lineHiddenFrame==20 || lineHiddenFrame==21 || lineHiddenFrame==22) && voucherDetected == 0){
				voucherDetected = 1
				eval("shippingCost = shippingCost + 2.95");
			}else if (lineHiddenFrame==24){
				if(selectedRegion==14 || selectedRegion==9 || selectedRegion==10 || selectedRegion==11 || selectedRegion==12){
					eval("shippingCost = shippingCost + (frmIn.hiddenQty"+i+".value * 6.95)");
				}else{
					eval("shippingCost = shippingCost + (frmIn.hiddenQty"+i+".value * 15.95)");
				}	
			}else if (lineHiddenFrame==25 || lineHiddenFrame==26){
				if(selectedRegion==14){
					eval("shippingCost = shippingCost + (frmIn.hiddenQty"+i+".value * 6.95)");
				}else if(selectedRegion==16){
					eval("shippingCost = shippingCost + (frmIn.hiddenQty"+i+".value * 15.95)");
				}else{
					eval("shippingCost = shippingCost + (frmIn.hiddenQty"+i+".value * 9.95)");
				}	
			}
		}
	}
	
	// Shipping free on orders over (x)
	if (selectedRegion=="UK"){
		if (parseFloat(frmIn.hiddenSubTotal.value) > 30){
			shippingCost = 0;
		}
	}else if (selectedRegion==14){
		if (parseFloat(frmIn.hiddenSubTotal.value) > 150){
			shippingCost = 0;
		}
	}
	
	
	
	//Do sums
	var itemsTotal= parseFloat(frmIn.hiddenSubTotal.value);
	var percentageDiscount;
	percentageDiscount = 0;
	
	if (frmIn.hiddenPromoCode.value!=""){
		if (frmIn.hiddenPromoType.value=="per"){
			itemsTotal = itemsTotal - ((itemsTotal/100) * parseInt(frmIn.hiddenPromoVal.value)); //percentage
		}else if (frmIn.hiddenPromoType.value=="pri"){
			itemsTotal = itemsTotal - parseFloat(frmIn.hiddenPromoVal.value); // set price
		}
		document.getElementById('subTotalDiscount').innerHTML = "£" + itemsTotal.toFixed(2);
	}
	
	document.getElementById('shippingTotal').innerHTML = "£" + shippingCost.toFixed(2);
	frmIn.hiddenDeliveryCost.value = shippingCost.toFixed(2);
	var subTotal = parseFloat(shippingCost) + parseFloat(itemsTotal);
	
	pam = subTotal.toFixed(2);
	var arrPAM = pam.split('.');
	var pam = arrPAM[0].toString() + arrPAM[1].toString();
	frmIn.PurchaseAmount.value = pam;
	document.getElementById('grandTotal').innerHTML = "£" + subTotal.toFixed(2);
}

function calcSubTotal_OLD(){
	var subTotal=0;
	var linePrice = 0;
	var lineQty = 0;
	var totalNoVat = 0;
	var VAT = 17.5;
	var orderTotal = 0;
	
	var totalProducts = document.OrderQuantity.totalProducts.value;
	if (totalProducts > 0){
		for (var i = 1; i <= totalProducts; i++){
			lineQty = parseInt(document.getElementById('Qty'+i).value);
			eval("linePrice = parseInt(document.OrderQuantity.Price" + i + ".value);");
			subTotal = parseInt(subTotal) + parseInt(linePrice) * parseInt(lineQty);
			
		}
		totalNoVat = subTotal;
		VAT = VAT * totalNoVat / 100;
		orderTotal = VAT + totalNoVat;
		
		document.getElementById('subtotaldiv').innerHTML = "£"+subTotal.toFixed(2);
		document.getElementById('itemsTotal').innerHTML = "£"+subTotal.toFixed(2);
		document.getElementById('itemsTotalNoVat').innerHTML = "£"+totalNoVat.toFixed(2);
		document.getElementById('itemsVat').innerHTML = "£"+VAT.toFixed(2);
		document.getElementById('itemsGrandTotal').innerHTML = "£"+orderTotal.toFixed(2);
		
		//write totals to hidden field
		document.OrderQuantity.hiddenOrderTotal.value = orderTotal.toFixed(2);
		document.OrderQuantity.hiddenSubTotal.value = subTotal.toFixed(2);
		document.OrderQuantity.hiddenVAT.value = VAT.toFixed(2);
	}
}

function validateDetails(frmIn){
	var errStr = "";
	
	
	if (frmIn.BillingFirstName.value==""){
		errStr = errStr + " - Billing First Name is required \n";
	}
	if (frmIn.BillingLastName.value==""){
		errStr = errStr + " - Billing Last Name is required \n";
	}
	if (frmIn.BillingAddress1.value==""){
		errStr = errStr + " - Billing Address 1 is required \n";
	}
	if (frmIn.BillingCity.value==""){
		errStr = errStr + " - Billing City is required \n";
	}
	if (frmIn.BillingPostal.value==""){
		errStr = errStr + " - Billing Post Code is required \n";
	}
	if (frmIn.BillingCountry.value==""){
		errStr = errStr + " - Billing Country is required \n";
	}
	if (frmIn.hiddenTel.value==""){
			errStr = errStr + " - Telephone Number is required \n";
		}
	if (frmIn.ShopperEmail.value==""){
		errStr = errStr + " - Email Address is required \n";
	}else if (!emailcheck(frmIn.ShopperEmail.value)){
		errStr = errStr + " - Please enter a valid Email Address \n";
	}
	
	
	
	//If copy billing and no errors
	if (frmIn.hiddenbillingasshipping.checked == true && errStr==""){
		frmIn.ShippingFirstName.value = frmIn.BillingFirstName.value;
		frmIn.ShippingLastName.value = frmIn.BillingLastName.value;
		frmIn.ShippingAddress1.value = frmIn.BillingAddress1.value;
		frmIn.ShippingAddress2.value = frmIn.BillingAddress2.value;
		frmIn.ShippingCity.value = frmIn.BillingCity.value;
		frmIn.ShippingCounty.value = frmIn.BillingCounty.value;
		frmIn.ShippingPostal.value = frmIn.BillingPostal.value;
		//SORT OUT COUNTRY DROPDOWN
		frmIn.ShippingCountry.value = frmIn.BillingCountry.value;
	}else{
		if (frmIn.ShippingFirstName.value==""){
			errStr = errStr + " - Shipping First Name is required \n";
		}
		if (frmIn.ShippingLastName.value==""){
			errStr = errStr + " - Shipping Last Name is required \n";
		}
		if (frmIn.ShippingAddress1.value==""){
			errStr = errStr + " - Shipping Address 1 is required \n";
		}
		if (frmIn.ShippingCity.value==""){
			errStr = errStr + " - Shipping City is required \n";
		}
		if (frmIn.ShippingPostal.value==""){
			errStr = errStr + " - Shipping Post Code is required \n";
		}
		
		if (frmIn.ShippingCountry.value==""){
			errStr = errStr + " - Shipping Country is required \n";
		}
		
	}
	
	if (errStr=="" && frmIn.hiddenterms.checked==false){
		errStr = " - Please confirm that you agree to our terms and conditions";
	}
	
	if (errStr!=""){
		alert("The following form information is required or incorrect\n" + errStr);
		return false;
	} else {
		return true;
	}
}

function emailcheck(str) {
	var at="@"
	var dot="."
	var quote="'"
	var comma=","
	var scomma=";"
	var lat=str.indexOf(at)
	var lstr=str.length
	var ldot=str.indexOf(dot)
	
	if (str.indexOf(quote)!=-1){
	   return false
	}
	if (str.indexOf(comma)!=-1){
	   return false
	}
	if (str.indexOf(scomma)!=-1){
	   return false
	}			
	if (str.indexOf(at)==-1){
	   return false
	}
	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
	   return false
	}
	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
	    return false
	}
	if (str.indexOf(at,(lat+1))!=-1){
	    return false
	}
	if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
	    return false
	}
	if (str.indexOf(dot,(lat+2))==-1){
	    return false
	}
	if (str.indexOf(" ")!=-1){
	    return false
	}
	return true					
}
function populateShipping(El){
	var frmIn = document.OrderQuantity;
	if (El.checked==true){
		frmIn.ShippingFirstName.value = frmIn.BillingFirstName.value;
		frmIn.ShippingLastName.value = frmIn.BillingLastName.value;
		frmIn.ShippingAddress1.value = frmIn.BillingAddress1.value;
		frmIn.ShippingAddress2.value = frmIn.BillingAddress2.value;
		frmIn.ShippingCity.value = frmIn.BillingCity.value;
		frmIn.ShippingCounty.value = frmIn.BillingCounty.value;
		frmIn.ShippingPostal.value = frmIn.BillingPostal.value;
		
		//SORT OUT COUNTRY DROPDOWN
		frmIn.ShippingCountry.value = frmIn.BillingCountry.value;
		
		calcOrderTotals('shipping');
	}else{
		frmIn.BillingCountry.value = frmIn.ShippingCountry.value;
		
		calcOrderTotals('shipping');
	}
}