 
            var xmlHttp
			var qqq
			var str
			var str1="EditParamedicDoctorInfoHelper.aspx";
			var splitarr1
			var switch_No	
			var s
	//---------paramDoc--------------------------
			function initializeparamDoc()
			{ 
			  
			    Form1.cmbSUB_GROUP.options[0] = new Option(Form1.test1.value,"1");
				Form1.cmbSUB_GROUP.value="";
				Form1.cmbSUB_GROUP.selectedIndex=0;
				
				for(i=0;i<=Panel1.childNodes.length-1;i++)
					{
						if(Panel1.childNodes[i].nodeType==1 && Panel1.childNodes[i].id.indexOf("Requiredfieldvalidator10")!=-1) 
						ValidatorEnable(Panel1.childNodes[i],false);  
					}
//-----------------------------------------------
               if (Form1.txtMODE_H.value=="Add" && Form1.test1.value!="")
                   Form1.txtMODE_H.value=="Edit"
                  
			   try {Form1.cmbFK_INSURANCE_SUB_BRANCH.focus();}catch(e){}
			   p3=0;
			   Form1.cmbFK_NOT_LOSS_DISCOUNT.disabled = true
    		   Form1.cmbFK_LOSS_PENALTY.disabled = true
    		   
			    if(Form1.txtMODE_H.value=="Edit")
			    {      
				  s2=Form1.txtEDIT_H.value;
				  if(s2 != "")
				  {
					arrss=s2.split("#");
                   
					// PARAMEDIC_DOCTOR_INFO
					arrss0=arrss[0].split("$");
					dic = new ActiveXObject("Scripting.Dictionary");
					for(i=0;i<arrss0.length-1;i++)
					{
						arrss01=arrss0[i].split("%");
						dic.Add(arrss01[0] , arrss01[1]);
					}
					Form1.txtFNAME.value=dic.Item("FNAME");
					Form1.txtLNAME.value = dic.Item("LNAME");
					//Form1.txtFATHER_NAME.value = dic.Item("FATHER_NAME");
					//Form1.txtID_NO.value = dic.Item("ID_NO");
					Form1.txtHOME_ADDRESS.value = dic.Item("HOME_ADDRESS");
					Form1.txtHOME_TEL.value = dic.Item("HOME_TEL");
					//Form1.txtHOSPITAL_ADDRESS.value = dic.Item("HOSPITAL_ADDRESS");
					//Form1.txtHOSPITAL_TEL.value = dic.Item("HOSPITAL_TEL");
					
					
					Form1.txtMEDICAL_NO.value = dic.Item("MEDICAL_NO");
					Form1.cmbGROUP_NO.value=dic.Item("GROUP_NO");
					cmbGROUP_NO_change();

					Form1.cmbSUB_GROUP.value = dic.Item("FK_GROUP");
					//cmbSUB_GROUP_change();
					
					Form1.cmbACTIVE_PLACE.value = dic.Item("ACTIVE_PLACE");
					cmbACTIVE_PLACE_change()
					
					Form1.cmbEDUCATION_COND.value = dic.Item("EDUCATION_COND");
					cmbEDUCATION_COND_change()
					
					//Form1.txtDESCRIPTION.value = dic.Item("DESCRIPTION");
						
					// PARAMEDIC_DOCTOR_COVERS				
					arrss1=arrss[1].split("$");
					dic.RemoveAll();
					for(i=0;i<arrss1.length;i++)
					{
						arrss11=arrss1[i].split("%");
						dic.Add(arrss11[0] , arrss11[1]);					
					}
					//Form1.cmbOLD_POLICY_TYPE.value=dic.Item("OLD_POLICY_TYPE");
					//cmbOLD_POLICY_TYPE_change();
					
					Form1.txtOLD_POLICY_NO.value=dic.Item("OLD_POLICY_NO");
					if (Form1.txtOLD_POLICY_NO.value!="")
					{
					  Form1.cmbFK_NOT_LOSS_DISCOUNT.disabled = false
    		          Form1.cmbFK_LOSS_PENALTY.disabled = false 
    		        }
					//Form1.txtEXP_DATE.value=dic.Item("EXP_DATE");  felan
					Form1.txtEXP_DATE_H.value=dic.Item("EXP_DATE");
					//Form1.cmbISSUE_STATUS.value=dic.Item("ISSUE_STATUS");
					Form1.cmbCALCULATE_STATUS.value=dic.Item("CALCULATE_STATUS");
					//Form1.cmbCOMMIT_SELECT_TYPE.value=dic.Item("COMMIT_SELECT_TYPE");
					cmbCOMMIT_SELECT_TYPE_change();
					
					Form1.cmbFK_NOT_LOSS_DISCOUNT.value=dic.Item("FK_NOT_LOSS_DISCOUNT");
				    cmbFK_NOT_LOSS_DISCOUNT_change();
				    Form1.txtNOT_LOSS_DISCOUNT_AMOUNT_H.value =dic.Item("NOT_LOSS_DISCOUNT_AMOUNT");
				    
				    //Form1.cmbFK_ETC_DISCOUNT.value=dic.Item("FK_ETC_DISCOUNT");
					//cmbFK_ETC_DISCOUNT_change();
					//Form1.txtETC_DISCOUNT_AMOUNT_H.value =dic.Item("ETC_DISCOUNT_AMOUNT");
					
					Form1.cmbFK_LOSS_PENALTY.value=dic.Item("FK_LOSS_PENALTY");
					cmbFK_LOSS_PENALTY_change();
					Form1.txtLOSS_PENALTY_AMOUNT_H.value =dic.Item("LOSS_PENALTY_AMOUNT");
					
					//Form1.txtFRANCHISE_PERCENT.value=(dic.Item("FRANCHISE_PERCENT")==""?dic.Item("FRANCHISE_PERCENT"):parseFloat(dic.Item("FRANCHISE_PERCENT")));
					//Form1.txtFRANCHISE_AMOUNT.value=dic.Item("FRANCHISE_AMOUNT");
					//SeperateNumber_change("txtFRANCHISE_AMOUNT",",");
					
					//Form1.txtDUPLICATE_NUMBER.value=dic.Item("DUPLICATE_NUMBER");
					
					//Form1.cmbFK_GROUP_DISCOUNT.value=dic.Item("FK_GROUP_DISCOUNT"); mm 860404
					
					//Form1.cmbFK_GROUP_DISCOUNT.value=Form1.TxtGroupdis_H.value;//mm 860404
					
					//Form1.txtGROUP_DISCOUNT_AMOUNT_H.value=dic.Item("GROUP_DISCOUNT_AMOUNT");
					
					//Form1.txtADDITIONAL_PERCENT.value=(dic.Item("ADDITIONAL_PERCENT")==""?dic.Item("ADDITIONAL_PERCENT"):parseFloat(dic.Item("ADDITIONAL_PERCENT")));
					///////850920
					//ADDITIONAL_PERCENT_h=(dic.Item("ADDITIONAL_PERCENT")==""?dic.Item("ADDITIONAL_PERCENT"):parseFloat(dic.Item("ADDITIONAL_PERCENT")));
					//////850920
					//Form1.txtADDITIONAL_AMOUNT_H.value=dic.Item("ADDITIONAL_AMOUNT");
					//Form1.txtADDITIONAL_PERCENT_TOTAL.value=dic.Item("ADDITIONAL_AMOUNT");
					
					
					//Form1.txtAGREE_DISCOUNT.value=(dic.Item("AGREE_DISCOUNT")=="" ? dic.Item("AGREE_DISCOUNT") : parseFloat(dic.Item("AGREE_DISCOUNT")));
					//Form1.txtAGREE_DISCOUNT_AMOUNT_H.value=dic.Item("AGREE_DISCOUNT_AMOUNT");
					Form1.txtCOMMIT_AMOUNT.value=dic.Item("COMMIT_AMOUNT");
					////////850808
					p1=dic.Item("COMMIT_AMOUNT");
					////////850808
					SeperateNumber_change("txtCOMMIT_AMOUNT",",");
					
					Form1.txtCOMMIT_AMOUNT_TERM.value=dic.Item("COMMIT_AMOUNT_TERM");
					SeperateNumber_change("txtCOMMIT_AMOUNT_TERM",",");
					if(parseFloat(dic.Item("PREMIUM_RATE"))!=0)
					{
					   Form1.txtCOMMIT_MAX_H.value=dic.Item("COMMIT_MAX");
					   //Form1.txtPREMIUM_RATE.value=parseFloat(dic.Item("PREMIUM_RATE"));
					   Form1.txtPREMIUM_RATE_H.value=dic.Item("PREMIUM_RATE");
					  // Form1.txtPREMIUM_SUR_RATE.value=parseFloat(dic.Item("PREMIUM_RATE_SUR"));
					   Form1.txtPREMIUM_SUR_RATE_H.value=dic.Item("PREMIUM_RATE_SUR");
					}
					else
					   cmbSUB_GROUP_change();
					
					Form1.txtDAY_NUM.value=dic.Item("DAY_NUM");
					Form1.txtMONTH_NUM.value=dic.Item("MONTH_NUM");
					Form1.txtYEAR_NUM.value=dic.Item("YEAR_NUM");
					//Form1.txtPREMIUM.value=dic.Item("PREMIUM");
					////850808
					p2=dic.Item("PREMIUM");
					////850808
					Form1.txtPREMIUM_H.value=dic.Item("PREMIUM");
					//Form1.PRIMARY_PREMIUM_H.value=dic.Item("PREMIUM");
					//SeperateNumber_change("txtPREMIUM",",");
					
					//Form1.txtTOTAL_DISCOUNT.value=dic.Item("TOTAL_DISCOUNT");
					Form1.txtTOTAL_DISCOUNT_H.value=dic.Item("TOTAL_DISCOUNT");
					//SeperateNumber_change("txtTOTAL_DISCOUNT",",");
					
					Form1.txtTOTAL_PREMIUM.value=dic.Item("TOTAL_PREMIUM");
					//850809
					p3=dic.Item("TOTAL_PREMIUM");
					//850809
					Form1.txtTOTAL_PREMIUM_H.value=dic.Item("TOTAL_PREMIUM");
					SeperateNumber_change("txtTOTAL_PREMIUM",",");
					//--------------------actual------------------------
					arrss2=arrss[2].split("$");
					dic.RemoveAll();
					for(i=0;i<arrss2.length;i++)
					{
						arrss21=arrss2[i].split("%");
						dic.Add(arrss21[0] , arrss21[1]);					
					}
					Form1.txtNATIONAL_CODE.value =dic.Item("NATIONAL_CODE");
					Form1.txtE_MAIL.value =dic.Item("E_MAIL");
					//--------------------------------
					arrss3=arrss[3].split("$");
					dic.RemoveAll();
					for(i=0;i<arrss3.length;i++)
					{
						arrss31=arrss3[i].split("%");
						dic.Add(arrss31[0] , arrss31[1]);					
					}
					Form1.cmbFK_INSURANCE_SUB_BRANCH.value =dic.Item("FK_INSURANCE_SUB_BRANCH");
					//Form1.txtFK_INSURANCE_SUB_BRANCH_H.value =dic.Item("FK_INSURANCE_SUB_BRANCH");
					//Form1.ENTER_SECTION.value=(arrss[2]=="ENDORS"?"":dic.Item("TOTAL_PREMIUM"));
					//Form1.ENTER_SECTION.value=arrss[2];
					btnOk.disabled=false;
					//btnCancel.disabled=false;
				  }
			    }
				//LnkPolicy.disabled=(Form1.txtTOTAL_PREMIUM.value!=""?false:true)
			}
			//------------------------------
			
			function cmbGROUP_NO_change()
			{
			    Form1.txtPREMIUM_RATE_H.value="";
				Form1.txtPREMIUM_SUR_RATE_H.value="";
			    btnOk_disabled();
			    			
				qqq="?Query_No=1&CmbGroupNo="+Form1.cmbGROUP_NO.value+"&txtFK_INSURANCE_SUB_BRANCH_H="+Form1.cmbFK_INSURANCE_SUB_BRANCH.value;			
				str1="EditParamedicDoctorInfoHelper.aspx";
				switch_No="WebDoctor_GROUP_NO";
				splitarr1="@";
				
				Form1.cmbSUB_GROUP.length =0;
			    showcmb()	
			}
			//---------------------------------------
			function cmbSUB_GROUP_change()
			{
			  
			    Form1.test1.value="";
			    var item_select="";
			    var subgroup=document.all("cmbSUB_GROUP");
			   
			    if (subgroup.innerText!="")
			        item_select=(subgroup.options[subgroup.selectedIndex].text); 	
          	     
			    Form1.test1.value=(item_select);
			    //-----------child node-------
			    if ((Form1.cmbFK_INSURANCE_SUB_BRANCH.value=="101" && (Form1.cmbACTIVE_PLACE.value==1 |Form1.cmbACTIVE_PLACE.value==2)&& (item_select==String.fromCharCode(1605)+String.fromCharCode(1575)+String.fromCharCode(1605)+String.fromCharCode(1575)))|(Form1.cmbFK_INSURANCE_SUB_BRANCH.value=="102"))
			    {
					for(i=0;i<=Panel1.childNodes.length-1;i++)
					{
						if(Panel1.childNodes[i].nodeType==1 && Panel1.childNodes[i].id.indexOf("Requiredfieldvalidator7")!=-1) 
						ValidatorEnable(Panel1.childNodes[i],true);  
					}
			    }
			   else if (Form1.cmbFK_INSURANCE_SUB_BRANCH.value=="101")
			    {
			       for(i=0;i<=Panel1.childNodes.length-1;i++)
					{
						if(Panel1.childNodes[i].nodeType==1 && Panel1.childNodes[i].id.indexOf("Requiredfieldvalidator7")!=-1) 
						ValidatorEnable(Panel1.childNodes[i],false);  
					}
			    }
			    
			 //------ماما-------------------------
			    var item_select1=String.fromCharCode(1605)+String.fromCharCode(1575)+String.fromCharCode(1605)+String.fromCharCode(1575);
				if(item_select==item_select1 && (Form1.cmbACTIVE_PLACE.value=="1" | Form1.cmbACTIVE_PLACE.value=="2"))
				     qqq="?Query_No=9&CmbGroupNo="+Form1.cmbGROUP_NO.value+"&txtFK_INSURANCE_SUB_BRANCH_H="+Form1.cmbFK_INSURANCE_SUB_BRANCH.value; 
				 else
				     qqq="?Query_No=8&CmbGroupNo="+Form1.cmbGROUP_NO.value+"&txtFK_INSURANCE_SUB_BRANCH_H="+Form1.cmbFK_INSURANCE_SUB_BRANCH.value;		
				splitarr1="@";
				switch_No="WebDoctor_SUB_GROUP";
				str1="EditParamedicDoctorInfoHelper.aspx";
				var item_select2=String.fromCharCode(1662)+String.fromCharCode(1585)+String.fromCharCode(1587)+String.fromCharCode(1578)+String.fromCharCode(1575)+String.fromCharCode(1585);
				var item_select3=String.fromCharCode(1576)+String.fromCharCode(1607)+String.fromCharCode(1610)+String.fromCharCode(1575)+String.fromCharCode(1585);
				if(item_select.indexOf(item_select2)!=-1 | item_select.indexOf(item_select3)!=-1)
				   cmbACTIVE_PLACE_change()  
				showcmb()		    	   
			}
			
			//----------------------------------------------
			 
			function cmbEDUCATION_COND_change()
	        {
	           
				Form1.txtADDITIONAL_PERCENT.value=Math.round(Form1.txtADDITIONAL_PERCENT.value)-Math.round(Form1.txtADDITIONAL1.value)
				btnOk_disabled();
				Form1.txtADDITIONAL1.value="";
				
				if( Form1.cmbEDUCATION_COND.value=="3")
				{
					qqq="?Query_No=6&cmbEDUCATION_COND="+Form1.cmbEDUCATION_COND.value;
					str1="EditParamedicDoctorInfoHelper.aspx";
					splitarr1="@";
					switch_No="WebDoctor_EDUCATION_COND"; 
					showcmb()		 
				} 		
	        }
	       //------------------------------------
	       function cmbACTIVE_PLACE_change()
			{
			
			  Form1.txtADDITIONAL_PERCENT.value=Math.round(Form1.txtADDITIONAL_PERCENT.value)-Math.round(Form1.txtADDITIONAL2.value)
			  Form1.txtADDITIONAL2.value=""; 
			  btnOk_disabled();	 
			  if (Form1.cmbFK_INSURANCE_SUB_BRANCH.value=="101" && Form1.cmbSUB_GROUP.value!="")
			     {
					for(i=0;i<=Panel1.childNodes.length-1;i++)
					{
						if(Panel1.childNodes[i].nodeType==1 && Panel1.childNodes[i].id.indexOf("Requiredfieldvalidator7")!=-1) 
						ValidatorEnable(Panel1.childNodes[i],false);  
					}
			  
					var subgroup=document.all("cmbSUB_GROUP");
	  				var item_select=subgroup.options[subgroup.selectedIndex].text;
		  	        
					if(Form1.cmbACTIVE_PLACE.value=="1" | Form1.cmbACTIVE_PLACE.value=="2")
					{
						qqq="?Query_No=7&cmbSUB_GROUP="+Form1.cmbSUB_GROUP.value;
						str1="EditParamedicDoctorInfoHelper.aspx";
						splitarr1="@";
						switch_No="WebDoctor_ACTIVE_PLACE";
				        showcmb()
					}
					var item_select1=String.fromCharCode(1605)+String.fromCharCode(1575)+String.fromCharCode(1605)+String.fromCharCode(1575);
					if (item_select==item_select1)
						cmbSUB_GROUP_change()
			      }
			  
			    else if (Form1.cmbFK_INSURANCE_SUB_BRANCH.value=="102")
				{
						for(i=0;i<=Panel1.childNodes.length-1;i++)
						{
							if(Panel1.childNodes[i].nodeType==1 && Panel1.childNodes[i].id.indexOf("Requiredfieldvalidator7")!=-1) 
							ValidatorEnable(Panel1.childNodes[i],true);  
						}
				}
						
			}
			//-------------------------------
			function cmbCOMMIT_SELECT_TYPE_change()//1
			{
			 /* // if(Form1.cmbCOMMIT_SELECT_TYPE.value=="1")
			  
			        //Form1.txtPREMIUM_RATE.disabled=true; hidden
				    //Form1.txtPREMIUM_SUR_RATE.disabled=true;
				    cmbSUB_GROUP_change()
				    btnOk_disabled()*/ 
			}	
			//----------------------------
			function cmbFK_LOSS_PENALTY_change()//7
            {
               
                btnOk_disabled();
		        Form1.txtLOSS_PENALTY_H.value="";
		        if(Form1.cmbFK_LOSS_PENALTY.value!="")
		        {
			        qqq="?Query_No=3&cmbFK_LOSS_PENALTY="+Form1.cmbFK_LOSS_PENALTY.value+ "&cmbFK_INSURANCE_SUB_BRANCH=" + Form1.cmbFK_INSURANCE_SUB_BRANCH.value;
			        splitarr1="";
					switch_No="WebDoctor_LOSS_PENALTY"; 
					 str1="EditParamedicDoctorInfoHelper.aspx";
			        Form1.cmbFK_NOT_LOSS_DISCOUNT.disabled = true;
					showcmb()
		        }
            }
