

//delete conform
function delCk(){
		var confrm;
		confrm=confirm("Are you sure that you want to delete this record");
		return confrm;
}


//Phone number validation
function phonenumbersonly(e)
{
	var unicode=e.charCode? e.charCode : e.keyCode
	//alert(unicode);
	//(9-> TAB;  8-> Backspace; 13-> ENTER;  37-> rigth arrow; 39-> left arrow; 46->DELETE; 43-> + ;46->- )
	if (unicode!=9 && unicode!=8 && unicode!=13 && unicode!=37 && unicode!=39 && unicode!=46 && unicode!=43 && unicode!=45){ //if the key isn't the backspace key (which we should allow)
	if (unicode<48||unicode>57) //if not a number
	return false //disable key press
	}
}

//number validation
function numbersonly(e)
{
	var unicode=e.charCode? e.charCode : e.keyCode
	//alert(unicode);
	if (unicode!=9 && unicode!=8 && unicode!=13 && unicode!=35 && unicode!=36 && unicode!=37 && unicode!=39 && unicode!=46){ //if the key isn't the backspace key (which we should allow)
	if (unicode<48||unicode>57) //if not a number
	return false //disable key press
	}
}

//charecter validation
function charonly(e)
	{
		var unicode=e.charCode? e.charCode : e.keyCode
		//alert(unicode);
			
			if (unicode!=9 && unicode!=8 && unicode!=13 && unicode!=35 && unicode!=36 && unicode!=37 && unicode!=39 && unicode!=46){ //if the key isn't the backspace key (which we should allow)	
				if (unicode<97 || unicode>122 || unicode==32 )
					{
					  	if((unicode<65 && unicode!=32) || unicode>90 ) 				//if not a char
					  		{
									 //if not a number
								return false 						//disable key press
							}
					}
			}
	}


//username validation
function unVali(e)
	{
		var unicode=e.charCode? e.charCode : e.keyCode
		//alert(unicode);
			//(9-> TAB;  8-> Backspace; 13-> ENTER;  45-> - 95-> _ )
			if (unicode!=9 && unicode!=8 && unicode!=13 && unicode!=45 && unicode!=95 && unicode!=35 && unicode!=36 && unicode!=46){ //if the key isn't the backspace key (which we should allow)	
				if (unicode<97 || unicode>122 )
					{
					  	if((unicode<65) || unicode>90 ) //if not a char
						{
							if (unicode<48||unicode>57)
							{
								return false 	
							}	//disable key press
						}
					}
			}
	}

