function fnBuildString (strInA,strInB, strSep)
{	//Concatinates strInB to end of strInA.
	//If strInA is blank then just returns strInB.
	//Otherwise returns strInA concatinated with strInB and separted with string strSep.
	if (isWhitespace(strInA) )
	{	strInA = strInB
	}
	else
	{	strInA += (strSep + strInB)
	}
	return strInA
}

//Returns DialCode from Phone Number
function fnGetDialCode (strPhoneNum) {
	var strDialCode;
	if (strPhoneNum + ' ' != ' ' && strPhoneNum != undefined) {
		if (strPhoneNum.match(/\+[0-9]+\./) != null) {
			strDialCode = strPhoneNum.match(/\+[0-9]+\./)[0].replace(/[^0-9]/g, '');
		} else {
			strDialCode = "";
		}
	} else {
		strDialCode = "";
	}
	return strDialCode
}
function fnRemoveDialCode (strPhoneNum)
{	//Returns Phone Number without DialCode
	var strNewPhoneNum
	if (strPhoneNum + ' ' != ' ' && strPhoneNum != undefined)
	{
		strNewPhoneNum = strPhoneNum.replace(/\+[0-9]+\./, '');
	}
	else
	{
		strNewPhoneNum = "";
	}
	return strNewPhoneNum
}

function isblank(s)
{
	for( var i = 0; i < s.length; i++ ) {
		var c = s.charAt(i);
		if (( c != ' ' ) && ( c != '\n' ) && ( c != '\t' )) return false;
	}
	return true;
}


