﻿// JScript File

	  function Check()
		  {	  
		  var elm=document.aspnetForm.elements;		
		  for (i=0;i<elm.length;i++)
		  {
		  
		  if((elm[i].type=="text" || elm[i].type=="select-one") && elm[i].getAttribute("lname"))
		    {
		             if(elm[i].value=="0" || elm[i].value=="")
		             {
		               alert(elm[i].getAttribute("lname"));
		               elm[i].style.background="#ffcc99";
		               elm[i].focus();
		               return false;
		             }
		    } 
		         if (elm[i].type == 'radio')
				     {
		            if(document.getElementById('<%=ctl00_ContentPlaceHolder1_ddlLoanType.ClientID %>').value=="Secured" && document.getElementById('ctl00_ContentPlaceHolder1_rdoHome_1').checked==true)
		            {		
		            alert('Criteria mismatch for Secured loan.')   
		             return false;
		            }
		           } 
		    
		  }		     
    }
    
     function OpenLoan(url)
      {
        if(url!="")
        {
          window.open(url);//,"","width=800,height=800,resizable=yes,top=150,left=150,scrollbars=yes");
        }
        else
       {
        alert("Sorry Landing URL is Not Available ! ");
        return false;
        }        
      }
    //////////////////////////////////// Detail Code //////////////////////////////////
    
     var xmlhttp1;
    
    function CallCarInsuranceDetail(providerid,pageurl)
    {
   
    var url=pageurl;  
//var url='<%=Page.ResolveUrl("~/insurance")%>'+'/BreakdownDetails.aspx?BreakdownId=2';
    // alert(url);
      xmlhttp1=new XMLHttpRequest(); 
      xmlhttp1.onreadystatechange=onResponseDetail;
      xmlhttp1.open("GET",url,true);
      xmlhttp1.send(null);
    }
    
    
 function onResponseDetail()
   {    
   //alert('innn');
    if(xmlhttp1.readyState!=4){ return;}   
    
    if(document.getElementById('detaildiv').style.display=='none')
    {
       document.getElementById('detaildiv').style.display='block';
       document.getElementById('loading').style.display='block';
       //alert(xmlhttp1.responseText);
       document.getElementById('tdShow').innerHTML=xmlhttp1.responseText;
    }
 }
   
   function dvclose()
   {
    document.getElementById('detaildiv').style.display='none';
    document.getElementById('loading').style.display='none';       
   return false;
   }
   
   ////////////////////////////////// Close Detail ////////////////////////////////


      function OpenNewWindow(url)
      {
        if(url!="")
        {
          window.open(url);//,"","width=800,height=800,resizable=yes,top=150,left=150,scrollbars=yes");
        }
        else
       {
        alert("Sorry Landing URL is Not Available ! ");
        return false;
        }
        
      }