//Sign up for a FREE Trial Today!
function signupTrial(){
var err="";
 	with(document.signUpFrm){
		//Confirm Password
		if(con_pwd.value == ''){
			err = "Please enter Confirm Password";
			con_pwd.focus();
		}else if(con_pwd.value != ''){
			if(pwd.value != con_pwd.value)
			err = "Password and Confirm Password must be same";
			pwd.focus();
			
		}
		//Password
		if(pwd.value == ''){
			err = "Please enter Password";
			pwd.focus();
		}else if(pwd.value != ''){
			if(pwd.value.length < 4){
				err = "Password should be minimum four characters";
				pwd.focus();
			}
			
		}
		//Login ID
// 		if(login_id.value == ''){
// 			err = "Please enter  Login ID";
// 			login_id.focus();
// 		}else if(login_id.value != ''){
// 			if(login_id.value.length < 4){
// 				err = "Login ID should be minimum four characters";
// 				login_id.focus();
// 			}
// 			
// 		}
		//List Size
// 		if(listSize.value == ''){
// 			err = "Please enter List Size";
// 			listSize.focus();
// 		}
		//Phone
		var ph = /^([0-9]{7,10})$/;
		var ph_no=phone.value;
		if(phone.value == ''){
			err = "Please enter Phone";
			phone.focus();
		}/*else{
			if(ph.test(ph_no) == false) {
				err = "Invalid Phone";
				phone.focus();
			}
		}*/
		//Username
		/*if(username.value == '')
		{
			err = "Please enter Usernadsme";
			username.focus();
		}
		else
		{
			//alert(aa.value);
			if(un.value != ("popwindow_full_green") && (un.value != "") && (un.value != "true"))
			{
				err= "Username Already Exist!";
				username.focus();
			}
		}*/


		
		/*else if(dname.value != ''){
			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','.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 mai = dname.value;
			var val = true;
			var dot = mai.lastIndexOf(".");
			var dname = mai.substring(0,dot);
			//alert(dname);
			var ext = mai.substring(dot,mai.length);
			//alert(ext);
			var nostart = mai.substring(0,4);
			//alert(nostart);
			if(nostart == "www." || nostart == "http" || nostart == "WWW." || nostart == "HTTP"){
				err="Your Domain Name should not start with www or http";
				dname.focus();
			}
			
			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)
				{
					err="Your Domain Name extension "+ext+" is not correct";
					dname.focus();
				}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){
								err="Domain Name should not begin are end with '-'";
								dname.focus();	
							}
						}else{
							err="Your Domain Name should not have special characters";
							dname.focus();
						}
					}
				}
			}else{
				err="Your Domain Name is too short/long";
				dname.focus();
			}	
		}*/
		
		
		//E-Mail Address
		var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
		var address=email.value;
		if(email.value == ''){
			err = "Please enter E-Mail Address";
			email.focus();
		}else{
			if(reg.test(address) == false) {
				err = "Invalid E-Mail Address";
				email.focus();
			}else{
				//alert(aa.value);
				if(aa.value != ("popwindow_full_green") && (aa.value != "") && (aa.value != "true")){
					err= "E-Mail Address Already Exist!";
					email.focus();
				}
			}
			
		}
		//Company
		if(company.value == ''){
			err = "Please enter Company";
			company.focus();
		}
		//Last Name
		if(lname.value == ''){
			err = "Please enter Last Name";
			lname.focus();
		}
		//Last Name
		if(lname.value == ''){
			err = "Please enter Last Name";
			lname.focus();
		}
		//First Name
		if(fname.value == ''){
			err = "Please enter First Name";
			fname.focus();
		}
	}
	if(err != ''){
			//alert(err);
			document.getElementById("popup_id1").className="popwindow_full_red";	
			document.getElementById("popup_id1").style.right="0";
			document.getElementById("popup_id1").style.bottom="+5px";
			document.getElementById("popup_id1").style.display="block";
			
			document.getElementById("disp").innerHTML = err.substr(0, 50);
			document.getElementById("dispdet").innerHTML = err;
		
		return false;
	}else {
		return true;
	}	
}
//Email Tips Delivered 
function emailTipsVali(){
var err="";

	with(document.sugFrm){
		//E-Mail
		var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
		var address=emailid.value;
		//alert(address);
		if(emailid.value == ''){
			err = "Please enter E-Mail";
			emailid.focus();
		}else{
			if(reg.test(address) == false) {
				err = "Invalid E-Mail";
				emailid.focus();
			}
		}
		//Name
		if(uname.value == ''){
			err = "Please enter Name";
			uname.focus();
		}
	}
	if(err != ''){
			document.getElementById("popup_id1").style.right="0";
			document.getElementById("popup_id1").style.bottom="+5px";
			document.getElementById("popup_id1").style.display="block";
			
			document.getElementById("disp").innerHTML = err.substr(0, 50);
			document.getElementById("dispdet").innerHTML = err;
		
		return false;
	}else {
		return true;
	}
}

function showAtype(va1,va2,va3){
	//alert(va1);
	if(va1 == "atype1"){
		document.getElementById("atype1").style.display="block";
		document.getElementById("atype2").style.display="none";
		document.getElementById("atype3").style.display="none";
		document.getElementById("cost").value="$9.00";
		return false;
	}else if(va1 == "atype2"){
		document.getElementById("atype2").style.display="block";
		document.getElementById("atype1").style.display="none";
		document.getElementById("atype3").style.display="none";
		document.getElementById("cost").value="$20.00";
		return false;
	}else if(va1 == "atype3"){
		document.getElementById("atype3").style.display="block";
		document.getElementById("atype1").style.display="none";
		document.getElementById("atype2").style.display="none";
		document.getElementById("cost").value="$88.00";
		return false;
	}else{
		return true;
	}
	
}

