

function validateOrder() {
    var errorFound = 0;
	var errorList = "The following errors were found:\n\n";

	if (document.ordernowform.myname.value == "")
	{
		errorFound = 1;
		errorList += "\tYou must enter your name.\n";
	}

	if (document.ordernowform.company.value == "")
	{
		errorFound = 1;
		errorList += "\tYou must enter your company.\n";
	}
	
	if (document.ordernowform.phone.value == "")
	{
		errorFound = 1;
		errorList += "\tYou must enter your phone.\n";
	}
	
	if (document.ordernowform.email.value == "")
	{
		errorFound = 1;
		errorList += "\tYou must enter your email.\n";
	}
	
	if (document.ordernowform.street.value == "")
	{
		errorFound = 1;
		errorList += "\tYou must enter your street.\n";
	}
	
	if (document.ordernowform.suburb.value == "")
	{
		errorFound = 1;
		errorList += "\tYou must enter your suburb.\n";
	}
	
	if (document.ordernowform.state.value == "")
	{
		errorFound = 1;
		errorList += "\tYou must enter your state.\n";
	}
	
	if (document.ordernowform.postcode.value == "")
	{
		errorFound = 1;
		errorList += "\tYou must enter your postcode.\n";
	}
	
	if (document.ordernowform.daterequired.value == "")
	{
		errorFound = 1;
		errorList += "\tYou must enter the date required.\n";
	}
	
	if (document.ordernowform.attention.value == "")
	{
		errorFound = 1;
		errorList += "\tYou must enter a contact name for attention.\n";
	}
	
	if (document.ordernowform.contactnumber.value == "")
	{
		errorFound = 1;
		errorList += "\tYou must enter your contact number for delivery.\n";
	}
	
	if (document.ordernowform.deliveryaddress.value == "")
	{
		errorFound = 1;
		errorList += "\tYou must enter your delivery address.\n";
	}
	
	if (document.ordernowform.deliverystate.value == "")
	{
		errorFound = 1;
		errorList += "\tYou must enter your delivery state.\n";
	}
	
	if (document.ordernowform.deliverypostcode.value == "")
	{
		errorFound = 1;
		errorList += "\tYou must enter your delivery postcode.\n";
	}
		
	if (errorFound == 1)
	{
		errorList += "\nPlease address these issues and re-submit your enquiry.\n";
		alert(errorList);
		return false;
	}
	
	return true;    
}

function popupHelp(URL) {
 day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=355,height=500,left = 326,top = 232');");

}

function validateCustomRequest() {
    var errorFound = 0;
	var errorList = "The following errors were found:\n\n";

	if (document.customprint.myname.value == "")
	{
		errorFound = 1;
		errorList += "\tYou must enter your name.\n";
	}

	if (document.customprint.company.value == "")
	{
		errorFound = 1;
		errorList += "\tYou must enter your company.\n";
	}
	
	if (document.customprint.phone.value == "")
	{
		errorFound = 1;
		errorList += "\tYou must enter your phone.\n";
	}
	
	if (document.customprint.email.value == "")
	{
		errorFound = 1;
		errorList += "\tYou must enter your email.\n";
	}
	
	if (document.customprint.street.value == "")
	{
		errorFound = 1;
		errorList += "\tYou must enter your street.\n";
	}
	
	if (document.customprint.suburb.value == "")
	{
		errorFound = 1;
		errorList += "\tYou must enter your suburb.\n";
	}
	
	if (document.customprint.state.value == "")
	{
		errorFound = 1;
		errorList += "\tYou must enter your state.\n";
	}
	
	if (document.customprint.postcode.value == "")
	{
		errorFound = 1;
		errorList += "\tYou must enter your postcode.\n";
	}
	
	if (document.customprint.request.value == "")
	{
		errorFound = 1;
		errorList += "\tYou must enter your request.\n";
	}
		
	if (errorFound == 1)
	{
		errorList += "\nPlease address these issues and re-submit your enquiry.\n";
		alert(errorList);
		return false;
	}
	
	return true;    
}

function changeMktgColor(formName)
{
    var stock=document.forms[formName].stock.value;
	var size=document.forms[formName].size.value;
	var quantity=document.forms[formName].quantity.value;
    self.location='marketing-cards-quoted.php?stock=' +stock+ '&size=' +size+ '&quantity=' +quantity; 
}

function changePhotoprintPice(formName)
{
	var price=document.forms[formName].size.value;
	document.forms[formName].pricecheck.value="$ "+price;
}
