function PopUpDomainChecker()
{
	DomainChecker=window.open('/domain_checker.php','DomainChecker','width=400,height=338,');
	DomainChecker.opener.name="opener";
}

function AddDomain(domain)
{
	var current = parent.opener.document.BulkDomainsForm.domain_blob.value;
	if(current != "")
	{
		current = current + "\n" + domain;
	}
	else
	{
		current = domain;
	}
	parent.opener.document.BulkDomainsForm.domain_blob.value=current;
	parent.opener.document.BulkDomainsForm.domain_blob.focus();
}

function FillInAdmin(IsChecked) 
{
	if(IsChecked)
   {
   	// fill in the fields from the registrant
      document.ContactForm.admin_first_name.value = document.ContactForm.registrant_first_name.value;
      document.ContactForm.admin_last_name.value = document.ContactForm.registrant_last_name.value;
      document.ContactForm.admin_email.value = document.ContactForm.registrant_email.value;
      document.ContactForm.admin_title.value = document.ContactForm.registrant_title.value;
      document.ContactForm.admin_org_name.value = document.ContactForm.registrant_org_name.value;
      document.ContactForm.admin_address.value = document.ContactForm.registrant_address.value;
      document.ContactForm.admin_city.value = document.ContactForm.registrant_city.value;
      document.ContactForm.admin_state.value = document.ContactForm.registrant_state.value;
      document.ContactForm.admin_zip.value = document.ContactForm.registrant_zip.value;
      document.ContactForm.admin_country.value = document.ContactForm.registrant_country.value;
      document.ContactForm.admin_country_phone_code.value = document.ContactForm.registrant_country_phone_code.value;
		document.ContactForm.admin_phone_number.value = document.ContactForm.registrant_phone_number.value;
		
		
      // disable the fields
      document.ContactForm.admin_first_name.disabled=true;
      document.ContactForm.admin_last_name.disabled=true;
      document.ContactForm.admin_email.disabled=true;
      document.ContactForm.admin_title.disabled=true;
      document.ContactForm.admin_org_name.disabled=true;
      document.ContactForm.admin_address.disabled=true;
      document.ContactForm.admin_city.disabled=true;
      document.ContactForm.admin_state.disabled=true;
      document.ContactForm.admin_zip.disabled=true;
      document.ContactForm.admin_country.disabled=true;
      document.ContactForm.admin_country_phone_code.disabled=true;
		document.ContactForm.admin_phone_number.disabled=true;
		
   }
   else
   {
   	// empty the fields
      document.ContactForm.admin_first_name.value = "";
      document.ContactForm.admin_last_name.value = "";
      document.ContactForm.admin_email.value = "";
      document.ContactForm.admin_title.value = "";
      document.ContactForm.admin_org_name.value = "";
      document.ContactForm.admin_address.value = "";
      document.ContactForm.admin_city.value = "";
      document.ContactForm.admin_state.value = "";
      document.ContactForm.admin_zip.value = "";
      document.ContactForm.admin_country.value = "US";
      document.ContactForm.admin_country_phone_code.value = "1";
		document.ContactForm.admin_phone_number.value = "";
		
      // enable the fields
      document.ContactForm.admin_first_name.disabled=false;
      document.ContactForm.admin_last_name.disabled=false;
      document.ContactForm.admin_email.disabled=false;
      document.ContactForm.admin_title.disabled=false;
      document.ContactForm.admin_org_name.disabled=false;
      document.ContactForm.admin_address.disabled=false;
      document.ContactForm.admin_city.disabled=false;
      document.ContactForm.admin_state.disabled=false;
      document.ContactForm.admin_zip.disabled=false;
      document.ContactForm.admin_country.disabled=false;
      document.ContactForm.admin_country_phone_code.disabled=false;
		document.ContactForm.admin_phone_number.disabled=false;
   }
}