//Create Your Free Trial Account - order frm
function orderValdation(){
var err="";
var currentTime = new Date();
var month = currentTime.getMonth() + 1;
var day = currentTime.getDate();
var year = currentTime.getFullYear();
//var year='2011';
//var month =6;

// alert(currentTime);
// alert(month);
// alert(day);
// alert(year);

	with(document.orderFrm){
		
		//Terms & Conditions
		if(terms.checked == false){
			err = "Please select Terms & Conditions";
			terms.focus();
		}
		//Credit Card Expiration- year
		/*if(ccExpYr.value == ''){
			err = "Please select Credit Card Expiration- year";
			ccExpYr.focus();
		}else if(ccExpYr.value !=''){
			if(ccExpYr.value == year && ccExpMonth.value <= month){
				//alert(ccExpYr.value +"=="+ year+ "&&"+ ccExpMonth.value+" <"+ month);
				err = "Credit Card Expired!";
			}else if(ccExpYr.value <= year){
				//alert(ccExpYr.value +"<"+ year);
				err = "Credit Card Expired!";
			}
		}*/
		//Credit Card Expiration- month
		/*if(ccExpMonth.value == ''){
			err = "Please select Credit Card Expiration- month";
			ccExpMonth.focus();
		}
		//Card Security Code
		if(csCode.value == ''){
			err = "Please enter Card Security Code";
			csCode.focus();
		}else{
			if(csCode.value.length < 3){
				err = "Please enter correct Card Security Code";
				csCode.focus();
			}		
		}*/
		//Credit Card Number
		/*if(ccnumnber.value == ''){
			err = "Please enter Credit Card Number";
			ccnumnber.focus();
		}else if (ccnumnber.value.length < 16){
  			err = "Please enter Correct Credit Card Number";
			ccnumnber.focus();
 		}
		//Credit Card Type
		if(cctype.value == ''){
			err = "Please select Credit Card Type";
			cctype.focus();
		}*/
		//Country 
		if(countryselect.value == ''){
			err = "Please select Country";
			countryselect.focus();
		}
		//Postal Code
		if(postalCode.value == ''){
			err = "Please enter Postal Code";
			postalCode.focus();
		}
		//State/Territory
		if(state.value == ''){
			err = "Please enter State/Territory";
			state.focus();
		}	
		//City	
		if(city.value == ''){
			err = "Please enter City";
			city.focus();
		}
		//Address1
		if(addr1.value == ''){
			err = "Please enter Address1";
			addr1.focus();
		}
		//Phone Number
		if(phoneNo.value == ''){
			err = "Please enter Phone Number";
			phoneNo.focus();
		}
		//Email-Address
		var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
		var address=email.value;
		//alert(address);
		if(email.value == ''){
			err = "Please enter Email-Address";
			email.focus();
		}else{
			if(reg.test(address) == false) {
				err = "Invalid Email-Address";
				email.focus();
			}else{
				//alert(aa.value);
				if(aa.value != ("popwindow_full_green") && (aa.value != "") && (aa.value != "true")){
					err= "You can order using your Existing account!";
					email.focus();
				}
			}
		}

		//Username
		if(username.value == ''){
			err = "Please enter Usernameprem";
			username.focus();
		}else{
			//alert(aa.value);
			if(un.value != ("popwindow_full_green") && (un.value != "") && (un.value != "true")){
				err= "Username Already Exist!";
				username.focus();
			}
		}
		
				
 		//Company
 		if(company.value == ''){
 			err = "Please enter Company";
 			company.focus();
 		}
 		//Last Name
 		if(lname.value == ''){
 			err = "Please enter Last Name";
 			lname.focus();
 		}
 		//First Name
 		if(fname.value == ''){
 			err = "Please enter First Name";
 			fname.focus();
 		}
// 		//Login ID
// 		if(login_id.value == ''){
// 			err = "Please enter Login ID";
// 			login_id.focus();
// 		}
		//Choose Your Account Type
		var val=3;
		for(i=0;i<group.length;i++){
			if(group[i].checked){
			val --;
			}
		}
		if(val == 3){//alert(val);
			err = "Please Choose Your Account Type";
			group[0].focus();
		}


		
	}	
	if(err != ''){
			//alert(err);
			document.getElementById("popup_id1").className="popwindow_full_red";
			document.getElementById("popup_id1").style.right="0";
			document.getElementById("popup_id1").style.bottom="+5px";
			document.getElementById("popup_id1").style.display="block";
			
			document.getElementById("disp").innerHTML = err.substr(0, 50);
			document.getElementById("dispdet").innerHTML = err;
		
		return false;
	}else {
		return true;
	}
}

