
function submitApplyPendingCharges(thisForm)
{


   var todayDate = new Date();
   var currentMonth = todayDate.getMonth();
   var currentYear = todayDate.getYear(); 
   currentMonth = currentMonth + 1;
   var currentYear1 = new String(currentYear);

   currentYear1 = currentYear1.substring(2);



   if(thisForm.card_type.value =='')
   {
	  alert('Select the card type.');
	  thisForm.card_type.focus();
	  return (false);
   }
   else if (thisForm.card_number.value =='')
   {
	  alert('Enter the card number.');
	  thisForm.card_number.focus();
	  return (false);
   }
   else if (thisForm.card_number.value.length < 14 || thisForm.card_number.value.length > 16)
   {
		alert("The card number must contain 14 - 16 digits.");
		thisForm.card_number.focus();
		return (false);
   }
   else if (thisForm.month.value =='')
   {
	  alert('Enter the expiry month for the credit card.');
	  thisForm.month.focus();
	  return (false);
   }
   else if(invalidNumber(thisForm.month.value))
   {
	  alert('Enter a valid expiry month for the credit card.');
	  thisForm.month.focus();
	  return (false);
   }

   else if( (thisForm.month.value < 1) || (thisForm.month.value > 12) )
           {
                 alert('Enter a valid expiry month for the credit card.');
                 thisForm.month.focus();
                 return(false);
   
           } 


   else if (thisForm.year.value =='')
   {
	  alert('Enter the expiry year for the credit card.');
	  thisForm.year.focus();
	  return (false);
   }
   else if(invalidNumber(thisForm.year.value))
   {
	  alert('Enter a valid expiry year for the credit card.');
	  thisForm.year.focus();
	  return (false);
   }
   
     else if( (thisForm.year.value) < (parseInt(currentYear1,10)) )
           {
                alert('Enter a valid expiry year for the credit card.');
                thisForm.year.focus();
                return(false);
           }

     else if( ( (thisForm.year.value) == (parseInt(currentYear1,10)) ) && (  (thisForm.month.value) < (parseInt(currentMonth,10)) ) )
      {

            alert('Enter a valid expiry date for the credit card.');
            thisForm.month.focus();
             return (false);
  
      } 	


else if ( thisForm.address.value =='')
   {
	  alert('Enter a valid billing address.');
	  thisForm.address.focus();
	  return (false);
   }
   else if (inValidAddress(thisForm.address.value) )
   {
	  //alert('Address can contain only A-Z, a-z, 0-9, _, # / ( ) - and blank space');
	   alert('The address can not contain single quotes, double quotes and backward slash.');
      thisForm.address.focus();
	  return (false);
   }
   else if ( thisForm.zip.value =='')
   {
	  alert('Enter the zip code.');
	  thisForm.zip.focus();
	  return (false);
   }
   else if ( inValidZip(thisForm.zip.value) )
   {
      alert('Zip code can only contain characters A-Z, a-z, 0-9,-, _ and blank space.') ;
      thisForm.zip.focus();
	  return (false);
   }
   else
   {
      thisForm.action = "/remotepc/servlet/PendingChargesServlet";
      thisForm.method = "post";
      thisForm.submit();
   }

}



function upgFreeAccSubmit(thisForm)
{


   var todayDate = new Date();
   var currentMonth = todayDate.getMonth();
   var currentYear = todayDate.getYear(); 
   currentMonth = currentMonth + 1;
   var currentYear1 = new String(currentYear);

   currentYear1 = currentYear1.substring(2);


   if(thisForm.card_type.value =='')
   {
	  alert('Select the card type.');
	  thisForm.card_type.focus();
	  return (false);
   }
   else if (thisForm.card_number.value =='')
   {
	  alert('Enter the card number.');
	  thisForm.card_number.focus();
	  return (false);
   }
   else if (thisForm.card_number.value.length < 14 || thisForm.card_number.value.length > 16)
   {
		alert("The card number must contain 14 - 16 digits.");
		thisForm.card_number.focus();
		return (false);
   }

   else if(isBlank(thisForm.cvv.value))
   {
	  alert('Enter the CVV number.');
	  thisForm.cvv.focus();
	  return (false);
   }
   else if(invalidNumber(thisForm.cvv.value))
   {
	  alert('CVV accepts only digits 0-9.');
	  thisForm.cvv.focus();
	  return (false);
   }

   else if (thisForm.month.value =='')
   {
	  alert('Enter the expiry month for the credit card.');
	  thisForm.month.focus();
	  return (false);
   }
   else if(invalidNumber(thisForm.month.value))
   {
	  alert('Enter a valid expiry month for the credit card.');
	  thisForm.month.focus();
	  return (false);
   }

   else if( (thisForm.month.value < 1) || (thisForm.month.value > 12) )
           {
                 alert('Enter a valid expiry month for the credit card.');
                 thisForm.month.focus();
                 return(false);
   
           } 


   else if (thisForm.year.value =='')
   {
	  alert('Enter the expiry year for the credit card.');
	  thisForm.year.focus();
	  return (false);
   }
   else if(invalidNumber(thisForm.year.value))
   {
	  alert('Enter a valid expiry year for the credit card.');
	  thisForm.year.focus();
	  return (false);
   }
   
     else if( (thisForm.year.value) < (parseInt(currentYear1,10)) )
           {
                alert('Enter a valid expiry year for the credit card.');
                thisForm.year.focus();
                return(false);
           }

     else if( ( (thisForm.year.value) == (parseInt(currentYear1,10)) ) && (  (thisForm.month.value) < (parseInt(currentMonth,10)) ) )
      {

            alert('Enter a valid expiry date for the credit card.');
            thisForm.month.focus();
             return (false);
  
      } 	


else if ( thisForm.address.value =='')
   {
	  alert('Enter a valid billing address.');
	  thisForm.address.focus();
	  return (false);
   }
   else if (inValidAddress(thisForm.address.value) )
   {
	  //alert('Address can contain only A-Z, a-z, 0-9, _, # / ( ) - and blank space');
	  alert('The address can not contain single quotes, double quotes and backward slash.');
      thisForm.address.focus();
	  return (false);
   }
   else if ( thisForm.zip.value =='')
   {
	  alert('Enter the zip code.');
	  thisForm.zip.focus();
	  return (false);
   }
   else if ( inValidZip(thisForm.zip.value) )
   {
      alert('Zip code can only contain characters A-Z, a-z, 0-9,-, _ and blank space.') ;
      thisForm.zip.focus();
	  return (false);
   }
   else
   {
      return true;
   }

}
function confirmFeedback(thisForm) 
{ 
   
   if(thisForm.validateEmail.value!='true')
{
   
   if(!isValidEmailId(thisForm.email.value))
   {
      alert('Enter a valid email address.');
      thisForm.email.focus();
      return(false);
   }
   else if(trim(thisForm.user_id.value)!='' && invalidUserName(trim(thisForm.user_id.value)))
	{
	   alert('The username can contain only characters a-z, 0-9 and _ (underscore).');
	  
	   thisForm.user_id.focus();
	   return false;

	}
	else if((thisForm.invUser.value=="too") && isBlank(thisForm.user_id.value)) 
   {  
	  alert("Enter the username to identify your account.");
      thisForm.user_id.focus();
	  return false; 
   }
    else if((thisForm.invUser.value=="too") && (invalidUserName(thisForm.user_id.value)))
   {
	  alert('The username can contain only characters a-z, 0-9 and _ (underscore).');
      thisForm.user_id.focus();
	  return false;
   }

   else if( (thisForm.phone.value!='') && (invalidSecurityPhNum(thisForm.phone.value)))
   {
	   thisForm.phone.focus();
	   alert('The phone number can contain only characters 0-9 x X - +');
	   return(false);
   }
   
   else if(thisForm.os.value == 'select')
	{
	   alert("Select the Operating System.");
	   thisForm.os.focus();
	   return false;
	}
   else if(thisForm.application.value == 'select')
	{
	   alert("Choose your issue.");
	   thisForm.application.focus();
	   return false;
	}
	
   else if(thisForm.application.value=='Other' && isBlank(thisForm.otherinfo.value))
   {
      alert('Enter your technical query or feedback.');
      thisForm.otherinfo.focus();
      return(false);
   }  

	if(thisForm.invEmail.value=="true")
	{
	   STREAMNET.remotepc.emailVerifySyn(thisForm);
	   return(false);
	}

   
   { 
	   thisForm.user_id.value = checkAndReplace(thisForm.user_id.value);
	   thisForm.phone.value = checkAndReplace(thisForm.phone.value);
	   thisForm.email.value = checkAndReplace(thisForm.email.value);
	   thisForm.otherinfo.value = checkAndReplace(thisForm.otherinfo.value);
	   
	   return true ;
   }

}
else
{
	return false;
}
}




