function getlogin(type){
 if($('lgerr').style.display=="block"){
	 $('lgerr').style.display="none";
	 $('remember').style.display="block";
 }
 if(type=="username")
   $('login_username').value="";
 else
   $('login_password').value="";
}
function getloginout(type){
 if(type=="username" && $('login_username').value=="")
   $('login_username').value="UserName";
 else if(type=="password" && $('login_password').value=="")
   $('login_password').value="Password";
}
////////////////Login Register////////////////////////////////////////
function getreglogin(type){
 if($('reg_lgerr').style.display=="block"){
	 $('reg_lgerr').style.display="none";
	 $('reg_remember').style.display="block";
 }
 if(type=="username")
   $('reg_login_username').value="";
 else
   $('reg_login_password').value="";
}
function getregloginout(type){
 if(type=="username" && $('reg_login_username').value=="")
   $('reg_login_username').value="UserName";
 else if(type=="password" && $('reg_login_password').value=="")
   $('reg_login_password').value="Password";
}
////////////////////////////////////////////////////////////////////////
//////////////////// Validation for registration////////////////////////////////////////////
function registerValidation(type){  
 if(type=='all' || type=="fname"){  
   if($('fname').value==""){
    $('fnamecheck').innerHTML="Please enter first name";
	$('validdata').value="false";
   }else{	
	$('fnamecheck').innerHTML="&nbsp;";	
   }
 }
 if(type=='all' || type=="loginame"){  
	var ValidChars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.-_";
	var IsValid=true;
	var Char;
	var sText=$('loginame').value;	
	if(sText=="") {		
		IsValid = false;
	}
	for (i = 0; i < sText.length && IsValid == true; i++) 
	{ 
	Char = sText.charAt(i); 
	if(ValidChars.indexOf(Char) == -1) 
	{
	IsValid = false;
	}
	}	
    if(IsValid){
	  $('loginamecheck').innerHTML="&nbsp;";
	}else{
	  $('loginamecheck').innerHTML="Please enter valid login name";
	  $('validdata').value="false";
	}   
 }
 if(type=='all' || type=="metroarea"){
   if($('metroarea').value==""){
    $('metroareacheck').innerHTML="Please select metro area";
	$('validdata').value="false";
   }else{	
	$('metroareacheck').innerHTML="&nbsp;";	
   }
 }
 if(type=='all' || type=="password"){
   if($('password').value==""){
    $('passwordcheck').innerHTML="Please enter password";
	$('validdata').value="false";
   }else{
	 var pass=$('password').value;
	 var len=pass.length;
	 if(len<5){
	  $('passwordcheck').innerHTML="Minimum 5 letters ";
	  $('validdata').value="false";
	 }else if(len>15){
	  $('passwordcheck').innerHTML="Maximum 15 letters";
	  $('validdata').value="false";
	 }else{
	  $('passwordcheck').innerHTML="&nbsp;";
	 }
   } 
 }
 /*if(type=='all' || type=="captchacode"){
  if($('captchacode').value==""){
    $('captchacodecheck').innerHTML="Please enter verification code";
	$('validdata').value="false";
   }else{
	   $('captchacodecheck').innerHTML="&nbsp;";		
   }
 }*/
 if(type=='all' || type=="lname"){
  if($('lname').value==""){
    $('lnamecheck').innerHTML="Please enter last name";
	$('validdata').value="false";
   }else{	
	$('lnamecheck').innerHTML="&nbsp;";	
   } 
 }
if(type=='all' || type=="email"){
var email=$('email').value; 
	if($('email').value==""){
	$('emailcheck').innerHTML="Please enter email address";
	$('validdata').value="false";
	}else{
		if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email)){
			$('emailcheck').innerHTML="&nbsp;";	
		}else{
			$('emailcheck').innerHTML="Please enter valid email address";
			$('validdata').value="false";
		}
	}
}

if(type=='all' || type=="url"){
	var urlval=$('url').value;
	if($('url').value!=""){	
		var urlregex = new RegExp("^(http:\/\/|https:\/\/|ftp:\/\/|www.){1}([0-9A-Za-z]+\.)");
		if(urlregex.test(urlval)){
			$('urlcheck').innerHTML="&nbsp;";	
		}else{
			$('urlcheck').innerHTML="Please enter valid URL address";
			$('validdata').value="false";
		}
	}else{
		$('urlcheck').innerHTML="&nbsp;";
	}
}
 if(type=='all' || type=="repassword"){
  if($('repassword').value==""){
    $('repasswordcheck').innerHTML="Please retype your password";
	$('validdata').value="false";
   }else{
	var pass=$('password').value;
	var repass=$('repassword').value;
	var len=repass.length;	    
		if(len<5){
			$('repasswordcheck').innerHTML="Minimum 5 letters ";
			$('validdata').value="false";
		}else if(len>15){
			$('repasswordcheck').innerHTML="Maximum 15 letters";
			$('validdata').value="false";
		}else{
			$('repasswordcheck').innerHTML="&nbsp;";
		}
		if(pass!=repass){
			$('repasswordcheck').innerHTML="Password mismatch";
			$('validdata').value="false";
		}
   } 
 }
 if($('validdata').value=="false"){
	$('regerrmsg1').style.display="block";
	$('regerrmsg').innerHTML="Some of your entries are not correct.  Please revise";
	$('regerrmsg1').className="regerrmsg";
    return false;
 }
}
///////////////////////////////////////////Validation for Contact Us ///////////////////////////////
function contactusValidation(type){  
  if(type=='all' || type=="cntname"){  
	   if($('cntname').value==""){
			$('cntnamecheck').innerHTML="Please enter name";
			$('validdata').value="false";
	   }else{	
			$('cntnamecheck').innerHTML="&nbsp;";	
	   }
  }
   if(type=='all' || type=="cntemail"){  
		var email=$('cntemail').value;  
		if($('cntemail').value==""){
		$('cntemailcheck').innerHTML="Please enter email address";
		$('validdata').value="false";
		}else{
			if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email)){
				$('cntemailcheck').innerHTML="&nbsp;";	
			}else{
				$('cntemailcheck').innerHTML="Please enter valid email address";
				$('validdata').value="false";
			}
		}
  }
   if(type=='all' || type=="cntphone"){  
    if($('cntphone').value!=""){
	   var sText=$('cntphone').value;
	   var ValidChars = "0123456789-_() ";
	   var IsValid=true;
	   var Char;
	   for (i = 0; i < sText.length && IsValid == true; i++) 
	   { 
		  Char = sText.charAt(i); 
		  if(ValidChars.indexOf(Char) == -1) 
		  {
			 IsValid = false;
		  }
	   }
	   if(!IsValid){
		   $('cntphonecheck').innerHTML="Please enter valid Phone Number";
		   $('validdata').value="false";
	   }else{
		   $('cntphonecheck').innerHTML="&nbsp;";
	   }		
	}else{
		$('cntphonecheck').innerHTML="&nbsp;";
	}
  }
   if(type=='all' || type=="cntmessage"){  
	   if($('cntmessage').value==""){
			$('cntmessagecheck').innerHTML="Please enter Message";
			$('validdata').value="false";
	   }else{	
			$('cntmessagecheck').innerHTML="&nbsp;";	
	   }
  }
  if(type=='all' || type=="vcode"){  
	   if($('vcode').value==""){
			$('vcodecheck').innerHTML="Please enter the Verification Code shown below";
			$('validdata').value="false";
	   }else{	
			$('vcodecheck').innerHTML="&nbsp;";	
	   }
  }
}
////////////////////////////////////////////////////////////////////////////////////////////////
function getfocus(id){
 if($(id)){
  $(id).className='foctxt';
 }  
}
function getfocusout(id){
 registerValidation(id);
 if($(id)){
  $(id).className='regtxtbox';
 }  
}
function getcofocus(id){
 if($(id)){
  $(id).className='foctxt';
 }  
}
function getcofocusout(id){
 consultantValidation(id);
 if($(id)){
  $(id).className='regtxtbox';
 }  
}
function getcofocusarea(id){
 if($(id)){
  $(id).className='foctxtarea';
 }  
}
function getcofocusareaout(id){
 consultantValidation(id);
 if($(id)){
  $(id).className='regtxtarea';
 }  
}
function getfocuscontact(id){
 if($(id)){
  $(id).className='foctxt';
 }  
}
function getfocuscontactout(id){
 contactusValidation(id);
 if($(id)){
  $(id).className='regtxtbox';
 }  
}
function getfocuscontactarea(id){
 if($(id)){
  $(id).className='foctxtarea';
 }  
}
function getfocuscontactoutarea(id){
 contactusValidation(id);
 if($(id)){
  $(id).className='regtxtarea';
 }  
}
function getconeedfocusout(id){
 consultantneedValidation(id);
 if($(id)){
  $(id).className='regtxtbox';
 }  
}
function getconeedfocusoutarea(id){
 consultantneedValidation(id);
 if($(id)){
  $(id).className='regtxtarea';
 }  
}

