function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function loadCardTypes(){//loads credit card values if the acceptFee check box is checked
		document.frmCalculate.cardType.options[0] = new Option(' CREDIT ',' CREDIT ');
		document.frmCalculate.cardType.options[1] = new Option(' DEBIT ',' DEBIT ');
}

function copyAddress() { // copy address to shipping
	var frm;
	
	frm = document.frmCalculate;
	frm.shipName.value = frm.name.value;
	frm.shipAddress.value = frm.address.value;
	frm.shipTown.value = frm.town.value;
	frm.shipCounty.value = frm.county.value;
	frm.shipPostcode.value = frm.postcode.value;
	frm.shipTelephone.value = frm.telephone.value;
	frm.shipEmail.value = frm.email.value;
}

function validateForm() { // validate form input
  var i,p,q,nm,test,num,min,max,errors='',args=validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  else{ orderValidation(); }
  //document.returnValue = (errors == '');
  //alert('returned ok');
}
function checkCardLength(){
	var cardLength, frm;
	frm = document.frmCalculate;
	cardLength = frm.cardnumber.value
	if (cardLength.length < 16){
		alert('Incorrect Card Number Entered\nPlease enter the 16 (plus) digit code\nacross the center of your card.');
	}

}

function fixCurrency(nValue) { // round and fix decimal places
	nValue = Math.round(nValue * 100)/100;
	if (nValue == Math.floor(nValue)) {
		nValue = nValue + '.00';
	} else if (nValue * 10 == Math.floor(nValue * 10)) {
		nValue = nValue + '0';
	}
	return(nValue);
}

function calculateShipping(nWeightOfOrder,iMultiplier) { // calculate oversea shipping costs
	var nCostOfShipping;

	// the following calculation takes the weight of the order in kilograms and divides it
	// by the threshold for charging (26kilograms). The resulting number is rounded down to
	// an integer to produce the following (if order less than 26kilos) 1 x multiplier (shipping rate)
	// or if between 26-52kilos 2 x multiplier etc etc.
	nCostOfShipping = (Math.floor(nWeightOfOrder / 25.5) + 1) * iMultiplier;
	return nCostOfShipping;
}