function submitAddHosts(thisForm)
{
	if(thisForm.host_number.value=='')
	{
		  alert('Enter the number of host computers that you want to add.');
		  thisForm.host_number.focus();
		  return false;
	}
	else if(invalidNumber(thisForm.host_number.value)  || ((parseInt(thisForm.host_number.value,10)) <=0))
	   {
		  alert('Enter a valid  number.');
		  thisForm.host_number.focus();
		  return (false);
	   }
	else if( ((parseInt(thisForm.host_number.value,10)) + (parseInt(thisForm.existing_hosts.value,10))) > 100)
	{
          alert('The total number of host computers can not exceed 100.');
          thisForm.host_number.focus();
		  return false;
	}
	else
	{
		  return true;
	}
    


}












function hdpopulateUserName(thisForm,check)
{

 var fname = thisForm.first_name.value;
 var lname = thisForm.last_name.value;
 var firname = '';
 var lasname = '' ;
 var ch;
 var userallowed = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";

 
     //alert('check1'+thisForm.check1.value);

    if( (check==1) && (thisForm.check1.value=='') )
	{
          
             if((fname!='') && (lname!=''))
		     {

						  thisForm.user_id.value = ' ';
						  
						  for (var loop = 0;loop<fname.length ; loop++)
						  {
							  ch = fname.charAt(loop);
							  if(userallowed.indexOf(ch)!= -1)
							  { firname = firname + ch; }

						  }
                          if(firname=='' || firname!='')
				          {fname = firname;}						  
							  
						  for (var loop = 0;loop<lname.length ; loop++)
						  {
							  ch = lname.charAt(loop);
							  if(userallowed.indexOf(ch)!= -1)
							  { lasname = lasname + ch; }
						  }

						  if(lasname=='' || lasname!='')
				          {lname = lasname;}
							 
						 

						 fname = fname.toLowerCase();
						 lname = lname.toLowerCase();

						  if(fname.length > 10)
						 {
							  fname = fname.substring(0,10).toLowerCase();
						 }

						 if(lname.length >=10)
						 {
							  lname = lname.substring(0,9).toLowerCase();
						 }

						 if(fname=='' && lname=='')
				         { thisForm.user_id.value = ''; }
						 else
				         {thisForm.user_id.value = fname + "_" + lname;
				          }
						 thisForm.user_id.select();
				
			 }	 

	}// end of check==1
	else if( (check == 2) && (thisForm.check1.value == 1) )
	{
       thisForm.user_id.value = thisForm.user_id.value;
	   thisForm.check1.value = 1;
	   thisForm.user_id.select();

	}
   
}




function setState(thisForm)
{
	if(thisForm.country.value != 'United States of America')
	{
		  thisForm.state.value = "Others";
		  thisForm.state.disabled = true;
	}
	else

	{
		  thisForm.state.value = "Choose a state";
		  thisForm.state.disabled = false;
	}
}


function setupdateprofileState(thisForm)
{   
    if(thisForm.country.value != 'United States of America')
	{
		  thisForm.state.value = "Others";
		  thisForm.state.disabled = true;
	}
	else
	{
		  thisForm.state.value = "Choose a state";
		  thisForm.state.disabled = false;
	}

}

function confirmChangePwd(thisForm) 
{ 
   if(isBlank(thisForm.user_passwd.value))
   {
      alert('Enter the Password.');
	  thisForm.user_passwd.focus();
      return (false);
   }
   else if(inValidString(thisForm.user_passwd.value))
   {
       alert('Password can contain only A-Z, a-z, and 0-9 as characters.')
       thisForm.user_passwd.focus();
       return (false);
   }
   else if( (thisForm.user_passwd.value.length < 4) || (thisForm.user_passwd.value.length > 16))
   {
       alert('Password must contain 4-16 characters.');
       thisForm.user_passwd.focus();
       return(false);
   }
  /* else if(!containsNumeric(thisForm.user_passwd.value))
   {
       alert('Password should have at least one numeric character')
       thisForm.user_passwd.focus();
       return (false);
   }*/
   else if(thisForm.user_passwd2.value!=thisForm.user_passwd.value)
   {  alert('The confirm password must match the password.');
      thisForm.user_passwd2.focus();
      return (false);
   }
   else
   { 
      return (true);
   }
}