function consultantValidation(type){
 if($('convaliddata')){
	if(type=='all' || type=="problem"){  
		if($('problem').value==""){
			$('problemcheck').innerHTML="Please enter problem you are solving";
			$('convaliddata').value="false";
		}else{
			var problem=$('problem').value;
			var splitpr=problem.split(" ");			
			if(splitpr.length<=50){
			 $('problemcheck').innerHTML="&nbsp;";	
			}else{
			 $('problemcheck').innerHTML="Should be 50 Words or fewer";
			 $('convaliddata').value="false";
			}
			if(common(problem)){
			 $('block').value="1";
			}
		}
	}
	if(type=='all' || type=="overview"){  
		if($('overview').value==""){
			$('overviewcheck').innerHTML="Please enter your solution overview";
			$('convaliddata').value="false";
		}else{	
			var overviewval=$('overview').value;
			var overview=overviewval.split(" ");	
			if(overview.length<=100){
			 $('overviewcheck').innerHTML="&nbsp;";	
			}else{
			 $('overviewcheck').innerHTML="Should be 100 Words or fewer";
			 $('convaliddata').value="false";
			}
			if(common(overviewval)){
			 $('block').value="1";
			}
		}
	}
	if(type=='all' || type=="qualify"){  
		if($('qualify').value==""){
			$('qualifycheck').innerHTML="Please enter your qualifications";
			$('convaliddata').value="false";
		}else{	
			var qualifyval=$('qualify').value;
			var qualify=qualifyval.split(" ");
			if(qualify.length<=50){
			 $('qualifycheck').innerHTML="&nbsp;";	
			}else{
			 $('qualifycheck').innerHTML="Should be 50 Words or fewer";
			 $('convaliddata').value="false";
			}
			if(common(qualifyval)){
			 $('block').value="1";
			}
		}
	}
	if(type=='all' || type=="headline"){  
		if($('headline').value==""){
			$('headlinecheck').innerHTML="Please enter your catchy headline";
			$('convaliddata').value="false";
		}else{	
			$('headlinecheck').innerHTML="&nbsp;";	
		if(common($('headline').value)){
			 $('block').value="1";
		}
	  }
	}
	if(type=='all' || type=="cons_area"){  
		if($('cons_area').value==""){
			$('cons_areacheck').innerHTML="Please select your functional area";
			$('convaliddata').value="false";
		}else{	
			$('cons_areacheck').innerHTML="&nbsp;";	
		}
	}
	if($('prval').value=="yes"){
		if(type=='all' || type=="pr_period"){  
			if($('pr_period').value==""){
				$('pr_periodcheck').innerHTML="Please select your premium period";
				$('convaliddata').value="false";
			}else{	
				$('pr_periodcheck').innerHTML="&nbsp;";	
			}
		}
	}
 }else{	
	 if($('cl_problem')){
		if(type=='all' || type=="cl_problem"){
			
			if($('cl_problem').value==""){
				$('cl_problemcheck').innerHTML="Please enter your Problem";
				$('clvaliddata').value="false";
			}else{	
				var problemval=$('cl_problem').value;
				var problem=problemval.split(" ");
				if(problem.length<=100){
				 $('cl_problemcheck').innerHTML="&nbsp;";	
				}else{
				 $('cl_problemcheck').innerHTML="Should be 100 Words or fewer";
				 $('clvaliddata').value="false";
				}
				if(common(problemval)){
				 $('block').value="1";
				}
			}			
		}
	 }
	 if($('cl_position')){
		if(type=='all' || type=="cl_position"){			
			if($('cl_position').value==""){
				$('cl_positioncheck').innerHTML="Please enter your Position";
				$('clvaliddata').value="false";
			}else{	
				var positionval=$('cl_position').value;
				var position=positionval.split(" ");
				if(position.length<=100){
				 $('cl_positioncheck').innerHTML="&nbsp;";	
				}else{
				 $('cl_positioncheck').innerHTML="Should be 100 Words or fewer";
				 $('clvaliddata').value="false";
				}
				if(common(positionval)){
				 $('block').value="1";
				}
			}		
		}
	 }
 }
}
function getmemberlogin(){
	document.login.action="index.php";
	document.login.submit();
}
function getmemberreglogin(){	
	document.loginpage.action="register.php";
	document.loginpage.submit();
}
function getbrowsearea(metro,val,cs){
	if(val!=""){
		var fsarinval2=val.split("-");
		fval1 = fsarinval2[0];
		fsart1 = fsarinval2[1];
		var val=fsart1.toLowerCase();
	}else{
		val="";
	}
	
	if(metro!=""){
		var sarinval=metro.split("-");
		val4 = sarinval[0];
		sart = sarinval[1];
		var metro=sart.toLowerCase();
	}else{
		metro="";
	}	
	
	pthurl="";
	if(val!=""){
		pthurl=pthurl+"fid="+val;
	}else{
		pthurl=pthurl;
	}
	if(metro!=""){
		if(pthurl!="")
			pthurl=pthurl+"&mid="+metro;
		else
			pthurl=pthurl+"mid="+metro;
	}else{
		pthurl=pthurl;
	}
		
	if(cs=="")
	 location.href="solutions-list.php?"+pthurl;
	else
	 location.href="solutions-list.php?"+pthurl+"&cs="+cs;
}
function gettwovalues(){
	if(document.mainfrm.area_interest.value!=""){
		var sarinval=document.mainfrm.area_interest.value.split("-");
		val6 = sarinval[0];
		sart = sarinval[1];
		var fid=sart.toLowerCase();
	}else{
		fid="";
	}
	if(document.mainfrm.metro_area.value!=""){
		var sametval=document.mainfrm.metro_area.value.split("-");
		val2 = sametval[0];
		sart2 = sametval[1];
		var mid=sart2.toLowerCase();
	}else{
		mid="";
	}
	//reg = /\s+/;
	//art=art.replace(reg,'+');
	location.href="solutions-list.php?fid="+fid+"&mid="+mid;
}
/*getbrowsearea({if $smarty.request.mid neq ""}{$smarty.request.mid}{else}''{/if},area_interest.value); 
getbrowsemetroarea({if $smarty.request.fid neq ""}{$smarty.request.fid}{else}''{/if},metro_area.value)
*/
function getbrowsemetroarea(farea,mval,cs){
	if(mval!=""){
		var msarinval=mval.split("-");
		valm = msarinval[0];
		msart = msarinval[1];
		var mval=msart.toLowerCase();
	}else{
		mval="";
	}
	if(farea!=""){
		var fsarinval=farea.split("-");
		fval = fsarinval[0];
		fsart = fsarinval[1];
		var farea=fsart.toLowerCase();
	}else{
		farea="";
	}
	
	pthurl="";
	if(farea!=""){
		pthurl=pthurl+"fid="+farea;
	}else{
		pthurl=pthurl;
	}
	if(mval!=""){
		if(pthurl!="")
			pthurl=pthurl+"&mid="+mval;
		else
			pthurl=pthurl+"mid="+mval;
	}else{
		pthurl=pthurl;
	}
	
	if(cs=="")
	 location.href="solutions-list.php?"+pthurl;	
	else
	 location.href="solutions-list.php?"+pthurl+"&cs="+cs;
}
function expressinterest(id){
	document.browse_consultant.action="solutions-list.php?cnid="+id+"";
	document.browse_consultant.submit();
}
function getrequirements(val){
	if(val=="browse"){
		var total=document.browse_client.totalreq.value;
		for(i=0;i<total;i++){
		  var check=$('require'+i).checked;	 
		  if(check==true)
		   var req=1;
		}
		if(req!="1"){
		 alert("Please select atleast one client requirement");
		 return false;
		}
	}
	document.browse_client.submit();
}
function updatebusiness(id,status){ 
 if(status=="Rejected"){
   if(confirm("Are you sure you want to delete this Transaction?")){
	 document.myaccount.fAction.value='update';
	 document.myaccount.status.value=status;
	 document.myaccount.businessid.value=id;
	 document.myaccount.submit();
   }
 }else if(status=="Confirmed"){ 
 	if(document.getElementById('totalamount').value>0){
		document.myaccount.faction.value="payment";
		document.myaccount.status.value=status;
		document.myaccount.businessid.value=id;
		document.myaccount.action='myaccount.php?mode=acceptrequirement&cid='+id+'&pid=pay';
		document.myaccount.submit();
	}else{
		document.myaccount.fAction.value='update';
		document.myaccount.status.value=status;
		document.myaccount.businessid.value=id;
		document.myaccount.submit();
	}
 }else{
	 document.myaccount.fAction.value='update';
	 document.myaccount.status.value=status;
	 document.myaccount.businessid.value=id;
	 document.myaccount.submit();	 
 }
}
function editmysolution(id,pg,lm){
 location.href='myaccount.php?mode=solution&view=edit&sid='+id+'&pg='+pg+'&lm='+lm;
}
function editmyrequirement(id,pg,lm){
 location.href='myaccount.php?mode=client&view=edit&sid='+id+'&pg='+pg+'&lm='+lm;
}
function delMySolution(val){
  if(confirm("Are you sure you want to delete this solution?")){
	 document.my_consultant_list.csid.value=val;
	 document.my_consultant_list.fAction.value="delete";
	 document.my_consultant_list.submit();
  }
}
function delMyRequirement(val){
 if(confirm("Are you sure you want to delete this requirement?")){
	 document.my_client_list.crid.value=val;
	 document.my_client_list.fAction.value="delete";
	 document.my_client_list.submit();
 }
}
function getclose(id){
	 if($(id)){
		$(id).style.display="none";	
	 }
}
function getshowpremium(val){
	$('prval').value=val;
	if(val=="yes"){
		$('showpremium').style.display="block";
	}else{
		$('showpremium').style.display="none";
	}
}
function consultantneedValidation(type){
 if($('conneedvaliddata')){
	if(type=='all' || type=="head"){  
		if($('head').value==""){
			$('headcheck').innerHTML="Please enter your headline";
			$('conneedvaliddata').value="false";
		}else{	
			$('headcheck').innerHTML="&nbsp;";	
	  }
	}
	if(type=='all' || type=="detail"){  
		if($('detail').value==""){
			$('detailcheck').innerHTML="Please enter your description";
			$('conneedvaliddata').value="false";
		}else{	
			 $('detailcheck').innerHTML="&nbsp;";	
		}
	}
	if(type=='all' || type=="fn_area"){  
		if($('fn_area').value==""){
			$('fn_areacheck').innerHTML="Please select your functional area";
			$('conneedvaliddata').value="false";
		}else{	
			$('fn_areacheck').innerHTML="&nbsp;";	
		}
	}
	if(type=='all' || type=="metro_area"){  
		if($('metro_area').value==""){
			$('metro_areacheck').innerHTML="Please select metro area";
			$('conneedvaliddata').value="false";
		}else{	
			$('metro_areacheck').innerHTML="&nbsp;";	
		}
	}
	if(type=='all' || type=="cnlocation"){  
		if($('cnlocation').value==""){
			$('cnlocationcheck').innerHTML="Please select Consultant Location";
			$('conneedvaliddata').value="false";
		}else{	
			$('cnlocationcheck').innerHTML="&nbsp;";	
		}
	}
 }
}
function getConsultantneed(){
   document.consultantneed.faction.value="add";
   document.consultantneed.conneedvaliddata.value="true";
   document.consultantneed.savetype.value="draft";
   consultantneedValidation('all');    
   if($('conneedvaliddata').value=="true"){	  
	   document.consultantneed.submit();
   }
 }