//Email Verification
function vcodeVali(){
var err="";
	with(document.vcodeFrm){
		
		//Enter your verification code
		if(vercode.value == ""){
			err = "Please Enter your verification code";
			vercode.focus();
		}
	}	
	if(err != ''){
			//alert(err);
			document.getElementById("popup_id1").style.right="0";
			document.getElementById("popup_id1").style.bottom="+5px";
			document.getElementById("popup_id1").style.display="block";
			
			document.getElementById("disp").innerHTML = err.substr(0, 50);
			document.getElementById("dispdet").innerHTML = err;
		
		return false;
	}else {
		return true;
	}
}

//Client Login
function loginVali(){
var err="";
	
	with(document.loginfrm){
		//Password
		if(password.value == ""){
			err = "Please enter your Password";
			password.focus();
		}
		//User Name
		if(username.value == ""){
			err = "Please enter your User Name";
			username.focus();
		}
	}	

	if(err != ''){
			//alert(err);
			document.getElementById("popup_id1").style.right="0";
			document.getElementById("popup_id1").style.bottom="+5px";
			document.getElementById("popup_id1").style.display="block";
			
			document.getElementById("disp").innerHTML = err.substr(0, 50);
			document.getElementById("dispdet").innerHTML = err;
		
		return false;
	}else {
		return true;
	}
	
}


//Forgot Password
function forgotpassVali(){
var err="";
	
	with(document.forgotfrm){
		//Email-Address
		var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
		var address=email.value;
		//alert(address);
		if(email.value == ''){
			err = "Please enter Email-Address";
			email.focus();
		}else{
			if(reg.test(address) == false) {
				err = "Invalid Email-Address";
				email.focus();
			}
		}
	}	

	if(err != ''){
			//alert(err);
			document.getElementById("popup_id1").style.right="0";
			document.getElementById("popup_id1").style.bottom="+5px";
			document.getElementById("popup_id1").style.display="block";
			
			document.getElementById("disp").innerHTML = err.substr(0, 50);
			document.getElementById("dispdet").innerHTML = err;
		
		return false;
	}else {
		return true;
	}
	
}

//My account
function myaccVali(){
var err='';
	with(document.myprofileFrm){
		//Old Password
		if(old_pwd.value != '')
		{
			if(old_pwd.value == pwd.value){
				err = "Old Password and New Password should not be same";
				pwd.focus();	
			}else{
				//Password Again
				if(pwdagain.value == ''){
					err = "Please enter Confirm New Password";
					pwdagain.focus();
				}else if(pwdagain.value != ''){
					if(pwd.value != pwdagain.value)
					err = "New Password and Confirm New Password must be same";
					pwd.focus();
					
				}
				//Password
				if(pwd.value == ''){
					err = "Please enter New Password";
					pwd.focus();
				}else if(pwd.value != ''){
					if(pwd.value.length < 4){
						err = "Password should be minimum four characters";
						pwd.focus();
					}
					
				}

			}
			
		}else if(old_pwd.value == ''){
			if(pwd.value != '' || pwdagain.value != '')
			{	
				err = "Please enter Old Password";
				pwd.focus();
			}
		}
				
		//Country
		if(countrysel.value == ''){
			err = "Please select Country";
			countrysel.focus();
		}
		//Postal Code
		if(postalCode.value == ''){
			err = "Please enter Postal Code";
			postalCode.focus();
		}
		//State/Territory
		if(state.value == ''){
			err = "Please enter State/Territory";
			state.focus();
		}	
		//City	
		if(city.value == ''){
			err = "Please enter City";
			city.focus();
		}
		//Address1
		if(addr1.value == ''){
			err = "Please enter Address1";
			addr1.focus();
		}
		//Phone Number
		if(phoneNo.value == ''){
			err = "Please enter Phone Number";
			phoneNo.focus();
		}
		//Company
 		if(company.value == ''){
 			err = "Please enter Company";
 			company.focus();
 		}
 		//Last Name
 		if(lname.value == ''){
 			err = "Please enter Last Name";
 			lname.focus();
 		}
 		//First Name
 		if(fname.value == ''){
 			err = "Please enter First Name";
 			fname.focus();
 		}		
	}	
	if(err != '')
	{		
			showErrorMsg('popup_id1');
			document.getElementById("popup_id1").style.right="0";
			document.getElementById("popup_id1").style.bottom="+5px";
			document.getElementById("popup_id1").style.display="block";		
			document.getElementById("disp").innerHTML = err.substr(0, 50);
			document.getElementById("dispdet").innerHTML = err;
			return false;
	}
	else 
	{
		return true;
	}
}