// For Forgot Password 

function confirmForgotPwd(thisForm) 
{ 
   if( (thisForm.user_id.value=='') && (thisForm.email.value=='') )
    {
      alert('Enter username or email address.');
      return (false);
    }
    else if( (thisForm.user_id.value!='') && (invalidUserName(thisForm.user_id.value)) )
    {
      alert('The username can contain only characters a-z, 0-9 and _ (underscore).');
      thisForm.user_id.focus();
      return (false);
    }
    else if( (thisForm.email.value!='') && (!isValidEmailId(thisForm.email.value)) )
    {
      alert('Enter a valid email address');
      thisForm.email.focus();
      return(false);
    } 
   else
   { 
      return (true);
   }
}







//For Cancellation process
function confirmCancel(thisForm)
{

   if(isBlank(thisForm.USERNAME.value))
   {
      alert('Enter Username or email address.');
      thisForm.USERNAME.focus();
      return (false);
   }
   else if(thisForm.USERNAME.value.indexOf('@')!=-1)
   {
	   if(!isValidEmailId(thisForm.USERNAME.value))
		{
		   thisForm.USERNAME.focus();
		   alert('Enter a valid username/email address.');
		   return (false);
		}
	}
    else if(thisForm.USERNAME.value.indexOf('@')==-1)
	{
	   if(invalidUserName(thisForm.USERNAME.value))
	   {
	     thisForm.USERNAME.focus();
	     alert('Enter a valid Username.');
	     return (false);
	   }
	}
   
   if(isBlank(thisForm.PASSWORD.value))
   {
      alert('Enter the Password.');
      thisForm.PASSWORD.focus();
      return (false);
   }
   else if (inValidString(thisForm.PASSWORD.value))
   {
       alert('Password can contain only A-Z, a-z, and 0-9 as characters.')
       thisForm.PASSWORD.focus();
       return (false);
   }
   else if( (thisForm.PASSWORD.value.length < 4) || (thisForm.PASSWORD.value.length > 16))
   {
        alert('Password must be between 4 to 16 characters.');
        thisForm.PASSWORD.focus();
        return(false);
   }
 /*  else if (!containsNumeric(thisForm.PASSWORD.value))
   {
       alert('Password should have at least one numeric character')
       thisForm.PASSWORD.focus();
       return (false);
   }*/
   else   if (thisForm.REASON.value =='')
	{
		thisForm.REASON.focus();
		alert('Select a reason for canceling your RemotePC account.'); 
		return (false);
	}

	else if ( (thisForm.REASON.value =='Others') && (thisForm.OTHERREASON.value ==''))
	{
		thisForm.OTHERREASON.focus();
		alert('Enter your Comments.');
		return (false);
	}
   else if( (thisForm.EMAIL.value!='') && (!isValidEmailId(thisForm.EMAIL.value)) )
   {
      alert('Enter a valid email address.');
      thisForm.EMAIL.focus();
      return(false);
   }
   else
   {
      thisForm.REASON.value = checkAndReplace(thisForm.REASON.value);
	  thisForm.OTHERREASON.value = checkAndReplace(thisForm.OTHERREASON.value);
	  return true ;
   }

}


 
//For Registration process
function confirmSubmit(thisForm)
{

   var todayDate = new Date();
   var currentMonth = todayDate.getMonth();
   var currentYear = todayDate.getYear(); 
   currentMonth = currentMonth + 1;
   var currentYear1 = new String(currentYear);

   currentYear1 = currentYear1.substring(2);

    if (thisForm.first_name.value =='')
   {
	  alert('Enter the First name.');
	  thisForm.first_name.focus();
	  return (false);
   }
   else if (invalidName(thisForm.first_name.value))
   {
	  alert('First name can contain only characters A-Z, a-z and blank space.');
      thisForm.first_name.focus();
	  return (false);
   }
   else if (thisForm.last_name.value == '')
   {
	  alert('Enter the Last name.');
	  thisForm.last_name.focus();
	  return (false);
   }
   else if (invalidName(thisForm.last_name.value))
   {
	  alert('Last name can contain only characters A-Z, a-z and blank space.');
	  thisForm.last_name.focus();
	  return (false);
   }


   else if(isBlank(thisForm.user_id.value))
   {  alert('Enter the Username.');
      thisForm.user_id.focus();
	  return (false);
   }
   else if(invalidUserName(thisForm.user_id.value))
   {  
	  thisForm.user_id.value = thisForm.user_id.value;
      thisForm.check1.value = 1;
      hdpopulateUserName(thisForm,'2'); 
	  alert(' The username can contain only characters a-z, 0-9 and _ (underscore).');
	  return (false);
   }
   else if(thisForm.user_id.value.length < 4 ||thisForm.user_id.value.length > 20  )
   {
	  alert('Username must be between 4 to 20 characters.');
	  return (false);
   }
   else if(isBlank(thisForm.user_passwd.value))
   {  alert('Enter the Password.');
      thisForm.user_passwd.focus();
	  return (false);
   }
   else if (inValidString(thisForm.user_passwd.value))
   {
       alert('Password can contain only A-Z, a-z, and 0-9 as characters.')
       thisForm.user_passwd.focus();
       return (false);
   }
   else if( (thisForm.user_passwd.value.length < 4) || (thisForm.user_passwd.value.length > 16))
   {
        alert('Password must be between 4 to 16 characters.');
        thisForm.user_passwd.focus();
        return(false);
   }
 /*  else if (!containsNumeric(thisForm.user_passwd.value))
   {
       alert('Password should have at least one numeric character')
       thisForm.user_passwd.focus();
       return (false);
   }*/
   else if(thisForm.user_id.value == thisForm.user_passwd.value)
   {
      alert('Password can not be same as Username.');
      thisForm.user_passwd.focus();
      return (false);
   }
   else if(isBlank(thisForm.user_passwd2.value))
   {  alert('Confirm your Password.');
      thisForm.user_passwd2.focus();
	  return (false);
   }
   else if(thisForm.user_passwd2.value != thisForm.user_passwd.value)
   {  alert('The confirm password must match the password.');
      thisForm.user_passwd2.focus();
     return (false);
   }
   else if (thisForm.plan_type.value =='')
   {
	  alert('Choose the Plan type');
	  thisForm.plan_type.focus();
	  return (false);
   }

   else if(thisForm.country.value == 'United States of America')
   {
	   //if(thisForm.state.value == '' || thisForm.state.value == 'Others' || thisForm.state.value == 'Choose a state')
	   if(thisForm.state.value == '' || thisForm.state.value == 'Choose a state')
	   {
		    alert('Select a State.');
            thisForm.state.focus();
		    return(false);
	   }
	                     
   }
  
   else if(thisForm.country.value != 'United States of America')//removed else 
	{
	    thisForm.state.value == 'Others' ;
	    thisForm.state.disabled = false;

	    
	}
   
    if(isBlank(thisForm.phonefield.value))
   {
	   alert('Enter Phone number');
	   thisForm.phonefield.focus();
	   return(false);
   }
   else if(invalidPhoneNumber(thisForm.phonefield.value))
   {
	   alert('The phone number can contain only characters 0-9 x X - +');
	   thisForm.phonefield.focus();
	   return(false);
   }
   

 else if(isBlank(thisForm.textverify.value))
	{
       thisForm.textverify.focus();
       alert('Enter the Verification text.');
	   return(false);
	}

   //if( (thisForm.plan_type.value == 'M9.95') || (thisForm.plan_type.value == 'M49.95') 
	 //  || (thisForm.plan_type.value == 'Y99.95') || (thisForm.plan_type.value == 'Y499.50'))

  // if( !(thisForm.plan_type.value == 'Free_Trial') ) //do validations for freee trial also
  //{
      
	   //if not a dummy card, then validate for cc details
	   if (thisForm.card_number.value=='5555999944448888')
	   {
		   return true;
	   }
	   else
	   {
		   if (isBlank(thisForm.card_type.value))
		   {
			  alert('Select the card type.');
			  thisForm.card_type.focus();
			  return (false);
		   }
		   else if(isBlank(thisForm.card_number.value))
		   {
			  alert('Enter the card number.');
			  thisForm.card_number.focus();
			  return (false);
		   }
		   else if (invalidNumber(thisForm.card_number.value) )
		   {
			   alert('Card number must be numerals 0-9');
			   thisForm.card_number.focus();
			   return (false);
		   }
		   else if (thisForm.card_number.value.length < 14 || thisForm.card_number.value.length > 16)
		   {
				alert("The card number must contain 14 - 16 digits.");
				thisForm.card_number.focus();
				return (false);
		   }
		   else if(isBlank(thisForm.cvv.value))
		   {
			  alert('Enter the CVV number.');
			  thisForm.cvv.focus();
			  return (false);
		   }
		   else if(invalidNumber(thisForm.cvv.value))
		   {
			  alert('CVV accepts only digits 0-9.');
			  thisForm.cvv.focus();
			  return (false);
		   }
		   else if(isBlank(thisForm.month.value))
		   {
			  alert('Enter the expiry month for the credit card.');
			  thisForm.month.focus();
			  return (false);
		   }
		   else if(invalidNumber(thisForm.month.value))
		   {
			  alert('Enter a valid expiry month for the credit card.');
			  thisForm.month.focus();
			  return (false);
		   }
		   else if( (thisForm.month.value < 1) || (thisForm.month.value > 12) )
			   {
					 alert('Enter a valid expiry month for the credit card.');
					 thisForm.month.focus();
					 return(false);
	   
			   }

		  else if(isBlank(thisForm.year.value))
		   {
			  alert('Enter the expiry year for the credit card.');
			  thisForm.year.focus();
			  return (false);
		   }

		   else if(invalidNumber(thisForm.year.value))
		   {
			  alert('Enter valid expiry year for the credit card.');
			  thisForm.year.focus();
			  return (false);
		   }
		   
			   else if((thisForm.year.value) < (parseInt(currentYear1,10)) )
			   {
					alert('Enter a valid expiry year for the cedit card.');
					thisForm.year.focus();
					return(false);
			   }


			   else if( ( (thisForm.year.value) ==(parseInt(currentYear1,10)) ) && ( (thisForm.month.value) < (parseInt(currentMonth,10))  ) )
			   {

					  alert('Enter a valid expiry date for the credit card.');
					  thisForm.month.focus();
					  return (false);
			  } 	
			   


			 else  if(isBlank(thisForm.address.value))
		   {
			  alert('Enter a valid billing Address');
			  thisForm.address.focus();
			  return (false);
		   }
		   else if(inValidAddress(thisForm.address.value))
		   {
			  alert('The address can not contain single quotes, double quotes and backward slash.');
			  thisForm.address.focus();
			  return (false);
		   }
		   else if(isBlank(thisForm.zip.value))
		   {
			  alert('Enter the zip code.');
			  thisForm.zip.focus();
			  return (false);
		   }
		   else if(inValidZip(thisForm.zip.value))
		   {
				alert('Zip code can contain only A-Z, a-z, 0-9,-, _ and blank space') ;
				thisForm.zip.focus();
				return (false);
		   }
		   else
		   {
			   return true;
		   }
	}
   //}
   //else
  // {
   //  return true;
   //}


}