function editmycn(id,pg,lm){
 location.href='myaccount.php?mode=consultant&view=edit&cid='+id+'&pg='+pg+'&lm='+lm;
}
function delMycn(val){
  if(confirm("Are you sure you want to delete this consultant need?")){
	 document.my_consultantneed_list.cnid.value=val;
	 document.my_consultantneed_list.fAction.value="delete";
	 document.my_consultantneed_list.submit();
  }
}
function getConsultantedit(){
	document.editmycn.savetype.value="save";
   document.editmycn.fAction.value="update";
   document.editmycn.conneedvaliddata.value="true";
   consultantneedValidation('all');    
   if($('conneedvaliddata').value=="true"){	  
	   document.editmycn.submit();
   }
 }
 function getConsultanteditdraft(){
	document.editmycn.savetype.value="draft";
   document.editmycn.fAction.value="update";
   document.editmycn.conneedvaliddata.value="true";
   consultantneedValidation('all');    
   if($('conneedvaliddata').value=="true"){	  
	   document.editmycn.submit();
   }
 }
function gettwovaluesforcn(){
	if(document.mainfrm.cnarea_interest.value!=""){
		var arinval=document.mainfrm.cnarea_interest.value.split("-");
		val = arinval[0];
		art = arinval[1];
		var fid=art.toLowerCase();
	}else{
		fid="";
	}
	if(document.mainfrm.cnmetro_area.value!=""){
		var ametval=document.mainfrm.cnmetro_area.value.split("-");
		val2 = ametval[0];
		art2 = ametval[1];
		var mid=art2.toLowerCase();
	}else{
		mid="";
	}
	//reg = /\s+/;
	//art=art.replace(reg,'+');
	location.href="needed-list.php?fid="+fid+"&mid="+mid;
}
function getcnbrowsearea(metro,val,cs,locl){
	if(val!=""){
		var msarinval=val.split("-");
		valm = msarinval[0];
		msart = msarinval[1];
		var val=msart.toLowerCase();
	}else{
		val="";
	}
	if(metro!=""){
		var msarinval=metro.split("-");
		valm = msarinval[0];
		msart = msarinval[1];
		var metro=msart.toLowerCase();
	}else{
		metro="";
	}
		
	if(locl==""){
		pthurl="";
		if(val!=""){
			pthurl=pthurl+"fid="+val;
		}else{
			pthurl=pthurl;
		}
		if(metro!=""){
			if(pthurl!="")
				pthurl=pthurl+"&mid="+metro;
			else
				pthurl=pthurl+"mid="+metro;
		}
		if(cs=="")
		 location.href="needed-list.php?"+pthurl;
		else
		 location.href="needed-list.php?"+pthurl+"&cs="+cs;
	}else{
		pthurl="";
		if(val!=""){
			pthurl=pthurl+"fid="+val;
		}else{
			pthurl=pthurl;
		}
		if(metro!=""){
			if(pthurl!="")
				pthurl=pthurl+"&mid="+metro;
			else
				pthurl=pthurl+"mid="+metro;
		}
		if(locl!=""){
			if(pthurl!="")
				pthurl=pthurl+"&loc="+locl;
			else
				pthurl=pthurl+"loc="+locl;
		}
		if(cs=="")
		 location.href="needed-list.php?"+pthurl;
		else
		 location.href="needed-list.php?"+pthurl+"&cs="+cs;
	}
}
function getcnbrowsemetroarea(farea,mval,cs,loc){
	if(farea!=""){
		var msarinval=farea.split("-");
		valm = msarinval[0];
		msart = msarinval[1];
		var farea=msart.toLowerCase();
	}else{
		farea="";
	}
	if(mval!=""){
		var msarinval=mval.split("-");
		valm = msarinval[0];
		msart = msarinval[1];
		var mval=msart.toLowerCase();
	}else{
		mval="";
	}
	
	if(loc==""){
		pthurl="";
		if(farea!=""){
			pthurl=pthurl+"fid="+farea;
		}else{
			pthurl=pthurl;
		}
		if(mval!=""){
			if(pthurl!="")
				pthurl=pthurl+"&mid="+mval;
			else
				pthurl=pthurl+"mid="+mval;
		}
		if(cs=="")
		 location.href="needed-list.php?"+pthurl;	
		else
		 location.href="needed-list.php?"+pthurl+"&cs="+cs;
	}else{
		pthurl="";
		if(farea!=""){
			pthurl=pthurl+"fid="+farea;
		}else{
			pthurl=pthurl;
		}
		if(mval!=""){
			if(pthurl!="")
				pthurl=pthurl+"&mid="+mval;
			else
				pthurl=pthurl+"mid="+mval;
		}
		if(loc!=""){
			if(pthurl!="")
				pthurl=pthurl+"&loc="+loc;
			else
				pthurl=pthurl+"loc="+loc;
		}
		if(cs=="")
		 location.href="needed-list.php?"+pthurl;	
		else
		 location.href="needed-list.php?"+pthurl+"&cs="+cs;
	}
}
function getconexpressfocusoutarea(id){
 consultantexpressValidation(id);
 if($(id)){
  $(id).className='regtxtarea';
 }  
}
function consultantexpressValidation(type){
 if($('conexpvaliddata')){
	if(type=='all' || type=="letter"){  
		if($('letter').value=="" && $('resumelink').value==""){
			$('resumelinkcheck').innerHTML="Please enter your cover letter or attach your resume";
			$('conexpvaliddata').value="false";
		}else{
			if($('resumelink').value!=""){
				var fup = document.getElementById('resumelink');
				var fileName = fup.value;
				var ext1 = fileName.substring(fileName.lastIndexOf('.') + 1);
				var ext = ext1.toLowerCase();
				if(ext == "doc" || ext == "txt" || ext == "pdf" || ext == "docx"){
					$('resumelinkcheck').innerHTML="&nbsp;";
				}else{
					$('resumelinkcheck').innerHTML="Please Upload docx or txt or doc or pdf files only";
					$('conexpvaliddata').value="false";
				}
			}else{
				$('resumelinkcheck').innerHTML="&nbsp;";
			}
		}
	}
 }
}
function getexpresscn(id){
	if(id!=""){
		document.browse_consultant.fAction.value="express";
		location.href="needed-list.php?cnid="+id;	
	}
}
function getConsultantexpress(cnid){
   document.expressneed.fAction.value="expresscn";
   document.expressneed.conexpvaliddata.value="true"; 
   consultantexpressValidation('all');    
   if($('conexpvaliddata').value=="true"){	  
	   document.expressneed.submit();
   }
 }
 function getConsultantneedforsave(){
	/*if(document.consultantneed.coupon.value!=""){
		document.consultantneed.faction.value="discount";
	}else{
		document.consultantneed.faction.value="payment";
	}*/
	/*alert(document.getElementById('feevalsetting').value);
	return false;*/
	document.consultantneed.savetype.value="save";
	if(document.getElementById('feevalsetting').value=="pay"){
		document.consultantneed.faction.value="discount";
		document.consultantneed.conneedvaliddata.value="true"; 
		consultantneedValidation('all');
		// alert(document.consultantneed.faction.value);
		//return false;
		if(document.consultantneed.faction.value=="payment")
   			document.consultantneed.totalamount.value=document.consultantneed.cnfee.value;
		if($('conneedvaliddata').value=="true"){	  
			document.consultantneed.action="consultant-needed.php";
			document.consultantneed.submit();
   		}
	}else{
		document.consultantneed.faction.value="add";
		document.consultantneed.conneedvaliddata.value="true"; 
		consultantneedValidation('all');    
		if($('conneedvaliddata').value=="true"){	  
			document.consultantneed.submit();
		}
	}
 }
