function actionSurvey(){
	 var disable_rollover=0; 
     if(checkeMail() && (disable_rollover == 0)) {
     			   //MM_swapImage('Business','','images/free-week-images/topButton3.gif',1)
				   disable_rollover=1;
     			   document.forms[0].submit();
     }      
     
}

function checkParent(){
   document.forms[0].index_iam[0].checked = true;
}

function isParent(){
   document.forms[0].index_age1.enabled;
   document.forms[0].index_age2.enabled;
   document.forms[0].index_age3.enabled;
}


function isNotParent(){			
	   document.forms[0].index_age1.checked = false;
	   document.forms[0].index_age2.checked = false;
	   document.forms[0].index_age3.checked = false;	
}

function checkeMail(){		 
		 var testresult
		 var str=document.forms[0].cc_email.value
str = str.replace(/^\s+|\s+$/g, '')
		 var filter = /^([\w-+]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i			 
		 if (filter.test(str))
			  testresult = true
		 else{
			  alert('Please enter a valid e-mail address.\n\nValid characters include numbers, letters and _\n(underscore) but no spaces and other symbols.')
			  document.forms[0].cc_email.focus();
			  testresult = false
		 }		 
		 return (testresult)
		
}


function checkMail(){      	
		var at="@"
		var dot="."
        var str = document.forms[0].cc_email.value
str = str.replace(/^\s+|\s+$/g, '')
		var lenghtstr=str.length
		var lat=str.indexOf(at)		
		var ldot=str.indexOf(dot)
        if(lTrim(str)== '' || lenghtstr < 3 || lat == -1 || ldot == -1 || str.indexOf(",") > -1 || str.indexOf(";") > -1 || str.indexOf("*") > -1 || str.indexOf(" ") > -1 || str.indexOf("-") > -1)
        {        
		    alert('Please enter a valid e-mail address.\n\nValid characters include numbers, letters and _\n(underscore) but no spaces and other symbols.')
		    document.forms[0].cc_email.focus();		  
		    return false;
		}
		
		if (str.indexOf(at)==0 || str.indexOf(at)==lenghtstr){
		    alert('Please enter a valid e-mail address.\n\nValid characters include numbers, letters and _\n(underscore) but no spaces and other symbols.')
		    document.forms[0].cc_email.focus();		  
		    return false;
		}

		if (str.indexOf(dot)==0 || str.indexOf(dot)==lenghtstr){
		    alert('Please enter a valid e-mail address.\n\nValid characters include numbers, letters and _\n(underscore) but no spaces and other symbols.')
		    document.forms[0].cc_email.focus();		  
		    return false;
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert('Please enter a valid e-mail address.\n\nValid characters include numbers, letters and _\n(underscore) but no spaces and other symbols.')
		    document.forms[0].cc_email.focus();		  
		    return false;
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert('Please enter a valid e-mail address.\n\nValid characters include numbers, letters and _\n(underscore) but no spaces and other symbols.')
		    document.forms[0].cc_email.focus();		  
		    return false;
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert('Please enter a valid e-mail address.\n\nValid characters include numbers, letters and _\n(underscore) but no spaces and other symbols.')
		    document.forms[0].cc_email.focus();		  
		    return false;
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert('Please enter a valid e-mail address.\n\nValid characters include numbers, letters and _\n(underscore) but no spaces and other symbols.')
		    document.forms[0].cc_email.focus();		  
		    return false;
		 }
		
		return true;
		
}

function checkName(){
	var v;
	v = document.forms[0].cc_first_name.value;
	if(lTrim(v)== ''){
		alert('Please enter your first name.');
		document.forms[0].cc_first_name.focus();
		return false;
	} else{
		return true;
	}
}

function startNow(){
  window.opener.document.forms[0].cc_first_name.focus();
  window.close();
}

function signNow(){	
  window.opener.document.location = '/csp/cc.php';
  window.close();
  //document.forms[0].cc_email.focus();
  
}

function surveyAction($char, $mozChar){	 
     if(($mozChar && $mozChar==13) || ($char && $char== 13)){     		           		      
     		      if(checkeMail()){
     		          actionSurvey();
     		      } 
	   }
}

function questionAction(){
       if((event.which && event.which==13) || (event.keyCode && event.keyCode== 13)){     		           		           		      
           document.forms[0].submit();
	   }
}

function submitSurvey(){
    document.forms[0].submit();
}

function start(){
	document.forms[1].email.focus();
}