//registration validations after adding basic plans

function confirmSubmit1(thisForm)
{

   var todayDate = new Date();
   var currentMonth = todayDate.getMonth();
   var currentYear = todayDate.getYear(); 
   currentMonth = currentMonth + 1;
   var currentYear1 = new String(currentYear);

   currentYear1 = currentYear1.substring(2);

    if (thisForm.first_name.value =='')
   {
	  alert('Enter the First name.');
	  thisForm.first_name.focus();
	  return (false);
   }
   else if (invalidName(thisForm.first_name.value))
   {
	  alert('First name can contain only characters A-Z, a-z and blank space.');
      thisForm.first_name.focus();
	  return (false);
   }
   else if (thisForm.last_name.value == '')
   {
	  alert('Enter the Last name.');
	  thisForm.last_name.focus();
	  return (false);
   }
   else if (invalidName(thisForm.last_name.value))
   {
	  alert('Last name can contain only characters A-Z, a-z and blank space.');
	  thisForm.last_name.focus();
	  return (false);
   }


   else if(isBlank(thisForm.user_id.value))
   {  alert('Enter the Username.');
      thisForm.user_id.focus();
	  return (false);
   }
   else if(invalidUserName(thisForm.user_id.value))
   {  
	  thisForm.user_id.value = thisForm.user_id.value;
      thisForm.check1.value = 1;
      hdpopulateUserName(thisForm,'2'); 
	  alert('The username can contain only characters a-z, 0-9 and _ (underscore).');
	  return (false);
   }
   else if(thisForm.user_id.value.length < 4 ||thisForm.user_id.value.length > 20  )
   {
	  alert('Username must be between 4 to 20 characters.');
	  return (false);
   }
   else if(isBlank(thisForm.user_passwd.value))
   {  alert('Enter the Password.');
      thisForm.user_passwd.focus();
	  return (false);
   }
   else if (inValidString(thisForm.user_passwd.value))
   {
       alert('Password can contain only A-Z, a-z, and 0-9 as characters.')
       thisForm.user_passwd.focus();
       return (false);
   }
   else if( (thisForm.user_passwd.value.length < 4) || (thisForm.user_passwd.value.length > 16))
   {
        alert('Password must be between 4 to 16 characters.');
        thisForm.user_passwd.focus();
        return(false);
   }
  /* else if (!containsNumeric(thisForm.user_passwd.value))
   {
       alert('Password should have at least one numeric character')
       thisForm.user_passwd.focus();
       return (false);
   }*/
   else if(thisForm.user_id.value == thisForm.user_passwd.value)
   {
      alert('Password can not be same as Username.');
      thisForm.user_passwd.focus();
      return (false);
   }
   else if(isBlank(thisForm.user_passwd2.value))
   {  alert('Confirm your Password.');
      thisForm.user_passwd2.focus();
	  return (false);
   }
   else if(thisForm.user_passwd2.value != thisForm.user_passwd.value)
   {  alert('The confirm password must match the password.');
      thisForm.user_passwd2.focus();
     return (false);
   }
  else
	{  
	  var registration = -1;
       for (i=0, n=thisForm.plan_type.length; i<n; i++) 
		   {
              if (thisForm.plan_type[i].checked)
			    {
					registration = thisForm.plan_type[i].value;
                 } 
		   }
            if (registration == -1)
               {
                  alert("Choose the Plan type.");
				   thisForm.plan_type[0].focus();
                   return (false);
                }
		   	}

   if(thisForm.country.value == 'United States of America')
   {
	   //if(thisForm.state.value == '' || thisForm.state.value == 'Others' || thisForm.state.value == 'Choose a state')
	   if(thisForm.state.value == '' || thisForm.state.value == 'Choose a state')
	   {
		    alert('Select a State');
            thisForm.state.focus();
		    return(false);
	   }
	                     
   }
  
   else if(thisForm.country.value != 'United States of America')//removed else 
	{
	    thisForm.state.value == 'Others' ;
	    thisForm.state.disabled = false;

	    
	}
   
    if(isBlank(thisForm.phonefield.value))
   {
	   alert('Enter your phone number.');
	   thisForm.phonefield.focus();
	   return(false);
   }
   else if(invalidPhoneNumber(thisForm.phonefield.value))
   {
	   alert('The phone number can contain only characters 0-9 x X - +');
	   thisForm.phonefield.focus();
	   return(false);
   }
   

 else if(isBlank(thisForm.textverify.value))
	{
       thisForm.textverify.focus();
       alert('Enter the Verification text.');
	   return(false);
	}

   //if( (thisForm.plan_type.value == 'M9.95') || (thisForm.plan_type.value == 'M49.95') 
	 //  || (thisForm.plan_type.value == 'Y99.95') || (thisForm.plan_type.value == 'Y499.50'))

  // if( !(thisForm.plan_type.value == 'Free_Trial') ) //do validations for freee trial also
  //{
      
	   //if not a dummy card, then validate for cc details
	   if (thisForm.card_number.value=='5555999944448888')
	   {
		   return true;
	   }
	   else
	   {
		   if (isBlank(thisForm.card_type.value))
		   {
			  alert('Select the card type.');
			  thisForm.card_type.focus();
			  return (false);
		   }
		   else if(isBlank(thisForm.card_number.value))
		   {
			  alert('Enter the card number.');
			  thisForm.card_number.focus();
			  return (false);
		   }
		   else if (invalidNumber(thisForm.card_number.value) )
		   {
			   alert('Card number must be numerals 0-9.');
			   thisForm.card_number.focus();
			   return (false);
		   }
		   else if (thisForm.card_number.value.length < 14 || thisForm.card_number.value.length > 16)
		   {
				alert("The card number must contain 14 - 16 digits.");
				thisForm.card_number.focus();
				return (false);
		   }
		   else if(isBlank(thisForm.cvv.value))
		   {
			  alert('Enter the CVV number.');
			  thisForm.cvv.focus();
			  return (false);
		   }
		   else if(invalidNumber(thisForm.cvv.value))
		   {
			  alert('CVV accepts only digits 0-9.');
			  thisForm.cvv.focus();
			  return (false);
		   }
		   else if(isBlank(thisForm.month.value))
		   {
			  alert('Enter the expiry month for the credit card.');
			  thisForm.month.focus();
			  return (false);
		   }
		   else if(invalidNumber(thisForm.month.value))
		   {
			  alert('Enter a valid expiry month for the credit card.');
			  thisForm.month.focus();
			  return (false);
		   }
		   else if( (thisForm.month.value < 1) || (thisForm.month.value > 12) )
			   {
					 alert('Enter a valid expiry month for the credit card.');
					 thisForm.month.focus();
					 return(false);
	   
			   }

		  else if(isBlank(thisForm.year.value))
		   {
			  alert('Enter the expiry year for the credit card.');
			  thisForm.year.focus();
			  return (false);
		   }

		   else if(invalidNumber(thisForm.year.value))
		   {
			  alert('Enter valid expiry year for the credit card.');
			  thisForm.year.focus();
			  return (false);
		   }
		   
			   else if((thisForm.year.value) < (parseInt(currentYear1,10)) )
			   {
					alert('Enter a valid expiry year for the credit card.');
					thisForm.year.focus();
					return(false);
			   }


			   else if( ( (thisForm.year.value) ==(parseInt(currentYear1,10)) ) && ( (thisForm.month.value) < (parseInt(currentMonth,10))  ) )
			   {

					  alert('Enter a valid expiry date for the credit card.');
					  thisForm.month.focus();
					  return (false);
			  } 	
			   


			 else  if(isBlank(thisForm.address.value))
		   {
			  alert('Enter a valid billing address.');
			  thisForm.address.focus();
			  return (false);
		   }
		   else if(inValidAddress(thisForm.address.value))
		   {
			  alert('The address can not contain single quotes, double quotes and backward slash.');
			  thisForm.address.focus();
			  return (false);
		   }
		   else if(isBlank(thisForm.zip.value))
		   {
			  alert('Enter the zip code.');
			  thisForm.zip.focus();
			  return (false);
		   }
		   else if(inValidZip(thisForm.zip.value))
		   {
				alert('Zip code can contain only A-Z, a-z, 0-9,-, _ and blank space.') ;
				thisForm.zip.focus();
				return (false);
		   }
		   else
		   {
			   return true;
		   }
	}
   //}
   //else
  // {
   //  return true;
   //}


}




