/* function getpaymentverify(){
	if(document.getElementById('method').value=="1"){
		var url=document.getElementById('action').value;
		document.paymentinvoice.action=url;
	}else{
		document.getElementById('faction').value="paycredit";
	}
	document.paymentinvoice.submit();
}*/
function getshowmethod(val){
	document.getElementById('method').value=val;
	if(val=="2"){
	  document.getElementById('showccpayment').style.display="block";
	}else{
	  if(document.getElementById('showccpayment').style.display=="block")
	   document.getElementById('showccpayment').style.display="none";
	}	
}
function getpaymentmethod(){
	if(document.getElementById('method').value == ""){
		alert("Please Select Payment Type");
		return false;
	}
	if(document.getElementById('method').value=="2"){
	FirstName=document.getElementById('fname').value;
		if(FirstName==""){
			alert("Please Enter First Name");
			document.getElementById('fname').focus();
			return false;
		}
	LastName=document.getElementById('lname').value;
		if(LastName==""){
			alert("Please Enter Last Name");
			document.getElementById('lname').focus();
			return false;
		}	
	Address=document.getElementById('address').value;
		if(Address==""){
			alert("Please Enter  Address");
			document.getElementById('address').focus();
			return false;
		}
	if(document.getElementById('city').value == ""){
		alert("Please Enter the City name");
		document.getElementById('city').focus();
		return false;
	}
	if(document.getElementById('state').value == "" && document.getElementById('slstate').value == ""){
		alert("Please Enter the State name");
		document.getElementById('state').focus();
		return false;
	}
	if(document.getElementById('country').value == ""){
		alert("Please Select Country");
		document.getElementById('country').focus();
		return false;
	}	
	if(document.getElementById('zipcode').value == ""){
		alert("Please Enter PostalCode");
		document.getElementById('zipcode').focus();
		return false;
	}
		if(document.getElementById('ccname').value == ""){
			alert("Please Enter Name");
			document.getElementById('ccname').focus();
			return false;
			}
		if(document.getElementById('ccnumber').value == ""){
			alert("Please Enter Card Number");
			document.getElementById('ccnumber').focus();
			return false;
			}
		if(document.getElementById('cctype').value == ""){
			alert("Please Select Card Type");
			document.getElementById('cctype').focus();
			return false;
			}
		selDMonth=document.getElementById('expmon').value;
		/*selDDate=document.getElementById('selDDate').value;*/
		selDYear=document.getElementById('expyear').value;
			if(selDMonth==""){
				alert("Please select the Expiration Month");
				document.getElementById('expmon').focus();
				return false;
				}
			/*if(selDDate==""){
				alert("Please select the Expiration Date");
				document.getElementById('selDMonth').focus();
				return false;
			}*/
			if(selDYear==""){
				alert("Please select the Expiration Year");
				document.getElementById('expyear').focus();
				return false;
			}
		
		if(document.getElementById('cvccode').value == ""){
			alert("Please Enter CVC Code");		
			document.getElementById('cvccode').focus();
			return false;
			}
		if(document.getElementById('cvccode').value == "000" || document.getElementById('cvccode').value == "00" || document.getElementById('cvccode').value == "0"){
			alert("Invalid CVC Code");
			document.getElementById('cvccode').focus();
			return false;
		}
		cardnumber=document.getElementById('ccnumber').value ;
		 cardName=document.getElementById('cctype').value ;
		 cvc=document.getElementById('cvccode').value;
		 clen=cvc.length ;
		
		 if(cardName=="American Express"){
			  if(clen!=4){
				   alert("American Express CVC Code Should have 4 digits");
				   document.getElementById('cvccode').focus();
				   return false;
			  }
		 }
	  // Array to hold the permitted card characteristics
	  var cardname = new Array();
	  // Define the cardname we support. You may add addtional card types.
	  
	  //  Name:      As in the selection box of the form - must be same as user's
	  //  Length:    List of possible valid lengths of the card number for the card
	  //  prefixes:  List of possible prefixes for the card
	  //  checkdigit Boolean to say whether there is a check digit
	  
	  cardname [0] = {name: "Visa", 
				   length: "13,16", 
				   prefixes: "4",
				   checkdigit: true};
	  cardname [1] = {name: "Mastercard", 
				   length: "16", 
				   prefixes: "51,52,53,54,55",
				   checkdigit: true};
	  cardname [2] = {name: "Diner's Club", 
				   length: "14,16", 
				   prefixes: "300,301,302,303,304,305,36,38,55",
				   checkdigit: true};
	  cardname [3] = {name: "CarteBlanche", 
				   length: "14", 
				   prefixes: "300,301,302,303,304,305,36,38",
				   checkdigit: true};
	  cardname [4] = {name: "American Express", 
				   length: "15", 
				   prefixes: "34,37",
				   checkdigit: true};
	  cardname [5] = {name: "Discover", 
				   length: "16", 
				   prefixes: "6011,650",
				   checkdigit: true};
	  cardname [6] = {name: "JCB", 
				   length: "15,16", 
				   prefixes: "3,1800,2131",
				   checkdigit: true};
	  cardname [7] = {name: "enRoute", 
				   length: "15", 
				   prefixes: "2014,2149",
				   checkdigit: true};
	  cardname [8] = {name: "Solo", 
				   length: "16,18,19", 
				   prefixes: "6334, 6767",
				   checkdigit: true};
	  cardname [9] = {name: "Switch", 
				   length: "16,18,19", 
				   prefixes: "4903,4905,4911,4936,564182,633110,6333,6759",
				   checkdigit: true};
	  cardname [10] = {name: "Mastercard Debit Card", 
				   length: "16", 
				   prefixes: "5020,6",
				   checkdigit: true};
	  cardname [11] = {name: "Visa Debit Card", 
				   length: "16", 
				   prefixes: "417500,4917,4913",
				   checkdigit: true};
				   
	  // Establish card type
	  var cardType = -1;
	  for (var i=0; i<cardname.length; i++) { 
		// See if it is this card (ignoring the case of the string)
		//  if (cardname.toLowerCase () == cards[i].name.toLowerCase()) {
		if (cardName.toLowerCase () == cardname[i].name.toLowerCase()) {		
		  cardType = i;
		  break;
		}
	  }
	  // If card type not found, report an error
	  if (cardType == -1) {
		  alert("Unknown card type");
	   //  ccErrorNo = 0;
	   document.getElementById('ccnumber').focus();
			 return false; 
	  }
	 
	  // Ensure that the user has provided a credit card number
	  if (cardnumber.length == 0)  {
		// ccErrorNo = 1;
		alert("No card number provided");
		document.getElementById('ccnumber').focus();
		 return false; 
	  }
		
	  // Now remove any spaces from the credit card number
	  cardnumber = cardnumber.replace (/\s/g, "");
	
	  // Check that the number is numeric
	  var cardNo = cardnumber;
	  var cardexp = /^[0-9]{13,19}$/;
	 
	  if (!cardexp.exec(cardNo))  {
	   //  ccErrorNo = 2;
	   alert("Credit card number does not match the type of card you selected");
		 document.getElementById('ccnumber').focus();
		 return false; 
	  }
	  
	  // Now check the modulus 10 check digit - if required
	  /*if (cardname[cardType].checkdigit) {
		alert()
		var checksum = 0;                                  // running checksum total
		var mychar = "";                                   // next char to process
		var j = 1;                                         // takes value of 1 or 2
	  
		// Process each digit one by one starting at the right
		var calc;
		for (i = cardNo.length - 1; i >= 0; i--) {
		
		  // Extract the next digit and multiply by 1 or 2 on alternative digits.
		  calc = Number(cardNo.charAt(i)) * j;
		
		  // If the result is in two digits add 1 to the checksum total
		  if (calc > 9) {


			checksum = checksum + 1;
			calc = calc - 10;
		  }
		
		  // Add the units element to the checksum total
		  checksum = checksum + calc;
		
		  // Switch the value of j
		  if (j ==1) {j = 2} else {j = 1};
		} 
	  
		// All done - if checksum is divisible by 10, it is a valid modulus 10.
		// If not, report an error.
		if (checksum % 10 != 0)  {
		 ccErrorNo = 3;

		 return false; 
		}
	  }  */
	
	  // The following are the card-specific checks we undertake.
	  var LengthValid = false;
	  var PrefixValid = false; 
	  var undefined; 
	
	  // We use these for holding the valid lengths and prefixes of a card type
	  var prefix = new Array ();
	  var lengths = new Array ();
		
	  // Load an array with the valid prefixes for this card
	  prefix = cardname[cardType].prefixes.split(",");
		  
	  // Now see if any of them match what we have in the card number
	  for (i=0; i<prefix.length; i++) {
		var exp = new RegExp ("^" + prefix[i]);
		if (exp.test (cardNo)) PrefixValid = true;
	  }
		  
	  // If it isn't a valid prefix there's no point at looking at the length
	  if (!PrefixValid) {
		// ccErrorNo = 3;
		alert("Credit card number does not match the type of card you selected");
		document.getElementById('ccnumber').focus();
		 return false; 
	  }
		
	  // See if the length is valid for this card
	  lengths = cardname[cardType].length.split(",");
	  for (j=0; j<lengths.length; j++) {
		if (cardNo.length == lengths[j]) LengthValid = true;
	  }
	 
	  // See if all is OK by seeing if the length was valid. We only check the 
	  // length if all else was hunky dory.
	  if (!LengthValid) {
		 //ccErrorNo = 4;
		 alert("Credit card number has an inappropriate number of digits");
		 document.getElementById('ccnumber').focus();
		 return false; 
	  }  
  }
  document.getElementById('faction').value="paymentmethod";
  if(document.getElementById('modmethod').value=="addpremium")
  	document.payment.action="myaccount.php?mode=addpremium&pid=pay";//+document.getElementById('payid').value;
  else if(document.getElementById('modmethod').value=="consultant")
  	document.payment.action="myaccount.php?mode=consultant&view=edit&cid="+document.getElementById('cid').value+"&pid=pay";//+document.getElementById('payid').value;
  else if(document.getElementById('modmethod').value=="acceptrequirement")
  	document.payment.action="myaccount.php?mode=acceptrequirement&cid="+document.getElementById('cid').value+"&pid=pay";//+document.getElementById('payid').value;
  else if(document.getElementById('modmethod').value=="premiummember")
  	document.payment.action="getpremium.php?mode=premiummember&pid=pay";
  else if(document.getElementById('modmethod').value=="premiumcs")
  	document.payment.action="addcspremium.php?mode=premiumcs&pid=pay";
  else
    document.payment.action="consultant-needed.php?pid=pay";//+document.getElementById('payid').value;
  document.payment.submit();
}
function getselectcnt(val){
	 if(val!="US"){
	   document.getElementById('sltstate').style.display="none";
	   document.getElementById('txtstate').style.display="block";
	 }else{
	   document.getElementById('sltstate').style.display="block";
	   document.getElementById('txtstate').style.display="none";
	 }	
}
function getpaymentverify(){
	if(document.getElementById('method').value=="1"){
		var url=document.getElementById('actn').value;
		document.paymentinvoice.action=url;
	}else{
		document.getElementById('faction').value="paycredit";
	}
	document.paymentinvoice.submit();
}
function getcalculatecouponcode(){
	if(document.getElementById('ccode').value==""){
		$('ccodecheck').innerHTML="Please enter your Coupon Code";
		$('couponvaliddata').value="false";
		document.getElementById('disc').style.display="none";
		document.getElementById('totalval').style.display="none";
	}else{
		document.getElementById('discountpage').style.display="block";
			document.getElementById('paypage').style.display="none";
		if(document.discount.coupon.value==document.discount.ccode.value){
			document.getElementById('totalamount').value=document.getElementById('cnfee').value-document.getElementById('discountval').value;
			document.getElementById('totalamount').value=Math.round(document.getElementById('totalamount').value*100)/100;
			if(document.getElementById('cnfee').value-document.getElementById('discountval').value>0){
				if(document.getElementById('countval').value>=1){
					$('ccodecheck').innerHTML="Sorry – the coupon code is usable only once";
					$('couponvaliddata').value="false";
				}else{
					document.getElementById('disc').style.display="block";
					document.getElementById('totalval').style.display="block";
					$('ccodecheck').innerHTML="&nbsp;";	
				   document.discount.couponvaliddata.value="true"; 
				   couponValidation('all');    
				   if($('couponvaliddata').value=="true"){
					   if(document.discount.mode.value==""){
							document.discount.action="consultant-needed.php";
					   }else{
							document.discount.action="myaccount.php?mode=consultant&view=edit&cid="+document.discount.cid.value;
					   }
					   document.discount.submit();
				   }
				}
			}else{
				document.discount.submit();
			}
		}else{
			document.getElementById('discountpage').style.display="block";
			document.getElementById('paypage').style.display="none";
			document.discount.faction.value="checkcoupon";
			if(document.discount.mode.value==""){
				document.discount.action="consultant-needed.php";
			}else{
				document.discount.action="myaccount.php?mode=consultant&view=edit&cid="+document.discount.cid.value;
			}
			document.discount.submit();
		}
	}
 }
 function couponValidation(type){
 if($('couponvaliddata')){
	if(type=='all' || type=="ccode"){  
		if($('ccode').value==""){
			$('ccodecheck').innerHTML="Please enter your Coupon Code";
			$('couponvaliddata').value="false";
		}else{	
			$('ccodecheck').innerHTML="&nbsp;";	
	  }
	}
 }
}
function validatecouponcode(){
	if(document.getElementById('ccode').value==""){
		$('ccodecheck').innerHTML="Please enter your Coupon Code";
		$('couponvaliddata').value="false";
		document.getElementById('disc').style.display="none";
		document.getElementById('totalval').style.display="none";
	}else{	
		/*if(document.discount.coupon.value==document.discount.ccode.value){
			if(document.getElementById('countval').value>=1){
				$('ccodecheck').innerHTML="Sorry – the coupon code is usable only once";
				$('couponvaliddata').value="false";
			}else{
				document.getElementById('disc').style.display="block";
				document.getElementById('totalval').style.display="block";
				$('ccodecheck').innerHTML="&nbsp;";	
			}
		}else{
			$('ccodecheck').innerHTML="Sorry – incorrect code";
			$('couponvaliddata').value="false";
		}*/
		document.getElementById('discountpage').style.display="block";
		document.getElementById('paypage').style.display="none";
		document.discount.faction.value="checkcoupon";
		//document.discount.action="consultant-needed.php";
		document.discount.submit();
	}
}
function validatecouponcodevalues(){
	if(document.getElementById('ccode').value==""){
			$('ccodecheck').innerHTML="Please enter your Coupon Code";
			$('couponvaliddata').value="false";
			document.getElementById('disc').style.display="none";
			document.getElementById('totalval').style.display="none";		
	}else{	
		if(document.discount.coupon.value==document.discount.ccode.value && $('disc')){
			if(document.getElementById('countval').value>=1){
				$('ccodecheck').innerHTML="Sorry – the coupon code is usable only once";
				$('couponvaliddata').value="false";
			}else{
				document.getElementById('disc').style.display="block";
				document.getElementById('totalval').style.display="block";
				$('ccodecheck').innerHTML="&nbsp;";	
			}
		}else{
			$('ccodecheck').innerHTML="Sorry – incorrect code";
			$('couponvaliddata').value="false";
		}
	}
	getdiscountpage('yes');
}
function fieldEnterval(fldName,evt) {
	evt = (evt) ? evt : window.event;
	if (evt.keyCode == 13 ) {
		return false;
	} else {
		return true;
	}
}
function geteditConsultantneedforsave(){
	/*if(document.editmycn.coupon.value!=""){
		document.editmycn.faction.value="discount";
	}else{
		document.editmycn.faction.value="payment";
	}*/
	document.editmycn.savetype.value="save";
	if(document.getElementById('amtvalsetting').value=="pay"){
		document.editmycn.faction.value="discount";
   		document.editmycn.conneedvaliddata.value="true"; 
   		consultantneedValidation('all');  //alert(document.editmycn.faction.value);return false; 
   		if(document.editmycn.faction.value=="payment")
   			document.editmycn.totalamount.value=document.editmycn.cnfee.value;
   		if($('conneedvaliddata').value=="true"){	  
	   		document.editmycn.action="myaccount.php?mode=consultant&view=edit&cid="+document.editmycn.cid.value;
	   		document.editmycn.submit();
   		}
	}else{
		document.editmycn.fAction.value="update";
		document.editmycn.conneedvaliddata.value="true";
		consultantneedValidation('all');    
		if($('conneedvaliddata').value=="true"){	  
			document.editmycn.submit();
		}
	}
 }
 function getdiscountpage(val){
	 if(val=="yes"){
		 if(document.getElementById('discountpage'))
		 	document.getElementById('discountpage').style.display="block";
		 if(document.getElementById('paypage'))
		 	document.getElementById('paypage').style.display="none";	
	 }else{
		 if(document.getElementById('discountpage'))
		 	document.getElementById('discountpage').style.display="none";
		 if(document.getElementById('paypage'))
		 	document.getElementById('paypage').style.display="block";
	 }
 }
 function getpaypage(){
	if(document.getElementById('disc_yes').checked==false && document.getElementById('disc_no').checked==false){
		alert("Please select the method you want");
		return false;
	}else{
		document.discount.faction.value="payment";
		if(document.discount.faction.value=="payment")
   			document.discount.totalamount.value=document.discount.cnfee.value;
	   if(document.discount.mode.value==""){
			document.discount.action="consultant-needed.php";
	   }else{
			document.discount.action="myaccount.php?mode=consultant&view=edit&cid="+document.discount.cid.value;
	   }
	   document.discount.submit();
	}
 }
 function getskipdiscountpage(){
	 document.discount.faction.value="payment";
	 document.discount.submit();
 }
 function getnewreg(id){
  if(id!=''){
   location.href="myaccount.php";  }
   else{
  document.mainfrm.action="register.php";
  document.mainfrm.submit();
  }
 }