function LTrim( value ) {
	
	var re = /\s*((\S+\s*)*)/;
	return value.replace(re, "$1");
	
}

// Removes ending whitespaces
function RTrim( value ) {
	
	var re = /((\s*\S+)*)\s*/;
	return value.replace(re, "$1");
	
}

//Add New Email Id
function addEmailVali(){
var err='';
	
	with(document.addemailfrm){
		// Enter Your Name 
 		if(uname.value == ''){
 			err = "Please Enter Your Name ";
 			uname.focus();
 		}
		
		// Enter Your Email Id
 		var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
		var address=email.value;
		//alert(address);
		if(email.value == ''){
			err = "Please Enter Your Email Id";
			email.focus();
		}else{
			if(reg.test(address) == false) {
				err = "Invalid Email Id";
				email.focus();
			}
		}
	}

		
	if(err != ''){
			//alert(err);
			document.getElementById("popup_id1").style.right="0";
			document.getElementById("popup_id1").style.bottom="+5px";
			document.getElementById("popup_id1").style.display="block";
			
			document.getElementById("disp").innerHTML = err.substr(0, 50);
			document.getElementById("dispdet").innerHTML = err;
		
		return false;
	}else {
		return true;
	}
}
//add Email to MyAccount
function addEmailMyAccount(){
var err='';
var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
var k ="", j=""; 	

	for(i=0;i<document.saveEmail.length-1;i++){
		if(document.saveEmail.elements[i].type == "checkbox")
		{	
			
			if (document.saveEmail.elements[i].name.substring(0,7) == "billing"){
				var val="document.saveEmail.billing"+k+".checked"	
				if(eval(val) == false){
					j++;
				}
				k++;
			}
		}
	}
	if(k == j){
		err="Please select atleast one billing account";
	}
		

	with(document.saveEmail){
		for(var i=rec_count.value;i>=1;i--){

			//Name
			if(eval("addname"+i+".value") == ''){
				err = "Please Enter "+i+" row  Name ";
				eval("addname"+i+".focus()");
			}
			
			var address=eval("addemail"+i+".value");
			//alert(address);
			if(eval("addemail"+i+".value") == ''){
				err = "Please Enter "+i+" row  Email Id";
				eval("addemail"+i+".focus()");
			}else{
				if(reg.test(address) == false) {
					err = "Invalid "+i+" row Email Id";
					eval("addemail"+i+".focus()");
				}
			}
			
	
		}
		
	}


	if(err != ''){
			//alert(err);
			document.getElementById("popup_id1").style.right="0";
			document.getElementById("popup_id1").style.bottom="+5px";
			document.getElementById("popup_id1").style.display="block";
			
			document.getElementById("disp").innerHTML = err.substr(0, 50);
			document.getElementById("dispdet").innerHTML = err;
		
		return false;
	}else {
		return true;
	}
}