//----------------------------------
                function cmbFK_NOT_LOSS_DISCOUNT_change()//8
                {
                  btnOk_disabled();
	              Form1.txtNOT_LOSS_DISCOUNT_H.value="";        
					if(Form1.cmbFK_NOT_LOSS_DISCOUNT.value!="")
					{
						qqq="?Query_No=2&cmbFK_NOT_LOSS_DISCOUNT="+Form1.cmbFK_NOT_LOSS_DISCOUNT.value+ "&cmbFK_INSURANCE_SUB_BRANCH=" + Form1.cmbFK_INSURANCE_SUB_BRANCH.value;
        				splitarr1="";
						switch_No="WebDoctor_NOT_LOSS_DISCOUNT";	   
						Form1.cmbFK_LOSS_PENALTY.disabled = true;
						 str1="EditParamedicDoctorInfoHelper.aspx";
					// Form1.txtLOSS_PENALTY_H.value = ""; 		
					}
			        showcmb()			
                }
              //----------//9-----------------
              function txtCOMMIT_AMOUNT_change()
            {
           
                Form1.txtCOMMIT_AMOUNT_TERM.value=Form1.txtCOMMIT_AMOUNT.value;
                btnOk_disabled();
                Form1.ErrLabel.value ="";
                
                if (parseInt(RemoveSeperateNumber(Form1.txtCOMMIT_AMOUNT.value))<100000000) 
                {
                Form1.TxtIncrease_Tax.value="";
                Form1.TxtCharge.value="";
                Form1.txtPremium.value="";
                Form1.txtTOTAL_PREMIUM.value="";
                
                Form1.ErrLabel.value =String.fromCharCode(1576)+String.fromCharCode(1575)+String.fromCharCode(32)+String.fromCharCode(1575)+String.fromCharCode(1610)+ String.fromCharCode(1606)+String.fromCharCode(32)+String.fromCharCode(1587)+String.fromCharCode(1610)+String.fromCharCode(1587)+String.fromCharCode(1578)+String.fromCharCode(1605);
				Form1.ErrLabel.value =Form1.ErrLabel.value + String.fromCharCode(32)+String.fromCharCode(1606)+String.fromCharCode(1605)+String.fromCharCode(1610);
				Form1.ErrLabel.value =Form1.ErrLabel.value + String.fromCharCode(1578)+String.fromCharCode(1608)+String.fromCharCode(1575)+String.fromCharCode(1606)+ String.fromCharCode(32)+String.fromCharCode(1575)+String.fromCharCode(1610)+String.fromCharCode(1606)+String.fromCharCode(32)+ String.fromCharCode(1576)+String.fromCharCode(1610);
			    Form1.ErrLabel.value =Form1.ErrLabel.value + String.fromCharCode(1605)+String.fromCharCode(1607); 
			    
			    Form1.ErrLabel.value =Form1.ErrLabel.value +String.fromCharCode(32)+String.fromCharCode(1606)+String.fromCharCode(1575)+String.fromCharCode(1605)+String.fromCharCode(1607)+ String.fromCharCode(32)+String.fromCharCode(1585)+String.fromCharCode(1575)+String.fromCharCode(32)+String.fromCharCode(1589)+String.fromCharCode(1575)+String.fromCharCode(1583);
				Form1.ErrLabel.value =Form1.ErrLabel.value + String.fromCharCode(1585)+String.fromCharCode(32)+String.fromCharCode(1610)+String.fromCharCode(1575);
				Form1.ErrLabel.value =Form1.ErrLabel.value + String.fromCharCode(32)+String.fromCharCode(1578)+String.fromCharCode(1605)+String.fromCharCode(1583)+ String.fromCharCode(1610)+String.fromCharCode(1583)+String.fromCharCode(32)+String.fromCharCode(1705)+String.fromCharCode(1585)+ String.fromCharCode(1583)+String.fromCharCode(32);
			    Form1.ErrLabel.value =Form1.ErrLabel.value + String.fromCharCode(1588)+String.fromCharCode(1605)+ String.fromCharCode(1575)+String.fromCharCode(32)+ String.fromCharCode(1576)+String.fromCharCode(1575)+ String.fromCharCode(1610)+String.fromCharCode(1583)+ String.fromCharCode(32)+String.fromCharCode(1576)+ String.fromCharCode(1607)+String.fromCharCode(32); 
			    
			    Form1.ErrLabel.value =Form1.ErrLabel.value +String.fromCharCode(1610)+String.fromCharCode(1705)+String.fromCharCode(1610)+String.fromCharCode(32)+String.fromCharCode(1575)+ String.fromCharCode(1586)+String.fromCharCode(32)+String.fromCharCode(1588)+String.fromCharCode(1593)+String.fromCharCode(1576)+String.fromCharCode(32)+String.fromCharCode(1610);
				Form1.ErrLabel.value =Form1.ErrLabel.value + String.fromCharCode(1575)+String.fromCharCode(32)+String.fromCharCode(1606)+String.fromCharCode(1605);
				Form1.ErrLabel.value =Form1.ErrLabel.value + String.fromCharCode(1610)+String.fromCharCode(1606)+String.fromCharCode(1583)+String.fromCharCode(1711)+ String.fromCharCode(1610)+String.fromCharCode(32)+String.fromCharCode(1607)+String.fromCharCode(1575)+String.fromCharCode(32)+ String.fromCharCode(1605)+String.fromCharCode(1585);
			    Form1.ErrLabel.value =Form1.ErrLabel.value + String.fromCharCode(1575)+String.fromCharCode(1580)+ String.fromCharCode(1593)+String.fromCharCode(1607)+ String.fromCharCode(32)+String.fromCharCode(1705)+ String.fromCharCode(1606)+String.fromCharCode(1610)+ String.fromCharCode(1583)+String.fromCharCode(32); 
				
				return;
			        
			     }
			     
            }
            //----------------------------
            function txtYEAR_NUM_change()
            {
                btnOk_disabled();
            }
            function txtMONTH_NUM_change()
            {
                btnOk_disabled();
            }
            function txtDAY_NUM_change()
            {
                btnOk_disabled();
            }
            //-----------------------------
            function cmbCALCULATE_STATUS_change()
            {
                btnOk_disabled();         
            }
            //-----------------------------    
            function txtOLD_POLICY_NO_change()//17
			{	
			 Form1.ErrLabel.value=""; 
			 if(Form1.txtOLD_POLICY_NO.value=="")
			   Form1.ErrLabel.value="";
			 else
			 {
			  if(Form1.txtOLD_POLICY_NO.value.length!=22)
			  Form1.ErrLabel.value=String.fromCharCode(1588)+String.fromCharCode(1605)+String.fromCharCode(1575)+String.fromCharCode(1585)+String.fromCharCode(1607)+String.fromCharCode(32)+String.fromCharCode(1576)+String.fromCharCode(1740)+String.fromCharCode(1605)+String.fromCharCode(1607)+String.fromCharCode(32)+String.fromCharCode(1606)+String.fromCharCode(1575)+String.fromCharCode(1605)+String.fromCharCode(1607)+String.fromCharCode(32)+String.fromCharCode(1588)+String.fromCharCode(1605)+String.fromCharCode(1575)+String.fromCharCode(32)+String.fromCharCode(1589)+String.fromCharCode(1581)+String.fromCharCode(1740)+String.fromCharCode(1581)+String.fromCharCode(32)+String.fromCharCode(1606)+String.fromCharCode(1605)+String.fromCharCode(1740)+String.fromCharCode(32)+String.fromCharCode(1576)+String.fromCharCode(1575)+String.fromCharCode(1588)+String.fromCharCode(1583)+String.fromCharCode(46);
			  if(Form1.txtOLD_POLICY_NO.value.length>5 && Form1.txtOLD_POLICY_NO.value.substr(0,5)!="04102")
			   Form1.ErrLabel.value=String.fromCharCode(1588)+String.fromCharCode(1605)+String.fromCharCode(1575)+String.fromCharCode(1585)+String.fromCharCode(1607)+String.fromCharCode(32)+String.fromCharCode(1576)+String.fromCharCode(1740)+String.fromCharCode(1605)+String.fromCharCode(1607)+String.fromCharCode(32)+String.fromCharCode(1606)+String.fromCharCode(1575)+String.fromCharCode(1605)+String.fromCharCode(1607)+String.fromCharCode(32)+String.fromCharCode(1588)+String.fromCharCode(1605)+String.fromCharCode(1575)+String.fromCharCode(32)+String.fromCharCode(1589)+String.fromCharCode(1581)+String.fromCharCode(1740)+String.fromCharCode(1581)+String.fromCharCode(32)+String.fromCharCode(1606)+String.fromCharCode(1605)+String.fromCharCode(1740)+String.fromCharCode(32)+String.fromCharCode(1576)+String.fromCharCode(1575)+String.fromCharCode(1588)+String.fromCharCode(1583)+String.fromCharCode(46);
			 }
			      
			   /* Form1.ErrLabel.value =String.fromCharCode(1576)+String.fromCharCode(1575)+String.fromCharCode(32)+String.fromCharCode(1575)+String.fromCharCode(1610)+ String.fromCharCode(1606)+String.fromCharCode(32)+String.fromCharCode(1587)+String.fromCharCode(1610)+String.fromCharCode(1587)+String.fromCharCode(1578)+String.fromCharCode(1605);
				Form1.ErrLabel.value =Form1.ErrLabel.value + String.fromCharCode(32)+String.fromCharCode(1606)+String.fromCharCode(1605)+String.fromCharCode(1610);
				Form1.ErrLabel.value =Form1.ErrLabel.value + String.fromCharCode(1578)+String.fromCharCode(1608)+String.fromCharCode(1575)+String.fromCharCode(1606)+ String.fromCharCode(32)+String.fromCharCode(1575)+String.fromCharCode(1610)+String.fromCharCode(1606)+String.fromCharCode(32)+ String.fromCharCode(1576)+String.fromCharCode(1610);
			    Form1.ErrLabel.value =Form1.ErrLabel.value + String.fromCharCode(1605)+String.fromCharCode(1607); 
			    
			    Form1.ErrLabel.value =Form1.ErrLabel.value +String.fromCharCode(32)+String.fromCharCode(1606)+String.fromCharCode(1575)+String.fromCharCode(1605)+String.fromCharCode(1607)+ String.fromCharCode(32)+String.fromCharCode(1585)+String.fromCharCode(1575)+String.fromCharCode(32)+String.fromCharCode(1589)+String.fromCharCode(1575)+String.fromCharCode(1583);
				Form1.ErrLabel.value =Form1.ErrLabel.value + String.fromCharCode(1585)+String.fromCharCode(32)+String.fromCharCode(1610)+String.fromCharCode(1575);
				Form1.ErrLabel.value =Form1.ErrLabel.value + String.fromCharCode(32)+String.fromCharCode(1578)+String.fromCharCode(1605)+String.fromCharCode(1583)+ String.fromCharCode(1610)+String.fromCharCode(1583)+String.fromCharCode(32)+String.fromCharCode(1705)+String.fromCharCode(1585)+ String.fromCharCode(1583)+String.fromCharCode(32);
			    Form1.ErrLabel.value =Form1.ErrLabel.value + String.fromCharCode(1588)+String.fromCharCode(1605)+ String.fromCharCode(1575)+String.fromCharCode(32)+ String.fromCharCode(1576)+String.fromCharCode(1575)+ String.fromCharCode(1610)+String.fromCharCode(1583)+ String.fromCharCode(32)+String.fromCharCode(1576)+ String.fromCharCode(1607)+String.fromCharCode(32); 
			    
			    Form1.ErrLabel.value =Form1.ErrLabel.value +String.fromCharCode(1610)+String.fromCharCode(1705)+String.fromCharCode(1610)+String.fromCharCode(32)+String.fromCharCode(1575)+ String.fromCharCode(1586)+String.fromCharCode(32)+String.fromCharCode(1588)+String.fromCharCode(1593)+String.fromCharCode(1576)+String.fromCharCode(32)+String.fromCharCode(1610);
				Form1.ErrLabel.value =Form1.ErrLabel.value + String.fromCharCode(1575)+String.fromCharCode(32)+String.fromCharCode(1606)+String.fromCharCode(1605);
				Form1.ErrLabel.value =Form1.ErrLabel.value + String.fromCharCode(1610)+String.fromCharCode(1606)+String.fromCharCode(1583)+String.fromCharCode(1711)+ String.fromCharCode(1610)+String.fromCharCode(32)+String.fromCharCode(1607)+String.fromCharCode(1575)+String.fromCharCode(32)+ String.fromCharCode(1605)+String.fromCharCode(1585);
			    Form1.ErrLabel.value =Form1.ErrLabel.value + String.fromCharCode(1575)+String.fromCharCode(1580)+ String.fromCharCode(1593)+String.fromCharCode(1607)+ String.fromCharCode(32)+String.fromCharCode(1705)+ String.fromCharCode(1606)+String.fromCharCode(1610)+ String.fromCharCode(1583)+String.fromCharCode(32); */
			    
			    //if(Form1.txtMODE_H.value=="Add" && Form1.txtOLD_POLICY_NO.value!="" && Form1.txtOLD_POLICY_NO.value.substring(16)!="000000")
			   Form1.txtFK_INFO_H.value = "";
			   //Form1.txtEXP_DATE.value="";
			   Form1.txtEXP_DATE_H.value="";
			   	   			   
			   if(Form1.txtOLD_POLICY_NO.value!="" && Form1.txtOLD_POLICY_NO.value.substring(16)!="000000" && Form1.txtOLD_POLICY_NO.value.length==22)
			   {
			      Form1.txtFNAME.value="";
			      Form1.txtLNAME.value = "";
			      //Form1.txtFATHER_NAME.value = "";
			      //Form1.txtID_NO.value = "";
			      Form1.txtHOME_ADDRESS.value ="";
			      Form1.txtHOME_TEL.value = "";
			      //Form1.txtHOSPITAL_ADDRESS.value = "";
			      //Form1.txtHOSPITAL_TEL.value = "";
			      Form1.txtMEDICAL_NO.value = "";
			      Form1.cmbGROUP_NO.value="";
			      Form1.cmbSUB_GROUP.value ="";
			      Form1.cmbACTIVE_PLACE.value ="";
			      Form1.cmbEDUCATION_COND.value ="";
			      //Form1.txtDESCRIPTION.value ="";
				  Form1.cmbFK_NOT_LOSS_DISCOUNT.disabled = false
				  Form1.cmbFK_LOSS_PENALTY.disabled = false
				  
			      qqq="?Query_No=10&txtOLD_POLICY_NO=" + Form1.txtOLD_POLICY_NO.value;
				  str1="EditParamedicDoctorInfoHelper.aspx";
				  splitarr1="#";
				  switch_No="WebDoctor_OLD_POLICY_NO";
				 
				  showcmb()
				  	
				 
			  }
			  else if(Form1.txtOLD_POLICY_NO.value=="")
			  {
			        Form1.cmbFK_NOT_LOSS_DISCOUNT.value="";
				    cmbFK_NOT_LOSS_DISCOUNT_change()
					Form1.cmbFK_NOT_LOSS_DISCOUNT.disabled = true
				    Form1.cmbFK_LOSS_PENALTY.disabled = true
				    Form1.txtOLD_POLICY_NO.disabled = true
			  }
			}
            //----------------------------
            function SeperateNumber_change(str,sep)//14
    	    {
    			 var no=Form1.document.all(str).value;
    	    //var e = window.event
           //var codepoint=Form1.txtCOMMIT_AMOUNT.value.charCodeAt(0)
               if (str=="txtCOMMIT_AMOUNT")
               {
                    if(no.indexOf(",")!=-1) 
    				   no=RemoveSeperateNumber(document.all(str).value); 
					codepoint=Char2Ascii(no);
					var s=codepoint.split(" ");
					for(i=0;i<=s.length-1;i++)
					{
						if(parseInt(s[i])<48 || parseInt(s[i])>57)
						{
							Form1.txtCOMMIT_AMOUNT.value="";
							return;
						}
					}
					txtCOMMIT_AMOUNT_change()
                 }
    	     //----------------------------------
    			//mm var no=Form1.document.all(str).value;
    			if(no.indexOf(",")!=-1) 
    				no=RemoveSeperateNumber(document.all(str).value); 
    			if (str=="txtCOMMIT_AMOUNT" && (no<100000000))
    			    Form1.document.all(str).value="";	       
    			else
    			  Form1.document.all(str).value=SeperateNumber(no,sep);  
    	   }
    	   //---------------------------------
    	  function Compute_Dates(Ylen,Mlen,Dlen)
        {	
			Edate=0;
			insure_length=0;
			Fdate=Form1.txtPROPOSAL_DATE.value;

			if(Fdate != "")
				Edate=1
			else
			{
				dt = new Date();
				year = dt.getFullYear();
				month = dt.getMonth()+1
				day = dt.getDate();
				Fdate= Miladi2Shamsi(year,month,day);
			}
			dif=0;
			return Date_Differents(Form1.txtPROPOSAL_DATE.value,nDayAfter(Form1.txtPROPOSAL_DATE.value,Ylen,Mlen,Dlen,1,dif));
		}
		
		//------------calculate-------------------------
		function btnCalculate_Paramedic_click()
		{  
		   
        	Form1.ErrLabel.value= "";
			GroupNo = Form1.cmbGROUP_NO.value
	           
			if(GroupNo == "")
			{
				//Form1.ErrLabel.value = "شماره گروه مشخص نشده است";
				Form1.ErrLabel.value =String.fromCharCode(1588)+String.fromCharCode(1605)+String.fromCharCode(1575)+String.fromCharCode(1585)+String.fromCharCode(1607)+ String.fromCharCode(32)+String.fromCharCode(1711)+String.fromCharCode(1585)+String.fromCharCode(1608)+String.fromCharCode(1607)+String.fromCharCode(32);
			    Form1.ErrLabel.value =Form1.ErrLabel.value + String.fromCharCode(1605)+String.fromCharCode(1588)+String.fromCharCode(1582)+String.fromCharCode(1589)+ String.fromCharCode(32)+String.fromCharCode(1606)+String.fromCharCode(1588)+String.fromCharCode(1583)+String.fromCharCode(1607)+ String.fromCharCode(32)+String.fromCharCode(1575);
			    Form1.ErrLabel.value =Form1.ErrLabel.value + String.fromCharCode(1587)+String.fromCharCode(1578);
				return;
			}
			
			if(Form1.txtOLD_POLICY_NO.value.substring(16) == "000000")
			{
				//Form1.ErrLabel.value = "شماره بيمه نامه مشخص نشده است";
				Form1.ErrLabel.value =String.fromCharCode(1588)+String.fromCharCode(1605)+String.fromCharCode(1575)+String.fromCharCode(1585)+String.fromCharCode(1607)+ String.fromCharCode(32)+String.fromCharCode(1576)+String.fromCharCode(1610)+String.fromCharCode(1605)+String.fromCharCode(1607)+String.fromCharCode(32)+String.fromCharCode(1606);
				Form1.ErrLabel.value =Form1.ErrLabel.value + String.fromCharCode(1575)+String.fromCharCode(1605)+String.fromCharCode(1607)+String.fromCharCode(32);
				Form1.ErrLabel.value =Form1.ErrLabel.value + String.fromCharCode(1605)+String.fromCharCode(1588)+String.fromCharCode(1582)+String.fromCharCode(1589)+ String.fromCharCode(32)+String.fromCharCode(1606)+String.fromCharCode(1588)+String.fromCharCode(1583)+String.fromCharCode(1607)+ String.fromCharCode(32)+String.fromCharCode(1575);
			    Form1.ErrLabel.value =Form1.ErrLabel.value + String.fromCharCode(1587)+String.fromCharCode(1578); 
				return;
			}
			
			
			Ylen=(Form1.txtYEAR_NUM.value!=""?parseInt(Form1.txtYEAR_NUM.value):0);
			Mlen=(Form1.txtMONTH_NUM.value!=""?parseInt(Form1.txtMONTH_NUM.value):0);
			Dlen=(Form1.txtDAY_NUM.value!=""?parseInt(Form1.txtDAY_NUM.value):0);
			insure_length = Compute_Dates(Ylen,Mlen,Dlen)
			if(insure_length == 0) 
			{
			   // Form1.ErrLabel.value = "خطا مدت بيمه معلوم نمي باشد";
			    Form1.ErrLabel.value =String.fromCharCode(1582)+String.fromCharCode(1591)+String.fromCharCode(1575)+String.fromCharCode(32)+String.fromCharCode(1605)+String.fromCharCode(1583)+String.fromCharCode(1578)+String.fromCharCode(32)+String.fromCharCode(1610)+String.fromCharCode(1605)+String.fromCharCode(1607)+String.fromCharCode(32)+String.fromCharCode(1606)+String.fromCharCode(1575)+String.fromCharCode(1605)+String.fromCharCode(1607)+String.fromCharCode(32);
			    Form1.ErrLabel.value=Form1.ErrLabel.value+String.fromCharCode(1605)+String.fromCharCode(1593)+String.fromCharCode(1604)+String.fromCharCode(1608)+String.fromCharCode(1605)+String.fromCharCode(32)+String.fromCharCode(1606)+String.fromCharCode(1605)+String.fromCharCode(1610)+String.fromCharCode(1576)+String.fromCharCode(1575)+String.fromCharCode(1588)+String.fromCharCode(1583);
				return;
			}
			
			//Form1.txtEXP_DATE_H.value=nDayAfter(Form1.txtPROPOSAL_DATE.value,Ylen,Mlen,Dlen,1,dif);
			
			d_Def=Date_Differents(Form1.txtPROPOSAL_DATE.value,Form1.txtEXP_DATE_H.value)
			if (d_Def>0)
			{
			  //Form1.ErrLabel.value ="اين بيمه نامه"+d_Def+"روز ديگر اعتبار دارد";
			   Form1.ErrLabel.value =String.fromCharCode(1575)+String.fromCharCode(1610)+String.fromCharCode(1606)+String.fromCharCode(32)+String.fromCharCode(1576)+String.fromCharCode(1610)+String.fromCharCode(1605)+String.fromCharCode(1607)+String.fromCharCode(32)+String.fromCharCode(1606)+String.fromCharCode(1575)+String.fromCharCode(1605)+String.fromCharCode(1607)+String.fromCharCode(32);
			   Form1.ErrLabel.value=Form1.ErrLabel.value+d_Def+String.fromCharCode(32)+String.fromCharCode(1585)+String.fromCharCode(1608)+String.fromCharCode(1586)+String.fromCharCode(32)+String.fromCharCode(1583)+String.fromCharCode(1610)+String.fromCharCode(1711)+String.fromCharCode(1585)+String.fromCharCode(32)+String.fromCharCode(1575)+String.fromCharCode(1593)+String.fromCharCode(1578)+String.fromCharCode(1576)+String.fromCharCode(1575);
			   Form1.ErrLabel.value=Form1.ErrLabel.value+String.fromCharCode(1585)+String.fromCharCode(32)+String.fromCharCode(1583)+String.fromCharCode(1575)+String.fromCharCode(1585)+String.fromCharCode(1583);
			   return;
			}
			//************CALCULATE PREMIUM*****************
			CapitalAmount=RemoveSeperateNumber(Form1.txtCOMMIT_AMOUNT.value);	
			CommitMax=Form1.txtCOMMIT_MAX_H.value;  
			PremiumRate=Form1.txtPREMIUM_RATE_H.value;
			if(parseFloat(CapitalAmount) <= parseFloat(CommitMax))
			  OneYear_Premium =CapitalAmount*PremiumRate/1000;
			else
			  OneYear_Premium =[(CommitMax*PremiumRate)+((CapitalAmount-CommitMax)*Form1.txtPREMIUM_SUR_RATE_H.value)]/1000;		
			//*********************************************
			premium=OneYear_Premium * Ylen;
			Daily_Premium=0,Short_Premium=0,day=0 	
			if (Form1.cmbCALCULATE_STATUS.value=="2")
			{
			  
			     day=parseInt(Form1.txtYEAR_NUM.value*365)+parseInt(Form1.txtMONTH_NUM.value*30)+parseInt(Form1.txtDAY_NUM.value);
			     Daily_Premium =Math.round(OneYear_Premium*(day/365));
			   premium=Daily_Premium;
			   
			}
			/*else if ((Mlen>0 | Dlen>0) && Form1.cmbCALCULATE_STATUS.value=="3")
			{
			 
			   qqq="?Query_No=12&txtMONTH_NUM="+Form1.txtMONTH_NUM.value+ "&txtDAY_NUM=" + Form1.txtDAY_NUM.value+ "&cmbFK_INSURANCE_SUB_BRANCH=" + Form1.cmbFK_INSURANCE_SUB_BRANCH.value;
			   splitarr1="";
			   switch_No="WebDoctor_CALCULATE_STATUS3";	
			   str1="EditParamedicDoctorInfoHelper.aspx";
			   showcmb()
			   //if (s=="") s=100;
			   
			   Short_Premium =Math.round(OneYear_Premium*(Form1.txtShort_Premium_H.value/100))
			   premium=Short_Premium;
			}*/	  
			 
			//Form1.txtPremium.value=SeperateNumber(premium,",") //premium value
			Form1.txtPREMIUM_H.value =premium	
			//hamid
			additional_amount=0
			if(Form1.txtADDITIONAL_PERCENT.value!= "" && Form1.txtADDITIONAL_PERCENT.value!= "0")
					additional_amount=Math.round(parseFloat(Form1.txtADDITIONAL_PERCENT.value*0.01)*(premium));
			Form1.txtADDITIONAL_AMOUNT_H.value=additional_amount
			premium=premium+additional_amount;
			Form1.txtPremium.value=Math.round(premium);
			//-----------------------------------
			/*var sign1=""; var no2="";
			var t_no=Form1.txtPremium.value; 
			if(t_no.indexOf(".")!=-1) {no2=t_no.substring(t_no.length,t_no.indexOf(".")); t_no=t_no.substring(0,t_no.indexOf("."));}
			if(t_no.indexOf(",")!=-1)  t_no=RemoveSeperateNumber(Form1.txtPremium.value); 
			if(t_no.substring(0,1)=="-")  sign1="-";
			else if(t_no.substring(0,1)=="+") {t_no=t_no.replace("+","");sign1="";}
			t_no=Math.abs(t_no);
			if(t_no.toString()=="NaN"){Form1.txtPremium.value="";return;}
			if(t_no.toString().length>3)  Form1.txtPremium.value=sign1+SeperateNumber(t_no,",");  */
			//-----------------------------------
			 Form1.txtPremium.value=SeperateNumber(Math.round(premium),",");
			Form1.txtPREMIUM_H.value =Math.round(premium);
			
			//1************NOT_LOSS_DISCOUNT*********************
			notloss_discount=0
			
			if(Form1.txtNOT_LOSS_DISCOUNT_H.value != "" )
			   notloss_discount=parseFloat(Form1.txtNOT_LOSS_DISCOUNT_H.value*0.01)*premium;
			Form1.txtNOT_LOSS_DISCOUNT_AMOUNT_H.value=notloss_discount
			//3************AGREE_DISCOUNT*********************
			agree_discount=0
			if (Form1.txtMEDICAL_NO.value!= "" && Form1.txtMEDICAL_NO.value!= "0")
			{
				agree_discount=25	  
				agree_discount=parseFloat(agree_discount*0.01)*(premium-notloss_discount);
				Form1.txtAGREE_DISCOUNT_AMOUNT_H.value = agree_discount; 
			}
			//5************ADDITIONAL_loss penalty*********************
				
			/*additional_amount=0
			if(Form1.txtADDITIONAL_PERCENT.value!= "" && Form1.txtADDITIONAL_PERCENT.value!= "0")
					additional_amount=Math.round(parseFloat(Form1.txtADDITIONAL_PERCENT.value*0.01)*(premium-notloss_discount-agree_discount));
			Form1.txtADDITIONAL_AMOUNT_H.value=additional_amount
			*/	
			//************************************************************
			final_discount=Math.round(notloss_discount+agree_discount)
			
			if(parseFloat(final_discount)>parseFloat(premium))
			{ 
			   //Form1.ErrLabel.value = "مبلغ تخفيف بيشتر از سرمايه بيمه مي باشد";
			   Form1.ErrLabel.value =String.fromCharCode(1605)+String.fromCharCode(1576)+String.fromCharCode(1604)+String.fromCharCode(1594)+String.fromCharCode(32)+String.fromCharCode(1587)+String.fromCharCode(1585)+String.fromCharCode(1605)+String.fromCharCode(1575)+String.fromCharCode(1610)+String.fromCharCode(1607)+String.fromCharCode(32)+String.fromCharCode(1705)+String.fromCharCode(1605);
			   Form1.ErrLabel.value=Form1.ErrLabel.value+String.fromCharCode(1578)+String.fromCharCode(1585)+String.fromCharCode(32)+String.fromCharCode(1575)+String.fromCharCode(1586)+String.fromCharCode(32)+String.fromCharCode(1578)+String.fromCharCode(1582)+String.fromCharCode(1601)+String.fromCharCode(1610)+String.fromCharCode(1601)+String.fromCharCode(32)+String.fromCharCode(1605)+String.fromCharCode(1610)+String.fromCharCode(1576);
			   Form1.ErrLabel.value=Form1.ErrLabel.value+String.fromCharCode(1575)+String.fromCharCode(1588)+String.fromCharCode(1583);
			   return;
			}
			
			final_premium1=Math.round((parseFloat(premium))-parseFloat(final_discount));
			
			//-------------------------------------
			InCrease_Tax_Amount=0 
			Charge_Amount=0 
			final_premium=Math.round(parseFloat((final_premium1*(1.03))));
			final_premium_diff=Math.round(parseFloat(final_premium-final_premium1));
			InCrease_Tax_Amount=Math.round(parseFloat(final_premium_diff/2));
			Charge_Amount=InCrease_Tax_Amount;
			Form1.TxtIncrease_Tax_H.value=InCrease_Tax_Amount;
			Form1.TxtIncrease_Tax.value=SeperateNumber(InCrease_Tax_Amount,",");
			Form1.TxtCharge_H.value=Charge_Amount;
			Form1.TxtCharge.value=SeperateNumber(Charge_Amount,",");
			//-----------------------------------
			//Form1.txtTOTAL_PREMIUM.value=final_premium;
		    final_premium=AsiaRound(final_premium);
			Form1.txtTOTAL_PREMIUM.value=SeperateNumber(final_premium,",");
			Form1.txtTOTAL_PREMIUM_H.value=final_premium
			Form1.txtTOTAL_DISCOUNT_H.value=final_discount
            btnOk.disabled=false;
			
		}		
			//-----------------------------
			function btnOk_disabled()
			{
			   Form1.txtTOTAL_PREMIUM.value="";
			   Form1.txtTOTAL_PREMIUM_H.value="";
			   btnOk.disabled=true;
			   /*LnkPolicy.disabled=true;
			   btnCancel.disabled=(Form1.ENTER_SECTION.value=="ENDORS"?true:false)*/
			}
	       //---------------------------------		
			function showcmb()
			{ 
				xmlHttp=GetXmlHttpObject();
				if (xmlHttp==null)
				{
					alert ("Your browser does not support AJAX!");
					return;
				} 
				var url=""; 	
				str1 = str1 +qqq;
				
				url=url+str1;
				url=url+"&sid="+Math.random();
				xmlHttp.onreadystatechange=stateChanged;
				xmlHttp.open("GET",url,true);
				xmlHttp.send(null);			
			}