function CheckFields( f )
{
	var msg = "";

	// -------------------------------------------
	//	Registrant Information
	// -------------------------------------------
	
	
	var RegEmptyFields = "";
	var RegErrors = "";

	var Country

	

		TheIndexUSA = f.RegistrantCountry.selectedIndex;
		TheUSA		= f.RegistrantCountry.options[TheIndexUSA].text;

		Country = TheUSA.toUpperCase();

		USA = "UNITED STATES";
		CANADA = "CANADA";


		if ( f.RegistrantFName.value == "" || f.RegistrantFName.value == null || isblank( f.RegistrantFName.value ) )
			RegEmptyFields += "		First Name\n";
		if ( f.RegistrantLName.value == "" || f.RegistrantLName.value == null || isblank( f.RegistrantLName.value ) )
			RegEmptyFields += "		Last Name\n";
		if ( f.RegistrantAddress.value == "" || f.RegistrantAddress.value == null || isblank( f.RegistrantAddress.value ) )
			RegEmptyFields += "		Address\n";
		if ( f.RegistrantCity.value == "" || f.RegistrantCity.value == null || isblank( f.RegistrantCity.value ) )
			RegEmptyFields += "		City\n";

		if ( Country == "" )
		   RegEmptyFields += "                Country\n";
		if ( Country == USA || Country == CANADA )
		{
			if ( f.RegistrantZip.value == "" || f.RegistrantZip.value == null || isblank( f.RegistrantZip.value ) )
				RegEmptyFields += "		Postal or Zip Code\n";
		}

		if ( f.RegistrantEmail.value == "" || f.RegistrantEmail.value == null || isblank( f.RegistrantEmail.value ) )
			RegEmptyFields += "		Email Address\n";
			

		phoneIndex = f.RegistrantPhoneDial.selectedIndex;
		phoneCode =  f.RegistrantPhoneDial.options[phoneIndex].text;
		if ( phoneCode == "" || phoneCode == null || isblank (phoneCode) )
			RegEmptyFields += "		Phone Code\n";	
		
		if ( f.RegistrantPhone.value == "" || f.RegistrantPhone.value == null || isblank( f.RegistrantPhone.value ) )
			RegEmptyFields += "		Phone\n";


		// Check the Organization info
		if ( f.RegistrantOrg.value == "" || f.RegistrantOrg.value == null || isblank( f.RegistrantOrg.value ) )
		{
			// don't do anything
		}
		else
		{
			// they typed in an Organization name so they need Job title and Fax #

			if ( f.RegistrantJobTitle.value == "" || f.RegistrantJobTitle.value == null || isblank( f.RegistrantJobTitle.value ) )
				RegEmptyFields += "		Your Role/Title\n";

			faxIndex = f.RegistrantFaxDial.selectedIndex;
			faxCode =  f.RegistrantFaxDial.options[faxIndex].text;
			if ( faxCode == "" || faxCode == null || isblank (faxCode) )
				RegEmptyFields += "		Fax Code\n";
				
		        if ( f.RegistrantFax.value == "" || f.RegistrantFax.value == null || isblank( f.RegistrantFax.value ))
				RegEmptyFields += "		Fax Number\n";
		}


		if (f.RegistrantStateProvinceChoice[0].checked == true && Country != USA)
			RegErrors += "		You cannot select a US state and have a different country\n";

		if (f.RegistrantStateProvinceChoice[1].checked == true && Country == USA)
			RegErrors += "		You cannot select Other and have USA as your country\n";
			
			


	// ---------------------------------
	//	Aux Billing Information
	// ---------------------------------
/*	var AuxBillingEmptyFields = "";		// Kind of like "EmptyFields" only for aux billing info
	var AuxBillingErrors = "";
	
	if (document.form1.OptContactTech[2].checked)
	{
		
		TheIndexUSA = f.AuxBillingCountry.selectedIndex;
		TheUSA		= f.AuxBillingCountry.options[TheIndexUSA].text;

		Country = TheUSA.toUpperCase();

		USA = "UNITED STATES";
		CANADA = "CANADA";


		if ( f.AuxBillingFName.value == "" || f.AuxBillingFName.value == null || isblank( f.AuxBillingFName.value ) )
			AuxBillingEmptyFields += "		First Name\n";
		if ( f.AuxBillingLName.value == "" || f.AuxBillingLName.value == null || isblank( f.AuxBillingLName.value ) )
			AuxBillingEmptyFields += "		Last Name\n";
		if ( f.AuxBillingAddress.value == "" || f.AuxBillingAddress.value == null || isblank( f.AuxBillingAddress.value ) )
			AuxBillingEmptyFields += "		Address\n";
		if ( f.AuxBillingCity.value == "" || f.AuxBillingCity.value == null || isblank( f.AuxBillingCity.value ) )
			AuxBillingEmptyFields += "		City\n";

		if ( Country == "" )
		    AuxEmptyFields += "                Country\n";
		if ( Country == USA || Country == CANADA)
		{
			if ( f.AuxBillingZip.value == "" || f.AuxBillingZip.value == null || isblank( f.AuxBillingZip.value ) )
				AuxBillingEmptyFields += "		Postal or Zip Code\n";
		}

		if ( f.AuxBillingEmail.value == "" || f.AuxBillingEmail.value == null || isblank( f.AuxBillingEmail.value ) )
			AuxBillingEmptyFields += "		Email Address\n";
		if ( f.AuxBillingPhone.value == "" || f.AuxBillingPhone.value == null || isblank( f.AuxBillingPhone.value ) )
			AuxBillingEmptyFields += "		Phone\n";


		// Check the Organization info
		if ( f.AuxBillingOrg.value == "" || f.AuxBillingOrg.value == null || isblank( f.AuxBillingOrg.value ) )
		{
			// don't do anything
		}
		else
		{
			// they typed in an Organization name so they need Job title and Fax #

			if ( f.AuxBillingJobTitle.value == "" || f.AuxBillingJobTitle.value == null || isblank( f.AuxBillingJobTitle.value ) )
				AuxBillingEmptyFields += "		Your Role/Title\n";

//			if ( f.AuxBillingFax.value == "" || f.AuxBillingFax.value == null || isblank( f.AuxBillingFax.value ) )
//				AuxBillingEmptyFields += "		Fax Number\n";
		}


		if (f.AuxBillingStateProvinceChoice[0].checked == true && Country != USA)
			AuxBillingErrors += "		You cannot select a US state and have a different country\n";

		if (f.AuxBillingStateProvinceChoice[1].checked == true && Country == USA)
			AuxBillingErrors += "		You cannot select Other and have USA as your country\n";

	}

*/


	// -----------------------
	//	Tech Information
	// -----------------------
	var TechEmptyFields = "";
	var TechErrors = "";
    
	if (document.form1.OptTechnical[1].checked)
	{
		
		TheIndexUSA = f.TechCountry.selectedIndex;
		TheUSA		= f.TechCountry.options[TheIndexUSA].text;

		Country = TheUSA.toUpperCase();

		USA = "UNITED STATES";
		CANADA = "CANADA";


		if ( f.TechFName.value == "" || f.TechFName.value == null || isblank( f.TechFName.value ) )
			TechEmptyFields += "		First Name\n";
		if ( f.TechLName.value == "" || f.TechLName.value == null || isblank( f.TechLName.value ) )
			TechEmptyFields += "		Last Name\n";
		if ( f.TechAddress.value == "" || f.TechAddress.value == null || isblank( f.TechAddress.value ) )
			TechEmptyFields += "		Address\n";
		if ( f.TechCity.value == "" || f.TechCity.value == null || isblank( f.TechCity.value ) )
			TechEmptyFields += "		City\n";

		if ( Country == "" )
		    TechEmptyFields += "                Country\n";
		if ( Country == USA || Country == CANADA)
		{
			if ( f.TechZip.value == "" || f.TechZip.value == null || isblank( f.TechZip.value ) )
				TechEmptyFields += "		Postal or Zip Code\n";
		}

		if ( f.TechEmail.value == "" || f.TechEmail.value == null || isblank( f.TechEmail.value ) )
			TechEmptyFields += "		Email Address\n";
		
		phoneIndex = f.TechPhoneDial.selectedIndex;
		phoneCode =  f.TechPhoneDial.options[phoneIndex].text;
		if ( phoneCode == "" || phoneCode == null || isblank (phoneCode) )
			TechEmptyFields += "		Phone Code\n";	
			
		if ( f.TechPhone.value == "" || f.TechPhone.value == null || isblank( f.TechPhone.value ) )
			TechEmptyFields += "		Phone\n";
			
		// Check the Organization info
		if ( f.TechOrg.value == "" || f.TechOrg.value == null || isblank( f.TechOrg.value ) )
		{
			// don't do anything
		}
		else
		{
			// they typed in an Organization name so they need Job title and Fax #

			if ( f.TechJobTitle.value == "" || f.TechJobTitle.value == null || isblank( f.TechJobTitle.value ) )
				TechEmptyFields += "		Your Role/Title\n";

			faxIndex = f.TechFaxDial.selectedIndex;
			faxCode =  f.TechFaxDial.options[faxIndex].text;
			if ( faxCode == "" || faxCode == null || isblank (faxCode) )
				TechEmptyFields += "		Fax Code\n";
			
			if ( f.TechFax.value == "" || f.TechFax.value == null || isblank( f.TechFax.value ) )
				TechEmptyFields += "		Fax Number\n";
		}


		if (f.TechStateProvinceChoice[0].checked == true && Country != USA)
			TechErrors += "		You cannot select a US state and have a different country\n";

		if (f.TechStateProvinceChoice[1].checked == true && Country == USA)
			TechErrors += "		You cannot select Other and have USA as your country\n";
		
	
			

	}
	
	// -----------------------
	//	ADmin Information
	// -----------------------
	var AdminEmptyFields = "";
	var AdminErrors = "";
    
	if (document.form1.OptAdmin[1].checked)
	{
		
		TheIndexUSA = f.AdminCountry.selectedIndex;
		TheUSA		= f.AdminCountry.options[TheIndexUSA].text;

		Country = TheUSA.toUpperCase();
		
		USA = "UNITED STATES";
		CANADA = "CANADA";

		if ( f.AdminFName.value == "" || f.AdminFName.value == null || isblank( f.AdminFName.value ) )
			AdminEmptyFields += "		First Name\n";
		if ( f.AdminLName.value == "" || f.AdminLName.value == null || isblank( f.AdminLName.value ) )
			AdminEmptyFields += "		Last Name\n";
		if ( f.AdminAddress.value == "" || f.AdminAddress.value == null || isblank( f.AdminAddress.value ) )
			AdminEmptyFields += "		Address\n";
		if ( f.AdminCity.value == "" || f.AdminCity.value == null || isblank( f.AdminCity.value ) )
			AdminEmptyFields += "		City\n";

		if ( Country == "" )
		    AdminEmptyFields += "                Country\n";
		if ( Country == USA || Country == CANADA)
		{
			if ( f.AdminZip.value == "" || f.AdminZip.value == null || isblank( f.AdminZip.value ) )
				AdminEmptyFields += "		Postal or Zip Code\n";
		}

		if ( f.AdminEmail.value == "" || f.AdminEmail.value == null || isblank( f.AdminEmail.value ) )
			AdminEmptyFields += "		Email Address\n";
		
		phoneIndex = f.AdminPhoneDial.selectedIndex;
		phoneCode =  f.AdminPhoneDial.options[phoneIndex].text;
		if ( phoneCode == "" || phoneCode == null || isblank (phoneCode) )
			AdminEmptyFields += "		Phone Code\n";	
			
		if ( f.AdminPhone.value == "" || f.AdminPhone.value == null || isblank( f.AdminPhone.value ) )
			AdminEmptyFields += "		Phone\n";


		// Check the Organization info
		if ( f.AdminOrg.value == "" || f.AdminOrg.value == null || isblank( f.AdminOrg.value ) )
		{
			// don't do anything
		}
		else
		{
			// they typed in an Organization name so they need Job title and Fax #

			if ( f.AdminJobTitle.value == "" || f.AdminJobTitle.value == null || isblank( f.AdminJobTitle.value ) )
				AdminEmptyFields += "		Your Role/Title\n";
			
			faxIndex = f.AdminFaxDial.selectedIndex;
			faxCode =  f.AdminFaxDial.options[faxIndex].text;
			if ( faxCode == "" || faxCode == null || isblank (faxCode) )
				AdminEmptyFields += "		Fax Code\n";
				
				
			if ( f.AdminFax.value == "" || f.AdminFax.value == null || isblank( f.AdminFax.value ) )
				AdminEmptyFields += "		Fax Number\n";
		}


		if (f.AdminStateProvinceChoice[0].checked == true && Country != USA)
			AdminErrors += "		You cannot select a US state and have a different country\n";

		if (f.AdminStateProvinceChoice[1].checked == true && Country == USA)
			AdminErrors += "		You cannot select Other and have USA as your country\n";

	}
	
	// submit the form if there weren't any errors
	if ( !RegEmptyFields && !RegErrors && !AuxBillingEmptyFields && !AuxBillingErrors && !TechEmptyFields && !TechErrors && !AdminEmptyFields && !AdminErrors)
		return true;
	
	// create the message for the error dialog
	msg	= "_____________________________________________________\n\n";
	msg += "The form was not submitted because of the following error(s).\n";
	msg += "Please correct these error(s) and re-submit.\n";
	msg += "_____________________________________________________\n\n";

	if ( RegEmptyFields || RegErrors )
	{
		msg += "Registrant Contact\n"

		// print out the required fields that were missing
		if ( RegEmptyFields ) {
			msg += "- the following required field(s) are empty:\n" + RegEmptyFields + "\n";
		}

		// print out any other misc errors
		if ( RegErrors ) {
			msg += RegErrors;
		}

		msg += "\n\n";
	}


/*	if ( AuxBillingEmptyFields || AuxBillingErrors )
	{
		msg += "Auxilliary Billing Contact\n"

		// print out the required fields that were missing
		if ( AuxBillingEmptyFields ) {
			msg += "- the following required field(s) are empty:\n" + AuxBillingEmptyFields + "\n";
		}

		// print out any other misc errors
		if ( AuxBillingErrors ) {
			msg += AuxBillingErrors;
		}

		msg += "\n\n";
	}*/

	if ( AdminEmptyFields || AdminErrors )
	{
		msg += "Administration Contact\n"

		// print out the required fields that were missing
		if ( AdminEmptyFields ) {
			msg += "- the following required field(s) are empty:\n" + AdminEmptyFields + "\n";
		}

		// print out any other misc errors
		if ( AdminErrors ) {
			msg += AdminErrors;
		}

		msg += "\n\n";
	}

	if ( TechEmptyFields || TechErrors )
	{
		msg += "Technical Contact\n"

		// print out the required fields that were missing
		if ( TechEmptyFields ) {
			msg += "- the following required field(s) are empty:\n" + TechEmptyFields + "\n";
		}

		// print out any other misc errors
		if ( TechErrors ) {
			msg += TechErrors;
		}

		msg += "\n\n";
	}
	
	


	// display the message
	alert( msg );
	return false;

}