//add cc card in Billing Page
function addCCvali(){

var err='';
var currentTime = new Date();
var month = currentTime.getMonth() + 1;
var day = currentTime.getDate();
var year = currentTime.getFullYear();
	with(document.addCCard){
		//Credit Card Expiration- year
		if(ccExpYr.value == ''){
			err = "Please select Credit Card Expiration- year";
			ccExpYr.focus();
		}else if(ccExpYr.value !=''){
			if(ccExpYr.value == year && ccExpMonth.value < month){
				//alert(ccExpYr.value +"=="+ year+ "&&"+ ccExpMonth.value+" <"+ month);
				err = "Credit Card Expired!";
			}else if(ccExpYr.value < year){
				//alert(ccExpYr.value +"<"+ year);
				err = "Credit Card Expired!";
			}
		}
		//Credit Card Expiration- month
		if(ccExpMonth.value == ''){
			err = "Please select Credit Card Expiration- month";
			ccExpMonth.focus();
		}
		//Card Security Code
		if(csCode.value == ''){
			err = "Please enter Card Security Code";
			csCode.focus();
		}else{
			if(csCode.value.length < 3){
				err = "Please enter correct Card Security Code";
				csCode.focus();
			}		
		}

		//Credit Card Number
		if(ccnumnber.value == ''){
			err = "Please enter Credit Card Number";
			ccnumnber.focus();
		}else if(ccnumnber.value != ''){
			if (ccnumnber.value.length < 16){
				err = "Please enter Correct Credit Card Number";
				ccnumnber.focus();
			}
 		}
		//Credit Card Type
		if(cctype.value == ''){
			err = "Please select Credit Card Type";
			cctype.focus();
		}
	}

	if(err != ''){
			//alert(err);
			document.getElementById("popup_id1").style.right="0";
			document.getElementById("popup_id1").style.bottom="+5px";
			document.getElementById("popup_id1").style.display="block";
			
			document.getElementById("disp").innerHTML = err.substr(0, 50);
			document.getElementById("dispdet").innerHTML = err;
		
		return false;
	}else {
		return true;
	}
}
//feedback validation
function feedbackVali(){
var err="";
	with(document.fbfrm){
		//Message
		if(msg.value == ''){
			err = "Please enter Message";
			msg.focus();
		}
		//Subject
		if(sub.value == ''){
			err = "Please enter Subject";
			sub.focus();
		}
		//Country
		if(countryselect2.value == ''){
			err = "Please select Country";
			countryselect2.focus();
		}

	}

	if(err != ''){
			//alert(err);
			document.getElementById("popup_id1").style.right="0";
			document.getElementById("popup_id1").style.bottom="+5px";
			document.getElementById("popup_id1").style.display="block";
			
			document.getElementById("disp").innerHTML = err.substr(0, 50);
			document.getElementById("dispdet").innerHTML = err;
		
		return false;
	}else {
		return true;
	}
}

function testiVali(){
var err="";
 
	with(document.tesfrm){
		//Comments
		if(comment.value == ''){
			err = "Please enter Comments";
			comment.focus();
		}
		if(testsubject.value == ''){
			err = "Please enter Subject";
			testsubject.focus();
		}
		//Country
		if(countryselect2.value == ''){
			err = "Please select Country";
			countryselect2.focus();
		}
	}

	if(err != ''){
			//alert(err);
			document.getElementById("popup_id1").style.right="0";
			document.getElementById("popup_id1").style.bottom="+5px";
			document.getElementById("popup_id1").style.display="block";
			
			document.getElementById("disp").innerHTML = err.substr(0, 50);
			document.getElementById("dispdet").innerHTML = err;
		
		return false;
	}else {
		return true;
	}
}

//Tell a Friend
function tellafndvali(){
var err="";
	var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
	with(document.tellafndfrm){
		//Messgae
		if(message.value == ''){
			err = "Please enter Messgae";
			message.focus();
		}
		//Friend Email
		var address=femail.value;
		if(femail.value == ''){
			err = "Please Enter Your Friend Email";
			femail.focus();
		}else{
			if(reg.test(address) == false) {
				err = "Invalid Friend Email";
				femail.focus();
			}
		}
		//Friend Name
		if(fname.value == ''){
			err = "Please enter Friend Name";
			fname.focus();
		}
		//Your Email
		var address=uemail.value;
		if(uemail.value == ''){
			err = "Please Enter Your Email";
			uemail.focus();
		}else{
			if(reg.test(address) == false) {
				err = "Invalid Your Email";
				uemail.focus();
			}
		}
		//Your Name
		if(uname.value == ''){
			err = "Please enter Your Name";
			uname.focus();
		}		
	}

	if(err != ''){
			//alert(err);
			document.getElementById("popup_id1").style.right="0";
			document.getElementById("popup_id1").style.bottom="+5px";
			document.getElementById("popup_id1").style.display="block";
			
			document.getElementById("disp").innerHTML = err.substr(0, 50);
			document.getElementById("dispdet").innerHTML = err;
		return false;
	}else {
		document.tellafndfrm.method="post";
		document.tellafndfrm.action="?do=tellafrnd";
		document.tellafndfrm.submit();
 	}
}