var currentdate = 0
var core = 0
function StringArray (n) {
  this.length = n;
  for (var i =1; i <= n; i++) {
    this[i] = ' '
  }
}
image = new StringArray(4)
image[0] = 'assets/images/1.gif'
image[1] = 'assets/images/2.jpg'
image[2] = 'assets/images/3.jpg'
image[3] = 'assets/images/4.jpg'
var ran = 60/4;
function ranimage() {
  currentdate = new Date()
  core = currentdate.getSeconds();
  core = Math.floor(core/ran);
  document.getElementById('welcomeimg').src=image[core];
   // return(image[core])
}
function getsolution(val){
	if(val==''){
		alert("Please enter member id or consulting solution id or consultant needed id to find");
		document.mainfrm.solname.focus();
		return false;
	}else{
		var sep=val.split("-");
		var fsep=sep[1];
		if(!fsep){
			fsep="yes";
		}
		if((fsep.charAt(0)=="c" && fsep.charAt(1)=="n") || (val.charAt(0)=="c" && val.charAt(1)=="n")){
			location.href="needed-list.php?cs="+val;
		}else{
			location.href="solutions-list.php?cs="+val;
		}
	}
}
function fieldEnter(fldName,evt) {
		evt = (evt) ? evt : window.event;
			if (evt.keyCode == 13 ) {
				getsolution(document.mainfrm.solname.value);
				return false;
			} else {
				return true;
			}
	}
