// JavaScript Document

function GiftWrappingPopup()
{
	window.open("http://www.giftingdirect.com/wrapping.htm","packing", "width=600px,height=450px,toolbar=no,menubar=no,status=no,top=100,left=100");
}

function validate(pForm) {
	errBuild = " errors detected:\n\n";
	errCount = 0;
	if (pForm.postcode.value.length<1) {
		errCount ++;
		errBuild += "Please enter a valid postcode.\n";
	}
	if (errCount != 0) {
		errText = errCount + errBuild;
		alert(errText);
		return false;
	} else { 
		return true;
	};
}


// Define our popup function
function lookup_postcode() {
	if (validate(document.lookup) == 1) {
		var url = "https://www.giftingdirect.co.uk/cgi-bin/cp-app.pl?&pg=ste_nolay_postcode&postcode=" + document.lookup.postcode.value;
		var w = window.open(url, "lookupwin", 
			"scrollbars=no,toolbar=no,status=no,width=520,height=240");
		w.focus();
	}
}

// Define our popup function
function lookup_postcode1() {
	if (validate(document.lookup1) == 1) {
		var url = "https://www.giftingdirect.co.uk/cgi-bin/cp-app.pl?&pg=ste_nolay_postcode1&postcode=" + document.lookup1.postcode.value;
		var w = window.open(url, "lookupwin", 
			"scrollbars=no,toolbar=no,status=no,width=520,height=240");
	w.focus();}
}