//For Signup process
function signUpSubmit(thisForm)
{

   if(!isValidEmailId(thisForm.email.value))
   {
       alert('Enter a valid email address');
       thisForm.email.focus();
       return(false);
   }
   else
   {
     return true ;
   }

}


//For Upgrade process
function upgradePlanSubmit(thisForm)

{



  var todayDate = new Date();
   var currentMonth = todayDate.getMonth();
   var currentYear = todayDate.getYear(); 
   currentMonth = currentMonth + 1;
   var currentYear1 = new String(currentYear);

   currentYear1 = currentYear1.substring(2);

//   alert("currentYear1:"+currentYear1);


   if (thisForm.first_name.value =='')
   {
	  alert('Enter the First name.');
	  thisForm.first_name.focus();
	  return (false);
   }
   else if (invalidName(thisForm.first_name.value))
   {
	  alert('First name can contain only characters A-Z, a-z and blank space.');
      thisForm.first_name.focus();
	  return (false);
   }
   else if (thisForm.last_name.value == '')
   {
	  alert('Enter the Last name.');
	  thisForm.last_name.focus();
	  return (false);
   }
   else if (invalidName(thisForm.last_name.value))
   {
	  alert('Last name can contain only characters A-Z, a-z and blank space.');
	  thisForm.last_name.focus();
	  return (false);
   }
   else if (thisForm.plan_type.value =='')
   {
	  alert('Choose the Plan type.');
	  thisForm.plan_type.focus();
	  return (false);
   }
   else if(thisForm.card_type.value =='')
   {
	  alert('Select the card type.');
	  thisForm.card_type.focus();
	  return (false);
   }
   else if (thisForm.card_number.value =='')
   {
	  alert('Enter the card number.');
	  thisForm.card_number.focus();
	  return (false);
   }
   else if ((thisForm.card_number.value.indexOf('*') == -1) && (invalidNumber(thisForm.card_number.value)))
   {
	   alert('Card number must be numerals 0-9.');
	   thisForm.card_number.focus();
	   return (false);
   }
   else if (thisForm.card_number.value.length < 14 || thisForm.card_number.value.length > 16)
   {
		alert("The card number must contain 14 - 16 digits.");
		thisForm.card_number.focus();
		return (false);
   }
   else if (thisForm.cvv.value =='')
   {
	  alert('Enter the CVV number.');
	  thisForm.cvv.focus();
	  return (false);
   }
   else if (invalidNumber(thisForm.cvv.value))
   {
	  alert('CVV accepts only digits 0-9.');
      thisForm.cvv.focus();
	  return (false);
   }
   else if (thisForm.month.value =='')
   {
	  alert('Enter the expiry month for the credit card.');
	  thisForm.month.focus();
	  return (false);
   }
   else if(invalidNumber(thisForm.month.value))
   {
	  alert('Enter a valid expiry month for the credit card.');
	  thisForm.month.focus();
	  return (false);
   }
  

   else if( (thisForm.month.value < 1) || (thisForm.month.value > 12) )
   {
		 alert('Enter a valid expiry month for the credit card.');
		 thisForm.month.focus();
		 return(false);

   } 

  else if (thisForm.year.value =='')
   {
	  alert('Enter the expiry year for the credit card.');
	  thisForm.year.focus();
	  return (false);
   }
   else if(invalidNumber(thisForm.year.value))
   {
	  alert('Enter a valid expiry year for the credit card.');
	  thisForm.year.focus();
	  return (false);
   }

     else if( (thisForm.year.value) < (parseInt(currentYear1,10)) )
	   {
			alert('Enter a valid expiry year for the credit card.');
			thisForm.year.focus();
			return(false);
	   }


    else if( ( (thisForm.year.value) == (parseInt(currentYear1,10)) ) && (  (thisForm.month.value) < (parseInt(currentMonth,10)) ) )
      {

            alert('Enter a valid expiry date for the credit card.');
            thisForm.month.focus();
             return (false);
  
      } 	




   if ( thisForm.address.value == '')
   {
	  alert('Enter a valid billing address.');
	  thisForm.address.focus();
	  return (false);
   }
   else if (inValidAddress(thisForm.address.value) )
   {
	  alert('The address can not contain single quotes, double quotes and backward slash.');
 	  thisForm.address.focus();
	  return (false);
   }
   else if ( thisForm.zip.value =='')
   {
	  alert('Enter the zip code.');
	  thisForm.zip.focus();
	  return (false);
   }
   else if ( inValidZip(thisForm.zip.value) )
   {
      alert('Zip code can only contain characters A-Z, a-z, 0-9,-, _ and blank space.') ;
	  thisForm.zip.focus();
	  return (false);
   }
   else
   {
      return true;
   }

}


