
var invalidaddress=new Array()
invalidaddress[0]="hotmail"
invalidaddress[1]="rocketmail"
invalidaddress[2]="yahoo"
invalidaddress[3]="zdnetmail"
//extend or shorten this list if neccessary

var testresults
function checkemail(){
var invalidcheck=0;
var str=document.form1.merchant_email.value;
if(str != ""){
var filter=/^(\w+(?:\.\w+)*)@((?:\w+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
if (filter.test(str)){
var tempstring=str.split("@");
tempstring=tempstring[1].split(".");
for (i=0;i<invalidaddress.length;i++){
if (tempstring[0]==invalidaddress[i]);
invalidcheck=0;
}
if (invalidcheck!=1)
testresults=true;
else{
alert("Please input a more official email address!");
testresults=false;
}
}
else{
alert("Please input a valid email address!");
testresults=false;
}
}
return (testresults);
}


function checkForm(p){
var service_type=p;
var str=document.form1.product_id.value;
if (str == ""){
	alert("You must enter a Product ID!");
	document.form1.product_id.focus();
	return false;
}

var str=document.form1.product_price.value;
if (str==""){
	alert("You must enter a Product Price.");
	document.form1.product_price.focus();
	return false;
}else if ((isNaN(str)) || (str < 1)){
	alert("Your product price must be a dollar amount of one dollar or more.");
	document.form1.product_price.select();
	return false;
}
   
var str=document.form1.product_description.value;
if (str == ""){
	alert("You must enter a short product description!");
	document.form1.product_description.focus();
	return false;
}
//End Product Details Section
if (service_type == 1){
//Start Website Details Section

var str=document.form1.website_url.value;
if (str == ""){
	alert("You must enter the URL of the webpage the payment button will display on!");
	document.form1.website_url.focus();
	return false;
}

var str=document.form1.website_layout_description.value;
if (str == ""){
	alert("You must enter a general description of where in the layout the payment button should be placed!");
	document.form1.website_layout_description.focus();
	return false;
}
   
 //End Website Details Section

 //Start FTP Details Section
 
 var str=document.form1.ftp_url.value;
if (str == ""){
	alert("Please enter the Host or FTP address of your website!");
	document.form1.ftp_url.focus();
	return false;
}

var str=document.form1.ftp_username.value;
if (str == ""){
	alert("Please enter the FTP username for your website!");
	document.form1.ftp_username.focus();
	return false;
}

var str=document.form1.ftp_password.value;
if (str == ""){
	alert("Please enter the FTP password for your website!");
	document.form1.ftp_password.focus();
	return false;
}

//End FTP Details
} //End for: "if(service_type !=3){"
//Start EzyBonds Details Section

var str=document.form1.merchantid.value;
if (str == ""){
	alert("Please enter your EzyBonds MerchantID!");
	document.form1.merchantid.focus();
	return false;
}

var str=document.form1.ezb_username.value;
if (str == ""){
	alert("Please enter the Username for logging into your Ezybonds account!");
	document.form1.ezb_username.focus();
	return false;
}

var str=document.form1.ezb_password.value;
if (str == ""){
	alert("Please enter the Password for logging into your Ezybonds account!");
	document.form1.ezb_password.focus();
	return false;
}

var str=document.form1.ezb_security_code.value;
if (str == ""){
	alert("Please enter the 5-digit Security Code for logging into your Ezybonds account!");
	document.form1.ezb_security_code.focus();
	return false;
}

// End EzyBonds Details Section

// Start Merchant Contact Details Section
var str=document.form1.merchant_organisation.value;
if (str == ""){
	alert("Please enter your organisation name!");
	document.form1.merchant_organisation.focus();
	return false;
}

var str=document.form1.merchant_name.value;
if (str == ""){
	alert("Please enter your name!");
	document.form1.merchant_name.focus();
	return false;
}

var str=document.form1.merchant_phone.value;
var strMobile=document.form1.merchant_mobile.value;
if (str == "" && strMobile == ""){
	alert("Please enter either a landline or mobile phone number we can promptly reach you on!");
	document.form1.merchant_phone.focus();
	return false;
}

var str=document.form1.merchant_email.value;
if(str == ""){
	alert("Very Important: Please enter an email address!");
	document.form1.merchant_email.focus();
	return false;
}else{
	var filter=/^(\w+(?:\.\w+)*)@((?:\w+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
	if (filter.test(str)){

	}else{
		alert("Very Important: Please input a valid email address!");
		document.form1.merchant_email.select();
		return false;
	}
}

var str=document.form1.merchant_state.value;
if (str == ""){
	alert("Because of time differences we need to be aware of, please enter your state or province and country!");
	document.form1.merchant_state.focus();
	return false;
}

var str=document.form1.merchant_countryid.value;
if (str == ""){
	alert("Because of time differences we need to be aware of, please enter your country!");
	document.form1.merchant_countryid.focus();
	return false;
}
document.form1.submit();
}