// Not used anymore
function CheckFields2( f )
{

	//Access form checking
//	get values from form
	var RegOrg=document.form1.RegistrantOrg.value
	var RegFName=document.form1.RegistrantFName.value
	var RegLName=document.form1.RegistrantLName.value
	var RegJobTitle=document.form1.RegistrantJobTitle.value
	var RegPhone=document.form1.RegistrantPhone.value
	var RegPhoneExt=document.form1.RegistrantPhoneExt.value
	var RegFax=document.form1.RegistrantFax.value
	var RegistrantCity=document.form1.RegistrantCity.value
	var RegEmail=document.form1.RegistrantEmail.value

	var AuxOrg=document.form1.AuxBillingOrg.value
	var AuxFName=document.form1.AuxBillingFName.value
	var AuxLName=document.form1.AuxBillingLName.value
	var AuxJobTitle=document.form1.AuxBillingJobTitle.value
	var AuxPhone=document.form1.AuxBillingPhone.value
	var AuxPhoneExt=document.form1.AuxBillingPhoneExt.value
	var AuxFax=document.form1.AuxBillingFax.value
	var AuxBillingCity=document.form1.AuxBillingCity.value
	var AuxEmail=document.form1.AuxBillingEmail.value

	var TechOrg=document.form1.TechOrg.value
	var TechFName=document.form1.TechFName.value
	var TechLName=document.form1.TechLName.value
	var TechJobTitle=document.form1.TechJobTitle.value
	var TechPhone=document.form1.TechPhone.value
	var TechPhoneExt=document.form1.TechPhoneExt.value
	var TechFax=document.form1.TechFax.value
	var TechCity=document.form1.TechCity.value
	var TechEmail=document.form1.TechEmail.value

// define all error strings
	var AuxMsg="The Following Auxiliary Billing Fields are Required"
	var RegMsg="The Following Registrant Fields are Required"
	var TechMsg="The Following Technical Contact Fields are Required"
	var strMsgReg=""
	var strMsgAux=""
	var strMsgTech=""
	var strMsgAll=""
	strOrg = "Organization Name"
	strFName = "First Name"
	strLName = "Last Name"
	strJobTitle = "JobTitle"
	strPhone = "Phone"
	strFax = "Fax"
	strEmail = "EMail Address"
	strCity = "City"
	strSep = "\n		"

//define all error flags
	var validateReg=false
	var validateAux=false
	var validateTech=false

	//BEGINNING OF REGISTRANT FIELD CHECK
	//if USE THE FOLLOWING INFORMATION is checked, do edits on required flds
	if (document.form1.OptContactReg[1].checked)
	{
		//	if required field is empty set error flag and build error msg string
		if ( isWhitespace(RegOrg) )
		{
			//validateReg=true
			//strMsgReg = fnBuildString (strMsgReg,strOrg, strSep)
		}
		else
		{
			if ( isWhitespace(RegJobTitle) )
			{
				validateReg=true
				strMsgReg = fnBuildString (strMsgReg,strJobTitle, strSep)
			}
			if ( isWhitespace(RegFax) )
			{
				validateReg=true
				strMsgReg = fnBuildString (strMsgReg,strFax, strSep)
			}
		}
		if ( isWhitespace(RegFName) )
		{
			validateReg=true
			strMsgReg = fnBuildString (strMsgReg,strFName, strSep)
		}
		if ( isWhitespace(RegLName) )
		{
			validateReg=true
			strMsgReg = fnBuildString (strMsgReg,strLName, strSep)
		}
		if ( isWhitespace(RegPhone) )
		{
			validateReg=true
			strMsgReg = fnBuildString (strMsgReg,strPhone, strSep)
		}
		if ( isWhitespace(RegistrantCity) )
		{
			validateReg=true
			strMsgReg = fnBuildString (strMsgReg,strCity, strSep)
		}
		if ( isWhitespace(RegEmail) )
		{
			validateReg=true
			strMsgReg = fnBuildString (strMsgReg,strEmail, strSep)
		}
	}

	//BEGINNING OF AUX BILLING FIELD CHECK
	//if USE THE FOLLOWING INFORMATION is checked, do edits on required flds
	if (document.form1.OptContactTech[2].checked)
	{	//if required field is empty set error flag and build error msg string
		if ( isWhitespace(AuxOrg) )
		{
			//validateAux=true
			//strMsgAux = fnBuildString (strMsgAux,strOrg, strSep)
		}
		else
		{
			if ( isWhitespace(AuxJobTitle) )
			{
				validateAux=true
				strMsgAux = fnBuildString (strMsgAux,strJobTitle, strSep)
			}
			if ( isWhitespace(AuxFax) )
			{
				validateAux=true
				strMsgAux = fnBuildString (strMsgAux,strFax, strSep)
			}
		}
		if ( isWhitespace(AuxFName) )
		{
			validateAux=true
			strMsgAux = fnBuildString (strMsgAux,strFName, strSep)
		}
		if ( isWhitespace(AuxLName) )
		{
			validateAux=true
			strMsgAux = fnBuildString (strMsgAux,strLName, strSep)
		}
		if ( isWhitespace(AuxPhone) )
		{
			validateAux=true
			strMsgAux = fnBuildString (strMsgAux,strPhone, strSep)
		}
		if ( isWhitespace(AuxBillingCity) )
		{
			validateAux=true
			strMsgAux = fnBuildString (strMsgAux,strCity, strSep)
		}
		if ( isWhitespace(AuxEmail) )
		{
			validateAux=true
			strMsgAux = fnBuildString (strMsgAux,strEmail, strSep)
		}
	}

	//BEGINNING OF TECHNICAL CONTACT FIELDS CHECK
	//if USE THE FOLLOWING INFORMATION is checked, do edits on required flds
	if (document.form1.OptTechnical[1].checked)
	{	//if required field is empty set error flag and build error msg string
		if ( isWhitespace(TechOrg) )
		{
//			validateTech=true
//			strMsgTech = fnBuildString (strMsgTech,strOrg, strSep)
		}
		else
		{
			if ( isWhitespace(TechJobTitle) )
			{
				validateTech=true
				strMsgTech = fnBuildString (strMsgTech,strJobTitle, strSep)
			}
			if ( isWhitespace(TechFax) )
			{
				validateTech=true
				strMsgTech = fnBuildString (strMsgTech,strFax, strSep)
			}
		}
		if ( isWhitespace(TechFName) )
		{
			validateTech=true
			strMsgTech = fnBuildString (strMsgTech,strFName, strSep)
		}
		if ( isWhitespace(TechLName) )
		{
			validateTech=true
			strMsgTech = fnBuildString (strMsgTech,strLName, strSep)
		}
		if ( isWhitespace(TechPhone) )
		{
			validateTech=true
			strMsgTech = fnBuildString (strMsgTech,strPhone, strSep)
		}
		if ( isWhitespace(TechCity) )
		{
			validateTech=true
			strMsgTech = fnBuildString (strMsgTech,strCity, strSep)
		}
		if ( isWhitespace(TechEmail) )
		{
			validateTech=true
			strMsgTech = fnBuildString (strMsgTech,strEmail, strSep)
		}
	}

	//DISPLAY THE POP UP MESSAGES
	//CHECK FOR AUX, REGISTRANT AND TECHNICAL VALIDATION ERRORS

	if (validateReg==true || validateAux==true || validateTech==true)
	{

		strSep = ":\n		"

		strMsgAll	= "_____________________________________________________\n\n";
		strMsgAll += "The form was not submitted because of the following error(s).\n";
		strMsgAll += "Please correct these error(s) and re-submit.\n";
		strMsgAll += "_____________________________________________________\n\n";

		// Build Registrant alert message
		if (validateReg==true)
		{
			strMsgAll = fnBuildString (strMsgAll, (fnBuildString(RegMsg, strMsgReg + "\n", strSep)), "\n")
		}

		// Build Aux alert message
		if (validateAux==true)
		{
			strMsgAll = fnBuildString (strMsgAll, (fnBuildString(AuxMsg, strMsgAux + "\n", strSep)), "\n")
		}

		// Build Technical alert message
		if (validateTech==true)
		{
			strMsgAll = fnBuildString(strMsgAll, (fnBuildString (TechMsg, strMsgTech, strSep)), "\n")
		}
		// display alert message
		alert(strMsgAll)
		//return to page without submitting form
		return false
	}
}