function checkfield(){
    var email=$('newslist1').value;  
	if($('newslist1').value==""){
	  alert("Please enter email address to subscribe newsletter");
	  document.mainfrm.newslist1.focus();
	}else{
		if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email)){
			document.mainfrm.submit();
		}else{
			 alert("Please enter valid email address to subscribe newsletter");
	         document.mainfrm.newslist1.focus();
		}
	}	
}
function getpaymentforcoupon(){
	document.getElementById('totalamount').value=Math.round(document.getElementById('neededtotal').value*100)/100;
	if(document.getElementById('totalamount').value>0){
		document.discount.faction.value="payment";
		if(document.discount.mode.value==""){
			document.discount.action="consultant-needed.php";
		}else{
			document.discount.action="myaccount.php?mode=consultant&view=edit&cid="+document.discount.cid.value;
		}
		document.discount.submit();
	}else{
		document.discount.faction.value="listed";
		if(document.discount.mode.value==""){
			document.discount.action="consultant-needed.php";
		}else{
			document.discount.action="myaccount.php?mode=consultant&view=edit&cid="+document.discount.cid.value;
		}
		document.discount.submit();
	}
}
function getConsultingsolutionexpress(cnid){
   document.expresssolution.fAction.value="expresssln";
   document.expresssolution.conexpslnvaliddata.value="true"; 
   consultingslnexpressValidation('all');    
   if($('conexpslnvaliddata').value=="true"){	  
	   document.expresssolution.submit();
   }
 }
