﻿function CloseQuote()
{
    var popUp = document.getElementById(GicQuoteDiv);
    popUp.style.display= 'none';
    //document.getElementById(GBtnQuote).style.display = 'none';   
}
function ValidateInsurance(ctl, args)
{                                          
    var control = document.getElementById(ctl.controltovalidate);                                                                                                                                                  
    //alert('ValidateInsurance'+" "+ctl.controltovalidate);       
    if(parseInt(control.value).toString() != control.value )
    {             
        //document.getElementById(GBtnQuote).style.display = 'block';   
        if(navigator.appName=="Microsoft Internet Explorer"){
            try{ctl.innerText=GOkNumber;}catch(err){}
         }
        else{
            try{ctl.textContent=GOkNumber;}catch(e){}
          }
          args.IsValid = false;
     }
    else 
    {   
        if(navigator.appName=="Microsoft Internet Explorer"){
            try{ctl.innerText=GNotInsurable;}catch(err){}
         }
        else{
            try{ctl.textContent=GNotInsurable;}catch(e){}
          }
        args.IsValid = true;        
        if(btnClicked==0) __doPostBack(GtbInsuranceVal,"");          
     }
}
function InsuranceModified(evt)
{  
    document.onmousemove=MouseMove;    
    btnClicked = 0;    
    return true;
}  
function MouseMove()
{        
    document.onmousemove = null;    
    (document.getElementById(GRbtn1)).focus();
}
             
function calcClick()
{    
    btnClicked = 1;
    return true;
}                

function EndRequestHandler(sender, args)
 { 
//     debugger
//     theForm.action = "<%=PageUrl%>";
//     theForm._initialAction = theForm.action;
//     
//     if (args.get_error() != null)
//        {
//            var errorMessage;            
//            if (args.get_response().get_statusCode() == '200')
//                { errorMessage = args.get_error().message;}            
//            args.set_errorHandled(true);
//        }
  }     
  
        
              