function DisableRegistrant()
{
	//document.form1.RegistrantOrg.value = document.form1.BillingOrg.value;


	document.form1.RegistrantOrg.disabled=true;
	document.form1.RegistrantFName.disabled=true;
	document.form1.RegistrantLName.disabled=true;
	document.form1.RegistrantJobTitle.disabled=true;
	document.form1.RegistrantAddress.disabled=true;
	document.form1.RegistrantAddress2.disabled=true;
	document.form1.RegistrantCity.disabled=true;
	document.form1.RegistrantStateProvinceChoice.disabled=true;
	document.form1.RegistrantState.disabled=true;
	document.form1.RegistrantProvince.disabled=true;
	document.form1.RegistrantZip.disabled=true;
	document.form1.RegistrantCountry.disabled=true;
	document.form1.RegistrantPhone.disabled=true;
	document.form1.RegistrantPhoneExt.disabled=true;
	document.form1.RegistrantPhoneDial.disabled=true;
	document.form1.RegistrantEmail.disabled=true;
	document.form1.RegistrantFax.disabled=true;
	document.form1.RegistrantFaxDial.disabled=true;
}

function EnableRegistrant(withvalues)
{


	document.form1.RegistrantOrg.disabled=false;
	document.form1.RegistrantFName.disabled=false;
	document.form1.RegistrantLName.disabled=false;
	document.form1.RegistrantJobTitle.disabled=false;
	document.form1.RegistrantAddress.disabled=false;
	document.form1.RegistrantAddress2.disabled=false;
	document.form1.RegistrantCity.disabled=false;
	document.form1.RegistrantStateProvinceChoice.disabled=false;
	document.form1.RegistrantState.disabled=false;
	document.form1.RegistrantProvince.disabled=false;
	document.form1.RegistrantZip.disabled=false;
	document.form1.RegistrantCountry.disabled=false;
	document.form1.RegistrantPhone.disabled=false;
	document.form1.RegistrantPhoneExt.disabled=false;
	document.form1.RegistrantPhoneDial.disabled=false;
	document.form1.RegistrantEmail.disabled=false;
	document.form1.RegistrantFax.disabled=false;
	document.form1.RegistrantFaxDial.disabled=false;

	document.form1.RegistrantOrg.focus();

	if (withvalues == true)
	{
		document.form1.RegistrantOrg.value ="";	 //document.form1.RegistrantOrg.value;
		document.form1.RegistrantFName.value="";	//document.form1.RegistrantFName.value;
		document.form1.RegistrantLName.value="";
		document.form1.RegistrantJobTitle.value="";
		document.form1.RegistrantAddress.value="";
		document.form1.RegistrantAddress2.value="";
		document.form1.RegistrantCity.value="";
		document.form1.RegistrantState.value="";
		document.form1.RegistrantProvince.value="";
		document.form1.RegistrantZip.value="";
		document.form1.RegistrantCountry.value="United States";
		document.form1.RegistrantPhone.value="";
		document.form1.RegistrantPhoneExt.value="";
		document.form1.RegistrantPhoneDial.selectedIndex=0;
		document.form1.RegistrantEmail.value="";
		document.form1.RegistrantFax.value="";
		document.form1.RegistrantFaxDial.selectedIndex=0;
	}

}

function DisableAdministrativeContact()
{
	//Disables the fields below.	This is used when a user selects
	// USE REGISTRANT INFO radiobutton in the Admin info section.

	document.form1.AdminOrg.disabled=true;
	document.form1.AdminFName.disabled=true;
	document.form1.AdminLName.disabled=true;
	document.form1.AdminJobTitle.disabled=true;
	document.form1.AdminAddress.disabled=true;
	document.form1.AdminAddress2.disabled=true;
	document.form1.AdminCity.disabled=true;
	document.form1.AdminStateProvinceChoice.disabled=true;
	document.form1.AdminState.disabled=true;
	document.form1.AdminProvince.disabled=true;
	document.form1.AdminZip.disabled=true;
	document.form1.AdminCountry.disabled=true;
	document.form1.AdminPhone.disabled=true;
	document.form1.AdminPhoneExt.disabled=true;
	document.form1.AdminPhoneDial.disabled=true;
	document.form1.AdminEmail.disabled=true;
	document.form1.AdminFax.disabled=true;
	document.form1.AdminFaxDial.disabled=true;

}

function EnableAdminContact(withvalues)
{
	//Denables the fields below.	This is used when a user selects
	// USE THE FOLLOWING INFO radiobutton in the Admin info section.
	document.form1.AdminOrg.disabled=false;
	document.form1.AdminFName.disabled=false;
	document.form1.AdminLName.disabled=false;
	document.form1.AdminJobTitle.disabled=false;
	document.form1.AdminAddress.disabled=false;
	document.form1.AdminAddress2.disabled=false;
	document.form1.AdminCity.disabled=false;
	document.form1.AdminStateProvinceChoice.disabled=false;
	document.form1.AdminState.disabled=false;
	document.form1.AdminProvince.disabled=false;
	document.form1.AdminZip.disabled=false;
	document.form1.AdminCountry.disabled=false;
	document.form1.AdminPhone.disabled=false;
	document.form1.AdminPhoneExt.disabled=false;
	document.form1.AdminPhoneDial.disabled=false;
	document.form1.AdminEmail.disabled=false;
	document.form1.AdminFax.disabled=false;
	document.form1.AdminFaxDial.disabled=false;

	document.form1.AdminOrg.focus();

	if (withvalues == true)
	{
		document.form1.AdminOrg.value ="";
		document.form1.AdminFName.value="";
		document.form1.AdminLName.value="";
		document.form1.AdminJobTitle.value="";
		document.form1.AdminAddress.value="";
		document.form1.AdminAddress2.value="";
		document.form1.AdminCity.value="";
		document.form1.AdminState.value="";
		document.form1.AdminProvince.value="";
		document.form1.AdminZip.value="";
		SelByVal(document.form1.AdminCountry, "United States");
		//document.form1.AdminProvince.value="";
		document.form1.AdminPhone.value="";
		document.form1.AdminPhoneExt.value="";
		document.form1.AdminPhoneDial.selectedIndex=0;
		document.form1.AdminEmail.value="";
		document.form1.AdminFax.value="";
		document.form1.AdminFaxDial.selectedIndex=0;
	}
}

function DisableAuxBilling()
{
	//Disables the fields below.	This is used when a user selects
	// USE REGISTRANT INFO radiobutton in the Aux Billing info section.

	document.form1.AuxBillingOrg.disabled=true;
	document.form1.AuxBillingFName.disabled=true;
	document.form1.AuxBillingLName.disabled=true;
	document.form1.AuxBillingJobTitle.disabled=true;
	document.form1.AuxBillingAddress.disabled=true;
	document.form1.AuxBillingAddress2.disabled=true;
	document.form1.AuxBillingCity.disabled=true;
	document.form1.AuxBillingStateProvinceChoice.disabled=true;
	document.form1.AuxBillingState.disabled=true;
	document.form1.AuxBillingProvince.disabled=true;
	document.form1.AuxBillingZip.disabled=true;
	document.form1.AuxBillingCountry.disabled=true;
	document.form1.AuxBillingPhone.disabled=true;
	document.form1.AuxBillingPhoneExt.disabled=true;
	document.form1.AuxBillingPhoneDial.disabled=true;
	document.form1.AuxBillingEmail.disabled=true;
	document.form1.AuxBillingFax.disabled=true;
	document.form1.AuxBillingFaxDial.disabled=true;

}

function EnableAuxBilling(withvalues)
{
	//Denables the fields below.	This is used when a user selects
	// USE THE FOLLOWING INFO radiobutton in the AUX Billing info section.
	document.form1.AuxBillingOrg.disabled=false;
	document.form1.AuxBillingFName.disabled=false;
	document.form1.AuxBillingLName.disabled=false;
	document.form1.AuxBillingJobTitle.disabled=false;
	document.form1.AuxBillingAddress.disabled=false;
	document.form1.AuxBillingAddress2.disabled=false;
	document.form1.AuxBillingCity.disabled=false;
	document.form1.AuxBillingStateProvinceChoice.disabled=false;
	document.form1.AuxBillingState.disabled=false;
	document.form1.AuxBillingProvince.disabled=false;
	document.form1.AuxBillingZip.disabled=false;
	document.form1.AuxBillingCountry.disabled=false;
	document.form1.AuxBillingPhone.disabled=false;
	document.form1.AuxBillingPhoneExt.disabled=false;
	document.form1.AuxBillingPhoneDial.disabled=false;
	document.form1.AuxBillingEmail.disabled=false;
	document.form1.AuxBillingFax.disabled=false;
	document.form1.AuxBillingFaxDial.disabled=false;

	document.form1.AuxBillingOrg.focus();

	if (withvalues == true)
	{
		document.form1.AuxBillingOrg.value ="";
		document.form1.AuxBillingFName.value="";
		document.form1.AuxBillingLName.value="";
		document.form1.AuxBillingJobTitle.value="";
		document.form1.AuxBillingAddress.value="";
		document.form1.AuxBillingAddress2.value="";
		document.form1.AuxBillingCity.value="";
		document.form1.AuxBillingState.selectedIndex=0;
		//document.form1.AuxBillingState.value="";
		document.form1.AuxBillingProvince.value="";
		document.form1.AuxBillingZip.value="";
		SelByVal(document.form1.AuxBillingCountry, "United States");
		//document.form1.AuxBillingCountry.value="United States";
		document.form1.AuxBillingPhone.value="";
		document.form1.AuxBillingPhoneExt.value="";
		document.form1.AuxBillingDial.selectedIndex=0;
		document.form1.AuxBillingEmail.value="";
		document.form1.AuxBillingFax.value="";
		document.form1.AuxBillingFaxDial.selectedIndex=0;
	}

}

