function openEmailEnquire(a){
win = window.open(a,"Enquiry","width=500,height=420,scrollbars=no,resizable=no");
}

var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);}


function gosomewhere(here)
{
	window.location = here;
}

function validateContact(formobj)
{
	var alertMsg = "Please provide the following information:\n";

	var msgLength = alertMsg.length;

	console.log(document.getElementById("ContactName").value);
	console.log(document.getElementById("Email").value);
	console.log(document.getElementById("message").value);
	console.log(document.getElementById("phone").value);
	console.log(document.getElementById("address").value);
	console.log(document.getElementById("subject").value);

	//Check for empty fields (user details only... not checking order info yet - make default amount 1 though)
	if (document.getElementById("ContactName").value == "") alertMsg += "-Name\n";
	if (document.getElementById("Email").value == "") alertMsg += "-Email\n";
	if (document.getElementById("message").value == "") alertMsg += "-Message Body\n";
	if (document.getElementById("phone").value == "") alertMsg += "-Phone\n";
	if (document.getElementById("address").value == "") alertMsg += "-Address\n";
	if (document.getElementById("subject").value == "") alertMsg += "-Subject\n";

	if (alertMsg.length == msgLength){
		document.contact.submit();
	}else{
		alert(alertMsg);
		return false;
	}
}