function FillInBilling(IsChecked) 
{
	if(IsChecked)
   {
   	// fill in the fields from the registrant
      document.ContactForm.billing_first_name.value = document.ContactForm.registrant_first_name.value;
      document.ContactForm.billing_last_name.value = document.ContactForm.registrant_last_name.value;
      document.ContactForm.billing_email.value = document.ContactForm.registrant_email.value;
      document.ContactForm.billing_title.value = document.ContactForm.registrant_title.value;
      document.ContactForm.billing_org_name.value = document.ContactForm.registrant_org_name.value;
      document.ContactForm.billing_address.value = document.ContactForm.registrant_address.value;
      document.ContactForm.billing_city.value = document.ContactForm.registrant_city.value;
      document.ContactForm.billing_state.value = document.ContactForm.registrant_state.value;
      document.ContactForm.billing_zip.value = document.ContactForm.registrant_zip.value;
      document.ContactForm.billing_country.value = document.ContactForm.registrant_country.value;
      document.ContactForm.billing_country_phone_code.value = document.ContactForm.registrant_country_phone_code.value;
		document.ContactForm.billing_phone_number.value = document.ContactForm.registrant_phone_number.value;
      
		// disable the fields
      document.ContactForm.billing_first_name.disabled=true;
      document.ContactForm.billing_last_name.disabled=true;
      document.ContactForm.billing_email.disabled=true;
      document.ContactForm.billing_title.disabled=true;
      document.ContactForm.billing_org_name.disabled=true;
      document.ContactForm.billing_address.disabled=true;
      document.ContactForm.billing_city.disabled=true;
      document.ContactForm.billing_state.disabled=true;
      document.ContactForm.billing_zip.disabled=true;
      document.ContactForm.billing_country.disabled=true;
      document.ContactForm.billing_country_phone_code.disabled=true;
		document.ContactForm.billing_phone_number.disabled=true;
   }
   else
   {
   	// empty the fields
      document.ContactForm.billing_first_name.value = "";
      document.ContactForm.billing_last_name.value = "";
      document.ContactForm.billing_email.value = "";
      document.ContactForm.billing_title.value = "";
      document.ContactForm.billing_org_name.value = "";
      document.ContactForm.billing_address.value = "";
      document.ContactForm.billing_city.value = "";
      document.ContactForm.billing_state.value = "";
      document.ContactForm.billing_zip.value = "";
      document.ContactForm.billing_country.value = "US";
      document.ContactForm.billing_country_phone_code.value = "1";
		document.ContactForm.billing_phone_number.value = "";
		
      // enable the fields
      document.ContactForm.billing_first_name.disabled=false;
      document.ContactForm.billing_last_name.disabled=false;
      document.ContactForm.billing_email.disabled=false;
      document.ContactForm.billing_title.disabled=false;
      document.ContactForm.billing_org_name.disabled=false;
      document.ContactForm.billing_address.disabled=false;
      document.ContactForm.billing_city.disabled=false;
      document.ContactForm.billing_state.disabled=false;
      document.ContactForm.billing_zip.disabled=false;
      document.ContactForm.billing_country.disabled=false;
      document.ContactForm.billing_country_phone_code.disabled=false;
		document.ContactForm.billing_phone_number.disabled=false;
   
   }
}

