function checkDomain() {
	if (document.checkdomain.domain_name.value == "") {
		alert("Please Enter Your Domain Name!");
		return false;
	}

	document.checkdomain.submit();

} // End of registerDomain() function

function check_domain_form() {
	var totalcheck = 0;

	if (document.register.domains.length == null) {
		if (!document.register.domains.checked) {
      	alert("Please select the domain(s) available!");
			return false;
		}
	}
	else {
		for (i = 0; i < document.register.domains.length; i++) {
			if (document.register.domains[i].checked) {
				totalcheck++;
			}
		}

		if (totalcheck <= 0) {
			alert("Please select at least one domain to transfer/renew!");
			return false;
		}
	}

	document.register.submit();

} // End of check_form() function

function trimAll(strValue) {
   var objRegExp = /^(\s*)$/;
   
   //check for all spaces
   if(objRegExp.test(strValue)) {
      strValue = strValue.replace(objRegExp, '');
      if( strValue.length == 0)
         return strValue;
   }

   //check for leading & trailing spaces
   objRegExp = /^(\s*)([\W\w]*)(\b\s*$)/;
   
   if(objRegExp.test(strValue)) {
      strValue = strValue.replace(objRegExp, '$2');
   }
   
   return strValue;

} // End of trimAll() function

function toggle_tech() {
	if (document.register.tech_same.checked == true) {
		hide_tech();
	}
	else {
		show_tech();
	}

} // End of toggle_tech() function

function show_tech() {
	document.getElementById('tech').style.display="block"; 

} // End of show_tech() function

function hide_tech() {
	document.getElementById('tech').style.display="none";

} // End of hide_tech() function

function toggle_billing() {
	if (document.register.billing_same.checked == true) {
		hide_billing();
	}
	else {
		show_billing();
	}

} // End of toggle_billing() function

function show_billing() {
	document.getElementById('billing').style.display="block"; 

} // End of show_billing() function

function hide_billing() {
	document.getElementById('billing').style.display="none";

} // End of hide_billing() function

function checkTerms() {
	if (document.register.terms.checked == true) {
 		return confirm('Please be patient while your order is processed. It may take a few minutes.')	
	}
	else {
		alert('You must agree to the terms and conditions to complete this order.');
		return false;
	}
		
} // End of checkTerms() function