function DisableTechnicalContact()
{
	//Disables the fields below.	This is used when a user selects
	// USE REGISTRANT INFO radiobutton in the Tech info section.

	document.form1.TechOrg.disabled=true;
	document.form1.TechFName.disabled=true;
	document.form1.TechLName.disabled=true;
	document.form1.TechJobTitle.disabled=true;
	document.form1.TechAddress.disabled=true;
	document.form1.TechAddress2.disabled=true;
	document.form1.TechCity.disabled=true;
	document.form1.TechStateProvinceChoice.disabled=true;
	document.form1.TechState.disabled=true;
	document.form1.TechProvince.disabled=true;
	document.form1.TechZip.disabled=true;
	document.form1.TechCountry.disabled=true;
	document.form1.TechPhone.disabled=true;
	document.form1.TechPhoneExt.disabled=true;
	document.form1.TechPhoneDial.disabled=true;
	document.form1.TechEmail.disabled=true;
	document.form1.TechFax.disabled=true;
	document.form1.TechFaxDial.disabled=true;

}

function EnableTechnicalContact(withvalues)
{
	//Denables the fields below.	This is used when a user selects
	// USE THE FOLLOWING INFO radiobutton in the Tech info section.
	document.form1.TechOrg.disabled=false;
	document.form1.TechFName.disabled=false;
	document.form1.TechLName.disabled=false;
	document.form1.TechJobTitle.disabled=false;
	document.form1.TechAddress.disabled=false;
	document.form1.TechAddress2.disabled=false;
	document.form1.TechCity.disabled=false;
	document.form1.TechStateProvinceChoice.disabled=false;
	document.form1.TechState.disabled=false;
	document.form1.TechProvince.disabled=false;
	document.form1.TechZip.disabled=false;
	document.form1.TechCountry.disabled=false;
	document.form1.TechPhone.disabled=false;
	document.form1.TechPhoneExt.disabled=false;
	document.form1.TechPhoneDial.disabled=false;
	document.form1.TechEmail.disabled=false;
	document.form1.TechFax.disabled=false;
	document.form1.TechFaxDial.disabled=false;

	document.form1.TechOrg.focus();

	if (withvalues == true)
	{
		document.form1.TechOrg.value ="";
		document.form1.TechFName.value="";
		document.form1.TechLName.value="";
		document.form1.TechJobTitle.value="";
		document.form1.TechAddress.value="";
		document.form1.TechAddress2.value="";
		document.form1.TechCity.value="";
		document.form1.TechState.value="";
		document.form1.TechProvince.value="";
		document.form1.TechZip.value="";
		SelByVal(document.form1.TechCountry, "United States");
		//document.form1.TechProvince.value="";
		document.form1.TechPhone.value="";
		document.form1.TechPhoneExt.value="";
		document.form1.TechPhoneDial.selectedIndex=0;
		document.form1.TechEmail.value="";
		document.form1.TechFax.value="";
		document.form1.TechFaxDial.selectedIndex=0;
	}
}


function RegistrantUseBillingInfo()
{

	document.form1.RegistrantOrg.value = document.form1.AuxBillingOrg.value;
	document.form1.RegistrantFName.value = document.form1.AuxBillingFName.value;
	document.form1.RegistrantLName.value = document.form1.AuxBillingLName.value;
	document.form1.RegistrantJobTitle.value = document.form1.AuxBillingJobTitle.value;
	document.form1.RegistrantAddress.value = document.form1.AuxBillingAddress.value;
	document.form1.RegistrantAddress2.value = document.form1.AuxBillingAddress2.value;
	document.form1.RegistrantCity.value = document.form1.AuxBillingCity.value;

	//copy the values and check the radiobtn
	if(document.form1.AuxBillingStateProvinceChoice[0].checked)
	{ // "State"

		for (var i = 0; i < document.form1.RegistrantState.length; i++)
		{
				if (document.form1.RegistrantState[i].value == document.form1.AuxBillingState.value)
			{
				document.form1.RegistrantState[i].selected = true;
			}
		}

		//document.form1.RegistrantState.selectedIndex = document.form1.BillingState.selectedIndex;
		document.form1.RegistrantProvince.value = "";
		document.form1.RegistrantStateProvinceChoice[0].checked = "1";
	}
	else
	{
		if(document.form1.AuxBillingStateProvinceChoice[1].checked)
		{ //"Province"
			document.form1.RegistrantState.selectedIndex = 0;
			document.form1.RegistrantProvince.value = document.form1.AuxBillingProvince.value;
			document.form1.RegistrantStateProvinceChoice[1].checked = "1";
		}
		else
		{	//None
			document.form1.RegistrantState.selectedIndex = 0;
			document.form1.RegistrantProvince.value = "";
			document.form1.RegistrantStateProvinceChoice[2].checked = "1";
		}
	}


	document.form1.RegistrantZip.value = document.form1.AuxBillingZip.value;
	document.form1.RegistrantCountry.value = document.form1.AuxBillingCountry.value;
	document.form1.RegistrantPhone.value = fnRemoveDialCode(document.form1.AuxBillingPhone.value);
	document.form1.RegistrantPhoneExt.value = document.form1.AuxBillingPhoneExt.value;
	document.form1.RegistrantEmail.value = document.form1.AuxBillingEmail.value;
	document.form1.RegistrantFax.value = fnRemoveDialCode(document.form1.AuxBillingFax.value);
	document.form1.RegistrantPhoneDial.value = document.form1.AuxBillingPhoneDial.value;
	document.form1.RegistrantFaxDial.value = document.form1.AuxBillingFaxDial.value;
	//document.form1.RegistrantPhoneDial.selectedIndex = fnGetDialCode(document.form1.BillingPhone.value);
	//document.form1.RegistrantFaxDial.selectedIndex = fnGetDialCode(document.form1.BillingFax.value);

	//disable all input flds
	DisableRegistrant();
}

function AdminUseBillingInfo()
{
	
	document.form1.AdminOrg.value = document.form1.AuxBillingOrg.value;
	document.form1.AdminFName.value = document.form1.AuxBillingFName.value;
	document.form1.AdminLName.value = document.form1.AuxBillingLName.value;
	document.form1.AdminJobTitle.value = document.form1.AuxBillingJobTitle.value;
	document.form1.AdminAddress.value = document.form1.AuxBillingAddress.value;
	document.form1.AdminAddress2.value = document.form1.AuxBillingAddress2.value;
	document.form1.AdminCity.value = document.form1.AuxBillingCity.value;

	if(document.form1.AuxBillingStateProvinceChoice[0].checked)
	{ // "State"
		for (var i = 0; i < document.form1.AdminState.length; i++)
		{
				if (document.form1.AdminState[i].value == document.form1.AuxBillingState.value)
			{
				document.form1.AdminState[i].selected = true;
			}
		}

		document.form1.AdminProvince.value = "";
		document.form1.AdminStateProvinceChoice[0].checked = "1";
	}
	else
	{
		if(document.form1.AuxBillingStateProvinceChoice[1].checked)
		{ //"Province"
			document.form1.AdminState.selectedIndex = 0;
			document.form1.AdminProvince.value = document.form1.AuxBillingProvince.value;
			document.form1.AdminStateProvinceChoice[1].checked = "1";
		}
		else
		{	//None
			document.form1.AdminState.selectedIndex = 0;
			document.form1.AdminProvince.value = "";
			document.form1.AdminStateProvinceChoice[2].checked = "1";
		}
	}

	document.form1.AdminZip.value = document.form1.AuxBillingZip.value;
	document.form1.AdminCountry.value = document.form1.AuxBillingCountry.value;
	document.form1.AdminPhone.value = fnRemoveDialCode(document.form1.AuxBillingPhone.value);
	document.form1.AdminPhoneExt.value = document.form1.AuxBillingPhoneExt.value;
	document.form1.AdminEmail.value = document.form1.AuxBillingEmail.value;
	document.form1.AdminFax.value = fnRemoveDialCode(document.form1.AuxBillingFax.value);
	document.form1.AdminPhoneDial.value = document.form1.AuxBillingPhoneDial.value;
	document.form1.AdminFaxDial.value = document.form1.AuxBillingFaxDial.value;
	//document.form1.AdminPhoneDial.selectedIndex = fnGetDialCode(document.form1.BillingPhone.value);
	//document.form1.AdminFaxDial.selectedIndex = fnGetDialCode(document.form1.BillingFax.value);

	//disable all input flds
	DisableAdministrativeContact()
}

