function antispam (message, email1, email2) {
	if (confirm(message)) {
		location = "mailto:"+email1+"@"+email2;
	}
	return false;
}


/* 	adapted from mozilla
	http://developer.mozilla.org/en/docs/DOM:window.open
*/
var pop1 = null;
function openWindow (strUrl) {

	var PreviousUrl;
	var popupH = 600;
	var popupW = 600;
	var strTarget = "myPopup";

	if (openWindow.arguments.length == 3) {
		popupW = openWindow.arguments[1];
		popupH = openWindow.arguments[2];
	}

	if (pop1 == null || pop1.closed) {
		pop1 = window.open(strUrl, strTarget, "top=20,left=20,width="+popupW+",height="+popupH+",titlebar=yes,menubar=yes,toolbar=yes,location=yes,resizable=yes,scrollbars=yes,status=yes");
	} else if (PreviousUrl != strUrl) {
		pop1 = window.open(strUrl, strTarget, "titlebar=yes,menubar=yes,toolbar=yes,location=yes,resizable=yes,scrollbars=yes,status=yes");
		pop1.focus();
	} else {
		pop1.focus();
	}

	PreviousUrl = strUrl;

	return (pop1 && pop1.open) ? false : true;
}


function changeContainerWidth() {
	var myWidth = 0;
	if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		myWidth = window.innerWidth;
	} else if( document.documentElement && ( document.documentElement.clientWidth) ) {
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
	} else if( document.body && ( document.body.clientWidth) ) {
		//IE 4 compatible
		myWidth = document.body.clientWidth;
	}

	sWidth = myWidth < 960 ? "97.5%" : "960px";
	document.writeln("<style type=\"text/css\">");
	document.writeln("#container { width:" + sWidth + "}");
	document.writeln("<\/style>");


}

function stripSpaces (myString) {
	myNewString = '';
	for (i = 0; i < myString.length; i++) {
		if (myString.charAt(i) != ' ')  {
			myNewString += myString.charAt(i);
		}
	}
	return myNewString;
}

function verify(myForm) {
	myError = "";
	if (stripSpaces(myForm.req_name.value).length < 3) myError += "Name\n";
	if (stripSpaces(myForm.req_address1.value).length < 3) myError += "Address 1\n";
	if (stripSpaces(myForm.req_city.value).length < 3) myError +=  "Town\n";
	if (stripSpaces(myForm.req_zip.value).length < 3) myError += "Postcode\n";
	if (stripSpaces(myForm.req_country.value).length < 3) myError += "Country\n";

	if (myError != "") {
		alert("The following field/s appear to be filled in incorrectly.\nThey are all required.\n\n" + myError + "\n\nPlease try again.");
	} else {
		myForm.submit();
	}

}

// changeContainerWidth();


