
			// validations in the form user in userinfo
				function test(){
					if(document.user.username.value == "") 
					{
					alert('Please fill username');
					return false;
					}
					else
					return true;
				}
				
			
				
				
				// validations in the form userinfo in userinfo
				
			function set()
			{
            	document.getElementById("username").innerHTML = "";
            	document.getElementById("fname").innerHTML = "";
            	document.getElementById("email").innerHTML = "";
            	document.getElementById("passwd").innerHTML = "";
            	document.getElementById("rpasswd").innerHTML = "";
            	
			if(document.userinfo.Username.value == "")
			{
				document.getElementById("username").innerHTML = "<div id=warnusrb>Please Enter User Name</div>";
				document.userinfo.Username.focus();
				return false;
			}
			
			if(document.userinfo.Fname.value == "")
			{
				document.getElementById("fname").innerHTML = "<div id=warnusrb>Please Enter First Name</div>";
				document.userinfo.Fname.focus();
				return false;
			}
			
			
          	BeforeAtRate = document.userinfo.Email.value.substring(0,document.userinfo.Email.value.indexOf("@"));
			AfterAtRate = document.userinfo.Email.value.substring(document.userinfo.Email.value.indexOf("@")+1,document.userinfo.Email.value.length);	
			middle = AfterAtRate.substring(0, AfterAtRate.indexOf("."));
			last = AfterAtRate.substring(AfterAtRate.indexOf(".") + 1,AfterAtRate.length);
			
			if ((document.userinfo.Email.value == "") || (document.userinfo.Email.value.indexOf(" ") >= 0) || (document.userinfo.Email.value.indexOf("@") == -1) || (document.userinfo.Email.value.indexOf(".") == -1))
			{
				document.getElementById("email").innerHTML = "<div id=warnusrd>Incorrect EmailID</div>";
          	 	document.userinfo.Email.focus();
          	 	return false;
			}
			
				
			if (BeforeAtRate.length == 0 || middle.length == 0 || last.length == 0)
			{
				document.getElementById("email").innerHTML = "<div id=warnusrd>Incorrect Email</div>";
				document.userinfo.Email.focus();
				return (false);
			}
			
			var strInput = document.userinfo.Psw.value;
            var strInput2 = document.userinfo.Repsw.value;
            if (document.userinfo.Psw.value == "")
			{
				document.getElementById("passwd").innerHTML = "<div id=warnusrb>Please Enter Password</div>";
				document.userinfo.Psw.focus();
				return false;
			}
			
            if(strInput.length < 6)
            {
            	document.getElementById("passwd").innerHTML = "<div id=warnusre>Password Characters less than 6</div>";
           		document.userinfo.Psw.focus();
             	return false;
          	} 
          	
          	if(strInput != strInput2)
          	{
          	 	document.getElementById("rpasswd").innerHTML = "<div id=warnusra>Password Mismatch</div>";
          	 	strInput2 = strInput = "";
          	 	document.userinfo.Psw.focus();
          	 	return false;
          	}
          
			return true;	
		 }
		   
		   
		   //calculation on corporate.php
		   function Cshow_total(Agent_cost)
            {
	            
	            if(parseInt(document.option_form.No_of_agents.value) == 0)
           		{
           			document.option_form.more_corp.disabled=false;
           			document.option_form.No_of_agents.disabled=true;
           			document.option_form.more_corp.focus();    			
           			var agent = parseInt(document.option_form.more_corp.value);
           		}
           		else
           		{
           			var agent = parseInt(document.option_form.No_of_agents.value);
           		}   
           		
	             var decimal=agent%10;
		         var part=Math.floor(agent/10);
		         document.option_form.Cost.value=(part*300+decimal*35);
		         return true;
	                
            }
           
           function validate()
           {
           	 if(document.option_form.more.value < 1)
          	 {
          	 	alert("Agents should be more than 1");	
           		 document.option_form.more.focus();
             	return false;
          	 }
           }
           
           function validate_corp()
           {
           	 if(document.option_form.more.value < 10)
          	 {
          	 	alert("Agents Should be more than 10");	
           		 document.option_form.more_corp.focus();
             	return false;
          	 }
           }
           
           
           function setdefault_std(Agent_cost,maxL1,minL1,discL1,maxL2,minL2,discL2,minL3,discL3,maxF1,minF1,discF1,maxF2,minF2,discF2,minF3,discF3)
			{
				document.option_form.No_of_agents.value = 1;
				document.option_form.Department.checked = false;
				document.option_form.Reports.checked = false;
				document.option_form.Aamgmnt.checked = false;
				document.option_form.Pbranding.checked = false;
				document.option_form.Security.checked = false;
				show_total(Agent_cost,maxL1,minL1,discL1,maxL2,minL2,discL2,minL3,discL3,maxF1,minF1,discF1,maxF2,minF2,discF2,minF3,discF3);
			} 
			
			 function setdefault_corp(Agent_cost,maxL1,minL1,discL1,maxL2,minL2,discL2,minL3,discL3,maxF1,minF1,discF1,maxF2,minF2,discF2,minF3,discF3)
			{
				document.option_form.No_of_agents.value = 10;
				show_total(Agent_cost,maxL1,minL1,discL1,maxL2,minL2,discL2,minL3,discL3,maxF1,minF1,discF1,maxF2,minF2,discF2,minF3,discF3);
			} 
           //calculation on standard.php
            
           function show_total(Agent_cost,maxL1,minL1,discL1,maxL2,minL2,discL2,minL3,discL3,maxF1,minF1,discF1,maxF2,minF2,discF2,minF3,discF3)
           {
           		
           		if(parseInt(document.option_form.No_of_agents.value) == 0)
           		{
           			document.option_form.more.disabled=false;
           			document.option_form.No_of_agents.disabled=true;
           			document.option_form.more.focus();    			
           			var agent = parseInt(document.option_form.more.value);
           		}
           		else
           		{
           			var agent = parseInt(document.option_form.No_of_agents.value);
           		}
      			var deptt=0;
           		var cost=0;
           		var net_cost=0;
           		document.option_form.agCost.value = agent*Agent_cost;
           		document.option_form.adCost.value = 0;
           		document.option_form.arCost.value = 0;
           		document.option_form.amCost.value = 0;
           		document.option_form.pbCost.value = 0;
           		document.option_form.sCost.value = 0;
           		
           		if(document.option_form.Department.checked)
           		{
           			deptt = parseInt(document.option_form.Department.value)
           			document.option_form.adCost.value = agent*deptt;
           		}
           		var rptng=0;
           		if(document.option_form.Reports.checked)
           		{
           			rptng = parseInt(document.option_form.Reports.value);
           			document.option_form.arCost.value = agent*rptng;
           		}
           		var ad_man=0;
           		if(document.option_form.Aamgmnt.checked)
           		{
           			ad_man= parseInt(document.option_form.Aamgmnt.value);
           			document.option_form.amCost.value = agent*ad_man;
           		}
           		var pvt_lbl=0;
           		if(document.option_form.Pbranding.checked)
           		{
           			pvt_lbl= parseInt(document.option_form.Pbranding.value);
           			document.option_form.pbCost.value = agent*pvt_lbl;
           		}
           		var sec=0;
           		if(document.option_form.Security.checked)
           		{
           			sec= parseInt(document.option_form.Security.value);
           			document.option_form.sCost.value = agent*sec;
           		}
           		cost = (agent)*Agent_cost+agent*(deptt+rptng+ad_man+pvt_lbl+sec);

                       
           		if(!is_all_checked(deptt,rptng,ad_man,pvt_lbl,sec))
           		{
           			if(agent >= minL1 && agent <= maxL1)
           			{
           				net_cost = cost - cost*discL1;
           			}
           			
           			else if(agent >= minL2 && agent <= maxL2)
           			{
           				
           				net_cost = cost - cost*discL2;
           			}
           			else if(agent >= minL3)
           			{
           				
           				net_cost = cost - cost*discL3;
           			}
           			else
           			{
           				net_cost = cost
           			}
           		}
           		else
           		{
           			if(agent >= minF1 && agent <= maxF1)
           			{
           				    				net_cost = cost - cost*discF1;
           				
           			}
           			else if(agent >= minF2 && agent <= maxF2)
           			{
           				net_cost = cost - cost*discF2;
           			}
           			else if(agent >= minF3)
           			{
           				net_cost = cost - cost*discF3;
           			}
           			else
           			{
           				net_cost = (agent)*Agent_cost+agent*(deptt+rptng+ad_man+pvt_lbl+sec);
           			}
           		}
           		
if(net_cost< cost)
 { document.getElementById('actual').innerHTML=cost;

 }
else
{
 document.getElementById('actual').innerHTML="";
}
           		document.option_form.Cost.value = net_cost;
           		
           	return;
           	
           }
           
           function is_all_checked(deptt,rptng,ad_man,pvt_lbl,sec)
           {
           		if(deptt && rptng && ad_man && pvt_lbl && sec)
           			return 1;
           		else
           			return 0;
           }
           
 