// JavaScript Document

function validateDonate(thisform)
{
	if(!commonCheck(thisform.txtAmount,true,""))
	{
		if(thisform.selAmount.selectedIndex == 0)
		{
			alert("Please enter an amount or select from the list provided");
			setfocus(thisform.txtAmount);
			return false;
		}
	}
	else
	{
		if(thisform.txtAmount.value == "0" || thisform.txtAmount.value == "0.00" || thisform.txtAmount.value == "$0" || thisform.txtAmount.value == "$0.00")
		{
			if(thisform.selAmount.selectedIndex == 0)
			{
				alert("Please enter an amount or select from the list provided");
				setfocus(thisform.txtAmount);
				return false;
			}
		}
	}
	
	return true;
}

function validateDetails(thisform)
{
	var valid = true;
	/*var title = document.form1.txttitle.value;
	var firstName = document.form1.txtfirstName.value;
	var lastName = document.form1.txtlastName.value;
	var streetAddress = document.form1.txtstreetAddress.value;
	var suburb = document.form1.txtsuburb.value;
	var state = document.form1.txtstate.value;
	var postCode = document.form1.txtpostCode.value;
	var country = document.form1.txtCountry.value;
	var phoneH = document.form1.txtphoneH.value;
	var phoneW = document.form1.txtphoneW.value;
	var phoneM = document.form1.txtphoneM.value;
	var emailAddress = document.form1.txtemailAddress.value;*/

	//
	//
//
	if(!commonCheck(thisform.txttitle,true,"Please enter a Title"))
	{
		return false;
	}
	if(!commonCheck(thisform.txtfirstName,true,"Please enter a First Name"))
	{
		return false;
	}
	if(!commonCheck(thisform.txtlastName,true,"Please enter a Last Name"))
	{
		return false;
	}	
	if(!commonCheck(thisform.txtstreetAddress,true,"Please enter your Street Address"))
	{
		return false;
	}
	if(!commonCheck(thisform.txtsuburb,true,"Please enter your Suburb"))
	{
		return false;
	}		
	if(!commonCheck(thisform.txtstate,true,"Please enter your State,Territory or County"))
	{
		return false;
	}
	if(!commonCheck(thisform.txtpostCode,true,"Please enter your Post/Zip Code"))
	{
		return false;
	}	
	if(!commonCheck(thisform.txtcountry,true,"Please enter your Country of residence"))
	{
		return false;
	}
	if(!commonCheck(thisform.txtphoneH,true,"Please enter a contact Phone Number"))
	{
		return false;
	}			
	if(!validateEmail(thisform.txtemailAddress,true,"Please enter a valid email address\n\nThis will be used for administration purposes unless you choose to also receive additional information."))
	{
		return false;
	}
						
//	 || firstName.length == 0 || lastName.length == 0 || streetAddress.length == 0 || suburb.length == 0 || state.length == 0 || postCode.length == 0 || country.length == 0 || phoneH.length == 0 || emailAddress.length == 0)
	//
	/*if(emailAddress.indexOf('@') == -1)
	{
		//
		var("Please enter a valid email address.");
		//
		valid = false;
	}*/
	//
	return valid;
}

function checkNum(phoneFld)
{
	validateTelnr(phoneFld,false,"ERROR: not a valid telephone number. Characters permitted are digits, space ()- and leading +");		
}

function checkEmail(emailFld)
{
	validateEmail(emailFld,true,"Please enter a valid email address\n\nThis will be used for administration purposes unless you choose to also receive additional information.");
}