function FillInTech(IsChecked) 
{
	if(IsChecked)
   {
   	// fill in the fields from the registrant
      document.ContactForm.tech_first_name.value = document.ContactForm.registrant_first_name.value;
      document.ContactForm.tech_last_name.value = document.ContactForm.registrant_last_name.value;
      document.ContactForm.tech_email.value = document.ContactForm.registrant_email.value;
      document.ContactForm.tech_title.value = document.ContactForm.registrant_title.value;
      document.ContactForm.tech_org_name.value = document.ContactForm.registrant_org_name.value;
      document.ContactForm.tech_address.value = document.ContactForm.registrant_address.value;
      document.ContactForm.tech_city.value = document.ContactForm.registrant_city.value;
      document.ContactForm.tech_state.value = document.ContactForm.registrant_state.value;
      document.ContactForm.tech_zip.value = document.ContactForm.registrant_zip.value;
      document.ContactForm.tech_country.value = document.ContactForm.registrant_country.value;
     	document.ContactForm.tech_country_phone_code.value = document.ContactForm.registrant_country_phone_code.value;
		document.ContactForm.tech_phone_number.value = document.ContactForm.registrant_phone_number.value;
      
		// disable the fields
      document.ContactForm.tech_first_name.disabled=true;
      document.ContactForm.tech_last_name.disabled=true;
      document.ContactForm.tech_email.disabled=true;
      document.ContactForm.tech_title.disabled=true;
      document.ContactForm.tech_org_name.disabled=true;
      document.ContactForm.tech_address.disabled=true;
      document.ContactForm.tech_city.disabled=true;
      document.ContactForm.tech_state.disabled=true;
      document.ContactForm.tech_zip.disabled=true;
      document.ContactForm.tech_country.disabled=true;
      document.ContactForm.tech_country_phone_code.disabled=true;
		document.ContactForm.tech_phone_number.disabled=true;
		
   }
   else
   {
   	// empty the fields
      document.ContactForm.tech_first_name.value = "";
      document.ContactForm.tech_last_name.value = "";
      document.ContactForm.tech_email.value = "";
      document.ContactForm.tech_title.value = "";
      document.ContactForm.tech_org_name.value = "";
      document.ContactForm.tech_address.value = "";
      document.ContactForm.tech_city.value = "";
      document.ContactForm.tech_state.value = "";
      document.ContactForm.tech_zip.value = "";
      document.ContactForm.tech_country.value = "US";
      document.ContactForm.tech_country_phone_code.value = "1";
		document.ContactForm.tech_phone_number.value = "";
		
      // enable the fields
      document.ContactForm.tech_first_name.disabled=false;
      document.ContactForm.tech_last_name.disabled=false;
      document.ContactForm.tech_email.disabled=false;
      document.ContactForm.tech_title.disabled=false;
      document.ContactForm.tech_org_name.disabled=false;
      document.ContactForm.tech_address.disabled=false;
      document.ContactForm.tech_city.disabled=false;
      document.ContactForm.tech_state.disabled=false;
      document.ContactForm.tech_zip.disabled=false;
      document.ContactForm.tech_country.disabled=false;
      document.ContactForm.tech_country_phone_code.disabled=false;
		document.ContactForm.tech_phone_number.disabled=false;
   }
}

function ForwardingNameservers()
{
	document.ContactForm.fqdn1.value = "";
	document.ContactForm.fqdn2.value = "";
	document.ContactForm.fqdn1.disabled=true;
	document.ContactForm.fqdn2.disabled=true;	
}

function HostingNameservers()
{
	document.ContactForm.fqdn1.value = "";
	document.ContactForm.fqdn2.value = "";
	document.ContactForm.fqdn1.disabled=true;
	document.ContactForm.fqdn2.disabled=true;	
}

function CustomNameservers()
{
	document.ContactForm.fqdn1.value = "";
	document.ContactForm.fqdn2.value = "";
	document.ContactForm.fqdn1.disabled=false;
	document.ContactForm.fqdn2.disabled=false;
}

function NewCustomer()
{
	document.CCForm.existing_email.disabled=true;
   document.CCForm.existing_email.value="";
   document.CCForm.customer_first_name.disabled=false;
   document.CCForm.customer_last_name.disabled=false;
   document.CCForm.customer_password.disabled=false;
   document.CCForm.customer_confirm_password.disabled=false;
   document.CCForm.customer_pri_email.disabled=false;
   document.CCForm.customer_sec_email.disabled=false;
   document.CCForm.customer_pri_email.focus();
}

function ExistingCustomer()
{
	document.CCForm.existing_email.disabled=false;
   document.CCForm.customer_first_name.disabled=true;
   document.CCForm.customer_last_name.disabled=true;
   document.CCForm.customer_password.disabled=true;
   document.CCForm.customer_confirm_password.disabled=true;
   document.CCForm.customer_pri_email.disabled=true;
   document.CCForm.customer_sec_email.disabled=true;
   document.CCForm.customer_first_name.value="";
   document.CCForm.customer_last_name.value="";
   document.CCForm.customer_password.value="";
   document.CCForm.customer_confirm_password.value="";
   document.CCForm.customer_pri_email.value="";
   document.CCForm.customer_sec_email.value="";
   document.CCForm.existing_email.focus();
}

function CheckWhoisProtectionAgreement()
{
	if (document.domain_owner_contact_form.whois_protection_agreement.checked != true)
	{
		alert ('Error: You must check the checkbox next to the Whois ID Protection Terms in order to continue.');	
		return false;
	}
	else
	{
		return true;
	}
}