function AdminUseRegistrantInfo()
{	//10/16/00 : Description : sets Admin Info values equal to Registrant values
	//when the Admin Info radiobutton, "Use the Registrant Information (Above)", is selected.
	document.form1.AdminOrg.value = document.form1.RegistrantOrg.value;
	document.form1.AdminFName.value = document.form1.RegistrantFName.value;
	document.form1.AdminLName.value = document.form1.RegistrantLName.value;
	document.form1.AdminJobTitle.value = document.form1.RegistrantJobTitle.value;
	document.form1.AdminAddress.value = document.form1.RegistrantAddress.value;
	document.form1.AdminAddress2.value = document.form1.RegistrantAddress2.value;
	document.form1.AdminCity.value = document.form1.RegistrantCity.value;

	//copy the values and check the radiobtn
	if(document.form1.RegistrantStateProvinceChoice[0].checked)
	{ // "State"
		document.form1.AdminState.selectedIndex = document.form1.RegistrantState.selectedIndex;
		document.form1.AdminProvince.value = "";
		document.form1.AdminStateProvinceChoice[0].checked = "1";
	}
	else
	{
		if(document.form1.RegistrantStateProvinceChoice[1].checked)
		{ //"Province"
			document.form1.AdminState.selectedIndex = 0;
			document.form1.AdminProvince.value = document.form1.RegistrantProvince.value;
			document.form1.AdminStateProvinceChoice[1].checked = "1";
		}
		else
		{	//None
			document.form1.AdminState.selectedIndex = 0;
			document.form1.AdminProvince.value = "";
			document.form1.AdminStateProvinceChoice[2].checked = "1";
		}
	}

	document.form1.AdminZip.value = document.form1.RegistrantZip.value;
	document.form1.AdminCountry.value = document.form1.RegistrantCountry.value;
	document.form1.AdminPhone.value = fnRemoveDialCode(document.form1.RegistrantPhone.value);
	document.form1.AdminEmail.value = document.form1.RegistrantEmail.value;
	document.form1.AdminFax.value = fnRemoveDialCode(document.form1.RegistrantFax.value);
	document.form1.AdminPhoneDial.value = document.form1.RegistrantPhoneDial.value;
	document.form1.AdminFaxDial.value = document.form1.RegistrantFaxDial.value;
	//document.form1.AdminPhoneDial.selectedIndex = fnGetDialCode(document.form1.RegistrantPhone.value);
	//document.form1.AdminFaxDial.selectedIndex = fnGetDialCode(document.form1.RegistrantFax.value);

	//disable all Admin input flds
	DisableAdministrativeContact()
}

function AuxUseBillingInfo()
{
	document.form1.AuxBillingOrg.value = document.form1.BillingOrgName.value;
	document.form1.AuxBillingFName.value = document.form1.BillingFName.value;
	document.form1.AuxBillingLName.value = document.form1.BillingLName.value;
	document.form1.AuxBillingJobTitle.value = document.form1.BillingJobTitle.value;
	document.form1.AuxBillingAddress.value = document.form1.BillingAddress1.value;
	document.form1.AuxBillingAddress2.value = document.form1.BillingAddress2.value;
	document.form1.AuxBillingCity.value = document.form1.BillingCity.value;

	if(document.form1.BillingStateProvinceChoice.value == "S")
	{ // "State"
		for (var i = 0; i < document.form1.AuxBillingState.length; i++)
		{
				if (document.form1.AuxBillingState[i].value == document.form1.BillingStateProvince.value)
			{
				document.form1.AuxBillingState[i].selected = true;
			}
		}
		document.form1.AuxBillingProvince.value = "";
		document.form1.AuxBillingStateProvinceChoice[0].checked = "1";
	}
	else
	{
		if(document.form1.BillingStateProvinceChoice.value == "P")
		{ //"Province"
			document.form1.AuxBillingState.selectedIndex = 0;
			document.form1.AuxBillingProvince.value = document.form1.BillingStateProvince.value;
			document.form1.AuxBillingStateProvinceChoice[1].checked = "1";
		}
		else
		{ //None
			document.form1.AuxBillingState.selectedIndex = 0;
			document.form1.AuxBillingProvince.value = "";
			document.form1.AuxBillingStateProvinceChoice[2].checked = "1";
		}
	}

	document.form1.AuxBillingZip.value = document.form1.BillingPostalCode.value;
	SelByVal(document.form1.AuxBillingCountry, document.form1.BillingFullCountry.value);
	document.form1.AuxBillingPhone.value = fnRemoveDialCode(document.form1.BillingPhone.value);
	document.form1.AuxBillingPhoneExt.value = document.form1.BillingPhoneExt.value;
	document.form1.AuxBillingEmail.value = document.form1.BillingEmailAddress.value;
	document.form1.AuxBillingFax.value = fnRemoveDialCode(document.form1.BillingFax.value);
	document.form1.AuxBillingPhoneDial.value = fnGetDialCode(document.form1.BillingPhone.value);
	document.form1.AuxBillingFaxDial.value = fnGetDialCode(document.form1.BillingFax.value);
	//document.form1.AuxBillingPhoneDial.selectedIndex = fnGetDialCode(document.form1.BillingPhone.value);
	//document.form1.AuxBillingFaxDial.selectedIndex = fnGetDialCode(document.form1.BillingFax.value);

	//disable all AUX input flds
	DisableAuxBilling()
}


function AuxUseRegistrantInfo()
{	//10/16/00 : Description : sets Aux billing values equal to Registrant values
	// when the aux billing radiobutton, "Use the Registrant Information (Above)", is selected.
	document.form1.AuxBillingOrg.value = document.form1.RegistrantOrg.value;
	document.form1.AuxBillingFName.value = document.form1.RegistrantFName.value;
	document.form1.AuxBillingLName.value = document.form1.RegistrantLName.value;
	document.form1.AuxBillingJobTitle.value = document.form1.RegistrantJobTitle.value;
	document.form1.AuxBillingAddress.value = document.form1.RegistrantAddress.value;
	document.form1.AuxBillingAddress2.value = document.form1.RegistrantAddress2.value;
	document.form1.AuxBillingCity.value = document.form1.RegistrantCity.value;
	//copy the values and check the radiobtn
	if(document.form1.RegistrantStateProvinceChoice[0].checked)
	{ // "State"
		document.form1.AuxBillingState.selectedIndex = document.form1.RegistrantState.selectedIndex;
		document.form1.AuxBillingProvince.value = "";
		document.form1.AuxBillingStateProvinceChoice[0].checked = "1";
	}
	else
	{
		if(document.form1.RegistrantStateProvinceChoice[1].checked)
		{ //"Province"
			document.form1.AuxBillingState.selectedIndex = 0;
			document.form1.AuxBillingProvince.value = document.form1.RegistrantProvince.value;
			document.form1.AuxBillingStateProvinceChoice[1].checked = "1";
		}
		else
		{	//None
			document.form1.AuxBillingState.selectedIndex = 0;
			document.form1.AuxBillingProvince.value = "";
			document.form1.AuxBillingStateProvinceChoice[2].checked = "1";
		}
	}
	//document.form1.AuxBillingState.value = document.form1.RegistrantState.value;

	document.form1.AuxBillingZip.value = document.form1.RegistrantZip.value;
	document.form1.AuxBillingCountry.value = document.form1.RegistrantCountry.value;
	document.form1.AuxBillingPhone.value = fnRemoveDialCode(document.form1.RegistrantPhone.value);
	document.form1.AuxBillingPhoneExt.value = document.form1.RegistrantPhoneExt.value;
	document.form1.AuxBillingEmail.value = document.form1.RegistrantEmail.value;
	document.form1.AuxBillingFax.value = fnRemoveDialCode(document.form1.RegistrantFax.value);
	document.form1.AuxBillingPhoneDial.value = document.form1.RegistrantPhoneDial.value;
	//document.form1.AuxBillingPhoneDial.selectedIndex = fnGetDialCode(document.form1.RegistrantPhone.value);
	document.form1.AuxBillingFaxDial.value = document.form1.RegistrantFaxDial.value;
	//document.form1.AuxBillingFaxDial.selectedIndex = fnGetDialCode(document.form1.RegistrantFax.value);
	//disable all AUX input flds
	DisableAuxBilling()
}