//For Edit creditcard process
function editccSubmit(thisForm)
{


   var todayDate = new Date();
   var currentMonth = todayDate.getMonth();
   var currentYear = todayDate.getYear(); 
   currentMonth = currentMonth + 1;
   var currentYear1 = new String(currentYear);

   currentYear1 = currentYear1.substring(2);








   if (thisForm.first_name.value =='')
   {
	  alert('Enter the First name.');
	  thisForm.first_name.focus();
	  return (false);
   }
   else if (invalidName(thisForm.first_name.value))
   {
	  alert('First name can contain only characters A-Z, a-z and blank space.');
      thisForm.first_name.focus();
	  return (false);
   }
   else if (thisForm.last_name.value == '')
   {
	  alert('Enter the Last name.');
	  thisForm.last_name.focus();
	  return (false);
   }
   else if (invalidName(thisForm.last_name.value))
   {
	  alert('Last name can contain only characters A-Z, a-z and blank space.');
	  thisForm.last_name.focus();
	  return (false);
   }
   else if(thisForm.card_type.value =='')
   {
	  alert('Select the card type.');
	  thisForm.card_type.focus();
	  return (false);
   }
   else if (thisForm.card_number.value =='')
   {
	  alert('Enter the card number.');
	  thisForm.card_number.focus();
	  return (false);
   }
   else if (thisForm.card_number.value.length < 14 || thisForm.card_number.value.length > 16)
   {
		alert("The card number must contain 14 - 16 digits.");
		thisForm.card_number.focus();
		return (false);
   }
   else if (thisForm.month.value =='')
   {
	  alert('Enter the expiry month for the credit card.');
	  thisForm.month.focus();
	  return (false);
   }
   else if(invalidNumber(thisForm.month.value))
   {
	  alert('Enter a valid expiry month for the credit card.');
	  thisForm.month.focus();
	  return (false);
   }

   else if( (thisForm.month.value < 1) || (thisForm.month.value > 12) )
           {
                 alert('Enter a valid expiry month for the credit card.');
                 thisForm.month.focus();
                 return(false);
   
           } 


   else if (thisForm.year.value =='')
   {
	  alert('Enter the expiry year for the credit card.');
	  thisForm.year.focus();
	  return (false);
   }
   else if(invalidNumber(thisForm.year.value))
   {
	  alert('Enter a valid expiry year for the credit card.');
	  thisForm.year.focus();
	  return (false);
   }
   
     else if( (thisForm.year.value) < (parseInt(currentYear1,10)) )
           {
                alert('Enter a valid expiry year for the credit card.');
                thisForm.year.focus();
                return(false);
           }

     else if( ( (thisForm.year.value) == (parseInt(currentYear1,10)) ) && (  (thisForm.month.value) < (parseInt(currentMonth,10)) ) )
      {

            alert('Enter a valid expiry date for the credit card.');
            thisForm.month.focus();
             return (false);
  
      } 	


else if ( thisForm.address.value =='')
   {
	  alert('Enter a valid billing address.');
	  thisForm.address.focus();
	  return (false);
   }
   else if (inValidAddress(thisForm.address.value) )
   {
	  //alert('Address can contain only A-Z, a-z, 0-9, _, # / ( ) - and blank space');
	  		  alert('The address can not contain single quotes, double quotes and backward slash.');
      thisForm.address.focus();
	  return (false);
   }
   else if ( thisForm.zip.value =='')
   {
	  alert('Enter the zip code.');
	  thisForm.zip.focus();
	  return (false);
   }
   else if ( inValidZip(thisForm.zip.value) )
   {
      alert('Zip code can only contain characters A-Z, a-z, 0-9,-, _ and blank space.') ;
      thisForm.zip.focus();
	  return (false);
   }
   else
   {
      return true;
   }

}



