// JavaScript Document
<!--
function GetObj(objName){
	if(document.getElementById){
		return eval('document.getElementById("' + objName + '")');
	}else if(document.layers){
		return eval("document.layers['" + objName +"']");
	}else{
		return eval('document.all.' + objName);
	}
} 
var PreloadImg = function(){
	var preloadImages = new Array();
	for(var i=0;i<arguments.length;i++){
		preloadImages[0] = new Image();
		preloadImages[0].src = arguments[i];
	}
}
function SetLbl(objId, cClass, cCon, hCon, dCon){
	GetObj(objId).className = cClass;
	GetObj(cCon).style.display = "block";
	GetObj(hCon).style.display = "none";
	GetObj(dCon).style.display = "none";
}   
PreloadImg()
function SetLb(objId, aClass, aCon, bCon){
	GetObj(objId).className = aClass;
	GetObj(aCon).style.display = "block";
	GetObj(bCon).style.display = "none";
} 
function mover(src,clrOver){ 
	src.bgColor = clrOver; 
}
function mout(src,clrout)  { 
	src.bgColor = clrout; 
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function popupAntispamDemo(url) {
	window.open(url,"blank",'width=800,height=500,scrollbars=yes,resizable=yes,status=no,toolbars=no');
}

function popupEcomDemo(url) {
	window.open(url,"blank",'width=800,height=500,scrollbars=yes,resizable=yes,status=no,toolbars=no');
}
function popupGlossary(url) {
	newwin  = window.open(url,"glossary",'width=500,height=300,scrollbars=yes,resizable=yes,status=no,toolbars=no');
	newwin.focus();
}
function popupComparisonChart(url) {
	newwin  = window.open(url,"glossary",'width=700,height=700,scrollbars=yes,resizable=yes,status=no,toolbars=no');
	newwin.focus();
}
function popupUVoice(url) {
	newwin  = window.open(url,"UVoice",'width=250,height=500,scrollbars=no,resizable=no,status=no,toolbars=no');
	newwin.focus();
}
function selectPlan(thisForm) {
	if (thisForm.sid.selectedIndex==0) {
		alert("Please select a package");
		return false;
	}
	return true;
}
function checkdomain(thisForm){
	if (thisForm.domain1.value == "" && thisForm.domain2.value == ""){
		alert("Please enter your domain name");
		return false;
	}
	return true;
}

function isEmail(field) {
  var pattern = /^([a-zA-Z0-9_\.-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/;
  return pattern.test(field);
  }
  

function checkValue(thisForm) {
if (thisForm.rCompanyName.value == ""){
	alert("Please input Domain Owner/Administrative Contact's company name.");
	thisForm.rCompanyName.focus();
	return false;
	}
if (thisForm.rSurname.value == ""){
	alert("Please input Domain Owner/Administrative Contact's surname.");
	thisForm.rSurname.focus();
	return false;
	}
if (thisForm.rOtherName.value == ""){
	alert("Please input Domain Owner/Administrative Contact's other name.");
	thisForm.rOtherName.focus();
	return false;
	}
if (thisForm.rEmail.value == ""){
	alert("Please input Domain Owner/Administrative Contact's email address");
	thisForm.rEmail.focus();
	return false;
	}
if(isEmail(thisForm.rEmail.value) == false){
	alert("Please input a valid Domain Owner/Administrative Contact's email address");
	thisForm.rEmail.focus();
	return false;
	}	
if (thisForm.rTel.value == ""){
	alert("Please input Domain Owner/Administrative Contact's contact number");
	thisForm.rTel.focus();
	return false;
	}

if (thisForm.rAdd1.value == "" && thisForm.rAdd2.value == "" && thisForm.rAdd3.value == ""){
	alert("Please input Domain Owner/Administrative Contact's Address");
	thisForm.rAdd1.focus();
	return false;
}


if (thisForm.bCompanyName.value == ""){
	alert("Please input Billing Contact's company name.");
	thisForm.bCompanyName.focus();
	return false;
	}
if (thisForm.bSurname.value == ""){
	alert("Please input Billing Contact's surname.");
	thisForm.bSurname.focus();
	return false;
	}
if (thisForm.bOtherName.value == ""){
	alert("Please input Billing Contact's other name.");
	thisForm.bOtherName.focus();
	return false;
	}
if (thisForm.bEmail.value == ""){
	alert("Please input Billing Contact's email address");
	thisForm.bEmail.focus();
	return false;
	}
if(isEmail(thisForm.bEmail.value) == false){
	alert("Please input a valid Billing Contact's email address");
	thisForm.bEmail.focus();
	return false;
	}
if (thisForm.bTel.value == ""){
	alert("Please input Billing Contact's contact number");
	thisForm.bTel.focus();
	return false;
	}

if (thisForm.bAdd1.value == "" && thisForm.bAdd2.value == "" && thisForm.bAdd3.value == ""){
	alert("Please input Billing Contact's Address");
	thisForm.bAdd1.focus();
	return false;
}


isChecked = 0;
if (thisForm.printAdCheck.checked){
    if(thisForm.PrintedAdvertisingFrom.selectedIndex == 0){
        alert("Please select Print Advertising Type");
        return false;
    }
    isChecked = 1;
}
if (thisForm.outdoorAdCheck.checked){ 
    if (thisForm.OutdoorAdvertisingFrom.selectedIndex == 0){
    alert("Please select Outdoor Advertising Type");
	return false;
    }
    isChecked = 1;
}
if (thisForm.onlineAdCheck.checked){
    if (thisForm.BannerAdvertingFrom.selectedIndex == 0){
         alert("Please select Banner Advertising Type");
	    return false;
    }
    isChecked = 1;
}
if (thisForm.searchAdCheck.checked){
    if (thisForm.SearchEngineFrom.selectedIndex == 0){
        alert("Please select Search Engine Type");
	    return false;
    }
    isChecked = 1;
}
if (thisForm.otherCheck.checked){
    if (thisForm.OthersNotes.value == ""){
        alert("Please enter specify where you learn from UDomain");
		thisForm.OthersNotes.focus();
	    return false;
    }
    isChecked = 1;
}
if (thisForm.exhibitionCheck.checked){
    isChecked = 1;
}
if (thisForm.friendsCheck.checked){
    isChecked = 1;
}
if (thisForm.otherCheck.checked){
    isChecked = 1;
}

if (isChecked ==0){
    alert("How did you learn about UDomain services?");
	return false;
}
if (!thisForm.agreement.checked=="1") {
	alert("Please check the agreement box.");
	return false;
	}

	}
	
	function cp_reg2bill(thisForm) {
		if (thisForm.copybox.checked == true) {
			thisForm.bCompanyName.value = thisForm.rCompanyName.value;
			thisForm.bSurname.value = thisForm.rSurname.value;
			thisForm.bOtherName.value = thisForm.rOtherName.value;
			thisForm.bEmail.value = thisForm.rEmail.value;
			thisForm.bTel.value = thisForm.rTel.value;
			thisForm.bFax.value = thisForm.rFax.value;
			thisForm.bMobile.value = thisForm.rMobile.value;
			thisForm.bAdd1.value = thisForm.rAdd1.value;
			thisForm.bAdd2.value = thisForm.rAdd2.value;
			thisForm.bAdd3.value = thisForm.rAdd3.value;
		} else {
			thisForm.bCompanyName.value = "";
			thisForm.bSurname.value = "";
			thisForm.bOtherName.value = "";
			thisForm.bEmail.value = "";
			thisForm.bTel.value = "";
			thisForm.bFax.value = "";
			thisForm.bMobile.value = "";
			thisForm.bAdd1.value = "";
			thisForm.bAdd2.value = "";
			thisForm.bAdd3.value = "";
		}
	}
function ChangeLang(fromlang,tolang)
{
	tempurl = window.location.href
	if (tempurl.search(fromlang) != -1)
	{
		tempurl = tempurl.replace(fromlang, tolang);
		//alert(tempurl);
		window.location.href = tempurl
	}
}