function TechUseBillingInfo()
{
	document.form1.TechOrg.value = document.form1.AuxBillingOrg.value;
	document.form1.TechFName.value = document.form1.AuxBillingFName.value;
	document.form1.TechLName.value = document.form1.AuxBillingLName.value;
	document.form1.TechJobTitle.value = document.form1.AuxBillingJobTitle.value;
	document.form1.TechAddress.value = document.form1.AuxBillingAddress.value;
	document.form1.TechAddress2.value = document.form1.AuxBillingAddress2.value;
	document.form1.TechCity.value = document.form1.AuxBillingCity.value;

	if(document.form1.AuxBillingStateProvinceChoice[0].checked)
	{ // "State"
		for (var i = 0; i < document.form1.TechState.length; i++)
		{
				if (document.form1.TechState[i].value == document.form1.AuxBillingState.value)
			{
				document.form1.TechState[i].selected = true;
			}
		}

		document.form1.TechProvince.value = "";
		document.form1.TechStateProvinceChoice[0].checked = "1";
	}
	else
	{
		if(document.form1.AuxBillingStateProvinceChoice[1].checked)
		{ //"Province"
			document.form1.TechState.selectedIndex = 0;
			document.form1.TechProvince.value = document.form1.AuxBillingProvince.value;
			document.form1.TechStateProvinceChoice[1].checked = "1";
		}
		else
		{	//None
			document.form1.TechState.selectedIndex = 0;
			document.form1.TechProvince.value = "";
			document.form1.TechStateProvinceChoice[2].checked = "1";
		}
	}

	document.form1.TechZip.value = document.form1.AuxBillingZip.value;
	document.form1.TechCountry.value = document.form1.AuxBillingCountry.value;
	document.form1.TechPhone.value = fnRemoveDialCode(document.form1.AuxBillingPhone.value);
	document.form1.TechPhoneExt.value = document.form1.AuxBillingPhoneExt.value;
	document.form1.TechEmail.value = document.form1.AuxBillingEmail.value;
	document.form1.TechFax.value = fnRemoveDialCode(document.form1.AuxBillingFax.value);
	document.form1.TechPhoneDial.value = document.form1.AuxBillingPhoneDial.value;
	document.form1.TechFaxDial.value = document.form1.AuxBillingFaxDial.value;

	//document.form1.TechPhoneDial.selectedIndex = fnGetDialCode(document.form1.BillingPhone.value);
	//document.form1.TechFaxDial.selectedIndex = fnGetDialCode(document.form1.BillingFax.value);
	//disable all input flds
	DisableTechnicalContact()
}

function TechUseRegistrantInfo()
{	//10/16/00 : Description : sets Tech Info values equal to Registrant values
	//when the Tech Info radiobutton, "Use the Registrant Information (Above)", is selected.
	document.form1.TechOrg.value = document.form1.RegistrantOrg.value;
	document.form1.TechJobTitle.value = document.form1.RegistrantJobTitle.value;
	document.form1.TechFName.value = document.form1.RegistrantFName.value;
	document.form1.TechLName.value = document.form1.RegistrantLName.value;
	document.form1.TechAddress.value = document.form1.RegistrantAddress.value;
	document.form1.TechAddress2.value = document.form1.RegistrantAddress2.value;
	document.form1.TechCity.value = document.form1.RegistrantCity.value;

	//copy the values and check the radiobtn
	if(document.form1.RegistrantStateProvinceChoice[0].checked)
	{ // "State"
		document.form1.TechState.selectedIndex = document.form1.RegistrantState.selectedIndex;
		document.form1.TechProvince.value = "";
		document.form1.TechStateProvinceChoice[0].checked = "1";
	}
	else
	{
		if(document.form1.RegistrantStateProvinceChoice[1].checked)
		{ //"Province"
			document.form1.TechState.selectedIndex = 0;
			document.form1.TechProvince.value = document.form1.RegistrantProvince.value;
			document.form1.TechStateProvinceChoice[1].checked = "1";
		}
		else
		{	//None
			document.form1.TechState.selectedIndex = 0;
			document.form1.TechProvince.value = "";
			document.form1.TechStateProvinceChoice[2].checked = "1";
		}
	}

	//document.form1.TechState.value = document.form1.RegistrantState.value;

	document.form1.TechZip.value = document.form1.RegistrantZip.value;
	document.form1.TechCountry.selectedIndex = document.form1.RegistrantCountry.selectedIndex;
	document.form1.TechPhone.value = fnRemoveDialCode(document.form1.RegistrantPhone.value);
	document.form1.TechPhoneExt.value = document.form1.RegistrantPhoneExt.value;
	document.form1.TechEmail.value = document.form1.RegistrantEmail.value;
	document.form1.TechFax.value = fnRemoveDialCode(document.form1.RegistrantFax.value);
	document.form1.TechPhoneDial.value = document.form1.RegistrantPhoneDial.value;
	document.form1.TechFaxDial.value = document.form1.RegistrantFaxDial.value;
	//document.form1.TechPhoneDial.selectedIndex = fnGetDialCode(document.form1.RegistrantPhone.value);
	//document.form1.TechFaxDial.selectedIndex = fnGetDialCode(document.form1.RegistrantFax.value);
	//disable all tech input flds
	DisableTechnicalContact()
}



function DisableFields()
{
	/*if ( document.form1.OptContactTech[0].checked == true )
		AuxUseBillingInfo();*/
	/*if ( document.form1.OptContactReg[0].checked == true )
		RegistrantUseBillingInfo();*/
	if ( document.form1.OptAdmin[0].checked == true )
		AdminUseRegistrantInfo();
	/*if ( document.form1.OptContactTech[1].checked == true )
		AuxUseRegistrantInfo();*/
	if ( document.form1.OptTechnical[0].checked == true )
		TechUseRegistrantInfo();
	/*if ( document.form1.OptTechnical[0].checked == true )
		TechUseBillingInfo();*/
	/*if ( document.form1.OptAdmin[0].checked == true )
		AdminUseBillingInfo();*/

	for (var i=0; i<document.form1.length; i++) {
		var elem = document.form1.elements[i];
		if (elem.name.indexOf('eu_') == 0) {
			elem.disabled = true;
		}
	}
}

//------------------------------------------------------------------------------

function DisableBilling()
{	//not being used currently 10/25/00
	//document.form1.AuxBillingFax.value=document.form1.RegistrantFax.value;
	document.form1.AuxBillingOrg.value = "";
	document.form1.AuxBillingFName.value="";
	document.form1.AuxBillingLName.value="";
	document.form1.AuxBillingJobTitle.value="";
	document.form1.AuxBillingAddress.value="";
	document.form1.AuxBillingAddress2.value="";
	document.form1.AuxBillingCity.value="";
	document.form1.AuxBillingState.value="";
	document.form1.AuxBillingProvince.value="";
	document.form1.AuxBillingZip.value="";
	//document.form1.AuxBillingCountry.value="";
	document.form1.AuxBillingCountry.selectedIndex=-1;
	document.form1.AuxBillingPhone.value="";
	document.form1.AuxBillingEmail.value="";
	document.form1.AuxBillingFax.value="";

	document.form1.AuxBillingOrg.disabled=true;
	document.form1.AuxBillingFName.disabled=true;
	document.form1.AuxBillingLName.disabled=true;
	document.form1.AuxBillingJobTitle.disabled=true;
	document.form1.AuxBillingAddress.disabled=true;
	document.form1.AuxBillingAddress2.disabled=true;
	document.form1.AuxBillingCity.disabled=true;
	document.form1.AuxBillingStateProvinceChoice.disabled=true;
	document.form1.AuxBillingState.disabled=true;
	document.form1.AuxBillingProvince.disabled=true;
	document.form1.AuxBillingZip.disabled=true;
	document.form1.AuxBillingCountry.disabled=true;
	document.form1.AuxBillingPhone.disabled=true;
	document.form1.AuxBillingEmail.disabled=true;
	document.form1.AuxBillingFax.disabled=true;

}