//Contact Us 
function contusVali()
{
var err="";
	var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
	with(document.contusfrm){
		//Question/Comment/Feedback: 
		if(comment_us.value == ''){
			err = "Please enter Question/Comment/Feedback:";
			comment_us.focus();
		}
		//Country 
		if(countryselect.value == ''){
			err = "Please select Country";
			countryselect.focus();
		}
		//Phone Number
		if(phone_cus.value == ''){
			err = "Please enter Phone Number";
			phone_cus.focus();
		}
		//Email-Address
		var address=email_cus.value;
		if(email_cus.value == ''){
			err = "Please Enter Email-Address";
			email_cus.focus();
		}else{
			if(reg.test(address) == false) {
				err = "Invalid Email-Address";
				email_cus.focus();
			}
		}
		//Name
		if(uname_cus.value == ''){
			err = "Please enter Name";
			uname_cus.focus();
		}		
	}
	if(err != ''){
			document.getElementById("popup_id1").style.right="0";
			document.getElementById("popup_id1").style.bottom="+5px";
			document.getElementById("popup_id1").style.display="block";
			
			document.getElementById("disp").innerHTML = err.substr(0, 50);
			document.getElementById("dispdet").innerHTML = err;
		
		return false;
	}else {
		return true;
	}
}



//Plan Updation
function plamUpdateCCVali(currplan)
{
var err='';

//  alert(currplan);
	var selObjNew = document.getElementById("plannames");
	var editid = selObjNew.options[selObjNew.selectedIndex].value;

// alert(editid);
var newplanamount=editid.split('~~~');
// alert(newplanamount[1]);
/*
alert(parseInt(currplan));
alert(parseInt(newplanamount[1]));*/
		if(parseInt(currplan) > parseInt(newplanamount[1]))
		{
			
			err = "Please choose next Plan Type. You can only upgrade your plan!";
		}
		

// alert(err);


	with(document.planUpdatefrm)
	{



/*
		var ck_group="false";
				
		//Choose Your Credit Card
		if(ccard.value == '')
		{
			err = "Please select atleast one Credit Card Details";
		}
				
		//Choose Your Plan Type
		for(i=0;i<group.length;i++)
		{
			if(current_plan.value == group[i].value)
				current_plan_posi = i;
		}
		last_plan_posi =eval(group.length - 1);
			
		for(i=0;i<group.length;i++)
		{
			if(group[i].checked == true)
			{
				ck_group="true";
				change_plan=group[i].value;
				change_plan_posi = i;
			}
		}	
		//alert(current_plan_posi+" > "+change_plan_posi);
		if(currplan >= editid)
			err = "Please choose next Plan Type. You can only upgrade your plan!";

//alert(err);
		if(ck_group !="true")
		{
			err = "Please Choose Your Plan Type";
		}
		else if(ck_group =="true")
		{
			if(current_plan.value == current_plan_posi)
			{
				if(current_plan_posi > change_plan_posi)
					err = "Please choose next Plan Type. You can only upgrade your plan!";
			}
			else
			{
				if(current_plan_posi >= change_plan_posi)
					err = "Please choose next Plan Type. You can only upgrade your plan!";
			}
		}*/
	}	


	if(err != ''){



			document.getElementById("popup_id1").style.right="0";
			document.getElementById("popup_id1").style.bottom="+5px";
			document.getElementById("popup_id1").style.display="block";
			
			document.getElementById("disp").innerHTML = err.substr(0, 50);
			document.getElementById("dispdet").innerHTML = err;
		
		return false;
	}else {
		return true;
	}

}

//Account Cancelation 
function accCancelVali()
{
var err="";


	with(document.cancelaccountfrm)
	{
		//Reason for Cancelation
		if(reason.value == "")
		{
			err = "Please enter Reason for Cancelation";
			reason.focus();
		}
		else if(reason.value != "")
		{
		 	var confrm;
		 	confrm=confirm("Are you Confirm to cancel your account?.If OK then your account will be removed from our data base!");
			return confrm;
		}
	}

	if(err != ''){
			document.getElementById("popup_id1").style.right="0";
			document.getElementById("popup_id1").style.bottom="+5px";
			document.getElementById("popup_id1").style.display="block";
			
			document.getElementById("disp").innerHTML = err.substr(0, 50);
			document.getElementById("dispdet").innerHTML = err;
		
		return false;
	}else {
		return true;
	}

}
