function ValidateServiceAgreementForm_adminlevel()
{

	invalidFlag=false;	

	var cnL= window.document.ServiceAgreement_Form.CN.value.length;
	var cnV= window.document.ServiceAgreement_Form.CN.value;
	
	var addressline1L= window.document.ServiceAgreement_Form.addressline1.value.length;
	var addressline1V= window.document.ServiceAgreement_Form.addressline1.value;
	
	
	var cityL= window.document.ServiceAgreement_Form.city.value.length;
	var cityV= window.document.ServiceAgreement_Form.city.value;
	
	var stateL= window.document.ServiceAgreement_Form.state.value.length;
	var stateV= window.document.ServiceAgreement_Form.state.value;
	

	var postcodeL= window.document.ServiceAgreement_Form.postcode.value.length;
	var postcodeV= window.document.ServiceAgreement_Form.postcode.value;

	var countryL= window.document.ServiceAgreement_Form.country.length;
	var countryV= window.document.ServiceAgreement_Form.country.value;

	var phoneL= window.document.ServiceAgreement_Form.phone.value.length;
	var phoneV= window.document.ServiceAgreement_Form.phone.value;
	
	var billingcontactL= window.document.ServiceAgreement_Form.billingcontact.value.length;
	var billingcontactV= window.document.ServiceAgreement_Form.billingcontact.value;

	var billingpositionL= window.document.ServiceAgreement_Form.billingposition.value.length;
	var billingpositionV= window.document.ServiceAgreement_Form.billingposition.value;
	
	var billingphoneL= window.document.ServiceAgreement_Form.billingphone.value.length;
	var billingphoneV= window.document.ServiceAgreement_Form.billingphone.value;

	var billingemailL= window.document.ServiceAgreement_Form.billingemail.value.length;
	var billingemailV= window.document.ServiceAgreement_Form.billingemail.value;

	var billingaddressline1L= window.document.ServiceAgreement_Form.billingaddressline1.value.length;
	var billingaddressline1V= window.document.ServiceAgreement_Form.billingaddressline1.value;

	var billingcityL= window.document.ServiceAgreement_Form.billingcity.value.length;
	var billingcityV= window.document.ServiceAgreement_Form.billingcity.value;
	
	var billingstateL= window.document.ServiceAgreement_Form.billingstate.value.length;
	var billingstateV= window.document.ServiceAgreement_Form.billingstate.value;

	var billingpostcodeL= window.document.ServiceAgreement_Form.billingpostcode.value.length;
	var billingpostcodeV= window.document.ServiceAgreement_Form.billingpostcode.value;
	

	var postalcountryL= window.document.ServiceAgreement_Form.postalcountry.value.length;
	var postalcountryV= window.document.ServiceAgreement_Form.postalcountry.value;

	
	var websiteL= window.document.ServiceAgreement_Form.website.value.length;
	var websiteV= window.document.ServiceAgreement_Form.website.value;

	


	var existinguserV= window.document.ServiceAgreement_Form.existinguser.value;
	
	var existingusernameV= window.document.ServiceAgreement_Form.existingusername.value;
	var existingusernameL= window.document.ServiceAgreement_Form.existingusername.value.length;

	
	if((cnL < 2) && (invalidFlag==false))
	{
		alert("Please Enter Company / Customer Name with atleast 2 chars");
		window.document.ServiceAgreement_Form.CN.focus();
		invalidFlag=true;
	}
	
	if((addressline1L < 2) && (invalidFlag==false))
	{
		alert("Please Enter Physical Address - Street Number and Name with atleast 2 chars");
		window.document.ServiceAgreement_Form.addressline1.focus();
		invalidFlag=true;
	}
	
	if((cityL < 2) && (invalidFlag==false))
	{
		alert("Please Enter Physical Address - City or Suburb with atleast 2 chars");
		window.document.ServiceAgreement_Form.city.focus();
		invalidFlag=true;
	}

	if((stateL < 2) && (invalidFlag==false))
	{
		alert("Please Enter Physical Address - State with atleast 2 chars");
		window.document.ServiceAgreement_Form.state.focus();
		invalidFlag=true;
	}

	if((postcodeL < 1) && (invalidFlag==false))
	{
		alert("Please Enter Physical Address - Postcode with atleast 1 chars");
		window.document.ServiceAgreement_Form.postcode.focus();
		invalidFlag=true;
	}
	

	if((countryV==0) && (invalidFlag==false))
	{
		alert("Please Choose Physical Address Country");
		window.document.ServiceAgreement_Form.country.focus();
		invalidFlag=true;
	}
	
	if((phoneL < 6) && (invalidFlag==false))
	{
		alert("Please Enter Telephone with atleast 6 chars");
		window.document.ServiceAgreement_Form.phone.focus();
		invalidFlag=true;
	}
	
	if((billingcontactL < 2) && (invalidFlag==false))
	{
		alert("Please Enter Contact name for Billing Purposes with atleast 2 chars");
		window.document.ServiceAgreement_Form.billingcontact.focus();
		invalidFlag=true;
	}
	if((billingpositionL < 2) && (invalidFlag==false))
	{
		alert("Please Enter Position of Contact for Billing Purposes with atleast 2 chars");
		window.document.ServiceAgreement_Form.billingposition.focus();
		invalidFlag=true;
	}
	if((billingphoneL < 2) && (invalidFlag==false))
	{
		alert("Please Enter Phone of Contact for Billing Purposes with atleast 2 chars");
		window.document.ServiceAgreement_Form.billingphone.focus();
		invalidFlag=true;
	}
	
	

	//----------- Email validation ------------

	if((billingemailL<6) && (invalidFlag==false))
	{
		alert("Please enter your Email for Billing Purposes");
		invalidFlag=true;
		window.document.ServiceAgreement_Form.billingemail.focus();
	}

	var val1=billingemailV.indexOf("@");              // for existence of @ in email address

	var val2=billingemailV.indexOf(".");                  // for existence of . in email address

	var val3=billingemailV.indexOf(" ");                  // for existence of <space> in email address


	if(((val1==-1) || (val2==-1) || (val3!=-1)) && invalidFlag==false)                    // -1 will be returned if @ or . is missing from email address
	{
		alert("Please enter Correct Email Address in Billing Email");
		invalidFlag=true;
		window.document.ServiceAgreement_Form.billingemail.focus();
	}

	//---------------- Email Validation Ends----------------------




	if((billingaddressline1L < 2) && (invalidFlag==false))
	{
		alert("Please enter Billing Address - Street Number and Name or PO Box with atleast 2 chars");
		window.document.ServiceAgreement_Form.billingaddressline1.focus();
		invalidFlag=true;
	}

	if((billingcityL < 2) && (invalidFlag==false))
	{
		alert("Please enter Billing Address - City with atleast 2 chars");
		window.document.ServiceAgreement_Form.billingcity.focus();
		invalidFlag=true;
	}
	
	if((billingstateL < 2) && (invalidFlag==false))
	{
		alert("Please enter Billing Address - State with atleast 2 chars");
		window.document.ServiceAgreement_Form.billingstate.focus();
		invalidFlag=true;
	}	
	
	if((billingpostcodeL < 1) && (invalidFlag==false))
	{
		alert("Please enter Billing Address - Postcode with atleast 1 chars");
		window.document.ServiceAgreement_Form.billingpostcode.focus();
		invalidFlag=true;
	}
	
	if((postalcountryV==0) && (invalidFlag==false))
	{
		alert("Please choose Billing Address - Country with atleast 1 chars");
		window.document.ServiceAgreement_Form.billingpostcode.focus();
		invalidFlag=true;
	}
	
	/*
	// Website Optional
	if((websiteL < 3) && (invalidFlag==false))
	{
		alert("Please enter Website/Domain with atleast 3 chars");
		window.document.ServiceAgreement_Form.website.focus();
		invalidFlag=true;
	}
	*/

	
	if(existinguserV=="yes")
	{
		if((existingusernameL<5) && (invalidFlag==false))
		{
			alert("Please Enter your Existing username");
			window.document.ServiceAgreement_Form.existingusername.focus();
			invalidFlag=true;
		}

	}

	

	//---------------------------------
	if(invalidFlag==true)
		return false;
	else
		return true;



}



//----------------------------------------------------------------------------------------------------------------------------------------

function SameAsAboveAddress_admincontactform()
{
	if(window.document.ServiceAgreement_Form.sameasabove.checked)
	{
		window.document.ServiceAgreement_Form.billingaddressline1.value = window.document.ServiceAgreement_Form.addressline1.value;
		window.document.ServiceAgreement_Form.billingcity.value = window.document.ServiceAgreement_Form.city.value;
		window.document.ServiceAgreement_Form.billingstate.value = window.document.ServiceAgreement_Form.state.value;
		window.document.ServiceAgreement_Form.billingpostcode.value = window.document.ServiceAgreement_Form.postcode.value;
		window.document.ServiceAgreement_Form.postalcountry.selectedIndex = window.document.ServiceAgreement_Form.country.selectedIndex;

	}

	

}