function calculateValues() { // calculate costs and weight
	var frm;
	var iQuantityA1, iQuantityB1, iQuantityC1;
	var iQuantityA2, iQuantityB2, iQuantityC2;
	var iQuantityA4, iQuantityB4, iQuantityC4;
	var iQuantityA5, iQuantityB5, iQuantityC5;
	var iQuantityA6, iQuantityB6, iQuantityC6;
	var iQuantityA7, iQuantityB7, iQuantityC7;
	var nCostA1, nCostB1, nCostC1;
	var nCostA2, nCostB2, nCostC2;
	var nCostA4, nCostB4, nCostC4;
	var nCostA5, nCostB5, nCostC5;
	var nCostA6, nCostB6, nCostC6;
	var nCostA7, nCostB7, nCostC7;
	var nWeightA1, nWeightB1, nWeightC1;
	var nWeightA4, nWeightB4, nWeightC4;
    var nTotalWeight;
    var nCost, nShipping, nVAT, nTotal, nSurcharge;
    
	frm = document.frmCalculate;
	iQuantityA1 = frm.A1.value * 1;
	iQuantityB1 = frm.B1.value * 1;
	iQuantityC1 = frm.C1.value * 1;
	iQuantityA2 = frm.A2.value * 1;
	iQuantityB2 = frm.B2.value * 1;
	iQuantityC2 = frm.C2.value * 1;
	iQuantityA4 = frm.A4.value * 1;
	iQuantityB4 = frm.B4.value * 1;
	iQuantityC4 = frm.C4.value * 1;
	iQuantityA5 = frm.A5.value * 1;
	iQuantityB5 = frm.B5.value * 1;
	iQuantityC5 = frm.C5.value * 1;
	iQuantityA6 = frm.A6.value * 1;
	iQuantityB6 = frm.B6.value * 1;
	iQuantityC6 = frm.C6.value * 1;
	iQuantityA7 = frm.A7.value * 1;
	iQuantityB7 = frm.B7.value * 1;
	iQuantityC7 = frm.C7.value * 1;
	
	nCostA1 = iQuantityA1 * 28.25;
	nCostB1 = iQuantityB1 * 32.25;
	nCostC1 = iQuantityC1 * 35.00;
	nCostA2 = iQuantityA2 * 28.25;
	nCostB2 = iQuantityB2 * 32.25;
	nCostC2 = iQuantityC2 * 35.00;
	nCostA4 = iQuantityA4 * 34.00;
	nCostB4 = iQuantityB4 * 39.25;
	nCostC4 = iQuantityC4 * 43.75;
	nCostA5 = iQuantityA5 * 28.25;
	nCostB5 = iQuantityB5 * 32.25;
	nCostC5 = iQuantityC5 * 35.00;
	nCostA6 = iQuantityA6 * 28.25;
	nCostB6 = iQuantityB6 * 32.25;
	nCostC6 = iQuantityC6 * 35.00;
	nCostA7 = iQuantityA7 * 28.25;
	nCostB7 = iQuantityB7 * 32.25;
	nCostC7 = iQuantityC7 * 35.00;
	nCost = nCostA1 + nCostB1 + nCostC1 + nCostA2 + nCostB2 + nCostC2 + nCostA4 + nCostB4 + nCostC4 + nCostA5 + nCostB5 + nCostC5 + nCostA6 + nCostB6 + nCostC6 + nCostA7 + nCostB7 + nCostC7;

	nWeightA1 = (iQuantityA1 + iQuantityA2 + iQuantityA5 + iQuantityA6 + iQuantityA7) * 5.5;
	nWeightB1 = (iQuantityB1 + iQuantityB2 + iQuantityB5 + iQuantityB6 + iQuantityB7) * 7;
	nWeightC1 = (iQuantityC1 + iQuantityC2 + iQuantityC5 + iQuantityC6 + iQuantityC7) * 8.5;
	nWeightA4 = iQuantityA4 * 8;
	nWeightB4 = iQuantityB4 * 10.5;
	nWeightC4 = iQuantityC4 * 13;
	nTotalWeight = nWeightA1 + nWeightB1 + nWeightC1 + nWeightA4 + nWeightB4 + nWeightC4;
	
	if (nTotalWeight < 29) {
			nShipping = 11.61;} 
	else if (nTotalWeight < 57) {
				nShipping = 24.33;} 
	else if (nTotalWeight < 85) {
				nShipping = 37.05;} 
	else if (nTotalWeight < 113) {
				nShipping = 49.77;} 
	else if (nTotalWeight <= 136) {
				nShipping = 57.19;}
	else {
				alert('Thank you for your order.\nYour order is over the 136 kgs package rate.\nPlease telephone 01453 731717 to obtain a special delivery rate.\nOtherwise please go to the UK Contact page to email us your requirement.');
				nShipping = 0;}
	
	nVAT = ((nCost + nShipping) / 100) * 17.5;
	nTotal = nShipping + nCost + nVAT;
	
	if(frm.cardType.options[frm.cardType.selectedIndex].value == ' CREDIT '){//adds 1.65% surcharge if customer is paying by credit/charge card
		nSurcharge = ((nTotal) / 100) * 1.65;}
	else{nSurcharge = 0;}
	
	nTotal = nTotal + nSurcharge;
	
	frm.cost.value = fixCurrency(nCost);
	frm.weight.value = nTotalWeight;
	frm.shipping.value = fixCurrency(nShipping);
	frm.surcharge.value = fixCurrency(nSurcharge);
	frm.vat.value = fixCurrency(nVAT);
	frm.total.value = fixCurrency(nTotal);
}

