function Verify(nname, newdomain)
{

var arr = new Array(
'.com','.net','.org','.biz','.coop','.info','.museum','.name',
'.pro','.edu','.gov','.int','.mil','.ac','.ad','.ae','.af','.ag',
'.ai','.al','.am','.an','.ao','.aq','.ar','.as','.at','.au','.aw',
'.az','.ba','.bb','.bd','.be','.bf','.bg','.bh','.bi','.bj','.bm',
'.bn','.bo','.br','.bs','.bt','.bv','.bw','.by','.bz','.ca','.cc',
'.cd','.cf','.cg','.ch','.ci','.ck','.cl','.cm','.cn','.co','.cr',
'.cu','.cv','.cx','.cy','.cz','.de','.dj','.dk','.dm','.do','.dz',
'.ec','.ee','.eg','.eh','.er','.es','.et','.eu','.fi','.fj','.fk','.fm',
'.fo','.fr','.ga','.gd','.ge','.gf','.gg','.gh','.gi','.gl','.gm',
'.gn','.gp','.gq','.gr','.gs','.gt','.gu','.gv','.gy','.hk','.hm',
'.hn','.hr','.ht','.hu','.id','.ie','.il','.im','.in','.io','.iq',
'.ir','.is','.it','.je','.jm','.jo','.jp','.ke','.kg','.kh','.ki',
'.km','.kn','.kp','.kr','.kw','.ky','.kz','.la','.lb','.lc','.li',
'.lk','.lr','.ls','.lt','.lu','.lv','.ly','.ma','.mc','.md','.mg',
'.mh','.mk','.ml','.mm','.mn','.mo','.mp','.mq','.mr','.ms','.mt',
'.mu','.mv','.mw','.mx','.my','.mz','.na','.nc','.ne','.nf','.ng',
'.ni','.nl','.no','.np','.nr','.nu','.nz','.om','.pa','.pe','.pf',
'.pg','.ph','.pk','.pl','.pm','.pn','.pr','.ps','.pt','.pw','.py',
'.qa','.re','.ro','.rw','.ru','.sa','.sb','.sc','.sd','.se','.sg',
'.sh','.si','.sj','.sk','.sl','.sm','.sn','.so','.sr','.st','.sv',
'.sy','.sz','.tc','.td','.tf','.tg','.th','.tj','.tk','.tm','.tn',
'.to','.tp','.tr','.tt','.tv','.tw','.tz','.ua','.ug','.uk','.um',
'.us','.uy','.uz','.va','.vc','.ve','.vg','.vi','.vn','.vu','.ws',
'.wf','.ye','.yt','.yu','.za','.zm','.zw');

var arr2 = new Array('.com','.net','.org','.biz','.info');

var mai = nname;
var val = true;
var newd = newdomain;

var dot = mai.lastIndexOf(".");
var dname = mai.substring(0,dot);
var ext = mai.substring(dot,mai.length);
//alert(ext);
	
if(dot>2 && dot<57)
{    
	for(var i=0; i<arr.length; i++)
	{
	  if(ext == arr[i])
	  {
	 	val = true;
		break;
	  }	
	  
	  else
	  {
	 	val = false;
	  }
	}
	if(val == false)
	{
	  	 alert("Your domain extension "+ext+" is not correct - you can only use .com .net .org .info as new domains");
		 return false;
	}
	else
	{
		for(var j=0; j<dname.length; j++)
		{
		  var dh = dname.charAt(j);
		  var hh = dh.charCodeAt(0);
		  if((hh > 47 && hh<59) || (hh > 64 && hh<91) || (hh > 96 && hh<123) || hh==45 || hh==46)
		  {
			 if((j==0 || j==dname.length-1) && hh == 45)	
		  	 {
		 	  	 alert("Domain name should not begin or end with '-'");
			      return false;
		 	 }
		  }
		else	{
		  	 alert("Your domain name should not have special characters");
			 return false;
		  }
		}
	}
}
else
{
 alert("You have forgotten the domain extension or your domain is too long");
 return false;
}	

return true;
}
	

function Verify1() //verify if the requested fields is filled
{

    var regex = /^[a-zA-Z0-9._-]+@([a-zA-Z0-9.-]+\.)+[a-zA-Z0-9.-]{2,4}$/;
    if(!regex.test(window.document.forms[0].email.value)){
         alert("Email Address is invalid !");
         window.document.forms[0].email.focus();
         return false;
    }
	  
    if (window.document.forms[0].email.value != window.document.forms[0].cemail.value){
        alert("You typed 2 different email address. Please check !");
        window.document.forms[0].cemail.focus();
        return false;
    }

    if (window.document.forms[0].fname.value == ""){
          alert("Please insert your First Name !");
          window.document.forms[0].fname.focus();
          return false;
    }

    if (window.document.forms[0].lname.value == ""){
          alert("Please insert your Last Name !");
          window.document.forms[0].lname.focus();
          return false;
    }

    if (window.document.forms[0].city.value == ""){
          alert("Please insert your City!");
          window.document.forms[0].city.focus();
          return false;
    }

    if (window.document.forms[0].country.options[window.document.forms[0].country.selectedIndex].value == "?"){
          alert("Please insert your Country !");
          window.document.forms[0].country.focus();
          return false;
    }
	  if (window.document.forms[0].payment.options[window.document.forms[0].payment.selectedIndex].value == ""){
          alert("Please select a payment cycle !");
          window.document.forms[0].payment.focus();
          return false;
    }
	if (!window.document.forms[0].policy.checked){
          alert("Please agree to the TOS!");
          window.document.forms[0].policy.focus();
          return false;
    }
    if (window.document.forms[0].hphone.value == ""){
          alert("Please insert your Telephone Number!");
          window.document.forms[0].hphone.focus();
          return false;
    }
return true;
}