//For Edit profile process
function editprofileSubmit(thisForm)
{
	
   if(!isBlank(thisForm.user_passwd1.value))
   {
     if (inValidString(thisForm.user_passwd1.value))
     {
         alert('Password can contain only A-Z, a-z, and 0-9 as characters.')
         thisForm.user_passwd1.value = '';
         thisForm.user_passwd1.focus();
         return (false);
     }
     else if( (thisForm.user_passwd1.value.length < 4) || (thisForm.user_passwd1.value.length > 16))
     {
          alert('Password must be between 4 to 16 characters.');
          thisForm.user_passwd1.value = '';
          thisForm.user_passwd1.focus();
          return(false);
     }
   /*  else if (!containsNumeric(thisForm.user_passwd1.value))
     {
         alert('Password should have atleast one numeric character (0-9)')
         thisForm.user_passwd1.value = '';
         thisForm.user_passwd1.focus();
         return (false);
     }*/
     else if(thisForm.user_passwd2.value != thisForm.user_passwd1.value)
     {  alert('The confirm password must match the password.');
        thisForm.user_passwd2.focus();
        return (false);
     }
   }
  if(!isBlank(thisForm.user_passwd2.value) && (thisForm.user_passwd2.value != thisForm.user_passwd1.value))
	{
        alert('The confirm password must match the password.');
        thisForm.user_passwd2.focus();
        return (false);
	}
  if(!isValidEmailId(thisForm.email.value))
   {
       alert('Enter a valid email address.');
       thisForm.email.focus();
       return(false);
   }
  if(thisForm.phone.value=='')
   {
	   alert('Enter your phone number.');
	   thisForm.phone.focus();
	   return(false);
   }
 if( (thisForm.phone.value!='') && (invalidPhoneNumber(thisForm.phone.value) ) )
   {
	   alert('The phone number can contain only characters 0-9 x X - +');
	   thisForm.phone.focus();
	   return(false);
   }
 if(thisForm.country.value == 'United States of America')
   {
	   if(thisForm.state.value == '' || thisForm.state.value == 'Choose a state' )
	   {
			alert('Select a State');
		    return(false);
	   }
//	   else
//	   {
//		    return(true);
//	   }
   }
  if(thisForm.country.value != 'United States of America')
	{
	    thisForm.state.disabled = false;
	    thisForm.state.value == 'Others' ;
	//	return(true);
	}

   /*
   if(thisForm.enablesecurity.value=='checked' && thisForm.securityEnabled.value!='Y')
   {
     
	   if(isBlank(thisForm.securitypassword.value))
	   {
		   alert('Please enter the Security Password');
		   thisForm.securitypassword.value = '';
           thisForm.securitypassword.focus();
           return (false);
	   }
	   else if( (thisForm.securitypassword.value.length < 4) || (thisForm.securitypassword.value.length > 8))
       {
          alert('Security Password must be between 4 to 8 characters');
          thisForm.securitypassword.value = '';
          thisForm.securitypassword.focus();
          return(false);
       }
	   else if (inValidString(thisForm.securitypassword.value))
       {
         alert('Security Password can contain only A-Z, a-z, and 0-9 as characters')
         thisForm.securitypassword.value = '';
         thisForm.securitypassword.focus();
         return (false);
       }
	   else if (!containsNumeric(thisForm.securitypassword.value))
       {
         alert('Security Password should have atleast one numeric character (0-9)')
         thisForm.securitypassword.value = '';
         thisForm.securitypassword.focus();
         return (false);
       }
	   else if(thisForm.securitypassword2.value != thisForm.securitypassword.value)
       { 
		alert('Confirm Security Password must be same as Security Password');
        thisForm.securitypassword2.focus();
        return (false);
       }
	   else if(thisForm.securitypassword.value == thisForm.user_passwd1.value)
       { 
		alert('Security Password can not be same as Login Password');
        thisForm.securitypassword.focus();
        return (false);
       }

	}

	*/


if(thisForm.enablesecurity.value=='checked' && thisForm.securityEnabled.value=='Y' && ( thisForm.securitypassword.value!='' || thisForm.securitypassword2.value!=''))
	{
       
	   if( (thisForm.securitypassword.value.length < 4) || (thisForm.securitypassword.value.length > 8))
       {
          alert('The security Password must contain 4 to 8 characters.');
          thisForm.securitypassword.value = '';
          thisForm.securitypassword.focus();
          return(false);
       }
	   else if (inValidString(thisForm.securitypassword.value))
       {
         alert('The security Password can contain only characters A-Z, a-z, and 0-9.')
         thisForm.securitypassword.value = '';
		 thisForm.securitypassword2.value = '';
         thisForm.securitypassword.focus();
         return (false);
       }
	 /*  else if (!containsNumeric(thisForm.securitypassword.value))
       {
         alert('Security Password should have atleast one numeric character (0-9)')
         thisForm.securitypassword.value = '';
         thisForm.securitypassword.focus();
         return (false);
       }*/
	   else if(thisForm.securitypassword2.value != thisForm.securitypassword.value)
       { 
		alert('Confirm Security Password must be same as Security Password');
        thisForm.securitypassword2.focus();
        return (false);
       }
	   else if(thisForm.securitypassword.value == thisForm.user_passwd1.value)
       { 
		alert('The security and login Password must be different');
        thisForm.securitypassword.focus();
        return (false);
       }

	}
    else
    {
       return true;
    }
}




 