function orderValidation() { // get customer to validate order before it is processed

	var a1, a2, a4, a5, a6, a7, b1, b2, b4, b5, b6, b7, c1, c2, c4, c5, c6, c7;
	a1 = document.frmCalculate.A1.value;
	a2 = document.frmCalculate.A2.value;
	a4 = document.frmCalculate.A4.value;
	a5 = document.frmCalculate.A5.value;
	a6 = document.frmCalculate.A6.value;
	a7 = document.frmCalculate.A7.value;
	b1 = document.frmCalculate.B1.value;
	b2 = document.frmCalculate.B2.value;
	b4 = document.frmCalculate.B4.value;
	b5 = document.frmCalculate.B5.value;
	b6 = document.frmCalculate.B6.value;
	b7 = document.frmCalculate.B7.value;
	c1 = document.frmCalculate.C1.value;
	c2 = document.frmCalculate.C2.value;
	c4 = document.frmCalculate.C4.value;
	c5 = document.frmCalculate.C5.value;
	c6 = document.frmCalculate.C6.value;
	c7 = document.frmCalculate.C7.value;
		
	var newWindow;
	newWindow = window.open("", "", "status,height=680,width=780");
	newWindow.focus();
	
	var newContent;
	newContent = "<html><head><link href='inc/order.css' rel='stylesheet' type='text/css' media='screen' /><link href='inc/print.css' rel='stylesheet' type='text/css' media='print' /><title>EverEdge - Order Validation</title><style type='text/css'>table{background-repeat: no-repeat;border-collapse: collapse;}</style></head><body>";
	newContent += "<table border='0' width='760' height='123' cellpadding='0' cellspacing='0' background='images/background_top.jpg'>";
	newContent += "<tr>";
	newContent += "<td colspan='2' height='103' width='163'>";
	newContent += "<object classid='clsid:D27CDB6E-AE6D-11CF-96B8-444553540000' id='obj1' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0' border='0' width='163' height='103'>";
	newContent += "<param name='movie' value='images/top_left_image_loop.swf'>";
	newContent += "<param name='quality' value='High'>";
	newContent += "<embed src='images/top_left_image_loop.swf' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' name='obj1' width='163' height='103'></object>";
	newContent += "</td>";
	newContent += "<td width='434'>";		
	newContent += "<table width='100%'>";
	newContent += "<tr>";
	newContent += "<td  colspan='2' height='42'>";
	newContent += "&nbsp;";
	newContent += "</td>";
	newContent += "</tr>";
	newContent += "<tr>";
	newContent += "<td width='86'>&nbsp;</td>";
	newContent += "<td>";
	newContent += "<img border='0' src='images/order_confirmation.jpg' width='220' height='36'></td>";
	newContent += "</tr>";		
	newContent += "</table>";
	newContent += "</td>";
	newContent += "<td width='163'>";
	newContent += "<img border='0' src='images/everedge_logo.jpg' width='163' height='103'></td>";
	newContent += "</tr>";
	newContent += "<tr>";
	newContent += "<td colspan='4'><img src='images/WideBar2.jpg' alt=''></td>";
	newContent += "</tr>";
	newContent += "</table>";
	newContent += "<table border='0' width='760' height='477' cellpadding='0' cellspacing='0' background='images/background_bottom.jpg'>";
	newContent += "<tr>";
	newContent += "<td width='145'>&nbsp;</td>";
	newContent += "<td><font face='Arial'><font size='1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Dear " + document.frmCalculate.name.value + " <br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Please confirm your order<br><br>";
	
	if(a1 != "" || b1 != "" || c1 != ""){
		newContent += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Classic Brown 1.6mm<br>";
	}
	if(a1 != ""){
		newContent += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SIZE A1\t75mm (3"+ '"' +") Depth @ £28.25 per pack.   " + a1 + " pack(s) ordered<br>"};
	if(b1 != ""){
		newContent += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SIZE B1\t100mm (4"+ '"' +") Depth @ £32.25 per pack.   " + b1 + " pack(s) ordered<br>"};
	if(c1 != ""){
		newContent += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SIZE C1\t125mm (5"+ '"' +") Depth @ £35.00 per pack.   " + c1 + " pack(s) ordered"};
	
	if(a4 != "" || b4 != "" || c4 != ""){
		newContent += "<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Heavy Duty 2.5mm<br>";
	}
	if(a4 != ""){
		newContent += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SIZE A4\t75mm (3"+ '"' +") Depth @ £34.00 per pack.   " + a4 + " pack(s) ordered<br>"};
	if(b4 != ""){
		newContent += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SIZE B4\t100mm (4"+ '"' +") Depth @ £39.25 per pack.   " + b4 + " pack(s) ordered<br>"};
	if(c4 != ""){
		newContent += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SIZE C4\t125mm (5"+ '"' +") Depth @ £43.75 per pack.   " + c4 + " pack(s) ordered"};

	if(a2 != "" || b2 != "" || c2 != ""){
		newContent += "<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Classic Unpainted 1.6mm<br>";
	}
	if(a2 != ""){
		newContent += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SIZE A2\t75mm (3"+ '"' +") Depth @ £28.25 per pack.   " + a2 + " pack(s) ordered<br>"};
	if(b2 != ""){
		newContent += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SIZE B2\t100mm (4"+ '"' +") Depth @ £32.25 per pack.   " + b2 + " pack(s) ordered<br>"};
	if(c2 != ""){
		newContent += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SIZE C2\t125mm (5"+ '"' +") Depth @ £35.00 per pack.   " + c2 + " pack(s) ordered"};

	if(a5 != "" || b5 != "" || c5 != ""){
		newContent += "<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Classic Black 1.6mm<br>";
	}
	if(a5 != ""){
		newContent += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SIZE A5\t75mm (3"+ '"' +") Depth @ £28.25 per pack.   " + a5 + " pack(s) ordered<br>"};
	if(b5 != ""){
		newContent += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SIZE B5\t100mm (4"+ '"' +") Depth @ £32.25 per pack.   " + b5 + " pack(s) ordered<br>"};
	if(c5 != ""){
		newContent += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SIZE C5\t125mm (5"+ '"' +") Depth @ £35.00 per pack.   " + c5 + " pack(s) ordered"};

	if(a6 != "" || b6 != "" || c6 != ""){
		newContent += "<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Classic Green 1.6mm<br>";
	}
	if(a6 != ""){
		newContent += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SIZE A6\t75mm (3"+ '"' +") Depth @ £28.25 per pack.   " + a6 + " pack(s) ordered<br>"};
	if(b6 != ""){
		newContent += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SIZE B6\t100mm (4"+ '"' +") Depth @ £32.25 per pack.   " + b6 + " pack(s) ordered<br>"};
	if(c6 != ""){
		newContent += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SIZE C6\t125mm (5"+ '"' +") Depth @ £35.00 per pack.   " + c6 + " pack(s) ordered<br><br>"};
		
	if(a7 != "" || b7 != "" || c7 != ""){
		newContent += "<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Classic Slate 1.6mm<br>";
	}
	if(a7 != ""){
		newContent += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SIZE A7\t75mm (3"+ '"' +") Depth @ £28.25 per pack.   " + a7 + " pack(s) ordered<br>"};
	if(b7 != ""){
		newContent += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SIZE B7\t100mm (4"+ '"' +") Depth @ £32.25 per pack.   " + b7 + " pack(s) ordered<br>"};
	if(c7 != ""){
		newContent += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SIZE C7\t125mm (5"+ '"' +") Depth @ £35.00 per pack.   " + c7 + " pack(s) ordered<br><br>"};

	if(a1 != "" || b1 != "" || c1 != "" || a4 != "" || b4 != "" || c4 != "" || a2 != "" || b2 != "" || c2 != "" || a5 != "" || b5 != "" || c5 != "" || a6 != "" || b6 != "" || c6 != "" || a7 != "" || b7 != "" || c7 != ""){
		newContent += "<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Cost £" + document.frmCalculate.cost.value + "<br>";
		newContent += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Total Weight: Kilos " + document.frmCalculate.weight.value + "<br>";
		newContent += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Shipping Cost £" + document.frmCalculate.shipping.value + "<br>";
		
		newContent += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;VAT £" + document.frmCalculate.vat.value + "<br><br>";
		
		if(document.frmCalculate.surcharge.value != "0.00"){
			newContent += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Credit Card Fee £" + document.frmCalculate.surcharge.value + "&nbsp;&nbsp;&nbsp;<font color='#FF0000'>You have accepted the 1.65% Credit/Charge card fee.</font><br>";
		}
		newContent += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Total Cost £" + document.frmCalculate.total.value + "<br><br><br>";
	}
	
	newContent += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type='button' value='Accept' name='accept' onclick='opener.document.frmCalculate.submit();window.close();'>&nbsp;&nbsp;<input type='button' value='Decline' name='decline' onclick='opener.document.frmCalculate.reset(); window.close();'>";

	newContent += "	</font></td>";
	newContent += "<td>&nbsp;</td>";
	newContent += "</tr>";
	newContent += "<tr>";
	newContent += "<td width='145' rowspan='2'>&nbsp;</td>";
	newContent += "<td rowspan='2'>&nbsp;</td>";
	newContent += "<td>&nbsp;</td>";
	newContent += "</tr>";
	newContent += "<tr>";
	newContent += "<td>&nbsp;</td>";
	newContent += "</tr>";
	newContent += "</table></body></html>";
	
	newWindow.document.write(newContent);
	newWindow.document.close();
}

function checkPostCode(){ // check to see if postcode is valid for standard delivery
	var postcode, code, letters, upperCaseLetters, numbers;
	code = document.frmCalculate.postcode.value;
	letters = code.substr(0,2);
	upperCaseLetters = letters.toUpperCase();
	numbers = code.substr(2,2);
	postcode = upperCaseLetters + numbers;
	
	if(upperCaseLetters == 'BT')
	{
		postCodeMessage();
	}
	
	var postCodesToCheck = new Array('AB31','AB32','AB33','AB34','AB35','AB36','AB37','AB38','AB41','AB42','AB43','AB44','AB45',
										'AB51','AB52','AB53','AB54','AB55','AB56','FK1','FK2','FK3','FK4','FK5','FK6','FK7','FK8',
										'FK9','FK10','FK11','FK12','FK13','FK14','FK15','FK16','FK17','FK18','FK19','FK20','FK21',
										'IV1','IV2','IV3','IV4','IV5','IV6','IV7','IV8','IV9','IV10','IV11','IV12','IV13','IV14',
										'IV15','IV16','IV17','IV18','IV19','IV20','IV21','IV22','IV23','IV24','IV25','IV26','IV27',
										'IV28','IV30','IV31','IV32','IV36','IV41','IV42','IV43','IV44','IV45','IV46','IV47','IV48',
										'IV49','IV51','IV52','IV53','IV54','IV55','IV56','IV63','KW1','KW2','KW3','KW5','KW6','KW7',
										'KW8','KW9','KW10','KW11','KW12','KW13','KW14','KW15','KW16','KW17','PA20','PA21','PA22',
										'PA23','PA24','PA25','PA26','PA27','PA28','PA29','PA30','PA31','PA32','PA33','PA34','PA35',
										'PA36','PA37','PA38','PA41','PA42','PA43','PA44','PA45','PA46','PA47','PA48','PA49','PA60',
										'PA61','PA62','PA63','PA64','PA65','PA66','PA67','PA68','PA69','PA71','PA72','PA73','PA74',
										'PA75','PA76','PA77','PA78','PH1','PH5','PH6','PH7','PH8','PH9','PH10','PH15','PH16','PH17',
										'PH18','PH19','PH20','PH21','PH22','PH23','PH24','PH25','PH26','PH30','PH31','PH32','PH33',
										'PH34','PH35','PH36','PH37','PH38','PH39','PH40','PH41','PH42','PH43','PH44','PH49','PH50',
										'ZE1','ZE2','ZE3','HS1','HS2','HS3','HS4','HS5','HS6','HS7','HS8','HS9','KA27','KA28','TR21',
										'TR22','TR23','TR24','TR25','IM1','IM2','IM3','IM4','IM5','IM6','IM7','IM8','IM9','PO30',
										'PO31','PO32','PO33','PO34','PO35','PO36','PO37','PO38','PO39','PO40');
 
 	for( var i = 0; i < postCodesToCheck.length; i++)
	{
		if(postcode == postCodesToCheck[i])
		{
			postCodeMessage();		
		}
	}

}
function checkPostCode1(){ // check to see if postcode is valid for standard delivery
	var postcode, code, letters, upperCaseLetters, numbers;
	code = document.frmCalculate.shipPostcode.value;
	letters = code.substr(0,2);
	upperCaseLetters = letters.toUpperCase();
	numbers = code.substr(2,2);
	postcode = upperCaseLetters + numbers;
	
	
	
	var postCodesToCheck = new Array('AB31','AB32','AB33','AB34','AB35','AB36','AB37','AB38','AB41','AB42','AB43','AB44','AB45',
										'AB51','AB52','AB53','AB54','AB55','AB56','FK1','FK2','FK3','FK4','FK5','FK6','FK7','FK8',
										'FK9','FK10','FK11','FK12','FK13','FK14','FK15','FK16','FK17','FK18','FK19','FK20','FK21',
										'IV1','IV2','IV3','IV4','IV5','IV6','IV7','IV8','IV9','IV10','IV11','IV12','IV13','IV14',
										'IV15','IV16','IV17','IV18','IV19','IV20','IV21','IV22','IV23','IV24','IV25','IV26','IV27',
										'IV28','IV30','IV31','IV32','IV36','IV41','IV42','IV43','IV44','IV45','IV46','IV47','IV48',
										'IV49','IV51','IV52','IV53','IV54','IV55','IV56','IV63','KW1','KW2','KW3','KW5','KW6','KW7',
										'KW8','KW9','KW10','KW11','KW12','KW13','KW14','KW15','KW16','KW17','PA20','PA21','PA22',
										'PA23','PA24','PA25','PA26','PA27','PA28','PA29','PA30','PA31','PA32','PA33','PA34','PA35',
										'PA36','PA37','PA38','PA41','PA42','PA43','PA44','PA45','PA46','PA47','PA48','PA49','PA60',
										'PA61','PA62','PA63','PA64','PA65','PA66','PA67','PA68','PA69','PA71','PA72','PA73','PA74',
										'PA75','PA76','PA77','PA78','PH1','PH5','PH6','PH7','PH8','PH9','PH10','PH15','PH16','PH17',
										'PH18','PH19','PH20','PH21','PH22','PH23','PH24','PH25','PH26','PH30','PH31','PH32','PH33',
										'PH34','PH35','PH36','PH37','PH38','PH39','PH40','PH41','PH42','PH43','PH44','PH49','PH50',
										'ZE1','ZE2','ZE3','HS1','HS2','HS3','HS4','HS5','HS6','HS7','HS8','HS9','KA27','KA28','TR21',
										'TR22','TR23','TR24','TR25','IM1','IM2','IM3','IM4','IM5','IM6','IM7','IM8','IM9','PO30',
										'PO31','PO32','PO33','PO34','PO35','PO36','PO37','PO38','PO39','PO40'); 
 	for( var i = 0; i < postCodesToCheck.length; i++)
	{
		if(postcode == postCodesToCheck[i])
		{
			postCodeMessage();		
		}
	}
}

function postCodeMessage() { 			
	var newWindow;
	newWindow = window.open("", "", "status,height=600,width=780");
	newWindow.focus();
	
	var newContent;
	newContent = "<html><head><link href='inc/order.css' rel='stylesheet' type='text/css' media='screen' /><link href='inc/print.css' rel='stylesheet' type='text/css' media='print' /><title>EverEdge - Delivery Quote Required</title><style type='text/css'>table{background-repeat: no-repeat;border-collapse: collapse;}</style></head><body>";
	newContent += "<table border='0' width='760' height='123' cellpadding='0' cellspacing='0' background='images/background_top.jpg'>";
	newContent += "<tr>";
	newContent += "<td colspan='2' height='103' width='163'>";
	newContent += "<object classid='clsid:D27CDB6E-AE6D-11CF-96B8-444553540000' id='obj1' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0' border='0' width='163' height='103'>";
	newContent += "<param name='movie' value='images/top_left_image_loop.swf'>";
	newContent += "<param name='quality' value='High'>";
	newContent += "<embed src='images/top_left_image_loop.swf' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' name='obj1' width='163' height='103'></object>";
	newContent += "</td>";
	newContent += "<td width='434'>";		
	newContent += "<table width='100%'>";
	newContent += "<tr>";
	newContent += "<td  colspan='2' height='42'>";
	newContent += "&nbsp;";
	newContent += "</td>";
	newContent += "</tr>";
	newContent += "<tr>";
	newContent += "<td width='86'>&nbsp;</td>";
	newContent += "<td>";
	newContent += "<img border='0' src='images/delivery_quote.jpg' width='200' height='36'></td>";
	newContent += "</tr>";		
	newContent += "</table>";
	newContent += "</td>";
	newContent += "<td width='163'>";
	newContent += "<img border='0' src='images/everedge_logo.jpg' width='163' height='103'></td>";
	newContent += "</tr>";
	newContent += "<tr>";
	newContent += "<td colspan='4'><img src='images/WideBar2.jpg' alt=''></td>";
	newContent += "</tr>";
	newContent += "</table>";
	newContent += "<table border='0' width='760' height='477' cellpadding='0' cellspacing='0' background='images/background_bottom.jpg'>";
	newContent += "<tr>";
	newContent += "<td width='600'>&nbsp;";
	newContent += "<font face='Arial'><font size='2'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;It appears that you live in one of the following locations:<br><br>";
	newContent += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Isle of Man, Isle of Wight, Scottish Highlands and Islands or Northern Ireland.<br><br><br><br>";
	newContent += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;To place an order please close this window and follow the Contact Us link at<br>";
	newContent += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the top of the Secure Order page.<br><br>";
	newContent += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Thank you.<br><br>";
	newContent += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type='button' value='Close' onclick='opener.document.frmCalculate.reset();window.close();'>";

	newContent += "	</font></td>";
	newContent += "<td>&nbsp;</td>";
	newContent += "</tr>";
	newContent += "<tr>";
	newContent += "<td width='145' rowspan='2'>&nbsp;</td>";
	newContent += "<td rowspan='2'>&nbsp;</td>";
	newContent += "<td>&nbsp;</td>";
	newContent += "</tr>";
	newContent += "<tr>";
	newContent += "<td>&nbsp;</td>";
	newContent += "</tr>";
	newContent += "</table></body></html>";
	
	newWindow.document.write(newContent);
	newWindow.document.close();
}

function FP_changeProp() {//v1.0
 var args=arguments,d=document,i,j,id=args[0],o=FP_getObjectByID(id),s,ao,v,x;
 d.$cpe=new Array(); if(o) for(i=2; i<args.length; i+=2) { v=args[i+1]; s="o"; 
 ao=args[i].split("."); for(j=0; j<ao.length; j++) { s+="."+ao[j]; if(null==eval(s)) { 
  s=null; break; } } x=new Object; x.o=o; x.n=new Array(); x.v=new Array();
 x.n[x.n.length]=s; eval("x.v[x.v.length]="+s); d.$cpe[d.$cpe.length]=x;
 if(s) eval(s+"=v"); }
}

function FP_getObjectByID(id,o) {//v1.0
 var c,el,els,f,m,n; if(!o)o=document; if(o.getElementById) el=o.getElementById(id);
 else if(o.layers) c=o.layers; else if(o.all) el=o.all[id]; if(el) return el;
 if(o.id==id || o.name==id) return o; if(o.childNodes) c=o.childNodes; if(c)
 for(n=0; n<c.length; n++) { el=FP_getObjectByID(id,c[n]); if(el) return el; }
 f=o.forms; if(f) for(n=0; n<f.length; n++) { els=f[n].elements;
 for(m=0; m<els.length; m++){ el=FP_getObjectByID(id,els[n]); if(el) return el; } }
 return null;
}