function consultingslnexpressValidation(type){
 if($('conexpslnvaliddata')){
	if(type=='all' || type=="message"){  
		if(trim($('message').value)==""){
			$('messagecheck').innerHTML="Please enter a brief message";
			$('conexpslnvaliddata').value="false";
		}else{
			$('messagecheck').innerHTML="&nbsp;";
		}
	}
 }
}
function getconexpressslnfocusoutarea(id){
 consultingslnexpressValidation(id);
 if($(id)){
  $(id).className='regtxtarea';
 }  
}
function gotohome(){
	document.getpremium.action="index.php";
	document.getpremium.submit();
}
function premiumstate(val){
	if(document.getpremium.mkpremium1.checked==true){
		if(val=="addcs"){
			document.getpremium.action="addcspremium.php?mode=premiumcs&pid=pay";
		}else{
			document.getpremium.action="getpremium.php?mode=premiummember&pid=pay";
		}
		document.getpremium.faction.value="payment";
		document.getpremium.submit();
	}else{
		if(document.getpremium.mkpremium1.checked==false && document.getpremium.mkpremium2.checked==false){
			alert("Please select the option");
			return false;
		}else{
			document.getpremium.action="myaccount.php";
			document.getpremium.submit();
		}
	}
}
function changestatusofpremium(){	
	/*ralen = document.changepremium.chgmbrship.length;
	for(i=1; i<=ralen; i++){
			 if(eval("document.changepremium.chgmbrship" + i + ".checked") == true)
			 	selval = eval("document.changepremium.chgmbrship" + i + ".value");
	}
	document.changepremium.hact.value=selval;*/
	//return true;
	if(document.getElementById('paypalem').style.display=="block"){
		if(!isEmail(document.changepremium.paypalemail.value)){
		   document.changepremium.paypalemail.focus();
		   return false;
		}
	}
	if(document.getElementById('chgmbrship1').checked==false && document.getElementById('chgmbrship2').checked==false && document.getElementById('chgmbrship3').checked==false){
		alert("Please select the membership");
		return false;
	}
}
function changeURL(){
	if(document.getElementById('paypalem').style.display=="block"){
		if(!isEmail(document.changepremium.paypalemail.value)){
		   document.changepremium.paypalemail.focus();
		   return false;
		}
	}
	if(document.getElementById('chgmbrship1').checked==false && document.getElementById('chgmbrship2').checked==false && document.getElementById('chgmbrship3').checked==false){
		alert("Please select the membership");
		return false;
	}
	var lnk = document.getElementById('paylnk');
	//chgat=document.getElementById('paypalemail').value.replace("@","%40");
	//chgdot=chgat.replace(".","%2e");
	//lnk.href = "cancel_recur.php?email="+document.getElementById('paypalemail').value;
	document.changepremium.submit();
}