<!-- Begin
function textCounter(field, countfield, maxlimit) {
if (field.value.length > maxlimit) // if too long...trim it!
field.value = field.value.substring(0, maxlimit);
// otherwise, update 'characters left' counter
else 
countfield.value = maxlimit - field.value.length;
}
// End -->


function submitonce(theform)
{
if (document.all||document.getElementById){
for (i=0;i<theform.length;i++){
var tempobj=theform.elements[i]
if(tempobj.type.toLowerCase()=="submit"||tempobj.type.toLowerCase()=="reset")
tempobj.disabled=true
}
}
}

 function deletefunction()
   {
   var m=document.plandetails.counter.value;
   var tempcount=0;	
   if(m>1){
	 for (k=0; k<m; k++)
     {	  	
       if (document.plandetails.check[k].checked)
          {           
	        tempcount = tempcount+1;         
			document.rosterform1.chkval.value+=document.plandetails.check[k].value;		
			document.rosterform1.chkval.value+=",";
          }		
	  }
	}else{
	  	 if (document.plandetails.check.checked)
           {           
            tempcount = tempcount+1;
			document.rosterform1.chkval.value+=document.plandetails.check.value;			
			document.rosterform1.chkval.value+=",";			
           }		
	}

	 if (tempcount == 0)
	 {
       alert("Please check atleast one record ")
		return false;
     }	
	document.rosterform1.submit();
}     



 function esc_function()
   {
   var m=document.plandetails.counter.value;
   var k1=document.plandetails.counter2.value;
   var tempcount=0;	
   if(m>1){
	 for (k=k1; k<m; k++)
     {	  	
       if (document.plandetails.check[k1].checked)
          {           
	        tempcount = tempcount+1;         
			document.rosterform1.chkval.value+=document.plandetails.check[k1].value;		
			document.rosterform1.chkval.value+=",";
          }		
	  }
	}else{
	  	 if (document.plandetails.check.checked)
           {           
            tempcount = tempcount+1;
			document.rosterform1.chkval.value+=document.plandetails.check.value;			
			document.rosterform1.chkval.value+=",";			
           }		
	}

	 if (tempcount == 0)
	 {
       alert("Please check atleast one record ")
		return false;
     }	
	document.rosterform1.submit();
}     





 function deletefunction1()
   {
   var m=document.plandetails.counter.value;
   var tempcount=0;	
   var tempcount1=0;	
   if(m>1){
	 for (k=0; k<m; k++)
     {	  	
       if (document.plandetails.check[k].checked)
          {           
	        tempcount = tempcount+1;         
			document.rosterform1.chkval.value+=document.plandetails.check[k].value;		
			document.rosterform1.chkval.value+=",";

	        tempcount1 = tempcount1+1;         
			document.rosterform1.chkval1.value+=document.plandetails.check1[k].value;		
			document.rosterform1.chkval1.value+=",";
          }		
	  }
	}else{
	  	 if (document.plandetails.check.checked)
           {           
            tempcount = tempcount+1;
			document.rosterform1.chkval.value+=document.plandetails.check.value;			
			document.rosterform1.chkval.value+=",";	

            tempcount1 = tempcount1+1;
			document.rosterform1.chkval1.value+=document.plandetails.check1.value;			
			document.rosterform1.chkval1.value+=",";		
           }		
	}


	 if (tempcount == 0)
	 {
       alert("Please check atleast one record ")
		return false;
     }	
	document.rosterform1.submit();
} 










 function Clearfunction()
	{
		alert("Please Confirm Clear !");
//		alert("Click On Retry On the Next Popup");
		location.reload();
	}

function checkall(thestate){
	var el_collection = eval("document.forms.plandetails.groupid")
	for (c=0; c < el_collection.length; c++)
		el_collection[c].checked = thestate
}



// i need to enter body onload while exe this program.
// which is found in home.asp
function blinkIt() {
 if (!document.all) return;
 else {
   for(i=0;i<document.all.tags('blink').length;i++){
      s=document.all.tags('blink')[i];
      s.style.visibility=(s.style.visibility=='visible')?'hidden':'visible';
   }
 }
}



// Mask char input only accept numbers
	function maskKeyPress(objEvent) 
	{
	  var iKeyCode;  	
	  iKeyCode = objEvent.keyCode;			
	  if(iKeyCode>=48 && iKeyCode<=57) return true;
	  return false;
	}





<!-- //script hider
function form_validator(theForm)
{


	if(theForm.resellername.value == "") {
		 alert("Your Company Name");
		 theForm.resellername.focus();
		 return(false);
	}


	if(theForm.username.value == "") {
		 alert("Username");
		 theForm.username.focus();
		 return(false);
	}


	if(theForm.fname.value == "") {
		 alert("First Name");
		 theForm.fname.focus();
		 return(false);
	}


	if(theForm.lname.value == "") {
		 alert("Last Name");
		 theForm.lname.focus();
		 return(false);
	}


	if(theForm.Gender.value == "") {
		 alert("Gender");
		 theForm.Gender.focus();
		 return(false);
	}


	if(theForm.dob_day.value == "") {
		 alert("Day Of Birth");
		 theForm.dob_day.focus();
		 return(false);
	}


	if(theForm.dob_month.value == "") {
		 alert("Day Of Birth");
		 theForm.dob_month.focus();
		 return(false);
	}


	if(theForm.dob_year.value == "") {
		 alert("Day Of Birth");
		 theForm.dob_year.focus();
		 return(false);
	}

	if(theForm.Address.value == "") {
		 alert("Address");
		 theForm.Address.focus();
		 return(false);
	}

	if(theForm.Station.value == "") {
		 alert("Station/County");
		 theForm.Station.focus();
		 return(false);
	}

	if(theForm.City.value == "") {
		 alert("City");
		 theForm.City.focus();
		 return(false);
	}

	if(theForm.Zipcode.value == "") {
		 alert("Zipcode");
		 theForm.Zipcode.focus();
		 return(false);
	}

	if(theForm.State.value == "") {
		 alert("State");
		 theForm.State.focus();
		 return(false);
	}

	if(theForm.Country.value == "") {
		 alert("Country");
		 theForm.Country.focus();
		 return(false);
	}

	if(theForm.Email1.value == "") {
		 alert("Email 1");
		 theForm.Email1.focus();
		 return(false);
	}

	if(theForm.Contact1.value == "") {
		 alert("Contact Number 1");
		 theForm.Contact1.focus();
		 return(false);
	}


	if(theForm.Mobile.value.length <=11) {
		 alert("Enter Valid 12 Digit Number \n ie.919820110488 \n no space");
		 theForm.Mobile.focus();
		 return(false);
	}


	if(theForm.Marital_status.value == "") {
		 alert("Marital Status");
		 theForm.Marital_status.focus();
		 return(false);
	}


	if(theForm.Working_Status.value == "") {
		 alert("Work Status");
		 theForm.Working_Status.focus();
		 return(false);
	}


	if(theForm.SMS_Plan.value == "") {
		 alert("SMS Plan");
		 theForm.SMS_Plan.focus();
		 return(false);
	}

	if(theForm.SMS_Sender_Name.value == "") {
		 alert("SMS Sender Name Option");
		 theForm.SMS_Sender_Name.focus();
		 return(false);
	}

	return (true);
}


// end script hiding -->