function isBlank(Str)
 {
   while(''+Str.charAt(0)==' ')
   Str=Str.substring(1,Str.length);
   while(''+Str.charAt(Str.length-1)==' ')
   Str=Str.substring(0,Str.length-1);
   if (Str == '')
   { return(true);
   }
   else
   { return(false);
   };
 }



function invalidName(Str)
 {
     var alloweduser = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ";

     for(var count = 0; count < Str.length; count++)
     {
        if(alloweduser.indexOf(Str.substring(count, count + 1)) == -1)
        {
            return(true);
        }
     };

 }



function containsNumeric(Str)
 {
	 var alloweduser = "0123456789";
         var totcount = 0;
	 for(var count = 0; count < Str.length; count++)
	 {
		if(alloweduser.indexOf(Str.substring(count, count + 1)) != -1)
		{
		  totcount++;
		}
	 };

	 if(totcount!=0)
	 {
	   return(true);
	 }
     return(false);
 }







function isValidEmailId(email)
 {
	if (email == null)
	{
		return(false);
	}
	else if(email == '')
	{
		return(false) ;
	}
	else if ( (trim(email).indexOf('@') == -1) ||
			  (trim(email).indexOf('@') == 0) ||
			  (trim(email).indexOf('@') == (trim(email).length-1) ||  trim(email).indexOf('@',(trim(email).indexOf('@')+1))!=-1))
	{
		return(false);
	}
	else if (hasSpecChar(email))
	{
		return(false) ;
	}
	else
	{
		return(true) ;
	};
 }





function trim(Str)
 {
   if (!(isBlank(Str)))
   {
	  while(''+Str.charAt(0)==' ')
	  Str=Str.substring(1,Str.length);
	  while(''+Str.charAt(Str.length-1)==' ')
	  Str=Str.substring(0,Str.length-1);
	  return(Str);
   }
   else
   { return ('');
   };
 }



 function hasSpecChar(Str)
 {
	var alloweduser = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_@.- ";

	 for(var count = 0; count < Str.length; count++)
	 {
		if(alloweduser.indexOf(Str.substring(count, count + 1)) == -1)
		{
		  return(true);
		}

	 };
	 return(false);
 }




 function inValidString(Str)
 {
	 var alloweduser = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";

	 for(var count = 0; count < Str.length; count++)
	 {
		if(alloweduser.indexOf(Str.substring(count, count + 1)) == -1)
		{
		  return(true);
		}

	 };
	 return(false);
 }



 function invalidNumber(Str)
 {
	 var alloweduser = "0123456789";
         var totcount = 0;
	 for(var count = 0; count < Str.length; count++)
	 {
		if(alloweduser.indexOf(Str.substring(count, count + 1)) == -1)
		{
		  totcount++;
		}
	 };
	 if(totcount!=0)
	 {
	   return(true);
	 }
   return(false);
 }


 function invalidPhoneNumber(Str)
 {
	 var alloweduser = "0123456789()- xX+";
         var totcount = 0;
	 for(var count = 0; count < Str.length; count++)
	 {
		if(alloweduser.indexOf(Str.substring(count, count + 1)) == -1)
		{
		  totcount++;
		}
	 };
	 if(totcount!=0)
	 {
	   return(true);
	 }
   return(false);
 }




















 function invalidUserName(Str)
 {
	 var alloweduser = "abcdefghijklmnopqrstuvwxyz0123456789_";

	 for(var count = 0; count < Str.length; count++)
	 {
		if(alloweduser.indexOf(Str.substring(count, count + 1)) == -1)
		{
			return(true);
		}
	 };

 }

function inValidZip(Str)
 {
	 var alloweduser = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_ ";
         var totcount = 0;
	 for(var count = 0; count < Str.length; count++)
	 {
		if(alloweduser.indexOf(Str.substring(count, count + 1)) == -1)
		{
		  totcount++;
		}

	 };
	 if(totcount!=0)
	 {
	   return(true);
	 }
	 return(false);
 }



/*function inValidAddress(Str)
 {
	 var alloweduser = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_ ,#- ()/";
         var totcount = 0;
	 for(var count = 0; count < Str.length; count++)
	 {
		if(alloweduser.indexOf(Str.substring(count, count + 1)) == -1)
		{
		  totcount++;
		}

	 };
	 if(totcount!=0)
	 {
	   return(true);
	 }
	 return(false);
 }*/


 function inValidAddress(Str)
{
   if( (Str.indexOf('"') != -1)  ||	(Str.indexOf('\'') != -1) || (Str.indexOf('\\') != -1) )
   { return(true);
   }
   else
   { return (false);
   }
}
function invalidSecurityPhNum(Str)
{
	 var alloweduser = "0123456789- xX+";
         var totcount = 0;
	 for(var count = 0; count < Str.length; count++)
	 {
		if(alloweduser.indexOf(Str.substring(count, count + 1)) == -1)
		{
		  totcount++;
		}
	 };
	 if(totcount!=0)
	 {
	   return(true);
	 }
   return(false);
 }

function checkAndReplace(str)
{
	var ch ='';
	var j;
	
	if(str=='')
	{
		return '';
	}
	else
	{
	
		for(var i=0;i<str.length;i++)
		{
			
			j = 0;
			if(str.charAt(i)=='\'')
			{
				j++;
			}

			if(str.charAt(i)=='<')
			{
				j++;
			}

			if(str.charAt(i)=='>')
			{
				j++;
				
			}

			if(str.charAt(i)=='\(')
			{
				j++;
				
			}

			if(str.charAt(i)=='\)')
			{
				j++;
				
			}

			if(j == 0)
			{
				ch = ch + str.charAt(i);
			}
			j = 0;
			
		}
	}

	return ch;
}