//---------------------------------------
			function stateChanged() 
			{ 
			
				var s1; 
				var arrs ;
				
				if (xmlHttp.readyState==4)
				{ 
				 
					s1=xmlHttp.responseText;
					if (s1!= "")
					{
					   
						arrs =s1.split(splitarr1);
						switch(switch_No)
						{
							case "WebDoctor_SUB_GROUP":
								Form1.txtPREMIUM_RATE_H.value=(arrs[1]!=""?parseFloat(arrs[1]):"");
								Form1.txtPREMIUM_SUR_RATE_H.value=(arrs[2]!=""?parseFloat(arrs[2]):"");
								Form1.txtCOMMIT_MAX_H.value=arrs[0];
							break;
							case "WebDoctor_ACTIVE_PLACE":
							   Form1.txtADDITIONAL2.value=arrs[1];
					           Form1.txtADDITIONAL_PERCENT.value=Math.round(Form1.txtADDITIONAL_PERCENT.value)+Math.round(Form1.txtADDITIONAL2.value)
							break;
							case "WebDoctor_EDUCATION_COND":
							   Form1.txtADDITIONAL1.value=arrs[1];
					           Form1.txtADDITIONAL_PERCENT.value=Math.round(Form1.txtADDITIONAL_PERCENT.value)+Math.round(Form1.txtADDITIONAL1.value)
							break;
							case "WebDoctor_GROUP_NO":
							  for(i=0;i<arrs.length;i++)
								{
								
									newarrs = arrs[i].split("%");
									Form1.cmbSUB_GROUP.options[i] = new Option(newarrs[1],newarrs[0]);
								}
								Form1.cmbSUB_GROUP.value = "";					            
								Form1.cmbSUB_GROUP.value=Form1.h_txtsub_group.value;
							break;
							case "WebDoctor_LOSS_PENALTY":
							    Form1.txtLOSS_PENALTY_H.value =(parseFloat(s1));
							break;
							case "WebDoctor_NOT_LOSS_DISCOUNT":
							     Form1.txtNOT_LOSS_DISCOUNT_H.value =(parseFloat(s1));
							break;
							/*case"WebDoctor_CALCULATE_STATUS3":
							     Form1.txtShort_Premium_H.value =s1; 
							break;*/			
							case "WebDoctor_OLD_POLICY_NO":
								// PARAMEDIC_DOCTOR_INFO
								
								arrss0=arrs[0].split("$");
								dic = new ActiveXObject("Scripting.Dictionary");
								for(i=0;i<arrss0.length-1;i++)
								{
									arrss01=arrss0[i].split("%");
									dic.Add(arrss01[0] , arrss01[1]);
								}
								if (dic.Item("FNAME")!=undefined)
								  Form1.txtFNAME.value=dic.Item("FNAME");
								else  
								  Form1.txtFNAME.value="";
								if (dic.Item("LNAME")!=undefined) 
								  Form1.txtLNAME.value = dic.Item("LNAME");
								else
								  Form1.txtLNAME.value ="";
								  
								Form1.txtFK_INFO_H.value = dic.Item("PK_REC_CODE");
								
								//if (dic.Item("HOME_ADDRESS")!=undefined) 
								//  Form1.txtHOME_ADDRESS.value = dic.Item("HOME_ADDRESS");
								//else
								 // Form1.txtHOME_ADDRESS.value ="";
								  
								//if (dic.Item("HOME_TEL")!=undefined) 
								 // Form1.txtHOME_TEL.value = dic.Item("HOME_TEL");
								//else
								// Form1.txtHOME_TEL.value ="";
								 
								if (dic.Item("MEDICAL_NO")!=undefined) 
								  Form1.txtMEDICAL_NO.value=dic.Item("MEDICAL_NO");
								else
								  Form1.txtMEDICAL_NO.value="-";
								  
								Form1.cmbGROUP_NO.value=dic.Item("GROUP_NO");
								cmbGROUP_NO_change();
                                Form1.h_txtsub_group.value=dic.Item("FK_GROUP");
								Form1.cmbSUB_GROUP.value = dic.Item("FK_GROUP");
							
							    //---------------- cmbSUB_GROUP_change()	
								Form1.cmbACTIVE_PLACE.value=dic.Item("ACTIVE_PLACE");
								cmbACTIVE_PLACE_change()
		    					
								Form1.cmbEDUCATION_COND.value=dic.Item("EDUCATION_COND");
								cmbEDUCATION_COND_change()
								// POLICY				
								arrss1=arrs[1].split("$");
								dic.RemoveAll();
								for(i=0;i<arrss1.length;i++)
								{
									arrss11=arrss1[i].split("%");
									dic.Add(arrss11[0] , arrss11[1]);					
								}
								//Form1.txtEXP_DATE.value=dic.Item("END_DATE");
								if (dic.Item("END_DATE")!=undefined)
								 Form1.txtEXP_DATE_H.value=dic.Item("END_DATE");	
							break;
						    default: 	
						    break;	
						}//end switch					
					}//end if s
					else //s==""
					{   
						switch(switch_No)
						{
					        case "WebDoctor_OLD_POLICY_NO":
					            Form1.ErrLabel.value ="";
								Form1.ErrLabel.value =String.fromCharCode(1670)+String.fromCharCode(1606)+String.fromCharCode(1610)+String.fromCharCode(1606)+String.fromCharCode(32)+String.fromCharCode(1576)+String.fromCharCode(1610)+String.fromCharCode(1605)+String.fromCharCode(1607)+String.fromCharCode(32)+String.fromCharCode(1606)+String.fromCharCode(1575)+String.fromCharCode(1605)+String.fromCharCode(1607)+String.fromCharCode(32)+String.fromCharCode(1575)+String.fromCharCode(1610)+String.fromCharCode(32)+String.fromCharCode(1610)+String.fromCharCode(1575)+String.fromCharCode(1601)+String.fromCharCode(1578)+String.fromCharCode(32)+String.fromCharCode(1606)+String.fromCharCode(1588)+String.fromCharCode(1583);	
								Form1.txtOLD_POLICY_NO.value = "";			
							break;
					  	} 
					}//end else s==""
				}//ready
			}//end func*/
//---------------------------------------
   /*public string Ascii2Char(string str)
        {
            string Ascii2Char = "";
            string[] NewStr=str.Split(' ');
            for(int i=0;i<NewStr.Length;i++)
                if(NewStr[i] != "")
                    Ascii2Char  = Ascii2Char + (char)(System.Convert.ToInt64(NewStr[i]));
            return Ascii2Char;
        }*/
//---------------------------------------
			function GetXmlHttpObject()
			{
			var xmlHttp=null;
			try
			{
			// 
			xmlHttp=new XMLHttpRequest();
			}
			catch (e)
			{
			try
				{
				xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
				}
			catch (e)
				{
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
				}
			}
			return xmlHttp;
			}