function EnableBilling(withvalues)
{	//being called under aux billing	: when selecting use following info
	document.form1.AuxBillingOrg.disabled=false;
	document.form1.AuxBillingFName.disabled=false;
	document.form1.AuxBillingLName.disabled=false;
	document.form1.AuxBillingJobTitle.disabled=false;
	document.form1.AuxBillingAddress.disabled=false;
	document.form1.AuxBillingAddress2.disabled=false;
	document.form1.AuxBillingCity.disabled=false;
	document.form1.AuxBillingStateProvinceChoice.disabled=false;
	document.form1.AuxBillingState.disabled=false;
	document.form1.AuxBillingProvince.disabled=false;
	document.form1.AuxBillingZip.disabled=false;
	document.form1.AuxBillingCountry.disabled=false;
	document.form1.AuxBillingPhone.disabled=false;
	document.form1.AuxBillingEmail.disabled=false;
	document.form1.AuxBillingFax.disabled=false;

	document.form1.AuxBillingOrg.focus(); //set the focus

	if (withvalues == true)
	{
		document.form1.AuxBillingOrg.value = "";	//document.form1.RegistrantOrg.value;
		document.form1.AuxBillingFName.value="";	//document.form1.RegistrantFName.value;
		document.form1.AuxBillingLName.value="";
		document.form1.AuxBillingJobTitle.value="";
		document.form1.AuxBillingAddress.value="";
		document.form1.AuxBillingAddress2.value="";
		document.form1.AuxBillingCity.value="";
		document.form1.AuxBillingState.value="";
		document.form1.AuxBillingProvince.value="";
		document.form1.AuxBillingZip.value="";
		SelByVal(document.form1.AuxBillingCountry, "United States");
		//document.form1.AuxBillingCountry.value="United States";
		document.form1.AuxBillingPhone.value="";
		document.form1.AuxBillingEmail.value="";
		document.form1.AuxBillingFax.value="";
	}

}

function MaketheSame()
{	//not being used currently	10/25/00

	document.form1.RegistrantOrg.value = document.form1.BillingOrg.value;
	document.form1.RegistrantFName.value = document.form1.BillingFName.value;
	document.form1.RegistrantLName.value = document.form1.BillingLName.value;
	document.form1.RegistrantAddress.value = document.form1.BillingAddress.value;
	document.form1.RegistrantCity.value = document.form1.BillingCity.value;
	document.form1.RegistrantState.value = document.form1.BillingState.value;
	document.form1.RegistrantZip.value = document.form1.BillingZip.value;

	if ( document.form1.RegistrantCountry.value != document.form1.BillingCountry.value )
	{
		var NewCountry
		NewCountry = document.createElement("OPTION");
		NewCountry.text = document.form1.BillingCountry.value;
		NewCountry.value = document.form1.BillingCountry.value;
		NewCountry.selected = 1
		document.form1.RegistrantCountry.add( NewCountry );
	}

	document.form1.RegistrantPhone.value = document.form1.BillingPhone.value;
	document.form1.RegistrantFax.value = document.form1.BillingFax.value;
	document.form1.RegistrantEmail.value = document.form1.BillingEmail.value;


	return;
}

function RenewWarn()
{	//not being used currently 10/25/00
	if ( !document.form1.Renew.checked )
	{
		alert( "If you uncheck this box this domain name will not be registered again when it expires." )
	}
}

function SelectedAuxNone()
{	//not being used currently 10/25/00	may be used by eNom in future
	document.form1.AuxBillingOrg.value = "";
	document.form1.AuxBillingFName.value="";
	document.form1.AuxBillingLName.value="";
	document.form1.AuxBillingJobTitle.value="";
	document.form1.AuxBillingAddress.value="";
	document.form1.AuxBillingAddress2.value="";
	document.form1.AuxBillingCity.value="";
	document.form1.AuxBillingState.value="";
	document.form1.AuxBillingZip.value="";
	//document.form1.AuxBillingCountry.value="";
	document.form1.AuxBillingCountry.selectedIndex=-1;
	document.form1.AuxBillingPhone.value="";
	document.form1.AuxBillingEmail.value="";
	document.form1.AuxBillingFax.value="";

	document.form1.AuxBillingOrg.disabled=true;
	document.form1.AuxBillingFName.disabled=true;
	document.form1.AuxBillingLName.disabled=true;
	document.form1.AuxBillingJobTitle.disabled=true;
	document.form1.AuxBillingAddress.disabled=true;
	document.form1.AuxBillingAddress2.disabled=true;
	document.form1.AuxBillingCity.disabled=true;
	document.form1.AuxBillingStateProvinceChoice.disabled=true;
	document.form1.AuxBillingState.disabled=true;
	document.form1.AuxBillingProvince.disabled=true;
	document.form1.AuxBillingZip.disabled=true;
	document.form1.AuxBillingCountry.disabled=true;
	document.form1.AuxBillingPhone.disabled=true;
	document.form1.AuxBillingEmail.disabled=true;
	document.form1.AuxBillingFax.disabled=true;
}


function NoNameServers()
{	//not being used currently 10/25/00
	document.form1.Name1.value="";
	document.form1.Name2.value="";
	document.form1.Name3.value="";
	document.form1.Name4.value="";
	document.form1.Name5.value="";
	document.form1.Name6.value="";

	document.form1.Name1.disabled=true;
	document.form1.Name2.disabled=true;
	document.form1.Name3.disabled=true;
	document.form1.Name4.disabled=true;
	document.form1.Name5.disabled=true;
	document.form1.Name6.disabled=true;
}

function DisableNameServers()
{	//not being used currently 10/25/00
	document.form1.Name1.value=document.form1.EnomSrv1.value;
	document.form1.Name2.value=document.form1.EnomSrv2.value;
	document.form1.Name3.value=document.form1.EnomSrv3.value;
	document.form1.Name4.value=document.form1.EnomSrv4.value;
	document.form1.Name5.value="";
	document.form1.Name6.value="";

	document.form1.Name1.disabled=true;
	document.form1.Name2.disabled=true;
	document.form1.Name3.disabled=true;
	document.form1.Name4.disabled=true;
	document.form1.Name5.disabled=true;
	document.form1.Name6.disabled=true;
}

function EnableNameServers()
{	//not being used currently	10/25/00
	document.form1.Name1.disabled=false;
	document.form1.Name2.disabled=false;
	document.form1.Name3.disabled=false;
	document.form1.Name4.disabled=false;
	document.form1.Name5.disabled=false;
	document.form1.Name6.disabled=false;

	if (typeof(n1) == 'undefined')
	{
		CacheNameServers();
		EnableNameServers();
	}
	else
	{
		document.form1.Name1.value=n1;
		document.form1.Name2.value=n2;
		document.form1.Name3.value=n3;
		document.form1.Name4.value=n4;
		document.form1.Name5.value=n5;
		document.form1.Name6.value=n6;
		CacheNameServers();
	}
}

function CacheNameServers()
{	//not being used currently
	if (typeof(n1) == 'undefined')	//this is first time through
	{								// grab from hidden FORM inputs
		n1=document.form1.OrigSrvr1.value;
		n2=document.form1.OrigSrvr2.value;
		n3=document.form1.OrigSrvr3.value;
		n4=document.form1.OrigSrvr4.value;
		n5=document.form1.OrigSrvr5.value;
		n6=document.form1.OrigSrvr6.value;
	}
	else							//all other times
	{								// get from changed entry
		if (document.form1.NameServers[2].checked==true)
		{
			n1=document.form1.Name1.value;
			n2=document.form1.Name2.value;
			n3=document.form1.Name3.value;
			n4=document.form1.Name4.value;
			n5=document.form1.Name5.value;
			n6=document.form1.Name6.value;
		}
	}
}

function btnDelete_onclick()
{		//not being used currently 10/25/00
var msg="Are you sure you want to delete this domain?";
var TLD=document.form1.TLD.value
var SLD=document.form1.SLD.value

if (confirm(msg))
	document.location.replace("DeleteDomain.asp?TLD=" + TLD + "&SLD=" + SLD);
}

function SelByVal(ele, s)
{
	if (ele)
	{
		for (i=0;i<ele.options.length;i++)
		{
			if (ele.options[i].text.toUpperCase()==s.toUpperCase())
			{
				ele.options.selectedIndex=i;
				break;
			}
		}
	}
}

