var apnaloan={};apnaloan.isNull=function(param)
{return typeof(param)=='undefined'||param==null;};apnaloan.isNotNull=function(param)
{return!(apnaloan.isNull(param));};apnaloan.isFunction=function(param)
{return apnaloan.isNotNull(param)&&typeof(param)=='function';};apnaloan.getXMLHttpObject=function(){try{return new XMLHttpRequest();}catch(e){var ielibs=['Msxml2.XMLHTTP.6.0','Msxml2.XMLHTTP.4.0','Msxml2.XMLHTTP.3.0','Msxml2.XMLHTTP','Microsoft.XMLHTTP'];for(var i=0;i<ielibs.length;i++){try{return new ActiveXObject(ielibs[i]);}catch(ex){}}}
alert('Your browser does not seem to support AJAX, or the functionality has been disabled');return null;};apnaloan.getRootWindow=function(){var currentWindow=window;var lastWindow=null;while(currentWindow!=lastWindow&&currentWindow!=null)
{lastWindow=currentWindow;currentWindow=currentWindow.parent;}
return currentWindow;};apnaloan.setGlobal=function(name,value){var win=apnaloan.getRootWindow();win[name]=value;};apnaloan.getGlobal=function(name){var win=apnaloan.getRootWindow();return win[name];};apnaloan.urlDecode=function(url,delim){var result=new Array();if(url!=null)
{var arr=url.split(delim);for(var i=0;i<arr.length;i++)
{var str=arr[i];if(str!=null)
{var pair=str.split('=',2);if(pair.length>1){result[pair[0]]=pair[1];}else{result[str]='';}}}}
return result;};apnaloan.getParamKeys=function(url,delim)
{var result=new Array();var count=0;var str;if(url!=null)
{var arr=url.split(delim);for(var i=0;i<arr.length;i++)
{str=arr[i];if(str!=null)
{var pos=str.indexOf('=');if(pos>0){result[count++]=str.substring(0,pos);}else{result[count++]=str;}}}}
return result;};apnaloan.isWhitespace=function(str,pos)
{var ch=str.charAt(pos);return ch==' '||ch=='\t'||ch=='\r'||ch=='\n'||ch=='\f';};apnaloan.isDigit=function(str,pos)
{var ch=str.charAt(pos);return ch>='0'&&ch<='9';};apnaloan.isEmpty=function(str)
{str=apnaloan.trim(str);return apnaloan.isNull(str)||str.length==0;};apnaloan.isNotEmpty=function(str)
{return!(apnaloan.isEmpty(str));};apnaloan.trim=function(str)
{if(apnaloan.isNull(str)){return"";}
var pos;pos=0;while(pos<str.length&&apnaloan.isWhitespace(str,pos)){pos++;}
str=pos>=str.length?"":str.substring(pos,str.length);pos=str.length-1;while(pos>=0&&apnaloan.isWhitespace(str,pos)){pos--;}
str=pos<0?"":str.substring(0,pos+1);return str;};apnaloan.isVisible=function(element)
{while(apnaloan.isNotNull(element)&&element.nodeName.toLowerCase()!='body')
{if(apnaloan.isNotNull(element.style)&&apnaloan.isNotNull(element.style.visibility)&&element.style.display=='none'){return false;}
element=element.parentNode;}
return true;};apnaloan.replacePlusWithSpace=function(txt)
{return txt.replace(/\+/g,' ');};apnaloan.invokeServerAction=function(action,params,httpMethod,useXHR,isXHRAsynch)
{isXHRAsynch=false;if(apnaloan.isNotEmpty(action)&&apnaloan.isNotNull(params))
{if(useXHR)
{var ajax=apnaloan.getXMLHttpObject();ajax.open(httpMethod,action+".htm?"+params+"&random="+(new Date().getTime()),isXHRAsynch);ajax.setRequestHeader("Connection","close");ajax.send(null);return ajax.responseText;}}
else
{alert("<br/>Error invoking server action '"+action+"'");return false;}};apnaloan.purgeTable=function(elemTable)
{var numRows=elemTable.rows.length;for(var i=1;i<numRows;i++)
{elemTable.deleteRow(1);}};apnaloan.parseUriEncodedJson=function(encodedJson)
{var json=apnaloan.replacePlusWithSpace(decodeURIComponent(encodedJson));try
{return eval("("+json+")");}
catch(ex)
{alert("ERROR: Malformed JSON String: "+json);return false;}};apnaloan.setCookie=function(cName,cValue,cExpireDays,cPath)
{if(apnaloan.isNull(cPath)){cPath="/";}
var expires="";if(apnaloan.isNotNull(cExpireDays)){var exDate=new Date();exDate.setDate(exDate.getDate()+cExpireDays);expires="; expires="+exDate.toGMTString();}
document.cookie=cName+'='+encodeURI(cValue)+expires+"; path="+cPath;};apnaloan.generateRandomInteger=function(upperLimit)
{return Math.round(Math.random()*upperLimit);};function findElementPosition(obj)
{var left=0;var top=0;if(obj.offsetParent)
{do
{left+=obj.offsetLeft;top+=obj.offsetTop;}while(obj=obj.offsetParent);}
return{left:left,top:top};}
var hiddenSelectElements=new Array();function hideSelectElementsBehindPopupInIe6(popupElement)
{var popupPosition=findElementPosition(popupElement);var selectBoxPos,leftQualification,topQualification;if(navigator.userAgent.search("MSIE 6")>-1)
{var selects=document.getElementsByTagName('select');for(var i in selects)
{leftQualification=topQualification=false;selectBoxPos=findElementPosition(selects[i]);if(selectBoxPos.top!=0)
{if(selectBoxPos.left>=popupPosition.left)
{if(selectBoxPos.left<(popupPosition.left+popupElement.offsetWidth))
{leftQualification=true;}}
else
{if((selectBoxPos.left+selects[i].offsetWidth)>popupPosition.left)
{leftQualification=true;}}
if(leftQualification)
{if(selectBoxPos.top>=popupPosition.top)
{if(selectBoxPos.top<(popupPosition.top+popupElement.offsetHeight))
{topQualification=true;}}
else
{if((selectBoxPos.top+selects[i].offsetHeight)>popupPosition.top)
{topQualification=true;}}}
if(topQualification)
{selects[i].style.visibility="hidden";hiddenSelectElements.push(selects[i]);}}}}}
function unhideSelectElementsBehindPopupInIe6()
{while(hiddenSelectElements.length>0)
{hiddenSelectElements.pop().style.visibility="visible";}}var currentStart=5;var currentEnd=4;function moveLeft()
{if(imageArray.length==0)
{return;}
if((currentStart)>=(imageArray.length))
{return;}
else
{var tempStart=currentStart;for(var i=0;i<4;i++)
{if(imageArray.length>tempStart+i)
{document.getElementById("li"+i).innerHTML=imageArray[tempStart+i];currentStart=currentStart+1;currentEnd=currentEnd+1;}
else
{document.getElementById("li"+i).innerHTML="<img src=\"/images/no-bank-image.jpg\">";}}
if(document.getElementById("rightArrow").style.display=="none")
{document.getElementById("rightArrow").style.display="block";}
if((currentStart)>=(imageArray.length))
{document.getElementById("leftArrow").style.display="none";if(document.getElementById("rightArrow").style.display=="none")
{document.getElementById("rightArrow").style.display="block";}}}}
function moveRight()
{if(imageArray.length==0)
{return;}
if(currentStart==0)
{return;}
var tempStart=currentStart;var j=1;for(var i=3;i>=0;i--)
{if(tempStart-j>=0)
{document.getElementById("li"+i).innerHTML=imageArray[tempStart-j];currentStart--;j++;}
else
{document.getElementById("li"+i).innerHTML="<img src=\"/images/no-bank-image.jpg\">";}}
if(document.getElementById("leftArrow").style.display=="none")
{document.getElementById("leftArrow").style.display="block";}
if(currentStart==0)
{document.getElementById("rightArrow").style.display="none";if(document.getElementById("leftArrow").style.display=="none")
{document.getElementById("leftArrow").style.display="block";}}}
function getXmlHttpRequestObject()
{if(window.XMLHttpRequest)
{return new XMLHttpRequest();}
else if(window.ActiveXObject)
{return new ActiveXObject("Microsoft.XMLHTTP");}
else
{document.getElementById('p_status').innerHTML='Status: Cound not create XmlHttpRequest Object.'+'Consider upgrading your browser.';}}
function apTrack()
{}
function validateEmail(str)
{var at="@"
var dot="."
var lat=str.indexOf(at)
var lstr=str.length
var ldot=str.indexOf(dot)
if(str.indexOf(at)==-1){alert("Invalid E-mail ID")
return false}
if(str.indexOf(at)==-1||str.indexOf(at)==0||str.indexOf(at)==lstr){alert("Invalid E-mail ID")
return false}
if(str.indexOf(dot)==-1||str.indexOf(dot)==0||str.indexOf(dot)==lstr){alert("Invalid E-mail ID")
return false}
if(str.indexOf(at,(lat+1))!=-1){alert("Invalid E-mail ID")
return false}
if(str.substring(lat-1,lat)==dot||str.substring(lat+1,lat+2)==dot){alert("Invalid E-mail ID")
return false}
if(str.indexOf(dot,(lat+2))==-1){alert("Invalid E-mail ID")
return false}
if(str.indexOf(" ")!=-1){alert("Invalid E-mail ID")
return false}
return true}
function clearText(docElement)
{if(docElement.value=="[Please enter your comment here...]"||docElement.value=="[Please enter your question here...]")
{docElement.value='';}}
function saveComment()
{receiveReq=window.getXmlHttpRequestObject();var name=document.getElementById("author").value;var email=document.getElementById("email").value;var comment=document.getElementById("text").value;if((name=='')||(email=='')||(comment==''))
{alert("Mandatory fields should not be empty");return false;}
if(!validateEmail(email))
{document.getElementById("email").focus();return false;}
var articleId=document.getElementById("articleId").value;var data='author='+name+'&email='+email+'&articleId='+articleId+'&text='+comment;if(receiveReq.readyState==4||receiveReq.readyState==0)
{receiveReq.open("POST",'/ajax/addcomment.html',true);receiveReq.setRequestHeader("Content-type","application/x-www-form-urlencoded")
receiveReq.onreadystatechange=handleReceivedComment;receiveReq.send(data);}}
function handleReceivedComment()
{if(receiveReq.readyState==4)
{var comment_div=document.getElementById('comment');var response=eval("("+receiveReq.responseText+")");var newCommentElm=document.createElement('div');var author=document.createElement('p');author.setAttribute('id','author'+response.id);author.innerHTML='By : '+response.author+'<span id=commentDate'+response.id+' class=greytext>|'+response.date+'</span>';var commentText=document.createElement('p');commentText.setAttribute('id','text'+response.id);commentText.setAttribute('class','tspace2');commentText.innerHTML=response.text;newCommentElm.appendChild(author);newCommentElm.appendChild(commentText);comment_div.appendChild(newCommentElm);}}
function addExperience()
{receiveReq=window.getXmlHttpRequestObject();var query=document.getElementById("experience").value;var name=document.getElementById("name").value;var mobileNo=document.getElementById("mob").value;var email=document.getElementById("email").value;var termAndCondition=document.getElementById("termAndCondchk");if((name=='')||(query=='')||(email=='')||(mobileNo=='')||!termAndCondition.checked)
{alert("Mandatory fields should not be empty");return false;}
if((email!='')&&(!validateEmail(email)))
{document.getElementById("email").focus();return false;}
if(isNaN(mobileNo))
{alert('Please enter correct mobile number');document.getElementById("mobileNo").focus();return false;}
var data='name='+name+'&mobile='+mobileNo+'&comment='+query+'&email='+email;if(receiveReq.readyState==4||receiveReq.readyState==0)
{receiveReq.open("POST",'/ajax/saveExperience.html',true);receiveReq.setRequestHeader("Content-type","application/x-www-form-urlencoded")
receiveReq.onreadystatechange=handleReceivedSaveExprience;receiveReq.send(data);}}
function handleReceivedSaveExprience()
{if(receiveReq.readyState==4)
{var askExpert_div=document.getElementById('responseSaveExprience');var response=eval("("+receiveReq.responseText+")");askExpert_div.innerHTML="</br>"+response.message;}}
function addAskExpertQuery()
{receiveReq=window.getXmlHttpRequestObject();var query=document.getElementById("question").value;var prod=document.getElementById("currentQueryTypeId").value;var email=document.getElementById("email").value;var mobileNo=document.getElementById("mobile").value;var termsAndCondition=document.getElementById("termsAndCondition");if(query==''||query=='[Please enter your question here...]')
{alert("Please enter your question");document.getElementById("question").focus();return false;}
if(email=='')
{alert("Please enter Your Email-Id ");document.getElementById("email").focus();return false;}
if(mobileNo=='')
{alert("Please Enter Your Mobile Number");document.getElementById("mobile").focus();return false;}
if((document.getElementById('mobile').value!='')&&(isNaN(document.getElementById('mobile').value)||document.getElementById('mobile').value.length<10||(document.getElementById("mobile").value.indexOf(9)!=0&&document.getElementById("mobile").value.indexOf(8)!=0&&document.getElementById("mobile").value.indexOf(7)!=0)))
{alert("Please enter valid mobile number");document.getElementById("mobile").value='';return false;}
if((email!='')&&(!validateEmail(email)))
{document.getElementById("email").focus();return false;}
if(!termsAndCondition.checked)
{alert("Please read Terms And Conditions and select the check box");return false;}
var params='email='+email+'&mobile='+mobileNo+'&productId='+prod;var button=document.getElementById('ask');button.disabled='true';if(receiveReq.readyState==4||receiveReq.readyState==0)
{receiveReq.open("POST",'/ajax/addAskExpertQuery.html?'+params,true);receiveReq.setRequestHeader("Content-type","application/x-www-form-urlencoded")
receiveReq.onreadystatechange=handleReceivedAskExpertyQuery;receiveReq.send('question='+encodeURI(query));}}
function handleReceivedAskExpertyQuery()
{if(receiveReq.readyState==4)
{var askExpert_div=document.getElementById('askExpertResponse');var response=eval("("+receiveReq.responseText+")");askExpert_div.innerHTML=response.message;}}
function getComments(showAll)
{receiveReq=window.getXmlHttpRequestObject();var articleId=document.getElementById("articleId").value;var data='articleId='+articleId+'&showAll='+showAll;if(receiveReq.readyState==4||receiveReq.readyState==0)
{receiveReq.open("POST",'/ajax/getComment.html',true);receiveReq.setRequestHeader("Content-type","application/x-www-form-urlencoded")
receiveReq.onreadystatechange=handleReceivedComments;receiveReq.send(data);}}
function handleReceivedComments()
{if(receiveReq.readyState==4)
{var comments_div=document.getElementById('comments');var response=eval("("+receiveReq.responseText+")");var showAll=response.showAll;var size=response.comments.length;if(size>0)
{var html="<input type='hidden' id='allComments' value=true>"
html+="<div class='Left_Content'>";html+="<div id='comment' class='info_Block_sub info_Block_border'>";html+="<h2>User Comments</h2>";if(showAll=="true")
{for(var i=0;i<size;i++)
{html+="<div>";html+="<p id='"+response.comments[i].id+"'>By:"+response.comments[i].author+"<span id='"+response.comments[i].id+"' class='greytext'>|"+response.comments[i].date+"</span></p>";html+="<p id='"+response.comments[i].id+"' class='tspace2'>"+response.comments[i].text+"</p>";html+="<p class='tspace10'><a href='#'>Read complete comment></a></p>";html+="</div>";}}
else
{if(size>=2)
{for(i=0;i<2;i++)
{html+="<div>";html+="<p id='"+response.comments[i].id+"'>By:"+response.comments[i].author+"<span id='"+response.comments[i].id+"' class='greytext'>|"+response.comments[i].date+"</span></p>";html+="<p id='"+response.comments[i].id+"' class='tspace2'>"+response.comments[i].text+"</p>";html+="<p class='tspace10'><a href='#'>Read complete comment></a></p>";html+="</div>";}}
else
{html+="<div>";html+="<p id='"+response.comments[0].id+"'>By:"+response.comments[0].author+"<span id='"+response.comments[0].id+"' class='greytext'>|"+response.comments[0].date+"</span></p>";html+="<p id='"+response.comments[0].id+"' class='tspace2'>"+response.comments[0].text+"</p>";html+="<p class='tspace10'><a href='#'>Read complete comment></a></p>";html+="</div>";}}
html+="<p style='text-align: right;' class='tspace10'><a href='javascript:getComments(true);'>View All Comments</a></p>";html+="</div>";html+="</div>";comments_div.innerHTML=html;}}}
function onCSASubmit(somevar)
{if(document.pressed=='search')
{document.myform.action="/home-loan-india/search.html";}
else
if(document.pressed=='apply')
{document.myform.action="/apply.html";}
return document.myform.runvalidation();}
function sendActivationCode(mobileNumber,productId)
{if(document.getElementById('product')==null||document.getElementById('product').value==''){alert('No product specified');return false;}
if(document.getElementById('is_nri_y').checked==true&&(document.getElementById('country_code').value==0||document.getElementById('country_code').value==91))
{alert("Please enter Country Code");document.getElementById("country_code").focus();return false;}
if(document.getElementById('is_nri_y').checked==true)
{if(document.getElementById('mobile').value==''||isNaN(document.getElementById('mobile').value))
{alert("Please enter valid mobile number");document.getElementById("mobile").value='';return false;}}else
{if(document.getElementById('mobile').value==''||isNaN(document.getElementById('mobile').value)||document.getElementById('mobile').value.length<10||(document.getElementById("mobile").value.indexOf(9)!=0&&document.getElementById("mobile").value.indexOf(8)!=0&&document.getElementById("mobile").value.indexOf(7)!=0))
{alert("Please enter valid mobile number");document.getElementById("mobile").value='';return false;}}
document.getElementById("name").disabled=false;document.getElementById("landlineCode").disabled=false;document.getElementById("landlineNumber").disabled=false;document.getElementById("email").disabled=false;document.getElementById("subProduct").disabled=false;if(productId!=3&&document.getElementById('flag').value!="apnainsurance")
{document.getElementById("loanAmount").disabled=false;}
if(document.getElementById('flag').value!="apnainsurance")
{document.getElementById("monthlyIncome").disabled=false;}
document.getElementById("dobDay").disabled=false;document.getElementById("dobMonth").disabled=false;document.getElementById("dobYear").disabled=false;document.getElementById("professionType").disabled=false;document.getElementById("apply").disabled=false;document.getElementById("activationCode").disabled=false;if(document.getElementById('flag').value!="apnainsurance")
{document.getElementById("has_credit_card_y").disabled=false;document.getElementById("has_credit_card_n").disabled=false;}
document.getElementById("activationButton").disabled=true;document.getElementById("activationButtonMessage").innerHTML='A four digit activation code has been sent to your mobile.';request=getXmlHttpRequestObject();mobileNumber=document.getElementById("mobile").value;countryCode=document.getElementById("country_code").value;var productId=document.getElementById('product').value;var cityElem=document.getElementById('city');var cityId=cityElem.options[cityElem.selectedIndex].value;request.open("GET",'/ajax/logSmartApp.html?mobile='+mobileNumber+"&country_code="+countryCode+'&productId='+productId+'&cityId='+cityId+'&nri='+document.getElementById('is_nri_y').checked+'&random='+(new Date().getTime()),true);request.onreadystatechange=function(){if(request.readyState==4){var resp=request.responseText;if(resp.indexOf('SUCCESS: ')==0){document.getElementById('leadId').value=resp.substring('SUCCESS: '.length);}}}
request.send(null);}
function unsubscribeUser(emailId)
{if(document.getElementById('emailId').value=='')
{alert("Please enter valid Email Id");document.getElementById("emailId").value='';return false;}
document.getElementById("unsubscibeMessage").innerHTML='You will be sent an email with an unsubscribe url.';request=getXmlHttpRequestObject();EmailId=document.getElementById("emailId").value;request.open("GET",'/ajax/unsubscribeUser.html?email='+EmailId,true);request.send(null);}
var flagS='true';var gCurrApp,gCurrCust;var productId2ProductName={"1":"Home Loan","2":"Personal Loan","3":"Credit Card","4":"Car Loan","5":"Education Loan","6":"Loan Against Security","7":"Life Insurance","8":"Health Insurance","9":"Auto Insurance","10":"Householder Insurance","11":"Travel Insurance","12":"Loan Against Property","13":"Real Estate","14":"Mobile Service Provider","15":"Gold Loan","16":"Fixed Deposit","17":"Mobile Phones","18":"Savings Account","19":"Current Account","20":"Two Wheeler Loan"};var googleConversionCode=new Array();googleConversionCode['7']="<!-- Google Code for lead Conversion Page -->\n"+"<script language=\"JavaScript\" type=\"text/javascript\">\n"+"<!--\n"+"var google_conversion_id = 1065021105;\n"+"var google_conversion_language = \"en_US\";\n"+"var google_conversion_format = \"2\";\n"+"var google_conversion_color = \"666666\";\n"+"if (1) {\n"+"  var google_conversion_value = 1;\n"+"}\n"+"var google_conversion_label = \"lead\";\n"+"//-->\n"+"</script>\n"+"<script language=\"JavaScript\" src=\"http://www.googleadservices.com/pagead/conversion.js\">\n"+"</script>\n"+"<img height=1 width=1 border=0 src=\"http://www.googleadservices.com/pagead/conversion/1065021105/imp.gif?value=1&label=lead&script=0\">";googleConversionCode['1']="<!-- Google Code for Lead Conversion Page -->\n"+"<script type=\"text/javascript\">\n"+"<!--\n"+"var google_conversion_id = 1053924110;\n"+"var google_conversion_language = \"en_US\";\n"+"var google_conversion_format = \"3\";\n"+"var google_conversion_color = \"ffffff\";\n"+"var google_conversion_label = \"lead\";\n"+"//-->\n"+"</script>\n"+"<script type=\"text/javascript\" src=\"http://www.googleadservices.com/pagead/conversion.js\">\n"+"</script>\n"+"<div style=\"display:inline;\">\n"+"<img height=\"1\" width=\"1\" style=\"border-style:none;\" alt=\"\" src=\"http://www.googleadservices.com/pagead/conversion/1053924110/?label=lead&amp;guid=ON&amp;script=0\"/>\n"+"</div>";googleConversionCode['8']="<!-- Google Code for lead Conversion Page -->\n"+"<script language=\"JavaScript\" type=\"text/javascript\">\n"+"<!--\n"+"var google_conversion_id = 1065020505;\n"+"var google_conversion_language = \"en_US\";\n"+"var google_conversion_format = \"2\";\n"+"var google_conversion_color = \"666666\";\n"+"if (1) {\n"+"  var google_conversion_value = 1;\n"+"}\n"+"var google_conversion_label = \"lead\";\n"+"//-->\n"+"</script>\n"+"<script language=\"JavaScript\" src=\"http://www.googleadservices.com/pagead/conversion.js\">\n"+"</script>\n"+"<img height=1 width=1 border=0 src=\"http://www.googleadservices.com/pagead/conversion/1065020505/imp.gif?value=1&label=lead&script=0\">";googleConversionCode['9']="<!-- Google Code for lead Conversion Page -->\n"+"<script language=\"JavaScript\" type=\"text/javascript\">\n"+"<!--\n"+"var google_conversion_id = 1065020805;\n"+"var google_conversion_language = \"en_US\";\n"+"var google_conversion_format = \"1\";\n"+"var google_conversion_color = \"666666\";\n"+"if (1) {\n"+"  var google_conversion_value = 1;\n"+"}\n"+"var google_conversion_label = \"lead\";\n"+"//-->\n"+"</script>\n"+"<script language=\"JavaScript\" src=\"http://www.googleadservices.com/pagead/conversion.js\">\n"+"</script>\n"+"<img height=1 width=1 border=0 src=\"http://www.googleadservices.com/pagead/conversion/1065020805/imp.gif?value=1&label=lead&script=0\">";googleConversionCode['3']="<!-- Google Code for lead Conversion Page -->\n"+"<script language=\"JavaScript\" type=\"text/javascript\">\n"+"<!--\n"+"var google_conversion_id = 1051734951;\n"+"var google_conversion_language = \"en_US\";\n"+"var google_conversion_format = \"1\";\n"+"var google_conversion_color = \"666666\";\n"+"if (1) {\n"+"  var google_conversion_value = 1;\n"+"}\n"+"var google_conversion_label = \"lead\";\n"+"//-->\n"+"</script>\n"+"<script language=\"JavaScript\" src=\"http://www.googleadservices.com/pagead/conversion.js\">\n"+"</script>\n"+"<img height=1 width=1 border=0 src=\"http://www.googleadservices.com/pagead/conversion/1051734951/imp.gif?value=1&label=lead&script=0\">";googleConversionCode['4']="<!-- Google Code for lead Conversion Page -->\n"+"<script language=\"JavaScript\" type=\"text/javascript\">\n"+"<!--\n"+"var google_conversion_id = 1051735131;\n"+"var google_conversion_language = \"en_US\";\n"+"var google_conversion_format = \"1\";\n"+"var google_conversion_color = \"666666\";\n"+"if (1) {\n"+"  var google_conversion_value = 1;\n"+"}\n"+"var google_conversion_label = \"lead\";\n"+"//-->\n"+"</script>\n"+"<script language=\"JavaScript\" src=\"http://www.googleadservices.com/pagead/conversion.js\">\n"+"</script>\n"+"<img height=1 width=1 border=0 src=\"http://www.googleadservices.com/pagead/conversion/1051735131/imp.gif?value=1&label=lead&script=0\">";googleConversionCode['12']="<!-- Google Code for lead Conversion Page -->\n"+"<script language=\"JavaScript\" type=\"text/javascript\">\n"+"<!--\n"+"var google_conversion_id = 1064423385;\n"+"var google_conversion_language = \"en_US\";\n"+"var google_conversion_format = \"1\";\n"+"var google_conversion_color = \"666666\";\n"+"if (1) {\n"+"  var google_conversion_value = 1;\n"+"}\n"+"var google_conversion_label = \"lead\";\n"+"//-->\n"+"</script>\n"+"<script language=\"JavaScript\" src=\"http://www.googleadservices.com/pagead/conversion.js\">\n"+"</script>\n"+"<img height=1 width=1 border=0 src=\"http://www.googleadservices.com/pagead/conversion/1064423385/imp.gif?value=1&label=lead&script=0\">";googleConversionCode['2']="<!-- Google Code for lead Conversion Page -->\n"+"<script language=\"JavaScript\" type=\"text/javascript\">\n"+"<!--\n"+"var google_conversion_id = 1057675862;\n"+"var google_conversion_language = \"en_US\";\n"+"var google_conversion_format = \"1\";\n"+"var google_conversion_color = \"FFFFFF\";\n"+"if (1) {\n"+"  var google_conversion_value = 1;\n"+"}\n"+"var google_conversion_label = \"lead\";\n"+"//-->\n"+"</script>\n"+"<script language=\"JavaScript\" src=\"http://www.googleadservices.com/pagead/conversion.js\">\n"+"</script>\n"+"<img height=1 width=1 border=0 src=\"http://www.googleadservices.com/pagead/conversion/1057675862/imp.gif?value=1&label=lead&script=0\">";googleConversionCode['11']="<!-- Google Code for lead Conversion Page -->\n"+"<script language=\"JavaScript\" type=\"text/javascript\">\n"+"<!--\n"+"var google_conversion_id = 1065020085;\n"+"var google_conversion_language = \"en_US\";\n"+"var google_conversion_format = \"2\";\n"+"var google_conversion_color = \"666666\";\n"+"if (1) {\n"+"  var google_conversion_value = 1;\n"+"}\n"+"var google_conversion_label = \"lead\";\n"+"//-->\n"+"</script>\n"+"<script language=\"JavaScript\" src=\"http://www.googleadservices.com/pagead/conversion.js\">\n"+"</script>\n"+"<img height=1 width=1 border=0 src=\"http://www.googleadservices.com/pagead/conversion/1065020085/imp.gif?value=1&label=lead&script=0\">";var yahooConversionCode="<SCRIPT language=\"JavaScript\" type=\"text/javascript\">\n"+"window.ysm_customData = new Object();\n"+"window.ysm_customData.conversion = \"transId=,currency=,amount=\";\n"+"var ysm_accountid  = \"13K98LAK21MKH6MMQ7A50Q6C4US\";\n"+"document.write(\"<SCR\" + \"IPT language='JavaScript' type='text/javascript' \"+ \"SRC=//\" + \"srv1.wa.marketingsolutions.yahoo.com\" + \"/script/ScriptServlet\" + \"?aid=\" + ysm_accountid+ \"></SCR\" + \"IPT>\");\n"+"</SCRIPT>\n";function displayGoogleResultPage()
{var searchParam=document.getElementById("my_input_search_box").value;if(searchParam=="")
{alert("Please enter search parameter");return false;}
document.google_custom_search.submit();}
function displayGoogleResultPageFromHomePage()
{var searchParam=document.getElementById("home_page_input_search_box").value;if(searchParam=="")
{alert("Please enter search parameter");return false;}
document.getElementById('cse-search-box').submit();}
function displayRefineSearch(val)
{history.go(-val);}
function goBack()
{history.go(-1);}
function compareDisplayPage(loantype,city,strButton)
{var domain;if(loantype=="")
{if(document.getElementById('vertical').value=='apnaloan')
alert("Please select Type of Loan");else if(document.getElementById('vertical').value=='apnainsurance')
alert("Please select Type of Insurance");else
alert("Please select a product");return false;}
if(loantype=="home-loan-india"||loantype=="personal-loan-india"||loantype=="car-loan-india"||loantype=="loan-against-property-india"||loantype=="education-loan-india"||loantype=="credit-card-india"||loantype=="business-loan-india"||loantype=="gold-loan-india")
{domain="http://www.apnaloan.com";}
else
{domain="http://www.apnainsurance.com";}
if(city=="Select a City")
{alert("Please select City");return false;}
var cityName=city.replace(" ","_");var category=document.getElementById("typeOfLoan").value;var subcategory;if(strButton=='Apply')
{subcategory="apply.html";}
if(strButton=='Search')
{subcategory="search.html";}
if(strButton=='Compare')
{if(category=='credit-card-india')
{subcategory="comparators.html"}
else
{subcategory="compare.html";}}
if(category=="business-loan-india")
{category="loan-against-property-india";}
var uri=domain+"/"+category+"/compare/"+cityName+".html";if(strButton=='Rates')
{var uri=domain+"/"+category+"/compare.html";}
if(category=='money-back-policy-india'||category=='whole-life-insurance-india')
{uri=domain+"/"+category+"/ulip-compare.html";}
if(strButton=='Rates'&&domain=='http://www.apnaloan.com'&&loantype!="credit-card-india")
{uri=domain+"/"+loantype+"/rates.html"}
if(strButton=='Rates'&&(loantype=='term-insurance-india'||loantype=='health-insurance-india'||loantype=='travel-insurance-india'||loantype=='car-insurance-india'))
{uri=domain+"/"+loantype+"/quotes.html";}
dynamicSubmit(uri,'POST','homePage');}
function viewPageforLogo(str)
{location.href=str;}
function setLoanType(loanValue,bankSize)
{var str='';loanValue=document.getElementById(loanValue).value;document.getElementById('searchForm').searchFormButt.disabled="disabled";if(document.getElementById('typeOfLoan'))
{document.getElementById("typeOfLoan").value=loanValue;}
if(bankSize==null)
{document.getElementById("pageHead").innerHTML="Currently no banks for this product";}
else
{if(document.getElementById("vertical"))
{if(document.getElementById("vertical").value=="apnainsurance")
{if(document.getElementById("csa"))
{document.getElementById("pageHead").innerHTML="<b> Compare Premiums from "+bankSize+" insurance <br> policies before you apply </b>";}
else
{document.getElementById("pageHead").innerHTML="<b> Compare Premiums of "+bankSize+" insurance policies before you apply </b>";}}
if(document.getElementById("vertical").value=="apnaloan")
{if(loanValue=="credit-card-india")
{document.getElementById("pageHead").innerHTML="<b> Compare "+bankSize+" credit cards before you apply </b>";}
else
{document.getElementById("pageHead").innerHTML="<b> Compare Rates of "+bankSize+" banks before you apply </b>";}}}}
if(loanValue=="home-loan-india")
{if(imageArray&&imageArray!=undefined&&imageArray.length!=0)
{if(imageUrl[1]!="undefined"||imageUrl[1]!=null)
{str=imageUrl[1];imageArray.splice(0,imageArray.length);for(var j=0;j<prodArr[1].length;j++)
{imageArray[j]=prodArr[1][j];}}
else
{imageArray.splice(0,imageArray.length);str='<ul><li0><img style="cursor:pointer;" src="/images/axis_bank_logo.gif" onclick="viewPageforLogo(\'/know-your-bank/home-loan-india/axis-bank-(uti).html.html\')"></li><span class="space5"></span><li1><img style="cursor:pointer;" src="/images/hdfc_logo.gif" onclick="viewPageforLogo(\'/know-your-bank/home-loan-india/hdfc-ltd.html\')"></li><span class="space5"></span><li2><img style="cursor:pointer;" src="/images/icici_logo.gif" onclick="viewPageforLogo(\'/know-your-bank/home-loan-india/icici.html\')"></li><span class="space5"></span><li3><img style="cursor:pointer;" src="/images/lic-housing-finance-small-15.gif" onclick="viewPageforLogo(\'/know-your-bank/home-loan-india/lic-hf.html\')"></li><span class="space5"></span><li4><img style="cursor:pointer;" src="/images/union-bank-of-india-small-18.gif" onclick="viewPageforLogo(\'/know-your-bank/home-loan-india/union-bank-of-india.html\')"></li>';}}
if(document.getElementById('csaImg1')){document.getElementById('csaImg1').innerHTML='<img style="cursor:pointer;" src="/images/axis_bank_logo.gif" height="25px" onclick="viewPageforLogo(\'/know-your-bank/home-loan-india/axis-bank-(uti).html\')">';document.getElementById('csaImg2').innerHTML='<img style="cursor:pointer;" src="/images/hdfc_logo.gif" height="25px" onclick="viewPageforLogo(\'/know-your-bank/home-loan-india/hdfc-ltd.html\')">';document.getElementById('csaImg3').innerHTML='<img style="cursor:pointer;" src="/images/icici_logo.gif" height="25px" onclick="viewPageforLogo(\'/know-your-bank/home-loan-india/icici.html\')">';}}
if(loanValue=="personal-loan-india")
{if(imageArray&&imageArray!=undefined&&imageArray.length!=0)
{if(imageUrl[2]!="undefined"||imageUrl[2]!=null)
{str=imageUrl[2];imageArray.splice(0,imageArray.length);for(var j=0;j<prodArr[2].length;j++)
{imageArray[j]=prodArr[2][j];}}
else
{str='<img style="cursor:pointer;" src="/images/icici_logo.gif" onclick="viewPageforLogo(\'/know-your-bank/personal-loan-india/icici.html\')"> <span class="space5"></span> <img style="cursor:pointer;" src="/images/hdfc_logo.gif" onclick="viewPageforLogo(\'/know-your-bank/personal-loan-india/hdfc-bank.html\')"> <span class="space5"></span> <img style="cursor:pointer;" src="/images/axis_bank_logo.gif" onclick="viewPageforLogo(\'/know-your-bank/axis-bank-(uti).html\')"> <span class="space5"></span> <img style="cursor:pointer;" src="/images/citibank_logo.gif" onclick="viewPageforLogo(\'/know-your-bank/citi.html\')"> <span class="space5"></span> <img style="cursor:pointer;" src="/images/kotak-logo.gif" onclick="viewPageforLogo(\'/know-your-bank/personal-loan-india/kotak.html\')">';}}
if(document.getElementById('csaImg1')){document.getElementById('csaImg1').innerHTML='<img style="cursor:pointer;" src="/images/icici_logo.gif" height="25px" onclick="viewPageforLogo(\'/know-your-bank/personal-loan-india/icici.html\')">';document.getElementById('csaImg2').innerHTML='<img style="cursor:pointer;" src="/images/hdfc_logo.gif" height="25px" onclick="viewPageforLogo(\'/know-your-bank/personal-loan-india/hdfc-bank.html\')">';document.getElementById('csaImg3').innerHTML='<img style="cursor:pointer;" src="/images/axis_bank_logo.gif" height="25px" onclick="viewPageforLogo(\'/know-your-bank/axis-bank-(uti).html\')">';}}
if(loanValue=="car-loan-india")
{if(imageArray&&imageArray!=undefined&&imageArray.length!=0)
{if(imageUrl[4]!="undefined"||imageUrl[4]!=null)
{str=imageUrl[4];imageArray.splice(0,imageArray.length);for(var j=0;j<prodArr[4].length;j++)
{imageArray[j]=prodArr[4][j];}}
else
{str='<img style="cursor:pointer;" src="/images/icici_logo.gif" onclick="viewPageforLogo(\'/know-your-bank/car-loan-india/icici.html\')"> <span class="space5"></span> <img style="cursor:pointer;" src="/images/axis_bank_logo.gif" onclick="viewPageforLogo(\'/know-your-bank/car-loan-india/axis-bank-(uti).html.html\')"> <span class="space5"></span> <img style="cursor:pointer;" src="/images/hdfc_logo.gif" onclick="viewPageforLogo(\'/know-your-bank/car-loan-india/hdfc-bank.html\')"> <span class="space5"></span> <img style="cursor:pointer;" src="/images/citibank_logo.gif" onclick="viewPageforLogo(\'/know-your-bank/car-loan-india/citibank.html\')"> <span class="space5"></span> <img style="cursor:pointer;" src="/images/bank-of-baroda-small-21.gif" onclick="viewPageforLogo(\'/know-your-bank/bob.html\')">';}}
if(document.getElementById('csaImg1')){document.getElementById('csaImg1').innerHTML='<img style="cursor:pointer;" src="/images/icici_logo.gif" height="25px" onclick="viewPageforLogo(\'/know-your-bank/personal-loan-india/icici.html\')">';document.getElementById('csaImg2').innerHTML='<img style="cursor:pointer;" src="/images/axis_bank_logo.gif" height="25px" onclick="viewPageforLogo(\'/know-your-bank/car-loan-india/axis-bank-(uti).html\')">';document.getElementById('csaImg3').innerHTML='<img style="cursor:pointer;" src="/images/hdfc_logo.gif" height="25px" onclick="viewPageforLogo(\'/know-your-bank/car-loan-india/hdfc-bank.html\')">';}}
if(loanValue=="loan-against-property-india"||loanValue=="business-loan-india")
{if(imageArray&&imageArray!=undefined&&imageArray.length!=0)
{if(imageUrl[12]!="undefined"||imageUrl[12]!=null)
{str=imageUrl[12];imageArray.splice(0,imageArray.length);for(var j=0;j<prodArr[12].length;j++)
{imageArray[j]=prodArr[12][j];}}
else
{str='<img style="cursor:pointer;" src="/images/hdfc_logo.gif" onclick="viewPageforLogo(\'/know-your-bank/hdfc-bank.html\')"> <span class="space5"></span> <img style="cursor:pointer;" src="/images/bank-of-baroda-small-21.gif" onclick="viewPageforLogo(\'/know-your-bank/bob.html\')"> <span class="space5"></span> <img style="cursor:pointer;" src="/images/axis_bank_logo.gif" onclick="viewPageforLogo(\'/know-your-bank/axis-bank-(uti).html\')"> <span class="space5"></span> <img style="cursor:pointer;" src="/images/lic-housing-finance-small-15.gif" onclick="viewPageforLogo(\'/know-your-bank/lic-hf.html\')"> <span class="space5"></span> <img style="cursor:pointer;" src="/images/icici_logo.gif" onclick="viewPageforLogo(\'/know-your-bank/icici.html\')">';}}
if(document.getElementById('csaImg1')){document.getElementById('csaImg1').innerHTML='<img style="cursor:pointer;" src="/images/hdfc_logo.gif" height="25px" onclick="viewPageforLogo(\'/know-your-bank/hdfc-bank.html\')">';document.getElementById('csaImg2').innerHTML='<img style="cursor:pointer;" src="/images/bank-of-baroda-small-21.gif" height="25px" onclick="viewPageforLogo(\'/know-your-bank/bob.html\')">';document.getElementById('csaImg3').innerHTML='<img style="cursor:pointer;" src="/images/axis_bank_logo.gif" height="25px" onclick="viewPageforLogo(\'/know-your-bank/axis-bank-(uti).html\')">';}}
if(loanValue=="education-loan-india")
{if(imageArray&&imageArray!=undefined&&imageArray.length!=0)
{if(imageUrl[5]!="undefined"&&imageUrl[5]!=null&&imageUrl[5]!="<ul></ul>")
{str=imageUrl[5];imageArray.splice(0,imageArray.length);for(var j=0;j<prodArr[5].length;j++)
{imageArray[j]=prodArr[5][j];}}
else
{imageArray.splice(0,imageArray.length);str='<ul><li style="list-style-type:none;list-style-image:none;display:inline;white-space:nowrap;"><img style="cursor:pointer;height:30px;width:105px" src="/images/idbi_logo.gif" onclick="viewPageforLogo(\'/know-your-bank/education-loan-india/idbi-bank.html\')"></li><span class="space5"></span><li style="list-style-type:none;list-style-image:none;display:inline;white-space:nowrap;"><img style="cursor:pointer;height:30px;width:105px" src="/images/bank-of-baroda-small-21.gif" onclick="viewPageforLogo(\'/know-your-bank/bob.html\')"></li><span class="space5"></span><li style="list-style-type:none;list-style-image:none;display:inline;white-space:nowrap;"><img style="cursor:pointer;height:30px;width:105px" src="/images/punjab_national_logo.gif" onclick="viewPageforLogo(\'/know-your-bank/punjab-national-bank.html\')"></li><span class="space5"></span><li style="list-style-type:none;list-style-image:none;display:inline;white-space:nowrap;"><img style="cursor:pointer;height:30px;width:105px" src="/images/union-bank-of-india-small-18.gif" onclick="viewPageforLogo(\'/know-your-bank/education-loan-india/union-bank-of-india.html\')"></li><span class="space5"></span><li style="list-style-type:none;list-style-image:none;display:inline;white-space:nowrap;"><img style="cursor:pointer;height:30px;width:105px" src="/images/Bank-of-India.gif" onclick="viewPageforLogo(\'/know-your-bank/boi.html\')"></li></ul>';}}
if(document.getElementById('csaImg1')){document.getElementById('csaImg1').innerHTML='<img style="cursor:pointer;" src="/images/idbi_logo.gif" height="25px" onclick="viewPageforLogo(\'/know-your-bank/idbi-bank.html\')">';document.getElementById('csaImg2').innerHTML='<img style="cursor:pointer;" src="/images/bank-of-baroda-small-21.gif" height="25px" height="25px" onclick="viewPageforLogo(\'/know-your-bank/bob.html\')">';document.getElementById('csaImg3').innerHTML='<img style="cursor:pointer;" src="/images/punjab_national_logo.gif" height="25px" onclick="viewPageforLogo(\'/know-your-bank/punjab-national-bank.html\')">';}}
if(loanValue=="credit-card-india")
{if(imageArray&&imageArray!=undefined&&imageArray.length!=0)
{if(imageUrl[5]!="undefined"&&imageUrl[5]!=null&&imageUrl[5]!="<ul></ul>")
{str=imageUrl[3];imageArray.splice(0,imageArray.length);for(var j=0;j<prodArr[3].length;j++)
{imageArray[j]=prodArr[3][j];}}
else
{imageArray.splice(0,imageArray.length);str='<ul><li style="list-style-type:none;list-style-image:none;display:inline;white-space:nowrap;"><img style="cursor:pointer;height:30px;width:105px" src="/images/icici_logo.gif" onclick="viewPageforLogo(\'/know-your-bank/credit-card-india/icici.html\')"></li><span class="space5"></span><li style="list-style-type:none;list-style-image:none;display:inline;white-space:nowrap;"><img style="cursor:pointer;height:30px;width:105px" src="/images/hdfc_logo.gif" onclick="viewPageforLogo(\'/know-your-bank/credit-card-india/hdfc-bank.html\')"></li><span class="space5"></span><li style="list-style-type:none;list-style-image:none;display:inline;white-space:nowrap;"> <img style="cursor:pointer;height:30px;width:105px" src="/images/axis_bank_logo.gif" onclick="viewPageforLogo(\'/know-your-bank/credit-card-india/axis-bank-(uti).html.html\')"></li> <span class="space5"></span><li style="list-style-type:none;list-style-image:none;display:inline;white-space:nowrap;"><img style="cursor:pointer;height:30px;width:105px" src="/images/citibank_logo.gif" onclick="viewPageforLogo(\'/know-your-bank/credit-card-india/citi.html\')"></li> <span class="space5"></span><li style="list-style-type:none;list-style-image:none;display:inline;white-space:nowrap;" <img style="cursor:pointer;height:30px;width:105px" src="/images/hsbc.gif" onclick="viewPageforLogo(\'/know-your-bank/credit-card-india/hsbc.html\')"></li>';}}
if(document.getElementById('csaImg1')){document.getElementById('csaImg1').innerHTML='<img style="cursor:pointer;" src="/images/icici_logo.gif" height="25px" onclick="viewPageforLogo(\'/know-your-bank/credit-card-india/icici.html\')">';document.getElementById('csaImg2').innerHTML='<img style="cursor:pointer;" src="/images/hdfc_logo.gif" height="25px" onclick="viewPageforLogo(\'/know-your-bank/credit-card-india/hdfc-bank.html\')">';document.getElementById('csaImg3').innerHTML='<img style="cursor:pointer;" src="/images/axis_bank_logo.gif" height="25px" onclick="viewPageforLogo(\'/know-your-bank/credit-card-india/axis-bank-(uti).html\')">';}}
if(loanValue=="health-insurance-india")
{if(imageArray&&imageArray!=undefined&&imageArray.length!=0)
{if(imageUrl[8]!="undefined"||imageUrl[8]!=null)
{str=imageUrl[8];imageArray.splice(0,imageArray.length);for(var j=0;j<prodArr[8].length;j++)
{imageArray[j]=prodArr[8][j];}}
else
{str=str+'<img style="cursor:pointer;padding-left:55px"" src="/images/NewIndia-logo-S.gif" onclick="viewPageforLogo(\'/kyi/the-new-india-assurance-14.html\')"> <span class="space5"></span> <img style="cursor:pointer;" src="/images/UnitedIndia-S.gif" onclick="viewPageforLogo(\'/kyi/united-india-insurance-12.html\')"> <span class="space5"></span> <img style="cursor:pointer;" src="/images/National-Insurance-S.gif" onclick="viewPageforLogo(\'/kyi/national-insurance-7.html\')"> <span class="space5"></span> <img style="cursor:pointer;" src="/images/ICICI-S.gif" onclick="viewPageforLogo(\'/kyi/icici-lombard-general-insurance-5.html\')"> ';}}
if(document.getElementById('csaImg1'))
{document.getElementById('csaImg1').innerHTML='<img style="cursor:pointer;" src="/images/NewIndia-logo-S.gif" height="25px" onclick="viewPageforLogo(\'/kyi/the-new-india-assurance-14.html\')">';document.getElementById('csaImg2').innerHTML='<img style="cursor:pointer;" src="/images/UnitedIndia-S.gif" height="25px" onclick="viewPageforLogo(\'/kyi/united-india-insurance-12.html\')">';document.getElementById('csaImg3').innerHTML='<img style="cursor:pointer;" src="/images/National-Insurance-S.gif" height="25px" onclick="viewPageforLogo(\'/kyi/national-insurance-7.html\')">';}}
if(loanValue=="term-insurance-india")
{if(imageArray&&imageArray!=undefined&&imageArray.length!=0)
{if(imageUrl[7]!="undefined"||imageUrl[7]!=null)
{str=imageUrl[7];imageArray.splice(0,imageArray.length);for(var j=0;j<prodArr[7].length;j++)
{imageArray[j]=prodArr[7][j];}}
else
{str=str+'<img style="cursor:pointer;padding-left:55px"" src="/images/ICICI-prodential.gif" onclick="viewPageforLogo(\'/kyi/icici-prudential-life-insurance-24.html\')"> <span class="space5"></span> <img style="cursor:pointer;" src="/images/Kotak.gif" onclick="viewPageforLogo(\'/kyi/kotak-mahindra-old-mutual-life-insurance-18.html\')"> <span class="space5"></span> <img style="cursor:pointer;" src="/images/LIC.gif" onclick="viewPageforLogo(\'/kyi/life-insurance-corporation-of-india-20.html\')"> <span class="space5"></span> <img style="cursor:pointer;" src="/images/Reliance.gif" onclick="viewPageforLogo(\'/kyi/reliance-life-insurance-19.html\')"> ';}}
if(document.getElementById('csaImg1'))
{document.getElementById('csaImg1').innerHTML='<img style="cursor:pointer;" src="/images/ICICI-prodential.gif" height="25px" onclick="viewPageforLogo(\'/kyi/icici-prudential-life-insurance-24.html\')">';document.getElementById('csaImg2').innerHTML='<img style="cursor:pointer;" src="/images/Kotak.gif" height="25px" onclick="viewPageforLogo(\'/kyi/kotak-mahindra-old-mutual-life-insurance-18.html\')">';document.getElementById('csaImg3').innerHTML='<img style="cursor:pointer;" src="/images/LIC.gif" height="25px" onclick="viewPageforLogo(\'/kyi/life-insurance-corporation-of-india-20.html\')">';}}
if(loanValue=="critical-illness-insurance-india")
{if(imageArray&&imageArray!=undefined&&imageArray.length!=0)
{if(imageUrl[8]!="undefined"||imageUrl[8]!=null)
{str=imageUrl[8];imageArray.splice(0,imageArray.length);for(var j=0;j<prodArr[8].length;j++)
{imageArray[j]=prodArr[8][j];}}
else
{str=str+'<img style="cursor:pointer;padding-left:55px"" src="/images/ICICI-S.gif" onclick="viewPageforLogo(\'/kyi/icici-lombard-general-insurance-5.html\')"> <span class="space5"></span> <img style="cursor:pointer;" src="/images/iffco-tokio-S.gif" onclick="viewPageforLogo(\'/kyi/iffco-tokio-general-insurance-6.html\')"> <span class="space5"></span> <img style="cursor:pointer;" src="/images/logo-BajajAllianz-S.gif" onclick="viewPageforLogo(\'/kyi/bajaj-allianz-general-insurance-2.html\')"> <span class="space5"></span> <img style="cursor:pointer;" src="/images/Star-Personal&Caring-S.gif" onclick="viewPageforLogo(\'/kyi/star-health-&-allied-insurance-11.html\')"> ';}}
if(document.getElementById('csaImg1'))
{document.getElementById('csaImg1').innerHTML='<img style="cursor:pointer;" src="/images/ICICI-S.gif" height="25px" onclick="viewPageforLogo(\'/kyi/icici-lombard-general-insurance-5.html\')">';document.getElementById('csaImg2').innerHTML='<img style="cursor:pointer;" src="/images/iffco-tokio-S.gif" height="25px" onclick="viewPageforLogo(\'/kyi/iffco-tokio-general-insurance-6.html\')">';document.getElementById('csaImg3').innerHTML='<img style="cursor:pointer;" src="/images/logo-BajajAllianz-S.gif" height="25px" onclick="viewPageforLogo(\'/kyi/bajaj-allianz-general-insurance-2.html\')">';}}
if(loanValue=="car-insurance-india")
{if(imageArray&&imageArray!=undefined&&imageArray.length!=0)
{if(imageUrl[9]!="undefined"||imageUrl[9]!=null)
{str=imageUrl[9];imageArray.splice(0,imageArray.length);for(var j=0;j<prodArr[9].length;j++)
{imageArray[j]=prodArr[9][j];}}
else
{str=str+'<img style="cursor:pointer;padding-left:55px"" src="/images/ICICI-S.gif" onclick="viewPageforLogo(\'/kyi/icici-lombard-general-insurance-5.html\')"> <span class="space5"></span> <img style="cursor:pointer;" src="/images/NewIndia-logo-S.gif" onclick="viewPageforLogo(\'/kyi/the-new-india-assurance-14.html\')"> <span class="space5"></span> <img style="cursor:pointer;" src="/images/National-Insurance-S.gif" onclick="viewPageforLogo(\'/kyi/national-insurance-7.html\')"> <span class="space5"></span> <img style="cursor:pointer;" src="/images/logo-BajajAllianz-S.gif" onclick="viewPageforLogo(\'/kyi/bajaj-allianz-general-insurance-2.html\')"> <span class="space5"></span> <img style="cursor:pointer;" src="/images/National-Insurance-S.gif" onclick="viewPageforLogo(\'/kyi/reliance-general-insurance-9.html\')"> ';}}
if(document.getElementById('csaImg1'))
{document.getElementById('csaImg1').innerHTML='<img style="cursor:pointer;" src="/images/ICICI-S.gif" height="25px" onclick="viewPageforLogo(\'/kyi/icici-lombard-general-insurance-5.html\')">';document.getElementById('csaImg2').innerHTML='<img style="cursor:pointer;" src="/images/NewIndia-logo-S.gif" height="25px" onclick="viewPageforLogo(\'/kyi/the-new-india-assurance-14.html\')">';document.getElementById('csaImg3').innerHTML='<img style="cursor:pointer;" src="/images/National-Insurance-S.gif" height="25px" onclick="viewPageforLogo(\'/kyi/national-insurance-7.html\')">';}}
if(loanValue=="hospital-cash-plans")
{if(imageArray&&imageArray!=undefined&&imageArray.length!=0)
{if(imageUrl[8]!="undefined"||imageUrl[8]!=null)
{str=imageUrl[8];imageArray.splice(0,imageArray.length);for(var j=0;j<prodArr[8].length;j++)
{imageArray[j]=prodArr[8][j];}}
else
{str=str+'<img style="cursor:pointer;padding-left:55px"" src="/images/TATA-AIG-S.gif" onclick="viewPageforLogo(\'/kyi/tata-aig-general-insurance-35.html\')"> <span class="space5"></span> <img style="cursor:pointer;" src="/images/royal-sundaram-s.gif" onclick="viewPageforLogo(\'/kyi/royal-sundaram-alliance-insurance-10.html\')"> <span class="space5"></span> <img style="cursor:pointer;" src="/images/logo-BajajAllianz-S.gif" onclick="viewPageforLogo(\'/kyi/bajaj-allianz-general-insurance-2.html\')"> <span class="space5"></span> <img style="cursor:pointer;" src="/images/NewIndia-logo-S.gif" onclick="viewPageforLogo(\'/kyi/the-new-india-assurance-14.html\')"> <span class="space5"></span> <img style="cursor:pointer;" src="/images/National-Insurance-S.gif" onclick="viewPageforLogo(\'/kyi/national-insurance-7.html\')"> ';}}
if(document.getElementById('csaImg1'))
{document.getElementById('csaImg1').innerHTML='<img style="cursor:pointer;" src="/images/TATA-AIG-S.gif" height="25px" onclick="viewPageforLogo(\'/kyi/tata-aig-general-insurance-35.html\')">';document.getElementById('csaImg2').innerHTML='<img style="cursor:pointer;" src="/images/royal-sundaram-s.gif" height="25px" onclick="viewPageforLogo(\'/kyi/royal-sundaram-alliance-insurance-10.html\')">';document.getElementById('csaImg3').innerHTML='<img style="cursor:pointer;" src="/images/logo-BajajAllianz-S.gif" height="25px" onclick="viewPageforLogo(\'/kyi/bajaj-allianz-general-insurance-2.html\')">';}}
if(loanValue=="childrens-plans-plans")
{if(imageArray&&imageArray!=undefined&&imageArray.length!=0)
{if(imageUrl[8]!="undefined"||imageUrl[8]!=null)
{str=imageUrl[8];imageArray.splice(0,imageArray.length);for(var j=0;j<prodArr[8].length;j++)
{imageArray[j]=prodArr[8][j];}}
else
{str=str+'<img style="cursor:pointer;padding-left:55px"" src="/images/TATA-AIG-S.gif" onclick="viewPageforLogo(\'/kyi/tata-aig-general-insurance-35.html\')"> <span class="space5"></span> <img style="cursor:pointer;" src="/images/royal-sundaram-s.gif" onclick="viewPageforLogo(\'/kyi/royal-sundaram-alliance-insurance-10.html\')"> <span class="space5"></span> <img style="cursor:pointer;" src="/images/logo-BajajAllianz-S.gif" onclick="viewPageforLogo(\'/kyi/bajaj-allianz-general-insurance-2.html\')"> <span class="space5"></span> <img style="cursor:pointer;" src="/images/NewIndia-logo-S.gif" onclick="viewPageforLogo(\'/kyi/the-new-india-assurance-14.html\')"> <span class="space5"></span> <img style="cursor:pointer;" src="/images/National-Insurance-S.gif" onclick="viewPageforLogo(\'/kyi/national-insurance-7.html\')"> ';}}
if(document.getElementById('csaImg1'))
{document.getElementById('csaImg1').innerHTML='<img style="cursor:pointer;" src="/images/TATA-AIG-S.gif" height="25px" onclick="viewPageforLogo(\'/kyi/tata-aig-general-insurance-35.html\')">';document.getElementById('csaImg2').innerHTML='<img style="cursor:pointer;" src="/images/royal-sundaram-s.gif" height="25px" onclick="viewPageforLogo(\'/kyi/royal-sundaram-alliance-insurance-10.html\')">';document.getElementById('csaImg3').innerHTML='<img style="cursor:pointer;" src="/images/logo-BajajAllianz-S.gif" height="25px" onclick="viewPageforLogo(\'/kyi/bajaj-allianz-general-insurance-2.html\')">';}}
if(loanValue=="pension-plans-plans")
{if(imageArray&&imageArray!=undefined&&imageArray.length!=0)
{if(imageUrl[8]!="undefined"||imageUrl[8]!=null)
{str=imageUrl[8];imageArray.splice(0,imageArray.length);for(var j=0;j<prodArr[8].length;j++)
{imageArray[j]=prodArr[8][j];}}
else
{str=str+'<img style="cursor:pointer;padding-left:55px"" src="/images/TATA-AIG-S.gif" onclick="viewPageforLogo(\'/kyi/tata-aig-general-insurance-35.html\')"> <span class="space5"></span> <img style="cursor:pointer;" src="/images/royal-sundaram-s.gif" onclick="viewPageforLogo(\'/kyi/royal-sundaram-alliance-insurance-10.html\')"> <span class="space5"></span> <img style="cursor:pointer;" src="/images/logo-BajajAllianz-S.gif" onclick="viewPageforLogo(\'/kyi/bajaj-allianz-general-insurance-2.html\')"> <span class="space5"></span> <img style="cursor:pointer;" src="/images/NewIndia-logo-S.gif" onclick="viewPageforLogo(\'/kyi/the-new-india-assurance-14.html\')"> <span class="space5"></span> <img style="cursor:pointer;" src="/images/National-Insurance-S.gif" onclick="viewPageforLogo(\'/kyi/national-insurance-7.html\')"> ';}}
if(document.getElementById('csaImg1'))
{document.getElementById('csaImg1').innerHTML='<img style="cursor:pointer;" src="/images/TATA-AIG-S.gif" height="25px" onclick="viewPageforLogo(\'/kyi/tata-aig-general-insurance-35.html\')">';document.getElementById('csaImg2').innerHTML='<img style="cursor:pointer;" src="/images/royal-sundaram-s.gif" height="25px" onclick="viewPageforLogo(\'/kyi/royal-sundaram-alliance-insurance-10.html\')">';document.getElementById('csaImg3').innerHTML='<img style="cursor:pointer;" src="/images/logo-BajajAllianz-S.gif" height="25px" onclick="viewPageforLogo(\'/kyi/bajaj-allianz-general-insurance-2.html\')">';}}
if(document.getElementById("images")&&str!='')
{document.getElementById("images").innerHTML=str;}
compareDisplayPage(document.getElementById('typeOfLoan').value,'','Rates');}
function checkCheckboxSelect(str)
{var i;var checkbox_choices=0;var length=document.getElementById(str).elements.length;for(i=0;i<length;i++)
{var type1=document.getElementById(str).elements[i].type;if(type1=="checkbox")
{if(document.getElementById(str).elements[i].checked)
{checkbox_choices=checkbox_choices+1;}}}
if(document.getElementById('selectAllBank').checked)
{checkbox_choices=checkbox_choices-1;}
if(checkbox_choices<2||checkbox_choices>3)
{flagS='true';}
else
{flagS='false';}}
function checkCompareBanks(str)
{var msg;checkCheckboxSelect(str);if(flagS=='true')
{msg="You can select minimum 2 banks and maximum 3 banks.\n";alert(msg);return false;}
return true;}
function dynamicSubmit(basePath,method,formId)
{if(document.getElementById('cityId')&&document.getElementById('cityId').value=='0')
{alert('Please select the city');return false;}
if(document.getElementById('bankId')&&document.getElementById('bankId').value=='0')
{alert('Please select a brand');return false;}
document.getElementById(formId).method=method;document.getElementById(formId).action=basePath.replace(" ","_");document.getElementById(formId).submit();return false;}
function dynamicSubmitForIFrame(basePath,method,formId)
{parent.document.getElementById(formId).method=method;parent.document.getElementById(formId).action=basePath;parent.document.getElementById(formId).submit();}
function chkAllBank(str,formId)
{var checkAll=document.getElementById(str);var length;var type;var flagS;var i;if(checkAll.checked)
{length=document.getElementById(formId).elements.length;for(i=0;i<length;i++)
{type=document.getElementById(formId).elements[i].type;if(type=="checkbox")
{document.getElementById(formId).elements[i].checked=true;flagS='false';}}}
else
{length=document.getElementById(formId).elements.length;for(i=0;i<length;i++)
{type=document.getElementById(formId).elements[i].type;if(type=="checkbox")
{document.getElementById(formId).elements[i].checked=false;flagS='true';}}}}
function unSelectAll(str)
{document.getElementById(str).checked=false;}
function setBankId(entryIndex,flag)
{if(flag==2)
{parent.document.getElementById("bankProductId").value=parent.document.getElementById("checkbox"+entryIndex).value;}
if(flag==3)
{document.getElementById("bankProductId").value=entryIndex;}
return true;}
function checkcheckboxCompare()
{var checkbox_choices=0;var length=document.frmComparatorBank.elements.length;for(i=0;i<length;i++)
{var type1=document.frmComparatorBank.elements[i].type;if(type1=="checkbox")
{if(document.frmComparatorBank.elements[i].checked&&document.frmComparatorBank.elements[i].id!='t&c'&&document.frmComparatorBank.elements[i].id!='t&c1'&&document.frmComparatorBank.elements[i].id!='apnaExchangePolicy')
{checkbox_choices=checkbox_choices+1;}}}
if(checkbox_choices==0||checkbox_choices>2)
{flagS='true';}
else
{flagS='false';}}
function checkBanksforComparison()
{var msg;checkcheckboxCompare();if(flagS=='true')
{msg="You can select minimum 1 bank and maximum 2 banks to compare.\n";alert(msg);return false;}
var mainOffering=document.getElementById("mainOffering").value;var length=document.frmComparatorBank.elements.length;for(i=0;i<length;i++)
{var type1=document.frmComparatorBank.elements[i].type;if(type1=="checkbox")
{if(document.frmComparatorBank.elements[i].checked)
{mainOffering+='-'+document.frmComparatorBank.elements[i].value.replace(" ","_");}}}
var apnaExchangePolicyElem=document.getElementById("apnaExchangePolicy");var apnaExchangeCheckBoxValueElem=document.getElementById("apnaExchangeCheckBoxValue");if(apnaExchangePolicyElem&&apnaExchangePolicyElem.checked)
{apnaExchangeCheckBoxValueElem.value="checked";apnaExchangePolicyElem.value="Y";}
else
{apnaExchangeCheckBoxValueElem.value="unchecked";}
document.getElementById("url").value=mainOffering.replace(" ","_");return true;}
function checkPoliciesforComparison()
{var msg;checkcheckboxCompare();if(flagS=='true')
{msg="You can select minimum 1 policy and maximum 2 policies to compare.\n";alert(msg);return false;}
var mainOffering=document.getElementById("mainOffering").value;var length=document.frmComparatorBank.elements.length;for(i=0;i<length;i++)
{var type1=document.frmComparatorBank.elements[i].type;if(type1=="checkbox")
{if(document.frmComparatorBank.elements[i].checked)
{mainOffering+='-'+document.frmComparatorBank.elements[i].value.replace(" ","_");}}}
var apnaExchangePolicyElem=document.getElementById("apnaExchangePolicy");var apnaExchangeCheckBoxValueElem=document.getElementById("apnaExchangeCheckBoxValue");if(apnaExchangePolicyElem&&apnaExchangePolicyElem.checked)
{apnaExchangeCheckBoxValueElem.value="checked";apnaExchangePolicyElem.value="Y";}
else
{apnaExchangeCheckBoxValueElem.value="unchecked";}
document.getElementById("url").value=mainOffering.replace(" ","_");return true;}
function setBrandPreferences(prodId)
{var str;var url="";document.getElementById("productId").value=prodId;str='<select id="bankId" name="bankId" style="width: 120px;"><option value="0">Select Brand</option>';if(prodId==1)
{for(i=0;i<hlArray.length;i++)
{str=str+'<option value="'+hlArray[i]['bankId']+'" selected>'+hlArray[i]['bankName']+'</option>';}}
else if(prodId==2)
{for(i=0;i<plArray.length;i++)
{str=str+'<option value="'+plArray[i]['bankId']+'" selected>'+plArray[i]['bankName']+'</option>';}}
else if(prodId==4)
{for(i=0;i<clArray.length;i++)
{str=str+'<option value="'+clArray[i]['bankId']+'" selected>'+clArray[i]['bankName']+'</option>';}}
else if(prodId==12)
{for(i=0;i<lapArray.length;i++)
{str=str+'<option value="'+lapArray[i]['bankId']+'" selected>'+lapArray[i]['bankName']+'</option>';}}
else if(prodId==5)
{for(i=0;i<elArray.length;i++)
{str=str+'<option value="'+elArray[i]['bankId']+'" selected>'+elArray[i]['bankName']+'</option>';}}
else if(prodId==3)
{for(i=0;i<ccArray.length;i++)
{sstr=str+'<option value="'+ccArray[i]['bankId']+'" selected>'+ccArray[i]['bankName']+'</option>';}}
str=str+'</select>'
document.getElementById("brandPref").innerHTML=str;(prodId==1)?url='home-loan-india':(prodId==2)?url='personal-loan-india':(prodId==4)?url='car-loan-india':(prodId==12)?url='loan-against-property-india':(prodId==5)?url='education-loan-india':url='credit-card-india';location.href="/"+url+"/search.html";}
function validateHomeLoanComparator()
{var userLoanAmt=document.getElementById("loanAmt");var userTenureMonths=document.getElementById("tenureMonths");var userAge=document.getElementById("age");var userOfferingTypeId=document.getElementById("offeringTypeId");var userTenure=document.getElementById("tenure");var userOccupation=document.getElementById("occupation");var userMonthlyIncome=document.getElementById("monthlyIncome");if(userLoanAmt.value=="")
{alert("Please enter Loan Amount");userLoanAmt.focus();return false;}
var i=userLoanAmt.value.replace(/,/g,"");if(isNaN(i))
{alert("Please enter number only in Loan Amount");userLoanAmt.value="";userLoanAmt.focus();return false;}
if(userOfferingTypeId.value=="20")
{if(userTenureMonths.value=="")
{alert("Please enter Tenure in months");userTenureMonths.focus();return false;}
var i=userTenureMonths.value.replace(/,/g,"");if(isNaN(i))
{alert("Please enter number only in Tenure in months");userTenureMonths.value="";userTenureMonths.focus();return false;}
if(userAge.value=="0")
{alert("Please select age");userAge.focus();return false;}}
else
{if(userAge.value=="0")
{alert("Please select age");userAge.focus();return false;}
if(userTenure.value=="0")
{alert("Please select loan tenure");userTenure.focus();return false;}}
if((!document.getElementById("fixed").checked)&&(!document.getElementById("floating").checked)&&(!document.getElementById("both").checked))
{alert("Please select interest type");document.getElementById("fixed").focus();return false;}
if(userOccupation.value=="0")
{alert("Please select Employment Type");userOccupation.focus();return false;}
if(userOfferingTypeId.value=="20")
{var j=userMonthlyIncome.value.replace(/,/g,"");if(userMonthlyIncome.value=="")
{alert("Please enter Monthly Income");userMonthlyIncome.focus();return false;}
if(isNaN(j))
{alert("Please enter number only in Monthly Income");userMonthlyIncome.value="";document.getElementById("monthlyIncome").focus();return false;}
document.getElementById("monthlyIncome").value=document.getElementById("monthlyIncome").value.replace(/,/g,"");if(Math.round(parseInt(document.getElementById("tenureMonths").value)/12)==0)
{document.getElementById("tenure").value=1;}
else
{document.getElementById("tenure").value=Math.round(parseInt(document.getElementById("tenureMonths").value)/12);}}
else
{var j=document.getElementById("monthlyIncomeSingle").value.replace(/,/g,"");if(document.getElementById("monthlyIncomeSingle").value=="")
{alert("Please enter Monthly Income");document.getElementById("monthlyIncomeSingle").focus();return false;}
if(isNaN(j))
{alert("Please enter number only in Monthly Income");document.getElementById("monthlyIncomeSingle").value="";document.getElementById("monthlyIncomeSingle").focus();return false;}
if((!document.getElementById("coAppYes").checked)&&(!document.getElementById("coAppNo").checked))
{alert("Please select Co-Applicant option");document.getElementById("coAppYes").focus();return false;}
if((document.getElementById("coAppYes").checked))
{if(document.getElementById("coAppMonthlyIncome").value=="")
{alert("Please select Co-Applicant Monthly Income");document.getElementById("coAppMonthlyIncome").focus();return false;}
var k=document.getElementById("coAppMonthlyIncome").value.replace(/,/g,"");if(isNaN(k))
{alert("Please enter number only in Co-Applicant Monthly Income");document.getElementById("coAppMonthlyIncome").value="";document.getElementById("coAppMonthlyIncome").focus();return false;}
document.getElementById("monthlyIncomeSingle").value=document.getElementById("monthlyIncomeSingle").value.replace(/,/g,"");document.getElementById("coAppMonthlyIncome").value=document.getElementById("coAppMonthlyIncome").value.replace(/,/g,"");document.getElementById("monthlyIncome").value=parseInt(document.getElementById("monthlyIncomeSingle").value)+parseInt(document.getElementById("coAppMonthlyIncome").value);}
else
{document.getElementById("monthlyIncomeSingle").value=document.getElementById("monthlyIncomeSingle").value.replace(/,/g,"");document.getElementById("coAppMonthlyIncome").value="";document.getElementById("monthlyIncome").value=parseInt(document.getElementById("monthlyIncomeSingle").value);}}
var cityElement=document.getElementById("frmComparatorSearch").city;var cityTextBoxElement=document.getElementById("frmComparatorSearch").cityTextBox;if(cityElement.value=="0")
{alert("Please select city");cityTextBoxElement.focus();return false;}
var apnaExchangePolicyElem=document.getElementById("apnaExchangePolicy");var apnaExchangeCheckBoxValueElem=document.getElementById("apnaExchangeCheckBoxValue");if(apnaExchangePolicyElem&&apnaExchangePolicyElem.checked)
{apnaExchangeCheckBoxValueElem.value="checked";apnaExchangePolicyElem.value="Y";}
else
{apnaExchangeCheckBoxValueElem.value="unchecked";}
document.getElementById("loanAmt").value=document.getElementById("loanAmt").value.replace(/,/g,"");document.getElementById("cityId").value=document.getElementById("city").value;document.getElementById("pleaseWaitUrl").value='/home-loan-india/compare/'+(cityTextBoxElement.value).toLowerCase()+'.html';return true;}
function calculateTenureforHomeLoan(maxAge,age,maxTenure,minTenure,loanTenure)
{var i;var calTenure;var str;var flag=false;if(age!=0)
{calTenure=maxAge-age;if(calTenure<=maxTenure&&calTenure>=minTenure)
{str='<div class="leftfloat tspace5" id="loanTenureDiv" style="display:block;width:153px"><span style="color:#FF0000;font-weight:bold;">*</span>Loan Tenure :<span class="space5"></span></div>';str=str+'<p><select name="tenure" id="tenure" style="width:105px;" onchange="calculateTenureforHomeLoan(maxAge.value,age.value,maxTenure.value,minTenure.value,tenure.value);"><option value=0>-Tenure-</option>';for(i=parseInt(minTenure);i<=parseInt(calTenure);i++)
{str=str+"<option value="+i+">"+i+(i==1?" year":" years")+"</option>"+"\n";}
str=str+'</select></p>';document.getElementById('Agelist').innerHTML=str;}
else if(calTenure<minTenure)
{alert("No tenure available for given Age");str='<div class="leftfloat tspace5" id="loanTenureDiv" style="display:block;width:153px"><span style="color:#FF0000;font-weight:bold;">*</span>Loan Tenure :<span class="space5"></span></div>';str=str+'<p><select name="tenure" id="tenure" style="width:105px;"><option value=0>-Tenure-</option></select></p>';document.getElementById('Agelist').innerHTML=str;flag=true;}
else
{str='<div class="leftfloat tspace5" id="loanTenureDiv" style="display:block;width:153px"><span style="color:#FF0000;font-weight:bold;">*</span>Loan Tenure :<span class="space5"></span></div>';str=str+'<p><select name="tenure" id="tenure" style="width:105px;" onchange="calculateTenureforHomeLoan(maxAge.value,age.value,maxTenure.value,minTenure.value,tenure.value);"><option value=0>-Tenure-</option>';for(i=parseInt(minTenure);i<=parseInt(maxTenure);i++)
{str=str+"<option value="+i+">"+i+(i==1?" year":" years")+"</option>"+"\n";}
str=str+'</select></p>';document.getElementById('Agelist').innerHTML=str;}}
i=document.getElementById('tenure').options.length;while(i=i-1)
{if(document.getElementById('tenure').options[i].value==loanTenure)
{document.getElementById('tenure').options[i].selected=true;flag=true;break;}}
if(loanTenure!=0&&(!flag))
{alert('Please select tenure');}}
function showCoAppList(str)
{document.getElementById('coApplicantList').style.display=str;}
function showHlEmiBreakup(data)
{var loanAmt=data.split("##")[0];var tenure=data.split("##")[1];var rate1=data.split("##")[2];var rate2=data.split("##")[3];var intAmt=0;var totAmt=0;var percent=0;var interestPerMonth,interestFraction;document.getElementById("emiPopupTenure").innerHTML=tenure;if(rate1!=rate2)
{interestPerMonth=parseFloat(rate1)/12;interestFraction=interestPerMonth/100;var emi1=(loanAmt*interestFraction)/(1-(1/Math.pow(1+interestFraction,tenure*12)));intAmt=Math.round((emi1*12*tenure)-parseInt(loanAmt));totAmt=intAmt+parseInt(loanAmt);percent=(parseInt(loanAmt)*100)/parseInt(totAmt);document.getElementById("principalAmt1").value=CommaFormatted(loanAmt.toString());document.getElementById("interestAmt1").value=CommaFormatted(intAmt.toString());document.getElementById("totalAmt1").value=CommaFormatted(totAmt.toString());document.getElementById("prinCompImg1").width=Math.round(percent)+'%';document.getElementById("prinCompText1").width=Math.round(percent)+'%';document.getElementById("prinCompSpan1").innerHTML=Math.round(percent)+'%';document.getElementById("intCompImg1").width=100-Math.round(percent)+'%';document.getElementById("intCompText1").width=100-Math.round(percent)+'%';document.getElementById("intCompSpan1").innerHTML=100-Math.round(percent)+'%';document.getElementById("interestRate1").innerHTML='EMI Breakup for '+rate1+'%';interestPerMonth=parseFloat(rate2)/12;interestFraction=interestPerMonth/100;var emi2=(loanAmt*interestFraction)/(1-(1/Math.pow(1+interestFraction,tenure*12)));intAmt=Math.round((emi2*12*tenure)-parseInt(loanAmt));totAmt=intAmt+parseInt(loanAmt);percent=(parseInt(loanAmt)*100)/parseInt(totAmt);document.getElementById("principalAmt2").value=CommaFormatted(loanAmt.toString());document.getElementById("interestAmt2").value=CommaFormatted(intAmt.toString());document.getElementById("totalAmt2").value=CommaFormatted(totAmt.toString());document.getElementById("prinCompImg2").width=Math.round(percent)+'%';document.getElementById("prinCompText2").width=Math.round(percent)+'%';document.getElementById("prinCompSpan2").innerHTML=Math.round(percent)+'%';document.getElementById("intCompImg2").width=100-Math.round(percent)+'%';document.getElementById("intCompText2").width=100-Math.round(percent)+'%';document.getElementById("intCompSpan2").innerHTML=100-Math.round(percent)+'%';document.getElementById("interestRate2").innerHTML='EMI Breakup for '+rate2+'%';document.getElementById("emiBreakupTable2").style.display="";document.getElementById("close1").style.display="none";}
else
{interestPerMonth=parseFloat(rate1)/12;interestFraction=interestPerMonth/100;var emi=(loanAmt*interestFraction)/(1-(1/Math.pow(1+interestFraction,tenure*12)));intAmt=Math.round((emi*12*tenure)-parseInt(loanAmt));totAmt=intAmt+parseInt(loanAmt);percent=(parseInt(loanAmt)*100)/parseInt(totAmt);document.getElementById("principalAmt1").value=CommaFormatted(loanAmt.toString());document.getElementById("interestAmt1").value=CommaFormatted(intAmt.toString());document.getElementById("totalAmt1").value=CommaFormatted(totAmt.toString());document.getElementById("prinCompImg1").width=Math.round(percent)+'%';document.getElementById("prinCompText1").width=Math.round(percent)+'%';document.getElementById("prinCompSpan1").innerHTML=Math.round(percent)+'%';document.getElementById("intCompImg1").width=100-Math.round(percent)+'%';document.getElementById("intCompText1").width=100-Math.round(percent)+'%';document.getElementById("intCompSpan1").innerHTML=100-Math.round(percent)+'%';document.getElementById("interestRate1").innerHTML='EMI Breakup for '+rate1+'%';document.getElementById("emiBreakupTable2").style.display="none";document.getElementById("close1").style.display="";}
setLeftTopOfPopup("emiBreakup");}
function hideUserOptionForHl(adjustPixels)
{var top=document.getElementById("hint_msg").style.top;top=top.replace("px","");top=parseInt(top);var searchType;if(typeof adjustPixels=="undefined")
{adjustPixels="0";}
if(document.getElementById('pageFlag').value==1)
{searchType='Refine Search';}
else
{searchType='Show Options';}
if(document.getElementById('userData').style.display!='none')
{document.getElementById('userData').style.display='none';document.getElementById('btnHideShowText').innerHTML="&#9660;&nbsp;"+searchType+"&nbsp;&nbsp;";top=top-parseInt(adjustPixels);document.getElementById("hint_msg").style.top=top+"px";}else
{document.getElementById('userData').style.display='';document.getElementById('btnHideShowText').innerHTML="&#9650;&nbsp;Hide Option&nbsp;&nbsp;";top=top+parseInt(adjustPixels);document.getElementById("hint_msg").style.top=top+"px";}}
function validateOutstandingLoanAmtPopup()
{if(document.getElementById("popLoanAmt").value=="")
{alert("Please enter Total Loan Amount");document.getElementById("popLoanAmt").focus();return false;}
var i=document.getElementById("popLoanAmt").value.replace(/,/g,"");if(isNaN(i))
{alert("Please enter number only in Total Loan Amount");document.getElementById("popLoanAmt").value="";document.getElementById("popLoanAmt").focus();return false;}
if(document.getElementById("popIntRate").value=="")
{alert("Please enter Interest Rate");document.getElementById("popIntRate").focus();return false;}
i=document.getElementById("popIntRate").value.replace(/,/g,"");if(isNaN(i))
{alert("Please enter number only in Interest Rate");document.getElementById("popIntRate").value="";document.getElementById("popIntRate").focus();return false;}
document.getElementById("popIntRate").value=Math.round(document.getElementById("popIntRate").value*Math.pow(10,2))/Math.pow(10,2);if(document.getElementById("popTenureMonths").value=="")
{alert("Please enter Tenure in months");document.getElementById("popTenureMonths").focus();return false;}
i=document.getElementById("popTenureMonths").value.replace(/,/g,"");if(isNaN(i))
{alert("Please enter number only in Tenure");document.getElementById("popTenureMonths").value="";document.getElementById("popTenureMonths").focus();return false;}
document.getElementById("popTenureMonths").value=Math.round(document.getElementById("popTenureMonths").value);if(document.getElementById("noOfInstallments").value=="")
{alert("Please enter Number of Installments Paid");document.getElementById("noOfInstallments").focus();return false;}
i=document.getElementById("noOfInstallments").value.replace(/,/g,"");if(isNaN(i))
{alert("Please enter number only in Number of Installments Paid");document.getElementById("noOfInstallments").value="";document.getElementById("noOfInstallments").focus();return false;}
document.getElementById("noOfInstallments").value=Math.round(document.getElementById("noOfInstallments").value);if(parseInt(document.getElementById("noOfInstallments").value)>parseInt(document.getElementById("popTenureMonths").value))
{alert("Please enter Number of Installments Paid less than Tenure in months");document.getElementById("noOfInstallments").value="";document.getElementById("noOfInstallments").focus();return false;}
if(parseInt(document.getElementById("noOfInstallments").value)<0||parseInt(document.getElementById("popTenureMonths").value)<0||parseInt(document.getElementById("popIntRate").value)<0||parseInt(document.getElementById("popLoanAmt").value)<0)
{alert("Please enter positive number");return false;}
var result=calclulateOutstandingLoanAmount(document.getElementById("popLoanAmt").value.replace(/,/g,""),document.getElementById("popTenureMonths").value,document.getElementById("popIntRate").value,document.getElementById("noOfInstallments").value);if(document.getElementById("popTenureMonths").value==document.getElementById("noOfInstallments").value)
{document.getElementById("loanAmt").value=0;}
else
{document.getElementById("loanAmt").value=CommaFormatted(result.split("-")[0]);}
document.getElementById("tenureMonths").value=result.split("-")[1];if(Math.round(parseInt(result.split("-")[1])/12)==0)
{document.getElementById("tenure").value=1;}
else
{document.getElementById("tenure").value=Math.round(parseInt(result.split("-")[1])/12);}
document.getElementById('outstandingLoan').style.display='none';return true;}
function calclulateOutstandingLoanAmount(loanAmt,tenure,interestRate,noOfInstallments)
{var interestPerMonth=interestRate/12;var interestFraction=interestPerMonth/100;var emi=(loanAmt*interestFraction)/(1-(1/Math.pow(1+interestFraction,tenure)));var interestRepayment,principalRepayment;for(var i=1;i<=noOfInstallments;i++)
{interestRepayment=(loanAmt*interestRate)/1200;principalRepayment=emi-interestRepayment;loanAmt=loanAmt-principalRepayment;if(loanAmt<0)
{loanAmt=0;}
tenure--;}
return parseInt(loanAmt)+"-"+tenure;}
function setLeftTopOfInfoPopupForHl(id)
{var oElement=document.getElementById(id);var width=document.getElementById(id).style.width;var height=document.getElementById(id).style.height;var x=xMousePos;var y=yMousePos;oElement.style.left=x;oElement.style.top=y+60;oElement.style.display='inline';}
function showEffectiveRateBreakup(loanAmt,tenure,range,irr)
{var str1='<table cellspacing="1" cellpadding="1" border="0" width="487" style="background-color:#db8287;font-size:9px;"><tbody><tr>';var str2='<table cellspacing="1" cellpadding="1" border="0" width="487" style="background-color:#cccccc;font-size:9px;"><tbody><tr><td height="24" bgcolor="#ebebeb" align="center" width="60"><strong>Years</strong></td><td bgcolor="#ebebeb" align="center" width="74"><strong>Interest Rate<br/>(% p.a.)</strong></td><td bgcolor="#ebebeb" align="center" width="94"><strong>EMI <br/>(Rs. Per Month)</strong></td><td bgcolor="#ebebeb" align="center" width="70"><strong>Principal Paid<br/>(Rs.)</strong></td><td bgcolor="#ebebeb" align="center" width="66"><strong>Interest Paid<br/>(Rs.)</strong></td><td bgcolor="#ebebeb" align="center" width="104"><strong>Outstanding<br/>Principal<br/>(Rs.)</strong></td></tr>';var tenureSplit;var intRateSplit;var emi,interestRepaymentYearly=0,principalRepaymentYearly=0;var count=0;var outstandingAmt=loanAmt;var originalTenure=tenure;var rangeSplit=range.split(";");for(var i=0;i<rangeSplit.length;i++)
{intRateSplit=rangeSplit[i].split("=");if(intRateSplit[0].search("-")>-1)
{tenureSplit=intRateSplit[0].split("-");if(i!=0)
{tenure=originalTenure-parseInt(tenureSplit[0])+1;loanAmt=outstandingAmt;}
for(var j=parseInt(tenureSplit[0]);j<=parseInt(tenureSplit[1]);j++)
{var interestPerMonth=parseFloat(intRateSplit[1])/12;var interestFraction=interestPerMonth/100;emi=(loanAmt*interestFraction)/(1-(1/Math.pow(1+interestFraction,tenure*12)));interestRepaymentYearly=0;principalRepaymentYearly=0;for(var k=0;k<12;k++)
{var interestRepayment=(outstandingAmt*intRateSplit[1])/1200;var principalRepayment=emi-interestRepayment;outstandingAmt=outstandingAmt-principalRepayment;interestRepaymentYearly=interestRepaymentYearly+interestRepayment;principalRepaymentYearly=principalRepaymentYearly+principalRepayment;}
count++;if(outstandingAmt<0||count==originalTenure)
{outstandingAmt=0;}
str2=str2+'<tr><td height="24" bgcolor="#f5f5f5" align="center">'+count+'</td><td bgcolor="#f5f5f5" align="center">'+intRateSplit[1]+'</td><td bgcolor="#f5f5f5" align="center">'+CommaFormatted(Math.round(emi).toString())+'</td><td bgcolor="#f5f5f5" align="center">'+CommaFormatted(principalRepaymentYearly.toString())+'</td><td bgcolor="#f5f5f5" align="center">'+CommaFormatted(interestRepaymentYearly.toString())+'</td><td bgcolor="#f5f5f5" align="center">'+CommaFormatted(outstandingAmt.toString())+'</td></tr>';if(count==originalTenure)
{break;}}}
else
{if(i!=0)
{tenure=originalTenure-parseInt(intRateSplit[0])+1;loanAmt=outstandingAmt;}
var interestPerMonth=parseFloat(intRateSplit[1])/12;var interestFraction=interestPerMonth/100;emi=(loanAmt*interestFraction)/(1-(1/Math.pow(1+interestFraction,tenure*12)));interestRepaymentYearly=0;principalRepaymentYearly=0;for(var k=0;k<12;k++)
{var interestRepayment=(outstandingAmt*intRateSplit[1])/1200;var principalRepayment=emi-interestRepayment;outstandingAmt=outstandingAmt-principalRepayment;interestRepaymentYearly=interestRepaymentYearly+interestRepayment;principalRepaymentYearly=principalRepaymentYearly+principalRepayment;}
count++;if(outstandingAmt<0||count==originalTenure)
{outstandingAmt=0;}
str2=str2+'<tr><td height="24" bgcolor="#f5f5f5" align="center">'+count+'</td><td bgcolor="#f5f5f5" align="center">'+intRateSplit[1]+'</td><td bgcolor="#f5f5f5" align="center">'+CommaFormatted(Math.round(emi).toString())+'</td><td bgcolor="#f5f5f5" align="center">'+CommaFormatted(principalRepaymentYearly.toString())+'</td><td bgcolor="#f5f5f5" align="center">'+CommaFormatted(interestRepaymentYearly.toString())+'</td><td bgcolor="#f5f5f5" align="center">'+CommaFormatted(outstandingAmt.toString())+'</td></tr>';}
if(count==originalTenure)
{break;}}
for(var i=0;i<rangeSplit.length;i++)
{intRateSplit=rangeSplit[i].split("=");if(intRateSplit[0].search("-")>-1)
{str1=str1+'<td  height="24" bgcolor="#ebebeb" align="center" width="130"><strong>Interest Rate for<br/>Year '+intRateSplit[0]+'</strong></td>';}
else
{if(intRateSplit[0]==1)
{str1=str1+'<td height="24" bgcolor="#ebebeb" align="center" width="101"><strong>Interest Rate for<br/>Year 1</strong></td>';}
else
{str1=str1+'<td height="24" bgcolor="#ebebeb" align="center" width="101"><strong>Interest Rate for<br/>Year '+intRateSplit[0]+'</strong></td>';}}}
str1=str1+'<td bgcolor="#f1cfd1" align="center" width="107"><strong>Average Interest for <br/>'+originalTenure+' years</strong></td></tr><tr>';for(var i=0;i<rangeSplit.length;i++)
{intRateSplit=rangeSplit[i].split("=");str1=str1+'<td height="34" bgcolor="#ffffff" align="center"><strong>'+intRateSplit[1]+'%</strong></td>';}
if(irr.search("-")>-1)
{str1=str1+'<td bgcolor="#f1cfd1" align="center"><strong>'+irr.split("-")[1]+'%</strong></td></tr></tbody></table>';}
else
{str1=str1+'<td bgcolor="#f1cfd1" align="center"><strong>'+irr+'%</strong></td></tr></tbody></table>';}
str2=str2+'</tr></tbody></table>';document.getElementById("effectiveTable1").innerHTML=str1;document.getElementById("effectiveTable2").innerHTML=str2;setLeftTopOfPopup("effectiveRate");}
function displayInfoPopup(evnt,divName)
{if(evnt=='show')
{document.getElementById(divName).style.left=xMousePos+20;document.getElementById(divName).style.top=yMousePos-10;document.getElementById(divName).style.display='block';}
else
{document.getElementById(divName).style.display='none';}}
function updateOccupationTenureForHlComp(response,dataInfo)
{if(dataInfo.split("#")[0]=="search")
{var occArr=response.split("@@")[0].split("#");var tenureArr=response.split("@@")[1].split("#");for(i=0;i<occArr.length;i++)
{addOption('occupationHL',occArr[i],occArr[i]);}
setIndexOfDropDownBasedOnValue('occupationHL',0);for(i=tenureArr[0];i<=tenureArr[1];i++)
{addOption('tenureHL',i,i+(i==1?" year":" years"));}
setIndexOfDropDownBasedOnValue('tenureHL',0);}
else
{var occArr=response.split("@@")[0].split("#");var tenureArr=response.split("@@")[1].split("#");for(i=0;i<occArr.length;i++)
{addOption('occupation',occArr[i],occArr[i]);}
if(document.getElementById("defaultValue").value=="true")
{setIndexOfDropDownBasedOnValue('occupation',0);}
else
{setIndexOfDropDownBasedOnValue('occupation',dataInfo.split("#")[0]);}
if(document.getElementById("offeringTypeId").value!="20")
{for(i=tenureArr[0];i<=tenureArr[1];i++)
{addOption('tenure',i,i+(i==1?" year":" years"));}
if(document.getElementById("defaultValue").value=="true")
{setIndexOfDropDownBasedOnValue('tenure',0);}
else
{setIndexOfDropDownBasedOnValue('tenure',dataInfo.split("#")[1]);}
document.getElementById("minTenure").value=tenureArr[0];document.getElementById("maxTenure").value=tenureArr[1];}}}
function updateOccupationTenureForHlRates(response,dataInfo)
{var occArr=response.split("@@")[0].split("#");var tenureArr=response.split("@@")[1].split("#");for(i=0;i<occArr.length;i++)
{addOption('offeringOccupation',occArr[i],occArr[i]);}
if(document.getElementById("defaultValue").value=="true")
{setIndexOfDropDownBasedOnValue('offeringOccupation',0);}
else
{setIndexOfDropDownBasedOnValue('offeringOccupation',dataInfo.split("#")[0]);}
if(document.getElementById("currentOfferingTypeId").value=="10")
{for(i=tenureArr[0];i<=tenureArr[1];i++)
{addOption('offeringTenure',i,i+(i==1?" year":" years"));}
if(document.getElementById("defaultValue").value=="true")
{setIndexOfDropDownBasedOnValue('offeringTenure',0);}
else
{setIndexOfDropDownBasedOnValue('offeringTenure',dataInfo.split("#")[1]);}}}
function updateOccupationTenureForHlEMi(response,dataInfo)
{var occArr=response.split("@@")[0].split("#");for(i=0;i<occArr.length;i++)
{addOption('occupation',occArr[i],occArr[i]);}
if(document.getElementById("hideCriteria").value=="false")
{setIndexOfDropDownBasedOnValue('occupation',0);}
else
{setIndexOfDropDownBasedOnValue('occupation',dataInfo);}}
function colorColumnInSorting(colName,colorCode,prevColorCode,prevHeaderColorCode,totalRows)
{var i;if(prevHeaderColorCode!=null){document.getElementById(colName).bgColor=colorCode;}
for(i=0;i<totalRows;i++)
{document.getElementById(colName+"_"+i).bgColor=colorCode;}
var prevColName=document.getElementById("prevColName").value;document.getElementById("prevColName").value=colName;if(prevColName!=colName&&prevColName!="0")
{if(prevHeaderColorCode!=null){document.getElementById(prevColName).bgColor=prevHeaderColorCode;}
for(i=0;i<totalRows;i++)
{document.getElementById(prevColName+"_"+i).bgColor=prevColorCode;}}}
function disableColorColumnInSorting(prevColorCode,prevHeaderColorCode,totalRows)
{var prevColName=document.getElementById("prevColName").value;document.getElementById("prevColName").value="0";if(prevColName!="0")
{if(prevHeaderColorCode!=null){document.getElementById(prevColName).bgColor=prevHeaderColorCode;}
for(i=0;i<totalRows;i++)
{document.getElementById(prevColName+"_"+i).bgColor=prevColorCode;}}}
function selectRowOnClick(rowIndex,noOfCols,rowColor,defaultRowColor,sortedCellColor,defaultSortedCellColor)
{var previousRowIndex=document.getElementById("prevRowIndex").value;if(rowIndex!=parseInt(previousRowIndex))
{var i;for(i=0;i<noOfCols;i++)
{if(document.getElementById("f"+i+"_"+rowIndex).bgColor==defaultSortedCellColor)
{document.getElementById("f"+i+"_"+rowIndex).bgColor=sortedCellColor;document.getElementById("f"+i+"_"+rowIndex).style.fontWeight="bold";}
else
{document.getElementById("f"+i+"_"+rowIndex).bgColor=rowColor;}}
if(previousRowIndex!="")
{for(i=0;i<noOfCols;i++)
{if(document.getElementById("f"+i+"_"+previousRowIndex).bgColor==sortedCellColor)
{document.getElementById("f"+i+"_"+previousRowIndex).bgColor=defaultSortedCellColor;document.getElementById("f"+i+"_"+previousRowIndex).style.fontWeight="normal";}
else
{document.getElementById("f"+i+"_"+previousRowIndex).bgColor=defaultRowColor;}}}
document.getElementById("prevRowIndex").value=rowIndex;}}
function disableSelectRowOnClick(noOfCols,defaultRowColor)
{var previousRowIndex=document.getElementById("prevRowIndex").value;if(previousRowIndex!="")
{for(i=0;i<noOfCols;i++)
{document.getElementById("f"+i+"_"+previousRowIndex).bgColor=defaultRowColor;document.getElementById("f"+i+"_"+previousRowIndex).style.fontWeight="normal";}}
document.getElementById("prevRowIndex").value="";}
function validatePersonalLoanComparator()
{var userLoanAmt=document.getElementById("loanAmt");var userAge=document.getElementById("age");var userTenure=document.getElementById("tenure");var userOccupation=document.getElementById("occupation");var userMonthlyIncome=document.getElementById("monthlyIncome");var userForm=document.getElementById("frmComparatorSearch");var userExistingEmi=document.getElementById("existingEmi");var userCityId=document.getElementById("cityId");var pleaseWait=document.getElementById("pleaseWaitUrl");if(userLoanAmt.value=="")
{alert("Please enter Loan Amount");userLoanAmt.focus();return false;}
var i=userLoanAmt.value.replace(/,/g,"");if(isNaN(i))
{alert("Please enter number only in Loan Amount");userLoanAmt.value="";userLoanAmt.focus();return false;}
if(userAge.value=="0")
{alert("Please select age");userAge.focus();return false;}
if(userTenure.value=="0")
{alert("Please select loan tenure");userTenure.focus();return false;}
var userFixed=document.getElementById("fixed");var userFloating=document.getElementById("floating");var userBoth=document.getElementById("both");if((!userFixed.checked)&&(!userFloating.checked)&&(!userBoth.checked))
{alert("Please select interest type");userFixed.focus();return false;}
if(userOccupation.value=="0")
{alert("Please select Employment Type");userOccupation.focus();return false;}
var j=userMonthlyIncome.value.replace(/,/g,"");if(userMonthlyIncome.value=="")
{alert("Please enter Monthly Income");userMonthlyIncome.focus();return false;}
if(isNaN(j))
{alert("Please enter number only in Monthly Income");userMonthlyIncome.value="";userMonthlyIncome.focus();return false;}
var userExistingEMIYes=document.getElementById("existEMIYes");var userExistingEMINo=document.getElementById("existEMINo");if((!userExistingEMIYes.checked)&&(!userExistingEMINo.checked))
{alert("Please mention if you have any Existing Emi");userExistingEMIYes.focus();return false;}
var cityElement=userForm.city;var cityTextBoxElement=userForm.cityTextBox;if(cityElement.value=="0")
{alert("Please select city");cityTextBoxElement.focus();return false;}
var apnaExchangePolicyElem=document.getElementById("apnaExchangePolicy");var apnaExchangeCheckBoxValueElem=document.getElementById("apnaExchangeCheckBoxValue");if(apnaExchangePolicyElem&&apnaExchangePolicyElem.checked)
{apnaExchangeCheckBoxValueElem.value="checked";apnaExchangePolicyElem.value="Y";}
else
{apnaExchangeCheckBoxValueElem.value="unchecked";}
userLoanAmt.value=userLoanAmt.value.replace(/,/g,"");userMonthlyIncome.value=userMonthlyIncome.value.replace(/,/g,"");userExistingEmi.value=userExistingEmi.value.replace(/,/g,"");if(userExistingEmi.value=="")
{userExistingEmi.value=0;}
userCityId.value=cityElement.value;pleaseWait.value='/personal-loan-india/compare/'+(cityTextBoxElement.value).toLowerCase()+'.html';return true;}
function calculateTenureforPersonalLoan(maxAge,age,maxTenure,minTenure,loanTenure)
{var i;var calTenure;var str;var flag=false;if(age!=0)
{calTenure=maxAge-age;if(calTenure<=maxTenure&&calTenure>=minTenure)
{str='<div class="leftfloat tspace5" id="loanTenureDiv" style="display:block;width:153px"><span style="color:#FF0000;font-weight:bold;">*</span>Loan Tenure :<span class="space5"></span></div>';str=str+'<p><select name="tenure" id="tenure" style="width:105px;" onchange="calculateTenureforPersonalLoan(maxAge.value,age.value,maxTenure.value,minTenure.value,tenure.value);"><option value="0">Select Tenure</option>';for(i=parseInt(minTenure);i<=parseInt(calTenure);i++)
{if(i==1){str=str+"<option value="+i+">"+i+" year</option>"+"\n";}
else{str=str+"<option value="+i+">"+i+" years</option>"+"\n";}}
str=str+'</select></p></div>';document.getElementById('Agelist').innerHTML=str;}
else if(calTenure<minTenure)
{alert("No tenure available for given Age");str='<div class="leftfloat tspace5" id="loanTenureDiv" style="display:block;width:153px"><span style="color:#FF0000;font-weight:bold;">*</span>Loan Tenure :<span class="space5"></span></div>';str=str+'<p><select name="tenure" id="tenure" style="width:105px;"><option value="0">Select Tenure</option></select></p></div>';document.getElementById('Agelist').innerHTML=str;flag=true;}
else
{str='<div class="leftfloat tspace5" id="loanTenureDiv" style="display:block;width:153px"><span style="color:#FF0000;font-weight:bold;">*</span>Loan Tenure :<span class="space5"></span></div>';str=str+'<p><select name="tenure" id="tenure" style="width:105px;" onchange="calculateTenureforPersonalLoan(maxAge.value,age.value,maxTenure.value,minTenure.value,tenure.value);"><option value="0">Select Tenure</option>';for(i=parseInt(minTenure);i<=parseInt(maxTenure);i++)
{str=str+"<option value="+i+">"+i+" year</option>"+"\n";}
str=str+'</select></p></div>';document.getElementById('Agelist').innerHTML=str;}}
i=document.getElementById('tenure').options.length;while(i=i-1)
{if(document.getElementById('tenure').options[i].value==loanTenure)
{document.getElementById('tenure').options[i].selected=true;flag=true;break;}}
if(loanTenure!=0&&(!flag))
{alert('Please select tenure');}}
function showEmiList(str)
{if(str=='none')
{document.getElementById('existingEmi').value=0;}
document.getElementById('EMIShowHide').style.display=str;}
function updateOccupationTenureForPlComp(response,dataInfo)
{if(dataInfo.split("#")[0]=="search")
{var occArr=response.split("@@")[0].split("#");var tenureArr=response.split("@@")[1].split("#");for(i=0;i<occArr.length;i++)
{addOption('occupationPL',occArr[i],occArr[i]);}
setIndexOfDropDownBasedOnValue('occupationPL',0);for(i=tenureArr[0];i<=tenureArr[1];i++)
{addOption('tenurePL',i,i+(i==1?" year":" years"));}
setIndexOfDropDownBasedOnValue('tenurePL',0);}
else
{var occArr=response.split("@@")[0].split("#");var tenureArr=response.split("@@")[1].split("#");for(i=0;i<occArr.length;i++)
{addOption('occupation',occArr[i],occArr[i]);}
if(document.getElementById("defaultValue").value=="true")
{setIndexOfDropDownBasedOnValue('occupation',0);}
else
{setIndexOfDropDownBasedOnValue('occupation',dataInfo.split("#")[0]);}
for(i=tenureArr[0];i<=tenureArr[1];i++)
{addOption('tenure',i,i+(i==1?" year":" years"));}
if(document.getElementById("defaultValue").value=="true")
{setIndexOfDropDownBasedOnValue('tenure',0);}
else
{setIndexOfDropDownBasedOnValue('tenure',dataInfo.split("#")[1]);}
document.getElementById("minTenure").value=tenureArr[0];document.getElementById("maxTenure").value=tenureArr[1];}}
function updateOccupationTenureForPlRates(response,dataInfo)
{var occArr=response.split("@@")[0].split("#");var tenureArr=response.split("@@")[1].split("#");for(i=0;i<occArr.length;i++)
{addOption('offeringOccupation',occArr[i],occArr[i]);}
if(document.getElementById("defaultValue").value=="true")
{setIndexOfDropDownBasedOnValue('offeringOccupation',0);}
else
{document.getElementById("blah").innerHTML=window.yahooConversionCode;setIndexOfDropDownBasedOnValue('offeringOccupation',dataInfo.split("#")[0]);}
for(i=tenureArr[0];i<=tenureArr[1];i++)
{addOption('offeringTenure',i,i+(i==1?" year":" years"));}
if(document.getElementById("defaultValue").value=="true")
{setIndexOfDropDownBasedOnValue('offeringTenure',0);}
else
{setIndexOfDropDownBasedOnValue('offeringTenure',dataInfo.split("#")[1]);}}
function updateOccupationLoanAmtForPlEMi(response,dataInfo)
{var occArr=response.split("@@")[0].split("#");var loanArr=response.split("@@")[2].split("#");for(i=0;i<occArr.length;i++)
{addOption('occupation',occArr[i],occArr[i]);}
if(document.getElementById("hideCriteria").value=="false")
{setIndexOfDropDownBasedOnValue('occupation',0);}
else
{setIndexOfDropDownBasedOnValue('occupation',dataInfo.split("#")[0]);}
if(loanArr[0]>100000)
{loanArr[0]=Math.round(loanArr[0]/100000)*100000;}
else
{loanArr[0]=100000;}
for(i=loanArr[0];i<=loanArr[1];i=i+100000)
{addOption('loanAmt',i,CommaFormatted(i.toString()));}
if(document.getElementById("hideCriteria").value=="false")
{setIndexOfDropDownBasedOnValue('loanAmt',0);}
else
{setIndexOfDropDownBasedOnValue('loanAmt',dataInfo.split("#")[1]);}}
function validateCarLoanComparator()
{if(document.getElementById("loanAmt").value=="")
{alert("Please enter Loan Amount");document.getElementById("loanAmt").focus();return false;}
var i=document.getElementById("loanAmt").value.replace(/,/g,"");if(isNaN(i))
{alert("Please enter number only in Loan Amount");document.getElementById("loanAmt").value="";document.getElementById("loanAmt").focus();return false;}
if((document.getElementById("carType").value=="Old")&&document.getElementById("oldCarAge").value=="0")
{alert("Please enter number of years car old");document.getElementById("oldCarAge").focus();return false;}
if(document.getElementById("age").value=="0")
{alert("Please select age");document.getElementById("age").focus();return false;}
if(document.getElementById("tenure").value=="0")
{alert("Please select loan tenure");document.getElementById("tenure").focus();return false;}
if((!document.getElementById("fixed").checked)&&(!document.getElementById("floating").checked)&&(!document.getElementById("both").checked))
{alert("Please select interest type");document.getElementById("fixed").focus();return false;}
if(document.getElementById("occupation").value=="0")
{alert("Please select Employment Type");document.getElementById("occupation").focus();return false;}
if(document.getElementById("monthlyIncome").value=="")
{alert("Please enter Monthly Income");document.getElementById("monthlyIncome").focus();return false;}
var j=document.getElementById("monthlyIncome").value.replace(/,/g,"");if(isNaN(j))
{alert("Please enter number only in Monthly Income");document.getElementById("monthlyIncome").value="";document.getElementById("monthlyIncome").focus();return false;}
var cityElement=document.getElementById("frmComparatorSearch").city;var cityTextBoxElement=document.getElementById("frmComparatorSearch").cityTextBox;if(cityElement.value=="0")
{alert("Please select city");cityTextBoxElement.focus();return false;}
var apnaExchangePolicyElem=document.getElementById("apnaExchangePolicy");var apnaExchangeCheckBoxValueElem=document.getElementById("apnaExchangeCheckBoxValue");if(apnaExchangePolicyElem&&apnaExchangePolicyElem.checked)
{apnaExchangeCheckBoxValueElem.value="checked";apnaExchangePolicyElem.value="Y";}
else
{apnaExchangeCheckBoxValueElem.value="unchecked";}
document.getElementById("monthlyIncome").value=document.getElementById("monthlyIncome").value.replace(/,/g,"");document.getElementById("loanAmt").value=document.getElementById("loanAmt").value.replace(/,/g,"");document.getElementById("cityId").value=cityElement.value;document.getElementById("pleaseWaitUrl").value='/car-loan-india/compare/'+(cityTextBoxElement.value).toLowerCase()+'.html';return true;}
function showUsedCarYrs(str)
{if(str=='none')
{document.getElementById('oldCarYears').selectedIndex=0;}
document.getElementById('ShowHideYrs').style.display=str;calculateTenureforCarLoan(document.getElementById('maxAge').value,document.getElementById('age').value,document.getElementById('maxTenure').value,document.getElementById('loanTenure').value);}
function calculateTenureforCarLoan(maxAge,age,maxTenure,loanTenure)
{var i;var calTenure;var tempTenure;var str;var flag=false;document.getElementById('maxAge').value=maxAge;if(age!=0)
{calTenure=maxAge-age;if(document.getElementById('carType').value=="Old")
{tempTenure=maxTenure-document.getElementById('oldCarAge').value;if(tempTenure<calTenure)
{calTenure=tempTenure;}}
if(calTenure>maxTenure)
{calTenure=maxTenure;}
if(loanTenure>calTenure)
{if(calTenure>0)
{str='<div class="leftfloat tspace5" id="loanTenureDiv" style="display:block;width:153px"><span style="color:#FF0000;font-weight:bold;">*</span>Loan Tenure :<span class="space5"></span></div>';str=str+'<p><select name="tenure" id="tenure" style="width:105px;" onchange="calculateTenureforCarLoan(maxAge.value,age.value,maxTenure.value,tenure.value);"><option value="0">Select Tenure</option>';for(i=1;i<=parseInt(calTenure);i++)
{if(i==1){str=str+"<option value="+i+">"+i+" year</option>"+"\n";}
else{str=str+"<option value="+i+">"+i+" years</option>"+"\n";}}
str=str+'</select></p></div>';document.getElementById('Agelist').innerHTML=str;}
else
{alert('No tenure available for Criteria');str='<div class="leftfloat tspace5" id="loanTenureDiv" style="display:block;width:153px"><span style="color:#FF0000;font-weight:bold;">*</span>Loan Tenure :<span class="space5"></span></div>';str=str+'<p><select name="tenure" id="tenure" style="width:105px;" onchange="calculateTenureforCarLoan(maxAge.value,age.value,maxTenure.value,tenure.value);"><option value="0">Select Tenure</option></select></p></div>';document.getElementById('Agelist').innerHTML=str;flag=true;}}
else
{str='<div class="leftfloat tspace5" id="loanTenureDiv" style="display:block;width:153px"><span style="color:#FF0000;font-weight:bold;">*</span>Loan Tenure :<span class="space5"></span></div>';str=str+'<p><select name="tenure" id="tenure" style="width:105px;" onchange="calculateTenureforCarLoan(maxAge.value,age.value,maxTenure.value,tenure.value);"><option value="0">Select Tenure</option>';for(i=1;i<=parseInt(calTenure);i++)
{if(i==1){str=str+"<option value="+i+">"+i+" year</option>"+"\n";}
else{str=str+"<option value="+i+">"+i+" years</option>"+"\n";}}
str=str+'</select></p></div>';document.getElementById('Agelist').innerHTML=str;if(calTenure<=0)
{alert('No tenure available for Criteria');}}}
i=document.getElementById('tenure').options.length;while(i=i-1)
{if(document.getElementById('tenure').options[i].value==loanTenure)
{document.getElementById('tenure').options[i].selected=true;flag=true;break;}}
if(loanTenure!=0&&(!flag))
{alert('Please select tenure');}}
function updateOccupationTenureForClComp(response,dataInfo)
{if(dataInfo.split("#")[0]=="search")
{var occArr=response.split("@@")[0].split("#");var tenureArr=response.split("@@")[2].split("#");for(i=0;i<occArr.length;i++)
{addOption('occupationCL',occArr[i],occArr[i]);}
setIndexOfDropDownBasedOnValue('occupationCL',0);for(i=tenureArr[0];i<=tenureArr[1];i++)
{addOption('tenureCL',i,i+(i==1?" year":" years"));}
setIndexOfDropDownBasedOnValue('tenureCL',0);}
else
{var occArr=response.split("@@")[0].split("#");var oldCarYearsArr=response.split("@@")[1].split(",");var tenureArr=response.split("@@")[2].split("#");for(i=0;i<occArr.length;i++)
{addOption('occupation',occArr[i],occArr[i]);}
if(document.getElementById("defaultValue").value=="true")
{setIndexOfDropDownBasedOnValue('occupation',0);}
else
{setIndexOfDropDownBasedOnValue('occupation',dataInfo.split("#")[0]);}
for(i=tenureArr[0];i<=tenureArr[1];i++)
{addOption('tenure',i,i+(i==1?" year":" years"));}
if(document.getElementById("defaultValue").value=="true")
{setIndexOfDropDownBasedOnValue('tenure',0);}
else
{setIndexOfDropDownBasedOnValue('tenure',dataInfo.split("#")[1]);}
document.getElementById("minTenure").value=tenureArr[0];document.getElementById("maxTenure").value=tenureArr[1];if(document.getElementById("carType").value=="Old")
{oldCarYearsMax=findMaxValue(oldCarYearsArr);for(i=1;i<=oldCarYearsMax;i++)
{addOption('oldCarAge',i,i+(i==1?" year":" years"));}
if(document.getElementById("defaultValue").value=="true")
{setIndexOfDropDownBasedOnValue('oldCarAge',0);}
else
{setIndexOfDropDownBasedOnValue('oldCarAge',dataInfo.split("#")[2]);}
calculateTenureforCarLoan(maxAge.value,age.value,maxTenure.value,tenure.value);}}}
function updateOccupationTenureForClRates(response,dataInfo)
{var occArr=response.split("@@")[0].split("#");var loanArr=response.split("@@")[3].split("#");for(i=0;i<occArr.length;i++)
{addOption('offeringOccupation',occArr[i],occArr[i]);}
if(document.getElementById("defaultValue").value=="true")
{setIndexOfDropDownBasedOnValue('offeringOccupation',0);}
else
{setIndexOfDropDownBasedOnValue('offeringOccupation',dataInfo.split("#")[0]);}
if(loanArr[0]>100000)
{loanArr[0]=Math.round(loanArr[0]/100000)*100000;}
else
{loanArr[0]=100000;}
for(i=loanArr[0];i<=loanArr[1];i=i+100000)
{addOption('offeringLoanAmount',i,i);}
if(document.getElementById("defaultValue").value=="true")
{setIndexOfDropDownBasedOnValue('offeringLoanAmount',0);}
else
{setIndexOfDropDownBasedOnValue('offeringLoanAmount',dataInfo.split("#")[1]);}}
function updateOccupationForClEMi(response,dataInfo)
{var occArr=response.split("@@")[0].split("#");var loanArr=response.split("@@")[3].split("#");for(i=0;i<occArr.length;i++)
{addOption('occupation',occArr[i],occArr[i]);}
if(document.getElementById("hideCriteria").value=="false")
{setIndexOfDropDownBasedOnValue('occupation',0);}
else
{setIndexOfDropDownBasedOnValue('occupation',dataInfo.split("#")[0]);}
if(loanArr[0]>100000)
{loanArr[0]=Math.round(loanArr[0]/100000)*100000;}
else
{loanArr[0]=100000;}
for(i=loanArr[0];i<=loanArr[1];i=i+100000)
{addOption('loanAmt',i,CommaFormatted(i.toString()));}
if(document.getElementById("hideCriteria").value=="false")
{setIndexOfDropDownBasedOnValue('loanAmt',0);}
else
{setIndexOfDropDownBasedOnValue('loanAmt',dataInfo.split("#")[1]);}}
function validateLoanAgainstPropertyComparator()
{var userPropertyValue=document.getElementById("propertyValue");var userLoanAmount=document.getElementById("loanAmt");var userAge=document.getElementById("age");var userTenure=document.getElementById("tenure");var userMonthlyIncome=document.getElementById("monthlyIncome");var userOccupation=document.getElementById("occupation");var userForm=document.getElementById("frmComparatorSearch");var pleaseWait=document.getElementById("pleaseWaitUrl");if(userPropertyValue.value=="")
{alert("Please enter Property Value");userPropertyValue.focus();return false;}
var i=userPropertyValue.value.replace(/,/g,"");if(isNaN(i))
{alert("Please enter number only in property value");userPropertyValue.value="";userPropertyValue.focus();return false;}
if(userLoanAmount.value=="")
{alert("Please enter Loan Amount");userLoanAmount.focus();return false;}
var i=userLoanAmount.value.replace(/,/g,"");if(isNaN(i))
{alert("Please enter number only in Loan Amount");userLoanAmount.value="";userLoanAmount.focus();return false;}
if(parseInt(userPropertyValue.value.replace(/,/g,""))<parseInt(userLoanAmount.value.replace(/,/g,"")))
{alert("Your loan amount should be less than property value");return false;}
if(userAge.value=="0")
{alert("Please select age");userAge.focus();return false;}
if(userTenure.value=="0")
{alert("Please select loan tenure");userTenure.focus();return false;}
var userBoth=document.getElementById("both");var userFixed=document.getElementById("fixed");var userFloating=document.getElementById("floating");if((!userBoth.checked)&&(!userFixed.checked)&&(!userFloating.checked))
{alert("Please select interest type");userFixed.focus();return false;}
if(userBoth.checked)
{userBoth.name="tmpInterestRate";}
if(userMonthlyIncome.value=="")
{alert("Please enter Monthly Income");userMonthlyIncome.focus();return false;}
var j=userMonthlyIncome.value.replace(/,/g,"");if(isNaN(j))
{alert("Please enter number only in Monthly Income");userMonthlyIncome.value="";userMonthlyIncome.focus();return false;}
if(document.getElementById("occupation").value=="0")
{alert("Please select occupation ");userOccupation.focus();return false;}
var cityElement=userForm.city;var cityTextBoxElement=userForm.cityTextBox;if(cityElement.value=="0")
{alert("Please select city");cityTextBoxElement.focus();return false;}
var apnaExchangePolicyElem=document.getElementById("apnaExchangePolicy");var apnaExchangeCheckBoxValueElem=document.getElementById("apnaExchangeCheckBoxValue");if(apnaExchangePolicyElem&&apnaExchangePolicyElem.checked)
{apnaExchangeCheckBoxValueElem.value="checked";apnaExchangePolicyElem.value="Y";}
else
{apnaExchangeCheckBoxValueElem.value="unchecked";}
userMonthlyIncome.value=userMonthlyIncome.value.replace(/,/g,"");userLoanAmount.value=userLoanAmount.value.replace(/,/g,"");userPropertyValue.value=userPropertyValue.value.replace(/,/g,"");pleaseWait.value='/loan-against-property-india/compare/'+(cityTextBoxElement.value).toLowerCase()+'.html';return true;}
function calculateTenureforLoanAgainstProperty(maxAge,age,maxTenure,minTenure,loanTenure)
{var calTenure;var str="";var i;var flag=false;if(age!=0)
{calTenure=maxAge-age;if(calTenure<=maxTenure&&calTenure>=minTenure)
{removeOptions('tenure');for(i=parseInt(minTenure);i<=parseInt(calTenure);i++)
{addOption('tenure',i,i+' year');}}
else if(calTenure<minTenure)
{alert("No tenure available for given Age");removeOptions('tenure');flag=true;}
else
{removeOptions('tenure');for(i=parseInt(minTenure);i<=parseInt(maxTenure);i++)
{addOption('tenure',i,i+' year');}}}
i=document.getElementById('tenure').options.length;while(i=i-1)
{if(document.getElementById('tenure').options[i].value==loanTenure)
{document.getElementById('tenure').options[i].selected=true;flag=true;break;}}
if(loanTenure!=0&&(!flag))
{alert('Please select tenure');}}
function selectAll(str,chkbtn,number)
{var checkAll=document.getElementById(str);if(checkAll.checked==true)
{for(i=0;i<number;i++)
{document.getElementById(chkbtn+i).checked=true;}}else
{for(i=0;i<number;i++)
{document.getElementById(chkbtn+i).checked=false;}}}
function selectUnSelectChkBoxes(chkElement,frmElement)
{var length=frmElement.elements.length;var isSelected=chkElement.checked;for(i=0;i<length;i++)
{var element=frmElement.elements[i];if(element.type=="checkbox")
{element.checked=isSelected;}}}
function disableAll(enableAll,enablechkbtn,enableNumber,disableAll,disablechkbtn,disableNumber)
{document.getElementById(disableAll).checked=false;document.getElementById(enableAll).disabled=false;document.getElementById(disableAll).disabled=true;selectAll(disableAll,disablechkbtn,disableNumber);for(i=0;i<enableNumber;i++)
{document.getElementById(enablechkbtn+i).disabled=false;}
for(i=0;i<disableNumber;i++)
{document.getElementById(disablechkbtn+i).disabled=true;}}
function submitCreditCardSearchPage()
{var checkbox_choices=0;var length=document.getElementById('frmComparatorSearch').elements.length;for(i=0;i<length;i++)
{var type1=document.getElementById('frmComparatorSearch').elements[i].type;if(type1=="checkbox")
{if(document.getElementById('frmComparatorSearch').elements[i].checked)
{checkbox_choices=checkbox_choices+1;}}}
if(checkbox_choices<1)
{msg="You should select atleast one option.\n";alert(msg);return false;}
var cityElement=document.getElementById("frmComparatorSearch").city;var cityTextBoxElement=document.getElementById("frmComparatorSearch").cityTextBox;if(cityElement.value=="0")
{alert("Please select city");cityTextBoxElement.focus();return false;}
if(document.getElementById('journey')&&document.getElementById('journey')=="abandoned")
{document.getElementById('frmComparatorSearch').action="/credit-card-india/comparatorResultCCForCdo.html"}
else
{document.getElementById('frmComparatorSearch').action="/credit-card-india/comparators.html";}
document.getElementById('frmComparatorSearch').submit();}
function resetCreditCardComparatorPage()
{var length=document.frmCreditCardComparatorSearch.elements.length;for(i=0;i<length;i++)
{var type1=document.frmCreditCardComparatorSearch.elements[i].type;if(type1=="checkbox")
{document.frmCreditCardComparatorSearch.elements[i].checked=false;}}
document.getElementById("frmComparatorSearch").cityTextBox.value="Select a City";document.getElementById("frmComparatorSearch").city.value="0";}
function chklimit(checkedCheckBoxId)
{var checkbox_choices=0;var length=document.frmCreditCardComparatorResult.elements.length;for(i=0;i<length;i++)
{var type1=document.frmCreditCardComparatorResult.elements[i].type;if(type1=="checkbox")
{if(document.frmCreditCardComparatorResult.elements[i].checked)
{checkbox_choices=checkbox_choices+1;}}}
if(checkbox_choices>3)
{msg="You should select atleast two card & maximum three card to compare.\n";alert(msg);document.getElementById(checkedCheckBoxId).checked=false;}}
function checkCheckboxSelectedForCrediCard()
{var i;var checkbox_choices=0;var length=document.getElementById('creditCardComparatorResults').elements.length;for(i=0;i<length;i++)
{var type1=document.getElementById('creditCardComparatorResults').elements[i].type;if(type1=="checkbox")
{if(document.getElementById('creditCardComparatorResults').elements[i].checked)
{checkbox_choices=checkbox_choices+1;}}}
if(document.getElementById('checkAllCreditCard').checked)
{checkbox_choices=checkbox_choices-1;}
if(checkbox_choices<2||checkbox_choices>3)
{alert('You can select minimum 2 banks and maximum 3 banks.');return false;}
else
{document.getElementById('creditCardComparatorResults').action="compare-banks.html";document.getElementById('creditCardComparatorResults').submit();}}
var flagforbank=1;var flagforFix=1;var flagforFloat=1;var flagforfixelig=1;var flagforfloatelig=1;var flagforactiveRate=1;var flagforfixemi=1;var flagforfloatemi=1;var flagforint=1;var flagforelig=1;var flagforemi=1;var flagforpolicy=1;var flagforpremium=2;var flagfortenure=1;var flagforcardname=1;var flagforgraceperiod=1;var flagforjoiningfee=1;var flagforannualfee=1;var flagforintrate=1;var bankData=new Array();var emiFix=new Array();var emiFloat=new Array();var eligFix=new Array();var eligFloat=new Array();var fixRate=new Array();var floatRate=new Array();var sortIndex=new Array();var allData=new Array();var sponsoredallData=new Array();var loanEligFix=new Array();var loanEligFloat=new Array();var i;function interestAscSort(a,b)
{if(a.interestRate==b.interestRate)
{return 0;}
return(a.interestRate<b.interestRate)?-1:1;}
function interestDesSort(a,b)
{if(a.interestRate==b.interestRate)
{return 0;}
return(a.interestRate>b.interestRate)?-1:1;}
function sortDataCreditCard(str,fulllistcnt,sponlistcnt)
{get_AllDataCC(fulllistcnt,sponlistcnt);if(str=='cardName')
{document.getElementById('card_img_asc_desc').style.display='block';document.getElementById('graceperiod_img_asc_desc').style.display='none';document.getElementById('joiningfee_img_asc_desc').style.display='none';document.getElementById('annualfee_img_asc_desc').style.display='none';document.getElementById('rate_img_asc_desc').style.display='none';if(flagforcardname==1)
{document.getElementById('card_img_asc_desc').src="/images/down.gif";mainDataArray.sort(cardNameAscSort);sponsoredDataArray.sort(cardNameAscSort);flagforcardname=2;}
else
{document.getElementById('card_img_asc_desc').src="/images/TopArrow.gif";mainDataArray.sort(cardNameDesSort);sponsoredDataArray.sort(cardNameDesSort);flagforcardname=1;}
flagforgraceperiod=1;flagforjoiningfee=1;flagforannualfee=1;flagforintrate=1;}
if(str=='gracePeriod')
{document.getElementById('card_img_asc_desc').style.display='none';document.getElementById('graceperiod_img_asc_desc').style.display='block';document.getElementById('joiningfee_img_asc_desc').style.display='none';document.getElementById('annualfee_img_asc_desc').style.display='none';document.getElementById('rate_img_asc_desc').style.display='none';if(flagforgraceperiod==1)
{for(i=0;i<fulllistcnt;i++)
{if(mainDataArray[i]['gracePeriod']==-1)
{mainDataArray[i]['gracePeriod']=100000;}}
for(i=0;i<sponlistcnt;i++)
{if(sponsoredDataArray[i]['gracePeriod']==-1)
{sponsoredDataArray[i]['gracePeriod']=100000;}}
document.getElementById('graceperiod_img_asc_desc').src="/images/down.gif";mainDataArray.sort(gracePeriodAscSort);sponsoredDataArray.sort(gracePeriodAscSort);flagforgraceperiod=2;}
else
{for(i=0;i<fulllistcnt;i++)
{if(mainDataArray[i]['gracePeriod']==100000)
{mainDataArray[i]['gracePeriod']=-1;}}
for(i=0;i<sponlistcnt;i++)
{if(sponsoredDataArray[i]['gracePeriod']==100000)
{sponsoredDataArray[i]['gracePeriod']=-1;}}
document.getElementById('graceperiod_img_asc_desc').src="/images/TopArrow.gif";mainDataArray.sort(gracePeriodDesSort);sponsoredDataArray.sort(gracePeriodDesSort);flagforgraceperiod=1;}
flagforcardname=1;flagforjoiningfee=1;flagforannualfee=1;flagforintrate=1;}
if(str=='joiningFee')
{document.getElementById('card_img_asc_desc').style.display='none';document.getElementById('graceperiod_img_asc_desc').style.display='none';document.getElementById('joiningfee_img_asc_desc').style.display='block';document.getElementById('annualfee_img_asc_desc').style.display='none';document.getElementById('rate_img_asc_desc').style.display='none';if(flagforjoiningfee==1)
{document.getElementById('joiningfee_img_asc_desc').src="/images/down.gif";for(i=0;i<fulllistcnt;i++)
{if(mainDataArray[i]['joiningFee']==-1)
{mainDataArray[i]['joiningFee']=100000;}}
for(i=0;i<sponlistcnt;i++)
{if(sponsoredDataArray[i]['joiningFee']==-1)
{sponsoredDataArray[i]['joiningFee']=100000;}}
mainDataArray.sort(joiningFeeAscSort);sponsoredDataArray.sort(joiningFeeAscSort);flagforjoiningfee=2;}
else
{document.getElementById('joiningfee_img_asc_desc').src="/images/TopArrow.gif";for(i=0;i<fulllistcnt;i++)
{if(mainDataArray[i]['joiningFee']==100000)
{mainDataArray[i]['joiningFee']=-1;}}
for(i=0;i<sponlistcnt;i++)
{if(sponsoredDataArray[i]['joiningFee']==100000)
{sponsoredDataArray[i]['joiningFee']=-1;}}
mainDataArray.sort(joiningFeeDesSort);sponsoredDataArray.sort(joiningFeeDesSort);flagforjoiningfee=1;}
flagforcardname=1;flagforgraceperiod=1;flagforannualfee=1;flagforintrate=1;}
if(str=='annualFee')
{document.getElementById('card_img_asc_desc').style.display='none';document.getElementById('graceperiod_img_asc_desc').style.display='none';document.getElementById('joiningfee_img_asc_desc').style.display='none';document.getElementById('annualfee_img_asc_desc').style.display='block';document.getElementById('rate_img_asc_desc').style.display='none';if(flagforannualfee==1)
{document.getElementById('annualfee_img_asc_desc').src="/images/down.gif";for(i=0;i<fulllistcnt;i++)
{if(mainDataArray[i]['annualFee']==-1)
{mainDataArray[i]['annualFee']=100000;}}
for(i=0;i<sponlistcnt;i++)
{if(sponsoredDataArray[i]['annualFee']==-1)
{sponsoredDataArray[i]['annualFee']=100000;}}
mainDataArray.sort(annualFeeAscSort);sponsoredDataArray.sort(annualFeeAscSort);flagforannualfee=2;}
else
{document.getElementById('annualfee_img_asc_desc').src="/images/TopArrow.gif";for(i=0;i<fulllistcnt;i++)
{if(mainDataArray[i]['annualFee']==100000)
{mainDataArray[i]['annualFee']=-1;}}
for(i=0;i<sponlistcnt;i++)
{if(sponsoredDataArray[i]['annualFee']==100000)
{sponsoredDataArray[i]['annualFee']=-1;}}
mainDataArray.sort(annualFeeDesSort);sponsoredDataArray.sort(annualFeeDesSort);flagforannualfee=1;}
flagforcardname=1;flagforgraceperiod=1;flagforjoiningfee=1;flagforintrate=1;}
if(str=='rate')
{document.getElementById('card_img_asc_desc').style.display='none';document.getElementById('graceperiod_img_asc_desc').style.display='none';document.getElementById('joiningfee_img_asc_desc').style.display='none';document.getElementById('annualfee_img_asc_desc').style.display='none';document.getElementById('rate_img_asc_desc').style.display='block';if(flagforannualfee==1)
{document.getElementById('rate_img_asc_desc').src="/images/down.gif";mainDataArray.sort(interestAscSort);sponsoredDataArray.sort(interestAscSort);flagforannualfee=2;}
else
{document.getElementById('rate_img_asc_desc').src="/images/TopArrow.gif";mainDataArray.sort(interestDesSort);sponsoredDataArray.sort(interestDesSort);flagforannualfee=1;}
flagforcardname=1;flagforgraceperiod=1;flagforjoiningfee=1;flagforintrate=1;}
resetDataCC(fulllistcnt,sponlistcnt);}
function modifyDataArrayCreditCard(fulllistcnt,sponlistcnt)
{var gracePeriodArray1;var gracePeriodArray2;var joinFeeArray;var annualFeeArray;var interestRateArray;for(i=0;i<fulllistcnt;i++)
{if(mainDataArray[i]['gracePeriod']!="N/A"&&mainDataArray[i]['gracePeriod']!="NA"&&mainDataArray[i]['gracePeriod']!="N.A"&&mainDataArray[i]['gracePeriod']!="Free")
{gracePeriodArray1=mainDataArray[i]['gracePeriod'].split("to ");gracePeriodArray2=gracePeriodArray1[1].split(' ');mainDataArray[i]['gracePeriod']=parseInt(gracePeriodArray2[0]);}
else if(mainDataArray[i]['gracePeriod']=="N/A"||mainDataArray[i]['gracePeriod']=="NA"||mainDataArray[i]['gracePeriod']=="N.A")
{mainDataArray[i]['gracePeriod']=100000;}
else
{mainDataArray[i]['gracePeriod']=-1;}
if(mainDataArray[i]['joiningFee']!="N/A"&&mainDataArray[i]['joiningFee']!="NA"&&mainDataArray[i]['joiningFee']!="N.A"&&mainDataArray[i]['joiningFee']!="Free")
{joinFeeArray=mainDataArray[i]['joiningFee'].split("-");mainDataArray[i]['joiningFee']=parseFloat(joinFeeArray[0]);}
else if(mainDataArray[i]['joiningFee']=="N/A"||mainDataArray[i]['joiningFee']=="NA"||mainDataArray[i]['joiningFee']=="N.A")
{mainDataArray[i]['joiningFee']=100000;}
else
{mainDataArray[i]['joiningFee']=0;}
if(mainDataArray[i]['annualFee']!="N/A"&&mainDataArray[i]['annualFee']!="NA"&&mainDataArray[i]['annualFee']!="N.A"&&mainDataArray[i]['annualFee']!="Free")
{annualFeeArray=mainDataArray[i]['annualFee'].split("-");mainDataArray[i]['annualFee']=parseFloat(annualFeeArray[0]);}
else if(mainDataArray[i]['annualFee']=="N/A"||mainDataArray[i]['annualFee']=="NA"||mainDataArray[i]['annualFee']=="N.A")
{mainDataArray[i]['annualFee']=100000;}
else
{mainDataArray[i]['annualFee']=0;}
if(mainDataArray[i]['interestRate']!="N/A"&&mainDataArray[i]['interestRate']!="NA"&&mainDataArray[i]['interestRate']!="N.A")
{interestRateArray=mainDataArray[i]['interestRate'].split("%");mainDataArray[i]['interestRate']=parseFloat(interestRateArray[0]);}
else
{mainDataArray[i]['interestRate']=-1;}}
for(i=0;i<sponlistcnt;i++)
{if(sponsoredDataArray[i]['gracePeriod']!="N/A"&&sponsoredDataArray[i]['gracePeriod']!="NA"&&sponsoredDataArray[i]['gracePeriod']!="N.A"&&sponsoredDataArray[i]['gracePeriod']!="Free")
{gracePeriodArray1=sponsoredDataArray[i]['gracePeriod'].split("to ");gracePeriodArray2=gracePeriodArray1[1].split(' ');sponsoredDataArray[i]['gracePeriod']=parseInt(gracePeriodArray2[0]);}
else if(sponsoredDataArray[i]['gracePeriod']=="N/A"||sponsoredDataArray[i]['gracePeriod']=="NA"||sponsoredDataArray[i]['gracePeriod']=="N.A")
{sponsoredDataArray[i]['gracePeriod']=100000;}
else
{sponsoredDataArray[i]['gracePeriod']=-1;}
if(sponsoredDataArray[i]['joiningFee']!="N/A"&&sponsoredDataArray[i]['joiningFee']!="NA"&&sponsoredDataArray[i]['joiningFee']!="N.A"&&sponsoredDataArray[i]['joiningFee']!="Free")
{joinFeeArray=sponsoredDataArray[i]['joiningFee'].split("-");sponsoredDataArray[i]['joiningFee']=parseFloat(joinFeeArray[0]);}
else if(sponsoredDataArray[i]['joiningFee']=="N/A"||sponsoredDataArray[i]['joiningFee']=="NA"||sponsoredDataArray[i]['joiningFee']=="N.A")
{sponsoredDataArray[i]['joiningFee']=100000;}
else
{sponsoredDataArray[i]['joiningFee']=0;}
if(sponsoredDataArray[i]['annualFee']!="N/A"&&sponsoredDataArray[i]['annualFee']!="NA"&&sponsoredDataArray[i]['annualFee']!="N.A"&&sponsoredDataArray[i]['annualFee']!="Free")
{annualFeeArray=sponsoredDataArray[i]['annualFee'].split("-");sponsoredDataArray[i]['annualFee']=parseFloat(annualFeeArray[0]);}
else if(sponsoredDataArray[i]['annualFee']=="N/A"||sponsoredDataArray[i]['annualFee']=="NA"||sponsoredDataArray[i]['annualFee']=="N.A")
{sponsoredDataArray[i]['annualFee']=100000;}
else
{sponsoredDataArray[i]['annualFee']=0;}
if(sponsoredDataArray[i]['interestRate']!="N/A"&&sponsoredDataArray[i]['interestRate']!="NA"&&sponsoredDataArray[i]['interestRate']!="N.A")
{interestRateArray=sponsoredDataArray[i]['interestRate'].split("%");sponsoredDataArray[i]['interestRate']=parseFloat(interestRateArray[0]);}
else
{sponsoredDataArray[i]['interestRate']=-1;}}}
function cardNameAscSort(a,b)
{if(a.cardName==b.cardName)
{return 0;}
return(a.cardName<b.cardName)?-1:1;}
function cardNameDesSort(a,b)
{if(a.cardName==b.cardName)
{return 0;}
return(a.cardName>b.cardName)?-1:1;}
function gracePeriodAscSort(a,b)
{if(a.gracePeriod==b.gracePeriod)
{return 0;}
return(a.gracePeriod<b.gracePeriod)?-1:1;}
function gracePeriodDesSort(a,b)
{if(a.gracePeriod==b.gracePeriod)
{return 0;}
return(a.gracePeriod>b.gracePeriod)?-1:1;}
function joiningFeeAscSort(a,b)
{if(a.joiningFee==b.joiningFee)
{return 0;}
return(a.joiningFee<b.joiningFee)?-1:1;}
function joiningFeeDesSort(a,b)
{if(a.joiningFee==b.joiningFee)
{return 0;}
return(a.joiningFee>b.joiningFee)?-1:1;}
function annualFeeAscSort(a,b)
{if(a.annualFee==b.annualFee)
{return 0;}
return(a.annualFee<b.annualFee)?-1:1;}
function annualFeeDesSort(a,b)
{if(a.annualFee==b.annualFee)
{return 0;}
return(a.annualFee>b.annualFee)?-1:1;}
function trimSpaceNewLine(str)
{do
{tempStr=str;str=trimNewLine(str);str=trimSpace(str);}while(tempStr!=str);return str;}
function trimSpace(s)
{while(s.substring(0,1)==' ')
{s=s.substring(1,s.length);}
while(s.substring(s.length-1,s.length)==' ')
{s=s.substring(0,s.length-1);}
return s;}
function trimNewLine(s)
{while(s.substring(0,1)=='\n')
{s=s.substring(1,s.length);}
while(s.substring(s.length-1,s.length)=='\n')
{s=s.substring(0,s.length-1);}
return s;}
function get_AllDataCC(fulllistcnt,sponlistcnt)
{for(i=0;i<fulllistcnt;i++)
{var row=new Array(10);row[0]=document.getElementById('fullrowcardname_'+i).innerHTML;row[1]=document.getElementById('fullrowgraceperiod_'+i).innerHTML;row[2]=document.getElementById('fullrowjoiningfee_'+i).innerHTML;row[3]=document.getElementById('fullrowannualfee_'+i).innerHTML;row[4]=document.getElementById('fullrowrate_'+i).innerHTML;row[5]=document.getElementById('fullrowcallfacility_'+i).innerHTML;row[6]=document.getElementById('fullrowaction_'+i).innerHTML;row[7]=document.getElementById('fullrowbanknote_'+i).innerHTML;allData[i]=row;}
for(i=0;i<sponlistcnt;i++)
{var sponsoredrow=new Array(10);sponsoredrow[0]=document.getElementById('sponrowcardname_'+i).innerHTML;sponsoredrow[1]=document.getElementById('sponrowgraceperiod_'+i).innerHTML;sponsoredrow[2]=document.getElementById('sponrowjoiningfee_'+i).innerHTML;sponsoredrow[3]=document.getElementById('sponrowannualfee_'+i).innerHTML;sponsoredrow[4]=document.getElementById('sponrowrate_'+i).innerHTML;sponsoredrow[5]=document.getElementById('sponrowcallfacility_'+i).innerHTML;sponsoredrow[6]=document.getElementById('sponrowaction_'+i).innerHTML;sponsoredrow[7]=document.getElementById('sponrowbanknote_'+i).innerHTML;sponsoredallData[i]=sponsoredrow;}}
function resetDataCC(fulllistcnt,sponlistcnt)
{for(i=0;i<fulllistcnt;i++)
{document.getElementById('fullrowcardname_'+i).innerHTML=allData[mainDataArray[i]['rowIndex']][0];document.getElementById('fullrowgraceperiod_'+i).innerHTML=allData[mainDataArray[i]['rowIndex']][1];document.getElementById('fullrowjoiningfee_'+i).innerHTML=allData[mainDataArray[i]['rowIndex']][2];document.getElementById('fullrowannualfee_'+i).innerHTML=allData[mainDataArray[i]['rowIndex']][3];document.getElementById('fullrowrate_'+i).innerHTML=allData[mainDataArray[i]['rowIndex']][4];document.getElementById('fullrowcallfacility_'+i).innerHTML=allData[mainDataArray[i]['rowIndex']][5];document.getElementById('fullrowaction_'+i).innerHTML=allData[mainDataArray[i]['rowIndex']][6];document.getElementById('fullrowbanknote_'+i).innerHTML=allData[mainDataArray[i]['rowIndex']][7];}
for(i=0;i<sponlistcnt;i++)
{document.getElementById('sponrowcardname_'+i).innerHTML=sponsoredallData[sponsoredDataArray[i]['rowIndex']][0];document.getElementById('sponrowgraceperiod_'+i).innerHTML=sponsoredallData[sponsoredDataArray[i]['rowIndex']][1];document.getElementById('sponrowjoiningfee_'+i).innerHTML=sponsoredallData[sponsoredDataArray[i]['rowIndex']][2];document.getElementById('sponrowannualfee_'+i).innerHTML=sponsoredallData[sponsoredDataArray[i]['rowIndex']][3];document.getElementById('sponrowrate_'+i).innerHTML=sponsoredallData[sponsoredDataArray[i]['rowIndex']][4];document.getElementById('sponrowcallfacility_'+i).innerHTML=sponsoredallData[sponsoredDataArray[i]['rowIndex']][5];document.getElementById('sponrowaction_'+i).innerHTML=sponsoredallData[sponsoredDataArray[i]['rowIndex']][6];document.getElementById('sponrowbanknote_'+i).innerHTML=sponsoredallData[sponsoredDataArray[i]['rowIndex']][7];}
for(i=0;i<fulllistcnt;i++)
{mainDataArray[i]['rowIndex']=i;}
for(i=0;i<sponlistcnt;i++)
{sponsoredDataArray[i]['rowIndex']=i;}
get_AllDataCC(fulllistcnt,sponlistcnt);}
function sortfunctioncreditcard(x,cnt)
{if(x==1)
{flagforcardname=1;document.getElementById('graceperiod_img_asc_desc').style.display='none';document.getElementById('joiningfee_img_asc_desc').style.display='none';document.getElementById('annualfee_img_asc_desc').style.display='none';document.getElementById('rate_img_asc_desc').style.display='none';sortDataCreditCard1('cardName',cnt);}
if(x==2)
{flagforgraceperiod=1;document.getElementById('card_img_asc_desc').style.display='none';document.getElementById('joiningfee_img_asc_desc').style.display='none';document.getElementById('annualfee_img_asc_desc').style.display='none';document.getElementById('rate_img_asc_desc').style.display='none';sortDataCreditCard1('gracePeriod',cnt);}
if(x==3)
{flagforjoiningfee=1;document.getElementById('card_img_asc_desc').style.display='none';document.getElementById('graceperiod_img_asc_desc').style.display='none';document.getElementById('annualfee_img_asc_desc').style.display='none';document.getElementById('rate_img_asc_desc').style.display='none';sortDataCreditCard1('joiningFee',cnt);}
if(x==4)
{flagforannualfee=1;document.getElementById('card_img_asc_desc').style.display='none';document.getElementById('graceperiod_img_asc_desc').style.display='none';document.getElementById('joiningfee_img_asc_desc').style.display='none';document.getElementById('rate_img_asc_desc').style.display='none';sortDataCreditCard1('annualFee',cnt);}
if(x==5)
{flagforintrate=1;document.getElementById('card_img_asc_desc').style.display='none';document.getElementById('graceperiod_img_asc_desc').style.display='none';document.getElementById('joiningfee_img_asc_desc').style.display='none';document.getElementById('annualfee_img_asc_desc').style.display='none';sortDataCreditCard1('rate',cnt);}}
function hideshowPremiumFrequency()
{if(document.getElementById('regular').checked)
{document.getElementById('prem').style.display="block";document.getElementById('frequency').style.display="block"}
else if(document.getElementById('single').checked)
{document.getElementById('prem').style.display="none";document.getElementById('frequency').style.display="none";}}
function calculateTenureForTermInsurance(ageVal)
{if(ageVal==0)
return;var formParams="";var selectedIndex=0;var tenureVal=document.getElementById('tenure').value;formParams+="id="+document.getElementById('offerId').value+"&age="+ageVal;var ajaxUrl="/"+nameSpace+"/ajax/kyxHelper.html"
var receiveReq=window.getXmlHttpRequestObject();if(receiveReq.readyState==4||receiveReq.readyState==0)
{receiveReq.open("POST",ajaxUrl,true);receiveReq.setRequestHeader("Content-Length",formParams.length);receiveReq.setRequestHeader("Content-Type","application/x-www-form-urlencoded");receiveReq.onreadystatechange=function()
{if(receiveReq.readyState==4)
{var response=receiveReq.responseText;var a=response.substring(1);var tenureArray=a.split(",");tenureArray.sort(sortNumbers);removeOptions('tenure');for(i=0;i<tenureArray.length;i++)
{addOption('tenure',tenureArray[i],tenureArray[i]);if(tenureVal==tenureArray[i]){selectedIndex=i+1;}}
setIndexOfDropDownBasedOnValue('tenure',tenureVal);}};receiveReq.send(formParams);}}
function validateTermInsuranceComparator()
{if(document.getElementById('gender').value=="0")
{alert('Please Select Gender');document.getElementById('gender').focus();return false;}
if(document.getElementById('sumAssured').value=="0")
{alert("Select Sum Assured");document.getElementById('sumAssured').focus();return false;}
var cityElement=document.getElementById("frmTermInsuranceSearch").city;var cityTextBoxElement=document.getElementById("frmTermInsuranceSearch").cityTextBox;if(cityElement.value=="0")
{alert("Please select city");cityTextBoxElement.focus();return false;}
if(document.getElementById('age').value=="0")
{alert("Select Age")
document.getElementById('age').focus();return false;}
if(document.getElementById('tenure').value==0)
{alert("Please Enter Your Tenure");return false;}
if(!validateCustomerNameEmailMobile()){return false;}else{document.getElementById('searchCriteriaDiv').style.display='none';document.getElementById('principalListDiv').style.display='block';document.getElementById('applicantName').value=document.getElementById("tmpApplicantName").value;document.getElementById('applicantMobile').value=document.getElementById("tmpApplicantMobile").value;document.getElementById('applicantEmail').value=document.getElementById("tmpApplicantEmail").value;document.getElementById('_principalIds').name='noName';document.getElementById("pleaseWaitUrl").value='/term-insurance-india/compare/'+(cityTextBoxElement.value).toLowerCase()+'.html';return true;}}
function showHealthInsuranceFamilyPack()
{document.getElementById("myselfDiv").style.display="none";document.getElementById("myselfvalueDiv").style.display="none";document.getElementById("meandfamilyvalueDiv").style.display="";document.getElementById("meandfamilyDiv").style.display="";document.getElementById("bothPolicy").style.display="none";if(document.getElementById("policyTypeFixed").checked==true)
{document.getElementById("fixedFamilyCount").style.display="block";document.getElementById("fixedFamilyCount").disabled=false;document.getElementById("floaterFamilyCount").style.display="none";}else{document.getElementById("floaterFamilyCount").style.display="block";document.getElementById("fixedFamilyCount").style.display="none";}}
function hideHealthInsuranceFamilyPack()
{document.getElementById("myselfDiv").style.display="block";document.getElementById("myselfvalueDiv").style.display="block";document.getElementById("meandfamilyDiv").style.display="none";document.getElementById("bothPolicy").style.display="";document.getElementById("meandfamilyvalueDiv").style.display="none";}
function activateHealthInsFamilyFixed()
{document.getElementById("fixedFamilyCount").style.display="";document.getElementById("floaterFamilyCount").style.display="none";document.getElementById("fixedFamilyCount").selectedIndex='0';document.getElementById("floaterFamilyCount").selectedIndex='0';}
function activateHealthInsFamilyFloat()
{document.getElementById("fixedFamilyCount").style.display="none";document.getElementById("floaterFamilyCount").style.display="";}
function fixedHealthInsCreateRow(rowCount)
{if(rowCount<1)
{return;}
document.getElementById("numRows").value=rowCount;for(i=1;i<=10;i++)
{if(i<=rowCount)
{document.getElementById('row'+i).style.display='';}
else
{document.getElementById('row'+i).style.display='none';}}
setDivHeWi('flag');}
function enableDisableElement()
{if(document.getElementById('individualFamilyCount').selectedIndex==0)
{for(var x=1;x<11;x++)
{document.getElementById("age"+x).disabled=true;document.getElementById("relation"+x).disabled=true;document.getElementById("sumAssured"+x).disabled=true;}
alert("Please Select Number of Family Members");}
else
{for(var x=1;x<11;x++)
{document.getElementById("age"+x).disabled=false;document.getElementById("relation"+x).disabled=false;document.getElementById("sumAssured"+x).disabled=false;}}}
function hIComparatorvalidation()
{var personCount=1;var policyType="BLANK";var ages="";var sumAssured="";var relationType="";planType=document.getElementById("planType").value;if(planType=="INDIVIDUAL"||planType=="SENIOR_CITIZEN")
{if(planType=="SENIOR_CITIZEN")
{policyType="INDIVIDUAL";}
if(document.getElementById('myselfAge').value==0)
{alert("Please Select your age");return false;}
ages=','+document.getElementById('myselfAge').value;if(document.getElementById('myselfSumAssured').value==0)
{alert("Please Select sumassured");return false;}
sumAssured=','+document.getElementById('myselfSumAssured').value;relationType=','+'Self';}
else if(planType=="FAMILY_INDIVIDUAL")
{if(document.getElementById('individualFamilyCount').value==0)
{alert('Please select Number of family members');return false;}
var numFamilyMember=document.getElementById('individualFamilyCount').value;personCount=numFamilyMember;for(i=1;i<=numFamilyMember;i++)
{var error=false;var msg='Please Select ';if(i!=1&&document.getElementById('relation'+i).value=='0')
{msg+="relation ";document.getElementById('relation'+i).focus();error=true;}
relationType+=','+document.getElementById('relation'+i).value;if(document.getElementById('age'+i).value=='0')
{msg+="age ";document.getElementById('age'+i).focus();error=true;}
ages+=','+document.getElementById('age'+i).value;if(document.getElementById('sumAssured'+i).value=='0')
{msg+="sumAssured ";document.getElementById('sumAssured'+i).focus();error=true;}
sumAssured+=','+document.getElementById('sumAssured'+i).value;if(error==true)
{alert(msg+"for person no "+i);return false;}}}
else if(planType=="FAMILY_FLOATER")
{policyType="FLOATER";var error=false;var msg='Please Select ';if(document.getElementById('floaterFamilyCount').value=='0')
{alert("Please Select No. of Family members covered");document.getElementById('floaterFamilyCount').focus();return false;}
personCount=document.getElementById('floaterFamilyCount').value;if(document.getElementById('floaterAge').value=='0')
{msg+="age ";document.getElementById('floaterAge').focus();error=true;}
ages=','+document.getElementById('floaterAge').value;if(document.getElementById('floaterSumAssured').value=='0')
{msg+="sumAssured ";document.getElementById('floaterSumAssured').focus();error=true;}
sumAssured=','+document.getElementById('floaterSumAssured').value;relationType=','+'Self';if(error==true)
{alert(msg+"for person");document.getElementById('flaotMemberDetails').style.display='';return false;}}
var cityElement=document.getElementById("frmComparatorSearch").city;var cityTextBoxElement=document.getElementById("frmComparatorSearch").cityTextBox;if(cityElement.value=="0")
{alert("Please select city");cityTextBoxElement.focus();return false;}
document.getElementById('policyDuration').value=document.getElementById("policyDurationUsr").value;document.getElementById('personCount').value=personCount;document.getElementById('ages').value=ages.substring(1);document.getElementById('sumAssured').value=sumAssured.substring(1);document.getElementById('relationType').value=relationType.substring(1);document.getElementById('policyType').value=policyType;var apnaExchangePolicyElem=document.getElementById("apnaExchangePolicy");var apnaExchangeCheckBoxValueElem=document.getElementById("apnaExchangeCheckBoxValue");if(apnaExchangePolicyElem&&apnaExchangePolicyElem.checked)
{apnaExchangeCheckBoxValueElem.value="checked";apnaExchangePolicyElem.value="Y";}
else
{apnaExchangeCheckBoxValueElem.value="unchecked";}
if(validateCustomerNameEmailMobile())
{document.getElementById('applicantName').value=document.getElementById("tmpApplicantName").value;document.getElementById('applicantMobile').value=document.getElementById("tmpApplicantMobile").value;document.getElementById('applicantEmail').value=document.getElementById("tmpApplicantEmail").value;if(!document.getElementById("privacyPolicy").checked)
{alert("Please check the privacy policy");document.getElementById("privacyPolicy").focus();return false;}
document.getElementById("pleaseWaitUrl").value='/health-insurance-india/compare/'+(cityTextBoxElement.value).toLowerCase()+'.html';return true;}
else
{return false;}}
function hideShowUserDetails(strVal)
{document.getElementById("pageDesc").value=strVal;}
function showPremiumDetails(sMode,sElementName,sElement,sWidth,sTop,premium,discount,premiumAfterdiscount,serviceTax,premiumValues,policyType,tolPremium)
{sLeftPos=0;sTopPos=0;var premiumArray=premiumValues.split(',');if(policyType=="INDIVIDUAL"||policyType=="BLANK")
{for(var i=0;i<premiumArray.length;i++)
{document.getElementById("premium"+i).innerHTML='';}
for(var i=0;i<premiumArray.length;i++)
{document.getElementById("premium"+i).innerHTML=premiumArray[i];}}
else
{document.getElementById("premium").innerHTML=premium;}
while(sElement)
{sLeftPos+=sElement.offsetLeft;sTopPos+=sElement.offsetTop;sElement=sElement.offsetParent;}
sLeftPos=sLeftPos+sWidth+"px";sTopPos=sTopPos+sTop+"px";sDisplay=(sMode=="show")?"inline":"none";if(oElement=eval(document.getElementById('premiumDetails')))
{oElement.style.left=sLeftPos;oElement.style.top=sTopPos;oElement.style.display=sDisplay;}
if(policyType=="INDIVIDUAL"||policyType=="BLANK")
{document.getElementById('totalBasic').innerHTML=premium;document.getElementById('twoPlusPerson').innerHTML=discount;document.getElementById('premiumAfterDiscount').innerHTML=premiumAfterdiscount;}
document.getElementById('serviceTax').innerHTML=serviceTax;document.getElementById('totalPremium').innerHTML=tolPremium;return false;}
function enableHiddenValue(id,chkbox)
{if(document.getElementById(chkbox).checked==true)
{document.getElementById(id).disabled=false;}else
{document.getElementById(id).disabled=true;}}
function getAge(day,month,year)
{var today=new Date();var dateStr=today.getDate();var monthStr=today.getMonth()+1;var yearStr=parseInt(today.getFullYear());var age=yearStr-year;if(month>monthStr)
{return(age-1);}
else
{if(month==monthStr&&day>dateStr)
{return(age-1);}
else
{return(age);}}}
function setInsuranceType(insuranceValue)
{var strSearch;var strCompare;document.getElementById("typeOfInsurance").value=insuranceValue;if(insuranceValue=="life-insurance-india")
{strSearch='<span style="font-size: 9px;"> Find a Life Insurance provider </span>';strCompare='<span style="font-size: 9px;"> Compare Ife Insurance Providers </span>';}
else if(insuranceValue=="health-insurance-india")
{strSearch='<span style="font-size: 9px;"> Find a Health Insurance provider </span>';strCompare='<span style="font-size: 9px;"> Compare Health Insurance Providers </span>';}
else if(insuranceValue=="auto-insurance-india")
{strSearch='<span style="font-size: 9px;">Find a Car Insurance provider</span>';strCompare='<span style="font-size: 9px;">Compare Car Insurance Providers </span>';}
else if(insuranceValue=="householder-insurance-india")
{strSearch='<span style="font-size: 9px;">Find a Householder provider</span>';strCompare='<span style="font-size: 9px;">Compare Householder Providers</span>';}
else if(insuranceValue=="travel-insurance-india")
{strSearch='<span style="font-size: 9px;">Find Travel Insurance provider</span>';strCompare='<span style="font-size: 9px;">Compare Travel Insurance Providers </span>';}
document.getElementById('compareText').innerHTML=strCompare;}
function compareDisplayPageInsurance(insurancetype,city,strButton)
{if(insurancetype=="")
{alert("Please select Type of Insurance");return false;}
if(city=="Select a City")
{alert("Please select City");return false;}
var cityName=city.replace(" ","_");var category=document.getElementById("typeOfInsurance").value;var subcategory;if(strButton=='Apply')
{if(category=="householder-insurance-india")
{category="home-insurance-india";}
subcategory="apply.html";}
if(strButton=='Search')
{if(category=="householder-insurance-india")
{category="home-insurance-india";}
subcategory="search.html";}
if(strButton=='Compare')
{if(category=="life-insurance-india")
{category="term-insurance-india";}
if(category=="householder-insurance-india")
{category="home-insurance-india";}
subcategory="compare.html";}
location.href="/"+category+"/"+subcategory+"?city="+city;}
function SelectAllCompany(id,count)
{if(document.getElementById('selectAllBank').checked==true)
{for(i=0;i<count;i++)
{document.getElementById(id+i).checked=true;}}else
{for(i=0;i<count;i++)
{document.getElementById(id+i).checked=false;}}}
function changecombo()
{var pol=document.getElementById('tenure').value;var sum=document.getElementById('sumAssured');if(pol==1)
{sum.options.length=0;sum.options[sum.options.length]=new Option("Select Sum Assured","0");sum.options[sum.options.length]=new Option("100000","100000");sum.options[sum.options.length]=new Option("150000","150000");sum.options[sum.options.length]=new Option("200000","200000");sum.options[sum.options.length]=new Option("250000","250000");sum.options[sum.options.length]=new Option("300000","300000");sum.options[sum.options.length]=new Option("350000","350000");sum.options[sum.options.length]=new Option("400000","400000");sum.options[sum.options.length]=new Option("450000","450000");sum.options[sum.options.length]=new Option("500000","500000");sum.options[sum.options.length]=new Option("600000","600000");sum.options[sum.options.length]=new Option("750000","750000");sum.options[sum.options.length]=new Option("1000000","1000000");sum.options[sum.options.length]=new Option("1500000","1500000");sum.options[sum.options.length]=new Option("2000000","2000000");sum.options[sum.options.length]=new Option("2500000","2500000");sum.options[sum.options.length]=new Option("3000000","3000000");sum.options[sum.options.length]=new Option("3500000","3500000");sum.options[sum.options.length]=new Option("4000000","4000000");sum.options[sum.options.length]=new Option("4500000","4500000");sum.options[sum.options.length]=new Option("5000000","5000000");}
if(pol==3)
{sum.options.length=0;sum.options[sum.options.length]=new Option("Select Sum Assured","0");sum.options[sum.options.length]=new Option("300000","300000");sum.options[sum.options.length]=new Option("600000","600000");sum.options[sum.options.length]=new Option("1200000","1200000");}
if(pol==5)
{sum.options.length=0;sum.options[sum.options.length]=new Option("Select Sum Assured","0");sum.options[sum.options.length]=new Option("300000","300000");sum.options[sum.options.length]=new Option("600000","600000");sum.options[sum.options.length]=new Option("1200000","1200000");}
if(pol=='Select number of years')
{sum.options.length=0;sum.options[sum.options.length]=new Option("Select Sum Assured","Select Sum Assured");}}
function confirmCriticalHealthSubmit()
{var age=document.getElementById("age");if(age.value==0)
{alert("Please select the Age");age.focus();return false;}
var tenure=document.getElementById("tenure");if(tenure.value==0)
{alert("Please select the Policy Duration");tenure.focus();return false;}
var sumAssured=document.getElementById("sumAssured");if(sumAssured.value==0)
{alert("Please select the Sum Assured");sumAssured.focus();return false;}
var cityElement=document.getElementById("frmCriticalInsuranceSearch").city;var cityTextBoxElement=document.getElementById("frmCriticalInsuranceSearch").cityTextBox;if(cityElement.value=="0")
{alert("Please select city");cityTextBoxElement.focus();return false;}
document.getElementById("pleaseWaitUrl").value='/critical-illness-insurance-india/compare/'+(cityTextBoxElement.value).toLowerCase()+'.html';return true;}
function changeEducationLoanTab(changeTo,pageType)
{document.getElementById('studyIn').value=changeTo;document.getElementById('gender').name='tmpGender';document.getElementById('coursesAvailable').name='tmpcoursesAvailable';document.getElementById('tenure').name='tmptenure';document.getElementById("hideCriteria").value="false";if(pageType=='comp')
{document.getElementById('loanAmount').name='tmploanAmount';document.getElementById('city').name='userCity';dynamicSubmit('/education-loan-india/compare.html','POST','frmComparatorSearch');}
else
{document.getElementById('city').name='userCity';dynamicSubmit('/education-loan-india/rates.html','POST','educationRate');}}
function validateEducationLoanComparator()
{if(document.getElementById("gender").value==0)
{alert("Please Select Gender");document.getElementById("gender").focus();return false;}
if(document.getElementById("coursesAvailable").value==0)
{alert("Please Select Course");document.getElementById("coursesAvailable").focus();return false;}
var i=document.getElementById("loanAmount").value.replace(/,/g,"");if(isNaN(i))
{alert("Please Enter number only in Loan Amount");document.getElementById("loanAmount").value="";document.getElementById("loanAmount").focus();return false;}
if(document.getElementById("tenure").value=="0")
{alert("Please Select Tenure");document.getElementById("tenure").focus();return false;}
var cityElement=document.getElementById("frmComparatorSearch").city;var cityTextBoxElement=document.getElementById("frmComparatorSearch").cityTextBox;if(cityElement.value=="0")
{alert("Please select city");cityTextBoxElement.focus();return false;}
document.getElementById("loanAmount").value=document.getElementById("loanAmount").value.replace(/,/g,"");document.getElementById("pleaseWaitUrl").value='/education-loan-india/compare/'+(cityTextBoxElement.value).toLowerCase()+'.html';return true;}
function resetAllEducationLoanComparator()
{document.getElementById('gender').selectedIndex=0;document.getElementById('coursesAvailable').selectedIndex=0;if(document.getElementById('loanAmount'))
{document.getElementById('loanAmount').value="Loan Amount";}
document.getElementById("tenure").selectedIndex=0;}
function fetchTenureForEducationLoan()
{var formParams="";var tenureVal=document.getElementById('tenure').value;formParams+="id="+document.getElementById('offerId').value;var ajaxUrl="/"+nameSpace+"/ajax/kyxHelper.html"
var receiveReq=window.getXmlHttpRequestObject();if(receiveReq.readyState==4||receiveReq.readyState==0)
{receiveReq.open("POST",ajaxUrl,true);receiveReq.setRequestHeader("Content-Length",formParams.length);receiveReq.setRequestHeader("Content-Type","application/x-www-form-urlencoded");receiveReq.onreadystatechange=function()
{if(receiveReq.readyState==4)
{var response=receiveReq.responseText;var tenureArray=response.split("#");var tenureMinArray=tenureArray[0].substring(1).split(",");var minTenure=findMinValue(tenureMinArray);var tenureMaxArray=tenureArray[1].substring(1).split(",");var maxTenure=findMaxValue(tenureMaxArray);removeOptions('tenure');for(i=minTenure;i<=maxTenure;i++)
{addOption('tenure',i,i);if(tenureVal==i){selectedIndex=i+1;}}
setIndexOfDropDownBasedOnValue('tenure',tenureVal);}};receiveReq.send(formParams);}}
function getEducationLoanResults(item)
{if(item.value=="0")
{alert("Select appropriate details");}
else
{if(document.getElementById("gender").value!=0&&document.getElementById("coursesAvailable").value!=0&&document.getElementById("tenure").value!=0&&document.getElementById("city").value!=0)
{dynamicSubmit('/education-loan-india/rates.html','POST','educationRate');}}}
function sortEducationLoanResults(selectedVal,fullListSize,sponsoredListSize,numColumn)
{if(selectedVal==1)
{sortTable('action',fullListSize,sponsoredListSize,numColumn);}
else if(selectedVal==2)
{sortTable('bankName',fullListSize,sponsoredListSize,numColumn);}
else if(selectedVal==3)
{sortTable('rateType',fullListSize,sponsoredListSize,numColumn);}
else if(selectedVal==4)
{sortTable('l1',fullListSize,sponsoredListSize,numColumn);}
else if(selectedVal==5)
{sortTable('l2',fullListSize,sponsoredListSize,numColumn);}
else if(selectedVal==6)
{sortTable('l3',fullListSize,sponsoredListSize,numColumn);}}
function hideUserOption(adjustPixels)
{var top=document.getElementById("hint_msg").style.top;top=top.replace("px","");top=parseInt(top);if(typeof adjustPixels=="undefined")
{adjustPixels="0";}
if(document.getElementById('userData').style.display!='none')
{document.getElementById('userData').style.display='none';document.getElementById('btnHideShow').style.backgroundImage="url('/images/button-RefineSearch.gif')";top=top-parseInt(adjustPixels);document.getElementById("hint_msg").style.top=top+"px";}else
{document.getElementById('userData').style.display='';document.getElementById('btnHideShow').style.backgroundImage="url('/images/button-HideOptions.gif')";top=top+parseInt(adjustPixels);document.getElementById("hint_msg").style.top=top+"px";}}
var currentDiv='';var orderId=-1;var listingContactId=-1;var buyerPrincipalId=0;var isPrincipal='true';var bankAffilated='';var isBank=false;var bankId=-1;var currentBtn;var shdValidate;function showPopup(sMode,sElementName,sElement,sWidth,sTop)
{sLeftPos=0;sTopPos=0;while(sElement)
{sLeftPos+=sElement.offsetLeft;sTopPos+=sElement.offsetTop;sElement=sElement.offsetParent;}
adjVar=check_brwz();sLeftPos=sLeftPos+sWidth+"px";sTopPos=sTopPos+sTop-adjVar+"px";sDisplay=(sMode=="show")?"inline":"none";if(oElement=eval(document.getElementById('hint_msg')))
{oElement.style.left=sLeftPos;oElement.style.top=sTopPos;oElement.style.display=sDisplay;}}
var Apply=function(){var currentDiv;var isPrincipal=new Boolean();var order;var address;var bankImage;var buyerImage;var bankName;var buyerName;var orderIndex;var bankAffilated
var filter;var isMultipleOrder;var principalId;var currentBtn;};var isMultipleOrder=false;var filter='';var txnInfo=function(){this.offeringId=null;this.originalPositionId=null;this.positionId=null;this.txnType=null;this.listType=null;this.dataSnapshot=null;this.orderId=null;};document.txnInfo=null;function getComparatorFormDataForStorage()
{var data=getComparatorFormDataForTracking();if(!data)return data;return encodeURIComponent(data.replace(/^&/g,'').replace(/(^|&)frc_/g,'$1'));}
function handleTxn(txnBtn,txnType,offeringId,orderIndex)
{if(typeof(offeringId)=='undefined'||!offeringId){return false;}
var oldTxnInfo=document.txnInfo;var txn=new txnInfo();txn.offeringId=offeringId;txn.originalPositionId=null;txn.dataSnapshot=(oldTxnInfo&&oldTxnInfo.dataSnapshot)?oldTxnInfo.dataSnapshot:getComparatorFormDataForStorage();txn.txnType=txnType;document.txnInfo=txn;var position,listType='none';try{var spnid=txnBtn.parentNode.parentNode.id;var newStyle=(spnid.match(/^[sf][0-9]+_[0-9]+$/g));if(newStyle){position=parseInt(spnid.replace(/^.+_([0-9]+)$/g,"$1"));if(spnid.match(/^s[0-9]+_[0-9]+$/g))listType='spon';else if(spnid.match(/^f[0-9]+_[0-9]+$/g))listType='full';}
else{position=parseInt(spnid.replace(/^.+rowaction_([0-9]+)$/g,"$1"));if(spnid.match(/^sponrow.+$/g))listType='spon';else if(spnid.match(/^fullrow.+$/g))listType='full';}
if(isNaN(position))position=-1;}catch(e){position=-1;};var curi=document.location.href.replace(/^http:\/\/[^\/]+/g,'');var orderId=-1;try{orderId=(typeof(orderIndex)!='undefined'&&orderIndex)?orderArray[orderIndex][0]['orderId']:-1;}catch(e){orderId=-1;}
try{var oajax=getXmlHttpRequestObject();var url;if(offeringId>0){url='/ajax/reportCmpEvent.html?r='+(new Date().getTime())+'&evt=tx'+'&location='+encodeURIComponent(curi)+'&tt='+encodeURIComponent(txnType)+'&oid='+offeringId+'&pos='+position+'&lst='+encodeURIComponent(listType)+
getComparatorFormDataForTracking();}
else{url='/ajax/reportTxnClick.html?r='+(new Date().getTime())+'&location='+encodeURIComponent(curi)+'&txnType='+encodeURIComponent(txnType)+'&offeringId='+offeringId+'&pos='+position+'&orderId='+orderId+'&listType='+encodeURIComponent(listType)+
getComparatorFormDataForTracking();}
oajax.open('GET',url,true);oajax.onreadystatechange=function(){};oajax.send(null);}catch(e){}
return true;}
function popKyxApply(offering,txnBtn,listing)
{if(document.getElementById("formRegistration")!=null)
{if(/MSIE (\d+\.\d+);/.test(navigator.userAgent))
{var ieversion=new Number(RegExp.$1);if(ieversion==6)
{closeDivAndShowSelectBox();openDivAndHideSelectBox("hint_msg");}}}
if(typeof(offering)=='undefined'||!offering){return false;}
var oldTxnInfo=document.txnInfo;var txn=new txnInfo();txn.offeringId=offering.id;txn.originalPositionId=null;txn.dataSnapshot=(oldTxnInfo&&oldTxnInfo.dataSnapshot)?oldTxnInfo.dataSnapshot:getComparatorFormDataForStorage();txn.txnType=txnType;document.txnInfo=txn;var curi=document.location.href.replace(/^http:\/\/[^\/]+/g,'');var offeringId=(typeof(offering.id)!='undefined'&&offering.id)?offering.id:0;var txnType='apply';var origPos=(typeof(offering.opos)!='undefined'&&offering.opos)?offering.opos:0;var position,listType=(typeof(offering.listType)!='undefined'&&offering.listType)?offering.listType:'full';try{var spnid=txnBtn.parentNode.parentNode.id;var newStyle=(spnid.match(/^[sf][0-9]+_[0-9]+$/g));if(newStyle){position=parseInt(spnid.replace(/^.+_([0-9]+)$/g,"$1"));}
else{position=parseInt(spnid.replace(/^.+rowaction_([0-9]+)$/g,"$1"));}
if(isNaN(position))position=-1;}catch(e){position=-1;}
try{var oajax=getXmlHttpRequestObject();var url='/ajax/reportCmpEvent.html?r='+(new Date().getTime())+'&evt=tx'+'&location='+encodeURIComponent(curi)+'&tt='+encodeURIComponent(txnType)+'&oid='+offeringId+'&pos='+position+'&opos='+origPos+'&lst='+encodeURIComponent(listType)+
getComparatorFormDataForTracking();oajax.open('GET',url,true);oajax.onreadystatechange=function(){};oajax.send(null);}catch(e){}
var princName=offering.principalName;if(!princName){princName=offering.principal.name}
if(typeof(gIsModified)!='undefined'&&gIsModified!==true)
{displayDefaultApplyForm('show',txnBtn.name,txnBtn,txnBtn.offsetWidth,txnBtn.offsetTop,'defaultApply',offering.principalName,offering.imageUri,null,offering.orderIndex,offering.id,offering);return true;}
if((typeof(searchPage)!='undefined'&&searchPage)||(typeof(isVcfPg)!='undefined'&&isVcfPg))
{openCloseDivsApply(txnBtn,offering.id,princName,offering.imageUri,listing,offering);}
else
{popSetting('show',txnBtn.name,txnBtn,txnBtn.offsetWidth,txnBtn.offsetTop,'bank',princName,offering.imageUri,null,offering.orderIndex,offering.id,listing,offering);}
return true;}
function popKyxGPN(offering,txnBtn,listing)
{if(typeof(offering)=='undefined'||!offering){return false;}
var oldTxnInfo=document.txnInfo;var txn=new txnInfo();txn.offeringId=offering.id;txn.originalPositionId=null;txn.dataSnapshot=(oldTxnInfo&&oldTxnInfo.dataSnapshot)?oldTxnInfo.dataSnapshot:getComparatorFormDataForStorage();txn.txnType=txnType;document.txnInfo=txn;var curi=document.location.href.replace(/^http:\/\/[^\/]+/g,'');var offeringId=(typeof(offering.id)!='undefined'&&offering.id)?offering.id:0;var txnType='gpn';var origPos=(typeof(offering.opos)!='undefined'&&offering.opos)?offering.opos:0;var position,listType=(typeof(offering.listType)!='undefined'&&offering.listType)?offering.listType:'full';try{var spnid=txnBtn.parentNode.parentNode.id;var newStyle=(spnid.match(/^[sf][0-9]+_[0-9]+$/g));if(newStyle){position=parseInt(spnid.replace(/^.+_([0-9]+)$/g,"$1"));}
else{position=parseInt(spnid.replace(/^.+rowaction_([0-9]+)$/g,"$1"));}
if(isNaN(position))position=-1;}catch(e){position=-1;}
try{var oajax=getXmlHttpRequestObject();var url='/ajax/reportCmpEvent.html?r='+(new Date().getTime())+'&evt=tx'+'&location='+encodeURIComponent(curi)+'&tt='+encodeURIComponent(txnType)+'&oid='+offeringId+'&pos='+position+'&opos='+origPos+'&lst='+encodeURIComponent(listType)+
getComparatorFormDataForTracking();oajax.open('GET',url,true);oajax.onreadystatechange=function(){};oajax.send(null);}catch(e){}
var identifier;if(listing){identifier=listing.identifier;}
else{identifier=offering.orderId;}
var princ=offering.pi;if(!princ){princ=offering.principalId;}
if(typeof(searchPage)!='undefined'&&searchPage)
{openCloseDivsGpn(txnBtn,offering.id,offering.principalName,offering.imageUri,listing,offering);}
if(typeof(offering.pi)!='undefined'){popMobileSetting('show',txnBtn.name,txnBtn,txnBtn.offsetWidth,txnBtn.offsetTop,offering.isBank,princ,identifier,offering.id,listing);}
else{popMobileSetting('show',txnBtn.name,txnBtn,txnBtn.offsetWidth,txnBtn.offsetTop,offering.isBank,princ,identifier,offering.id,listing);}
return true;}
var shouldShowAx=true;function displayDefaultApplyForm(sMode,sElementName,sElement,sWidth,sTop,activeDiv,bankName,image,address,orderIndex,offeringId,offering)
{document.getElementById('closePopup').style.display="block";document.getElementById('msgWrongVal').style.display='none';document.getElementById('advInfoContainer').style.display='none';document.getElementById('validation').style.display='none';document.getElementById('apnaExchangePolicyDiv1Default').style.display='none';document.getElementById('apnaExchangePolicyAdv').value='';var elemAXInfo=document.getElementById('apnaAxchangeInfo');elemAXInfo.style.display="none";if(apnaloan.isNotNull(gCurrCust))
{document.getElementById('hasCreditCardY').checked=gCurrCust.hasCreditCard;document.getElementById('mIncomeQA').value=gCurrCust.monthlyIncome;}
if(currentDiv!='')
{document.getElementById(currentDiv).style.display='none';}
document.getElementById('t&cDefault').checked=false;if(document.getElementById('t&c').checked==false)
{document.getElementById('talkNow').disabled=true;document.getElementById('btnApply').disabled=true;}
document.txnInfo=null;handleTxn(sElement,'apply',offeringId,orderIndex);productId=document.getElementById('productId').value;var jTag=document.getElementById('jTag').value;var city=document.getElementById('applyfrmCity').value;var id;currentSubIndex=0;buyerPrincipalId=offering.principalId?offering.principalId:offering.pi;bankAffilated=isPrincipal?"":"Representing :"+bankName;var bankName=offering.principalName;if(!bankName){bankName=offering.principal.name}
image=gPi2ImgUrl[buyerPrincipalId];reportClick(id,buyerPrincipalId,productId,jTag,city);var str='<img style="cursor:pointer;" src="/images/minithumb_b_close.gif" onclick="hidePopup(\'hint_msg\');"/>';document.getElementById('bankImageDivDefault').style.display='none';document.getElementById('closePopup').innerHTML=str;document.getElementById('thxtBankName').innerHTML=bankName;currentBtn=sElement;document.getElementById(activeDiv).style.display='';document.getElementById('apply').style.display='none';document.getElementById('validation').style.display='none';document.getElementById('thankyou').style.display='none';document.getElementById('orderListDiv').style.display='none';document.getElementById('filterCriteria').innerHTML='';document.getElementById('popAffilatedBuyerName').innerHTML='';showPopup(sMode,sElementName,sElement,sWidth,sTop);currentDiv=activeDiv;currOffId=offering.id;if(shouldShowAx)
{document.getElementById('apnaExchangePolicyDiv1Default').style.display='';}
if(listOfFieldConfig!='undefined'&&listOfFieldConfig!=null&&listOfFieldConfig.length!=0&&trim(document.getElementById('additionalFieldsDiv').innerHTML)=='')
{var html="";for(var i=0;i<listOfFieldConfig.length;i++)
{if(custIncome!=null)
{var income=custIncome;}
else
{income='';}
var iString="monthlyIncome";if(listOfFieldConfig[i].divType!='undefined'&&listOfFieldConfig[i].divType=='vertical')
{if(listOfFieldConfig[i].name=="monthlyIncome")
{var valueHtml=income;}
else
{valueHtml='';}
html+='<div style="float:left;width:100%"><div style="float: left; width: 37%;">'+listOfFieldConfig[i].label+':</div>'+'<div style="width: 50%; float: left;"><input type="'+listOfFieldConfig[i].type+'" name="'+listOfFieldConfig[i].name+'" value="'+valueHtml+'" id="'+listOfFieldConfig[i].id+'" style="width: 90px;"></div></div>';}
else if(listOfFieldConfig[i].divType=='horizontal')
{html+='<div style="float: left; width: 100%;">'+listOfFieldConfig[i].label+':</div>'+'<div style="width: 100%; float: left;padding-top:5px">';if(listOfFieldConfig[i].type=='radio')
{var textList=listOfFieldConfig[i].text2ValueMap;for(elem in textList)
{value=textList[elem];html+='<input type="radio" name="'+listOfFieldConfig[i].name+'" value="'+value+'">'+elem+'</input><br><br>'}}
html+="</div>";}}
document.getElementById("additionalFieldsDiv").innerHTML=html;}}
function popSetting(sMode,sElementName,sElement,sWidth,sTop,activeDiv,bankName,image,address,orderIndex,offeringId,listing,offering)
{var isOrderIdArrayIndex=document.getElementById('isOrderIdArrayIndex');document.getElementById('closePopup').style.display="block";var newWay=typeof(gNewWay)=='undefined'?(typeof(listing)!='undefined'):gNewWay;if(document.getElementById('t&c').checked==false)
{document.getElementById('talkNow').disabled=true;document.getElementById('btnApply').disabled=true;}
order=(newWay?listing.identifier:orderIndex);if(showAlert(sMode,sElementName,sElement,sWidth,sTop,activeDiv,bankName,image,address,orderIndex))
{document.txnInfo=null;handleTxn(sElement,'apply',offeringId,orderIndex);productId=document.getElementById('productId').value;var jTag=document.getElementById('jTag').value;var city=document.getElementById('city').value;var id;if(newWay)
{currentIndex=listing.identifier;currentSubIndex=0;buyerPrincipalId=offering.principalId?offering.principalId:offering.pi;isPrincipal=listing.principal;bankAffilated=isPrincipal?"":"Representing :"+bankName;bankName=listing.name;isMultipleOrder=false;image=gPi2ImgUrl[buyerPrincipalId];shdValidate=listing.requiresMobileValidation;id=listing.identifier;}
else
{if(isOrderIdArrayIndex!=null)
{currentIndex=orderIndex;currentSubIndex=0;bankName=orderArray[orderIndex][0]['buyerName'];image=orderArray[orderIndex][0]['imageUri'];order=orderArray[orderIndex][0]['orderId'];filter=orderArray[orderIndex][0]['filter'];buyerPrincipalId=orderArray[orderIndex][0]['buyerPrincipalId'];isPrincipal=orderArray[orderIndex][0]['isPrincipal']=='true';bankAffilated="Representing :"+orderArray[orderIndex][0]['principalName'];isMultipleOrder=false;shdValidate=orderArray[orderIndex][0]['validateMobileNo'];id=order}}
reportClick(id,buyerPrincipalId,productId,jTag,city);var alreadyApplied=checkIsAlreadyApplied(order,buyerPrincipalId);if(alreadyApplied=="3")
{currentDiv='msgWrongVal';document.getElementById('msgWrongVal').style.display='';document.getElementById('msgWrongVal').innerHTML=errorMsg[parseInt(alreadyApplied)]+"("+bankName+")";document.getElementById('apply').style.display='none';document.getElementById('validation').style.display='none';document.getElementById('thankyou').style.display='none';document.getElementById('orderListDiv').style.display='none';if(newWay)
{if(dispatcher)
{dispatcher.postDispatch({type:"p",li:listing.identifier,oi:offering.id},{pi2ImgUrl:gPi2ImgUrl,isWidg:gIsWidg});}}
else if(isOrderIdArrayIndex!=null){orderArray[currentIndex].splice(currentSubIndex,1);}
if(isMultipleOrder)
{document.getElementById('orderListDiv').style.display='';document.getElementById('orderList').innerHTML=createOrderListOnThxDiv();}else{sElement.disabled=true;}
showPopup(sMode,sElementName,sElement,sWidth,sTop);return;}
var orderData=checkOrderType(order);var orderType=orderData.statusCode;if(orderType==8)
{if(window.location.toString().match("widget")!=null){scrollBy(-350,0);}
var url='/redir.html?rc=lo&oi='+order+'&pli='+buyerPrincipalId+'&pi='+document.getElementById('productId').value+'&ci='+document.getElementById('cityId').value+'&jTag='+document.getElementById('jTag').value;myRef=window.open(url,'Apply','left=20,top=20,resizable=1,width=800,height=600,scrollbars=1');myRef.focus();sElement.disabled=true;return;}
else
{if(currentDiv!='')
{document.getElementById(currentDiv).style.display='none';}
document.getElementById('apply').style.display='';document.getElementById('validation').style.display='none';document.getElementById('thankyou').style.display='none';document.getElementById('orderListDiv').style.display='none';document.getElementById('filterCriteria').innerHTML='';document.getElementById('popAffilatedBuyerName').innerHTML='';document.getElementById('popBankDivImage').src=image;document.getElementById('btnApply').value="Go";document.getElementById('popHeadline').innerHTML="<b>"+orderData.headline+"</b>";document.getElementById('popRow1').innerHTML=orderData.row1;document.getElementById('popRow2').innerHTML=orderData.row2;if(orderType==10)
{document.getElementById('orTextDiv').style.display="none";document.getElementById('talkNowDiv1').style.display="block";document.getElementById('apply').style.height="240px";document.getElementById('goButtonDiv').style.display="none";document.getElementById('applyGpnLeftFloat').style.width="42px";}
else
{document.getElementById('orTextDiv').style.display="none";document.getElementById('talkNowDiv1').style.display="none";document.getElementById('apply').style.height="240px";document.getElementById('goButtonDiv').style.display="block";document.getElementById('applyGpnLeftFloat').style.width="45px";}
if(document.getElementById('t&c').checked==true)
{document.getElementById('btnApply').disabled=false;}
document.getElementById(activeDiv).style.display='';document.getElementById('popBankName').innerHTML="";var apnaExchangeCheckBoxValueElem=document.getElementById("apnaExchangeCheckBoxValue");var apnaExchangePolicyDiv1Elem=document.getElementById('apnaExchangePolicyDiv1');if(apnaExchangeCheckBoxValueElem&&apnaExchangeCheckBoxValueElem.value=='checked'){apnaExchangePolicyDiv1Elem.style.display='none';}
else
{apnaExchangePolicyDiv1Elem.style.display='block';}
if(activeDiv=='bank')
{var str='<img style="cursor:pointer;" src="/images/minithumb_b_close.gif" onclick="hidePopup(\'hint_msg\');"/>';if(!isPrincipal)
{var str='Advertisement   <img style="cursor:pointer;" src="/images/minithumb_b_close.gif" onclick="hidePopup(\'hint_msg\');"/>';document.getElementById('closePopup').innerHTML=str;if(image=="/images/no-bank-image.jpg")
{document.getElementById('popBankName').innerHTML=bankAffilated;document.getElementById('bankDiv').style.display='none';}
else
{document.getElementById('popBankDivImage').src=image;document.getElementById('bankDiv').style.display='';}
document.getElementById('popAffilatedBuyerName').innerHTML=bankName;document.getElementById('bankImageDiv').style.display="none";}
else
{document.getElementById('bankImageDiv').style.display='none';document.getElementById('popBankName').innerHTML='Apply to '+bankName;if(image=="/images/no-bank-image.jpg")
{document.getElementById('bankDiv').style.display='none';}
else
{document.getElementById('bankDiv').style.display='block';document.getElementById('popBankDivImage').src=image;}
document.getElementById('closePopup').innerHTML=str;}}
else
{isPrincipal=document.getElementById(image+'IsPrincipal'+address).value=="true";if(!isPrincipal)
{var str='Advertisement   <img style="cursor:pointer;" src="/images/minithumb_b_close.gif" onclick="hidePopup(\'hint_msg\');"/>';document.getElementById('closePopup').innerHTML=str;document.getElementById('popAffilatedBuyerName').innerHTML=bankName;document.getElementById('bankImageDiv').style.display="none";document.getElementById('buyer').style.display="none";document.getElementById('popBuyerNameHeader').style.display="none";document.getElementById('bank').style.display="";document.getElementById('popBankDivImage').src=document.getElementById(image+'Image'+address).value;document.getElementById('bankDiv').style.display='';document.getElementById('popBuyerNameHeader').innerHTML='';document.getElementById('popBuyerName').innerHTML='';document.getElementById('popBuyerNameHeader').innerHTML=apnaloan.trim(bankName);document.getElementById('popBuyerName').innerHTML='Apply to '+apnaloan.trim(bankName);document.getElementById('popBuyerImage').src="";document.getElementById('popBankImage').src="";}
else
{var str='<img style="cursor:pointer;" src="/images/minithumb_b_close.gif" onclick="hidePopup(\'hint_msg\');"/>';document.getElementById('closePopup').innerHTML=str;document.getElementById('popAffilatedBuyerName').innerHTML='';document.getElementById('bankImageDiv').style.display="none";document.getElementById('buyer').style.display="none";document.getElementById('popBuyerNameHeader').style.display="none";document.getElementById('bank').style.display="";document.getElementById('popBankName').innerHTML="Apply To "+bankName;document.getElementById('popBankDivImage').src=document.getElementById(image+'Image'+address).value;document.getElementById('bankDiv').style.display='';document.getElementById('popBuyerNameHeader').innerHTML='';document.getElementById('popBuyerName').innerHTML='';document.getElementById('popBuyerNameHeader').innerHTML=apnaloan.trim(bankName);document.getElementById('popBuyerName').innerHTML='Apply to '+apnaloan.trim(bankName);document.getElementById('popBuyerImage').src="";document.getElementById('popBankImage').src="";}}
document.getElementById('thxtBankName').innerHTML=bankName;currentBtn=sElement;showPopup(sMode,sElementName,sElement,sWidth,sTop);currentDiv=activeDiv;orderId=order;if(offering!=null&&typeof(offering)!=undefined){currOffId=offering.id;}
else{currOffId=0;}}}}
function hidePopup(id)
{if(window.location.toString().match("widget")!=null){scrollBy(-350,0);}
document.getElementById(id).style.display='none';document.getElementById('apply').style.display='none';document.getElementById('validation').style.display='none';document.getElementById('thankyou').style.display='none';document.getElementById('msgWrongVal').innerHTML='';document.getElementById('mobileNumber').style.display='none';document.getElementById('mobileNumberMsg').style.display='none';document.getElementById('msgWrongVal').style.display='none';document.getElementById('orderListDiv').style.display='none';currentDiv='';closeDivAndShowSelectBox();}
var errorMsg=new Array();errorMsg[2]="The validation code entered by you was incorrect but your application has been logged.";errorMsg[3]="You have already applied for this advertiser.";errorMsg[4]="Some error occured but your application has been logged successfully.";errorMsg[6]="We've sent the contact details to you over SMS.";errorMsg[7]="We are unable to retrieve the contact details.";errorMsg[12]="Your application is validated. Your request has reached us outside of business hours. We'll be getting in touch with you shortly.";errorMsg[13]="You have already applied for 12 offerings. Should you need further assistance, please write to service@apnapaisa.com";errorMsg[15]="We've already sent the contact details to you over SMS.";errorMsg[17]="Sorry we couldn't find any new Service Provider for this request. Please do check again later.";errorMsg[18]="Your application has already been dispatched to the advertiser";function setNewOrderAndApply(index)
{bankName=orderArray[currentIndex][index]['buyerName'];image=orderArray[currentIndex][index]['imageUri'];order=orderArray[currentIndex][index]['orderId'];filter=orderArray[currentIndex][index]['filter'];buyerPrincipalId=orderArray[currentIndex][index]['buyerPrincipalId'];isPrincipal=orderArray[currentIndex][index]['isPrincipal'];bankAffilated="Representing :"+orderArray[currentIndex][index]['principalName'];currentSubIndex=index;activeDiv='bank';isMultipleOrder=(orderArray[currentIndex].length<2)?false:true;var orderData=checkOrderType(order);var orderType=orderData.statusCode;if(currentDiv!='')
{document.getElementById(currentDiv).style.display='none';}
document.getElementById('apply').style.display='';document.getElementById('validation').style.display='none';document.getElementById('popAffilatedBuyerNameDiv').style.display='none';document.getElementById('thankyou').style.display='none';document.getElementById('orderListDiv').style.display='none';document.getElementById('btnApply').value="Go";document.getElementById('popHeadline').innerHTML="<b>"+orderData.headline+"</b>";document.getElementById('popRow1').innerHTML=orderData.row1;document.getElementById('popRow2').innerHTML=orderData.row2;if(orderType==10)
{document.getElementById('orTextDiv').style.display="none";document.getElementById('apply').style.height="240px";document.getElementById('talkNowDiv1').style.display="block";document.getElementById('goButtonDiv').style.display="none";}
else
{document.getElementById('orTextDiv').style.display="none";document.getElementById('talkNowDiv1').style.display="none";document.getElementById('apply').style.height="100%";document.getElementById('goButtonDiv').style.display="";}
document.getElementById('btnApply').disabled=false;document.getElementById(activeDiv).style.display='';var str='<img style="cursor:pointer;" src="/images/minithumb_b_close.gif" onclick="hidePopup(\'hint_msg\');"/>';if(isPrincipal=='false')
{var str='Advertisement   <img style="cursor:pointer;" src="/images/minithumb_b_close.gif" onclick="hidePopup(\'hint_msg\');"/>';document.getElementById('closePopup').innerHTML=str;if(image=="/images/no-bank-image.jpg")
{document.getElementById('popBankName').innerHTML=bankAffilated;document.getElementById('bankDiv').style.display='none';}
else
{document.getElementById('popBankDivImage').src=image;document.getElementById('bankDiv').style.display='';}
document.getElementById('popAffilatedBuyerName').innerHTML=bankName;document.getElementById('bankImageDiv').style.display="none";}
else
{document.getElementById('bankImageDiv').style.display='none';document.getElementById('popBankName').innerHTML='Apply to '+bankName;if(image=="/images/no-bank-image.jpg")
{document.getElementById('bankDiv').style.display='none';}
else
{document.getElementById('bankDiv').style.display='block';document.getElementById('popBankDivImage').src=image;}
document.getElementById('closePopup').innerHTML=str;}
document.getElementById('popBankImage').src=image;if(filter!='')
{document.getElementById('filterCriteria').innerHTML='<b>Eligibility Criteria:</b><br/>'+filter+'<hr>';}
document.getElementById('thxtBankName').innerHTML=bankName;currentDiv=activeDiv;orderId=order;}
function createOrderListOnThxDiv()
{var tempstr='';for(i=0;i<orderArray[currentIndex].length;i++)
{tempstr+='<br><b><div style="cursor:pointer;" onclick="setNewOrderAndApply('+i+')">'+orderArray[currentIndex][i]['buyerName']+'</div></b>';}
return tempstr;}
window.leadId=null;window.productId=null;function validateApplyPopup()
{var appliedTo=document.getElementById('thxtBankName').innerHTML;var name=null;var countryCode;var mobileNumbera;var email=null;var newWay=typeof(gNewWay)=='undefined'?false:gNewWay;if(document.getElementById('applicantName'))
{name=apnaloan.trim(document.getElementById('applicantName').value);if(name=='')
{alert('Please enter your Name');return;}}
var city=document.getElementById('city');if(city.value==0)
{alert('Please select city');city.focus();return;}
countryCode=document.getElementById('countryCode').value;if(countryCode==0)
{alert('Please select Country code');return;}
if(document.getElementById('applicantMobile'))
{mobileNumbera=apnaloan.trim(document.getElementById('applicantMobile').value);if(apnaloan.trim(countryCode)==91)
{if(mobileNumbera==''||isNaN(mobileNumbera)||(countryCode==91&&((mobileNumbera.substring(0,1)!='9'&&mobileNumbera.substring(0,1)!='8'&&mobileNumbera.substring(0,1)!='7')||mobileNumbera.length!=10)))
{alert('Please enter correct mobile number');return;}}}
if(document.getElementById('applicantEmail'))
{email=apnaloan.trim(document.getElementById('applicantEmail').value);if(!validateEmail(email))
{return;}}
if(document.getElementById('smartTalkFlag').value=='true')
{if(document.getElementById('applicantMobile'))
{mobileNumbera=apnaloan.trim(document.getElementById('applicantMobile').value);if(countryCode==91)
{if(mobileNumbera==''||isNaN(mobileNumbera)||((mobileNumbera.substring(0,1)!='9'&&mobileNumbera.substring(0,1)!='8'&&mobileNumbera.substring(0,1)!='7')||mobileNumbera.length!=10))
{alert('Please enter your mobile number');return;}}
if(countryCode!=91)
{alert('Talk Now Functionality is currently available only in India');return;}}}
var axPolicy=document.getElementById("apnaExchangePolicy");var axPolicy1=document.getElementById("apnaExchangePolicy1");var apnaExchangeCheckBoxValueElem=document.getElementById("apnaExchangeCheckBoxValue");var apnaExchangePolicy;if((axPolicy!=null&&typeof(axPolicy)!='undefined'&&axPolicy.checked)||(axPolicy1!=null&&typeof(axPolicy1)!='undefined'&&axPolicy1.checked))
{apnaExchangePolicy='Y';if(apnaExchangeCheckBoxValueElem!=null&&typeof(apnaExchangeCheckBoxValueElem)!=undefined){apnaExchangeCheckBoxValueElem.value='checked';}}
var apnaExchangeCheckBoxValue=(apnaExchangeCheckBoxValueElem!=null&&typeof('apnaExchangeCheckBoxValueElem')!='undefined')?apnaExchangeCheckBoxValueElem.value:null;var apnaExchangePopupElem=document.getElementById("apnaExchangePopup");var apnaExchangePopup=(apnaExchangePopupElem!=null&&typeof('apnaExchangePopupElem')!='undefined')?apnaExchangePopupElem.value:null;var hasCreditCardElem=document.getElementById('hasCreditCard');var hasCreditCard=(hasCreditCardElem!=null&&typeof(hasCreditCardElem)!='undefined')?hasCreditCardElem.value:null;var mIncome=null;var monthlyIncomeElem=document.getElementById('monthlyIncome');if(apnaloan.isNull(monthlyIncomeElem))
{var mIncomeElem=document.getElementById('mIncome');if(apnaloan.isNotNull(mIncomeElem)){mIncome=mIncomeElem.value;}}
else
{mIncome=monthlyIncomeElem.value;}
var leadLoanAmount=null;var loanAmountElem=document.getElementById('loanAmt');if(!apnaloan.isNull(loanAmountElem))
{leadLoanAmount=trim(loanAmountElem.value.replace(/,/g,""));}
hasCreditCard=apnaloan.isNull(hasCreditCard)?"N":hasCreditCard;document.getElementById('filterCriteria').innerHTML='';document.getElementById('btnApply').disabled=true;document.getElementById('loadingImage').style.display='';var elemJourneyTag=document.getElementById('jTag');var jTag='';if(apnaloan.isNotNull(elemJourneyTag)){jTag=elemJourneyTag.value;}
var productId=document.getElementById('productId').value;window.productId=productId;var cityId=document.getElementById('cityId').value;shdValidate=(typeof(shdValidate)=='undefined'||shdValidate==null)?"Y":shdValidate;var _txnInfo=document.txnInfo;var oi=apnaloan.isNull(_txnInfo)?null:(apnaloan.isNull(_txnInfo.offeringId)?null:_txnInfo.offeringId);gCurrCust=new Customer(name,countryCode,mobileNumbera,email,null,cityId,window.askedForApnaExchange,shdValidate,hasCreditCard,mIncome);gCurrApp=new Application(productId,gCurrCust,jTag,buyerPrincipalId,oi,leadLoanAmount);gCurrApp.orderId=orderId;var formParams=gCurrApp.getApplyQS();formParams+="&apnaExchangePolicy="+apnaExchangePolicy+"&apnaExchangePopup="+apnaExchangePopup+"&apnaExchangeCheckBoxValue="+apnaExchangeCheckBoxValue;if(apnaloan.isNotNull(window.xmlData)){formParams+=xmlData();}
if(document.getElementById('smartTalkFlag').value=='true')
{formParams+="&smartTalkFlag=true";}
if(gCurrApp.source=="ss")
{var loanAmount=document.getElementById('loanAmount').value;var monthlyIncome=document.getElementById('monthlyIncome').value;var age=document.getElementById('age').value;var loanTenure=document.getElementById('loanTenure').value;var purpose=document.getElementById('purpose').value;var nri=(countryCode=='91')?'false':'true';formParams+="&nri="+nri+"&loanAmount="+loanAmount+"&monthlyIncome="+monthlyIncome+"&age="+age+"&loanTenure="+loanTenure+"&employmentType="+employmentType+"&purpose="+purpose;}
if(productId!=8&&productId!=9)
{if(gCurrApp.source!="ss"){formParams+="&nri="+nri;}
var ageElem=document.getElementById('age');if(apnaloan.isNotNull(ageElem))
{formParams+="&age="+ageElem.value;}}
doApply(formParams);}
function doApply(formParams)
{var ajaxUrl="/ajax/applyForSingleBuyer.html";var receiveReq=window.getXmlHttpRequestObject();document.getElementById('campaignPixel').innerHTML='';document.getElementById('campaignPixelValidate').innerHTML='';if(receiveReq.readyState==4||receiveReq.readyState==0)
{receiveReq.open("POST",ajaxUrl,true);receiveReq.setRequestHeader("Content-Length",formParams.length);receiveReq.setRequestHeader("Content-Type","application/x-www-form-urlencoded")
receiveReq.onreadystatechange=function()
{if(currentDiv!='')
{document.getElementById(currentDiv).style.display='none';}
if(receiveReq.readyState==4)
{document.getElementById('apnaExchangeParam').style.display='none';document.getElementById('advInfoContainer').style.display='none';var response=eval("("+receiveReq.responseText+")");document.getElementById('apply').style.display='none';if(typeof(gNewWay)!='undefined'&&apnaloan.isNotNull(gNewWay)&&gNewWay)
{if(dispatcher)
{dispatcher.postDispatch({type:'p',li:orderId,oi:currOffId},{pi2ImgUrl:gPi2ImgUrl,isWidg:gIsWidg});}}
else if(document.getElementById('isOrderIdArrayIndex')!=null){orderArray[currentIndex].splice(currentSubIndex,1);}
if(response.statusCode=="0")
{document.getElementById("applyToDiv").style.display="block";document.getElementById("applyToDiv").innerHTML="Your application has been forwarded to "+document.getElementById('thxtBankName').innerHTML;document.getElementById('thankyou').style.display='';var strThankYou='Your application number is '+response.leadId+'.';if(response.firstApply=="false"&&apnaExchangePolicy=='Y'){strThankYou+="<br><br> You have been registered in ApnaExchange as per your request.";}
document.getElementById('displayApplicationId').innerHTML=strThankYou;currentDiv='thankyou';if(isMultipleOrder)
{document.getElementById('orderListDiv').style.display='';document.getElementById('orderList').innerHTML=createOrderListOnThxDiv();}else{currentBtn.disabled=true;}}
else if(response.statusCode=="1")
{document.getElementById('validation').style.display='';currentDiv='validation';window.leadId=response.leadId;currentBtn.disabled=true;}
else if(response.statusCode=="16")
{document.getElementById('apnaExchangeParam').style.display='';if(document.getElementById("apnaExchangePopup")){document.getElementById("apnaExchangePopup").value='display';}
currentDiv='apnaExchangeParam';}
else
{document.getElementById('msgWrongVal').style.display='';var wrongMsg=errorMsg[parseInt(response.statusCode)];if(response.firstApply=="false"&&apnaExchangePolicy=='Y')
{wrongMsg+="<br> <br> You have been registered in ApnaExchange as per your request.";}
document.getElementById('msgWrongVal').innerHTML=wrongMsg;currentDiv='msgWrongVal';if(isMultipleOrder)
{document.getElementById('orderListDiv').style.display='';document.getElementById('orderList').innerHTML=createOrderListOnThxDiv();}else{currentBtn.disabled=true;}}
if(window.productId!=null&&googleConversionCode[window.productId]!='undefined')
{document.getElementById('gcc').innerHTML=googleConversionCode[window.productId];}
document.createdLeadId=response.leadId;document.getElementById('loadingImage').style.display='none';}};var closeStr='<img style="cursor:pointer;" src="/images/minithumb_b_close.gif" onclick="hidePopup(\'hint_msg\');"/>';document.getElementById('closePopup').innerHTML=closeStr;receiveReq.send(formParams);}}
window.askedForApnaExchange=false;window.orderId=null;var gCustInfoQueryString;function validateDefaultApplyForm(frm)
{var appliedTo=document.getElementById('thxtBankName').innerHTML;var name=frm["nameDefault"].value;var countryCode=frm["countryCodeDefault"].value;var mobile=frm["mobileDefault"].value;var email=frm["emailDefault"].value;var age=frm["userAge"].value;var city=document.getElementById('userCity').value;var cityName=frm["cityTextBox"].value;var newWay=true;var currentForm='defaultApply';if(name=='')
{alert('Please enter your Name');return;}
if(countryCode==0)
{alert('Please select Country code');return;}
mobile=apnaloan.trim(mobile);if(apnaloan.trim(countryCode)==91)
{if(mobile==''||isNaN(mobile)||(countryCode==91&&((mobile.substring(0,1)!='9'&&mobile.substring(0,1)!='8'&&mobile.substring(0,1)!='7')||mobile.length!=10)))
{alert('Please enter correct mobile number');return;}}
email=apnaloan.trim(email);if(!validateEmail(email))
{return;}
if(age=='0')
{alert('Please select your age');return;}
if(city=='0')
{alert('Please select city');return;}
var axPolicy=document.getElementById("apnaExchangePolicyDefault");var axPolicy1=document.getElementById("apnaExchangePolicyAdv");var apnaExchangeCheckBoxValueElem=document.getElementById("apnaExchangeCheckBoxValue");var apnaExchangePolicy;if((apnaloan.isNotNull(axPolicy1)&&axPolicy1.checked))
{apnaExchangePolicy='Y';if(apnaExchangeCheckBoxValueElem!=null&&typeof(apnaExchangeCheckBoxValueElem)!=undefined){apnaExchangeCheckBoxValueElem.value='checked';}}
var apnaExchangeCheckBoxValue=(apnaExchangeCheckBoxValueElem!=null&&typeof('apnaExchangeCheckBoxValueElem')!='undefined')?apnaExchangeCheckBoxValueElem.value:null;var apnaExchangePopupElem=document.getElementById("apnaExchangePopup");var apnaExchangePopup=(apnaExchangePopupElem!=null&&typeof('apnaExchangePopupElem')!='undefined')?apnaExchangePopupElem.value:null;var hasCreditCard='';var axCB=document.getElementById("apnaExchangePolicyAdv");if(apnaloan.isNotNull(axCB)&&axCB.checked)
{var cc=document.getElementById("hasCreditCardY");if(apnaloan.isNotNull(cc)){hasCreditCard=(cc.checked?'Y':'N');}}
var mIncome;var mIncomeElem=document.getElementById('mIncomeQA');mIncome=apnaloan.isNull(mIncomeElem)?null:apnaloan.trim(mIncomeElem.value).replace(/,/g,"");hasCreditCard=(typeof(hasCreditCard)=='undefined'||hasCreditCard==null)?"":hasCreditCard;document.getElementById('filterCriteria').innerHTML='';document.getElementById('advInfoContainer').style.display='none';var elemJourneyTag=document.getElementById('jTag');var jTag='';if(apnaloan.isNotNull(elemJourneyTag)){jTag=elemJourneyTag.value;}
var productId=document.getElementById('productId').value;window.productId=productId;var needsValidation=(typeof(shdValidate)=='undefined'||shdValidate==null)?'Y':shdValidate;gCurrCust=new Customer(name,countryCode,mobile,email,age,city,window.askedForApnaExchange,needsValidation);if(shouldShowAx&&document.getElementById('apnaExchangePolicyAdv').checked)
{shouldShowAx=false;document.getElementById('apnaExchangePolicyAdv').checked=false;}
var formParams="apnaExchangePolicy="+apnaExchangePolicy+"&apnaExchangePopup="+apnaExchangePopup+"&apnaExchangeCheckBoxValue="+apnaExchangeCheckBoxValue;if(listOfFieldConfig!='undefined'&&listOfFieldConfig!=null&&listOfFieldConfig.length>0)
{for(var i=0;i<listOfFieldConfig.length;i++)
{if(listOfFieldConfig[i].type=='text')
{if(frm[listOfFieldConfig[i].name].value=='')
{alert("Please enter the "+listOfFieldConfig[i].label);return false;}
if(isNaN(frm[listOfFieldConfig[i].name].value))
{alert("Please enter correct value for "+listOfFieldConfig[i].label);return false;}
if(listOfFieldConfig[i].name=='loanAmount')
{var leadLoanAmt=frm[listOfFieldConfig[i].name].value;}
formParams+="&"+listOfFieldConfig[i].name+"="+frm[listOfFieldConfig[i].name].value;}
else if(listOfFieldConfig[i].type=='radio')
{var isChecked=false;var fieldList=frm[listOfFieldConfig[i].name];for(var j=0;j<fieldList.length;j++)
{if(fieldList.item(j).checked)
{formParams+="&"+fieldList.item(j).name+"="+fieldList.item(j).value;isChecked=true;break;}}
if(!isChecked)
{alert("Please select an option for "+listOfFieldConfig[i].label);return false}}}}
document.getElementById('btnApplyDefault').disabled=true;if(leadLoanAmt!='undefined')
{gCurrApp=new Application(productId,gCurrCust,jTag,buyerPrincipalId,document.txnInfo.offeringId,leadLoanAmt);}
formParams+="&"+gCurrApp.getApplyQS();document.getElementById('loadingImageDefault').style.display='';var ajaxUrl="/ajax/doQuickApply.html";var receiveReq=window.getXmlHttpRequestObject();document.getElementById('campaignPixel').innerHTML='';document.getElementById('campaignPixelValidate').innerHTML='';if(receiveReq.readyState==4||receiveReq.readyState==0)
{receiveReq.open("POST",ajaxUrl,true);receiveReq.setRequestHeader("Content-Length",formParams.length);receiveReq.setRequestHeader("Content-Type","application/x-www-form-urlencoded")
receiveReq.onreadystatechange=function()
{if(receiveReq.readyState==4)
{var response=eval("("+receiveReq.responseText+")");document.getElementById('validation').style.display='none';document.getElementById('defaultApply').style.display='none';document.getElementById('loadingImageDefault').style.display='none';if(document.getElementById('apnaAxchangeInfo').style.display!='none')
{shouldShowAx=false;}
if(typeof(response.paidWebListing)!='undefined')
{gCurrApp.orderId=response.identifier;document.getElementById('thxtBankName').innerHTML=response.adName;if(typeof(response.otherBuyerSelected)!='undefined')
{currentDiv="msgWrongVal";var gpnOrderExist=false;if(response._identifier!='undefined')
{gCurrApp.listingContactId=response._identifier;gpnOrderExist=true;}
var usrSelectedBankName=response.useSelectedBankName;str='<b>Sorry</b>, we were unable to find a provider for <b>'+usrSelectedBankName+' '+productId2ProductName[productId]+'</b> in <b>'+cityName+'</b>';if(gpnOrderExist)
{str+=', If you want to follow up with <b>'+usrSelectedBankName+'</b> you may <a href="#" onclick="getContactDetail();">request the phone number</a><br/><br/>';}
str+='However, <b>'+response.adName+'</b> would like to make you a <b>'+productId2ProductName[productId]+'</b> offer'.replace("$principal2",response.adName);str+='<br/><input type="button" value="Get Offer" id="advConfirm"  name="updateResults" onclick="this.disabled = true;doApply(gCurrApp.getApplyQS());"/>'
document.getElementById('msgWrongVal').style.display='';document.getElementById('msgWrongVal').innerHTML=str;}else{document.getElementById("advInfoContainer").style.display='';var image=gPi2ImgUrl[buyerPrincipalId];document.getElementById("advName").innerHTML=response.adName;document.getElementById("advBankImage").src=image;var str='Advertisement   <img style="cursor:pointer;" src="/images/minithumb_b_close.gif" onclick="hidePopup(\'hint_msg\');"/>';document.getElementById('closePopup').innerHTML=str;var advAdCopyHeadLine=(response.paidWebListing.adCopyHeadine=='undefined')?'':response.paidWebListing.adCopyHeadine;var advAdCopyLine1=(response.paidWebListing.adCopyLine1=='undefined')?'':response.paidWebListing.adCopyLine1;var advAdCopyLine2=(response.paidWebListing.adCopyLine2=='undefined')?'':response.paidWebListing.adCopyLine2;var adCopyStr=advAdCopyHeadLine+"<br/>"+advAdCopyLine1+"<br/>"+advAdCopyLine2;document.getElementById("advAdCopy").innerHTML=adCopyStr;currentDiv="advInfoContainer";}}
else if(typeof(response.FreeWebListing)!='undefined')
{var usrSelectedBankName=response.useSelectedBankName;gCurrApp.listingContactId=response.identifier;currentDiv="msgWrongVal";str='<b>Sorry</b>, we were unable to find a provider for <b> '+usrSelectedBankName+' '+productId2ProductName[productId]+'</b> in <b>'+cityName+'</b>. If you want to follow up with <b>'+response.adName+'</b>, you may request the phone number<br/><br/>';str+='<input type="button" name="Get Phone Number" onclick="this.disabled = true;getContactDetail();" value="Get Phone No.">';document.getElementById('msgWrongVal').style.display='';document.getElementById('msgWrongVal').innerHTML=str;}
else
{document.getElementById('msgWrongVal').style.display='';var wrongMsg=errorMsg[parseInt(response.statusCode)];if(response.firstApply=="false"&&apnaExchangePolicy=='Y')
{wrongMsg+="<br> <br> You have been registered in ApnaExchange as per your request.";document.getElementById("advInfoContainer").style.display='';}
document.getElementById('msgWrongVal').innerHTML=wrongMsg;currentDiv='msgWrongVal';currentBtn.disabled=true;}
if(window.productId!=null&&googleConversionCode[window.productId]!='undefined')
{document.getElementById('gcc').innerHTML=googleConversionCode[window.productId];}
document.createdLeadId=response.leadId;}};receiveReq.send(formParams);}
if(dispatcher)
{dispatcher.postDispatch({type:null,li:null,oi:currOffId},{pi2ImgUrl:gPi2ImgUrl,isWidg:gIsWidg});}}
function validateConfirmAdvDiv()
{doApply(gCurrApp.getApplyQS());}
function apnaExchangeDetails(currentForm)
{var monthlyIncome=apnaloan.trim(document.getElementById("mIncome").value).replace(/,/g,"");if(monthlyIncome=='')
{alert("Please Enter correct Monthly Income");return;}
var hasCreditCard=document.getElementById("hasCreditCard").value;if(hasCreditCard==''||hasCreditCard==0)
{alert("Please Mention the Credit Card avalibility");return;}
document.getElementById("apnaExchangeParam").style.display="none";if(currentForm=='defaultApply')
{window.askedForApnaExchange=true;return validateDefaultApplyForm(document.getElementById('defaultApplyForm'));}
else
{return validateApplyPopup();}}
function validateValidationNo(activationCode)
{var appliedTo=document.getElementById('thxtBankName').innerHTML;if(typeof(activationCode)=='undefined'||activationCode==null){activationCode=document.getElementById("validationCode").value;}
var smartTalkFlag=document.getElementById("smartTalkFlag").value;if(activationCode==''||isNaN(activationCode)||activationCode.length<4||activationCode.length>4)
{alert("Please enter correct validation code");return;}
document.getElementById('btnValidate').disabled=true;var axPolicy=document.getElementById("apnaExchangePolicy");var axPolicy1=document.getElementById("apnaExchangePolicy1");var apnaExchangePolicy;if((axPolicy!=null&&typeof(axPolicy)!='undefined'&&axPolicy.checked)||(axPolicy1!=null&&typeof(axPolicy1)!='undefined'&&axPolicy1.checked))
{apnaExchangePolicy='Y';}
var apnaExchangePopupElem=document.getElementById("apnaExchangePopup");var apnaExchangePopup=(apnaExchangePopupElem!=null&&typeof('apnaExchangePopupElem')!='undefined')?apnaExchangePopupElem.value:null;var formParams="activationCode="+activationCode+"&smartTalkFlag="+smartTalkFlag;var ajaxUrl="/ajax/validateActivationCode.html";var receiveReq=window.getXmlHttpRequestObject();if(receiveReq.readyState==4||receiveReq.readyState==0)
{receiveReq.open("POST",ajaxUrl,true);receiveReq.setRequestHeader("Content-type","application/x-www-form-urlencoded");receiveReq.setRequestHeader("Content-Length",formParams.length);receiveReq.onreadystatechange=function()
{if(receiveReq.readyState==4)
{var response=eval("("+receiveReq.responseText+")");if(response.statusCode=="0")
{document.getElementById("applyToDiv").style.display="block";document.getElementById("applyToDiv").innerHTML="Your application has been forwarded to "+document.getElementById('thxtBankName').innerHTML;document.getElementById('thankyou').style.display='';var msg='';if(window.leadId)
if(typeof(window.leadId)!='undefined'&&window.leadId)
{msg='Your application number is '+window.leadId+'.';window.leadId=null;}
else{msg='Your application has been logged.';}
if(response.firstApply=="false"&&apnaExchangePolicy=='Y')
{msg+="<br> <br> You have been registered in ApnaExchange as per your request.";}
document.getElementById('displayApplicationId').innerHTML=msg;currentDiv='thankyou';}
else
{document.getElementById('msgWrongVal').style.display='';var wrongMsg=errorMsg[parseInt(response.statusCode)];if(response.firstApply=="false"&&apnaExchangePolicy=='Y')
{wrongMsg+="<br> <br> You have been registered in ApnaExchange as per your request.";}
document.getElementById('msgWrongVal').innerHTML=wrongMsg;currentDiv='msgWrongVal';}
if(window.productId!=null&&googleConversionCode[window.productId]!='undefined')
{document.getElementById('gcc').innerHTML=googleConversionCode[window.productId];}
var closeStr='<img style="cursor:pointer;" src="/images/minithumb_b_close.gif" onclick="hidePopup(\'hint_msg\');"/>';document.getElementById('closePopup').innerHTML=closeStr;if(isMultipleOrder)
{document.getElementById('orderListDiv').style.display='';document.getElementById('orderList').innerHTML=createOrderListOnThxDiv();}else{currentBtn.disabled=true;}
document.getElementById('validation').style.display='none';document.getElementById('btnValidate').disabled=false;}};receiveReq.send(formParams);}}
function isReferable(variable)
{return typeof(variable)!='undefined'&&variable!=null}
function validateValidationNoForTriggerProcess(ref)
{var valdnCodeElemId="validationCode";var mobNoElemId="mobileNo";var thnxElemId="thankYouMsgDiv";var errorElemId="msgWrongVal";var resultElemId="userSelectedPrincipalResultDiv";var valdnCodeDivElemId="validationCodeDiv";var valdnBtnElemId="btnValidate";if(isReferable(ref))
{if(isReferable(ref.valdnCodeElemId)){valdnCodeElemId=ref.valdnCodeElemId;}
if(isReferable(ref.mobNoElemId)){mobNoElemId=ref.mobNoElemId;}
if(isReferable(ref.thnxElemId)){thnxElemId=ref.thnxElemId;}
if(isReferable(ref.errorElemId)){errorElemId=ref.errorElemId;}
if(isReferable(ref.resultElemId)){resultElemId=ref.resultElemId;}
if(isReferable(ref.valdnCodeDivElemId)){valdnCodeDivElemId=ref.valdnCodeDivElemId;}
if(isReferable(ref.valdnBtnElemId)){valdnBtnElemId=ref.valdnBtnElemId;}}
var activationCode=document.getElementById(valdnCodeElemId).value;if(activationCode==''||isNaN(activationCode)||activationCode.length<4||activationCode.length>4)
{alert("Please enter correct validation code");return;}
var mobileNo=document.getElementById(mobNoElemId).value;document.getElementById(valdnBtnElemId).disabled=true;var formParams="activationCode="+activationCode+"&mobileNo="+mobileNo;var ajaxUrl="/ajax/validateActivationCodeForTriggerProcess.html";var receiveReq=window.getXmlHttpRequestObject();if(receiveReq.readyState==4||receiveReq.readyState==0)
{receiveReq.open("POST",ajaxUrl,true);receiveReq.setRequestHeader("Content-type","application/x-www-form-urlencoded");receiveReq.setRequestHeader("Content-Length",formParams.length);receiveReq.onreadystatechange=function()
{if(receiveReq.readyState==4)
{var response=eval("("+receiveReq.responseText+")");if(response.statusCode=="0")
{document.getElementById(thnxElemId).style.display='block';}
else
{var errorElem=document.getElementById(errorElemId);errorElem.style.display='';errorElem.innerHTML=errorMsg[parseInt(response.statusCode)];}
var resultElem=document.getElementById(resultElemId);if(resultElem!=undefined)
{resultElem.style.display='none';}
var resut1Elem=document.getElementById(resultElemId+'1')
if(resut1Elem!=undefined)
{resut1Elem.style.display='none';}
document.getElementById(valdnCodeDivElemId).style.display='none';document.getElementById(valdnBtnElemId).disabled=false;}};receiveReq.send(formParams);}}
function setBankIdAndSubmit(formId,bankId,orderId)
{if(showAlert(formId,bankId,orderId,'setBankAndSubmit','setBankIdAndSubmit','','','','',''))
{var urlPath=location.pathname;var productName=urlPath.slice(0,urlPath.indexOf("/",1));document.getElementById('bankId').value=bankId;document.getElementById('orderId').value=orderId;document.getElementById(formId).action=productName+"/compare-result.html";document.getElementById(formId).method="POST";document.getElementById(formId).submit();}}
function setBankIdAndSubmitHealth(formId,bankId,orderId,widgetOrNot)
{if(showAlert(formId,bankId,orderId,'setBankAndSubmit','setBankIdAndSubmitHealth','','','','',''))
{var urlPath=location.pathname;var productName=urlPath.slice(0,urlPath.indexOf("/",1));document.getElementById('bankId').value=bankId;document.getElementById('orderId').value=orderId;if(widgetOrNot==true)
{document.getElementById(formId).action="/widget/health-insurance-india/comparator-result.html";}
else
{document.getElementById(formId).action=productName+"/compare-result.html";}
document.getElementById(formId).method="POST";document.getElementById(formId).submit();}}
function setBankIdAndSubmitTerm(formId,bankId,orderId,widgetOrNot)
{if(showAlert(formId,bankId,orderId,'setBankAndSubmit','setBankIdAndSubmitTerm','','','','',''))
{document.getElementById('bankId').value=bankId;document.getElementById('orderId').value=orderId;if(widgetOrNot==true)
{document.getElementById(formId).action="/widget/term-insurance-india/comparator-result.html";}
else
{document.getElementById(formId).action="/term-insurance-india/comparator-result.html";}
document.getElementById(formId).method="POST";document.getElementById(formId).submit();}}
function setBankIdAndSubmitCriticalIllness(formId,bankId,orderId,widgetOrNot)
{if(showAlert(formId,bankId,orderId,'setBankAndSubmit','setBankIdAndSubmitCriticalIllness','','','','',''))
{document.getElementById('bankId').value=bankId;document.getElementById('orderId').value=orderId;if(widgetOrNot==true)
{document.getElementById(formId).action="/widget/health-insurance-india/critical-illness-comparator-result.html";}
else
{document.getElementById(formId).action="/health-insurance-india/critical-illness-comparator-result.html";}
document.getElementById(formId).method="POST";document.getElementById(formId).submit();}}
function check_brwz()
{function browser()
{this.name=navigator.appName;this.version=navigator.appVersion;}
browse=new browser();if(browse.name=='Netscape')
{return 60;}
else if(browse.name=='Microsoft Internet Explorer')
{return 30;}
return 30;}
function trim(str)
{return str.replace(/(?:(?:^|\n)\s+|\s+(?:$|\n))/g,"").replace(/\s+/g," ");}
function validateMobile(mobileNo,countryCode)
{if(mobileNo==''||isNaN(mobileNo))
{alert('Please enter your mobile number');return false;}
if(mobileNo.substring(0,1)=='0')
{alert('Please dont start no with 0');return false;}
if(countryCode==91&&((mobileNo.substring(0,1)!='9'&&mobileNo.substring(0,1)!='8'&&mobileNo.substring(0,1)!='7')||mobileNo.length!=10))
{alert('Please enter correct mobile no');return false;}
var regex2=/^[\d]{10}$/;if(countryCode!=91)
{regex2=/^[\d]+$/;}
if(!regex2.test(mobileNo))
{alert("Please enter mobile number without any spaces or hyphens");return false;}
return true;}
function getContactDetail()
{var formParams;document.getElementById('msgWrongVal').style.display='';document.getElementById('msgWrongVal').innerHTML='';if(apnaloan.isNull(gCurrApp))
{var mobile=apnaloan.trim(document.getElementById('getMobileNo').value);var countryCode=document.getElementById('countryCodeGCD').value;var email=document.getElementById('getEmail').value;var name=apnaloan.trim(document.getElementById('getName').value);var city=document.getElementById('city');if(city.value==0)
{alert('Please select city');city.focus();return;}
if(name=='')
{alert('Please enter your Name');return;}
if(countryCode==0)
{alert("Please select country code");return;}
if(!validateMobile(mobile,countryCode))
{return;}
if(!validateEmail(email))
{return false;}
var elemJourneyTag=document.getElementById('jTag');var jTag='';if(apnaloan.isNotNull(elemJourneyTag)){jTag=elemJourneyTag.value;}
var productId=document.getElementById('productId').value;window.productId=productId;var cityId=document.getElementById('cityId').value;formParams="mobile="+mobile+"&countryCode="+countryCode+"&email="+email+"&name="+name;document.getElementById('btnSend').disabled=true;formParams+="&isBank=true&principalId="+bankId+"&listingContactId="+listingContactId+"&productId="+productId+"&cityId="+cityId;formParams+="&"+getSourceQueryString(jTag);if(typeof(document.txnInfo)!='undefined'&&document.txnInfo&&document.txnInfo.offeringId){formParams+='&policyId='+document.txnInfo.offeringId;}}
else
{formParams=gCurrApp.getGPNQS();}
if(document.getElementById('validationCodeGCD').value!='')
{formParams+="&activationCode="+document.getElementById('validationCodeGCD').value;document.getElementById('validationCodeGCD').value='';}
if(typeof(window.xmlData)!='undefined'&&window.xmlData){formParams+=xmlData();}
var ajaxUrl="/ajax/getContactDetails.html";var receiveReq=window.getXmlHttpRequestObject();if(receiveReq.readyState==4||receiveReq.readyState==0)
{receiveReq.open("POST",ajaxUrl,true);receiveReq.setRequestHeader("Content-type","application/x-www-form-urlencoded");receiveReq.setRequestHeader("Content-Length",formParams.length);receiveReq.onreadystatechange=function()
{if(receiveReq.readyState==4)
{var response=eval("("+receiveReq.responseText+")");document.getElementById('mobileNumber').style.display='none';try{response.statusCode=parseInt(response.statusCode);if(response.statusCode==0)response.statusCode=6;if(response.statusCode==1)
{document.getElementById('validationGCD').style.display='';currentDiv='validationGCD';}
else if(response.statusCode>=0)
{document.getElementById('validationGCD').style.display='none';document.getElementById('mobileNumberMsg').style.display='';document.getElementById('mobileNumberMsg').innerHTML=errorMsg[response.statusCode];currentDiv='mobileNumberMsg';currentBtn.disabled=true;}}catch(e){alert('Sorry, looks like the response ('+receiveReq.statusCode+') was invalid: '+e);}
if(window.productId!=null&&googleConversionCode[window.productId]!='undefined')
{document.getElementById('gcc').innerHTML=googleConversionCode[window.productId];}
document.getElementById('btnSend').disabled=false;}};receiveReq.send(formParams);}}
function getComparatorElementValue(elem)
{if(elem.nodeName=='select'||elem.nodeName=='SELECT'){return elem.selectedIndex>=0&&elem.selectedIndex<elem.options.length?elem.options[elem.selectedIndex].value:null;}
if(elem.nodeName=='input'||elem.nodeName=='INPUT'){if(typeof(elem.type)=='undefined'){return typeof(elem.value)!='undefined'?elem.value:null;}
var type=elem.type.toLowerCase();if(type=='submit'||type=='reset'||type=='button')return null;if(type=='radio')return elem.checked?elem.value:null;if(type=='checkbox')return elem.checked?elem.value:null;return elem.value;}
return null;}
function getComparatorFormDataKeyValuePair(elem)
{var name=(typeof(elem)!='undefined'&&typeof(elem.id)!='undefined'&&elem.id!='')?elem.id:elem.name;if(!name||name==''||name=='cx'||name=='cof'||name=='site'||name=='resetFunction')return null;var value=getComparatorElementValue(elem);if(!value)return null;return'frc_'+name+'='+encodeURIComponent(value);}
function getComparatorFormDataForTracking()
{var nodes=document.getElementsByTagName('input'),i,str,result='';for(i in nodes){if((str=getComparatorFormDataKeyValuePair(nodes[i])))result+='&'+str;}
nodes=document.getElementsByTagName('select');for(i in nodes){if((str=getComparatorFormDataKeyValuePair(nodes[i])))result+='&'+str;}
return result;}
function reportTxnClick(elem,txnType,offeringId,orderIndex)
{if(typeof(offeringId)!='undefined'&&offeringId){var position,listType='none';try{var spnid=elem.parentNode.parentNode.id;position=parseInt(spnid.replace(/^.+rowaction_([0-9]+)$/g,"$1"));if(spnid.match(/^sponrow.+$/g))listType='spon';else if(spnid.match(/^fullrow.+$/g))listType='full';if(isNaN(position))position=-1;}catch(e){position=-1;};try{var curi=document.location.href.replace(/^http:\/\/[^\/]+/g,'');var oajax=getXmlHttpRequestObject();var orderId=(typeof(orderIndex)!='undefined'&&orderIndex)?orderArray[orderIndex][0]['orderId']:-1;oajax.open('GET','/ajax/reportTxnClick.html?r='+(new Date().getTime())+'&location='+encodeURIComponent(curi)+'&txnType='+encodeURIComponent(txnType)+'&offeringId='+offeringId+'&pos='+position+'&orderId='+orderId+'&listType='+encodeURIComponent(listType)+getComparatorFormDataForTracking(),true);oajax.onreadystatechange=function(){};oajax.send(null);}catch(e){}}}
function popMobileSetting(sMode,sElementName,sElement,sWidth,sTop,flagIsBank,pBankId,listingContactId,offeringId,listing)
{if(apnaloan.isNotNull(gCurrApp))
{gCurrApp.listingContactId=listingContactId;gCurrApp.policyId=offeringId;gCurrApp.principalId=pBankId;}
if(document.getElementById('t&c1').checked==false)
{document.getElementById('btnSend').disabled=true;}
if(document.getElementById('t&c1').checked==true)
{document.getElementById('btnSend').disabled=false;}
if(currentDiv!='')
{document.getElementById(currentDiv).style.display='none';}
if(chngDetailsPopup())
{document.txnInfo=null;if(typeof(offeringId)!='undefined'&&offeringId)handleTxn(sElement,'gpn',offeringId,null);if(currentDiv!='')
{document.getElementById(currentDiv).style.display='none';}
document.getElementById('mobileNumber').style.display='';document.getElementById('validationGCD').style.display='none';document.getElementById('apply').style.display='none';document.getElementById('validation').style.display='none';document.getElementById('thankyou').style.display='none';document.getElementById('orderListDiv').style.display='none';var str='<img style="cursor:pointer;" src="/images/minithumb_b_close.gif" onclick="hidePopup(\'hint_msg\');"/>';document.getElementById('closePopup').innerHTML=str;this.bankId=pBankId;this.listingContactId=listingContactId;isBank=flagIsBank;currentBtn=sElement;currentDiv='mobileNumber';showPopup(sMode,sElementName,sElement,sWidth,sTop);var productId=document.getElementById('productId').value;var jTag=document.getElementById('jTag').value;var city=document.getElementById('city').value;reportClick(listingContactId,pBankId,productId,jTag,city);}}
function setParameterForProduct(product,productInfo)
{var url="";var selectedProduct=null;switch(product)
{case 1:url='home-loan-india';break;case 2:url='personal-loan-india';break;case 3:url='credit-card-india';break;case 4:url='car-loan-india';break;case 5:url='education-loan-india';break;case 12:url='loan-against-property-india';break;case 7:url='life-insurance-india';if(productInfo!=null)
{switch(productInfo)
{case 1:selectedProduct='term';break;case 2:selectedProduct='endowment';break;case 3:selectedProduct='child';break;case 4:selectedProduct='ulip';break;case 5:selectedProduct='penp';break;case 6:selectedProduct='wli';break;case 7:selectedProduct='mbp';break;}}
break;case 8:url='health-insurance-india';break;case 9:url='auto-insurance-india';break;case 10:url='home-insurance-india';break;case 11:url='travel-insurance-india';break;}
var leadId=document.getElementById('leadId').value;var journey=document.getElementById('journey').value;if(journey=="abandoned")
{location.href="/"+url+"/smartApplicationForCdo.html?leadId="+leadId+"&journey=abandoned"+(selectedProduct==null?" ":("&selected="+selectedProduct));}else{location.href="/"+url+"/apply.html"+(selectedProduct==null?" ":("?selected="+selectedProduct));}}
function switchUrlForPreferredBank(product)
{var url="";(product=='hl')?url='home-loan-india':(product=='pl')?url='personal-loan-india':(product=='cl')?url='car-loan-india':(product=='lap')?url='loan-against-property-india':(product=='bl')?url='loan-against-property-india':(product=='el')?url='education-loan-india':(product=='life')?url='life-insurance-india':(product=='critical')?url='health-insurance-india':(product=='health')?url='health-insurance-india':(product=='auto')?url='car-insurance-india':(product=='householder')?url='home-insurance-india':(product=='travel')?url='travel-insurance-india':url='credit-card-india';location.href="/"+url+"/search.html";}
function validateApplyForm(formobj)
{var product=document.getElementsByName('productType');var flag=true;var selectProduct;for(i=0;i<product.length;i++)
{if(product[i].checked==true)
{flag=false;selectProduct=product[i].id;}}
if(flag)
{alert('Please select product');return false;}
if(document.getElementById('city').value==0)
{alert('Please select City of residence');return false;}
if(document.getElementById('countryCode').value==0)
{alert('Please select country code');return false;}
var name=apnaloan.trim(document.getElementById('name').value);if(name=='')
{alert('Please enter your Name');return false;}
var countryCode=document.getElementById('countryCode').value;var mobile=apnaloan.trim(document.getElementById('mobile').value);if(mobile==''||isNaN(mobile)||(countryCode==91&&((mobile.substring(0,1)!='9'&&mobile.substring(0,1)!='8'&&mobile.substring(0,1)!='7')||mobile.length!=10)))
{alert('Please enter your mobile number');return false;}
var loanAmount=apnaloan.trim(document.getElementById('loanAmount').value);if(loanAmount==''||isNaN(loanAmount))
{alert('Please enter your loan Amount');return false;}
var email=apnaloan.trim(document.getElementById('email').value);if(!validateEmail(email))
{return false;}
var monthlyIncome=apnaloan.trim(document.getElementById('monthlyIncome').value).replace(/,/g,"");if(monthlyIncome==''||isNaN(monthlyIncome))
{alert('Please enter your monthly Income');return false;}
var dobDay=document.getElementById('dobDay').value;var dobMonth=document.getElementById('dobMonth').value;var dobYear=document.getElementById('dobYear').value;if(dobDay==0||dobMonth==0||dobYear==0)
{alert('Please select your date of Birth');return false;}
var residentialstatus=(document.getElementById('is_nri_n').checked==document.getElementById('is_nri_y').checked)?true:false;if(residentialstatus)
{alert('Please select residential status');return false;}
var professionType=document.getElementById('professionType').value;if(professionType==0)
{alert('Please select profession');return false;}
if(selectProduct=="hl")
{var subProduct=document.getElementById('subProduct').value;if(subProduct==0)
{alert('Please select purpose of loan');return false;}
var property=(document.getElementById('property_in_same_city_y').checked==document.getElementById('property_in_same_city_n').checked)?true:false;if(property)
{alert('Please select property in same city yes or no');return false;}}
if(selectProduct=="pl")
{var totalEMI=apnaloan.trim(document.getElementById('totalEMI').value);if(totalEMI==''||isNaN(totalEMI))
{alert('Please enter your total EMI');return false;}
var houseowner=(document.getElementById('house_ownership_y').checked==document.getElementById('house_ownership_n').checked)?true:false;if(houseowner)
{alert('Please select house ownership yes or no');return false;}}
if(selectProduct=="cl")
{var manufacturer=apnaloan.trim(document.getElementById('manufacturer').value);if(manufacturer=='')
{alert('Please enter manufacturer');return false;}
var carType=(document.getElementById('type_of_car_new').checked==document.getElementById('type_of_car_old').checked)?true:false;if(carType)
{alert('Please select car Type');return false;}}
if(document.getElementById('pan').style.display!='none')
{var pan=(document.getElementById('pan_y').checked==document.getElementById('pan_n').checked)?true:false;if(pan)
{alert('Please select pan Card yes or no');return false;}}
if(document.getElementById('cardExist').style.display!='none')
{var existingCard=(document.getElementById('existing_card_y').checked==document.getElementById('existing_card_n').checked)?true:false;if(existingCard)
{alert('Please select existing Card yes or no');return false;}}
var url="";(selectProduct=='hl')?url='home-loan-india':(selectProduct=='pl')?url='personal-loan-india':(selectProduct=='cl')?url='car-loan-india':(selectProduct=='lap')?url='loan-against-property-india':(selectProduct=='bl')?url='loan-against-property-india':(selectProduct=='el')?url='education-loan-india':url='credit-card-india';if(document.getElementById("journey")&&document.getElementById("journey").value=="abandoned")
{document.getElementById('smartSearchfrm').action="/"+url+"/smartSearchForCdo.html";}
else
{document.getElementById('smartSearchfrm').action="/"+url+"/smart-result.html";}
return true;}
function validateApplyFormInsurance(formobj)
{var product=document.getElementsByName('productType');var journey=document.getElementById('journey').value;var flag=true;var selectProduct;for(i=0;i<product.length;i++)
{if(product[i].checked==true)
{flag=false;selectProduct=product[i].id;}}
if(flag)
{alert('Please select product');return false;}
if(document.getElementById('city').value==0)
{alert('Please select City of residence');return false;}
if(document.getElementById('countryCode').value==0)
{alert('Please select country code');return false;}
var countryCode=document.getElementById('countryCode').value;var mobile=apnaloan.trim(document.getElementById('mobile').value);if(mobile==''||isNaN(mobile)||(countryCode==91&&((mobile.substring(0,1)!='9'&&mobile.substring(0,1)!='8'&&mobile.substring(0,1)!='7')||mobile.length!=10)))
{alert('Please enter your mobile number');return false;}
var monthlyIncome=apnaloan.trim(document.getElementById('monthlyIncome').value).replace(/,/g,"");if(monthlyIncome==''||isNaN(monthlyIncome))
{alert('Please enter your monthly Income');return false;}
var email=apnaloan.trim(document.getElementById('email').value);if(!validateEmail(email))
{return false;}
var name=apnaloan.trim(document.getElementById('name').value);if(name=='')
{alert('Please enter your Name');return false;}
var dobDay=document.getElementById('dobDay').value;var dobMonth=document.getElementById('dobMonth').value;var dobYear=document.getElementById('dobYear').value;if(dobDay==0||dobMonth==0||dobYear==0)
{alert('Please select your date of Birth');return false;}
var residentialstatus=(document.getElementById('is_nri_n').checked==document.getElementById('is_nri_y').checked)?true:false;if(residentialstatus)
{alert('Please select residential status');return false;}
var professionType=document.getElementById('professionType').value;if(professionType==0)
{alert('Please select profession');return false;}
if(document.getElementById('has_credit_card_y')!=null)
{var existingCard=(document.getElementById('has_credit_card_y').checked==document.getElementById('has_credit_card_n').checked)?true:false;if(existingCard)
{alert('Have credit Card yes or no');return false;}}
var url="";(selectProduct=='li')?url='life-insurance-india':(selectProduct=='hi')?url='health-insurance-india':(selectProduct=='hhi')?url='home-insurance-india':(selectProduct=='ai')?url='car-insurance-india':url='travel-insurance-india';if(selectedProduct=='term'||selectedProduct=='end'||selectedProduct=='chip')
{url='life-insurance-india';}
if(journey=="abandoned")
{document.getElementById('smartSearchfrm').action="/"+url+"/smartSearchForCdo.html";}
else
{document.getElementById('smartSearchfrm').action="/"+url+"/smart-result.html";}
return true;}
function SortComparatorTable(tableEl,varStr)
{this.tbody=tableEl.getElementsByTagName('tbody');this.thead=tableEl.getElementsByTagName('thead');this.tfoot=tableEl.getElementsByTagName('tfoot');this.getInnerText=function(el)
{if(typeof(el.textContent)!='undefined')return el.textContent;if(typeof(el.innerText)!='undefined')return el.innerText;if(typeof(el.innerHTML)=='string')return el.innerHTML.replace(/<[^<>]+>/g,'');}
this.getParent=function(el,pTagName)
{if(el==null)
return null;else if(el.nodeType==1&&el.tagName.toLowerCase()==pTagName.toLowerCase())
return el;else
return this.getParent(el.parentNode,pTagName);}
this.sort=function(cell)
{if((cell.className.search('nosort'))!=-1)
{return;}
var column=cell.cellIndex;var rowCount=this.tbody[0].rows.length;for(i=0;i<rowCount;i++)
{if(this.tbody[0].rows[i].cells[column].innerHTML=="NA"||this.tbody[0].rows[i].cells[column].innerHTML=="9999999999999")
{if(cell.getAttribute("sortdir")=='down')
this.tbody[0].rows[i].cells[column].innerHTML="-100";else
this.tbody[0].rows[i].cells[column].innerHTML="9999999999999";}}
var itm=this.getInnerText(this.tbody[0].rows[1].cells[column]);var sortfn=this.sortCaseInsensitive;if(itm.match(/\d\d[-]+\d\d[-]+\d\d\d\d/))sortfn=this.sortDate;if(itm.replace(/^\s+|\s+$/g,"").match(/^[\d\.]+$/))sortfn=this.sortNumeric;this.sortColumnIndex=column;var newRows=new Array();for(j=0;j<this.tbody[0].rows.length;j++)
{newRows[j]=this.tbody[0].rows[j];}
newRows.sort(sortfn);if(cell.getAttribute("sortdir")=='down')
{newRows.reverse();cell.style.background="url(/images/up.gif) no-repeat";cell.setAttribute('sortdir','up');}
else
{cell.style.background="url(/images/down.gif) no-repeat";cell.setAttribute('sortdir','down');}
for(i=0;i<newRows.length;i++)
{this.tbody[0].appendChild(newRows[i]);if(i%2==0)
{newRows[i].style.backgroundColor="#f3f1e9";}
else
{newRows[i].style.backgroundColor="";}}
var rowCount=this.tbody[0].rows.length;for(i=0;i<rowCount;i++)
{if(this.tbody[0].rows[i].cells[column].innerHTML=="-100")
{this.tbody[0].rows[i].cells[column].innerHTML="NA";}
if(this.tbody[0].rows[i].cells[column].innerHTML=="9999999999999")
{this.tbody[0].rows[i].cells[column].innerHTML="NA";}}}
this.sortCaseInsensitive=function(a,b)
{aa=thisObject.getInnerText(a.cells[thisObject.sortColumnIndex]).toLowerCase();bb=thisObject.getInnerText(b.cells[thisObject.sortColumnIndex]).toLowerCase();if(aa==bb)return 0;if(aa<bb)
{return-1;}
else{return 1;}}
this.sortDate=function(a,b)
{aa=thisObject.getInnerText(a.cells[thisObject.sortColumnIndex]);bb=thisObject.getInnerText(b.cells[thisObject.sortColumnIndex]);date1=aa.substr(6,4)+aa.substr(3,2)+aa.substr(0,2);date2=bb.substr(6,4)+bb.substr(3,2)+bb.substr(0,2);if(date1==date2)return 0;if(date1<date2)return-1;return 1;}
this.sortNumeric=function(a,b)
{aa=parseFloat(thisObject.getInnerText(a.cells[thisObject.sortColumnIndex]));if(isNaN(aa))aa=0;bb=parseFloat(thisObject.getInnerText(b.cells[thisObject.sortColumnIndex]));if(isNaN(bb))bb=0;if(varStr=="desc")
return bb-aa;else
return aa-bb;}
var thisObject=this;var sortSection=this.thead;if(!(this.tbody&&this.tbody[0].rows&&this.tbody[0].rows.length>0))return;if(sortSection&&sortSection[0].rows&&sortSection[0].rows.length>0)
{var sortRow=sortSection[0].rows[0];}
else
{return;}
for(var i=0;i<sortRow.cells.length;i++)
{sortRow.cells[i].sTable=this;sortRow.cells[i].onclick=function()
{this.sTable.sort(this);}}}
function setHiddenValue(obj,id)
{if(obj.selectedIndex!=0)
{document.getElementById(id).value=obj.options[obj.selectedIndex].text;}else{document.getElementById(id).value="";}}
function hideAllDivOnPop()
{document.getElementById('apply').style.display='none';document.getElementById('validation').style.display='none';document.getElementById('thankyou').style.display='none';document.getElementById('mobileNumber').style.display='none';document.getElementById('msgWrongVal').style.display='none';document.getElementById('orderListDiv').style.display='none';}
function validationPopSetting(sMode,sElementName,sElement,sWidth,sTop,buyerName,orderId,principalId)
{window.productId=document.getElementById('productId').value;var orderType=checkOrderType(orderId);var city=document.getElementById("cityId").value;var jTag=document.getElementById("jTag").value;reportClick(orderId,principalId,window.productId,jTag,city);if(orderType==8)
{var url=document.domain+'/redir.html?rc=lo&oi='+orderId+'&pi='+document.getElementById('productId')+'&ci='+document.getElementById('productId')+'&jTag=ss';myRef=window.open(url,'Apply','left=20,top=20,resizable=1,width=600,height=800');myRef.focus();sElement.disabled=true;return;}else{hideAllDivOnPop();document.getElementById('commonLoadingImage').style.display='';this.orderId=orderId;var formParams="orderId="+orderId+"&principalId="+principalId;var ajaxUrl="/ajax/smartSearchApply.html";var receiveReq=window.getXmlHttpRequestObject();document.getElementById('campaignPixel').innerHTML='';if(receiveReq.readyState==4||receiveReq.readyState==0)
{receiveReq.open("POST",ajaxUrl,true);receiveReq.setRequestHeader("Content-Length",formParams.length);receiveReq.setRequestHeader("Content-Type","application/x-www-form-urlencoded")
receiveReq.onreadystatechange=function()
{if(receiveReq.readyState==4)
{document.getElementById('commonLoadingImage').style.display='none';var response=eval("("+receiveReq.responseText+")");if(response.statusCode=="0")
{document.getElementById('thankyou').style.display='';document.getElementById('displayApplicationId').innerHTML='Your application number is '+response.leadId+'.';currentDiv='thankyou';currentBtn.disabled=true;}
else if(response.statusCode=="1")
{document.getElementById('validation').style.display='';currentDiv='validation';}else
{document.getElementById('msgWrongVal').style.display='';document.getElementById('msgWrongVal').innerHTML=errorMsg[parseInt(response.statusCode)];currentDiv='msgWrongVal';currentBtn.disabled=true;}
if(window.productId!=null&&googleConversionCode[window.productId]!='undefined')
{document.getElementById('gcc').innerHTML=googleConversionCode[window.productId];}}};receiveReq.send(formParams);}
document.getElementById('thxtBankName').innerHTML=buyerName;currentBtn=sElement;showPopup(sMode,sElementName,sElement,sWidth,sTop);}}
function validationPopSettingMarketPlace(sMode,sElementName,sElement,sWidth,sTop,buyerName,orderId,principalId)
{window.productId=document.getElementById('productId').value;if(currentDiv!='')
{document.getElementById(currentDiv).style.display='none';}
var orderType=checkOrderType(orderId);var jTag=document.getElementById('jTag').value;var city=document.getElementById('cityId').value;reportClick(orderId,principalId,window.productId,jTag,city);if(orderType==8)
{var url='/redir.html?rc=lo&oi='+orderId+'&pi='+document.getElementById('productId').value+'&ci='+document.getElementById('cityId').value+'&jTag='+document.getElementById('jTag').value;myRef=window.open(url,'Apply','left=20,top=20,resizable=1,width=600,height=800');myRef.focus();sElement.disabled=true;return;}else{hideAllDivOnPop();document.getElementById('commonLoadingImage').style.display='';this.orderId=orderId;this.principalId=principalId;var formParams="orderId="+orderId+"&principalId="+principalId;var ajaxUrl="/ajax/marketPlaceApply.html";var receiveReq=window.getXmlHttpRequestObject();document.getElementById('campaignPixel').innerHTML='';if(receiveReq.readyState==4||receiveReq.readyState==0)
{receiveReq.open("POST",ajaxUrl,true);receiveReq.setRequestHeader("Content-Length",formParams.length);receiveReq.setRequestHeader("Content-Type","application/x-www-form-urlencoded")
receiveReq.onreadystatechange=function()
{if(receiveReq.readyState==4)
{document.getElementById('commonLoadingImage').style.display='none';var response=eval("("+receiveReq.responseText+")");if(response.statusCode=="0")
{document.getElementById('thankyou').style.display='';document.getElementById('displayApplicationId').innerHTML='Your application number is '+response.leadId+'.';currentDiv='thankyou';currentBtn.disabled=true;}
else if(response.statusCode=="1")
{document.getElementById('validation').style.display='';window.leadId=response.leadId;currentDiv='validation';}
else if(response.statusCode=="14")
{document.getElementById('msgWrongVal').style.display='';document.getElementById('msgWrongVal').innerHTML="You can apply to maximum 5 companies";currentDiv='msgWrongVal';currentBtn.disabled=true;}else
{document.getElementById('msgWrongVal').style.display='';document.getElementById('msgWrongVal').innerHTML=errorMsg[parseInt(response.statusCode)];currentDiv='msgWrongVal';currentBtn.disabled=true;}
if(window.productId!=null&&googleConversionCode[window.productId]!='undefined')
{document.getElementById('gcc').innerHTML=googleConversionCode[window.productId];}}};receiveReq.send(formParams);}
document.getElementById('thxtBankName').innerHTML=buyerName;currentBtn=sElement;showPopup(sMode,sElementName,sElement,sWidth,sTop);}}
function validationPopSettingThankYouPage(sMode,sElementName,sElement,sWidth,sTop,buyerName,orderId,principalId)
{window.productId=document.getElementById('productId').value;if(currentDiv!='')
{document.getElementById(currentDiv).style.display='none';}
var orderType=checkOrderType(orderId);var jTag=document.getElementById('jTag').value;var city=document.getElementById('city').value;reportClick(orderId,principalId,window.productId,jTag,city);if(orderType==8)
{var url='/redir.html?rc=lo&oi='+orderId+'&pi='+document.getElementById('productId').value+'&ci='+document.getElementById('cityId').value+'&jTag='+document.getElementById('jTag').value;myRef=window.open(url,'Apply','left=20,top=20,resizable=1,width=600,height=800');myRef.focus();sElement.disabled=true;return;}else{hideAllDivOnPop();document.getElementById('commonLoadingImage').style.display='';this.orderId=orderId;this.principalId=principalId;var formParams="";var journey='';if(document.getElementById("jTag")!=undefined&&document.getElementById("jTag")!=null&&document.getElementById("jTag").value!='')
{if(document.getElementById("jTag").value=="AUTOPOST")
{formParams=formParams+'jTag=AUTOPOST&'}else{formParams=formParams+'jTag='+jTag+'&'}}
if(principalId==null){}
else
{formParams=formParams+'principalId='+principalId+'&';}
formParams=formParams+"orderId="+orderId+"&custId="+document.getElementById('custId').value+"&productId="+document.getElementById('productId').value;var ajaxUrl="/ajax/thankYoupageApply.html";var receiveReq=window.getXmlHttpRequestObject();document.getElementById('campaignPixel').innerHTML='';if(receiveReq.readyState==4||receiveReq.readyState==0)
{receiveReq.open("POST",ajaxUrl,true);receiveReq.setRequestHeader("Content-Length",formParams.length);receiveReq.setRequestHeader("Content-Type","application/x-www-form-urlencoded")
receiveReq.onreadystatechange=function()
{if(receiveReq.readyState==4)
{document.getElementById('commonLoadingImage').style.display='none';var response=eval("("+receiveReq.responseText+")");if(response.statusCode=="0")
{document.getElementById('thankyou').style.display='';document.getElementById('displayApplicationId').innerHTML='Your application number is '+response.leadId+'.';currentDiv='thankyou';currentBtn.disabled=true;}
else if(response.statusCode=="1")
{document.getElementById('validation').style.display='';window.leadId=response.leadId;currentDiv='validation';}
else
{document.getElementById('msgWrongVal').style.display='';document.getElementById('msgWrongVal').innerHTML=errorMsg[parseInt(response.statusCode)];currentDiv='msgWrongVal';currentBtn.disabled=true;}
if(window.productId!=null&&googleConversionCode[window.productId]!='undefined')
{document.getElementById('gcc').innerHTML=googleConversionCode[window.productId];}}};receiveReq.send(formParams);}
document.getElementById('thxtBankName').innerHTML=buyerName;currentBtn=sElement;showPopup(sMode,sElementName,sElement,sWidth,sTop);}}
function hide(str)
{document.getElementById(str).style.display='none';}
function hideFloater(str)
{var cnt=document.getElementById('numRows').value;for(var i=1;i<=cnt;i++)
{if(document.getElementById('relation'+i).value==0)
{alert("Please enter all values");return;}
if(document.getElementById('age'+i).value==0)
{alert("Please enter all values");return;}
if(document.getElementById('sumAssured'+i).value==0)
{alert("Please enter all values");return;}}
document.getElementById(str).style.display='none';}
function logoScrollerLeft(ulId,speed)
{this.container=document.getElementById(ulId);this.container.Scroller=this;this.speed=speed;this.scroll=function()
{var c=this.container.firstChild;var first=null;while(c)
{if(c.tagName=='LI')
{first=c;break;}
c=c.nextSibling;}
var nodeSize=78;var px=0;nodeSize=first.clientWidth;if(first.style.marginLeft!=''){px=parseInt(first.style.marginLeft);}
first.style.marginLeft=(px-1)+'px';if(parseInt(first.style.marginLeft)<=-(nodeSize)){first.style.marginLeft='0px';this.container.removeChild(first);this.container.appendChild(first);}
setTimeout('document.getElementById(\''+this.container.id+'\').Scroller.scroll()',this.speed);}
setTimeout('document.getElementById(\''+ulId+'\').Scroller.scroll()',this.speed);}
function logoScrollerRight(ulId,speed)
{this.container=document.getElementById(ulId);this.container.Scroller=this;this.speed=speed;this.scroll=function()
{alert(this.container.lastChild);var c=this.container.lastChild;var first=null;while(c)
{if(c.tagName=='LI')
{first=c;break;}
c=c.nextSibling;}
var nodeSize=78;var px=0;nodeSize=first.clientWidth;if(first.style.marginRight!=''){px=parseInt(first.style.marginRight);}
first.style.marginRight=(px-1)+'px';if(parseInt(first.style.marginRight)<=-(nodeSize)){first.style.marginRight='0px';this.container.removeChild(first);this.container.appendChild(first);}
setTimeout('document.getElementById(\''+this.container.id+'\').Scroller.scroll()',this.speed);}
setTimeout('document.getElementById(\''+ulId+'\').Scroller.scroll()',this.speed);}
function setDivHeWi(flag)
{sElement=document.getElementById('mainDiv');sLeftPos=0;sTopPos=0;while(sElement)
{sLeftPos+=sElement.offsetLeft;sTopPos+=sElement.offsetTop;sElement=sElement.offsetParent;}
document.getElementById('blockDiv').style.height=document.getElementById('mainDiv').offsetHeight+'px';document.getElementById('blockDiv').style.width=document.getElementById('mainDiv').offsetWidth+'px';document.getElementById('blockDiv').style.left=sLeftPos+'px';document.getElementById('blockDiv').style.top=sTopPos+'px';}
if(document.layers){document.captureEvents(Event.MOUSEMOVE);document.onmousedown=captureMousePosition;document.onmousemove=captureMousePosition;}else if(document.all){document.onmousedown=captureMousePosition;document.onmousemove=captureMousePosition;}else if(document.getElementById){document.onmousedown=captureMousePosition;document.onmousemove=captureMousePosition;}
xMousePos=0;yMousePos=0;xMousePosMax=0;yMousePosMax=0;function captureMousePosition(e){if(document.layers){xMousePos=e.pageX;yMousePos=e.pageY;xMousePosMax=window.innerWidth+window.pageXOffset;yMousePosMax=window.innerHeight+window.pageYOffset;}else if(document.all){xMousePos=window.event.x+document.body.scrollLeft;yMousePos=window.event.y+document.body.scrollTop;xMousePosMax=document.body.clientWidth+document.body.scrollLeft;yMousePosMax=document.body.clientHeight+document.body.scrollTop;}else if(document.getElementById){xMousePos=e.pageX;yMousePos=e.pageY;xMousePosMax=window.innerWidth+window.pageXOffset;yMousePosMax=window.innerHeight+window.pageYOffset;}}
var tempsMode,tempsElementName,tempsElement,tempsWidth,tempsTop,tempactiveDiv,tempbankName,tempimage,tempaddress,temporder,tempOTI,tempPI;function showAlert(sMode,sElementName,sElement,sWidth,sTop,activeDiv,bankName,image,address,order,oti,pi)
{if(document.getElementById('defaultValue')==null||document.getElementById('defaultValue').value!='true')
{return true;}
if(document.getElementById('defaultValue').value=='true')
{setDivHeWi();document.getElementById('blockDiv').style.opacity=0.4;document.getElementById('blockDiv').style.filter='alpha(opacity = 40)';document.getElementById('blockDiv').style.backgroundColor="#E1E1E1";if(oElement=eval(document.getElementById('alertPop')))
{var x=xMousePos;var y=yMousePos;if((x+417)>xMousePosMax)
{oElement.style.left=(xMousePosMax-500)+'px';}
else{oElement.style.left=x;}
if((y+250)>yMousePosMax)
{oElement.style.top=(yMousePosMax-250)+'px';}
else{oElement.style.top=y;}
oElement.style.display='inline';tempsMode=sMode;tempsElementName=sElementName;tempsElement=sElement;tempsWidth=sWidth;tempsTop=sTop;tempactiveDiv=activeDiv;tempbankName=bankName;tempimage=image;tempaddress=address;temporder=order;tempOTI=oti;tempPI=pi;}
return false;}}
function chngDetailsPopup()
{if(document.getElementById('defaultValue')==null||document.getElementById('defaultValue').value!='true')
{return true;}
if(document.getElementById('defaultValue').value=='true')
{setDivHeWi();document.getElementById('blockDiv').style.opacity=0.4;document.getElementById('blockDiv').style.filter='alpha(opacity = 40)';document.getElementById('blockDiv').style.backgroundColor="#E1E1E1";if(oElement=eval(document.getElementById('alertPop')))
{var x=xMousePos;var y=yMousePos;if((x+417)>xMousePosMax)
{oElement.style.left=(xMousePosMax-500)+'px';}
else{oElement.style.left=x;}
if((y+250)>yMousePosMax)
{oElement.style.top=(yMousePosMax-250)+'px';}
else{oElement.style.top=y;}
oElement.style.display='inline';}
return false;}}
function allowApplyOrReset(action)
{document.getElementById('alertPop').style.display='none';document.getElementById('defaultValue').value=false;if(action=='reset')
{document.getElementById('btnHideShow').disabled=true;if(document.getElementById('userData').style.display=='none')
{document.getElementById('userData').style.display='';}
eval(document.getElementById('resetFunction').value);document.getElementById('showModifyMsg').innerHTML='Specify your criteria, click "Modify Results" and choose from relevant results';if(document.getElementById("modifyBtn")!=null)
{showChangeCriteria();}
window.scroll(0,150);setDivHeWi();return false;}else
{document.getElementById('blockDiv').style.height=0;document.getElementById('blockDiv').style.width=0;if(tempsWidth=='setBankAndSubmit')
{eval(tempsTop+'(\''+tempsMode+'\','+tempsElementName+','+tempsElement+')');}
else{popSetting(tempsMode,tempsElementName,tempsElement,tempsWidth,tempsTop,tempactiveDiv,tempbankName,tempimage,tempaddress,temporder,tempOTI,tempPI);}
return true;}}
function resetHomeLoanComp()
{document.getElementById("cityTextBox").value="Select a City";document.getElementById("city").value="0";document.getElementById("loanAmt").value="";document.getElementById("occupation").selectedIndex=0;document.getElementById("fixed").checked=false;document.getElementById("floating").checked=false;document.getElementById("both").checked=false;document.getElementById("age").selectedIndex=0;document.getElementById("loanAmt").focus();document.getElementById("btnHideShow").onclick="void(0);";document.getElementById("btnHideShow").onmouseover="void(0);";if(document.getElementById("offeringTypeId").value==20)
{document.getElementById("monthlyIncome").value="";document.getElementById("tenureMonths").value="";document.getElementById("tenure").value="";}
else
{document.getElementById("coAppYes").checked=false;document.getElementById("coAppNo").checked=false;document.getElementById("coAppMonthlyIncome").value="";document.getElementById("monthlyIncomeSingle").value="";document.getElementById("tenure").selectedIndex=0;}}
function resetPersonalLoanComp()
{document.getElementById("city").selectedIndex=0;document.getElementById("loanAmt").value="";document.getElementById("monthlyIncome").value="";document.getElementById("occupation").selectedIndex=0;document.getElementById("fixed").checked=false;document.getElementById("floating").checked=false;document.getElementById("both").checked=false;document.getElementById("age").selectedIndex=0;document.getElementById("tenure").selectedIndex=0;document.getElementById("existEMIYes").checked=false;document.getElementById("existEMINo").checked=false;document.getElementById("existingEmi").value="";}
function resetCarLoanComp()
{document.getElementById("city").selectedIndex=0;document.getElementById("loanAmt").value="";document.getElementById("tenure").selectedIndex=0;document.getElementById("occupation").selectedIndex=0;document.getElementById("fixed").checked=false;document.getElementById("floating").checked=false;document.getElementById("both").checked=false;document.getElementById("age").selectedIndex=0;document.getElementById("monthlyIncome").value="";document.getElementById("modifyResults").value="Modify Results";document.getElementById("loanAmt").focus();document.getElementById("btnHideShow").onclick="void(0);";document.getElementById("btnHideShow").onmouseover="void(0);";if(document.getElementById("carType").value=="Old")
{document.getElementById("oldCarAge").selectedIndex=0;}}
function resetLAPComp()
{document.getElementById("city").selectedIndex=0;document.getElementById("loanAmt").value="";document.getElementById("monthlyIncome").value="";document.getElementById("occupation").selectedIndex=0;document.getElementById("fixed").checked=false;document.getElementById("floating").checked=false;document.getElementById("age").selectedIndex=0;document.getElementById("tenure").selectedIndex=0;document.getElementById("propertyValue").value="";}
function resetTermInsureComp()
{document.getElementById("city").selectedIndex=0;document.getElementById('gender').selectedIndex=0;document.getElementById('sumAssured').selectedIndex=0;document.getElementById('tenure').selectedIndex=0;document.getElementById('age').selectedIndex=0;document.getElementById('tmpApplicantName').value='Name';document.getElementById('tmpApplicantMobile').value='Mobile';document.getElementById('tmpApplicantEmail').value='Email';}
function resetCriticalInsureComp()
{document.getElementById("age").selectedIndex=0;document.getElementById("tenure").selectedIndex=0;document.getElementById("sumAssured").selectedIndex=0;document.getElementById("disease").selectedIndex=0;}
function resetHealthInsureComp()
{if(document.getElementById('planType').value=="INDIVIDUAL"||document.getElementById('planType').value=="SENIOR_CITIZEN")
{document.getElementById('myselfAge').selectedIndex=0;document.getElementById('myselfSumAssured').selectedIndex=0;}
else if(document.getElementById('planType').value=="FAMILY_FLOATER")
{document.getElementById('floaterFamilyCount').selectedIndex=0;document.getElementById('floaterAge').selectedIndex=0;document.getElementById('floaterSumAssured').selectedIndex=0;}
else if(document.getElementById('planType').value=="FAMILY_INDIVIDUAL")
{document.getElementById('individualFamilyCount').selectedIndex=0;for(i=1;i<=10;i++)
{document.getElementById('relation'+i).selectedIndex=0;document.getElementById('age'+i).selectedIndex=0;document.getElementById('sumAssured'+i).selectedIndex=0;}}
document.getElementById('city').selectedIndex=0;document.getElementById('tmpApplicantName').value='Name';document.getElementById('tmpApplicantMobile').value='Mobile';document.getElementById('tmpApplicantEmail').value='Email';}
function resetLifeInsuranceComp()
{document.getElementById("city").selectedIndex=0;document.getElementById("age").selectedIndex=0;}
function moveLeftMarquee()
{var marquee=document.getElementById('marquee');marquee.start();marquee.setAttribute("DIRECTION","LEFT");marquee.scrollAmount="6";}
function moveRightMarquee()
{var marquee=document.getElementById('marquee');marquee.start();marquee.setAttribute("DIRECTION","RIGHT");marquee.scrollAmount="6";}
function stopMarquee()
{var marquee=document.getElementById('marquee');marquee.stop();}
function checkOrderType(orderId)
{this.orderId=orderId;var formParams="id="+orderId;var ajaxUrl="/ajax/getOrderType.html";var receiveReq=window.getXmlHttpRequestObject();if(receiveReq.readyState==4||receiveReq.readyState==0)
{receiveReq.open("POST",ajaxUrl,false);receiveReq.setRequestHeader("Content-Length",formParams.length);receiveReq.setRequestHeader("Content-Type","application/x-www-form-urlencoded")
receiveReq.send(formParams);var response=eval("("+receiveReq.responseText+")");return response.statusCode;}}
function setCityList(stateId)
{removeOptions('cityList');if(stateId=="0")
return;for(i in stateWiseCityList[stateId])
{addOption('cityList',stateWiseCityList[stateId][i].id,stateWiseCityList[stateId][i].name);}}
function setManufacturerList(manuList)
{removeOptions('manufacturerList');removeOptions('modelVariantList');removeOptions('modelList');if(manuList!="")
{var manuArr=manuList.split("##");for(i in manuArr)
{addOption('manufacturerList',manuArr[i].split("@@")[0],manuArr[i].split("@@")[1]);}}}
function setCarModels(modelsList)
{removeOptions('modelVariantList');removeOptions('modelList');if(modelsList!="")
{var modelsArr=modelsList.split("##");for(i in modelsArr)
{addOption('modelList',modelsArr[i].split("@@")[0],modelsArr[i].split("@@")[1]);}}}
function setVarients(variantsList)
{removeOptions('modelVariantList');if(variantsList!="")
{var variantsArr=variantsList.split("##");for(i in variantsArr)
{addOption('modelVariantList',variantsArr[i].split("@@")[0],variantsArr[i].split("@@")[1]);}}}
function addOption(id,valueTxt,textTxt)
{var elOptNew=document.createElement('option');elOptNew.text=textTxt;elOptNew.value=valueTxt;try{document.getElementById(id).add(elOptNew,null);}
catch(ex){document.getElementById(id).add(elOptNew);}}
function removeOptions(id)
{var elSel=document.getElementById(id);var i;for(i=elSel.length-1;i>0;i--){elSel.remove(i);}}
function getDepriciatedIDV(IDV)
{var curDate=new Date();var purchaseDate=document.getElementById('purchaseDate').value;var date=purchaseDate.split('-');var dat=date[1]+"/"+date[0]+"/"+date[2];var purDate=new Date(dat);var timeElapsed=parseInt((curDate.getTime()-purDate.getTime())/(1000*60*60*24*30));if(timeElapsed<=6)
{return IDV-(IDV*5/100);}
if(timeElapsed>6&&timeElapsed<=12)
{return IDV-(IDV*15/100);}
if(timeElapsed>12&&timeElapsed<=24)
{return IDV-(IDV*20/100);}
if(timeElapsed>24&&timeElapsed<=36)
{return IDV-(IDV*30/100);}
if(timeElapsed>36&&timeElapsed<=48)
{return IDV-(IDV*40/100);}
if(timeElapsed>48&&timeElapsed<=60)
{return IDV-(IDV*50/100);}
if(timeElapsed>60&&timeElapsed<=72)
{return IDV-(IDV*55/100);}
if(timeElapsed>72&&timeElapsed<=84)
{return IDV-(IDV*60/100);}
if(timeElapsed>84&&timeElapsed<=96)
{return IDV-(IDV*65/100);}
if(timeElapsed>96&&timeElapsed<=108)
{return IDV-(IDV*70/100);}
if(timeElapsed>108&&timeElapsed<=120)
{return IDV-(IDV*75/100);}
return 0;}
function getIdv()
{var purchaseDate=document.getElementById('purchaseDate').value;var stateId=document.getElementById('stateList').value;var manufacturerId=document.getElementById('manufacturerList').value;var modelId=document.getElementById('modelList').value;var variantId=document.getElementById('modelVariantList').value;if(stateId=="0"||manufacturerId=="0"||modelId=="0"||variantId=="0"||purchaseDate=="")
{return;}
getCarDetail();}
function getCarDetail()
{var stateId=document.getElementById('stateList').value;var manufacturerId=document.getElementById('manufacturerList').value;var modelId=document.getElementById('modelList').value;var variantId=document.getElementById('modelVariantList').value;if(stateId=="0"||manufacturerId=="0"||modelId=="0"||variantId=="0")
{return;}
document.getElementById("cubicCapacity").innerHTML="-";document.getElementById("showroomPrice").innerHTML="-";document.getElementById("showroomPriceIdv").innerHTML="-";var formParams="stateId="+stateId+"&manufacturerId="+manufacturerId+"&modelId="+modelId+"&variantId="+variantId;var ajaxUrl="/ajax/getCarDetail.html";var receiveReq=window.getXmlHttpRequestObject();if(receiveReq.readyState==4||receiveReq.readyState==0)
{receiveReq.open("POST",ajaxUrl,true);receiveReq.setRequestHeader("Content-Length",formParams.length);receiveReq.setRequestHeader("Content-Type","application/x-www-form-urlencoded")
receiveReq.onreadystatechange=function()
{if(receiveReq.readyState==4)
{try{var response=eval("("+receiveReq.responseText+")");document.getElementById("cubicCapacity").innerHTML=response.car.cubicCapacity;document.getElementById("showroomPrice").innerHTML="Rs. "+response.car.showroomPrice;if(document.getElementById('oldCar').checked)
{var showroom=parseInt(response.car.showroomPrice);document.getElementById("showroomPriceIdv").innerHTML="Rs. "+getDepriciatedIDV(showroom);document.getElementById('showroomPriceIdv').style.display='block';document.getElementById("showroomPrice").style.display='none';}
else if(document.getElementById('newCar').checked)
{document.getElementById("showroomPriceIdv").innerHTML="-";document.getElementById('showroomPriceIdv').style.display='none';document.getElementById("showroomPrice").style.display='block';}
document.getElementById("premiumAvailable").value="available";}catch(ex){document.getElementById("cubicCapacity").innerHTML='Not available';document.getElementById("showroomPrice").innerHTML='Not available';if(document.getElementById('oldCar').checked)
{document.getElementById('showroomPriceIdv').style.display='block';document.getElementById("showroomPrice").style.display='none';}
else if(document.getElementById('newCar').checked)
{document.getElementById('showroomPriceIdv').style.display='none';document.getElementById("showroomPrice").style.display='block';}
document.getElementById("showroomPriceIdv").innerHTML='Not available'
document.getElementById("premiumAvailable").value="";}}};receiveReq.send(formParams);}}
function validateCarInsuranceForm(formObj)
{var newCar=document.getElementById("newCar").checked;var oldCar=document.getElementById("oldCar").checked;if(!newCar&&!oldCar)
{alert("Please select Car Type(Old or New).");return false;}
if(newCar)
{var fieldIsMsgArray=[{id:"dropdown1",value:"0",msg:"Please select City where car is registered (RTO)"},{id:"dropdown3",value:"0",msg:"Please select Car Manufacturer Name:"},{id:"dropdown4",value:"0",msg:"Please select car model-variant"}];}
else
{var fieldIsMsgArray=[{id:"dropdown1",value:"0",msg:"Please select City where car is registered (RTO)"},{id:"dropdown2",value:"0",msg:"Please select year of manufacturing"},{id:"dropdown3",value:"0",msg:"Please select Car Manufacturer Name:"},{id:"dropdown4",value:"0",msg:"Please select car model-variant"}];}
for(i=0;i<fieldIsMsgArray.length;i++)
{if(checkValidateTrueFalse(fieldIsMsgArray[i].id,fieldIsMsgArray[i].value,fieldIsMsgArray[i].msg))
{return false;}}
var temp=document.getElementById("userShowroomPrice").value.replace(/,/g,"");if(newCar&&temp!=""&&isNaN(temp))
{alert("Please enter correct Current showroom price");return false;}
else if(oldCar&&temp!=""&&isNaN(temp))
{alert("Please enter correct I.D.V");return false;}
else if(newCar&&temp!=""&&!isNaN(temp))
{var idv=calculateCarInsIDV(temp,document.getElementById("dropdown2").options[document.getElementById("dropdown2").selectedIndex].value);document.getElementById("originalShowroomPrice").value=temp;document.getElementById("IDV").value=idv;}
else if(oldCar&&temp!=""&&!isNaN(temp))
{document.getElementById("IDV").value=temp;}
var additionalCovers=document.getElementById("additionalCoversY").checked;if(!additionalCovers&&document.getElementById("additionalCoversN").checked==false)
{alert("Do you want additional covers?");return false;}
if(additionalCovers)
{if(checkValidateTrueFalse("accidentalCoverUnnamedPassanger","0","Please select Accidental cover for un-named passanger"))
{return false;}
var passangerCapacity=document.getElementById("passangerCapacity").value;if(passangerCapacity==""||isNaN(passangerCapacity)||passangerCapacity<0)
{alert("Please enter Value of electrical accessories");return false;}
if(document.getElementById("CNGKitY").checked==false&&document.getElementById("CNGKitN").checked==false)
{alert("Do you have CNG/LPG kit fited in your car");return false;}
if(document.getElementById("CNGKitY").checked==true&&(document.getElementById("CNGLPG").value==""||isNaN(document.getElementById("CNGLPG").value)))
{alert("Please enter Value of CNG/LPG");return false;}
if(document.getElementById("electricalAccessories").value==""||isNaN(document.getElementById("electricalAccessories").value))
{alert("Please enter Value of electrical accessories");return false;}
if(document.getElementById("nonElectricalAccessories").value==""||isNaN(document.getElementById("nonElectricalAccessories").value))
{alert("Please enter Value of non electrical accessories");return false;}
if(document.getElementById("insurePaidDriverY").checked==false&&document.getElementById("insurePaidDriverN").checked==false)
{alert("Do you want to insure paid driver?");return false;}}
if(document.getElementById("discountsY").checked==false&&document.getElementById("discountsN").checked==false)
{alert("Do you want Discounts");return false;}
if(document.getElementById("discountsY").checked==true)
{if(document.getElementById("memberOfAutomobileAssociationY").checked==false&&document.getElementById("memberOfAutomobileAssociationN").checked==false)
{alert("Are you a member of Automobile association?");return false;}
if(document.getElementById("antiTheftDeviceY").checked==false&&document.getElementById("antiTheftDeviceN").checked==false)
{alert("Do you have an ARAI approved anti theft device fitted in your car?");return false;}}
var cityId=document.getElementById("dropdown1").options[document.getElementById("dropdown1").selectedIndex].value;if(cityId==24||cityId==57||cityId==70||cityId==9||cityId==20||cityId==49)
{document.getElementById("zoneId").value="A";}
else
{document.getElementById("zoneId").value="B";}
document.getElementById("manuName").value=document.getElementById("dropdown3").options[document.getElementById("dropdown3").selectedIndex].innerHTML;document.getElementById("modelName").value=document.getElementById("dropdown4").options[document.getElementById("dropdown4").selectedIndex].innerHTML;document.getElementById("pleaseWaitUrl").value='/car-insurance-india/car-search-result.html';return true;}
function checkValidateTrueFalse(id,value,msg)
{if(document.getElementById(id).value==value)
{alert(msg);return true;}
return false;}
function resetCarInsuranceForm()
{document.getElementById("newCar").checked=false;document.getElementById("oldCar").checked=true;document.getElementById("IDV").value="";document.getElementById("carNoClaimBonus").selectedIndex=0;document.getElementById("additionalCoversY").checked=false;document.getElementById("additionalCoversN").checked=true;document.getElementById("accidentalCoverUnnamedPassanger").selectedIndex=0;document.getElementById("passangerCapacity").value="";document.getElementById("CNGKitY").checked=false;document.getElementById("CNGKitN").checked=false;document.getElementById("CNGLPG").value="";document.getElementById("electricalAccessories").value="";document.getElementById("nonElectricalAccessories").value="";document.getElementById("insurePaidDriverY").checked=false;document.getElementById("insurePaidDriverN").checked=false;document.getElementById("discountsY").checked=false;document.getElementById("discountsN").checked=true;document.getElementById("memberOfAutomobileAssociationY").checked=false;document.getElementById("memberOfAutomobileAssociationN").checked=false;document.getElementById("antiTheftDeviceY").checked=false;document.getElementById("antiTheftDeviceN").checked=false;}
function changeNoclaimbonusDropDown(year)
{var currentYear=(new Date).getFullYear();removeOptions("claimBonus");var per=new Array(25,35,45,50);for(i=0;i<4&&i<(currentYear-year-1);i++)
{addOption("claimBonus",per[i],per[i]+'%');}}
function disableClaimsDetails(flag)
{document.getElementById("claimsExpiringpolicyY").disabled=flag;document.getElementById("claimsExpiringpolicyN").disabled=flag;document.getElementById("claimBonus").disabled=flag;}
function showHideDiv(divId,flag)
{document.getElementById(divId).style.display=flag;}
function showFirstHideSecondDiv(div1,div2)
{document.getElementById(div1).style.display='';document.getElementById(div2).style.display='none';}
function showPremiumDetailsOfCarIns(sMode,sElementName,sElement,sWidth,sTop,index,bankName,premiumDetails)
{sLeftPos=0;sTopPos=0;while(sElement)
{sLeftPos+=sElement.offsetLeft;sTopPos+=sElement.offsetTop;sElement=sElement.offsetParent;}
sLeftPos=sLeftPos+sWidth+"px";sTopPos=sTopPos+sTop+"px";sDisplay=(sMode=="show")?"inline":"none";if(oElement=eval(document.getElementById('premiumDetails')))
{oElement.style.left=sLeftPos;oElement.style.top=sTopPos;oElement.style.display=sDisplay;}
var premiumBreakup=premiumDetails.split("##");document.getElementById("bankPolicyName").innerHTML=bankName;document.getElementById("basicPremium").innerHTML=premiumBreakup[1];document.getElementById("electAccePremium").innerHTML=premiumBreakup[2];document.getElementById("nonElectAccePremium").innerHTML=premiumBreakup[3];document.getElementById("antiTheftDiscount").innerHTML=premiumBreakup[6];document.getElementById("voluntaryDiscount").innerHTML=premiumBreakup[7];document.getElementById('automobileMembershipDiscount').innerHTML=premiumBreakup[8];document.getElementById("deductNCB").innerHTML=premiumBreakup[9];document.getElementById("basicPremiumIncPre").innerHTML=premiumBreakup[14];document.getElementById("liabilityBiFual").innerHTML=premiumBreakup[15];document.getElementById("liabilityToPaidDriver").innerHTML=premiumBreakup[18];document.getElementById("biFualKit").innerHTML=premiumBreakup[4];document.getElementById("PAUnnamedPassenger").innerHTML=premiumBreakup[17];document.getElementById("subTotal").innerHTML=premiumBreakup[5];document.getElementById("total").innerHTML=premiumBreakup[16];document.getElementById("totalDiscount").innerHTML=premiumBreakup[10];document.getElementById("totalE").innerHTML=premiumBreakup[19];document.getElementById("totalOwnDamagePremium").innerHTML=premiumBreakup[11];document.getElementById("totalLiabilityPremium").innerHTML=premiumBreakup[20];document.getElementById("packagePremium").innerHTML=premiumBreakup[12];document.getElementById("serviceTax").innerHTML=premiumBreakup[13];document.getElementById("finalPremium").innerHTML=premiumBreakup[0];}
var carInsurFullData=new Array();var carInsurSponData=new Array();function getAllDataCarIns(fullListcnt,sponListcnt)
{for(i=0;i<fullListcnt;i++)
{var row=new Array(10);row[0]=document.getElementById('fullPolicyName'+i).innerHTML;row[1]=document.getElementById('fullPremium'+i).innerHTML;row[2]=document.getElementById('fullIDV'+i).innerHTML;row[3]=document.getElementById('fullImg1'+i).innerHTML;row[4]=document.getElementById('fullImg2'+i).innerHTML;row[5]=document.getElementById('fullImg3'+i).innerHTML;row[6]=document.getElementById('fullImg4'+i).innerHTML;row[7]=document.getElementById('fullImg5'+i).innerHTML;row[8]=document.getElementById('fullImg6'+i).innerHTML;row[9]=document.getElementById('fullImg7'+i).innerHTML;row[10]=document.getElementById('fullImg8'+i).innerHTML;row[11]=document.getElementById('fullImg9'+i).innerHTML;row[12]=document.getElementById('fullApply'+i).innerHTML;row[13]=document.getElementById('fullComment'+i).innerHTML;carInsurFullData[i]=row;}
for(i=0;i<sponListcnt;i++)
{var row=new Array(10);row[0]=document.getElementById('sponPolicyName'+i).innerHTML;row[1]=document.getElementById('sponPremium'+i).innerHTML;row[2]=document.getElementById('sponIDV'+i).innerHTML;row[3]=document.getElementById('sponImg1'+i).innerHTML;row[4]=document.getElementById('sponImg2'+i).innerHTML;row[5]=document.getElementById('sponImg3'+i).innerHTML;row[6]=document.getElementById('sponImg4'+i).innerHTML;row[7]=document.getElementById('sponImg5'+i).innerHTML;row[8]=document.getElementById('sponImg6'+i).innerHTML;row[9]=document.getElementById('sponImg7'+i).innerHTML;row[10]=document.getElementById('sponImg8'+i).innerHTML;row[11]=document.getElementById('sponImg9'+i).innerHTML;row[12]=document.getElementById('sponApply'+i).innerHTML;row[13]=document.getElementById('sponComment'+i).innerHTML;carInsurSponData[i]=row;}}
function resetDataCarInsur(fullListcnt,sponListcnt)
{for(i=0;i<fullListcnt;i++)
{document.getElementById('fullPolicyName'+i).innerHTML=carInsurFullData[mainDataArray[i]['rowIndex']][0];document.getElementById('fullPremium'+i).innerHTML=carInsurFullData[mainDataArray[i]['rowIndex']][1];document.getElementById('fullIDV'+i).innerHTML=carInsurFullData[mainDataArray[i]['rowIndex']][2];document.getElementById('fullImg1'+i).innerHTML=carInsurFullData[mainDataArray[i]['rowIndex']][3];document.getElementById('fullImg2'+i).innerHTML=carInsurFullData[mainDataArray[i]['rowIndex']][4];document.getElementById('fullImg3'+i).innerHTML=carInsurFullData[mainDataArray[i]['rowIndex']][5];document.getElementById('fullImg4'+i).innerHTML=carInsurFullData[mainDataArray[i]['rowIndex']][6];document.getElementById('fullImg5'+i).innerHTML=carInsurFullData[mainDataArray[i]['rowIndex']][7];document.getElementById('fullImg6'+i).innerHTML=carInsurFullData[mainDataArray[i]['rowIndex']][8];document.getElementById('fullImg7'+i).innerHTML=carInsurFullData[mainDataArray[i]['rowIndex']][9];document.getElementById('fullImg8'+i).innerHTML=carInsurFullData[mainDataArray[i]['rowIndex']][10];document.getElementById('fullImg9'+i).innerHTML=carInsurFullData[mainDataArray[i]['rowIndex']][11];document.getElementById('fullApply'+i).innerHTML=carInsurFullData[mainDataArray[i]['rowIndex']][12];document.getElementById('fullComment'+i).innerHTML=carInsurFullData[mainDataArray[i]['rowIndex']][13];}
for(i=0;i<sponListcnt;i++)
{document.getElementById('sponPolicyName'+i).innerHTML=carInsurSponData[sponsoredDataArray[i]['rowIndex']][0];document.getElementById('sponPremium'+i).innerHTML=carInsurSponData[sponsoredDataArray[i]['rowIndex']][1];document.getElementById('sponIDV'+i).innerHTML=carInsurSponData[sponsoredDataArray[i]['rowIndex']][2];document.getElementById('sponImg1'+i).innerHTML=carInsurSponData[sponsoredDataArray[i]['rowIndex']][3];document.getElementById('sponImg2'+i).innerHTML=carInsurSponData[sponsoredDataArray[i]['rowIndex']][4];document.getElementById('sponImg3'+i).innerHTML=carInsurSponData[sponsoredDataArray[i]['rowIndex']][5];document.getElementById('sponImg4'+i).innerHTML=carInsurSponData[sponsoredDataArray[i]['rowIndex']][6];document.getElementById('sponImg5'+i).innerHTML=carInsurSponData[sponsoredDataArray[i]['rowIndex']][7];document.getElementById('sponImg6'+i).innerHTML=carInsurSponData[sponsoredDataArray[i]['rowIndex']][8];document.getElementById('sponImg7'+i).innerHTML=carInsurSponData[sponsoredDataArray[i]['rowIndex']][9];document.getElementById('sponImg8'+i).innerHTML=carInsurSponData[sponsoredDataArray[i]['rowIndex']][10];document.getElementById('sponImg9'+i).innerHTML=carInsurSponData[sponsoredDataArray[i]['rowIndex']][11];document.getElementById('sponApply'+i).innerHTML=carInsurSponData[sponsoredDataArray[i]['rowIndex']][12];document.getElementById('sponComment'+i).innerHTML=carInsurSponData[sponsoredDataArray[i]['rowIndex']][13];}
for(i=0;i<fullListcnt;i++)
{mainDataArray[i]['rowIndex']=i;}
for(i=0;i<sponListcnt;i++)
{sponsoredDataArray[i]['rowIndex']=i;}
getAllDataCarIns(fullListcnt,sponListcnt);}
function sortDataCarInsuranceComparator(str,fullListcnt,sponListcnt)
{getAllDataCarIns(fullListcnt,sponListcnt);document.getElementById('policy_img_asc_desc').style.display='none';document.getElementById('premium_img_asc_desc').style.display='none';if(str=='policyName')
{document.getElementById('policy_img_asc_desc').style.display='';if(flagforbank==1)
{document.getElementById('policy_img_asc_desc').src="/images/down.gif";mainDataArray.sort(bankDataAscSort);sponsoredDataArray.sort(bankDataAscSort);flagforbank=2;}
else
{document.getElementById('policy_img_asc_desc').src="/images/TopArrow.gif";mainDataArray.sort(bankDataDesSort);sponsoredDataArray.sort(bankDataDesSort);flagforbank=1;}
flagforint=1;}
if(str=='premium')
{document.getElementById('premium_img_asc_desc').style.display='';if(flagforint==1)
{document.getElementById('premium_img_asc_desc').src="/images/down.gif";mainDataArray.sort(interestAscSort);sponsoredDataArray.sort(interestAscSort);flagforint=2;}
else
{document.getElementById('premium_img_asc_desc').src="/images/TopArrow.gif";mainDataArray.sort(interestDesSort);sponsoredDataArray.sort(interestDesSort);flagforint=1;}
flagforbank=1;}
resetDataCarInsur(fullListcnt,sponListcnt);}
function showFamilyDetails(rowCount)
{if(rowCount<1)
{return;}
document.getElementById("numRows").value=rowCount;for(i=2;i<=4;i++)
{if(i<=rowCount)
{document.getElementById('row'+i).style.display='';}
else
{document.getElementById('row'+i).style.display='none';}}}
function hideFamilyDetailDiv(id)
{var numberOfFamilyMember=document.getElementById("numberOfFamilyMember").value;showHideDiv('familyMemberDetails','');for(i=1;i<=numberOfFamilyMember;i++)
{if(document.getElementById('relation'+i).value=="0")
{alert("Please select relation of "+i+" person");showHideDiv('familyMemberDetails','');return false;}
if(document.getElementById('age'+i).value=="0")
{alert("Please select age of "+i+" person")
showHideDiv('familyMemberDetails','');return false;}}
showHideDiv('familyMemberDetails','none');return true;}
function hospitalCashValidation()
{var ages="";var relationType="";var personCount=1;if(!document.getElementById("me").checked&&!document.getElementById("myFamily").checked)
{alert("Please select me or me and my family");return false;}
var isSingle=document.getElementById("me").checked;var cityElement=document.getElementById("frmComparatorSearch").city;var cityTextBoxElement=document.getElementById("frmComparatorSearch").cityTextBox;if(cityElement.value=="0")
{alert("Please select city");cityTextBoxElement.focus();return false;}
if(isSingle)
{document.getElementById('single').value='true';if(document.getElementById("age").value=="0")
{alert("Please select your age");return false;}
ages=','+document.getElementById('age').value;relationType=','+'Self';}
else
{document.getElementById('single').value='false';if(document.getElementById("numOfFamilyMember").value=="0")
{alert("Please select how many family members");return false;}
var numFamilyMember=document.getElementById('numOfFamilyMember').value;personCount=numFamilyMember;for(i=1;i<=numFamilyMember;i++)
{var error=false;var msg='Please Select ';if(i!=1&&document.getElementById('relation'+i).value=='0')
{msg+="relation ";document.getElementById('relation'+i).focus();error=true;}
relationType+=','+document.getElementById('relation'+i).value;if(document.getElementById('age'+i).value=='0')
{msg+="age ";document.getElementById('age'+i).focus();error=true;}
ages+=','+document.getElementById('age'+i).value;if(error==true)
{alert(msg+"for person no "+i);return false;}}}
document.getElementById('ages').value=ages.substring(1);document.getElementById('relationType').value=relationType.substring(1);document.getElementById('personCount').value=personCount;document.getElementById('numberOfFamilyMember').value=personCount;var apnaExchangePolicyElem=document.getElementById("apnaExchangePolicy");var apnaExchangeCheckBoxValueElem=document.getElementById("apnaExchangeCheckBoxValue");if(apnaExchangePolicyElem&&apnaExchangePolicyElem.checked)
{apnaExchangeCheckBoxValueElem.value="checked";apnaExchangePolicyElem.value="Y";}
else
{apnaExchangeCheckBoxValueElem.value="unchecked";}
if(validateCustomerNameEmailMobile())
{document.getElementById('applicantName').value=document.getElementById("tmpApplicantName").value;document.getElementById('applicantMobile').value=document.getElementById("tmpApplicantMobile").value;document.getElementById('applicantEmail').value=document.getElementById("tmpApplicantEmail").value;if(!document.getElementById("privacyPolicy").checked)
{alert("Please check the privacy policy");document.getElementById("privacyPolicy").focus();return false;}
document.getElementById("pleaseWaitUrl").value='/hospital-cash-plans/compare/'+(cityTextBoxElement.value).toLowerCase()+'.html';return true;}
else
{return false;}}
function calculateHeight()
{searchHeight=document.getElementById('searchCriteriaDiv').offsetHeight;var searchHt=document.getElementById('searchDivHeight').value;var blockTop=document.getElementById('blockDiv').style.top;var blTop=parseInt(blockTop.substring(0,blockTop.length-2));var diffHt;if(searchHt!=0)
{diffHt=searchHeight-searchHt;}
document.getElementById('blockDiv').style.top=blTop+diffHt+'px';document.getElementById('searchDivHeight').value=searchHeight;}
function resetHospitalCash()
{document.getElementById('me').checked=false;document.getElementById('myFamily').checked=false;document.getElementById('city').selectedIndex=0;document.getElementById('age').selectedIndex=0;document.getElementById('numOfFamilyMember').selectedIndex=0;for(i=1;i<=4;i++)
{document.getElementById('relation'+i).selectedIndex=0;document.getElementById('age'+i).selectedIndex=0;}}
function showPremiumDetailsHospitalCash(sMode,sElementName,sElement,sWidth,sTop,noOfFamilyMember,premiumList,policyType,basic,discount,serviceTax,totalPremium)
{var id='';var premiums=new Array();var premiumArray=premiumList.split(",");for(i=0;i<premiumArray.length;i++)
{premiums[i]=premiumArray[i];}
if(policyType=='FAMILY')
{id='family';document.getElementById("familyType").style.display='';document.getElementById("selfAndall").style.display='none';}
else
{document.getElementById("selfAndall").style.display='';document.getElementById("familyType").style.display='none';}
var sLeftPos=0;var sTopPos=0;while(sElement)
{sLeftPos+=sElement.offsetLeft;sTopPos+=sElement.offsetTop;sElement=sElement.offsetParent;}
sLeftPos=sLeftPos+sWidth+"px";sTopPos=sTopPos+sTop+"px";var sDisplay=(sMode=="show")?"inline":"none";if(oElement=eval(document.getElementById('premiumDetails')))
{oElement.style.left=sLeftPos;oElement.style.top=sTopPos;oElement.style.display=sDisplay;}
if(noOfFamilyMember==1)
{document.getElementById('premiumOf0').innerHTML=basic;}
else
{if(premiums.length==1)
{document.getElementById('premiumOf0').rowSpan=noOfFamilyMember;document.getElementById('premiumOf0').innerHTML=premiums[0];for(i=1;i<noOfFamilyMember;i++)
{document.getElementById('premiumOf'+i).style.display='none';}}
else
{for(i=1;i<noOfFamilyMember;i++)
{document.getElementById('premiumOf'+i).style.display='block';}
for(i=0;i<noOfFamilyMember;i++)
{document.getElementById('premiumOf0').rowSpan=1;document.getElementById('premiumOf'+i).innerHTML=premiums[i];}}}
document.getElementById('familypremiumOf0').innerHTML=basic;document.getElementById(id+'totalBasic').innerHTML=basic;document.getElementById(id+'twoPlusPerson').innerHTML=parseInt(basic-discount);document.getElementById(id+'premiumAfterDiscount').innerHTML=discount;document.getElementById(id+'serviceTax').innerHTML=serviceTax;document.getElementById(id+'totalPremium').innerHTML=totalPremium;return false;}
var hcpFullData=new Array();var hcpSponData=new Array();function getAllDataHCP(fullListcnt,sponListcnt)
{for(i=0;i<fullListcnt;i++)
{var row=new Array(12);row[0]=document.getElementById('f0'+i).innerHTML;row[1]=document.getElementById('f1'+i).innerHTML;row[2]=document.getElementById('f2'+i).innerHTML;row[3]=document.getElementById('f3'+i).innerHTML;row[4]=document.getElementById('f4'+i).innerHTML;row[5]=document.getElementById('f5'+i).innerHTML;row[6]=document.getElementById('f6'+i).innerHTML;row[7]=document.getElementById('f7'+i).innerHTML;row[8]=document.getElementById('f8'+i).innerHTML;row[9]=document.getElementById('f9'+i).innerHTML;row[10]=document.getElementById('fa'+i).innerHTML;row[11]=document.getElementById('fb'+i).innerHTML;hcpFullData[i]=row;}
for(i=0;i<sponListcnt;i++)
{var row=new Array(12);row[0]=document.getElementById('s0'+i).innerHTML;row[1]=document.getElementById('s1'+i).innerHTML;row[2]=document.getElementById('s2'+i).innerHTML;row[3]=document.getElementById('s3'+i).innerHTML;row[4]=document.getElementById('s4'+i).innerHTML;row[5]=document.getElementById('s5'+i).innerHTML;row[6]=document.getElementById('s6'+i).innerHTML;row[7]=document.getElementById('s7'+i).innerHTML;row[8]=document.getElementById('s8'+i).innerHTML;row[9]=document.getElementById('s9'+i).innerHTML;row[10]=document.getElementById('sa'+i).innerHTML;row[11]=document.getElementById('sb'+i).innerHTML;hcpSponData[i]=row;}}
function resetDataHCP(fullListcnt,sponListcnt)
{for(i=0;i<fullListcnt;i++)
{document.getElementById('f0'+i).innerHTML=hcpFullData[mainDataArray[i]['rowIndex']][0];document.getElementById('f1'+i).innerHTML=hcpFullData[mainDataArray[i]['rowIndex']][1];document.getElementById('f2'+i).innerHTML=hcpFullData[mainDataArray[i]['rowIndex']][2];document.getElementById('f3'+i).innerHTML=hcpFullData[mainDataArray[i]['rowIndex']][3];document.getElementById('f4'+i).innerHTML=hcpFullData[mainDataArray[i]['rowIndex']][4];document.getElementById('f5'+i).innerHTML=hcpFullData[mainDataArray[i]['rowIndex']][5];document.getElementById('f6'+i).innerHTML=hcpFullData[mainDataArray[i]['rowIndex']][6];document.getElementById('f7'+i).innerHTML=hcpFullData[mainDataArray[i]['rowIndex']][7];document.getElementById('f8'+i).innerHTML=hcpFullData[mainDataArray[i]['rowIndex']][8];document.getElementById('f9'+i).innerHTML=hcpFullData[mainDataArray[i]['rowIndex']][9];document.getElementById('fa'+i).innerHTML=hcpFullData[mainDataArray[i]['rowIndex']][10];document.getElementById('fb'+i).innerHTML=hcpFullData[mainDataArray[i]['rowIndex']][11];}
for(i=0;i<sponListcnt;i++)
{document.getElementById('s0'+i).innerHTML=hcpSponData[sponsoredDataArray[i]['rowIndex']][0];document.getElementById('s1'+i).innerHTML=hcpSponData[sponsoredDataArray[i]['rowIndex']][1];document.getElementById('s2'+i).innerHTML=hcpSponData[sponsoredDataArray[i]['rowIndex']][2];document.getElementById('s3'+i).innerHTML=hcpSponData[sponsoredDataArray[i]['rowIndex']][3];document.getElementById('s4'+i).innerHTML=hcpSponData[sponsoredDataArray[i]['rowIndex']][4];document.getElementById('s5'+i).innerHTML=hcpSponData[sponsoredDataArray[i]['rowIndex']][5];document.getElementById('s6'+i).innerHTML=hcpSponData[sponsoredDataArray[i]['rowIndex']][6];document.getElementById('s7'+i).innerHTML=hcpSponData[sponsoredDataArray[i]['rowIndex']][7];document.getElementById('s8'+i).innerHTML=hcpSponData[sponsoredDataArray[i]['rowIndex']][8];document.getElementById('s9'+i).innerHTML=hcpSponData[sponsoredDataArray[i]['rowIndex']][9];document.getElementById('sa'+i).innerHTML=hcpSponData[sponsoredDataArray[i]['rowIndex']][10];document.getElementById('sb'+i).innerHTML=hcpSponData[sponsoredDataArray[i]['rowIndex']][11];}
for(i=0;i<fullListcnt;i++)
{mainDataArray[i]['rowIndex']=i;}
for(i=0;i<sponListcnt;i++)
{sponsoredDataArray[i]['rowIndex']=i;}}
function sortDataHCP(str,fullListcnt,sponListcnt,noRows)
{alert('sorting start');getAllDataHCP(fullListcnt,sponListcnt,noRows);for(i in flagAscDesc)
{eval("document.getElementById('"+i+"SortImage').style.display='none'");}
document.getElementById(str+'SortImage').style.display='';if(flagAscDesc[str]==false)
{document.getElementById(str+'SortImage').src="/images/down.gif";eval("mainDataArray.sort("+str+"AscSort)");eval("sponsoredDataArray.sort("+str+"AscSort)");flagAscDesc[str]=true;}
else
{document.getElementById(str+'SortImage').src="/images/TopArrow.gif";eval("mainDataArray.sort("+str+"DesSort)");eval("sponsoredDataArray.sort("+str+"DesSort)");flagAscDesc[str]=false;}
resetDataHCP(fullListcnt,sponListcnt,noRows);alert('sorting end');}
function bankNameAscSort(a,b)
{if(a.bankName==b.bankName)
{return 0;}
return(a.maxDays<b.bankName)?-1:1;}
function bankNameDesSort(a,b)
{if(a.bankName==b.bankName)
{return 0;}
return(a.bankName>b.bankName)?-1:1;}
function maxDaysAscSort(a,b)
{if(a.maxDays==b.maxDays)
{return 0;}
return(a.maxDays<b.maxDays)?-1:1;}
function maxDaysDesSort(a,b)
{if(a.maxDays==b.maxDays)
{return 0;}
return(a.maxDays>b.maxDays)?-1:1;}
function maxAgeAscSort(a,b)
{if(a.maxAge==b.maxAge)
{return 0;}
return(a.maxAge<b.maxAge)?-1:1;}
function maxAgeDesSort(a,b)
{if(a.maxAge==b.maxAge)
{return 0;}
return(a.maxAge>b.maxAge)?-1:1;}
function illGeneralAscSort(a,b)
{if(a.illGeneral==b.illGeneral)
{return 0;}
return(a.illGeneral<b.illGeneral)?-1:1;}
function illGeneralDesSort(a,b)
{if(a.illGeneral==b.illGeneral)
{return 0;}
return(a.illGeneral>b.illGeneral)?-1:1;}
function illICUAscSort(a,b)
{if(a.illICU==b.illICU)
{return 0;}
return(a.illICU<b.illICU)?-1:1;}
function illICUDesSort(a,b)
{if(a.illICU==b.illICU)
{return 0;}
return(a.illICU>b.illICU)?-1:1;}
function accidentGeneralAscSort(a,b)
{if(a.accidentGeneral==b.accidentGeneral)
{return 0;}
return(a.accidentGeneral<b.accidentGeneral)?-1:1;}
function accidentGeneralDesSort(a,b)
{if(a.accidentGeneral==b.accidentGeneral)
{return 0;}
return(a.accidentGeneral>b.accidentGeneral)?-1:1;}
function accidentICUAscSort(a,b)
{if(a.accidentICU==b.accidentICU)
{return 0;}
return(a.accidentICU<b.accidentICU)?-1:1;}
function accidentICUDesSort(a,b)
{if(a.accidentICU==b.accidentICU)
{return 0;}
return(a.accidentICU>b.accidentICU)?-1:1;}
function convalesenceAscSort(a,b)
{if(a.convalesence==b.convalesence)
{return 0;}
return(a.convalesence<b.convalesence)?-1:1;}
function convalesenceDesSort(a,b)
{if(a.convalesence==b.convalesence)
{return 0;}
return(a.convalesence>b.convalesence)?-1:1;}
function accidentalDeathAscSort(a,b)
{if(a.accidentalDeath==b.accidentalDeath)
{return 0;}
return(a.accidentalDeath<b.accidentalDeath)?-1:1;}
function accidentalDeathDesSort(a,b)
{if(a.accidentalDeath==b.accidentalDeath)
{return 0;}
return(a.accidentalDeath>b.accidentalDeath)?-1:1;}
function checkSpouse(element,numberOfFamilyMember)
{for(i=1;i<=numberOfFamilyMember;i++)
{if(element==document.getElementById('relation'+i))
{continue;}
if(document.getElementById('relation'+i).value=="spouse"&&element.value=="spouse")
{alert("You already select spouse");element.selectedIndex=0;}}}
function showHideCarIns(carType)
{var carNoClaimBonusSelectBox=document.getElementById('carNoClaimBonus');if(carType=='old')
{showHideDiv('suggestedShowRoomPrice','none');showHideDiv('showroomPrice','none');showHideDiv('divForShowRoom','none');showHideDiv('showroomPriceIdv','block');showHideDiv('divForIdv','block');showHideDiv('suggestedShowRoomPriceIdv','block');showHideDiv('yearOfManufactureDiv','block');document.getElementById('differentShowRoomPrice').innerHTML='Current I.D.V if different from above';document.getElementById('showroomPriceIdv').innerHTML=' - ';document.getElementById('carNoClaimBonus').remove(0);makeAjaxCall('id=4&flag=cityList&carType=2','updateCarInsuranceDropdown','1');}
else
{showHideDiv('suggestedShowRoomPrice','block');showHideDiv('showroomPrice','block');showHideDiv('divForShowRoom','block');showHideDiv('showroomPriceIdv','none');showHideDiv('divForIdv','none');showHideDiv('suggestedShowRoomPriceIdv','none');showHideDiv('yearOfManufactureDiv','none');document.getElementById('differentShowRoomPrice').innerHTML='Current showroom price if different from above';document.getElementById('showroomPrice').innerHTML=' - ';carNoClaimBonusSelectBox.length=0;addOption('carNoClaimBonus','0','0%');addOption('carNoClaimBonus','20','No claim-last 1 yr');addOption('carNoClaimBonus','25','No claim-last 2 Yrs');addOption('carNoClaimBonus','35','No claim-last 3 Yrs');addOption('carNoClaimBonus','45','No claim-last 4 Yrs');addOption('carNoClaimBonus','50','No claim-last 5 Yrs');addOption('carNoClaimBonus','0','Claim in last 1 yr');makeAjaxCall('id=4&flag=cityList&carType=1','updateCarInsuranceDropdown','1');}
document.getElementById('cubicCapacityText').innerHTML=' - ';document.getElementById('userShowroomPrice').value='';document.getElementById('voluntaryExcess').selectedIndex=0;document.getElementById('carNoClaimBonus').selectedIndex=0;document.getElementById('additionalCoversN').checked=true;document.getElementById('discountsN').checked=true;document.getElementById('additionalInfoDiv').style.display="none";document.getElementById('accidentalCoverUnnamedPassanger').selectedIndex=0;document.getElementById('passangerCapacity').value='';document.getElementById('CNGKitY').checked=false;document.getElementById('CNGKitN').checked=false;document.getElementById('valueOfCNGLPG').style.display="none";document.getElementById('CNGLPG').value='';document.getElementById('electricalAccessories').value='';document.getElementById('nonElectricalAccessories').value='';document.getElementById('insurePaidDriverY').checked=false;document.getElementById('insurePaidDriverN').checked=false;document.getElementById('discountTable').style.display="none";document.getElementById('memberOfAutomobileAssociationY').checked=false;document.getElementById('memberOfAutomobileAssociationN').checked=false;document.getElementById('antiTheftDeviceY').checked=false;document.getElementById('antiTheftDeviceN').checked=false;}
function validateLifeInsuranceInput()
{if(document.getElementById('city').value==0)
{alert("Please Enter the City");return false;}
if(document.getElementById('age').value==0)
{alert("Please Enter Your Age");return false;}
return true;}
function endowmentValidation()
{if(document.getElementById('gender').value==0)
{alert("Please Enter Gender");document.getElementById('gender').focus();return false;}
if(document.getElementById('age').value==0)
{alert("Please Enter Your Age");return false;}
if(document.getElementById('sumAssured').value==0)
{alert("Please Enter Your Sum Assured");return false;}
if(document.getElementById('tenure').value==0)
{alert("Please Enter Your Tenure");return false;}
var cityElement=document.getElementById("frmComparatorSearch").city;var cityTextBoxElement=document.getElementById("frmComparatorSearch").cityTextBox;if(cityElement.value=="0")
{alert("Please select city");cityTextBoxElement.focus();return false;}
if(validateCustomerNameEmailMobile())
{document.getElementById('searchCriteriaDiv').style.display='none';document.getElementById('principalListDiv').style.display='block';document.getElementById('applicantName').value=document.getElementById("tmpApplicantName").value;document.getElementById('applicantMobile').value=document.getElementById("tmpApplicantMobile").value;document.getElementById('applicantEmail').value=document.getElementById("tmpApplicantEmail").value;document.getElementById('_principalIds').name='noName';document.getElementById("pleaseWaitUrl").value='/endowment-insurance-india/compare/'+(cityTextBoxElement.value).toLowerCase()+'.html';return true;}
else
{return false;}}
function calculateforEndowmentPlan()
{var formParams="";var selectedIndex=0;var tenureArray;var i=0;formParams+="id="+document.getElementById('offerId').value+"&age="+document.getElementById('age').value;var ajaxUrl="/"+nameSpace+"/ajax/kyxHelper.html"
var receiveReq=window.getXmlHttpRequestObject();if(receiveReq.readyState==4||receiveReq.readyState==0)
{receiveReq.open("POST",ajaxUrl,true);receiveReq.setRequestHeader("Content-Length",formParams.length);receiveReq.setRequestHeader("Content-Type","application/x-www-form-urlencoded");receiveReq.onreadystatechange=function()
{if(receiveReq.readyState==4)
{var response=receiveReq.responseText;var respArray=response.split("#");var a=respArray[0].substring(1);var b=respArray[1].substring(1);var e=respArray[2].substring(1);if(document.getElementById('age')){ageVal=document.getElementById('age').value;}
else{ageVal=30;}
var ageArray=a.split(",");ageArray.sort(sortNumbers);removeOptions('age');for(i=0;i<ageArray.length;i++)
{addOption('age',ageArray[i],ageArray[i]);if(ageVal==ageArray[i]){selectedIndex=i+1;}}
setIndexOfDropDownBasedOnValue('age',ageVal);if(document.getElementById('sumAssured')){sumAssuredVal=document.getElementById('sumAssured').value;}
else{sumAssuredVal=500000;}
var sumAssuredArray=b.split(",");sumAssuredArray.sort(sortNumbers);removeOptions('sumAssured');for(i=0;i<sumAssuredArray.length;i++)
{addOption('sumAssured',sumAssuredArray[i],CommaFormatted(sumAssuredArray[i]));if(sumAssuredVal==sumAssuredArray[i]){selectedIndex=i+1;}}
setIndexOfDropDownBasedOnValue('sumAssured',sumAssuredVal);if(document.getElementById('tenure')){tenureVal=document.getElementById('tenure').value;}
else{tenureVal=25;}
tenureArray=e.split(",");tenureArray.sort(sortNumbers);removeOptions('tenure');selectedIndex=0;for(i=0;i<tenureArray.length;i++)
{addOption('tenure',tenureArray[i],tenureArray[i]);if(tenureVal==tenureArray[i]){selectedIndex=i+1;}}
setIndexOfDropDownBasedOnValue('tenure',tenureVal);}}};receiveReq.send(formParams);}
function changeEndowmentTab()
{document.getElementById('gender').name='tmpGender';document.getElementById('age').name='tmpAge';document.getElementById('sumAssured').name='tmpSumAssured';document.getElementById('tenure').name='tmptenure';document.getElementById('city').name='tmpCity';document.getElementById('cityId').name='tmpCityId';document.getElementById('premiumPayingTerm').name='tmpPremiumPayingTerm';document.getElementById("hideCriteria").value="false";document.getElementById('_principalIds').name='noName';}
function resetEndowment()
{document.getElementById('gender').selectedIndex=0;document.getElementById('age').selectedIndex=0;document.getElementById('sumAssured').selectedIndex=0;document.getElementById('tenure').selectedIndex=0;document.getElementById("frmComparatorSearch").city.value="0";document.getElementById("frmComparatorSearch").cityTextBox.value="Select a City";document.getElementById('tmpApplicantName').value='Name';document.getElementById('tmpApplicantMobile').value='Mobile';document.getElementById('tmpApplicantEmail').value='Email';}
function setValuesForEndowment(index)
{removeOptions('age');for(i=ageTenure[index][0];i<=ageTenure[index][1];i++)
{addOption('age',i,i);}
removeOptions('tenure');for(i=ageTenure[index][2];i<=ageTenure[index][3];i++)
{addOption('tenure',i,i);}
removeOptions('sumAssured');for(i in sumAssured[index])
{addOption('sumAssured',sumAssured[index][i],sumAssured[index][i]);}
removeOptions('premiumPayingTerm');for(i in prePayingTerm[index])
{addOption('premiumPayingTerm',prePayingTerm[index][i],prePayingTerm[index][i]);}}
function setPremiumPayingTerm(value)
{var ppt=document.getElementById("premiumPayingTerm");ppt.disabled=false;if(value=="0")
{ppt.selectedIndex=0;}
if(document.getElementById("REGULAR").checked)
{for(i=ppt.length-1;i>0;i--)
{if(parseInt(ppt[i].value)==parseInt(value))
{ppt.selectedIndex=i;break;}}
ppt.disabled=true;}else if(document.getElementById("LIMITED").checked)
{removeOptions('premiumPayingTerm');for(i in prePayingTerm[1])
{addOption('premiumPayingTerm',prePayingTerm[1][i],prePayingTerm[1][i]);}
for(i=ppt.length-1;i>0;i--)
{if(parseInt(ppt[i].value)<parseInt(value))
{break;}else{ppt.remove(i);}}}else
{ppt.selectedIndex=1;ppt.disabled=true;}}
function greyOutComparatorResult()
{var isModified=document.getElementById('defaultValue')==null||document.getElementById('defaultValue').value!='true';if(!isModified)
{setDivHeWi();var blockDiv=document.getElementById('blockDiv');blockDiv.style.opacity=0.4;blockDiv.style.filter='alpha(opacity = 40)';blockDiv.style.backgroundColor="#E1E1E1";blockDiv.onclick=function()
{alert("Step One: Specify your requirements in form above and click the 'Compare Quotes' button Step Two: Apply for the product of your choice");};if(document.getElementById('showModifyMsg'))
document.getElementById('showModifyMsg').innerHTML='These are Sample Results. To get results best suited for you, please fill up the form above.';allowApplyOrReset('reset');document.getElementById('modifyResults').value='Compare Quotes';document.getElementById('showModifyMsg').innerHTML='Specify your criteria, click "Compare Quotes" and then Apply for the product of your choice';var selects=document.getElementsByTagName('select');for(var i in selects)
{if(selects[i].length>0&&selects[i].selectedIndex==0&&(selects[i].options[0].value==''||selects[i].options[0].value=='0'))
selects[i].options[0].innerHTML='--Select--';}
var inputElements=document.getElementsByTagName('input');if(inputElements.length>0)
{for(var j in inputElements)
{status=inputElements[j].getAttribute("type");if(status=="checkbox")
inputElements[j].checked=false;}}}}
function validateChildrensPlan()
{if(document.getElementById('childAge').value=="0")
{alert("Please Select Child Age");document.getElementById('childAge').focus();return false;}
if(document.getElementById('childGender').value=="0")
{alert('Please Select Child Gender');document.getElementById('childGender').focus();return false;}
var cityElement=document.getElementById("frmComparatorSearch").city;var cityTextBoxElement=document.getElementById("frmComparatorSearch").cityTextBox;if(cityElement.value=="0")
{alert("Please select city");cityTextBoxElement.focus();return false;}
var apnaExchangePolicyElem=document.getElementById("apnaExchangePolicy");var apnaExchangeCheckBoxValueElem=document.getElementById("apnaExchangeCheckBoxValue");if(apnaExchangePolicyElem&&apnaExchangePolicyElem.checked)
{apnaExchangeCheckBoxValueElem.value="checked";apnaExchangePolicyElem.value="Y";}
else
{apnaExchangeCheckBoxValueElem.value="unchecked";}
if(validateCustomerNameEmailMobile())
{document.getElementById('applicantName').value=document.getElementById("tmpApplicantName").value;document.getElementById('applicantMobile').value=document.getElementById("tmpApplicantMobile").value;document.getElementById('applicantEmail').value=document.getElementById("tmpApplicantEmail").value;if(!document.getElementById("privacyPolicy").checked)
{alert("Please check the privacy policy");document.getElementById("privacyPolicy").focus();return false;}
document.getElementById('searchCriteriaDiv').style.display='none';document.getElementById('principalListDiv').style.display='block';document.getElementById('_principalIds').name='noName';document.getElementById("pleaseWaitUrl").value='/childrens-plans-india/compare/'+(cityTextBoxElement.value).toLowerCase()+'.html';return true;}
else
{return false;}
return true;}
function getPayoutStructure(sMode,sElementName,sElement,sWidth,sTop,typeOfPlan,payoutStructure)
{var sLeftPos=0;var sTopPos=0;while(sElement)
{sLeftPos+=sElement.offsetLeft;sTopPos+=sElement.offsetTop;sElement=sElement.offsetParent;}
sLeftPos=sLeftPos+sWidth+"px";sTopPos=sTopPos+sTop+"px";var sDisplay=(sMode=="show")?"inline":"none";var structure=payoutStructure.split('##');if(typeOfPlan=="Endowment")
{document.getElementById('moneybackDiv').style.display='none';if(oElement=eval(document.getElementById('endowmentDiv')))
{oElement.style.left=sLeftPos;oElement.style.top=sTopPos;oElement.style.display=sDisplay;}
var payoutArray=structure[0].split(':');document.getElementById('endow1').innerHTML=payoutArray[0];document.getElementById('endow2').innerHTML=payoutArray[1];}
if(typeOfPlan=="Moneyback")
{document.getElementById('endowmentDiv').style.display='none';if(oElement=eval(document.getElementById('moneybackDiv')))
{oElement.style.left=sLeftPos;oElement.style.top=sTopPos;oElement.style.display=sDisplay;}
for(i=0;i<structure.length;i++)
{var payoutArray=structure[i].split(':');document.getElementById('moneyback'+i+'1').innerHTML=payoutArray[0];document.getElementById('moneyback'+i+'2').innerHTML=payoutArray[1];}}}
function selectRiders(rider,cnt)
{if(document.getElementById(rider).checked)
{for(i=0;i<cnt;i++)
{document.getElementById('rider'+i).checked=true;}}
if(!document.getElementById(rider).checked)
{for(i=0;i<cnt;i++)
{document.getElementById('rider'+i).checked=false;}}}
function calculateTenureforChildPlan(childAge,childMaturityAge)
{var tenure=childMaturityAge-childAge;document.getElementById("tenure").value=tenure;var ppt=document.getElementById("premiumPayingTerm");ppt.disabled=false;if(tenure==0)
{ppt.selectedIndex=0;}
if(document.getElementById("REGULAR").checked)
{for(i=ppt.length-1;i>0;i--)
{if(parseInt(ppt[i].value)==parseInt(tenure))
{ppt.selectedIndex=i;break;}}
ppt.disabled=false;}
else if(document.getElementById("LIMITED").checked)
{removeOptions('premiumPayingTerm');for(i in prePayingTerm["limited"])
{addOption('premiumPayingTerm',prePayingTerm["limited"][i],prePayingTerm["limited"][i]);}
for(i=ppt.length-1;i>0;i--)
{if(parseInt(ppt[i].value)<parseInt(tenure))
{break;}
else
{ppt.remove(i);}}}
else
{ppt.selectedIndex=1;ppt.disabled=true;}}
function resetChildrensPlan()
{document.getElementById('childAge').value="0";document.getElementById('childGender').value="0";document.getElementById('city').value=0;document.getElementById('tmpApplicantName').value='Name';document.getElementById('tmpApplicantMobile').value='Mobile';document.getElementById('tmpApplicantEmail').value='Email';}
function calculateAgeForImmediatePension()
{var formParams="";formParams+="id="+document.getElementById('offeringTypeId').value;var minimumAgeVestingVal=document.getElementById('minimumAgeVesting').value;var ajaxUrl="/"+nameSpace+"/ajax/kyxHelper.html"
var receiveReq=window.getXmlHttpRequestObject();if(receiveReq.readyState==4||receiveReq.readyState==0)
{receiveReq.open("POST",ajaxUrl,true);receiveReq.setRequestHeader("Content-Length",formParams.length);receiveReq.setRequestHeader("Content-Type","application/x-www-form-urlencoded");receiveReq.onreadystatechange=function()
{if(receiveReq.readyState==4)
{var response=receiveReq.responseText;var respArray=response.split("#");var a=respArray[0].substring(1);var b=respArray[1].substring(1);var strArray1=a.split(",");min=findMinValue(strArray1);var strArray2=b.split(",");max=findMaxValue(strArray2);removeOptions('minimumAgeVesting');for(var i=parseInt(min);i<=parseInt(max);i++)
{addOption('minimumAgeVesting',i,i);}
setIndexOfDropDownBasedOnValue('minimumAgeVesting',minimumAgeVestingVal);}};receiveReq.send(formParams);}}
function validateCustomerNameEmailMobile()
{var countryCode="91";var userName=document.getElementById("tmpApplicantName");var tam=document.getElementById('tmpApplicantMobile');var userEmail=document.getElementById('tmpApplicantEmail');if(apnaloan.isNotNull(userName))
{if(userName.value==""||userName.value=="Name")
{alert("Please enter Name");userName.focus();return false;}
userName.name='name';}
if(apnaloan.isNotNull(tam))
{var mob=tam.value;if(mob==""||mob=="Mobile")
{alert('Please enter correct mobile number');return false;}
else
{mobileNumbera=apnaloan.trim(mob);if(apnaloan.trim(countryCode)==91)
{if(mobileNumbera==''||isNaN(mobileNumbera)||(countryCode==91&&((mobileNumbera.substring(0,1)!='9'&&mobileNumbera.substring(0,1)!='8'&&mobileNumbera.substring(0,1)!='7')||mobileNumbera.length!=10)))
{alert('Please enter correct mobile number');return false;}}}
tam.name='mobile';}
if(apnaloan.isNotNull(userEmail))
{if(userEmail.value==""||userEmail.value=="Email")
{alert('Please enter email');return false;}
else
{email=apnaloan.trim(userEmail.value);if(!validateEmail(email))
{alert('Please enter correct email');return false;}}
userEmail.name='email';}
return true;}
function validateImmediatePensionPlan()
{if(document.getElementById('minimumAgeVesting').value==0)
{alert("Please Enter Age");return false;}
if(document.getElementById('minimumPurchasePrice').value==0)
{alert("Please Enter Purchase Price");return false;}
var cityElement=document.getElementById("frmComparatorSearch").city;var cityTextBoxElement=document.getElementById("frmComparatorSearch").cityTextBox;if(cityElement.value=="0")
{alert("Please select city");cityTextBoxElement.focus();return false;}
if(validateCustomerNameEmailMobile())
{document.getElementById('searchCriteriaDiv').style.display='none';document.getElementById('principalListDiv').style.display='block';document.getElementById('applicantName').value=document.getElementById("tmpApplicantName").value;document.getElementById('applicantMobile').value=document.getElementById("tmpApplicantMobile").value;document.getElementById('applicantEmail').value=document.getElementById("tmpApplicantEmail").value;document.getElementById('_principalIds').name='noName';document.getElementById("pleaseWaitUrl").value='/pension-plans-india/immediate-compare/'+(cityTextBoxElement.value).toLowerCase()+'.html';return true;}
else
{return false;}}
function resetImmediatePensionPlan()
{document.getElementById('minimumPurchasePrice').selectedIndex=0;document.getElementById('minimumAgeVesting').selectedIndex=0;document.getElementById("frmComparatorSearch").city.value="0";document.getElementById("frmComparatorSearch").cityTextBox.value="Select a City";document.getElementById('tmpApplicantName').value='Name';document.getElementById('tmpApplicantMobile').value='Mobile';document.getElementById('tmpApplicantEmail').value='Email';}
var limitedPptArray=new Array();function calculateForRegularPension()
{var formParams="";var selectedIndex=0;var tenureArray;var i=0;formParams+="id="+document.getElementById('offeringTypeId').value+"&age="+document.getElementById('age').value;var ajaxUrl="/"+nameSpace+"/ajax/kyxHelper.html"
var receiveReq=window.getXmlHttpRequestObject();if(receiveReq.readyState==4||receiveReq.readyState==0)
{receiveReq.open("POST",ajaxUrl,true);receiveReq.setRequestHeader("Content-Length",formParams.length);receiveReq.setRequestHeader("Content-Type","application/x-www-form-urlencoded");receiveReq.onreadystatechange=function()
{if(receiveReq.readyState==4)
{var response=receiveReq.responseText;var respArray=response.split("#");var a=respArray[0].substring(1);var b=respArray[1].substring(1);var c=respArray[2].substring(1);if(document.getElementById('age')){ageVal=document.getElementById('age').value;}
else{ageVal=35;}
var ageArray=a.split(",");ageArray.sort(sortNumbers);removeOptions('age');for(i=0;i<ageArray.length;i++)
{addOption('age',ageArray[i],ageArray[i]);if(ageVal==ageArray[i]){selectedIndex=i+1;}}
document.getElementById("age").selectedIndex=selectedIndex;if(document.getElementById('notionalCashAmount')){cashAmtVal=document.getElementById('notionalCashAmount').value;}
else{cashAmtVal=1000000;}
var notionalCashArray=b.split(",");notionalCashArray.sort(sortNumbers);removeOptions('notionalCashAmount');selectedIndex=0;for(i=0;i<notionalCashArray.length;i++)
{var textTextWithComma=CommaFormatted(notionalCashArray[i]);addOption('notionalCashAmount',notionalCashArray[i],textTextWithComma);if(cashAmtVal==parseInt(notionalCashArray[i])){selectedIndex=i+1;}}
document.getElementById("notionalCashAmount").selectedIndex=selectedIndex;if(document.getElementById('tenure')){tenureVal=document.getElementById('tenure').value;}
else{tenureVal=25;}
tenureArray=c.split(",");tenureArray.sort(sortNumbers);removeOptions('tenure');selectedIndex=0;for(i=0;i<tenureArray.length;i++)
{addOption('tenure',tenureArray[i],tenureArray[i]);if(tenureVal==tenureArray[i]){selectedIndex=i+1;}}
document.getElementById("tenure").selectedIndex=selectedIndex;}};receiveReq.send(formParams);}}
function displayPremiumPayingTerm(tenure)
{var ppt=document.getElementById("premiumPayingTerm");ppt.disabled=false;if(tenure==0)
{ppt.selectedIndex=0;}
if(document.getElementById("regular").checked)
{removeOptions('premiumPayingTerm');addOption('premiumPayingTerm',tenure,tenure);ppt.selectedIndex=1;ppt.disabled=true;}
else if(document.getElementById("limited").checked)
{removeOptions('premiumPayingTerm');for(i in limitedPptArray){addOption('premiumPayingTerm',limitedPptArray[i],limitedPptArray[i]);}
for(i=ppt.length-1;i>0;i--)
{if(parseInt(ppt[i].value)<parseInt(tenure)){break;}
else{ppt.remove(i);}}}
else
{removeOptions('premiumPayingTerm');addOption('premiumPayingTerm',1,1);ppt.selectedIndex=1;ppt.disabled=true;}}
function validateRegularPensionPlan()
{if(document.getElementById('age').value==0)
{alert("Please Enter Age");document.getElementById('age').focus();return false;}
if(document.getElementById('gender').value==0)
{alert("Please Enter Gender");document.getElementById('gender').focus();return false;}
if(document.getElementById('notionalCashAmount').value==0)
{alert("Please Enter Notional Cash Amount");document.getElementById('notionalCashAmount').focus();return false;}
if(document.getElementById('tenure').value==0)
{alert("Please Enter Tenure");document.getElementById('tenure').focus();return false;}
var cityElement=document.getElementById("frmComparatorSearch").city;var cityTextBoxElement=document.getElementById("frmComparatorSearch").cityTextBox;if(cityElement.value=="0")
{alert("Please select city");cityTextBoxElement.focus();return false;}
if(validateCustomerNameEmailMobile())
{document.getElementById('searchCriteriaDiv').style.display='none';document.getElementById('principalListDiv').style.display='block';document.getElementById('applicantName').value=document.getElementById("tmpApplicantName").value;document.getElementById('applicantMobile').value=document.getElementById("tmpApplicantMobile").value;document.getElementById('applicantEmail').value=document.getElementById("tmpApplicantEmail").value;document.getElementById('_principalIds').name='noName';document.getElementById("pleaseWaitUrl").value='/pension-plans-india/compare/'+(cityTextBoxElement.value).toLowerCase()+'.html';return true;}
else
{return false;}}
function showInformationText(sMode,sElement,sWidth,sHeight,sTop,informationText)
{var sLeftPos=0;var sTopPos=0;var widthOfTable=parseInt(document.getElementById('informationTexTable').width);while(sElement)
{sLeftPos+=sElement.offsetLeft;sTopPos+=sElement.offsetTop;sElement=sElement.offsetParent;}
sLeftPos=sLeftPos+(sWidth/2)-(widthOfTable/2)+"px";sTopPos=sTopPos+sTop+"px";var sDisplay=(sMode=="show")?"inline":"none";if(sMode=='show'){document.getElementById('informationTextTd').innerHTML=informationText;}
if(oElement=eval(document.getElementById('informationTextDiv')))
{oElement.style.left=sLeftPos;oElement.style.top=sTopPos;oElement.style.display=sDisplay;}}
function getAnnuityDetails(sMode,sElement,sWidth,sTop,annuityText)
{var sLeftPos=0;var sTopPos=0;while(sElement)
{sLeftPos+=sElement.offsetLeft;sTopPos+=sElement.offsetTop;sElement=sElement.offsetParent;}
sLeftPos=sLeftPos+sWidth+"px";sTopPos=sTopPos+sTop+"px";var sDisplay=(sMode=="show")?"inline":"none";if(oElement=eval(document.getElementById('annuityDetailsDiv')))
{oElement.style.left=sLeftPos;oElement.style.top=sTopPos;oElement.style.display=sDisplay;}
if(annuityText.substring(0,2)=="&&")
{annuityText=annuityText.substring(2);}
var annuityArray=annuityText.split('&&');var annuityNo=document.getElementById('annuityNo').value;var tableElement=document.getElementById("annuityTable");var tbody=tableElement.getElementsByTagName('tbody')[0];if(annuityNo!="")
{limit=parseInt(annuityNo);for(var i=0;i<limit;i++)
{tbody.removeChild(document.getElementById("annuity"+i));}}
for(var i=0;i<annuityArray.length;i++)
{var tr=document.createElement("tr");var td=document.createElement("td");td.height="20";td.style.bgColor='#FDF8F2';tr.id="annuity"+i;td.innerHTML=annuityArray[i];tr.appendChild(td);tbody.appendChild(tr);}
document.getElementById('annuityNo').value=annuityArray.length;}
function resetRegularPensionPlan()
{document.getElementById('age').selectedIndex=0;document.getElementById('gender').selectedIndex=0;document.getElementById('notionalCashAmount').selectedIndex=0;document.getElementById('tenure').selectedIndex=0;document.getElementById("frmComparatorSearch").city.value="0";document.getElementById("frmComparatorSearch").cityTextBox.value="Select a City";document.getElementById('tmpApplicantName').value='Name';document.getElementById('tmpApplicantMobile').value='Mobile';document.getElementById('tmpApplicantEmail').value='Email';}
function findMinValue(strArray)
{try{for(var i=0;i<strArray.length;i++)
{strArray[i]=parseInt(strArray[i]);}}catch(exe){alert('Not a number in array')}
var min=strArray[0];for(var i=0;i<strArray.length;i++)
{if(strArray[i]<min)
{min=strArray[i];}}
return min;}
function findMaxValue(strArray)
{try{for(var i=0;i<strArray.length;i++)
{strArray[i]=parseInt(strArray[i]);}}catch(exe){alert('Not a number in array')}
var max=strArray[0];for(var i=0;i<strArray.length;i++)
{if(strArray[i]>max)
{max=strArray[i];}}
return max;}
function displayInfoAboutField(evnt,sMode,sElement,sWidth,sTop,divName)
{if(evnt=='mouseover')
{var sLeftPos=0;var sTopPos=0;while(sElement)
{sLeftPos+=sElement.offsetLeft;sTopPos+=sElement.offsetTop;sElement=sElement.offsetParent;}
sLeftPos=sLeftPos+sWidth+8+"px";sTopPos=sTopPos+sTop-92+"px";var sDisplay=(sMode=="show")?"inline":"none";if(oElement=eval(document.getElementById(divName)))
{oElement.style.left=sLeftPos;oElement.style.top=sTopPos;oElement.style.display=sDisplay;}
document.getElementById(divName).style.display='block';}
else
{document.getElementById(divName).style.display='none';}}
var sortFullData=new Array();var sortSponData=new Array();function getDataForSorting(fullListcnt,sponListcnt,noRows)
{for(i=0;i<fullListcnt;i++)
{var row=new Array(noRows);for(j=0;j<noRows;j++)
{row[j]=document.getElementById("f"+j+"_"+i).innerHTML;}
sortFullData[i]=row;}
for(i=0;i<sponListcnt;i++)
{var row=new Array(noRows);for(j=0;j<noRows;j++)
{row[j]=document.getElementById("s"+j+"_"+i).innerHTML;}
sortSponData[i]=row;}}
function resetDataForSorting(fullListcnt,sponListcnt,noRows)
{for(i=0;i<fullListcnt;i++)
{for(j=0;j<noRows;j++)
{document.getElementById("f"+j+"_"+i).innerHTML=sortFullData[mainDataArray[i]['rowIndex']][j];}}
for(i=0;i<sponListcnt;i++)
{for(j=0;j<noRows;j++)
{document.getElementById("s"+j+"_"+i).innerHTML=sortSponData[sponsoredDataArray[i]['rowIndex']][j];}}
for(i=0;i<fullListcnt;i++)
{mainDataArray[i]['rowIndex']=i;}
for(i=0;i<sponListcnt;i++)
{sponsoredDataArray[i]['rowIndex']=i;}}
var key;var sortAsNum=new Array();var flagAscDescBackUp;function sortTable(str,fullListcnt,sponListcnt,noRows)
{if(document.getElementById("sortingImage")!=null)
{document.getElementById("sortingImage").style.left=(screen.width)?screen.width/2:0;document.getElementById("sortingImage").style.top=(screen.height)?screen.height/2:0;document.getElementById("sortingImage").style.display='';}
if(flagAscDescBackUp==null)
{flagAscDescBackUp=new Array()
for(i in flagAscDesc)
{flagAscDescBackUp[i]=flagAscDesc[i];}}
key=str;getDataForSorting(fullListcnt,sponListcnt,noRows);if(fullListcnt==0)
{return;}
for(i in flagAscDesc)
{document.getElementById(i+"SortImage").style.display='none';if(i!=key)
{flagAscDesc[i]=flagAscDescBackUp[i];}}
backUpArray=new Array();for(i=0;i<sortAsNum.length;i++)
if(sortAsNum[i]==str)
{backUpArray=createBkUp(fullListcnt,sponListcnt,str,flagAscDesc[str]);break;}
document.getElementById(str+'SortImage').style.display='';if(flagAscDesc[str]==false)
{document.getElementById(str+'SortImage').src="/images/down.gif";mainDataArray.sort(compAscSort);sponsoredDataArray.sort(compAscSort);flagAscDesc[str]=true;}
else
{document.getElementById(str+'SortImage').src="/images/TopArrow.gif";mainDataArray.sort(compDesSort);sponsoredDataArray.sort(compDesSort);flagAscDesc[str]=false;}
for(i=0;i<sortAsNum.length;i++)
if(sortAsNum[i]==str)
{resetOriginalValues(backUpArray,fullListcnt,sponListcnt,str);break;}
if(document.getElementById("sortingImage")!=null)
{document.getElementById("sortingImage").style.display='none';}
resetDataForSorting(fullListcnt,sponListcnt,noRows);}
function createBkUp(fullListcnt,sponListcnt,index,isSortDesc)
{var tmpArr=new Array();var tmpFullArr=new Array();var tmpSponArr=new Array();for(i=0;i<fullListcnt;i++)
{tmpFullArr[i]=mainDataArray[i][index];mainDataArray[i][index]=replaceValue2number(mainDataArray[i][index],isSortDesc);}
for(i=0;i<sponListcnt;i++)
{tmpSponArr[i]=sponsoredDataArray[i][index];sponsoredDataArray[i][index]=replaceValue2number(sponsoredDataArray[i][index],isSortDesc);}
tmpArr[0]=tmpFullArr;tmpArr[1]=tmpSponArr;return tmpArr;}
function resetOriginalValues(backUpArray,fullListcnt,sponListcnt,index)
{for(i=0;i<fullListcnt;i++)
{mainDataArray[i][index]=backUpArray[0][mainDataArray[i]['rowIndex']];}
for(i=0;i<sponListcnt;i++)
{sponsoredDataArray[i][index]=backUpArray[1][sponsoredDataArray[i]['rowIndex']];}}
function replaceValue2number(value,isSortDesc)
{try{value=value.replace(" ","");}catch(ex){}
if(value=="DNA"||value=="NA"||value==""||value=="n/a"||value=="data not available")
{if(isSortDesc)
{value="-99999999999";}else{value="9999999999";}}else if(value=="free"){value="-999999999";}
try{return parseFloat(value);}catch(ex){}}
function compAscSort(a,b)
{if(eval("a."+key+" == b."+key)){return 0;}return(eval("a."+key+" < b."+key))?-1:1;}
function compDesSort(a,b)
{if(eval("a."+key+" == b."+key)){return 0;}return(eval("a."+key+" > b."+key))?-1:1;}
function validateSmartApply()
{var product=document.getElementsByName('productType');var flag=true;var selectProduct;var productId;for(i=0;i<product.length;i++)
{if(product[i].checked==true)
{flag=false;selectProduct=product[i].id;productId=product[i].value;}}
if(flag)
{alert('Please select product');return false;}
var domain;if(productId==1||productId==2||productId==4||productId==12)
{domain='http://www.apnaloan.com'}
else
{domain='http://www.apnainsurance.com'}
if(document.getElementById('city').value==0)
{alert('Please select City of residence');return false;}
if(document.getElementById('country_code').value==0)
{alert('Please select country code');return false;}
var name=apnaloan.trim(document.getElementById('name').value);if(name=='')
{alert('Please enter your Name');return false;}
var countryCode=document.getElementById('country_code').value;var mobile=apnaloan.trim(document.getElementById('mobile').value);if(mobile==''||isNaN(mobile)||(countryCode==91&&((mobile.substring(0,1)!='9'&&mobile.substring(0,1)!='8'&&mobile.substring(0,1)!='7')||mobile.length!=10)))
{alert('Please enter your mobile number');return false;}
var dobDay=document.getElementById('dobDay').value;var dobMonth=document.getElementById('dobMonth').value;var dobYear=document.getElementById('dobYear').value;if(dobDay==0||dobMonth==0||dobYear==0)
{alert('Please select your date of Birth');return false;}
if(document.getElementById('loanAmount').style.display!='none')
{var loanAmount=apnaloan.trim(document.getElementById('loanAmount').value);if(loanAmount==''||isNaN(loanAmount))
{alert('Please enter your loan Amount');return false;}}
var email=apnaloan.trim(document.getElementById('email').value);if(!validateEmail(email))
{return false;}
var monthlyIncome=apnaloan.trim(document.getElementById('monthlyIncome').value);if(monthlyIncome==''||isNaN(monthlyIncome))
{alert('Please enter your monthly Income');return false;}
var residentialstatus=(document.getElementById('is_nri_n').checked==document.getElementById('is_nri_y').checked)?true:false;if(residentialstatus)
{alert('Please select residential status');return false;}
var professionType=document.getElementById('professionType').value;if(professionType==0)
{alert('Please select profession');return false;}
if(document.getElementById('homeloan').style.display!='none')
{var subProduct=document.getElementById('subProduct').value;if(subProduct==0)
{alert('Please select purpose of loan');return false;}
var property=(document.getElementById('property_in_same_city_y').checked==document.getElementById('property_in_same_city_n').checked)?true:false;if(property)
{alert('Please select property in same city yes or no');return false;}}
if(document.getElementById('personal').style.display!='none')
{var houseowner=(document.getElementById('house_ownership_y').checked==document.getElementById('house_ownership_n').checked)?true:false;if(houseowner)
{alert('Please select house ownership yes or no');return false;}
var totalEMI=apnaloan.trim(document.getElementById('totalEMI').value);if(totalEMI==''||isNaN(totalEMI))
{alert('Please enter your total existing EMI');return false;}}
if(document.getElementById('car').style.display!='none')
{var manufacturer=apnaloan.trim(document.getElementById('manufacturer').value);if(manufacturer=='')
{alert('Please enter manufacturer');return false;}
var carType=(document.getElementById('type_of_car_new').checked==document.getElementById('type_of_car_old').checked)?true:false;if(carType)
{alert('Please select car Type');return false;}}
var url="";(selectProduct=='hl')?url='home-loan-india':(selectProduct=='pl')?url='personal-loan-india':(selectProduct=='cl')?url='car-loan-india':(selectProduct=='lap')?url='loan-against-property-india':(selectProduct=='bl')?url='loan-against-property-india':(selectProduct=='el')?url='education-loan-india':url='credit-card-india';if(document.getElementById("journey")&&document.getElementById("journey").value=="abandoned")
{document.getElementById('smartSearchfrm').action=domain+"/"+url+"/smartSearchForCdo.html";}
else
{document.getElementById('smartSearchfrm').action=domain+"/"+url+"/smart-result.html";}
return true;}
function showSearchForm()
{document.getElementById('searchTable').style.zIndex=100;document.getElementById('searchTable').style.display='';}
function setIndexOfDropDownBasedOnValue(id,value)
{var dropdown=document.getElementById(id);for(i=0;i<dropdown.length;i++)
{if(dropdown[i].value==value)
{dropdown.selectedIndex=i;break;}}}
function showFamilyDetailDiv(policyType)
{document.getElementById("individualFamilyCount").style.display='none';document.getElementById("floaterFamilyCount").style.display='none';document.getElementById("individualDetails").style.display='none';document.getElementById("floaterDetails").style.display='none';if(policyType=="INDIVIDUAL")
{document.getElementById("individualFamilyCount").style.display='';document.getElementById("individualDetails").style.display='';fixedHealthInsCreateRow(document.getElementById('individualFamilyCount').value);}else{document.getElementById("floaterFamilyCount").style.display='';document.getElementById("floaterDetails").style.display='';}}
function changePlan(plan)
{if(plan==document.getElementById('planType').value)
{return;}
document.getElementById('pageDesc').value='Back';document.getElementById('planType').value=plan;formTag=document.getElementById('frmComparatorSearch');document.getElementById('policyDuration').value='1';if(plan=='INDIVIDUAL')
{document.getElementById('ages').value="30";document.getElementById('sumAssured').value="300000";document.getElementById('personCount').value="1";document.getElementById('policyType').value="BLANK";document.getElementById('relationType').value='Self';}
else if(plan=='FAMILY_INDIVIDUAL'||plan=='FAMILY_FLOATER')
{document.getElementById('ages').value="30";document.getElementById('sumAssured').value="300000";document.getElementById('personCount').value="1";document.getElementById('relationType').value='Self';if(plan=='FAMILY_INDIVIDUAL')
{document.getElementById('policyType').value="BLANK";}
else
{document.getElementById('policyType').value="FLOATER";}}
else if(plan=='SENIOR_CITIZEN')
{document.getElementById('ages').value="65";document.getElementById('sumAssured').value="500000";document.getElementById('personCount').value="1";document.getElementById('policyType').value="INDIVIDUAL";document.getElementById('relationType').value='Self';}
document.getElementById('hideCriteria').name="freshSubHideCriteria";document.getElementById("hideCriteria").value="false";document.getElementById('city').name='tmpCity';dynamicSubmit('/health-insurance-india/compare.html','POST',formTag.id);}
function showChangeCriteria()
{if(document.getElementById('defaultValue').value=='true'&&document.getElementById('userData').style.display=='none')
{document.getElementById('modifyBtn').style.display='';}else{document.getElementById('modifyBtn').style.display='none';}}
function validateUlip()
{if(document.getElementById('premiumAmt').value==0)
{alert('Please select premium range');return false;}
if(document.getElementById('age').value==0)
{alert('Please select your age ');return false;}
var cityElement=document.getElementById("frmComparatorSearch").city;var cityTextBoxElement=document.getElementById("frmComparatorSearch").cityTextBox;if(cityElement.value=="0")
{alert("Please select city");cityTextBoxElement.focus();return false;}
if(validateCustomerNameEmailMobile())
{document.getElementById('searchCriteriaDiv').style.display='none';document.getElementById('principalListDiv').style.display='block';document.getElementById('applicantName').value=document.getElementById("tmpApplicantName").value;document.getElementById('applicantMobile').value=document.getElementById("tmpApplicantMobile").value;document.getElementById('applicantEmail').value=document.getElementById("tmpApplicantEmail").value;document.getElementById('_principalIds').name='noName';document.getElementById("pleaseWaitUrl").value=document.getElementById("pleaseWaitUrl").value+(cityTextBoxElement.value).toLowerCase()+'.html';return true;}
else
{return false;}}
function selectPrincipalList(noOfPrincipal)
{var principalIds="";for(i=0;i<noOfPrincipal;i++)
{if(document.getElementById('principal'+i).checked)
{principalIds+=document.getElementById('principal'+i).value+",";}}
if(principalIds!="")
{document.getElementById("_principalIds").value=principalIds.substring(0,principalIds.length-1);document.getElementById("_principalIds").name="principalIds";}}
function narrowDownResultsForNewCompareForm(noOfPrincipal)
{var principalIds="";for(i=0;i<noOfPrincipal;i++)
{if(document.getElementById('principal'+i).checked)
{principalIds+=document.getElementById('principal'+i).value+",";}}
if(principalIds!="")
{document.getElementById("_principalIds").value=principalIds.substring(0,principalIds.length-1);}
if(document.getElementById('_principalIds').value=="")
{document.getElementById('_principalIds').name='noName';}
return true;}
function refineSearchForNewCompareForm()
{document.getElementById('searchCriteriaDiv').style.display='block';document.getElementById('principalListDiv').style.display='none';if(document.getElementById('sortOptionDiv')){document.getElementById('sortOptionDiv').style.display='none';}}
function showMoreTextForUlip(divIndex)
{document.getElementById('shortTextDiv_'+divIndex).style.display='none';document.getElementById('longTextDiv_'+divIndex).style.display='block';}
function collapseTextForUlip(divIndex)
{document.getElementById('shortTextDiv_'+divIndex).style.display='block';document.getElementById('longTextDiv_'+divIndex).style.display='none';}
function selectAllchkBoxes(value,id,noOfPrincipal)
{for(i=0;i<noOfPrincipal;i++)
{document.getElementById(id+i).checked=value;}}
function sortUlipResults(selectedVal,fullListSize,sponsoredListSize,numColumn)
{if(selectedVal==1)
{sortTable('action',fullListSize,sponsoredListSize,numColumn);}
if(selectedVal==2)
{sortTable('bankName',fullListSize,sponsoredListSize,numColumn);}
if(selectedVal==3)
{sortTable('maxTerm',fullListSize,sponsoredListSize,numColumn);}
if(selectedVal==4)
{sortTable('p1st',fullListSize,sponsoredListSize,numColumn);}
if(selectedVal==5)
{sortTable('p2nd',fullListSize,sponsoredListSize,numColumn);}
if(selectedVal==6)
{sortTable('p3rd',fullListSize,sponsoredListSize,numColumn);}
if(selectedVal==7)
{sortTable('p4th',fullListSize,sponsoredListSize,numColumn);}
if(selectedVal==8)
{sortTable('adminCharges',fullListSize,sponsoredListSize,numColumn);}
if(selectedVal==9)
{sortTable('fundOptions',fullListSize,sponsoredListSize,numColumn);}
if(selectedVal==10)
{sortTable('freeSwitch',fullListSize,sponsoredListSize,numColumn);}}
function resetUlipValues()
{document.getElementById('premiumAmt').selectedIndex=0;document.getElementById('age').selectedIndex=0;document.getElementById('city').selectedIndex=0;document.getElementById('tmpApplicantName').value='Name';document.getElementById('tmpApplicantMobile').value='Mobile';document.getElementById('tmpApplicantEmail').value='Email';}
function setLeftTopOfPopup(id)
{var oElement=document.getElementById(id);var width=document.getElementById(id).style.width;var height=document.getElementById(id).style.height;var x=xMousePos;var y=yMousePos;oElement.style.left=x;oElement.style.top=y;oElement.style.display='inline';}
function showfundDetail(data)
{var dataArray=data.split("~^~");var str="";var tab=document.getElementById("fundOptionsTable");var rowTmp=tab.getElementsByTagName("tr")[3].cloneNode(true);var rows=tab.getElementsByTagName("tr");document.getElementById("fundDetails").style.display='';for(i=3;i<rows.length;i++)
{rows[i].style.display='';}
for(i=0;i<dataArray.length;i++)
{if(rows.length-3>i)
{setFundData(rows[i+3],dataArray[i].split("~~"));}else{newRow=createRowForFundOpt();setFundData(newRow,dataArray[i].split("~~"));tab.appendChild(newRow);}
document.getElementById("fundDetails").style.display='';}
var rows=tab.getElementsByTagName("tr");for(i=3+dataArray.length;i<rows.length;i++)
{rows[i].style.display='none';}
document.getElementById("fundDetails").style.display='';setLeftTopOfPopup("fundDetails");return false;}
function setFundData(row,data)
{for(j=0;j<6;j++)
{row.cells[j].innerHTML=data[j];}}
function createRowForFundOpt()
{var tr=document.createElement("tr");var td=document.createElement("td");td.className="tabCellData";td.align="left";td.style.borderColor="#d4b595";tr.appendChild(td);var td=document.createElement("td");td.className="tabCellData";td.style.borderColor="#d4b595";td.style.backgroundColor="#F9EFDB";tr.appendChild(td);var td=document.createElement("td");td.className="tabCellData";td.style.borderColor="#d4b595";td.style.backgroundColor="#F8F7E4";tr.appendChild(td);var td=document.createElement("td");td.className="tabCellData";td.style.borderColor="#d4b595";td.style.backgroundColor="#F9EFDB";tr.appendChild(td);var td=document.createElement("td");td.className="tabCellData";td.style.borderColor="#d4b595";td.style.backgroundColor="#F8F7E4";tr.appendChild(td);var td=document.createElement("td");td.className="tabCellData";td.style.borderColor="#d4b595";tr.appendChild(td);return tr;}
var lastPremium=0;function fetchTenures(value)
{if(lastPremium==value)
{lastPremium=value;return;}
var tenure='';var offTypeIds='';if(document.getElementById('allOfferingType')!=null&&!document.getElementById('allOfferingType').checked)
{for(i=0;i<5;i++)
{if(document.getElementById('offeringType'+i).checked==true)
{offTypeIds+=","+document.getElementById('offeringType'+i).value;}}}else if(document.getElementById('allOfferingType')==null)
{offTypeIds=","+document.getElementById('offeringTypeId').value;}
else{offTypeIds=",11,12,13,14,15";}
offTypeIds=offTypeIds.substring(1).split(",");var tmpTenure=new Array(),ajax=new Array();for(i=0;i<offTypeIds.length;i++)
{tmpTenure[i]=null;try{var formParams="id="+offTypeIds[i];formParams+='&premiumAmt='+value;formParams+='&cmd=tenure';var ajaxUrl="/"+nameSpace+"/ajax/kyxHelper.html";ajax[i]=window.getXmlHttpRequestObject();ajax[i].open("POST",ajaxUrl,true);ajax[i].setRequestHeader("Content-Length",formParams.length);ajax[i].setRequestHeader("Content-Type","application/x-www-form-urlencoded");ajax[i].index=i;ajax[i].onreadystatechange=function()
{if(ajax[this.index].readyState==4)
{var respText=ajax[this.index].responseText;tmpTenure[this.index]=respText.length>0?respText.substring(1):'';}};ajax[i].send(formParams);}catch(ex){}}
var restoreTenureFunc=function(){var allRecvd=true;for(j=0;j<tmpTenure.length;j++){if(tmpTenure[j]==null){allRecvd=false;break;}}
if(!allRecvd){window.setTimeout(restoreTenureFunc,500);return;}
for(j=0;j<tmpTenure.length;j++){tenure+=','+tmpTenure[j];}
tenure=tenure.split(",");var selectedTenure=document.getElementById("tenure").value;removeOptions('tenure');var tmp=new Array();var cnt=0;for(i=0;i<tenure.length;i++)
{if(tenure[i]==""||tenure[i]==null||tenure[i]=='null'||tenure[i]=='NaN'||isNaN(tenure[i]))
{continue;}
tmp[cnt]=parseInt(tenure[i]);cnt++;}
tenure=unique(tmp);tenure.sort(sortNumbers);var selectedIndex;for(i=0;i<tenure.length;i++)
{if(tenure[i]==""||tenure[i]==null||tenure[i]=='null')
{continue;}
addOption('tenure',tenure[i],tenure[i]+' yrs');if(selectedTenure==tenure[i])
{selectedIndex=i+1;}}
document.getElementById("tenure").selectedIndex=selectedIndex;}
restoreTenureFunc();}
function unique(a)
{var r=new Array();o:for(var i=0,n=a.length;i<n;i++)
{for(var x=0,y=r.length;x<y;x++)
{if(r[x]==a[i])continue o;}
r[r.length]=a[i];}
return r;}
function sortNumbers(one,two){return(one-two);}
function unCheckMainCheckBox(id)
{document.getElementById(id).checked=false;}
function setOfferingType(id)
{document.getElementById('hideCriteria').value='false';if(id==0)
{document.getElementById('offeringTypeId').name='__offeringTypeId';}
else
{document.getElementById('offeringTypeId').value=id;document.getElementById('offeringTypeId').name='offeringTypeId';}
if(document.getElementById('age')){document.getElementById('age').name='ten1';}
if(document.getElementById('premiumAmt')){document.getElementById('premiumAmt').name='premiumAmt1';}
if(document.getElementById('tenure')){document.getElementById('tenure').name='ten1';}
if(document.getElementById('city')){document.getElementById('city').name='city1';}
if(document.getElementById('_principalIds')){document.getElementById('_principalIds').name='noName';}}
function CommaFormatted(amount)
{var delimiter=",";var a=amount.split('.',2)
var d=a[1];var i=parseInt(a[0]);if(isNaN(i)){return'';}
var minus='';if(i<0){minus='-';}
i=Math.abs(i);var n=new String(i);var a=[];var cnt=0;while(n.length>2)
{if(cnt==0)
{var nn=n.substr(n.length-3);n=n.substr(0,n.length-3);cnt++;}
else
{var nn=n.substr(n.length-2);n=n.substr(0,n.length-2);}
a.unshift(nn);}
if(n.length>0)
{a.unshift(n);}
n=a.join(delimiter);amount=n;amount=minus+amount;return amount;}
function formatWithComa(element)
{var obj=document.getElementById(element);if(apnaloan.trim(obj.value)=='')
{return;}
var number=obj.value.replace(/,/g,"");var formattedInput=CommaFormatted(number);obj.value=formattedInput;}
function showUserDetails()
{var isBlocked=document.getElementById("userData").style.display=='none';if(isBlocked)
{document.getElementById("userData").style.display='';document.getElementById("btnHideShow").innerHTML="&#9650; Hide Option";}else{document.getElementById("userData").style.display='none';document.getElementById("btnHideShow").innerHTML="&#9660; Refine Search";}}
function fetchAgeAndTenure()
{var formParams="id=26";makeAjaxCall(formParams,'updateLAPAgeTenure',null);}
function updateLAPAgeTenure(response,dataInfo)
{data=response.split("#");ageMin=findMinValue(data[0].substring(1).split(","));ageMax=findMaxValue(data[1].substring(1).split(","));tenureMin=findMinValue(data[2].substring(1).split(","));tenureMax=findMaxValue(data[3].substring(1).split(","));document.getElementById("minAge").value=ageMin;document.getElementById("maxAge").value=ageMax;document.getElementById("minTenure").value=tenureMin;document.getElementById("maxTenure").value=tenureMax;age=document.getElementById("age").value;tenure=document.getElementById("tenure").value;removeOptions('age');for(i=ageMin;i<=ageMax;i++)
{addOption('age',i,i+' year');}
setIndexOfDropDownBasedOnValue('age',age);calculateTenureforLoanAgainstProperty(ageMax,age,tenureMax,tenureMin,tenure);}
function fetchLAPTenure()
{var formParams="id=26";makeAjaxCall(formParams,'populateTenure',null);}
function populateTenure(response,dataInfo)
{data=response.split("#");tenureMin=findMinValue(data[2].substring(1).split(","));tenureMax=findMaxValue(data[3].substring(1).split(","));tenure=document.getElementById("tenure").value;removeOptions('tenure');for(i=tenureMin;i<=tenureMax;i++)
{addOption('tenure',i,i+' year');}
setIndexOfDropDownBasedOnValue('tenure',tenure);}
function makeAjaxCall(formParams,renderingFunc,dataInfo)
{try{var ajaxUrl="/"+nameSpace+"/ajax/kyxHelper.html";ajax=window.getXmlHttpRequestObject();ajax.open("POST",ajaxUrl,true);ajax.setRequestHeader("Content-Length",formParams.length);ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");ajax.onreadystatechange=function()
{if(ajax.readyState==4)
{var respText=ajax.responseText;eval(renderingFunc+"('"+respText+"',dataInfo)");}};ajax.send(formParams);}catch(ex){}}
function changePropertyType(propertyType)
{document.getElementById("propertyType").value=propertyType;document.getElementById("occupation").name="tmpOccupation";document.getElementById("tenure").name="tmpTenure";document.getElementById("userCity").name="userCity";document.getElementById("hideCriteria").value="false";dynamicSubmit('/loan-against-property-india/rates.html','POST','lapRate');}
function changePropertyTypeForComp(propertyType)
{document.getElementById("propertyType").value=propertyType;document.getElementById("fixed").checked=false;document.getElementById("floating").checked=false;document.getElementById("propertyValue").name="tmpPropertyValue";document.getElementById("monthlyIncome").name="tmpIncome";document.getElementById("age").name="tmpAge";document.getElementById("occupation").name="tmpOccupation";document.getElementById("tenure").name="tmpTenure";document.getElementById("loanAmt").name="tmpLoanAmount";document.getElementById("city").name="userCity";document.getElementById("hideCriteria").value="false";dynamicSubmit('/loan-against-property-india/compare.html','POST','frmComparatorSearch');}
function enableDisable(value)
{document.getElementById('btnApply').disabled=!value;document.getElementById('talkNow').disabled=!value;document.getElementById('btnSend').disabled=!value;document.getElementById('btnApplyDefault').disabled=!value;}
function checkIsAlreadyApplied(orderId,principalId)
{this.orderId=orderId;var formParams="orderId="+orderId;formParams+="&principalId="+principalId;formParams+='&checkIsAlreadyApplied='+true;var ajaxUrl="/ajax/isAlreadyAppliedForOrder.html";var receiveReq=window.getXmlHttpRequestObject();receiveReq.open("POST",ajaxUrl,false);receiveReq.setRequestHeader("Content-Length",formParams.length);receiveReq.setRequestHeader("Content-Type","application/x-www-form-urlencoded")
receiveReq.send(formParams);var response=eval("("+receiveReq.responseText+")");return response.statusCode.toString();}
function calculateValueForPrincipalEvent()
{document.getElementById('processingResultsDiv').style.height=screen.height;document.getElementById('processingResultsDiv').style.width=screen.width;document.getElementById('processingResults').style.display="block";document.getElementById('processingResults').style.marginTop=(document.getElementById('resultTable').scrollTop+300);document.getElementById('blockDiv').style.height=0;document.getElementById('blockDiv').style.width=0;var allPrincipal=document.getElementById("allPrincipal").value;var iterator=allPrincipal.split(",");var valOld='';for(var i=0;i<iterator.length;i++){if(document.getElementById(iterator[i]).style.display=='block'||(document.getElementById(iterator[i]+"1").checked)){valOld=valOld.concat(","+document.getElementById(iterator[i]+"1").value);}}
valOld=valOld.substr(1);var val='';var allPrincipal=document.getElementById("allPrincipal").value;var iterator=allPrincipal.split(",");for(var i=0;i<iterator.length;i++){if(document.getElementById(iterator[i]).style.display=='block'&&document.getElementById(iterator[i]+"1").checked){val=val.concat(","+document.getElementById(iterator[i]+"1").value);}}
val=val.substr(1);var slider1Min='';var slider1Max='';var slider2Min='';var slider2Max='';var slider3Min='';var slider3Max='';if(document.getElementById("slider1").style.display!='none'){slider1Min=(document.getElementById("slider1Min").value);slider1Max=(document.getElementById("slider1Max").value);}
if(document.getElementById("slider2").style.display!='none'){slider2Min=(document.getElementById("slider2Min").value);slider2Max=(document.getElementById("slider2Max").value);}
if(document.getElementById("slider3").style.display!='none'){slider3Min=(document.getElementById("slider3Min").value);slider3Max=(document.getElementById("slider3Max").value);}
if(val==""){val=document.getElementById("allPrincipal").value;}
var principalArrayList=valOld;var principalArrayListChecked=val;document.getElementById("principalFilter").value=val;var regionId=document.getElementById("regionId").value;var regionName=document.getElementById("regionName").value;document.getElementById("regionId").value=regionId;document.getElementById("regionName").value=regionName;if(regionName=='')
{document.getElementById('regionNameToShow').innerHTML="";}{document.getElementById('regionNameToShow').innerHTML="("+regionName+")";}
{var formParams="";formParams+="id=21&city="+document.getElementById('city').value+"&principal="+val+"&flag=providerChange&slider1Min="+slider1Min+"&slider1Max="+slider1Max+"&slider2Min="+slider2Min+"&slider2Max="+slider2Max+"&slider3Min="+slider3Min+"&slider3Max="+slider3Max+"&regionId="+regionId+"&regionName="+regionName+"productId=14";var ajaxUrl="/"+nameSpace+"/ajax/kyxHelper.html";var receiveReq=window.getXmlHttpRequestObject();if(receiveReq.readyState==4||receiveReq.readyState==0)
{receiveReq.open("POST",ajaxUrl,true);receiveReq.setRequestHeader("Content-Length",formParams.length);receiveReq.setRequestHeader("Content-Type","application/x-www-form-urlencoded");receiveReq.onreadystatechange=function()
{if(receiveReq.readyState==4)
{var response=receiveReq.responseText;var respArray=response.split("#");var result=new Array();document.getElementById("principalIds").value=valOld;var a=respArray[0];if(a==""||a==null){return;}else{a=a.replace(/\"\"\"\"/g,"\"\"");var resultFinal=eval("("+a+")");var temp='';var temp1='';var temp2='';var monthlyChargeRentalArrayDistinctmax;var monthlyChargeRentalArrayDistinctmin;var freebiesSameOperatorFreeTalkTimeMinArrayDistinctmin;var freebiesSameOperatorFreeTalkTimeMinArrayDistinctmax;var freeSmsInNumbersLocalSameOperatorArrayDistinctmin;var freeSmsInNumbersLocalSameOperatorArrayDistinctmax;monthlyChargeRentalArrayDistinctmax=respArray[1];monthlyChargeRentalArrayDistinctmin=respArray[2];freebiesSameOperatorFreeTalkTimeMinArrayDistinctmin=respArray[4];var maxVal=respArray[3];if(maxVal=='ULTD'||maxVal=='Ultd'||maxVal=='ULTD'||maxVal=='Ultd'||parseInt(maxVal)>1000){freebiesSameOperatorFreeTalkTimeMinArrayDistinctmax=1100;}
else
{freebiesSameOperatorFreeTalkTimeMinArrayDistinctmax=maxVal;}
freeSmsInNumbersLocalSameOperatorArrayDistinctmin=respArray[6];var maxVal=respArray[5];if(maxVal=='ULTD'||maxVal=='Ultd'||maxVal=='ULTD'||maxVal=='Ultd'||parseInt(maxVal)>1000)
{freeSmsInNumbersLocalSameOperatorArrayDistinctmax=1100;}
else
{freeSmsInNumbersLocalSameOperatorArrayDistinctmax=maxVal;}}
if(monthlyChargeRentalArrayDistinctmax<=100||monthlyChargeRentalArrayDistinctmax==null)
{document.getElementById("slider1").style.display="none";}
else
{document.getElementById("slider1").style.display="block";document.getElementById("dd1").innerHTML="<span id=\"my-slider-1\" ></span>";var limit1=monthlyChargeRentalArrayDistinctmax;document.getElementById("slider1Limit").value=limit1;(function(){var YUE=YAHOO.util.Event;var YUD=YAHOO.util.Dom;var YUC=YAHOO.util.CustomEvent;var isDrag=false;if(window.opera)
{YUD.addClass(document.documentElement,'borwser-opera');};var stopAction=function(e)
{YUE.stopEvent(e);return false;};var setValue=function(nFrom,nTo,dFromBtn,bNotChangePosition)
{var nOldFrom=this.from;var nOldTo=this.to;var sElementId=this.id;var dEl=document.getElementById(sElementId);var dBox=document.getElementById(sElementId+'-box');var dC0=document.getElementById(sElementId+'-ctrl-0');var dC1=document.getElementById(sElementId+'-ctrl-1');var dC2=document.getElementById(sElementId+'-ctrl-2');var dLn1=document.getElementById(sElementId+'-line-1');var nSliderWidth=dBox.offsetWidth;var nf=Math.min(nTo,Math.max(0,nFrom));var nt=Math.min(limit1,Math.max(nFrom,nTo));if(isNaN(nf)){nf=0};if(isNaN(nt)){nf=limit1};nf=Math.round(nf);nt=Math.round(nt);this.from=nf;this.to=nt;if(!bNotChangePosition)
{var nX1=(nSliderWidth*(this.from/limit1));var nX2=(nSliderWidth*(this.to/limit1))-dC2.offsetWidth;if(dFromBtn==dC1)
{dC1.style.left=nX1+'px';}
else if(dFromBtn==dC2)
{dC2.style.left=nX2+'px';}
else
{dC1.style.left=nX1+'px';dC2.style.left=nX2+'px';};var nLeft=parseInt(dC1.style.left)-1;var nRight=parseInt(dC2.style.left)+dC2.offsetWidth-1;dC0.style.left=dC1.style.left;dC0.style.width=nRight-nLeft+'px';};if(!!(nOldFrom-nf)||!!(nOldTo-nt))
{this.onChange.fire(nf,nt);};return[nX1,nX2];};var onMouseDown=function(e,oSelf)
{var dBtn=this;var sElementId=oSelf.id;var dEl=document.getElementById(sElementId);var dBox=document.getElementById(sElementId+'-box');var dC0=document.getElementById(sElementId+'-ctrl-0');var dC1=document.getElementById(sElementId+'-ctrl-1');var dC2=document.getElementById(sElementId+'-ctrl-2');var dLn1=document.getElementById(sElementId+'-line-1');var nSliderWidth=dBox.offsetWidth;var nOffsetLeft=YUD.getX(dBox)||YUD.getX(dEl);var nlimit1Left=0;var nlimit1Right=nSliderWidth-dBtn.offsetWidth;var nSliderWidth=nSliderWidth;if(dBtn.className=='ctrl-2')
{nlimit1Left=parseInt(dC1.style.left)+dC1.offsetWidth;}
else
{nlimit1Right=parseInt(dC2.style.left)-dC1.offsetWidth;};var onMouseUp=function(e)
{YUE.stopEvent(e);YUE.removeListener(document,'mousemove',onMouseMove);YUE.removeListener(document,'mouseup',onMouseUp);isDrag=false;oSelf.onMouseUp.fire(e);return false;};var onMouseMove=function(e)
{var nEx=e.clientX-nOffsetLeft;if(!isDrag)
{onMouseUp.call(document,e,aArg);return;};nEx=Math.max(nlimit1Left,nEx);nEx=Math.min(nEx,nlimit1Right);if(dBtn==dC1)
{oSelf.from=Math.abs((nEx/(nSliderWidth-dC1.offsetWidth-dC2.offsetWidth))*limit1);}
else
{oSelf.to=Math.abs((nEx/(nSliderWidth-dC1.offsetWidth-dC2.offsetWidth))*limit1);};if(Math.abs(oSelf.from-oSelf.to)<=3)
{oSelf.from=oSelf.to};setValue.call(oSelf,oSelf.from,oSelf.to,dBtn,true);if(dBtn==dC1)
{dBtn.style.left=nEx+'px';var nLeft=parseInt(dC1.style.left)-1;var nRight=parseInt(dC2.style.left)+dC2.offsetWidth-1;dC0.style.left=dC1.style.left;dC0.style.width=nRight-nLeft+'px';}
else
{dBtn.style.left=nEx+'px';var nLeft=parseInt(dC1.style.left)-1;var nRight=parseInt(dC2.style.left)+dC2.offsetWidth-1;dC0.style.left=dC1.style.left;dC0.style.width=nRight-nLeft+'px';};YUE.stopEvent(e);oSelf.onSlide.fire(e,oSelf.from,oSelf.to);return false;};YUE.on(document,'mousemove',onMouseMove);YUE.on(document,'mouseup',onMouseUp);isDrag=true;YUE.stopEvent(e);oSelf.onMouseDown.fire(e);return false;};var onMouseDownOnBackground=function(e,oSelf)
{var sElementId=oSelf.id;var dBox=document.getElementById(sElementId+'-box');var dC0=this;var dC1=document.getElementById(sElementId+'-ctrl-1');var dC2=document.getElementById(sElementId+'-ctrl-2');var dLn1=document.getElementById(sElementId+'-line-1');var nSliderWidth=dBox.parentNode.offsetWidth||dBox.offsetWidth;var nAvailRangeWidth=nSliderWidth-dC1.offsetWidth-dC2.offsetWidth;var nOffsetLeft=YUD.getX(dBox);var ndC0Width=dC0.offsetWidth;var ndC2Width=dC2.offsetWidth;var nlimit1Right=nSliderWidth-ndC0Width;var nMouseDownX=e.clientX-YUD.getX(dC0);var nRange=oSelf.to-oSelf.from;var onMouseMove=function(e)
{if(!isDrag)
{onMouseUp.call(document,e);return;};var nEx=Math.max(0,e.clientX-nOffsetLeft-nMouseDownX);if(nEx<nlimit1Right)
{var nTo=Math.min(limit1,Math.round(((nEx+ndC0Width)/nAvailRangeWidth)*limit1));var nFrom=nTo-nRange;setValue.call(oSelf,nFrom,nTo,null,true);dC0.style.left=nEx+'px';dC0.style.width=ndC0Width+'px';dC2.style.left=nEx+ndC0Width-ndC2Width+1+'px';}
else
{dC0.style.left=nlimit1Right+'px';dC0.style.width=ndC0Width+'px';dC2.style.left=nlimit1Right+ndC0Width-ndC2Width+1+'px';};dC1.style.left=dC0.style.left;oSelf.onSlide.fire(e,oSelf.from,oSelf.to);};var onMouseUp=function(e)
{YUE.removeListener(document,'mousemove',onMouseMove);YUE.removeListener(document,'mouseup',onMouseUp);isDrag=false;};YUE.on(document,'mousemove',onMouseMove);YUE.on(document,'mouseup',onMouseUp);isDrag=true;YUE.stopEvent(e);oSelf.onMouseDown.fire(e);return false;};YAHOO.widget.RangeSlider1=function(sElementId,oAttr)
{var oSelf=this;oSelf.onMouseDown=new YUC('mousedown');oSelf.onMouseUp=new YUC('mouseup');oSelf.onSlide=new YUC('slide');oSelf.onLoad=new YUC('load');oSelf.onChange=new YUC('change');if(typeof(oAttr)!='object')
{oAttr={};};var init=function()
{var dEl=this;dEl.className='yui-range-slider';if(dEl.tagName!='SPAN')
{throw Error('YAHOO.widget.RangeSlider1 Error: \n Element['+sElementId+']\'s tagName is not SPAN');return;};oSelf.type=(YUD.hasClass(dEl,'yui-range-slider-v'))?2:1;YUD.addClass(dEl,'yui-range-slider yui-range-slider-'+oSelf.type);var sTagName=window.opera?'span':'button';dEl.innerHTML=['<span class="s-hd">','<span class="s-line-1" id="',sElementId,'-line-1"></span>','<',sTagName,' class="ctrl-0" id="',sElementId,'-ctrl-0" ></',sTagName,'>','<button  id="',sElementId,'-ctrl-1" class="ctrl-1">&nbsp;</button>','<button   id="',sElementId,'-ctrl-2" class="ctrl-2">&nbsp;</button>','</span>','<',sTagName,' hidefocus="hidefocus" class="s-bd" id="',sElementId,'-box" >&nbsp;</',sTagName,'>',].join('');var dBox=document.getElementById(sElementId+'-box');dBox.style.width=(oAttr.width||200)+'px';dBox.style.height=(oAttr.height||23)+'px';var dC0=document.getElementById(sElementId+'-ctrl-0');var dC1=document.getElementById(sElementId+'-ctrl-1');var dC2=document.getElementById(sElementId+'-ctrl-2');var dLn1=document.getElementById(sElementId+'-line-1');var nSliderWidth=dBox.offsetWidth;dLn1.style.width=parseInt(dBox.style.width)-4+'px';dC0.style.height=dC1.style.height=dC2.style.height=(parseInt(dBox.style.height)-4)+'px';dLn1.style.top=(oAttr.height||23)/2+'px';YUE.on(dC1,'mousedown',onMouseDown,oSelf);YUE.on(dC2,'mousedown',onMouseDown,oSelf);YUE.on(dC0,'mousedown',stopAction);YUE.on(dEl,'selectstart',stopAction);YUE.on(dBox,'mousedown',stopAction);setValue.call(oSelf,oSelf.from,oSelf.to);oSelf.readyState='complete';oSelf.onLoad.fire();};this.id=sElementId;YUE.onAvailable(sElementId,init);};YAHOO.widget.RangeSlider1.prototype={id:'',readyState:'uninitialized',type:1,from:10,to:90,setValue:function(nFrom,nTo)
{var oSelf=this;nFrom=isNaN(nFrom)?0:(nFrom||0);nTo=isNaN(nTo)?limit1:(nTo||limit1);nFrom=Math.max(0,nFrom);nTo=Math.min(limit1,nTo);nFrom=Math.min(nFrom,nTo);var fAction=function()
{setValue.call(oSelf,nFrom,nTo);};if(oSelf.readyState!='complete')
{oSelf.onLoad.subscribe(fAction);}
else
{fAction();};},getValue:function()
{return[this.from,this.to];},getElement:function()
{return document.getElementById(this.id);}};})();var oMS3=new YAHOO.widget.RangeSlider1('my-slider-1',{width:230,height:24});if(document.getElementById("firstActionSliderOrPrincipal").value!="slider"){oMS3.setValue(0,limit1);}else{oMS3.setValue(slider1Min,slider1Max);}
var onMS1Slide=function(sType)
{var aData2=this.getValue();if(typeof(this.oldData02)=='undefined')this.oldData02=aData2[0];if(typeof(this.oldData12)=='undefined')this.oldData12=aData2[1];if(aData2[0]!=this.oldData02)
{if(aData2[0]-this.oldData02<=0)
{aData2=this.getValue();this.oldData02=aData2[0];this.oldData12=aData2[1];var oldUpper=this.oldData02;oldUpper=Math.round(oldUpper/100);oldUpper=oldUpper-1;oldUpper=oldUpper*100;oMS3.setValue(oldUpper,this.oldData12);}else
{aData2=this.getValue();this.oldData02=aData2[0];this.oldData12=aData2[1];var oldUpper=this.oldData02;oldUpper=Math.round(oldUpper/100);if(((this.oldData12-this.oldData02)<100)){if(((this.oldData12-this.oldData02)==0)||(((this.oldData12-this.oldData02)<100)&&((this.oldData12-this.oldData02)>0))){oldUpper=oldUpper-1;}else{oldUpper=oldUpper+1;}}
oldUpper=oldUpper*100;oMS3.setValue(oldUpper,this.oldData12);}}
if(aData2[1]!=this.oldData12)
{if(aData2[1]-this.oldData12<=0)
{aData2=this.getValue();this.oldData02=aData2[0];this.oldData12=aData2[1];var oldLower=this.oldData12;oldLower=Math.round(oldLower/100);if(((this.oldData12-this.oldData02)<100)){if(((this.oldData12-this.oldData02)==0)||(((this.oldData12-this.oldData02)<100)&&((this.oldData12-this.oldData02)>0))){oldLower=oldLower+1;}else{oldLower=oldLower-1;}}
oldLower=oldLower*100;oMS3.setValue(this.oldData02,oldLower);}else
{aData2=this.getValue();this.oldData02=aData2[0];this.oldData12=aData2[1];var oldLower=this.oldData12;oldLower=Math.round(oldLower/100);oldLower=oldLower+1;oldLower=oldLower*100;oMS3.setValue(this.oldData02,oldLower);}}
aData2=this.getValue();this.oldData02=aData2[0];this.oldData12=aData2[1];oMS3.setValue(this.oldData02,this.oldData12);if(aData2[0]!=document.getElementById('slider1Min').value||aData2[1]!=document.getElementById('slider1Max').value){document.getElementById('slider1Min').value=this.oldData02;document.getElementById('slider1Max').value=this.oldData12;if(this.oldData12>1000){document.getElementById('d1').innerHTML=this.oldData02+' - '+'1000+';}else{document.getElementById('d1').innerHTML=this.oldData02+' - '+this.oldData12;}
calculateValueForsliderEvent(21,principalArrayListChecked,this.oldData02,this.oldData12,document.getElementById("slider2Min").value,document.getElementById("slider2Max").value,+document.getElementById("slider3Min").value,document.getElementById("slider3Max").value,document.getElementById("regionId").value,document.getElementById("regionName").value,document.getElementById("city").value);return;}
document.getElementById('slider1Min').value=this.oldData02;document.getElementById('slider1Max').value=this.oldData12;if(this.oldData12>1000){document.getElementById('d1').innerHTML=this.oldData02+' - '+'1000+';}else{document.getElementById('d1').innerHTML=this.oldData02+' - '+this.oldData12;}};oMS3.onLoad.subscribe(onMS1Slide,oMS3,true);oMS3.onMouseUp.subscribe(onMS1Slide,oMS3,true);}
if(monthlyChargeRentalArrayDistinctmax>1000){document.getElementById("dw1").value=1100;}else{document.getElementById("dw1").value=monthlyChargeRentalArrayDistinctmax;}
if(freebiesSameOperatorFreeTalkTimeMinArrayDistinctmax=="ULTD"||freebiesSameOperatorFreeTalkTimeMinArrayDistinctmax=="Ultd")
{freebiesSameOperatorFreeTalkTimeMinArrayDistinctmax=1100;}
if(freebiesSameOperatorFreeTalkTimeMinArrayDistinctmax<=100||freebiesSameOperatorFreeTalkTimeMinArrayDistinctmax==null){document.getElementById("slider2").style.display="none";}else{document.getElementById("slider2").style.display="block";document.getElementById("dd2").innerHTML="<span id=\"my-slider-2\" ></span>";var limit2=freebiesSameOperatorFreeTalkTimeMinArrayDistinctmax;document.getElementById("slider2Limit").value=limit2;(function(){var YUE=YAHOO.util.Event;var YUD=YAHOO.util.Dom;var YUC=YAHOO.util.CustomEvent;var isDrag=false;if(window.opera)
{YUD.addClass(document.documentElement,'borwser-opera');};var stopAction=function(e)
{YUE.stopEvent(e);return false;};var setValue=function(nFrom,nTo,dFromBtn,bNotChangePosition)
{var nOldFrom=this.from;var nOldTo=this.to;var sElementId=this.id;var dEl=document.getElementById(sElementId);var dBox=document.getElementById(sElementId+'-box');var dC0=document.getElementById(sElementId+'-ctrl-0');var dC1=document.getElementById(sElementId+'-ctrl-1');var dC2=document.getElementById(sElementId+'-ctrl-2');var dLn1=document.getElementById(sElementId+'-line-1');var nSliderWidth=dBox.offsetWidth;var nf=Math.min(nTo,Math.max(0,nFrom));var nt=Math.min(limit2,Math.max(nFrom,nTo));if(isNaN(nf)){nf=0};if(isNaN(nt)){nf=limit2};nf=Math.round(nf);nt=Math.round(nt);this.from=nf;this.to=nt;if(!bNotChangePosition)
{var nX1=(nSliderWidth*(this.from/limit2));var nX2=(nSliderWidth*(this.to/limit2))-dC2.offsetWidth;if(dFromBtn==dC1)
{dC1.style.left=nX1+'px';}
else if(dFromBtn==dC2)
{dC2.style.left=nX2+'px';}
else
{dC1.style.left=nX1+'px';dC2.style.left=nX2+'px';};var nLeft=parseInt(dC1.style.left)-1;var nRight=parseInt(dC2.style.left)+dC2.offsetWidth-1;dC0.style.left=dC1.style.left;dC0.style.width=nRight-nLeft+'px';};if(!!(nOldFrom-nf)||!!(nOldTo-nt))
{this.onChange.fire(nf,nt);};return[nX1,nX2];};var onMouseDown=function(e,oSelf)
{var dBtn=this;var sElementId=oSelf.id;var dEl=document.getElementById(sElementId);var dBox=document.getElementById(sElementId+'-box');var dC0=document.getElementById(sElementId+'-ctrl-0');var dC1=document.getElementById(sElementId+'-ctrl-1');var dC2=document.getElementById(sElementId+'-ctrl-2');var dLn1=document.getElementById(sElementId+'-line-1');var nSliderWidth=dBox.offsetWidth;var nOffsetLeft=YUD.getX(dBox)||YUD.getX(dEl);var nlimit2Left=0;var nlimit2Right=nSliderWidth-dBtn.offsetWidth;var nSliderWidth=nSliderWidth;if(dBtn.className=='ctrl-2')
{nlimit2Left=parseInt(dC1.style.left)+dC1.offsetWidth;}
else
{nlimit2Right=parseInt(dC2.style.left)-dC1.offsetWidth;};var onMouseUp=function(e)
{YUE.stopEvent(e);YUE.removeListener(document,'mousemove',onMouseMove);YUE.removeListener(document,'mouseup',onMouseUp);isDrag=false;oSelf.onMouseUp.fire(e);return false;};var onMouseMove=function(e)
{var nEx=e.clientX-nOffsetLeft;if(!isDrag)
{onMouseUp.call(document,e,aArg);return;};nEx=Math.max(nlimit2Left,nEx);nEx=Math.min(nEx,nlimit2Right);if(dBtn==dC1)
{oSelf.from=Math.abs((nEx/(nSliderWidth-dC1.offsetWidth-dC2.offsetWidth))*limit2);}
else
{oSelf.to=Math.abs((nEx/(nSliderWidth-dC1.offsetWidth-dC2.offsetWidth))*limit2);};if(Math.abs(oSelf.from-oSelf.to)<=3)
{oSelf.from=oSelf.to};setValue.call(oSelf,oSelf.from,oSelf.to,dBtn,true);if(dBtn==dC1)
{dBtn.style.left=nEx+'px';var nLeft=parseInt(dC1.style.left)-1;var nRight=parseInt(dC2.style.left)+dC2.offsetWidth-1;dC0.style.left=dC1.style.left;dC0.style.width=nRight-nLeft+'px';}
else
{dBtn.style.left=nEx+'px';var nLeft=parseInt(dC1.style.left)-1;var nRight=parseInt(dC2.style.left)+dC2.offsetWidth-1;dC0.style.left=dC1.style.left;dC0.style.width=nRight-nLeft+'px';};YUE.stopEvent(e);oSelf.onSlide.fire(e,oSelf.from,oSelf.to);return false;};YUE.on(document,'mousemove',onMouseMove);YUE.on(document,'mouseup',onMouseUp);isDrag=true;YUE.stopEvent(e);oSelf.onMouseDown.fire(e);return false;};var onMouseDownOnBackground=function(e,oSelf)
{var sElementId=oSelf.id;var dBox=document.getElementById(sElementId+'-box');var dC0=this;var dC1=document.getElementById(sElementId+'-ctrl-1');var dC2=document.getElementById(sElementId+'-ctrl-2');var dLn1=document.getElementById(sElementId+'-line-1');var nSliderWidth=dBox.parentNode.offsetWidth||dBox.offsetWidth;var nAvailRangeWidth=nSliderWidth-dC1.offsetWidth-dC2.offsetWidth;var nOffsetLeft=YUD.getX(dBox);var ndC0Width=dC0.offsetWidth;var ndC2Width=dC2.offsetWidth;var nlimit2Right=nSliderWidth-ndC0Width;var nMouseDownX=e.clientX-YUD.getX(dC0);var nRange=oSelf.to-oSelf.from;var onMouseMove=function(e)
{if(!isDrag)
{onMouseUp.call(document,e);return;};var nEx=Math.max(0,e.clientX-nOffsetLeft-nMouseDownX);if(nEx<nlimit2Right)
{var nTo=Math.min(limit2,Math.round(((nEx+ndC0Width)/nAvailRangeWidth)*limit2));var nFrom=nTo-nRange;setValue.call(oSelf,nFrom,nTo,null,true);dC0.style.left=nEx+'px';dC0.style.width=ndC0Width+'px';dC2.style.left=nEx+ndC0Width-ndC2Width+1+'px';}
else
{dC0.style.left=nlimit2Right+'px';dC0.style.width=ndC0Width+'px';dC2.style.left=nlimit2Right+ndC0Width-ndC2Width+1+'px';};dC1.style.left=dC0.style.left;oSelf.onSlide.fire(e,oSelf.from,oSelf.to);};var onMouseUp=function(e)
{YUE.removeListener(document,'mousemove',onMouseMove);YUE.removeListener(document,'mouseup',onMouseUp);isDrag=false;};YUE.on(document,'mousemove',onMouseMove);YUE.on(document,'mouseup',onMouseUp);isDrag=true;YUE.stopEvent(e);oSelf.onMouseDown.fire(e);return false;};YAHOO.widget.RangeSlider2=function(sElementId,oAttr)
{var oSelf=this;oSelf.onMouseDown=new YUC('mousedown');oSelf.onMouseUp=new YUC('mouseup');oSelf.onSlide=new YUC('slide');oSelf.onLoad=new YUC('load');oSelf.onChange=new YUC('change');if(typeof(oAttr)!='object')
{oAttr={};};var init=function()
{var dEl=this;dEl.className='yui-range-slider';if(dEl.tagName!='SPAN')
{throw Error('YAHOO.widget.RangeSlider2 Error: \n Element['+sElementId+']\'s tagName is not SPAN');return;};oSelf.type=(YUD.hasClass(dEl,'yui-range-slider-v'))?2:1;YUD.addClass(dEl,'yui-range-slider yui-range-slider-'+oSelf.type);var sTagName=window.opera?'span':'button';dEl.innerHTML=['<span class="s-hd">','<span class="s-line-1" id="',sElementId,'-line-1"></span>','<',sTagName,' class="ctrl-0" id="',sElementId,'-ctrl-0" ></',sTagName,'>','<button  id="',sElementId,'-ctrl-1" class="ctrl-1">&nbsp;</button>','<button   id="',sElementId,'-ctrl-2" class="ctrl-2">&nbsp;</button>','</span>','<',sTagName,' hidefocus="hidefocus" class="s-bd" id="',sElementId,'-box" >&nbsp;</',sTagName,'>',].join('');var dBox=document.getElementById(sElementId+'-box');dBox.style.width=(oAttr.width||200)+'px';dBox.style.height=(oAttr.height||23)+'px';var dC0=document.getElementById(sElementId+'-ctrl-0');var dC1=document.getElementById(sElementId+'-ctrl-1');var dC2=document.getElementById(sElementId+'-ctrl-2');var dLn1=document.getElementById(sElementId+'-line-1');var nSliderWidth=dBox.offsetWidth;dLn1.style.width=parseInt(dBox.style.width)-4+'px';dC0.style.height=dC1.style.height=dC2.style.height=(parseInt(dBox.style.height)-4)+'px';dLn1.style.top=(oAttr.height||23)/2+'px';YUE.on(dC1,'mousedown',onMouseDown,oSelf);YUE.on(dC2,'mousedown',onMouseDown,oSelf);YUE.on(dC0,'mousedown',stopAction);YUE.on(dEl,'selectstart',stopAction);YUE.on(dBox,'mousedown',stopAction);setValue.call(oSelf,oSelf.from,oSelf.to);oSelf.readyState='complete';oSelf.onLoad.fire();};this.id=sElementId;YUE.onAvailable(sElementId,init);};YAHOO.widget.RangeSlider2.prototype={id:'',readyState:'uninitialized',type:1,from:10,to:90,setValue:function(nFrom,nTo)
{var oSelf=this;nFrom=isNaN(nFrom)?0:(nFrom||0);nTo=isNaN(nTo)?limit2:(nTo||limit2);nFrom=Math.max(0,nFrom);nTo=Math.min(limit2,nTo);nFrom=Math.min(nFrom,nTo);var fAction=function()
{setValue.call(oSelf,nFrom,nTo);};if(oSelf.readyState!='complete')
{oSelf.onLoad.subscribe(fAction);}
else
{fAction();};},getValue:function()
{return[this.from,this.to];},getElement:function()
{return document.getElementById(this.id);}};})();var oMS2=new YAHOO.widget.RangeSlider2('my-slider-2',{width:230,height:24});if(document.getElementById("firstActionSliderOrPrincipal").value!="slider"){oMS2.setValue(0,limit2);}else{oMS2.setValue(slider2Min,slider2Max);}
var onMS1Slide=function(sType)
{var aData1=this.getValue();if(typeof(this.oldData01)=='undefined')this.oldData01=aData1[0];if(typeof(this.oldData11)=='undefined')this.oldData11=aData1[1];if(aData1[0]!=this.oldData01)
{if(aData1[0]-this.oldData01<=0)
{aData1=this.getValue();this.oldData01=aData1[0];this.oldData11=aData1[1];var oldUpper=this.oldData01;oldUpper=Math.round(oldUpper/100);oldUpper=oldUpper-1;oldUpper=oldUpper*100;oMS2.setValue(oldUpper,this.oldData11);}else
{aData1=this.getValue();this.oldData01=aData1[0];this.oldData11=aData1[1];var oldUpper=this.oldData01;oldUpper=Math.round(oldUpper/100);if(((this.oldData11-this.oldData01)<100)){if(((this.oldData11-this.oldData01)==0)||(((this.oldData11-this.oldData01)<100)&&((this.oldData11-this.oldData01)>0))){oldUpper=oldUpper-1;}else{oldUpper=oldUpper+1;}}
oldUpper=oldUpper*100;oMS2.setValue(oldUpper,this.oldData11);}}
if(aData1[1]!=this.oldData11)
{if(aData1[1]-this.oldData11<=0)
{aData1=this.getValue();this.oldData01=aData1[0];this.oldData11=aData1[1];var oldLower=this.oldData11;oldLower=Math.round(oldLower/100);if(((this.oldData11-this.oldData01)<100)){if(((this.oldData11-this.oldData01)==0)||(((this.oldData11-this.oldData01)<100)&&((this.oldData11-this.oldData01)>0))){oldLower=oldLower+1;}else{oldLower=oldLower-1;}}
oldLower=oldLower*100;oMS2.setValue(this.oldData01,oldLower);}else
{aData1=this.getValue();this.oldData01=aData1[0];this.oldData11=aData1[1];var oldLower=this.oldData11;oldLower=Math.round(oldLower/100);oldLower=oldLower+1;oldLower=oldLower*100;oMS2.setValue(this.oldData01,oldLower);}}
aData1=this.getValue();this.oldData01=aData1[0];this.oldData11=aData1[1];oMS2.setValue(this.oldData01,this.oldData11);if(document.getElementById('slider2Min').value!=aData1[0]||document.getElementById('slider2Max').value!=aData1[1])
{document.getElementById('slider2Min').value=this.oldData01;document.getElementById('slider2Max').value=this.oldData11;if(this.oldData11>1000){document.getElementById('d2').innerHTML=this.oldData01+' - '+'1000+';document.getElementById('slider2MinSelected').value=this.oldData01;document.getElementById('slider2MaxSelected').value=1100;}else{document.getElementById('d2').innerHTML=this.oldData01+' - '+this.oldData11;document.getElementById('slider2MinSelected').value=this.oldData01;document.getElementById('slider2MaxSelected').value=this.oldData11;}
calculateValueForsliderEvent(21,principalArrayListChecked,document.getElementById('slider1Min').value,document.getElementById('slider1Max').value,this.oldData01,this.oldData11,+document.getElementById("slider3Min").value,document.getElementById("slider3Max").value,document.getElementById("regionId").value,document.getElementById("regionName").value,document.getElementById("city").value);return;}
document.getElementById('slider2Min').value=this.oldData01;document.getElementById('slider2Max').value=this.oldData11;if(this.oldData11>1000){document.getElementById('d2').innerHTML=this.oldData01+' - '+'1000+';document.getElementById('slider2MinSelected').value=this.oldData01;document.getElementById('slider2MaxSelected').value=1100;}else{document.getElementById('d2').innerHTML=this.oldData01+' - '+this.oldData11;document.getElementById('slider2MinSelected').value=this.oldData01;document.getElementById('slider2MaxSelected').value=this.oldData11;}};oMS2.onLoad.subscribe(onMS1Slide,oMS2,true);oMS2.onMouseUp.subscribe(onMS1Slide,oMS2,true);}
if(freebiesSameOperatorFreeTalkTimeMinArrayDistinctmax>1000){document.getElementById("dw2").value=1100;}else
{document.getElementById("dw2").value=freebiesSameOperatorFreeTalkTimeMinArrayDistinctmax;}
if(freeSmsInNumbersLocalSameOperatorArrayDistinctmax<=100||freeSmsInNumbersLocalSameOperatorArrayDistinctmax==null){document.getElementById("slider3").style.display="none";}else{document.getElementById("slider3").style.display="block";document.getElementById("dd3").innerHTML="<span id=\"my-slider-3\" ></span>";var limit3=freeSmsInNumbersLocalSameOperatorArrayDistinctmax;document.getElementById("slider3Limit").value=limit3;(function(){var YUE=YAHOO.util.Event;var YUD=YAHOO.util.Dom;var YUC=YAHOO.util.CustomEvent;var isDrag=false;if(window.opera)
{YUD.addClass(document.documentElement,'borwser-opera');};var stopAction=function(e)
{YUE.stopEvent(e);return false;};var setValue=function(nFrom,nTo,dFromBtn,bNotChangePosition)
{var nOldFrom=this.from;var nOldTo=this.to;var sElementId=this.id;var dEl=document.getElementById(sElementId);var dBox=document.getElementById(sElementId+'-box');var dC0=document.getElementById(sElementId+'-ctrl-0');var dC1=document.getElementById(sElementId+'-ctrl-1');var dC2=document.getElementById(sElementId+'-ctrl-2');var dLn1=document.getElementById(sElementId+'-line-1');var nSliderWidth=dBox.offsetWidth;var nf=Math.min(nTo,Math.max(0,nFrom));var nt=Math.min(limit3,Math.max(nFrom,nTo));if(isNaN(nf)){nf=0};if(isNaN(nt)){nf=limit3};nf=Math.round(nf);nt=Math.round(nt);this.from=nf;this.to=nt;if(!bNotChangePosition)
{var nX1=(nSliderWidth*(this.from/limit3));var nX2=(nSliderWidth*(this.to/limit3))-dC2.offsetWidth;if(dFromBtn==dC1)
{dC1.style.left=nX1+'px';}
else if(dFromBtn==dC2)
{dC2.style.left=nX2+'px';}
else
{dC1.style.left=nX1+'px';dC2.style.left=nX2+'px';};var nLeft=parseInt(dC1.style.left)-1;var nRight=parseInt(dC2.style.left)+dC2.offsetWidth-1;dC0.style.left=dC1.style.left;dC0.style.width=nRight-nLeft+'px';};if(!!(nOldFrom-nf)||!!(nOldTo-nt))
{this.onChange.fire(nf,nt);};return[nX1,nX2];};var onMouseDown=function(e,oSelf)
{var dBtn=this;var sElementId=oSelf.id;var dEl=document.getElementById(sElementId);var dBox=document.getElementById(sElementId+'-box');var dC0=document.getElementById(sElementId+'-ctrl-0');var dC1=document.getElementById(sElementId+'-ctrl-1');var dC2=document.getElementById(sElementId+'-ctrl-2');var dLn1=document.getElementById(sElementId+'-line-1');var nSliderWidth=dBox.offsetWidth;var nOffsetLeft=YUD.getX(dBox)||YUD.getX(dEl);var nlimit3Left=0;var nlimit3Right=nSliderWidth-dBtn.offsetWidth;var nSliderWidth=nSliderWidth;if(dBtn.className=='ctrl-2')
{nlimit3Left=parseInt(dC1.style.left)+dC1.offsetWidth;}
else
{nlimit3Right=parseInt(dC2.style.left)-dC1.offsetWidth;};var onMouseUp=function(e)
{YUE.stopEvent(e);YUE.removeListener(document,'mousemove',onMouseMove);YUE.removeListener(document,'mouseup',onMouseUp);isDrag=false;oSelf.onMouseUp.fire(e);return false;};var onMouseMove=function(e)
{var nEx=e.clientX-nOffsetLeft;if(!isDrag)
{onMouseUp.call(document,e,aArg);return;};nEx=Math.max(nlimit3Left,nEx);nEx=Math.min(nEx,nlimit3Right);if(dBtn==dC1)
{oSelf.from=Math.abs((nEx/(nSliderWidth-dC1.offsetWidth-dC2.offsetWidth))*limit3);}
else
{oSelf.to=Math.abs((nEx/(nSliderWidth-dC1.offsetWidth-dC2.offsetWidth))*limit3);};if(Math.abs(oSelf.from-oSelf.to)<=3)
{oSelf.from=oSelf.to};setValue.call(oSelf,oSelf.from,oSelf.to,dBtn,true);if(dBtn==dC1)
{dBtn.style.left=nEx+'px';var nLeft=parseInt(dC1.style.left)-1;var nRight=parseInt(dC2.style.left)+dC2.offsetWidth-1;dC0.style.left=dC1.style.left;dC0.style.width=nRight-nLeft+'px';}
else
{dBtn.style.left=nEx+'px';var nLeft=parseInt(dC1.style.left)-1;var nRight=parseInt(dC2.style.left)+dC2.offsetWidth-1;dC0.style.left=dC1.style.left;dC0.style.width=nRight-nLeft+'px';};YUE.stopEvent(e);oSelf.onSlide.fire(e,oSelf.from,oSelf.to);return false;};YUE.on(document,'mousemove',onMouseMove);YUE.on(document,'mouseup',onMouseUp);isDrag=true;YUE.stopEvent(e);oSelf.onMouseDown.fire(e);return false;};var onMouseDownOnBackground=function(e,oSelf)
{var sElementId=oSelf.id;var dBox=document.getElementById(sElementId+'-box');var dC0=this;var dC1=document.getElementById(sElementId+'-ctrl-1');var dC2=document.getElementById(sElementId+'-ctrl-2');var dLn1=document.getElementById(sElementId+'-line-1');var nSliderWidth=dBox.parentNode.offsetWidth||dBox.offsetWidth;var nAvailRangeWidth=nSliderWidth-dC1.offsetWidth-dC2.offsetWidth;var nOffsetLeft=YUD.getX(dBox);var ndC0Width=dC0.offsetWidth;var ndC2Width=dC2.offsetWidth;var nlimit3Right=nSliderWidth-ndC0Width;var nMouseDownX=e.clientX-YUD.getX(dC0);var nRange=oSelf.to-oSelf.from;var onMouseMove=function(e)
{if(!isDrag)
{onMouseUp.call(document,e);return;};var nEx=Math.max(0,e.clientX-nOffsetLeft-nMouseDownX);if(nEx<nlimit3Right)
{var nTo=Math.min(limit3,Math.round(((nEx+ndC0Width)/nAvailRangeWidth)*limit3));var nFrom=nTo-nRange;setValue.call(oSelf,nFrom,nTo,null,true);dC0.style.left=nEx+'px';dC0.style.width=ndC0Width+'px';dC2.style.left=nEx+ndC0Width-ndC2Width+1+'px';}
else
{dC0.style.left=nlimit3Right+'px';dC0.style.width=ndC0Width+'px';dC2.style.left=nlimit3Right+ndC0Width-ndC2Width+1+'px';};dC1.style.left=dC0.style.left;oSelf.onSlide.fire(e,oSelf.from,oSelf.to);};var onMouseUp=function(e)
{YUE.removeListener(document,'mousemove',onMouseMove);YUE.removeListener(document,'mouseup',onMouseUp);isDrag=false;};YUE.on(document,'mousemove',onMouseMove);YUE.on(document,'mouseup',onMouseUp);isDrag=true;YUE.stopEvent(e);oSelf.onMouseDown.fire(e);return false;};YAHOO.widget.RangeSlider3=function(sElementId,oAttr)
{var oSelf=this;oSelf.onMouseDown=new YUC('mousedown');oSelf.onMouseUp=new YUC('mouseup');oSelf.onSlide=new YUC('slide');oSelf.onLoad=new YUC('load');oSelf.onChange=new YUC('change');if(typeof(oAttr)!='object')
{oAttr={};};var init=function()
{var dEl=this;dEl.className='yui-range-slider';if(dEl.tagName!='SPAN')
{throw Error('YAHOO.widget.RangeSlider3 Error: \n Element['+sElementId+']\'s tagName is not SPAN');return;};oSelf.type=(YUD.hasClass(dEl,'yui-range-slider-v'))?2:1;YUD.addClass(dEl,'yui-range-slider yui-range-slider-'+oSelf.type);var sTagName=window.opera?'span':'button';dEl.innerHTML=['<span class="s-hd">','<span class="s-line-1" id="',sElementId,'-line-1"></span>','<',sTagName,' class="ctrl-0" id="',sElementId,'-ctrl-0" ></',sTagName,'>','<button  id="',sElementId,'-ctrl-1" class="ctrl-1">&nbsp;</button>','<button   id="',sElementId,'-ctrl-2" class="ctrl-2">&nbsp;</button>','</span>','<',sTagName,' hidefocus="hidefocus" class="s-bd" id="',sElementId,'-box" >&nbsp;</',sTagName,'>',].join('');var dBox=document.getElementById(sElementId+'-box');dBox.style.width=(oAttr.width||200)+'px';dBox.style.height=(oAttr.height||23)+'px';var dC0=document.getElementById(sElementId+'-ctrl-0');var dC1=document.getElementById(sElementId+'-ctrl-1');var dC2=document.getElementById(sElementId+'-ctrl-2');var dLn1=document.getElementById(sElementId+'-line-1');var nSliderWidth=dBox.offsetWidth;dLn1.style.width=parseInt(dBox.style.width)-4+'px';dC0.style.height=dC1.style.height=dC2.style.height=(parseInt(dBox.style.height)-4)+'px';dLn1.style.top=(oAttr.height||23)/2+'px';YUE.on(dC1,'mousedown',onMouseDown,oSelf);YUE.on(dC2,'mousedown',onMouseDown,oSelf);YUE.on(dC0,'mousedown',stopAction);YUE.on(dEl,'selectstart',stopAction);YUE.on(dBox,'mousedown',stopAction);setValue.call(oSelf,oSelf.from,oSelf.to);oSelf.readyState='complete';oSelf.onLoad.fire();};this.id=sElementId;YUE.onAvailable(sElementId,init);};YAHOO.widget.RangeSlider3.prototype={id:'',readyState:'uninitialized',type:1,from:10,to:90,setValue:function(nFrom,nTo)
{var oSelf=this;nFrom=isNaN(nFrom)?0:(nFrom||0);nTo=isNaN(nTo)?limit3:(nTo||limit3);nFrom=Math.max(0,nFrom);nTo=Math.min(limit3,nTo);nFrom=Math.min(nFrom,nTo);var fAction=function()
{setValue.call(oSelf,nFrom,nTo);};if(oSelf.readyState!='complete')
{oSelf.onLoad.subscribe(fAction);}
else
{fAction();};},getValue:function()
{return[this.from,this.to];},getElement:function()
{return document.getElementById(this.id);}};})();var oMS1=new YAHOO.widget.RangeSlider3('my-slider-3',{width:230,height:24});if(document.getElementById("firstActionSliderOrPrincipal").value!="slider"){oMS1.setValue(0,limit3);}else{oMS1.setValue(slider3Min,slider3Max);}
var onMS1Slide=function(sType)
{var aData=this.getValue();if(typeof(this.oldData0)=='undefined')this.oldData0=aData[0];if(typeof(this.oldData1)=='undefined')this.oldData1=aData[1];if(aData[0]!=this.oldData0)
{if(aData[0]-this.oldData0<=0)
{aData=this.getValue();this.oldData0=aData[0];this.oldData1=aData[1];var oldUpper=this.oldData0;oldUpper=Math.round(oldUpper/100);oldUpper=oldUpper-1;oldUpper=oldUpper*100;oMS1.setValue(oldUpper,this.oldData1);}else
{aData=this.getValue();this.oldData0=aData[0];this.oldData1=aData[1];var oldUpper=this.oldData0;oldUpper=Math.round(oldUpper/100);if(((this.oldData1-this.oldData0)<100)){if(((this.oldData1-this.oldData0)==0)||(((this.oldData1-this.oldData0)<100)&&((this.oldData1-this.oldData0)>0))){oldUpper=oldUpper-1;}else{oldUpper=oldUpper+1;}}
oldUpper=oldUpper*100;oMS1.setValue(oldUpper,this.oldData1);}}
if(aData[1]!=this.oldData1)
{if(aData[1]-this.oldData1<=0)
{aData=this.getValue();this.oldData0=aData[0];this.oldData1=aData[1];var oldLower=this.oldData1;oldLower=Math.round(oldLower/100);if(((this.oldData1-this.oldData0)<100)){if(((this.oldData1-this.oldData0)==0)||(((this.oldData1-this.oldData0)<100)&&((this.oldData1-this.oldData0)>0))){oldLower=oldLower+1;}else{oldLower=oldLower-1;}}
oldLower=oldLower*100;oMS1.setValue(this.oldData0,oldLower);}else
{aData=this.getValue();this.oldData0=aData[0];this.oldData1=aData[1];var oldLower=this.oldData1;oldLower=Math.round(oldLower/100);oldLower=oldLower+1;oldLower=oldLower*100;oMS1.setValue(this.oldData0,oldLower);}}
aData=this.getValue();this.oldData0=aData[0];this.oldData1=aData[1];oMS1.setValue(this.oldData0,this.oldData1);if(aData[0]!=document.getElementById('slider3Min').value||aData[1]!=document.getElementById('slider3Max').value){document.getElementById('slider3Min').value=this.oldData0;document.getElementById('slider3Max').value=this.oldData1;if(this.oldData1>1000){document.getElementById('d3').innerHTML=this.oldData0+' - '+'1000+';document.getElementById('slider3MinSelected').value=this.oldData0;document.getElementById('slider3MaxSelected').value=1100;}else{document.getElementById('d3').innerHTML=this.oldData0+' - '+this.oldData1;document.getElementById('slider3MinSelected').value=this.oldData0;document.getElementById('slider3MaxSelected').value=this.oldData1;}
calculateValueForsliderEvent(21,principalArrayListChecked,document.getElementById('slider1Min').value,document.getElementById('slider1Max').value,document.getElementById('slider2Min').value,document.getElementById('slider2Max').value,+this.oldData0,this.oldData1,document.getElementById("regionId").value,document.getElementById("regionName").value,document.getElementById("city").value);return;}
document.getElementById('slider3Min').value=this.oldData0;document.getElementById('slider3Max').value=this.oldData1;if(this.oldData1>1000){document.getElementById('d3').innerHTML=this.oldData0+' - '+'1000+';document.getElementById('slider3MinSelected').value=this.oldData0;document.getElementById('slider3MaxSelected').value=1100;}else{document.getElementById('d3').innerHTML=this.oldData0+' - '+this.oldData1;document.getElementById('slider3MinSelected').value=this.oldData0;document.getElementById('slider3MaxSelected').value=this.oldData1;}};oMS1.onLoad.subscribe(onMS1Slide,oMS1,true);oMS1.onMouseUp.subscribe(onMS1Slide,oMS1,true);}
if(freeSmsInNumbersLocalSameOperatorArrayDistinctmax>1000)
{document.getElementById("dw3").value=1100;}
else
{document.getElementById("dw3").value=freeSmsInNumbersLocalSameOperatorArrayDistinctmax;}
for(var i=0;i<principalArrayList.length;i++)
{if(document.getElementById(""+principalArrayList[i]+"")!=null){document.getElementById("provider").style.display="block";document.getElementById(""+principalArrayList[i]+"").width="45%";document.getElementById(""+principalArrayList[i]+"").style.display="block";document.getElementById(""+principalArrayList[i]+"").float="left";for(var j=0;j<principalArrayListChecked.length;j++){if(principalArrayList[j]==principalArrayListChecked[j]){document.getElementById(""+principalArrayList[i]+"1").checked=true;}
document.getElementById(""+principalArrayList[i]+"").width="45%";document.getElementById(""+principalArrayList[i]+"").style.display="block";document.getElementById(""+principalArrayList[i]+"").float="left";document.getElementById(""+principalArrayList[i]+"1").checked=false;}}}
document.getElementById("slider1Max").value=respArray[1];document.getElementById("slider1Min").value=respArray[2];document.getElementById("slider2Max").value=respArray[3];document.getElementById("slider2Min").value=respArray[4];document.getElementById("slider3Max").value=respArray[5];document.getElementById("slider3Min").value=respArray[6];var result=new Array();var a=respArray[0];if(respArray[0]==""){return;}
if(a!=null){a=a.replace(/\"\"\"\"/g,"\"\"");var resultFinal=eval("("+a+")");mobileServiceProviderComparatorResultTable(resultFinal,document.getElementById("city").value);}else{document.getElementById("provider").style.display="none";document.getElementById("slider1").style.display="none";document.getElementById("slider2").style.display="none";document.getElementById("slider3").style.display="none";return;}}};receiveReq.send(formParams);}}}
function calculatePricipalsForMobilePostpaidConnections(){document.getElementById('cityId').value=document.getElementById('city').value;document.getElementById('processingResultsDiv').style.height=screen.height;document.getElementById('processingResultsDiv').style.width=screen.width;document.getElementById('blockDiv').style.height=0;document.getElementById('blockDiv').style.width=0;document.getElementById('processingResults').style.display="block";document.getElementById('processingResults').style.marginTop=(document.getElementById('resultTable').scrollTop+300);document.getElementById("firstActionSliderOrPrincipal").value="principal";var allPrincipal=document.getElementById("allPrincipal").value;var iterator=allPrincipal.split(",");var valOld='';for(var i=0;i<iterator.length;i++){document.getElementById(iterator[i]).style.display='none';}
var onChangeSliderEvent=false;var formParams="";formParams+="id=21&city="+document.getElementById('city').value+"&flag=cityChange&productId=14";var ajaxUrl="/"+nameSpace+"/ajax/kyxHelper.html";var receiveReq=window.getXmlHttpRequestObject();if(receiveReq.readyState==4||receiveReq.readyState==0)
{receiveReq.open("POST",ajaxUrl,true);receiveReq.setRequestHeader("Content-Length",formParams.length);receiveReq.setRequestHeader("Content-Type","application/x-www-form-urlencoded");receiveReq.onreadystatechange=function()
{if(receiveReq.readyState==4)
{var response=receiveReq.responseText;var respArray=response.split("#");var principalArray=respArray[0].substring(1);var principalArrayList=(principalArray.split(","));var monthlyChargeRentalArrayDistinctmax=respArray[1];var monthlyChargeRentalArrayDistinctmin=respArray[2];document.getElementById("citySpecificPrincipals").value=principalArray;if(monthlyChargeRentalArrayDistinctmax<=100||monthlyChargeRentalArrayDistinctmax==''||monthlyChargeRentalArrayDistinctmax==null){document.getElementById("slider1").style.display="none";}else{document.getElementById("slider1").style.display="block";document.getElementById("dd1").innerHTML="<span id=\"my-slider-1\" ></span>";if(monthlyChargeRentalArrayDistinctmax>1000){document.getElementById("dw1").value=1100;}else{document.getElementById("dw1").value=monthlyChargeRentalArrayDistinctmax;}
var limit1=monthlyChargeRentalArrayDistinctmax;document.getElementById("slider1Limit").value=limit1;(function(){var YUE=YAHOO.util.Event;var YUD=YAHOO.util.Dom;var YUC=YAHOO.util.CustomEvent;var isDrag=false;if(window.opera)
{YUD.addClass(document.documentElement,'borwser-opera');};var stopAction=function(e)
{YUE.stopEvent(e);return false;};var setValue=function(nFrom,nTo,dFromBtn,bNotChangePosition)
{var nOldFrom=this.from;var nOldTo=this.to;var sElementId=this.id;var dEl=document.getElementById(sElementId);var dBox=document.getElementById(sElementId+'-box');var dC0=document.getElementById(sElementId+'-ctrl-0');var dC1=document.getElementById(sElementId+'-ctrl-1');var dC2=document.getElementById(sElementId+'-ctrl-2');var dLn1=document.getElementById(sElementId+'-line-1');var nSliderWidth=dBox.offsetWidth;var nf=Math.min(nTo,Math.max(0,nFrom));var nt=Math.min(limit1,Math.max(nFrom,nTo));if(isNaN(nf)){nf=0};if(isNaN(nt)){nf=limit1};nf=Math.round(nf);nt=Math.round(nt);this.from=nf;this.to=nt;if(!bNotChangePosition)
{var nX1=(nSliderWidth*(this.from/limit1));var nX2=(nSliderWidth*(this.to/limit1))-dC2.offsetWidth;if(dFromBtn==dC1)
{dC1.style.left=nX1+'px';}
else if(dFromBtn==dC2)
{dC2.style.left=nX2+'px';}
else
{dC1.style.left=nX1+'px';dC2.style.left=nX2+'px';};var nLeft=parseInt(dC1.style.left)-1;var nRight=parseInt(dC2.style.left)+dC2.offsetWidth-1;dC0.style.left=dC1.style.left;dC0.style.width=nRight-nLeft+'px';};if(!!(nOldFrom-nf)||!!(nOldTo-nt))
{this.onChange.fire(nf,nt);};return[nX1,nX2];};var onMouseDown=function(e,oSelf)
{var dBtn=this;var sElementId=oSelf.id;var dEl=document.getElementById(sElementId);var dBox=document.getElementById(sElementId+'-box');var dC0=document.getElementById(sElementId+'-ctrl-0');var dC1=document.getElementById(sElementId+'-ctrl-1');var dC2=document.getElementById(sElementId+'-ctrl-2');var dLn1=document.getElementById(sElementId+'-line-1');var nSliderWidth=dBox.offsetWidth;var nOffsetLeft=YUD.getX(dBox)||YUD.getX(dEl);var nlimit1Left=0;var nlimit1Right=nSliderWidth-dBtn.offsetWidth;var nSliderWidth=nSliderWidth;if(dBtn.className=='ctrl-2')
{nlimit1Left=parseInt(dC1.style.left)+dC1.offsetWidth;}
else
{nlimit1Right=parseInt(dC2.style.left)-dC1.offsetWidth;};var onMouseUp=function(e)
{YUE.stopEvent(e);YUE.removeListener(document,'mousemove',onMouseMove);YUE.removeListener(document,'mouseup',onMouseUp);isDrag=false;oSelf.onMouseUp.fire(e);return false;};var onMouseMove=function(e)
{var nEx=e.clientX-nOffsetLeft;if(!isDrag)
{onMouseUp.call(document,e,aArg);return;};nEx=Math.max(nlimit1Left,nEx);nEx=Math.min(nEx,nlimit1Right);if(dBtn==dC1)
{oSelf.from=Math.abs((nEx/(nSliderWidth-dC1.offsetWidth-dC2.offsetWidth))*limit1);}
else
{oSelf.to=Math.abs((nEx/(nSliderWidth-dC1.offsetWidth-dC2.offsetWidth))*limit1);};if(Math.abs(oSelf.from-oSelf.to)<=3)
{oSelf.from=oSelf.to};setValue.call(oSelf,oSelf.from,oSelf.to,dBtn,true);if(dBtn==dC1)
{dBtn.style.left=nEx+'px';var nLeft=parseInt(dC1.style.left)-1;var nRight=parseInt(dC2.style.left)+dC2.offsetWidth-1;dC0.style.left=dC1.style.left;dC0.style.width=nRight-nLeft+'px';}
else
{dBtn.style.left=nEx+'px';var nLeft=parseInt(dC1.style.left)-1;var nRight=parseInt(dC2.style.left)+dC2.offsetWidth-1;dC0.style.left=dC1.style.left;dC0.style.width=nRight-nLeft+'px';};YUE.stopEvent(e);oSelf.onSlide.fire(e,oSelf.from,oSelf.to);return false;};YUE.on(document,'mousemove',onMouseMove);YUE.on(document,'mouseup',onMouseUp);isDrag=true;YUE.stopEvent(e);oSelf.onMouseDown.fire(e);return false;};var onMouseDownOnBackground=function(e,oSelf)
{var sElementId=oSelf.id;var dBox=document.getElementById(sElementId+'-box');var dC0=this;var dC1=document.getElementById(sElementId+'-ctrl-1');var dC2=document.getElementById(sElementId+'-ctrl-2');var dLn1=document.getElementById(sElementId+'-line-1');var nSliderWidth=dBox.parentNode.offsetWidth||dBox.offsetWidth;var nAvailRangeWidth=nSliderWidth-dC1.offsetWidth-dC2.offsetWidth;var nOffsetLeft=YUD.getX(dBox);var ndC0Width=dC0.offsetWidth;var ndC2Width=dC2.offsetWidth;var nlimit1Right=nSliderWidth-ndC0Width;var nMouseDownX=e.clientX-YUD.getX(dC0);var nRange=oSelf.to-oSelf.from;var onMouseMove=function(e)
{if(!isDrag)
{onMouseUp.call(document,e);return;};var nEx=Math.max(0,e.clientX-nOffsetLeft-nMouseDownX);if(nEx<nlimit1Right)
{var nTo=Math.min(limit1,Math.round(((nEx+ndC0Width)/nAvailRangeWidth)*limit1));var nFrom=nTo-nRange;setValue.call(oSelf,nFrom,nTo,null,true);dC0.style.left=nEx+'px';dC0.style.width=ndC0Width+'px';dC2.style.left=nEx+ndC0Width-ndC2Width+1+'px';}
else
{dC0.style.left=nlimit1Right+'px';dC0.style.width=ndC0Width+'px';dC2.style.left=nlimit1Right+ndC0Width-ndC2Width+1+'px';};dC1.style.left=dC0.style.left;oSelf.onSlide.fire(e,oSelf.from,oSelf.to);};var onMouseUp=function(e)
{YUE.removeListener(document,'mousemove',onMouseMove);YUE.removeListener(document,'mouseup',onMouseUp);isDrag=false;};YUE.on(document,'mousemove',onMouseMove);YUE.on(document,'mouseup',onMouseUp);isDrag=true;YUE.stopEvent(e);oSelf.onMouseDown.fire(e);return false;};YAHOO.widget.RangeSlider1=function(sElementId,oAttr){var oSelf=this;oSelf.onMouseDown=new YUC('mousedown');oSelf.onMouseUp=new YUC('mouseup');oSelf.onSlide=new YUC('slide');oSelf.onLoad=new YUC('load');oSelf.onChange=new YUC('change');if(typeof(oAttr)!='object')
{oAttr={};};var init=function()
{var dEl=this;dEl.className='yui-range-slider';if(dEl.tagName!='SPAN')
{throw Error('YAHOO.widget.RangeSlider1 Error: \n Element['+sElementId+']\'s tagName is not SPAN');return;};oSelf.type=(YUD.hasClass(dEl,'yui-range-slider-v'))?2:1;YUD.addClass(dEl,'yui-range-slider yui-range-slider-'+oSelf.type);var sTagName=window.opera?'span':'button';dEl.innerHTML=['<span class="s-hd">','<span class="s-line-1" id="',sElementId,'-line-1"></span>','<',sTagName,' class="ctrl-0" id="',sElementId,'-ctrl-0" ></',sTagName,'>','<button  id="',sElementId,'-ctrl-1" class="ctrl-1">&nbsp;</button>','<button   id="',sElementId,'-ctrl-2" class="ctrl-2">&nbsp;</button>','</span>','<',sTagName,' hidefocus="hidefocus" class="s-bd" id="',sElementId,'-box" >&nbsp;</',sTagName,'>',].join('');var dBox=document.getElementById(sElementId+'-box');dBox.style.width=(oAttr.width||200)+'px';dBox.style.height=(oAttr.height||23)+'px';var dC0=document.getElementById(sElementId+'-ctrl-0');var dC1=document.getElementById(sElementId+'-ctrl-1');var dC2=document.getElementById(sElementId+'-ctrl-2');var dLn1=document.getElementById(sElementId+'-line-1');var nSliderWidth=dBox.offsetWidth;dLn1.style.width=parseInt(dBox.style.width)-4+'px';dC0.style.height=dC1.style.height=dC2.style.height=(parseInt(dBox.style.height)-4)+'px';dLn1.style.top=(oAttr.height||23)/2+'px';YUE.on(dC1,'mousedown',onMouseDown,oSelf);YUE.on(dC2,'mousedown',onMouseDown,oSelf);YUE.on(dC0,'mousedown',stopAction);YUE.on(dEl,'selectstart',stopAction);YUE.on(dBox,'mousedown',stopAction);setValue.call(oSelf,oSelf.from,oSelf.to);oSelf.readyState='complete';oSelf.onLoad.fire();};this.id=sElementId;YUE.onAvailable(sElementId,init);};YAHOO.widget.RangeSlider1.prototype={id:'',readyState:'uninitialized',type:1,from:10,to:90,setValue:function(nFrom,nTo)
{var oSelf=this;nFrom=isNaN(nFrom)?0:(nFrom||0);nTo=isNaN(nTo)?limit1:(nTo||limit1);nFrom=Math.max(0,nFrom);nTo=Math.min(limit1,nTo);nFrom=Math.min(nFrom,nTo);var fAction=function()
{setValue.call(oSelf,nFrom,nTo);};if(oSelf.readyState!='complete')
{oSelf.onLoad.subscribe(fAction);}
else
{fAction();};},getValue:function()
{return[this.from,this.to];},getElement:function()
{return document.getElementById(this.id);}};})();var oMS3=new YAHOO.widget.RangeSlider1('my-slider-1',{width:230,height:24});if(document.getElementById("firstActionSliderOrPrincipal").value!="slider"){oMS3.setValue(0,limit1);}else{oMS3.setValue(slider1Min,slider1Max);}
var onMS1Slide=function(sType)
{var aData2=this.getValue();if(typeof(this.oldData02)=='undefined')this.oldData02=aData2[0];if(typeof(this.oldData12)=='undefined')this.oldData12=aData2[1];if(aData2[0]!=this.oldData02)
{if(aData2[0]-this.oldData02<=0)
{aData2=this.getValue();this.oldData02=aData2[0];this.oldData12=aData2[1];var oldUpper=this.oldData02;oldUpper=Math.round(oldUpper/100);oldUpper=oldUpper-1;oldUpper=oldUpper*100;oMS3.setValue(oldUpper,this.oldData12);}else
{aData2=this.getValue();this.oldData02=aData2[0];this.oldData12=aData2[1];var oldUpper=this.oldData02;oldUpper=Math.round(oldUpper/100);if(((this.oldData12-this.oldData02)<100)){if(((this.oldData12-this.oldData02)==0)||(((this.oldData12-this.oldData02)<100)&&((this.oldData12-this.oldData02)>0))){oldUpper=oldUpper-1;}else{oldUpper=oldUpper+1;}}
oldUpper=oldUpper*100;oMS3.setValue(oldUpper,this.oldData12);}}
if(aData2[1]!=this.oldData12)
{if(aData2[1]-this.oldData12<=0)
{aData2=this.getValue();this.oldData02=aData2[0];this.oldData12=aData2[1];var oldLower=this.oldData12;oldLower=Math.round(oldLower/100);if(((this.oldData12-this.oldData02)<100)){if(((this.oldData12-this.oldData02)==0)||(((this.oldData12-this.oldData02)<100)&&((this.oldData12-this.oldData02)>0))){oldLower=oldLower+1;}else{oldLower=oldLower-1;}}
oldLower=oldLower*100;oMS3.setValue(this.oldData02,oldLower);}else
{aData2=this.getValue();this.oldData02=aData2[0];this.oldData12=aData2[1];var oldLower=this.oldData12;oldLower=Math.round(oldLower/100);oldLower=oldLower+1;oldLower=oldLower*100;oMS3.setValue(this.oldData02,oldLower);}}
document.getElementById('slider1Min').value=this.oldData02;document.getElementById('slider1Max').value=this.oldData12;aData2=this.getValue();this.oldData02=aData2[0];this.oldData12=aData2[1];oMS3.setValue(this.oldData02,this.oldData12);if(aData2[0]!=document.getElementById('slider1Min').value||aData2[1]!=document.getElementById('slider1Max').value){calculateValueForsliderEvent(21,document.getElementById("principalIdsForSliderChange").value,this.oldData02,this.oldData12,document.getElementById("slider2Min").value,document.getElementById("slider2Max").value,document.getElementById("slider3Min").value,document.getElementById("slider3Max").value,document.getElementById("regionId").value,document.getElementById("regionName").value,document.getElementById("city").value);document.getElementById('slider1Min').value=this.oldData02;document.getElementById('slider1Max').value=this.oldData12;if(this.oldData12>1000){document.getElementById('d1').innerHTML=this.oldData02+' - '+'1000+';}else{document.getElementById('d1').innerHTML=this.oldData02+' - '+this.oldData12;}
return;}
document.getElementById('slider1Min').value=this.oldData02;document.getElementById('slider1Max').value=this.oldData12;if(this.oldData12>1000){document.getElementById('d1').innerHTML=this.oldData02+' - '+'1000+';}else{document.getElementById('d1').innerHTML=this.oldData02+' - '+this.oldData12;}};oMS3.onLoad.subscribe(onMS1Slide,oMS3,true);oMS3.onMouseUp.subscribe(onMS1Slide,oMS3,true);}
if(respArray[3]=='ULTD'||respArray[3]=='Ultd'||respArray[4]=='ULTD'||respArray[4]=='Ultd')
{var freebiesSameOperatorFreeTalkTimeMinArrayDistinctmax=1100;var freebiesSameOperatorFreeTalkTimeMinArrayDistinctmin=respArray[4];}
else
{var freebiesSameOperatorFreeTalkTimeMinArrayDistinctmax=respArray[3];var freebiesSameOperatorFreeTalkTimeMinArrayDistinctmin=respArray[4];}
if(freebiesSameOperatorFreeTalkTimeMinArrayDistinctmax=="ULTD"||freebiesSameOperatorFreeTalkTimeMinArrayDistinctmax=="Ultd"){freebiesSameOperatorFreeTalkTimeMinArrayDistinctmax=1100;}
if(freebiesSameOperatorFreeTalkTimeMinArrayDistinctmax<=100||freebiesSameOperatorFreeTalkTimeMinArrayDistinctmax==NaN||freebiesSameOperatorFreeTalkTimeMinArrayDistinctmax==''){document.getElementById("slider2").style.display="none";}else{document.getElementById("slider2").style.display="block";document.getElementById("dd2").innerHTML="<span id=\"my-slider-2\" ></span>";var limit2=freebiesSameOperatorFreeTalkTimeMinArrayDistinctmax;document.getElementById("slider2Limit").value=limit2;(function(){var YUE=YAHOO.util.Event;var YUD=YAHOO.util.Dom;var YUC=YAHOO.util.CustomEvent;var isDrag=false;if(window.opera)
{YUD.addClass(document.documentElement,'borwser-opera');};var stopAction=function(e)
{YUE.stopEvent(e);return false;};var setValue=function(nFrom,nTo,dFromBtn,bNotChangePosition)
{var nOldFrom=this.from;var nOldTo=this.to;var sElementId=this.id;var dEl=document.getElementById(sElementId);var dBox=document.getElementById(sElementId+'-box');var dC0=document.getElementById(sElementId+'-ctrl-0');var dC1=document.getElementById(sElementId+'-ctrl-1');var dC2=document.getElementById(sElementId+'-ctrl-2');var dLn1=document.getElementById(sElementId+'-line-1');var nSliderWidth=dBox.offsetWidth;var nf=Math.min(nTo,Math.max(0,nFrom));var nt=Math.min(limit2,Math.max(nFrom,nTo));if(isNaN(nf)){nf=0};if(isNaN(nt)){nf=limit2};nf=Math.round(nf);nt=Math.round(nt);this.from=nf;this.to=nt;if(!bNotChangePosition)
{var nX1=(nSliderWidth*(this.from/limit2));var nX2=(nSliderWidth*(this.to/limit2))-dC2.offsetWidth;if(dFromBtn==dC1)
{dC1.style.left=nX1+'px';}
else if(dFromBtn==dC2)
{dC2.style.left=nX2+'px';}
else
{dC1.style.left=nX1+'px';dC2.style.left=nX2+'px';};var nLeft=parseInt(dC1.style.left)-1;var nRight=parseInt(dC2.style.left)+dC2.offsetWidth-1;dC0.style.left=dC1.style.left;dC0.style.width=nRight-nLeft+'px';};if(!!(nOldFrom-nf)||!!(nOldTo-nt))
{this.onChange.fire(nf,nt);};return[nX1,nX2];};var onMouseDown=function(e,oSelf)
{var dBtn=this;var sElementId=oSelf.id;var dEl=document.getElementById(sElementId);var dBox=document.getElementById(sElementId+'-box');var dC0=document.getElementById(sElementId+'-ctrl-0');var dC1=document.getElementById(sElementId+'-ctrl-1');var dC2=document.getElementById(sElementId+'-ctrl-2');var dLn1=document.getElementById(sElementId+'-line-1');var nSliderWidth=dBox.offsetWidth;var nOffsetLeft=YUD.getX(dBox)||YUD.getX(dEl);var nlimit2Left=0;var nlimit2Right=nSliderWidth-dBtn.offsetWidth;var nSliderWidth=nSliderWidth;if(dBtn.className=='ctrl-2')
{nlimit2Left=parseInt(dC1.style.left)+dC1.offsetWidth;}
else
{nlimit2Right=parseInt(dC2.style.left)-dC1.offsetWidth;};var onMouseUp=function(e)
{YUE.stopEvent(e);YUE.removeListener(document,'mousemove',onMouseMove);YUE.removeListener(document,'mouseup',onMouseUp);isDrag=false;oSelf.onMouseUp.fire(e);return false;};var onMouseMove=function(e)
{var nEx=e.clientX-nOffsetLeft;if(!isDrag)
{onMouseUp.call(document,e,aArg);return;};nEx=Math.max(nlimit2Left,nEx);nEx=Math.min(nEx,nlimit2Right);if(dBtn==dC1)
{oSelf.from=Math.abs((nEx/(nSliderWidth-dC1.offsetWidth-dC2.offsetWidth))*limit2);}
else
{oSelf.to=Math.abs((nEx/(nSliderWidth-dC1.offsetWidth-dC2.offsetWidth))*limit2);};if(Math.abs(oSelf.from-oSelf.to)<=3)
{oSelf.from=oSelf.to};setValue.call(oSelf,oSelf.from,oSelf.to,dBtn,true);if(dBtn==dC1)
{dBtn.style.left=nEx+'px';var nLeft=parseInt(dC1.style.left)-1;var nRight=parseInt(dC2.style.left)+dC2.offsetWidth-1;dC0.style.left=dC1.style.left;dC0.style.width=nRight-nLeft+'px';}
else
{dBtn.style.left=nEx+'px';var nLeft=parseInt(dC1.style.left)-1;var nRight=parseInt(dC2.style.left)+dC2.offsetWidth-1;dC0.style.left=dC1.style.left;dC0.style.width=nRight-nLeft+'px';};YUE.stopEvent(e);oSelf.onSlide.fire(e,oSelf.from,oSelf.to);return false;};YUE.on(document,'mousemove',onMouseMove);YUE.on(document,'mouseup',onMouseUp);isDrag=true;YUE.stopEvent(e);oSelf.onMouseDown.fire(e);return false;};var onMouseDownOnBackground=function(e,oSelf)
{var sElementId=oSelf.id;var dBox=document.getElementById(sElementId+'-box');var dC0=this;var dC1=document.getElementById(sElementId+'-ctrl-1');var dC2=document.getElementById(sElementId+'-ctrl-2');var dLn1=document.getElementById(sElementId+'-line-1');var nSliderWidth=dBox.parentNode.offsetWidth||dBox.offsetWidth;var nAvailRangeWidth=nSliderWidth-dC1.offsetWidth-dC2.offsetWidth;var nOffsetLeft=YUD.getX(dBox);var ndC0Width=dC0.offsetWidth;var ndC2Width=dC2.offsetWidth;var nlimit2Right=nSliderWidth-ndC0Width;var nMouseDownX=e.clientX-YUD.getX(dC0);var nRange=oSelf.to-oSelf.from;var onMouseMove=function(e)
{if(!isDrag)
{onMouseUp.call(document,e);return;};var nEx=Math.max(0,e.clientX-nOffsetLeft-nMouseDownX);if(nEx<nlimit2Right)
{var nTo=Math.min(limit2,Math.round(((nEx+ndC0Width)/nAvailRangeWidth)*limit2));var nFrom=nTo-nRange;setValue.call(oSelf,nFrom,nTo,null,true);dC0.style.left=nEx+'px';dC0.style.width=ndC0Width+'px';dC2.style.left=nEx+ndC0Width-ndC2Width+1+'px';}
else
{dC0.style.left=nlimit2Right+'px';dC0.style.width=ndC0Width+'px';dC2.style.left=nlimit2Right+ndC0Width-ndC2Width+1+'px';};dC1.style.left=dC0.style.left;oSelf.onSlide.fire(e,oSelf.from,oSelf.to);};var onMouseUp=function(e)
{YUE.removeListener(document,'mousemove',onMouseMove);YUE.removeListener(document,'mouseup',onMouseUp);isDrag=false;};YUE.on(document,'mousemove',onMouseMove);YUE.on(document,'mouseup',onMouseUp);isDrag=true;YUE.stopEvent(e);oSelf.onMouseDown.fire(e);return false;};YAHOO.widget.RangeSlider2=function(sElementId,oAttr)
{var oSelf=this;oSelf.onMouseDown=new YUC('mousedown');oSelf.onMouseUp=new YUC('mouseup');oSelf.onSlide=new YUC('slide');oSelf.onLoad=new YUC('load');oSelf.onChange=new YUC('change');if(typeof(oAttr)!='object')
{oAttr={};};var init=function()
{var dEl=this;dEl.className='yui-range-slider';if(dEl.tagName!='SPAN')
{throw Error('YAHOO.widget.RangeSlider2 Error: \n Element['+sElementId+']\'s tagName is not SPAN');return;};oSelf.type=(YUD.hasClass(dEl,'yui-range-slider-v'))?2:1;YUD.addClass(dEl,'yui-range-slider yui-range-slider-'+oSelf.type);var sTagName=window.opera?'span':'button';dEl.innerHTML=['<span class="s-hd">','<span class="s-line-1" id="',sElementId,'-line-1"></span>','<',sTagName,' class="ctrl-0" id="',sElementId,'-ctrl-0" ></',sTagName,'>','<button  id="',sElementId,'-ctrl-1" class="ctrl-1">&nbsp;</button>','<button   id="',sElementId,'-ctrl-2" class="ctrl-2">&nbsp;</button>','</span>','<',sTagName,' hidefocus="hidefocus" class="s-bd" id="',sElementId,'-box" >&nbsp;</',sTagName,'>',].join('');var dBox=document.getElementById(sElementId+'-box');dBox.style.width=(oAttr.width||200)+'px';dBox.style.height=(oAttr.height||23)+'px';var dC0=document.getElementById(sElementId+'-ctrl-0');var dC1=document.getElementById(sElementId+'-ctrl-1');var dC2=document.getElementById(sElementId+'-ctrl-2');var dLn1=document.getElementById(sElementId+'-line-1');var nSliderWidth=dBox.offsetWidth;dLn1.style.width=parseInt(dBox.style.width)-4+'px';dC0.style.height=dC1.style.height=dC2.style.height=(parseInt(dBox.style.height)-4)+'px';dLn1.style.top=(oAttr.height||23)/2+'px';YUE.on(dC1,'mousedown',onMouseDown,oSelf);YUE.on(dC2,'mousedown',onMouseDown,oSelf);YUE.on(dC0,'mousedown',stopAction);YUE.on(dEl,'selectstart',stopAction);YUE.on(dBox,'mousedown',stopAction);setValue.call(oSelf,oSelf.from,oSelf.to);oSelf.readyState='complete';oSelf.onLoad.fire();};this.id=sElementId;YUE.onAvailable(sElementId,init);};YAHOO.widget.RangeSlider2.prototype={id:'',readyState:'uninitialized',type:1,from:10,to:90,setValue:function(nFrom,nTo)
{var oSelf=this;nFrom=isNaN(nFrom)?0:(nFrom||0);nTo=isNaN(nTo)?limit2:(nTo||limit2);nFrom=Math.max(0,nFrom);nTo=Math.min(limit2,nTo);nFrom=Math.min(nFrom,nTo);var fAction=function()
{setValue.call(oSelf,nFrom,nTo);};if(oSelf.readyState!='complete')
{oSelf.onLoad.subscribe(fAction);}
else
{fAction();};},getValue:function()
{return[this.from,this.to];},getElement:function()
{return document.getElementById(this.id);}};})();var oMS2=new YAHOO.widget.RangeSlider2('my-slider-2',{width:230,height:24});if(document.getElementById("firstActionSliderOrPrincipal").value!="slider"){oMS2.setValue(0,limit2);}else{oMS2.setValue(slider2Min,slider2Max);}
var onMS1Slide=function(sType)
{var aData1=this.getValue();if(typeof(this.oldData01)=='undefined')this.oldData01=aData1[0];if(typeof(this.oldData11)=='undefined')this.oldData11=aData1[1];if(aData1[0]!=this.oldData01)
{if(aData1[0]-this.oldData01<=0)
{aData1=this.getValue();this.oldData01=aData1[0];this.oldData11=aData1[1];var oldUpper=this.oldData01;oldUpper=Math.round(oldUpper/100);oldUpper=oldUpper-1;oldUpper=oldUpper*100;oMS2.setValue(oldUpper,this.oldData11);}else
{aData1=this.getValue();this.oldData01=aData1[0];this.oldData11=aData1[1];var oldUpper=this.oldData01;oldUpper=Math.round(oldUpper/100);if(((this.oldData11-this.oldData01)<100)){if(((this.oldData11-this.oldData01)==0)||(((this.oldData11-this.oldData01)<100)&&((this.oldData11-this.oldData01)>0))){oldUpper=oldUpper-1;}else{oldUpper=oldUpper+1;}}
oldUpper=oldUpper*100;oMS2.setValue(oldUpper,this.oldData11);}}
if(aData1[1]!=this.oldData11)
{if(aData1[1]-this.oldData11<=0)
{aData1=this.getValue();this.oldData01=aData1[0];this.oldData11=aData1[1];var oldLower=this.oldData11;oldLower=Math.round(oldLower/100);if(((this.oldData11-this.oldData01)<100)){if(((this.oldData11-this.oldData01)==0)||(((this.oldData11-this.oldData01)<100)&&((this.oldData11-this.oldData01)>0))){oldLower=oldLower+1;}else{oldLower=oldLower-1;}}
oldLower=oldLower*100;oMS2.setValue(this.oldData01,oldLower);}else
{aData1=this.getValue();this.oldData01=aData1[0];this.oldData11=aData1[1];var oldLower=this.oldData11;oldLower=Math.round(oldLower/100);oldLower=oldLower+1;oldLower=oldLower*100;oMS2.setValue(this.oldData01,oldLower);}}
document.getElementById('slider2Min').value=this.oldData01;document.getElementById('slider2Max').value=this.oldData11;aData1=this.getValue();this.oldData01=aData1[0];this.oldData11=aData1[1];if(document.getElementById('slider2Min').value!=aData1[0]||document.getElementById('slider2Max').value!=aData1[1]){calculateValueForsliderEvent(21,document.getElementById("principalIdsForSliderChange").value,document.getElementById("slider1Min").value,document.getElementById("slider1Max").value,this.oldData01,this.oldData11,document.getElementById("slider3Min").value,document.getElementById("slider3Max").value,document.getElementById("regionId").value,document.getElementById("regionName").value,document.getElementById("city").value);document.getElementById('slider2Min').value=this.oldData01;document.getElementById('slider2Max').value=this.oldData11;if(this.oldData11>1000){document.getElementById('d2').innerHTML=this.oldData01+' - '+'1000+';}else{document.getElementById('d2').innerHTML=this.oldData01+' - '+this.oldData11;}}
oMS2.setValue(this.oldData01,this.oldData11);document.getElementById('slider2Min').value=this.oldData01;document.getElementById('slider2Max').value=this.oldData11;if(this.oldData11>1000){document.getElementById('d2').innerHTML=this.oldData01+' - '+'1000+';}else{document.getElementById('d2').innerHTML=this.oldData01+' - '+this.oldData11;}};oMS2.onLoad.subscribe(onMS1Slide,oMS2,true);oMS2.onMouseUp.subscribe(onMS1Slide,oMS2,true);}
if(freebiesSameOperatorFreeTalkTimeMinArrayDistinctmax>1000){document.getElementById("dw2").value=1100;}else{document.getElementById("dw2").value=freebiesSameOperatorFreeTalkTimeMinArrayDistinctmax;}
var freeSmsInNumbersLocalSameOperatorArrayDistinctmax=respArray[5];var freeSmsInNumbersLocalSameOperatorArrayDistinctmin=respArray[6];if(freeSmsInNumbersLocalSameOperatorArrayDistinctmax<=100||freeSmsInNumbersLocalSameOperatorArrayDistinctmax==''||freeSmsInNumbersLocalSameOperatorArrayDistinctmax==NaN){document.getElementById("slider3").style.display="none";}else{document.getElementById("slider3").style.display="block";document.getElementById("dd3").innerHTML="<span id=\"my-slider-3\" ></span>";var limit3=freeSmsInNumbersLocalSameOperatorArrayDistinctmax;document.getElementById("slider3Limit").value=limit3;(function(){var YUE=YAHOO.util.Event;var YUD=YAHOO.util.Dom;var YUC=YAHOO.util.CustomEvent;var isDrag=false;if(window.opera)
{YUD.addClass(document.documentElement,'borwser-opera');};var stopAction=function(e)
{YUE.stopEvent(e);return false;};var setValue=function(nFrom,nTo,dFromBtn,bNotChangePosition)
{var nOldFrom=this.from;var nOldTo=this.to;var sElementId=this.id;var dEl=document.getElementById(sElementId);var dBox=document.getElementById(sElementId+'-box');var dC0=document.getElementById(sElementId+'-ctrl-0');var dC1=document.getElementById(sElementId+'-ctrl-1');var dC2=document.getElementById(sElementId+'-ctrl-2');var dLn1=document.getElementById(sElementId+'-line-1');var nSliderWidth=dBox.offsetWidth;var nf=Math.min(nTo,Math.max(0,nFrom));var nt=Math.min(limit3,Math.max(nFrom,nTo));if(isNaN(nf)){nf=0};if(isNaN(nt)){nf=limit3};nf=Math.round(nf);nt=Math.round(nt);this.from=nf;this.to=nt;if(!bNotChangePosition)
{var nX1=(nSliderWidth*(this.from/limit3));var nX2=(nSliderWidth*(this.to/limit3))-dC2.offsetWidth;if(dFromBtn==dC1)
{dC1.style.left=nX1+'px';}
else if(dFromBtn==dC2)
{dC2.style.left=nX2+'px';}
else
{dC1.style.left=nX1+'px';dC2.style.left=nX2+'px';};var nLeft=parseInt(dC1.style.left)-1;var nRight=parseInt(dC2.style.left)+dC2.offsetWidth-1;dC0.style.left=dC1.style.left;dC0.style.width=nRight-nLeft+'px';};if(!!(nOldFrom-nf)||!!(nOldTo-nt))
{this.onChange.fire(nf,nt);};return[nX1,nX2];};var onMouseDown=function(e,oSelf)
{var dBtn=this;var sElementId=oSelf.id;var dEl=document.getElementById(sElementId);var dBox=document.getElementById(sElementId+'-box');var dC0=document.getElementById(sElementId+'-ctrl-0');var dC1=document.getElementById(sElementId+'-ctrl-1');var dC2=document.getElementById(sElementId+'-ctrl-2');var dLn1=document.getElementById(sElementId+'-line-1');var nSliderWidth=dBox.offsetWidth;var nOffsetLeft=YUD.getX(dBox)||YUD.getX(dEl);var nlimit3Left=0;var nlimit3Right=nSliderWidth-dBtn.offsetWidth;var nSliderWidth=nSliderWidth;if(dBtn.className=='ctrl-2')
{nlimit3Left=parseInt(dC1.style.left)+dC1.offsetWidth;}
else
{nlimit3Right=parseInt(dC2.style.left)-dC1.offsetWidth;};var onMouseUp=function(e)
{YUE.stopEvent(e);YUE.removeListener(document,'mousemove',onMouseMove);YUE.removeListener(document,'mouseup',onMouseUp);isDrag=false;oSelf.onMouseUp.fire(e);return false;};var onMouseMove=function(e)
{var nEx=e.clientX-nOffsetLeft;if(!isDrag)
{onMouseUp.call(document,e,aArg);return;};nEx=Math.max(nlimit3Left,nEx);nEx=Math.min(nEx,nlimit3Right);if(dBtn==dC1)
{oSelf.from=Math.abs((nEx/(nSliderWidth-dC1.offsetWidth-dC2.offsetWidth))*limit3);}
else
{oSelf.to=Math.abs((nEx/(nSliderWidth-dC1.offsetWidth-dC2.offsetWidth))*limit3);};if(Math.abs(oSelf.from-oSelf.to)<=3)
{oSelf.from=oSelf.to};setValue.call(oSelf,oSelf.from,oSelf.to,dBtn,true);if(dBtn==dC1)
{dBtn.style.left=nEx+'px';var nLeft=parseInt(dC1.style.left)-1;var nRight=parseInt(dC2.style.left)+dC2.offsetWidth-1;dC0.style.left=dC1.style.left;dC0.style.width=nRight-nLeft+'px';}
else
{dBtn.style.left=nEx+'px';var nLeft=parseInt(dC1.style.left)-1;var nRight=parseInt(dC2.style.left)+dC2.offsetWidth-1;dC0.style.left=dC1.style.left;dC0.style.width=nRight-nLeft+'px';};YUE.stopEvent(e);oSelf.onSlide.fire(e,oSelf.from,oSelf.to);return false;};YUE.on(document,'mousemove',onMouseMove);YUE.on(document,'mouseup',onMouseUp);isDrag=true;YUE.stopEvent(e);oSelf.onMouseDown.fire(e);return false;};var onMouseDownOnBackground=function(e,oSelf)
{var sElementId=oSelf.id;var dBox=document.getElementById(sElementId+'-box');var dC0=this;var dC1=document.getElementById(sElementId+'-ctrl-1');var dC2=document.getElementById(sElementId+'-ctrl-2');var dLn1=document.getElementById(sElementId+'-line-1');var nSliderWidth=dBox.parentNode.offsetWidth||dBox.offsetWidth;var nAvailRangeWidth=nSliderWidth-dC1.offsetWidth-dC2.offsetWidth;var nOffsetLeft=YUD.getX(dBox);var ndC0Width=dC0.offsetWidth;var ndC2Width=dC2.offsetWidth;var nlimit3Right=nSliderWidth-ndC0Width;var nMouseDownX=e.clientX-YUD.getX(dC0);var nRange=oSelf.to-oSelf.from;var onMouseMove=function(e)
{if(!isDrag)
{onMouseUp.call(document,e);return;};var nEx=Math.max(0,e.clientX-nOffsetLeft-nMouseDownX);if(nEx<nlimit3Right)
{var nTo=Math.min(limit3,Math.round(((nEx+ndC0Width)/nAvailRangeWidth)*limit3));var nFrom=nTo-nRange;setValue.call(oSelf,nFrom,nTo,null,true);dC0.style.left=nEx+'px';dC0.style.width=ndC0Width+'px';dC2.style.left=nEx+ndC0Width-ndC2Width+1+'px';}
else
{dC0.style.left=nlimit3Right+'px';dC0.style.width=ndC0Width+'px';dC2.style.left=nlimit3Right+ndC0Width-ndC2Width+1+'px';};dC1.style.left=dC0.style.left;oSelf.onSlide.fire(e,oSelf.from,oSelf.to);};var onMouseUp=function(e)
{YUE.removeListener(document,'mousemove',onMouseMove);YUE.removeListener(document,'mouseup',onMouseUp);isDrag=false;};YUE.on(document,'mousemove',onMouseMove);YUE.on(document,'mouseup',onMouseUp);isDrag=true;YUE.stopEvent(e);oSelf.onMouseDown.fire(e);return false;};YAHOO.widget.RangeSlider3=function(sElementId,oAttr)
{var oSelf=this;oSelf.onMouseDown=new YUC('mousedown');oSelf.onMouseUp=new YUC('mouseup');oSelf.onSlide=new YUC('slide');oSelf.onLoad=new YUC('load');oSelf.onChange=new YUC('change');if(typeof(oAttr)!='object')
{oAttr={};};var init=function()
{var dEl=this;dEl.className='yui-range-slider';if(dEl.tagName!='SPAN')
{throw Error('YAHOO.widget.RangeSlider3 Error: \n Element['+sElementId+']\'s tagName is not SPAN');return;};oSelf.type=(YUD.hasClass(dEl,'yui-range-slider-v'))?2:1;YUD.addClass(dEl,'yui-range-slider yui-range-slider-'+oSelf.type);var sTagName=window.opera?'span':'button';dEl.innerHTML=['<span class="s-hd">','<span class="s-line-1" id="',sElementId,'-line-1"></span>','<',sTagName,' class="ctrl-0" id="',sElementId,'-ctrl-0" ></',sTagName,'>','<button  id="',sElementId,'-ctrl-1" class="ctrl-1">&nbsp;</button>','<button   id="',sElementId,'-ctrl-2" class="ctrl-2">&nbsp;</button>','</span>','<',sTagName,' hidefocus="hidefocus" class="s-bd" id="',sElementId,'-box" >&nbsp;</',sTagName,'>',].join('');var dBox=document.getElementById(sElementId+'-box');dBox.style.width=(oAttr.width||200)+'px';dBox.style.height=(oAttr.height||23)+'px';var dC0=document.getElementById(sElementId+'-ctrl-0');var dC1=document.getElementById(sElementId+'-ctrl-1');var dC2=document.getElementById(sElementId+'-ctrl-2');var dLn1=document.getElementById(sElementId+'-line-1');var nSliderWidth=dBox.offsetWidth;dLn1.style.width=parseInt(dBox.style.width)-4+'px';dC0.style.height=dC1.style.height=dC2.style.height=(parseInt(dBox.style.height)-4)+'px';dLn1.style.top=(oAttr.height||23)/2+'px';YUE.on(dC1,'mousedown',onMouseDown,oSelf);YUE.on(dC2,'mousedown',onMouseDown,oSelf);YUE.on(dC0,'mousedown',stopAction);YUE.on(dEl,'selectstart',stopAction);YUE.on(dBox,'mousedown',stopAction);setValue.call(oSelf,oSelf.from,oSelf.to);oSelf.readyState='complete';oSelf.onLoad.fire();};this.id=sElementId;YUE.onAvailable(sElementId,init);};YAHOO.widget.RangeSlider3.prototype={id:'',readyState:'uninitialized',type:1,from:10,to:90,setValue:function(nFrom,nTo)
{var oSelf=this;nFrom=isNaN(nFrom)?0:(nFrom||0);nTo=isNaN(nTo)?limit3:(nTo||limit3);nFrom=Math.max(0,nFrom);nTo=Math.min(limit3,nTo);nFrom=Math.min(nFrom,nTo);var fAction=function()
{setValue.call(oSelf,nFrom,nTo);};if(oSelf.readyState!='complete')
{oSelf.onLoad.subscribe(fAction);}
else
{fAction();};},getValue:function()
{return[this.from,this.to];},getElement:function()
{return document.getElementById(this.id);}};})();var oMS1=new YAHOO.widget.RangeSlider3('my-slider-3',{width:230,height:24});if(document.getElementById("firstActionSliderOrPrincipal").value!="slider"){oMS1.setValue(0,limit3);}else{oMS1.setValue(slider3Min,slider3Max);}
var onMS1Slide=function(sType)
{var aData=this.getValue();if(typeof(this.oldData0)=='undefined')this.oldData0=aData[0];if(typeof(this.oldData1)=='undefined')this.oldData1=aData[1];if(aData[0]!=this.oldData0)
{if(aData[0]-this.oldData0<=0)
{aData=this.getValue();this.oldData0=aData[0];this.oldData1=aData[1];var oldUpper=this.oldData0;oldUpper=Math.round(oldUpper/100);oldUpper=oldUpper-1;oldUpper=oldUpper*100;oMS1.setValue(oldUpper,this.oldData1);}else
{aData=this.getValue();this.oldData0=aData[0];this.oldData1=aData[1];var oldUpper=this.oldData0;oldUpper=Math.round(oldUpper/100);if(((this.oldData1-this.oldData0)<100)){if(((this.oldData1-this.oldData0)==0)||(((this.oldData1-this.oldData0)<100)&&((this.oldData1-this.oldData0)>0))){oldUpper=oldUpper-1;}else{oldUpper=oldUpper+1;}}
oldUpper=oldUpper*100;oMS1.setValue(oldUpper,this.oldData1);}}
if(aData[1]!=this.oldData1)
{if(aData[1]-this.oldData1<=0)
{aData=this.getValue();this.oldData0=aData[0];this.oldData1=aData[1];var oldLower=this.oldData1;oldLower=Math.round(oldLower/100);if(((this.oldData1-this.oldData0)<100)){if(((this.oldData1-this.oldData0)==0)||(((this.oldData1-this.oldData0)<100)&&((this.oldData1-this.oldData0)>0))){oldLower=oldLower+1;}else{oldLower=oldLower-1;}}
oldLower=oldLower*100;oMS1.setValue(this.oldData0,oldLower);}else
{aData=this.getValue();this.oldData0=aData[0];this.oldData1=aData[1];var oldLower=this.oldData1;oldLower=Math.round(oldLower/100);oldLower=oldLower+1;oldLower=oldLower*100;oMS1.setValue(this.oldData0,oldLower);}}
document.getElementById('slider3Min').value=this.oldData0;document.getElementById('slider3Max').value=this.oldData1;aData=this.getValue();this.oldData0=aData[0];this.oldData1=aData[1];oMS1.setValue(this.oldData0,this.oldData1);if(aData[0]!=document.getElementById('slider3Min').value||aData[1]!=document.getElementById('slider3Max').value){calculateValueForsliderEvent(21,document.getElementById("principalIdsForSliderChange").value,document.getElementById("slider1Min").value,document.getElementById("slider1Max").value,document.getElementById("slider2Min").value,document.getElementById("slider2Max").value,+this.oldData0,this.oldData1,document.getElementById("regionId").value,document.getElementById("regionName").value,document.getElementById("city").value);document.getElementById('slider3Min').value=this.oldData0;document.getElementById('slider3Max').value=this.oldData1;if(this.oldData1>1000){document.getElementById('d3').innerHTML=this.oldData0+' - '+'1000+';}else{document.getElementById('d3').innerHTML=this.oldData0+' - '+this.oldData1;}return;}
document.getElementById('slider3Min').value=this.oldData0;document.getElementById('slider3Max').value=this.oldData1;if(this.oldData1>1000){document.getElementById('d3').innerHTML=this.oldData0+' - '+'1000+';}else{document.getElementById('d3').innerHTML=this.oldData0+' - '+this.oldData1;}};oMS1.onLoad.subscribe(onMS1Slide,oMS1,true);oMS1.onMouseUp.subscribe(onMS1Slide,oMS1,true);}
if(freeSmsInNumbersLocalSameOperatorArrayDistinctmax>1000){document.getElementById("dw3").value=1100;}
else{document.getElementById("dw3").value=freeSmsInNumbersLocalSameOperatorArrayDistinctmax;}
var str="principalArray"+principalArray+"monthlyChargeRentalArrayDistinctmin"+monthlyChargeRentalArrayDistinctmin+"-"+monthlyChargeRentalArrayDistinctmax+"freebiesSameOperatorFreeTalkTimeMinArrayDistinctmin"+freebiesSameOperatorFreeTalkTimeMinArrayDistinctmin+"-"+freebiesSameOperatorFreeTalkTimeMinArrayDistinctmax+"freeSmsInNumbersLocalSameOperatorArrayDistinctmin"+freeSmsInNumbersLocalSameOperatorArrayDistinctmin+"-"+freeSmsInNumbersLocalSameOperatorArrayDistinctmax;document.getElementById("provider").style.display="none";var principalsToShow;var principalForSliderEvent="";for(var i=0;i<principalArrayList.length;i++)
{var a=principalArrayList[i].split("-->");if(document.getElementById(""+a[0]+"")!=null){document.getElementById("provider").style.display="block";document.getElementById(""+a[0]+"").style.width="105px";document.getElementById(""+a[0]+"").style.display="block";document.getElementById(""+a[0]+"").width="45%";document.getElementById(""+a[0]+"").style.color="#000000";document.getElementById(""+a[0]+"1").disabled=false;document.getElementById(""+a[0]+"").style.cssFloat="left";document.getElementById(""+a[0]+"").style.styleFloat="left";principalsToShow+=","+a[0]+"-"+a[1];principalForSliderEvent+=","+a[0];document.getElementById(""+a[0]+"1").checked=false;}}
document.getElementById("principalIdsForSliderChange").value=principalForSliderEvent.substring(1);var result=new Array();var a=respArray[7];if(respArray[7]==""){return;}
if(a!=null){document.getElementById("regionId").value=respArray[8];document.getElementById("regionName").value=respArray[9];if(respArray[9]==''){document.getElementById('regionNameToShow').innerHTML="";}{document.getElementById('regionNameToShow').innerHTML="("+respArray[9]+")";}
a=a.replace(/\"\"\"\"/g,"\"\"");var resultFinal=eval("("+a+")");mobileServiceProviderComparatorResultTable(resultFinal,document.getElementById("city").value);}else{document.getElementById("provider").style.display="none";document.getElementById("slider1").style.display="none";document.getElementById("slider2").style.display="none";document.getElementById("slider3").style.display="none";return;}}};receiveReq.send(formParams);}}
function calculateValueForsliderEvent(offeringTypeId,principalIdsForSliderChange,slider1Min,slider1Max,slider2Min,slider2Max,slider3Min,slider3Max,regionId,regionName,city)
{document.getElementById('processingResultsDiv').style.height=screen.height;document.getElementById('processingResultsDiv').style.width=screen.width;document.getElementById('processingResults').style.display="block";document.getElementById('processingResults').style.marginTop=(document.getElementById('resultTable').scrollTop+300);document.getElementById('blockDiv').style.height=0;document.getElementById('blockDiv').style.width=0;document.getElementById("firstActionSliderOrPrincipal").value="slider";{document.getElementById("slider1Min").value=slider1Min;document.getElementById("slider1Max").value=slider1Max;document.getElementById("slider2Min").value=slider2Min;document.getElementById("slider2Max").value=slider2Max;document.getElementById("slider3Min").value=slider3Min;document.getElementById("slider3Max").value=slider3Max;document.getElementById("regionId").value=regionId;document.getElementById("regionName").value=regionName;var formParams="";formParams+="id="+offeringTypeId+"&principal="+principalIdsForSliderChange+"&flag=providerChange&slider1Min="+slider1Min+"&slider1Max="+slider1Max+"&slider2Min="+slider2Min+"&slider2Max="+slider2Max+"&slider3Min="+slider3Min+"&slider3Max="+slider3Max+"&regionId="+regionId+"&regionName="+regionName+"&productId=14&city="+city;var ajaxUrl="/"+nameSpace+"/ajax/kyxHelper.html";var receiveReq=window.getXmlHttpRequestObject();if(receiveReq.readyState==4||receiveReq.readyState==0)
{receiveReq.open("POST",ajaxUrl,true);receiveReq.setRequestHeader("Content-Length",formParams.length);receiveReq.setRequestHeader("Content-Type","application/x-www-form-urlencoded");receiveReq.onreadystatechange=function()
{if(receiveReq.readyState==4)
{var response=receiveReq.responseText;var respArray=response.split("#");var result=new Array();var a=respArray[0];if(respArray[0]==""){return;}else
{a=a.replace(/\"\"\"\"/g,"\"\"");var resultFinal=eval("("+a+")");mobileServiceProviderComparatorResultTable(resultFinal,document.getElementById("city").value);var principalArray=respArray[7].substring(1);var principalArrayList=(document.getElementById("citySpecificPrincipals").value.split(","));var principalArrayList1=(principalArray.split(","));for(var i=0;i<principalArrayList.length;i++)
{if(document.getElementById(principalArrayList[i])!=null){if(!document.getElementById(principalArrayList[i]+"1").checked){document.getElementById(principalArrayList[i]+"1").disabled=true;document.getElementById(principalArrayList[i]).style.color="#CCCCCC";}}}
for(var j=0;j<principalArrayList1.length;j++)
{if(document.getElementById(principalArrayList1[j])!=null){document.getElementById(principalArrayList1[j]).style.color="#000000";document.getElementById(principalArrayList1[j]+"1").disabled=false;}}
return;}}};receiveReq.send(formParams);}}}
var mainDataArray=new Array();function mobileServiceProviderComparatorResultTable(resultFinal,cityId)
{document.getElementById('blockDiv').style.height="0%";document.getElementById('blockDiv').style.width="0%";document.getElementById("hint_msg").style.display="none";var j=0;var entries;var tableDiv=document.getElementById("tableBody");document.getElementById('userTotalResults').innerHTML='0';document.getElementById("totalResults").value=0;var tbl=document.getElementById("resultTable");var oldTBody=document.getElementById("resultBody");tbl.removeChild(oldTBody);var tblBody=document.createElement("tbody");tblBody.id="resultBody";if(resultFinal["4"].length>0){var row=document.createElement("tr");var cell=document.createElement("td");var cellText=document.createTextNode("");cell.innerHTML="  <strong>&nbsp;&nbsp;&nbsp;Full Results</strong>  </div></strong>";cell.colSpan="16";cell.style.backgroundImage="url(/images/mobile/cap-bg.gif)";cell.height="29px";cell.id="fullResultTd";cell.appendChild(cellText);row.appendChild(cell);tblBody.appendChild(row);}
for(var entry in resultFinal["4"])
{var row=document.createElement("tr");var cell=document.createElement("td");var cellText=document.createTextNode("");cell.innerHTML="<div style=\"height:5px\"></div><strong><img src=\""+resultFinal["4"][entry]["kyxValues"]['firstPagePrincipalImageUri']+"\" /><br/>"+resultFinal["4"][entry]['kyxValues']['policyName']+"<a style=\"cursor:pointer;font-size:9px;\" href=\"/mobile-connection-india/"+resultFinal["4"][entry]['kyxValues']['policyName']+"-"+resultFinal["4"][entry]['kyxValues']['policyId']+"-"+cityId+".html\" onclick=\"return dynamicSubmit('/mobile-connection-india/"+resultFinal["4"][entry]['kyxValues']['policyName']+"-"+resultFinal["4"][entry]['kyxValues']['policyId']+"-"+cityId+".html','POST','frmComparatorSearch');\"> <br/>(Compare Details) </a>";cell.style.backgroundColor="white";cell.rowSpan="3";cell.width="130px";cell.maxWidth="130px";cell.align="center";cell.id="f0_"+j;cell.appendChild(cellText);row.appendChild(cell);var cell=document.createElement("td");var cellText;if(parseInt(resultFinal["4"][entry]["kyxValues"]['monthlyChargeMinimumMonthlyBill'])>parseInt(resultFinal["4"][entry]["kyxValues"]['monthlyChargeRental'])){cellText=document.createTextNode(resultFinal["4"][entry]["kyxValues"]['monthlyChargeMinimumMonthlyBill']);}else{cellText=document.createTextNode(resultFinal["4"][entry]["kyxValues"]['monthlyChargeRental']);}
cell.rowSpan="3";cell.style.backgroundColor="#fef2fe";cell.width="60px";cell.align="center";cell.maxWidth="60px";cell.id="f1_"+j;cell.style.backgroundImage="url(/images/mobile/Premium-highlight.gif)";cell.style.backgroundPosition="center bottom";cell.style.backgroundRepeat="repeat-x";cell.appendChild(cellText);row.appendChild(cell);var cell=document.createElement("td");var cellText=document.createTextNode(resultFinal["4"][entry]["kyxValues"]['freebiesSameOperatorFreeTalkTimeMin']);cell.style.backgroundColor="#CACEE4";cell.width="24px";cell.maxWidth="24px";cell.id="f2_"+j;cell.height="41px";cell.align="center";cell.appendChild(cellText);row.appendChild(cell);var cell=document.createElement("td");var cellText=document.createTextNode(resultFinal["4"][entry]["kyxValues"]['freebiesAnyOperatorFreeTalkTimeMin']);cell.style.backgroundColor="#F4F5FC";cell.width="23px";cell.id="f3_"+j;cell.maxWidth="23px";cell.align="center";cell.appendChild(cellText);row.appendChild(cell);var cell=document.createElement("td");var cellText=document.createTextNode(resultFinal["4"][entry]["kyxValues"]['freeSmsInNumbersLocalSameOperator']);cell.style.backgroundColor="#CACEE4";cell.width="25px";cell.maxWidth="25px";cell.align="center";cell.id="f4_"+j;cell.appendChild(cellText);row.appendChild(cell);var cell=document.createElement("td");var cellText=document.createTextNode(resultFinal["4"][entry]["kyxValues"]['freeSmsInNumbersLocalAnyOperator']);cell.style.backgroundColor="#F4F5FC";cell.width="24px";cell.maxWidth="24px";cell.align="center";cell.id="f5_"+j;cell.appendChild(cellText);row.appendChild(cell);var cell=document.createElement("td");var cellText=document.createTextNode(resultFinal["4"][entry]["kyxValues"]['callChargesSameOperator']);cell.style.backgroundColor="#B6E1C4";cell.width="25px";cell.id="f6_"+j;cell.maxWidth="25px";cell.align="center";cell.appendChild(cellText);row.appendChild(cell);var cell=document.createElement("td");var cellText=document.createTextNode(resultFinal["4"][entry]["kyxValues"]['callChargesOtherOperator']);cell.style.backgroundColor="#F0FFF5";cell.width="24px";cell.maxWidth="24px";cell.align="center";cell.id="f7_"+j;cell.appendChild(cellText);row.appendChild(cell);var cell=document.createElement("td");var cellText=document.createTextNode(resultFinal["4"][entry]["kyxValues"]['callChargesLandline']);cell.style.backgroundColor="#B6E1C4";cell.width="25px";cell.maxWidth="25px";cell.id="f8_"+j;cell.align="center";cell.appendChild(cellText);row.appendChild(cell);var cell=document.createElement("td");var cellText=document.createTextNode(resultFinal["4"][entry]["kyxValues"]['smsChargesLocalSameOperator']);cell.style.backgroundColor="#CACEE4";cell.width="25px";cell.maxWidth="25px";cell.id="f9_"+j;cell.align="center";cell.appendChild(cellText);row.appendChild(cell);var cell=document.createElement("td");var cellText=document.createTextNode(resultFinal["4"][entry]["kyxValues"]['smsChargesLocalOtherOperator']);cell.style.backgroundColor="#F4F5FC";cell.width="25px";cell.maxWidth="2px";cell.align="center";cell.id="f10_"+j;cell.appendChild(cellText);row.appendChild(cell);var cell=document.createElement("td");var cellText=document.createTextNode(resultFinal["4"][entry]["kyxValues"]['smsChargesNational']);cell.style.backgroundColor="#CACEE4";cell.width="25px";cell.maxWidth="25px";cell.id="f11_"+j;cell.align="center";cell.appendChild(cellText);row.appendChild(cell);var cell=document.createElement("td");var cellText=document.createTextNode(resultFinal["4"][entry]["kyxValues"]['stdChargesSameOperator']);cell.style.backgroundColor="#B6E1C4";cell.width="25px";cell.maxWidth="25px";cell.align="center";cell.id="f12_"+j;cell.appendChild(cellText);row.appendChild(cell);var cell=document.createElement("td");var cellText=document.createTextNode(resultFinal["4"][entry]["kyxValues"]['stdChargesOtherOperator']);cell.style.backgroundColor="#F0FFF5";cell.width="24px";cell.maxWidth="24px";cell.align="center";cell.id="f13_"+j;cell.appendChild(cellText);row.appendChild(cell);var cell=document.createElement("td");var cellText=document.createTextNode(resultFinal["4"][entry]["kyxValues"]['stdChargesLandline']);cell.style.backgroundColor="#B6E1C4";cell.width="25px";cell.maxWidth="25px";cell.align="center";cell.id="f14_"+j;cell.appendChild(cellText);row.appendChild(cell);var cell=document.createElement("td");var str='';if(resultFinal["4"][entry]["kyxValues"]["relationType"]!="NONE"){if(resultFinal["4"][entry]["kyxValues"]["relationType"]=="GCD")
{str=str+'<input type="button" onclick=\'popKyxGPN({id:'+resultFinal["4"][entry]["kyxValues"]["policyId"]+', listType:"full", opos:'+entry+', imageUri:"'+resultFinal["4"][entry]["imageUri"]+'", principalName:"'+resultFinal["4"][entry]["kyxValues"]["principalName"]+'", principalId:"'+resultFinal["4"][entry]["kyxValues"]["principalId"]+'", isBank:';if(parseInt(resultFinal["4"][entry]['gcdOrderId'])==-1)
{str=str+'true,orderId:'+parseInt(resultFinal["4"][entry]["gcdOrderId"])+'}, this);\' value=""  id="updateResults" name="updateResults" class="buttonglobal"  style="width: 130px;background-image:url(\'/images/mobile/GPN-lavender.gif\')"/>';}else{str=str+'false,orderId:'+parseInt(resultFinal["4"][entry]["gcdOrderId"])+'}, this);\' value="" id="updateResults" name="updateResults" class="buttonglobal" style="width: 130px;background-image:url(\'/images/mobile/GPN-lavender.gif\')"/>';}}
else{str='';}}else{str="NA";}
var cellText=document.createTextNode("");cell.innerHTML=" <div align=\"center\">"+str+"</div>";cell.rowSpan="3";cell.style.backgroundColor="#FFFFFF";cell.width="130px";cell.maxWidth="130px";cell.align="center";cell.id="f15_"+j;cell.appendChild(cellText);row.appendChild(cell);tblBody.appendChild(row);var row=document.createElement("tr");var cell=document.createElement("td");var cellText=document.createTextNode("");cell.innerHTML=" <strong>Expert comments:</strong>"+resultFinal["4"][entry]["kyxValues"]["expertsComments"];cell.style.backgroundColor="#FCECFD";cell.colSpan="13";cell.width="320px";cell.height="20px";cell.maxHeight="20px";cell.maxWidth="320px";cell.id="f16_"+j;cell.appendChild(cellText);row.appendChild(cell);tblBody.appendChild(row);var row=document.createElement("tr");var cell=document.createElement("td");var cellText=document.createTextNode("");cell.innerHTML="<strong>Roaming Guide:</strong>"+resultFinal["4"][entry]["kyxValues"]["roamingExpertsComments"];cell.style.backgroundColor="#FCECFD";cell.setAttribute("align","left");cell.colSpan="13";cell.id="f17_"+j;cell.setAttribute("valign","top");cell.appendChild(cellText);cell.width="320px";cell.height="20px";cell.maxWidth="320px";cell.maxHeight="20px";row.appendChild(cell);tblBody.appendChild(row);tbl.style.backgroundColor="#b966b7";tbl.border="0";tbl.cellspacing="1";tbl.cellpadding="1";tbl.width="702";tbl.align="left";j++;document.getElementById("totalResultsSpan").innerText=j;document.getElementById("totalResults").value=j;document.getElementById('userTotalResults').innerHTML=""+j;document.getElementById("sampleResults").style.display="none";document.getElementById("userResults").style.display="block";}
if(document.getElementById("totalResults").value==0){document.getElementById('regionNameToShow').innerHTML="";}
tbl.appendChild(tblBody);var index=0;mainDataArray=new Array();sponsoredDataArray=[];for(var a in resultFinal["4"])
{if(parseInt(resultFinal["4"][a]["kyxValues"]['monthlyChargeMinimumMonthlyBill'])>parseInt(resultFinal["4"][a]["kyxValues"]['monthlyChargeRental'])){mainDataArray=mainDataArray.concat({offeringName:resultFinal["4"][a]["kyxValues"]['policyName'],monthlyRental:resultFinal["4"][a]["kyxValues"]['monthlyChargeMinimumMonthlyBill'],rowIndex:index});}else{mainDataArray=mainDataArray.concat({offeringName:resultFinal["4"][a]["kyxValues"]['policyName'],monthlyRental:resultFinal["4"][a]["kyxValues"]['monthlyChargeRental'],rowIndex:index});}
index++;}
flagAscDesc['offeringName']=false;flagAscDesc['monthlyRental']=false;sortTable('monthlyRental',resultFinal["4"].length,0,18);document.getElementById('processingResultsDiv').style.height=0;document.getElementById('processingResultsDiv').style.width=0;document.getElementById('processingResults').style.display="none";}
function CalculateValueForBackEvent()
{var allPrincipal=document.getElementById("allPrincipal").value;var iterator=allPrincipal.split(",");var valOld='';for(var i=0;i<iterator.length;i++)
{document.getElementById(iterator[i]).style.display='none';}
document.getElementById('processingResults').style.marginTop=(document.getElementById('resultTable').scrollTop+300);document.getElementById('processingResults').style.display="block";document.getElementById('processingResultsDiv').style.height=screen.height;document.getElementById('processingResultsDiv').style.width=screen.width;var formParams="";formParams+="id=21&city="+document.getElementById('cityId').value+"&flag=cityChange&productId=14";var ajaxUrl="/"+nameSpace+"/ajax/kyxHelper.html";var receiveReq=window.getXmlHttpRequestObject();if(receiveReq.readyState==4||receiveReq.readyState==0)
{receiveReq.open("POST",ajaxUrl,true);receiveReq.setRequestHeader("Content-Length",formParams.length);receiveReq.setRequestHeader("Content-Type","application/x-www-form-urlencoded");receiveReq.onreadystatechange=function()
{if(receiveReq.readyState==4)
{var response=receiveReq.responseText;var respArray=response.split("#");var principalArray=respArray[0].substring(1);var principalArrayList=(principalArray.split(","));var monthlyChargeRentalArrayDistinctmax=respArray[1];var monthlyChargeRentalArrayDistinctmin=respArray[2];if(monthlyChargeRentalArrayDistinctmax<=100||monthlyChargeRentalArrayDistinctmax==''||monthlyChargeRentalArrayDistinctmax==null)
{document.getElementById("slider1").style.display="none";}
else
{document.getElementById("slider1").style.display="block";document.getElementById("dd1").innerHTML="<span id=\"my-slider-1\" ></span>";if(monthlyChargeRentalArrayDistinctmax>1000){document.getElementById("dw1").value=1100;}else{document.getElementById("dw1").value=monthlyChargeRentalArrayDistinctmax;}
var limit1=monthlyChargeRentalArrayDistinctmax;document.getElementById("slider1Limit").value=limit1;(function(){var YUE=YAHOO.util.Event;var YUD=YAHOO.util.Dom;var YUC=YAHOO.util.CustomEvent;var isDrag=false;if(window.opera)
{YUD.addClass(document.documentElement,'borwser-opera');};var stopAction=function(e)
{YUE.stopEvent(e);return false;};var setValue=function(nFrom,nTo,dFromBtn,bNotChangePosition)
{var nOldFrom=this.from;var nOldTo=this.to;var sElementId=this.id;var dEl=document.getElementById(sElementId);var dBox=document.getElementById(sElementId+'-box');var dC0=document.getElementById(sElementId+'-ctrl-0');var dC1=document.getElementById(sElementId+'-ctrl-1');var dC2=document.getElementById(sElementId+'-ctrl-2');var dLn1=document.getElementById(sElementId+'-line-1');var nSliderWidth=dBox.offsetWidth;var nf=Math.min(nTo,Math.max(0,nFrom));var nt=Math.min(limit1,Math.max(nFrom,nTo));if(isNaN(nf)){nf=0};if(isNaN(nt)){nf=limit1};nf=Math.round(nf);nt=Math.round(nt);this.from=nf;this.to=nt;if(!bNotChangePosition)
{var nX1=(nSliderWidth*(this.from/limit1));var nX2=(nSliderWidth*(this.to/limit1))-dC2.offsetWidth;if(dFromBtn==dC1)
{dC1.style.left=nX1+'px';}
else if(dFromBtn==dC2)
{dC2.style.left=nX2+'px';}
else
{dC1.style.left=nX1+'px';dC2.style.left=nX2+'px';};var nLeft=parseInt(dC1.style.left)-1;var nRight=parseInt(dC2.style.left)+dC2.offsetWidth-1;dC0.style.left=dC1.style.left;dC0.style.width=nRight-nLeft+'px';};if(!!(nOldFrom-nf)||!!(nOldTo-nt))
{this.onChange.fire(nf,nt);};return[nX1,nX2];};var onMouseDown=function(e,oSelf)
{var dBtn=this;var sElementId=oSelf.id;var dEl=document.getElementById(sElementId);var dBox=document.getElementById(sElementId+'-box');var dC0=document.getElementById(sElementId+'-ctrl-0');var dC1=document.getElementById(sElementId+'-ctrl-1');var dC2=document.getElementById(sElementId+'-ctrl-2');var dLn1=document.getElementById(sElementId+'-line-1');var nSliderWidth=dBox.offsetWidth;var nOffsetLeft=YUD.getX(dBox)||YUD.getX(dEl);var nlimit1Left=0;var nlimit1Right=nSliderWidth-dBtn.offsetWidth;var nSliderWidth=nSliderWidth;if(dBtn.className=='ctrl-2')
{nlimit1Left=parseInt(dC1.style.left)+dC1.offsetWidth;}
else
{nlimit1Right=parseInt(dC2.style.left)-dC1.offsetWidth;};var onMouseUp=function(e)
{YUE.stopEvent(e);YUE.removeListener(document,'mousemove',onMouseMove);YUE.removeListener(document,'mouseup',onMouseUp);isDrag=false;oSelf.onMouseUp.fire(e);return false;};var onMouseMove=function(e)
{var nEx=e.clientX-nOffsetLeft;if(!isDrag)
{onMouseUp.call(document,e,aArg);return;};nEx=Math.max(nlimit1Left,nEx);nEx=Math.min(nEx,nlimit1Right);if(dBtn==dC1)
{oSelf.from=Math.abs((nEx/(nSliderWidth-dC1.offsetWidth-dC2.offsetWidth))*limit1);}
else
{oSelf.to=Math.abs((nEx/(nSliderWidth-dC1.offsetWidth-dC2.offsetWidth))*limit1);};if(Math.abs(oSelf.from-oSelf.to)<=3)
{oSelf.from=oSelf.to};setValue.call(oSelf,oSelf.from,oSelf.to,dBtn,true);if(dBtn==dC1)
{dBtn.style.left=nEx+'px';var nLeft=parseInt(dC1.style.left)-1;var nRight=parseInt(dC2.style.left)+dC2.offsetWidth-1;dC0.style.left=dC1.style.left;dC0.style.width=nRight-nLeft+'px';}
else
{dBtn.style.left=nEx+'px';var nLeft=parseInt(dC1.style.left)-1;var nRight=parseInt(dC2.style.left)+dC2.offsetWidth-1;dC0.style.left=dC1.style.left;dC0.style.width=nRight-nLeft+'px';};YUE.stopEvent(e);oSelf.onSlide.fire(e,oSelf.from,oSelf.to);return false;};YUE.on(document,'mousemove',onMouseMove);YUE.on(document,'mouseup',onMouseUp);isDrag=true;YUE.stopEvent(e);oSelf.onMouseDown.fire(e);return false;};var onMouseDownOnBackground=function(e,oSelf)
{var sElementId=oSelf.id;var dBox=document.getElementById(sElementId+'-box');var dC0=this;var dC1=document.getElementById(sElementId+'-ctrl-1');var dC2=document.getElementById(sElementId+'-ctrl-2');var dLn1=document.getElementById(sElementId+'-line-1');var nSliderWidth=dBox.parentNode.offsetWidth||dBox.offsetWidth;var nAvailRangeWidth=nSliderWidth-dC1.offsetWidth-dC2.offsetWidth;var nOffsetLeft=YUD.getX(dBox);var ndC0Width=dC0.offsetWidth;var ndC2Width=dC2.offsetWidth;var nlimit1Right=nSliderWidth-ndC0Width;var nMouseDownX=e.clientX-YUD.getX(dC0);var nRange=oSelf.to-oSelf.from;var onMouseMove=function(e)
{if(!isDrag)
{onMouseUp.call(document,e);return;};var nEx=Math.max(0,e.clientX-nOffsetLeft-nMouseDownX);if(nEx<nlimit1Right)
{var nTo=Math.min(limit1,Math.round(((nEx+ndC0Width)/nAvailRangeWidth)*limit1));var nFrom=nTo-nRange;setValue.call(oSelf,nFrom,nTo,null,true);dC0.style.left=nEx+'px';dC0.style.width=ndC0Width+'px';dC2.style.left=nEx+ndC0Width-ndC2Width+1+'px';}
else
{dC0.style.left=nlimit1Right+'px';dC0.style.width=ndC0Width+'px';dC2.style.left=nlimit1Right+ndC0Width-ndC2Width+1+'px';};dC1.style.left=dC0.style.left;oSelf.onSlide.fire(e,oSelf.from,oSelf.to);};var onMouseUp=function(e)
{YUE.removeListener(document,'mousemove',onMouseMove);YUE.removeListener(document,'mouseup',onMouseUp);isDrag=false;};YUE.on(document,'mousemove',onMouseMove);YUE.on(document,'mouseup',onMouseUp);isDrag=true;YUE.stopEvent(e);oSelf.onMouseDown.fire(e);return false;};YAHOO.widget.RangeSlider1=function(sElementId,oAttr){var oSelf=this;oSelf.onMouseDown=new YUC('mousedown');oSelf.onMouseUp=new YUC('mouseup');oSelf.onSlide=new YUC('slide');oSelf.onLoad=new YUC('load');oSelf.onChange=new YUC('change');if(typeof(oAttr)!='object')
{oAttr={};};var init=function()
{var dEl=this;dEl.className='yui-range-slider';if(dEl.tagName!='SPAN')
{throw Error('YAHOO.widget.RangeSlider1 Error: \n Element['+sElementId+']\'s tagName is not SPAN');return;};oSelf.type=(YUD.hasClass(dEl,'yui-range-slider-v'))?2:1;YUD.addClass(dEl,'yui-range-slider yui-range-slider-'+oSelf.type);var sTagName=window.opera?'span':'button';dEl.innerHTML=['<span class="s-hd">','<span class="s-line-1" id="',sElementId,'-line-1"></span>','<',sTagName,' class="ctrl-0" id="',sElementId,'-ctrl-0" ></',sTagName,'>','<button  id="',sElementId,'-ctrl-1" class="ctrl-1">&nbsp;</button>','<button   id="',sElementId,'-ctrl-2" class="ctrl-2">&nbsp;</button>','</span>','<',sTagName,' hidefocus="hidefocus" class="s-bd" id="',sElementId,'-box" >&nbsp;</',sTagName,'>',].join('');var dBox=document.getElementById(sElementId+'-box');dBox.style.width=(oAttr.width||200)+'px';dBox.style.height=(oAttr.height||23)+'px';var dC0=document.getElementById(sElementId+'-ctrl-0');var dC1=document.getElementById(sElementId+'-ctrl-1');var dC2=document.getElementById(sElementId+'-ctrl-2');var dLn1=document.getElementById(sElementId+'-line-1');var nSliderWidth=dBox.offsetWidth;dLn1.style.width=parseInt(dBox.style.width)-4+'px';dC0.style.height=dC1.style.height=dC2.style.height=(parseInt(dBox.style.height)-4)+'px';dLn1.style.top=(oAttr.height||23)/2+'px';YUE.on(dC1,'mousedown',onMouseDown,oSelf);YUE.on(dC2,'mousedown',onMouseDown,oSelf);YUE.on(dC0,'mousedown',stopAction);YUE.on(dEl,'selectstart',stopAction);YUE.on(dBox,'mousedown',stopAction);setValue.call(oSelf,oSelf.from,oSelf.to);oSelf.readyState='complete';oSelf.onLoad.fire();};this.id=sElementId;YUE.onAvailable(sElementId,init);};YAHOO.widget.RangeSlider1.prototype={id:'',readyState:'uninitialized',type:1,from:10,to:90,setValue:function(nFrom,nTo)
{var oSelf=this;nFrom=isNaN(nFrom)?0:(nFrom||0);nTo=isNaN(nTo)?limit1:(nTo||limit1);nFrom=Math.max(0,nFrom);nTo=Math.min(limit1,nTo);nFrom=Math.min(nFrom,nTo);var fAction=function()
{setValue.call(oSelf,nFrom,nTo);};if(oSelf.readyState!='complete')
{oSelf.onLoad.subscribe(fAction);}
else
{fAction();};},getValue:function()
{return[this.from,this.to];},getElement:function()
{return document.getElementById(this.id);}};})();var oMS3=new YAHOO.widget.RangeSlider1('my-slider-1',{width:230,height:24});if(document.getElementById("firstActionSliderOrPrincipal").value!="slider"){oMS3.setValue(0,limit1);}else{oMS3.setValue(slider1Min,slider1Max);}
var onMS1Slide=function(sType)
{var aData2=this.getValue();if(typeof(this.oldData02)=='undefined')this.oldData02=aData2[0];if(typeof(this.oldData12)=='undefined')this.oldData12=aData2[1];if(aData2[0]!=this.oldData02)
{if(aData2[0]-this.oldData02<=0)
{aData2=this.getValue();this.oldData02=aData2[0];this.oldData12=aData2[1];var oldUpper=this.oldData02;oldUpper=Math.round(oldUpper/100);oldUpper=oldUpper-1;oldUpper=oldUpper*100;oMS3.setValue(oldUpper,this.oldData12);}else
{aData2=this.getValue();this.oldData02=aData2[0];this.oldData12=aData2[1];var oldUpper=this.oldData02;oldUpper=Math.round(oldUpper/100);if(((this.oldData12-this.oldData02)<100)){if(((this.oldData12-this.oldData02)==0)||(((this.oldData12-this.oldData02)<100)&&((this.oldData12-this.oldData02)>0))){oldUpper=oldUpper-1;}else{oldUpper=oldUpper+1;}}
oldUpper=oldUpper*100;oMS3.setValue(oldUpper,this.oldData12);}}
if(aData2[1]!=this.oldData12)
{if(aData2[1]-this.oldData12<=0)
{aData2=this.getValue();this.oldData02=aData2[0];this.oldData12=aData2[1];var oldLower=this.oldData12;oldLower=Math.round(oldLower/100);if(((this.oldData12-this.oldData02)<100)){if(((this.oldData12-this.oldData02)==0)||(((this.oldData12-this.oldData02)<100)&&((this.oldData12-this.oldData02)>0))){oldLower=oldLower+1;}else{oldLower=oldLower-1;}}
oldLower=oldLower*100;oMS3.setValue(this.oldData02,oldLower);}else
{aData2=this.getValue();this.oldData02=aData2[0];this.oldData12=aData2[1];var oldLower=this.oldData12;oldLower=Math.round(oldLower/100);oldLower=oldLower+1;oldLower=oldLower*100;oMS3.setValue(this.oldData02,oldLower);}}
document.getElementById('slider1Min').value=this.oldData02;document.getElementById('slider1Max').value=this.oldData12;aData2=this.getValue();this.oldData02=aData2[0];this.oldData12=aData2[1];oMS3.setValue(this.oldData02,this.oldData12);if(aData2[0]!=document.getElementById('slider1Min').value||aData2[1]!=document.getElementById('slider1Max').value)
{calculateValueForsliderEvent(21,document.getElementById("principalIdsForSliderChange").value,this.oldData02,this.oldData12,document.getElementById("slider2Min").value,document.getElementById("slider2Max").value,document.getElementById("slider3Min").value,document.getElementById("slider3Max").values,document.getElementById("regionId").value,document.getElementById("regionName").value,document.getElementById("city").value);document.getElementById('slider1Min').value=this.oldData02;document.getElementById('slider1Max').value=this.oldData12;if(this.oldData12>1000){document.getElementById('d1').innerHTML=this.oldData02+' - '+'1000+';}else{document.getElementById('d1').innerHTML=this.oldData02+' - '+this.oldData12;}
return;}
document.getElementById('slider1Min').value=this.oldData02;document.getElementById('slider1Max').value=this.oldData12;if(this.oldData12>1000){document.getElementById('d1').innerHTML=this.oldData02+' - '+'1000+';}else{document.getElementById('d1').innerHTML=this.oldData02+' - '+this.oldData12;}};oMS3.onLoad.subscribe(onMS1Slide,oMS3,true);oMS3.onMouseUp.subscribe(onMS1Slide,oMS3,true);}
if(respArray[3]=='ULTD'||respArray[3]=='Ultd'||respArray[4]=='ULTD'||respArray[4]=='Ultd')
{var freebiesSameOperatorFreeTalkTimeMinArrayDistinctmax=1100;var freebiesSameOperatorFreeTalkTimeMinArrayDistinctmin=respArray[4];}
else
{var freebiesSameOperatorFreeTalkTimeMinArrayDistinctmax=respArray[3];var freebiesSameOperatorFreeTalkTimeMinArrayDistinctmin=respArray[4];}
if(freebiesSameOperatorFreeTalkTimeMinArrayDistinctmax=="ULTD"||freebiesSameOperatorFreeTalkTimeMinArrayDistinctmax=="Ultd"){freebiesSameOperatorFreeTalkTimeMinArrayDistinctmax=1100;}
if(freebiesSameOperatorFreeTalkTimeMinArrayDistinctmax<=100||freebiesSameOperatorFreeTalkTimeMinArrayDistinctmax==NaN||freebiesSameOperatorFreeTalkTimeMinArrayDistinctmax==''){document.getElementById("slider2").style.display="none";}else{document.getElementById("slider2").style.display="block";document.getElementById("dd2").innerHTML="<span id=\"my-slider-2\" ></span>";var limit2=freebiesSameOperatorFreeTalkTimeMinArrayDistinctmax;document.getElementById("slider2Limit").value=limit2;(function(){var YUE=YAHOO.util.Event;var YUD=YAHOO.util.Dom;var YUC=YAHOO.util.CustomEvent;var isDrag=false;if(window.opera)
{YUD.addClass(document.documentElement,'borwser-opera');};var stopAction=function(e)
{YUE.stopEvent(e);return false;};var setValue=function(nFrom,nTo,dFromBtn,bNotChangePosition)
{var nOldFrom=this.from;var nOldTo=this.to;var sElementId=this.id;var dEl=document.getElementById(sElementId);var dBox=document.getElementById(sElementId+'-box');var dC0=document.getElementById(sElementId+'-ctrl-0');var dC1=document.getElementById(sElementId+'-ctrl-1');var dC2=document.getElementById(sElementId+'-ctrl-2');var dLn1=document.getElementById(sElementId+'-line-1');var nSliderWidth=dBox.offsetWidth;var nf=Math.min(nTo,Math.max(0,nFrom));var nt=Math.min(limit2,Math.max(nFrom,nTo));if(isNaN(nf)){nf=0};if(isNaN(nt)){nf=limit2};nf=Math.round(nf);nt=Math.round(nt);this.from=nf;this.to=nt;if(!bNotChangePosition)
{var nX1=(nSliderWidth*(this.from/limit2));var nX2=(nSliderWidth*(this.to/limit2))-dC2.offsetWidth;if(dFromBtn==dC1)
{dC1.style.left=nX1+'px';}
else if(dFromBtn==dC2)
{dC2.style.left=nX2+'px';}
else
{dC1.style.left=nX1+'px';dC2.style.left=nX2+'px';};var nLeft=parseInt(dC1.style.left)-1;var nRight=parseInt(dC2.style.left)+dC2.offsetWidth-1;dC0.style.left=dC1.style.left;dC0.style.width=nRight-nLeft+'px';};if(!!(nOldFrom-nf)||!!(nOldTo-nt))
{this.onChange.fire(nf,nt);};return[nX1,nX2];};var onMouseDown=function(e,oSelf)
{var dBtn=this;var sElementId=oSelf.id;var dEl=document.getElementById(sElementId);var dBox=document.getElementById(sElementId+'-box');var dC0=document.getElementById(sElementId+'-ctrl-0');var dC1=document.getElementById(sElementId+'-ctrl-1');var dC2=document.getElementById(sElementId+'-ctrl-2');var dLn1=document.getElementById(sElementId+'-line-1');var nSliderWidth=dBox.offsetWidth;var nOffsetLeft=YUD.getX(dBox)||YUD.getX(dEl);var nlimit2Left=0;var nlimit2Right=nSliderWidth-dBtn.offsetWidth;var nSliderWidth=nSliderWidth;if(dBtn.className=='ctrl-2')
{nlimit2Left=parseInt(dC1.style.left)+dC1.offsetWidth;}
else
{nlimit2Right=parseInt(dC2.style.left)-dC1.offsetWidth;};var onMouseUp=function(e)
{YUE.stopEvent(e);YUE.removeListener(document,'mousemove',onMouseMove);YUE.removeListener(document,'mouseup',onMouseUp);isDrag=false;oSelf.onMouseUp.fire(e);return false;};var onMouseMove=function(e)
{var nEx=e.clientX-nOffsetLeft;if(!isDrag)
{onMouseUp.call(document,e,aArg);return;};nEx=Math.max(nlimit2Left,nEx);nEx=Math.min(nEx,nlimit2Right);if(dBtn==dC1)
{oSelf.from=Math.abs((nEx/(nSliderWidth-dC1.offsetWidth-dC2.offsetWidth))*limit2);}
else
{oSelf.to=Math.abs((nEx/(nSliderWidth-dC1.offsetWidth-dC2.offsetWidth))*limit2);};if(Math.abs(oSelf.from-oSelf.to)<=3)
{oSelf.from=oSelf.to};setValue.call(oSelf,oSelf.from,oSelf.to,dBtn,true);if(dBtn==dC1)
{dBtn.style.left=nEx+'px';var nLeft=parseInt(dC1.style.left)-1;var nRight=parseInt(dC2.style.left)+dC2.offsetWidth-1;dC0.style.left=dC1.style.left;dC0.style.width=nRight-nLeft+'px';}
else
{dBtn.style.left=nEx+'px';var nLeft=parseInt(dC1.style.left)-1;var nRight=parseInt(dC2.style.left)+dC2.offsetWidth-1;dC0.style.left=dC1.style.left;dC0.style.width=nRight-nLeft+'px';};YUE.stopEvent(e);oSelf.onSlide.fire(e,oSelf.from,oSelf.to);return false;};YUE.on(document,'mousemove',onMouseMove);YUE.on(document,'mouseup',onMouseUp);isDrag=true;YUE.stopEvent(e);oSelf.onMouseDown.fire(e);return false;};var onMouseDownOnBackground=function(e,oSelf)
{var sElementId=oSelf.id;var dBox=document.getElementById(sElementId+'-box');var dC0=this;var dC1=document.getElementById(sElementId+'-ctrl-1');var dC2=document.getElementById(sElementId+'-ctrl-2');var dLn1=document.getElementById(sElementId+'-line-1');var nSliderWidth=dBox.parentNode.offsetWidth||dBox.offsetWidth;var nAvailRangeWidth=nSliderWidth-dC1.offsetWidth-dC2.offsetWidth;var nOffsetLeft=YUD.getX(dBox);var ndC0Width=dC0.offsetWidth;var ndC2Width=dC2.offsetWidth;var nlimit2Right=nSliderWidth-ndC0Width;var nMouseDownX=e.clientX-YUD.getX(dC0);var nRange=oSelf.to-oSelf.from;var onMouseMove=function(e)
{if(!isDrag)
{onMouseUp.call(document,e);return;};var nEx=Math.max(0,e.clientX-nOffsetLeft-nMouseDownX);if(nEx<nlimit2Right)
{var nTo=Math.min(limit2,Math.round(((nEx+ndC0Width)/nAvailRangeWidth)*limit2));var nFrom=nTo-nRange;setValue.call(oSelf,nFrom,nTo,null,true);dC0.style.left=nEx+'px';dC0.style.width=ndC0Width+'px';dC2.style.left=nEx+ndC0Width-ndC2Width+1+'px';}
else
{dC0.style.left=nlimit2Right+'px';dC0.style.width=ndC0Width+'px';dC2.style.left=nlimit2Right+ndC0Width-ndC2Width+1+'px';};dC1.style.left=dC0.style.left;oSelf.onSlide.fire(e,oSelf.from,oSelf.to);};var onMouseUp=function(e)
{YUE.removeListener(document,'mousemove',onMouseMove);YUE.removeListener(document,'mouseup',onMouseUp);isDrag=false;};YUE.on(document,'mousemove',onMouseMove);YUE.on(document,'mouseup',onMouseUp);isDrag=true;YUE.stopEvent(e);oSelf.onMouseDown.fire(e);return false;};YAHOO.widget.RangeSlider2=function(sElementId,oAttr)
{var oSelf=this;oSelf.onMouseDown=new YUC('mousedown');oSelf.onMouseUp=new YUC('mouseup');oSelf.onSlide=new YUC('slide');oSelf.onLoad=new YUC('load');oSelf.onChange=new YUC('change');if(typeof(oAttr)!='object')
{oAttr={};};var init=function()
{var dEl=this;dEl.className='yui-range-slider';if(dEl.tagName!='SPAN')
{throw Error('YAHOO.widget.RangeSlider2 Error: \n Element['+sElementId+']\'s tagName is not SPAN');return;};oSelf.type=(YUD.hasClass(dEl,'yui-range-slider-v'))?2:1;YUD.addClass(dEl,'yui-range-slider yui-range-slider-'+oSelf.type);var sTagName=window.opera?'span':'button';dEl.innerHTML=['<span class="s-hd">','<span class="s-line-1" id="',sElementId,'-line-1"></span>','<',sTagName,' class="ctrl-0" id="',sElementId,'-ctrl-0" ></',sTagName,'>','<button  id="',sElementId,'-ctrl-1" class="ctrl-1">&nbsp;</button>','<button   id="',sElementId,'-ctrl-2" class="ctrl-2">&nbsp;</button>','</span>','<',sTagName,' hidefocus="hidefocus" class="s-bd" id="',sElementId,'-box" >&nbsp;</',sTagName,'>',].join('');var dBox=document.getElementById(sElementId+'-box');dBox.style.width=(oAttr.width||200)+'px';dBox.style.height=(oAttr.height||23)+'px';var dC0=document.getElementById(sElementId+'-ctrl-0');var dC1=document.getElementById(sElementId+'-ctrl-1');var dC2=document.getElementById(sElementId+'-ctrl-2');var dLn1=document.getElementById(sElementId+'-line-1');var nSliderWidth=dBox.offsetWidth;dLn1.style.width=parseInt(dBox.style.width)-4+'px';dC0.style.height=dC1.style.height=dC2.style.height=(parseInt(dBox.style.height)-4)+'px';dLn1.style.top=(oAttr.height||23)/2+'px';YUE.on(dC1,'mousedown',onMouseDown,oSelf);YUE.on(dC2,'mousedown',onMouseDown,oSelf);YUE.on(dC0,'mousedown',stopAction);YUE.on(dEl,'selectstart',stopAction);YUE.on(dBox,'mousedown',stopAction);setValue.call(oSelf,oSelf.from,oSelf.to);oSelf.readyState='complete';oSelf.onLoad.fire();};this.id=sElementId;YUE.onAvailable(sElementId,init);};YAHOO.widget.RangeSlider2.prototype={id:'',readyState:'uninitialized',type:1,from:10,to:90,setValue:function(nFrom,nTo)
{var oSelf=this;nFrom=isNaN(nFrom)?0:(nFrom||0);nTo=isNaN(nTo)?limit2:(nTo||limit2);nFrom=Math.max(0,nFrom);nTo=Math.min(limit2,nTo);nFrom=Math.min(nFrom,nTo);var fAction=function()
{setValue.call(oSelf,nFrom,nTo);};if(oSelf.readyState!='complete')
{oSelf.onLoad.subscribe(fAction);}
else
{fAction();};},getValue:function()
{return[this.from,this.to];},getElement:function()
{return document.getElementById(this.id);}};})();var oMS2=new YAHOO.widget.RangeSlider2('my-slider-2',{width:230,height:24});if(document.getElementById("firstActionSliderOrPrincipal").value!="slider"){oMS2.setValue(0,limit2);}else{oMS2.setValue(slider2Min,slider2Max);}
var onMS1Slide=function(sType)
{var aData1=this.getValue();if(typeof(this.oldData01)=='undefined')this.oldData01=aData1[0];if(typeof(this.oldData11)=='undefined')this.oldData11=aData1[1];if(aData1[0]!=this.oldData01)
{if(aData1[0]-this.oldData01<=0)
{aData1=this.getValue();this.oldData01=aData1[0];this.oldData11=aData1[1];var oldUpper=this.oldData01;oldUpper=Math.round(oldUpper/100);oldUpper=oldUpper-1;oldUpper=oldUpper*100;oMS2.setValue(oldUpper,this.oldData11);}
else
{aData1=this.getValue();this.oldData01=aData1[0];this.oldData11=aData1[1];var oldUpper=this.oldData01;oldUpper=Math.round(oldUpper/100);if(((this.oldData11-this.oldData01)<100)){if(((this.oldData11-this.oldData01)==0)||(((this.oldData11-this.oldData01)<100)&&((this.oldData11-this.oldData01)>0))){oldUpper=oldUpper-1;}else{oldUpper=oldUpper+1;}}
oldUpper=oldUpper*100;oMS2.setValue(oldUpper,this.oldData11);}}
if(aData1[1]!=this.oldData11)
{if(aData1[1]-this.oldData11<=0)
{aData1=this.getValue();this.oldData01=aData1[0];this.oldData11=aData1[1];var oldLower=this.oldData11;oldLower=Math.round(oldLower/100);if(((this.oldData11-this.oldData01)<100)){if(((this.oldData11-this.oldData01)==0)||(((this.oldData11-this.oldData01)<100)&&((this.oldData11-this.oldData01)>0))){oldLower=oldLower+1;}else{oldLower=oldLower-1;}}
oldLower=oldLower*100;oMS2.setValue(this.oldData01,oldLower);}else
{aData1=this.getValue();this.oldData01=aData1[0];this.oldData11=aData1[1];var oldLower=this.oldData11;oldLower=Math.round(oldLower/100);oldLower=oldLower+1;oldLower=oldLower*100;oMS2.setValue(this.oldData01,oldLower);}}
document.getElementById('slider2Min').value=this.oldData01;document.getElementById('slider2Max').value=this.oldData11;aData1=this.getValue();this.oldData01=aData1[0];this.oldData11=aData1[1];if(document.getElementById('slider2Min').value!=aData1[0]||document.getElementById('slider2Max').value!=aData1[1])
{calculateValueForsliderEvent(21,document.getElementById("principalIdsForSliderChange").value,document.getElementById("slider1Min").value,document.getElementById("slider1Max").value,this.oldData01,this.oldData11,document.getElementById("slider3Min").value,document.getElementById("slider3Max").value,document.getElementById("regionId").value,document.getElementById("regionName").value,document.getElementById("city").value);document.getElementById('slider2Min').value=this.oldData01;document.getElementById('slider2Max').value=this.oldData11;if(this.oldData11>1000){document.getElementById('d2').innerHTML=this.oldData01+' - '+'1000+';}else{document.getElementById('d2').innerHTML=this.oldData01+' - '+this.oldData11;}}
oMS2.setValue(this.oldData01,this.oldData11);document.getElementById('slider2Min').value=this.oldData01;document.getElementById('slider2Max').value=this.oldData11;if(this.oldData11>1000){document.getElementById('d2').innerHTML=this.oldData01+' - '+'1000+';}else{document.getElementById('d2').innerHTML=this.oldData01+' - '+this.oldData11;}};oMS2.onLoad.subscribe(onMS1Slide,oMS2,true);oMS2.onMouseUp.subscribe(onMS1Slide,oMS2,true);}
if(freebiesSameOperatorFreeTalkTimeMinArrayDistinctmax>1000){document.getElementById("dw2").value=1100;}else{document.getElementById("dw2").value=freebiesSameOperatorFreeTalkTimeMinArrayDistinctmax;}
var freeSmsInNumbersLocalSameOperatorArrayDistinctmax=respArray[5];var freeSmsInNumbersLocalSameOperatorArrayDistinctmin=respArray[6];if(freeSmsInNumbersLocalSameOperatorArrayDistinctmax<=100||freeSmsInNumbersLocalSameOperatorArrayDistinctmax==''||freeSmsInNumbersLocalSameOperatorArrayDistinctmax==NaN){document.getElementById("slider3").style.display="none";}else{document.getElementById("slider3").style.display="block";document.getElementById("dd3").innerHTML="<span id=\"my-slider-3\" ></span>";var limit3=freeSmsInNumbersLocalSameOperatorArrayDistinctmax;document.getElementById("slider3Limit").value=limit3;(function(){var YUE=YAHOO.util.Event;var YUD=YAHOO.util.Dom;var YUC=YAHOO.util.CustomEvent;var isDrag=false;if(window.opera)
{YUD.addClass(document.documentElement,'borwser-opera');};var stopAction=function(e)
{YUE.stopEvent(e);return false;};var setValue=function(nFrom,nTo,dFromBtn,bNotChangePosition)
{var nOldFrom=this.from;var nOldTo=this.to;var sElementId=this.id;var dEl=document.getElementById(sElementId);var dBox=document.getElementById(sElementId+'-box');var dC0=document.getElementById(sElementId+'-ctrl-0');var dC1=document.getElementById(sElementId+'-ctrl-1');var dC2=document.getElementById(sElementId+'-ctrl-2');var dLn1=document.getElementById(sElementId+'-line-1');var nSliderWidth=dBox.offsetWidth;var nf=Math.min(nTo,Math.max(0,nFrom));var nt=Math.min(limit3,Math.max(nFrom,nTo));if(isNaN(nf)){nf=0};if(isNaN(nt)){nf=limit3};nf=Math.round(nf);nt=Math.round(nt);this.from=nf;this.to=nt;if(!bNotChangePosition)
{var nX1=(nSliderWidth*(this.from/limit3));var nX2=(nSliderWidth*(this.to/limit3))-dC2.offsetWidth;if(dFromBtn==dC1)
{dC1.style.left=nX1+'px';}
else if(dFromBtn==dC2)
{dC2.style.left=nX2+'px';}
else
{dC1.style.left=nX1+'px';dC2.style.left=nX2+'px';};var nLeft=parseInt(dC1.style.left)-1;var nRight=parseInt(dC2.style.left)+dC2.offsetWidth-1;dC0.style.left=dC1.style.left;dC0.style.width=nRight-nLeft+'px';};if(!!(nOldFrom-nf)||!!(nOldTo-nt))
{this.onChange.fire(nf,nt);};return[nX1,nX2];};var onMouseDown=function(e,oSelf)
{var dBtn=this;var sElementId=oSelf.id;var dEl=document.getElementById(sElementId);var dBox=document.getElementById(sElementId+'-box');var dC0=document.getElementById(sElementId+'-ctrl-0');var dC1=document.getElementById(sElementId+'-ctrl-1');var dC2=document.getElementById(sElementId+'-ctrl-2');var dLn1=document.getElementById(sElementId+'-line-1');var nSliderWidth=dBox.offsetWidth;var nOffsetLeft=YUD.getX(dBox)||YUD.getX(dEl);var nlimit3Left=0;var nlimit3Right=nSliderWidth-dBtn.offsetWidth;var nSliderWidth=nSliderWidth;if(dBtn.className=='ctrl-2')
{nlimit3Left=parseInt(dC1.style.left)+dC1.offsetWidth;}
else
{nlimit3Right=parseInt(dC2.style.left)-dC1.offsetWidth;};var onMouseUp=function(e)
{YUE.stopEvent(e);YUE.removeListener(document,'mousemove',onMouseMove);YUE.removeListener(document,'mouseup',onMouseUp);isDrag=false;oSelf.onMouseUp.fire(e);return false;};var onMouseMove=function(e)
{var nEx=e.clientX-nOffsetLeft;if(!isDrag)
{onMouseUp.call(document,e,aArg);return;};nEx=Math.max(nlimit3Left,nEx);nEx=Math.min(nEx,nlimit3Right);if(dBtn==dC1)
{oSelf.from=Math.abs((nEx/(nSliderWidth-dC1.offsetWidth-dC2.offsetWidth))*limit3);}
else
{oSelf.to=Math.abs((nEx/(nSliderWidth-dC1.offsetWidth-dC2.offsetWidth))*limit3);};if(Math.abs(oSelf.from-oSelf.to)<=3)
{oSelf.from=oSelf.to};setValue.call(oSelf,oSelf.from,oSelf.to,dBtn,true);if(dBtn==dC1)
{dBtn.style.left=nEx+'px';var nLeft=parseInt(dC1.style.left)-1;var nRight=parseInt(dC2.style.left)+dC2.offsetWidth-1;dC0.style.left=dC1.style.left;dC0.style.width=nRight-nLeft+'px';}
else
{dBtn.style.left=nEx+'px';var nLeft=parseInt(dC1.style.left)-1;var nRight=parseInt(dC2.style.left)+dC2.offsetWidth-1;dC0.style.left=dC1.style.left;dC0.style.width=nRight-nLeft+'px';};YUE.stopEvent(e);oSelf.onSlide.fire(e,oSelf.from,oSelf.to);return false;};YUE.on(document,'mousemove',onMouseMove);YUE.on(document,'mouseup',onMouseUp);isDrag=true;YUE.stopEvent(e);oSelf.onMouseDown.fire(e);return false;};var onMouseDownOnBackground=function(e,oSelf)
{var sElementId=oSelf.id;var dBox=document.getElementById(sElementId+'-box');var dC0=this;var dC1=document.getElementById(sElementId+'-ctrl-1');var dC2=document.getElementById(sElementId+'-ctrl-2');var dLn1=document.getElementById(sElementId+'-line-1');var nSliderWidth=dBox.parentNode.offsetWidth||dBox.offsetWidth;var nAvailRangeWidth=nSliderWidth-dC1.offsetWidth-dC2.offsetWidth;var nOffsetLeft=YUD.getX(dBox);var ndC0Width=dC0.offsetWidth;var ndC2Width=dC2.offsetWidth;var nlimit3Right=nSliderWidth-ndC0Width;var nMouseDownX=e.clientX-YUD.getX(dC0);var nRange=oSelf.to-oSelf.from;var onMouseMove=function(e)
{if(!isDrag)
{onMouseUp.call(document,e);return;};var nEx=Math.max(0,e.clientX-nOffsetLeft-nMouseDownX);if(nEx<nlimit3Right)
{var nTo=Math.min(limit3,Math.round(((nEx+ndC0Width)/nAvailRangeWidth)*limit3));var nFrom=nTo-nRange;setValue.call(oSelf,nFrom,nTo,null,true);dC0.style.left=nEx+'px';dC0.style.width=ndC0Width+'px';dC2.style.left=nEx+ndC0Width-ndC2Width+1+'px';}
else
{dC0.style.left=nlimit3Right+'px';dC0.style.width=ndC0Width+'px';dC2.style.left=nlimit3Right+ndC0Width-ndC2Width+1+'px';};dC1.style.left=dC0.style.left;oSelf.onSlide.fire(e,oSelf.from,oSelf.to);};var onMouseUp=function(e)
{YUE.removeListener(document,'mousemove',onMouseMove);YUE.removeListener(document,'mouseup',onMouseUp);isDrag=false;};YUE.on(document,'mousemove',onMouseMove);YUE.on(document,'mouseup',onMouseUp);isDrag=true;YUE.stopEvent(e);oSelf.onMouseDown.fire(e);return false;};YAHOO.widget.RangeSlider3=function(sElementId,oAttr)
{var oSelf=this;oSelf.onMouseDown=new YUC('mousedown');oSelf.onMouseUp=new YUC('mouseup');oSelf.onSlide=new YUC('slide');oSelf.onLoad=new YUC('load');oSelf.onChange=new YUC('change');if(typeof(oAttr)!='object')
{oAttr={};};var init=function()
{var dEl=this;dEl.className='yui-range-slider';if(dEl.tagName!='SPAN')
{throw Error('YAHOO.widget.RangeSlider3 Error: \n Element['+sElementId+']\'s tagName is not SPAN');return;};oSelf.type=(YUD.hasClass(dEl,'yui-range-slider-v'))?2:1;YUD.addClass(dEl,'yui-range-slider yui-range-slider-'+oSelf.type);var sTagName=window.opera?'span':'button';dEl.innerHTML=['<span class="s-hd">','<span class="s-line-1" id="',sElementId,'-line-1"></span>','<',sTagName,' class="ctrl-0" id="',sElementId,'-ctrl-0" ></',sTagName,'>','<button  id="',sElementId,'-ctrl-1" class="ctrl-1">&nbsp;</button>','<button   id="',sElementId,'-ctrl-2" class="ctrl-2">&nbsp;</button>','</span>','<',sTagName,' hidefocus="hidefocus" class="s-bd" id="',sElementId,'-box" >&nbsp;</',sTagName,'>',].join('');var dBox=document.getElementById(sElementId+'-box');dBox.style.width=(oAttr.width||200)+'px';dBox.style.height=(oAttr.height||23)+'px';var dC0=document.getElementById(sElementId+'-ctrl-0');var dC1=document.getElementById(sElementId+'-ctrl-1');var dC2=document.getElementById(sElementId+'-ctrl-2');var dLn1=document.getElementById(sElementId+'-line-1');var nSliderWidth=dBox.offsetWidth;dLn1.style.width=parseInt(dBox.style.width)-4+'px';dC0.style.height=dC1.style.height=dC2.style.height=(parseInt(dBox.style.height)-4)+'px';dLn1.style.top=(oAttr.height||23)/2+'px';YUE.on(dC1,'mousedown',onMouseDown,oSelf);YUE.on(dC2,'mousedown',onMouseDown,oSelf);YUE.on(dC0,'mousedown',stopAction);YUE.on(dEl,'selectstart',stopAction);YUE.on(dBox,'mousedown',stopAction);setValue.call(oSelf,oSelf.from,oSelf.to);oSelf.readyState='complete';oSelf.onLoad.fire();};this.id=sElementId;YUE.onAvailable(sElementId,init);};YAHOO.widget.RangeSlider3.prototype={id:'',readyState:'uninitialized',type:1,from:10,to:90,setValue:function(nFrom,nTo)
{var oSelf=this;nFrom=isNaN(nFrom)?0:(nFrom||0);nTo=isNaN(nTo)?limit3:(nTo||limit3);nFrom=Math.max(0,nFrom);nTo=Math.min(limit3,nTo);nFrom=Math.min(nFrom,nTo);var fAction=function()
{setValue.call(oSelf,nFrom,nTo);};if(oSelf.readyState!='complete')
{oSelf.onLoad.subscribe(fAction);}
else
{fAction();};},getValue:function()
{return[this.from,this.to];},getElement:function()
{return document.getElementById(this.id);}};})();var oMS1=new YAHOO.widget.RangeSlider3('my-slider-3',{width:230,height:24});if(document.getElementById("firstActionSliderOrPrincipal").value!="slider"){oMS1.setValue(0,limit3);}else{oMS1.setValue(slider3Min,slider3Max);}
var onMS1Slide=function(sType)
{var aData=this.getValue();if(typeof(this.oldData0)=='undefined')this.oldData0=aData[0];if(typeof(this.oldData1)=='undefined')this.oldData1=aData[1];if(aData[0]!=this.oldData0)
{if(aData[0]-this.oldData0<=0)
{aData=this.getValue();this.oldData0=aData[0];this.oldData1=aData[1];var oldUpper=this.oldData0;oldUpper=Math.round(oldUpper/100);oldUpper=oldUpper-1;oldUpper=oldUpper*100;oMS1.setValue(oldUpper,this.oldData1);}else
{aData=this.getValue();this.oldData0=aData[0];this.oldData1=aData[1];var oldUpper=this.oldData0;oldUpper=Math.round(oldUpper/100);if(((this.oldData1-this.oldData0)<100)){if(((this.oldData1-this.oldData0)==0)||(((this.oldData1-this.oldData0)<100)&&((this.oldData1-this.oldData0)>0))){oldUpper=oldUpper-1;}else{oldUpper=oldUpper+1;}}
oldUpper=oldUpper*100;oMS1.setValue(oldUpper,this.oldData1);}}
if(aData[1]!=this.oldData1)
{if(aData[1]-this.oldData1<=0)
{aData=this.getValue();this.oldData0=aData[0];this.oldData1=aData[1];var oldLower=this.oldData1;oldLower=Math.round(oldLower/100);if(((this.oldData1-this.oldData0)<100)){if(((this.oldData1-this.oldData0)==0)||(((this.oldData1-this.oldData0)<100)&&((this.oldData1-this.oldData0)>0))){oldLower=oldLower+1;}else{oldLower=oldLower-1;}}
oldLower=oldLower*100;oMS1.setValue(this.oldData0,oldLower);}else
{aData=this.getValue();this.oldData0=aData[0];this.oldData1=aData[1];var oldLower=this.oldData1;oldLower=Math.round(oldLower/100);oldLower=oldLower+1;oldLower=oldLower*100;oMS1.setValue(this.oldData0,oldLower);}}
document.getElementById('slider3Min').value=this.oldData0;document.getElementById('slider3Max').value=this.oldData1;aData=this.getValue();this.oldData0=aData[0];this.oldData1=aData[1];oMS1.setValue(this.oldData0,this.oldData1);if(aData[0]!=document.getElementById('slider3Min').value||aData[1]!=document.getElementById('slider3Max').value){calculateValueForsliderEvent(21,document.getElementById("principalIdsForSliderChange").value,document.getElementById("slider1Min").value,document.getElementById("slider1Max").value,document.getElementById("slider2Min").value,document.getElementById("slider2Max").value,+this.oldData0,this.oldData1,document.getElementById("regionId").value,document.getElementById("regionName").value,document.getElementById("city").value);document.getElementById('slider3Min').value=this.oldData0;document.getElementById('slider3Max').value=this.oldData1;if(this.oldData1>1000){document.getElementById('d3').innerHTML=this.oldData0+' - '+'1000+';}else{document.getElementById('d3').innerHTML=this.oldData0+' - '+this.oldData1;}return;}
document.getElementById('slider3Min').value=this.oldData0;document.getElementById('slider3Max').value=this.oldData1;if(this.oldData1>1000){document.getElementById('d3').innerHTML=this.oldData0+' - '+'1000+';}else{document.getElementById('d3').innerHTML=this.oldData0+' - '+this.oldData1;}};oMS1.onLoad.subscribe(onMS1Slide,oMS1,true);oMS1.onMouseUp.subscribe(onMS1Slide,oMS1,true);}
if(freeSmsInNumbersLocalSameOperatorArrayDistinctmax>1000){document.getElementById("dw3").value=1100;}
else{document.getElementById("dw3").value=freeSmsInNumbersLocalSameOperatorArrayDistinctmax;}
var str="principalArray"+principalArray+"monthlyChargeRentalArrayDistinctmin"+monthlyChargeRentalArrayDistinctmin+"-"+monthlyChargeRentalArrayDistinctmax+"freebiesSameOperatorFreeTalkTimeMinArrayDistinctmin"+freebiesSameOperatorFreeTalkTimeMinArrayDistinctmin+"-"+freebiesSameOperatorFreeTalkTimeMinArrayDistinctmax+"freeSmsInNumbersLocalSameOperatorArrayDistinctmin"+freeSmsInNumbersLocalSameOperatorArrayDistinctmin+"-"+freeSmsInNumbersLocalSameOperatorArrayDistinctmax;document.getElementById("provider").style.display="none";var principalsToShow;var principalForSliderEvent="";for(var i=0;i<principalArrayList.length;i++)
{var a=principalArrayList[i].split("-->");if(document.getElementById(""+a[0]+"")!=null){document.getElementById("provider").style.display="block";document.getElementById(""+a[0]+"").style.width="105px";document.getElementById(""+a[0]+"").style.display="block";document.getElementById(""+a[0]+"").width="45%";document.getElementById(""+a[0]+"").style.cssFloat="left";document.getElementById(""+a[0]+"").style.styleFloat="left";principalsToShow+=","+a[0]+"-"+a[1];principalForSliderEvent+=","+a[0];document.getElementById(""+a[0]+"1").checked=false;}}
document.getElementById("principalIdsForSliderChange").value=principalForSliderEvent.substring(1);var result=new Array();var a=respArray[7];if(respArray[7]==""){return;}
if(a!=null)
{document.getElementById("regionId").value=respArray[8];document.getElementById("regionName").value=respArray[9];if(respArray[9]==''){document.getElementById('regionNameToShow').innerHTML="";}{document.getElementById('regionNameToShow').innerHTML="("+respArray[9]+")";}
a=a.replace(/\"\"\"\"/g,"\"\"");var resultFinal=eval("("+a+")");mobileServiceProviderComparatorResultTable(resultFinal,document.getElementById("city").value);}
else
{document.getElementById("provider").style.display="none";document.getElementById("slider1").style.display="none";document.getElementById("slider2").style.display="none";document.getElementById("slider3").style.display="none";return;}}};receiveReq.send(formParams);}}
function mobileHandsetComparatorUserAction()
{document.getElementById('processingResultsDiv').style.height=screen.height;document.getElementById('processingResultsDiv').style.width=screen.width;document.getElementById('processingResults').style.display="block";document.getElementById('processingResults').style.marginTop=(document.getElementById('resultTable').scrollTop+300);var val='';var allPrincipal=document.getElementById("allPrincipals").value;var iterator=allPrincipal.split(",");for(var i=0;i<iterator.length;i++){if(document.getElementById(iterator[i]).checked){val=val.concat(","+document.getElementById(iterator[i]).name);}}
document.getElementById("principalChecked").value=val.substr(1);var userAction='';if(document.getElementById("talkAndTextPhones").checked){userAction=userAction.concat("&talkAndTextPhones="+document.getElementById("talkAndTextPhones").value);}
if(document.getElementById("cameraPhones").checked){userAction=userAction.concat("&cameraPhones="+document.getElementById("cameraPhones").value);}
if(document.getElementById("musicPhones").checked){userAction=userAction.concat("&musicPhones="+document.getElementById("musicPhones").value);}
if(document.getElementById("designPhones").checked){userAction=userAction.concat("&designPhones="+document.getElementById("designPhones").value);}
if(document.getElementById("webAndEmailPhones").checked){userAction=userAction.concat("&webAndEmailPhones="+document.getElementById("webAndEmailPhones").value);}
if(document.getElementById("Bar").checked){userAction=userAction.concat("&Bar="+document.getElementById("Bar").value);}
if(document.getElementById("Slider").checked){userAction=userAction.concat("&Slider="+document.getElementById("Slider").value);}
if(document.getElementById("Flip").checked){userAction=userAction.concat("&Flip="+document.getElementById("Flip").value);}
if(document.getElementById("Others").checked){userAction=userAction.concat("&Others="+document.getElementById("Others").value);}
if(document.getElementById("camera").checked){userAction=userAction.concat("&camera="+document.getElementById("camera").value);}
if(document.getElementById("bluetooth").checked){userAction=userAction.concat("&bluetooth="+document.getElementById("bluetooth").value);}
if(document.getElementById("musicPlayer").checked){userAction=userAction.concat("&musicPlayer="+document.getElementById("musicPlayer").value);}
if(document.getElementById("fMRadio").checked){userAction=userAction.concat("&fMRadio="+document.getElementById("fMRadio").value);}
if(document.getElementById("netSurfing").checked){userAction=userAction.concat("&netSurfing="+document.getElementById("netSurfing").value);}
if(document.getElementById("3G").checked){userAction=userAction.concat("&3G="+document.getElementById("3G").value);}
if(document.getElementById("organiser").checked){userAction=userAction.concat("&organiser="+document.getElementById("organiser").value);}
if(document.getElementById("videoRecorder").checked){userAction=userAction.concat("&videoRecorder="+document.getElementById("videoRecorder").value);}
val=val.substr(1);var formParams="";formParams+="id=29&priceRange="+document.getElementById("priceRange").value+"&principal="+document.getElementById("allPrincipals").value+"&principalChecked="+document.getElementById("principalChecked").value+userAction;var ajaxUrl="/"+nameSpace+"/ajax/kyxHelper.html";var receiveReq=window.getXmlHttpRequestObject();if(receiveReq.readyState==4||receiveReq.readyState==0)
{receiveReq.open("POST",ajaxUrl,true);receiveReq.setRequestHeader("Content-Length",formParams.length);receiveReq.setRequestHeader("Content-Type","application/x-www-form-urlencoded");receiveReq.onreadystatechange=function()
{if(receiveReq.readyState==4)
{var response=receiveReq.responseText;var respArray=response.split("$");if(respArray[17]!="0"){var result=new Array();document.getElementById("Bar").disabled=true;document.getElementById("Slider").disabled=true;document.getElementById("Flip").disabled=true;document.getElementById("Others").disabled=true;document.getElementById("Bar2").src="/images/MobileHandset/TypesofPhone-Bar-D.gif";document.getElementById("Slider2").src="/images/MobileHandset/TypesofPhone-slide-D.gif";document.getElementById("Flip2").src="/images/MobileHandset/TypesofPhone-flab-D.gif";document.getElementById("Others2").src="/images/MobileHandset/TypesofPhone-Touch-D.gif";var form=respArray[0];var tmpArray=form.split("=");var tmpArray=tmpArray[1].split(",");for(var tmp in tmpArray){if(document.getElementById(tmpArray[tmp])!=null){document.getElementById(tmpArray[tmp]).disabled=false;if(tmpArray[tmp]=="Bar"){document.getElementById("Bar2").src="/images/MobileHandset/TypesofPhone-Bar.gif";}else if(tmpArray[tmp]=="Slider"){document.getElementById("Slider2").src="/images/MobileHandset/TypesofPhone-slide.gif";}else if(tmpArray[tmp]=="Flip"){document.getElementById("Flip2").src="/images/MobileHandset/TypesofPhone-flab.gif";}else if(tmpArray[tmp]=="Others"){document.getElementById("Others2").src="/images/MobileHandset/TypesofPhone-Touch.gif";}}}
var netSurfing=respArray[1];var tmpArray=netSurfing.split("=");document.getElementById(tmpArray[0]).disabled=true;if(tmpArray[1]=="true"||document.getElementById(tmpArray[0]).checked){document.getElementById(tmpArray[0]).disabled=false;document.getElementById(tmpArray[0]+"2").style.color="white";}else{document.getElementById(tmpArray[0]+"2").style.color="#E188FF";}
var bluetooth=respArray[2];var tmpArray=bluetooth.split("=");document.getElementById(tmpArray[0]).disabled=true;if(tmpArray[1]=="true"||document.getElementById(tmpArray[0]).checked){document.getElementById(tmpArray[0]).disabled=false;document.getElementById(tmpArray[0]+"2").style.color="white";}else{document.getElementById(tmpArray[0]+"2").style.color="#E188FF";}
var cameraPhones=respArray[3];var tmpArray=cameraPhones.split("=");document.getElementById(tmpArray[0]).disabled=true;if(tmpArray[1]=="true"||document.getElementById(tmpArray[0]).checked){document.getElementById(tmpArray[0]).disabled=false;document.getElementById(tmpArray[0]+"2").style.color="white";}else{document.getElementById(tmpArray[0]+"2").style.color="#E188FF";}
var musicPhones=respArray[4];var tmpArray=musicPhones.split("=");document.getElementById(tmpArray[0]).disabled=true;if(tmpArray[1]=="true"||document.getElementById(tmpArray[0]).checked){document.getElementById(tmpArray[0]).disabled=false;document.getElementById(tmpArray[0]+"2").style.color="white";}else{document.getElementById(tmpArray[0]+"2").style.color="#E188FF";}
var fMRadio=respArray[5];var tmpArray=fMRadio.split("=");document.getElementById(tmpArray[0]).disabled=true;if(tmpArray[1]=="true"||document.getElementById(tmpArray[0]).checked){document.getElementById(tmpArray[0]).disabled=false;document.getElementById(tmpArray[0]+"2").style.color="white";}else{document.getElementById(tmpArray[0]+"2").style.color="#E188FF";}
var musicPlayer=respArray[6];var tmpArray=musicPlayer.split("=");document.getElementById(tmpArray[0]).disabled=true;if(tmpArray[1]=="true"||document.getElementById(tmpArray[0]).checked){document.getElementById(tmpArray[0]).disabled=false;document.getElementById(tmpArray[0]+"2").style.color="white";}else{document.getElementById(tmpArray[0]+"2").style.color="#E188FF";}
var camera=respArray[7];var tmpArray=camera.split("=");document.getElementById(tmpArray[0]).disabled=true;if(tmpArray[1]=="true"||document.getElementById(tmpArray[0]).checked){document.getElementById(tmpArray[0]).disabled=false;document.getElementById(tmpArray[0]+"2").style.color="white";}else{document.getElementById(tmpArray[0]+"2").style.color="#E188FF";}
var threeG=respArray[8];var tmpArray=threeG.split("=");document.getElementById(tmpArray[0]).disabled=true;if(tmpArray[1]=="true"||document.getElementById(tmpArray[0]).checked){document.getElementById(tmpArray[0]).disabled=false;document.getElementById(tmpArray[0]+"2").style.color="white";}else{document.getElementById(tmpArray[0]+"2").style.color="#E188FF";}
var organiser=respArray[9];var tmpArray=organiser.split("=");document.getElementById(tmpArray[0]).disabled=true;if(tmpArray[1]=="true"||document.getElementById(tmpArray[0]).checked){document.getElementById(tmpArray[0]).disabled=false;document.getElementById(tmpArray[0]+"2").style.color="white";}else{document.getElementById(tmpArray[0]+"2").style.color="#E188FF";}
var talkAndTextPhones=respArray[10];var tmpArray=talkAndTextPhones.split("=");document.getElementById(tmpArray[0]).disabled=true;if(tmpArray[1]=="true"||document.getElementById(tmpArray[0]).checked){document.getElementById(tmpArray[0]).disabled=false;document.getElementById(tmpArray[0]+"2").style.color="white";}else{document.getElementById(tmpArray[0]+"2").style.color="#E188FF";}
var designPhones=respArray[11];var tmpArray=designPhones.split("=");document.getElementById(tmpArray[0]).disabled=true;if(tmpArray[1]=="true"||document.getElementById(tmpArray[0]).checked){document.getElementById(tmpArray[0]).disabled=false;document.getElementById(tmpArray[0]+"2").style.color="white";}else{document.getElementById(tmpArray[0]+"2").style.color="#E188FF";}
var webAndEmailPhones=respArray[12];var tmpArray=webAndEmailPhones.split("=");document.getElementById(tmpArray[0]).disabled=true;if(tmpArray[1]=="true"||document.getElementById(tmpArray[0]).checked){document.getElementById(tmpArray[0]).disabled=false;document.getElementById(tmpArray[0]+"2").style.color="white";}else{document.getElementById(tmpArray[0]+"2").style.color="#E188FF";}
var principalsAvailable=respArray[15].split("=");var tmpArray=document.getElementById("allPrincipals").value.split(",");var tmpArrayToBeChecked=principalsAvailable[1].split(",");for(var i in tmpArray){document.getElementById(tmpArray[i]).disabled=true;document.getElementById(tmpArray[i]+"2").style.color="#E188FF";for(var j in tmpArrayToBeChecked){document.getElementById(tmpArrayToBeChecked[j]).disabled=false;document.getElementById(tmpArray[i]+"2").style.color="white";}
if(document.getElementById(tmpArray[i]).checked){document.getElementById(tmpArray[i]).disabled=false;document.getElementById(tmpArray[i]+"2").style.color="white";}
if(document.getElementById(tmpArray[i]).disabled){document.getElementById(tmpArray[i]+"2").style.color="#E188FF";}}
var videoRecorder=respArray[16];var tmpArray=videoRecorder.split("=");document.getElementById(tmpArray[0]).disabled=true;if(tmpArray[1]=="true"||document.getElementById(tmpArray[0]).checked){document.getElementById(tmpArray[0]).disabled=false;document.getElementById(tmpArray[0]+"2").style.color="white";}else{document.getElementById(tmpArray[0]+"2").style.color="#E188FF";}
var a=respArray[14];a=a.replace(/\"\"\"\"/g,"\"\"");var resultFinal=eval("("+a+")");document.getElementById('processingResultsDiv').style.height=0;document.getElementById('processingResultsDiv').style.width=0;document.getElementById('processingResults').style.display="none";mobileHandsetComparatorResultTable(resultFinal,respArray[17]);}else{var a=respArray[14];a=a.replace(/\"\"\"\"/g,"\"\"");var resultFinal="";document.getElementById("userTotalResults").innerHTML="0";document.getElementById("totalResults").value="0";document.getElementById("resultTable").innerHTML="No results found for your search criteria";document.getElementById('processingResultsDiv').style.height=0;document.getElementById('processingResultsDiv').style.width=0;document.getElementById('processingResults').style.display="none";mobileHandsetComparatorResultTable(resultFinal,respArray[17]);}}};receiveReq.send(formParams);}}
function mobileHandsetComparatorResultTable(resultFinal,resultSize){document.getElementById("totalResults").value=0;document.getElementById("resultTable").innerHTML="No results found for your search criteria";var str1='<table width="100%" border="0" cellspacing="0" cellpadding="0"  ><tr >';var ctr=1;var j=0;if(resultFinal!=""||resultFinal["4"].length>0){for(var entry in resultFinal["4"])
{str1=str1+'<td align="left" id="f0_'+j+'" >'+'<table style="max-height:141;max-width:110" width="141" height="99" border="0" cellpadding="0" cellspacing="0"><tr>';str1=str1+'<td align="center" valign="middle" bgcolor="#FFFFFF"><a href="#">'+'<img src="/images/fs/mobile/handset/'+((resultFinal["4"][entry]["kyxValues"]["policyName"].replace(/-/g,"-")).replace(/\s/g,"-"))+'-S.jpg" width="87" alt="'+resultFinal["4"][entry]["kyxValues"]["policyName"]+'-'+resultFinal["4"][entry]["kyxValues"]["principalName"]+' Mobile"border="0" onclick="window.open(\'/images/fs/mobile/handset/'+((resultFinal["4"][entry]["kyxValues"]["policyName"].replace(/-/g,"-")).replace(/\s/g,"-"))+'.jpg\',\'\',\'scrollbars=yes,resizable=yes,width=500,height=400\')" /></a><br /></td>';str1=str1+'</tr>';str1=str1+'<td align="center" valign="middle" id="menu4"><a onclick="dynamicSubmit(\'/mobile-phones-india/'+resultFinal["4"][entry]["kyxValues"]["policyName"]+'-'+resultFinal["4"][entry]["kyxValues"]["policyId"]+'.html\',\'POST\',\'frmComparatorBank\');" target="_parent" > <span class="style7" style="font-size:10;cursor:pointer"><strong  style="cursor:pointer;" onmouseout="this.style.textDecoration=\'\'"  onmouseover="this.style.textDecoration=\'underline\'" >'+resultFinal["4"][entry]["kyxValues"]["policyName"]+'</strong></span><br />';str1=str1+'</a>Rs. ';if(resultFinal["4"][entry]["kyxValues"]["mRPrice"]!=""||resultFinal["4"][entry]["kyxValues"]["mRPrice"]!="0"){if(resultFinal["4"][entry]["kyxValues"]["recommendedPrice"]!=""||resultFinal["4"][entry]["kyxValues"]["recommendedPrice"]!="0"){if(parseInt(resultFinal["4"][entry]["kyxValues"]["mRPrice"])>parseInt(resultFinal["4"][entry]["kyxValues"]["recommendedPrice"])){str1=str1+resultFinal["4"][entry]["kyxValues"]["recommendedPrice"].toString();}else{str1=str1+resultFinal["4"][entry]["kyxValues"]["mRPrice"].toString();}}
else{str1=str1+resultFinal["4"][entry]["kyxValues"]["mRPrice"].toString();}}else{str1=str1+resultFinal["4"][entry]["kyxValues"]["recommendedPrice"].toString();}
str1=str1+'/-<br /><div style="height:2px"> </div><a href="#"> </a><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr>';str1=str1+'<td align="center" valign="middle"><input type="checkbox"  name="product'+resultFinal["4"][entry]["kyxValues"]["policyId"]+'" id="product'+resultFinal["4"][entry]["kyxValues"]["policyId"]+'" value="58532" onclick="insertthisproduct(\'23\',\''+resultFinal["4"][entry]["kyxValues"]["policyId"]+'\',\'/images/fs/mobile/handset/'+((resultFinal["4"][entry]["kyxValues"]["policyName"].replace(/-/g,"-")).replace(/\s/g,"-"))+'-T.jpg\',\''+resultFinal["4"][entry]["kyxValues"]["policyName"]+'\')"/><span class="style7" style="font-size:10px" >Compare</span> </td>';str1=str1+'<td align="right"> '+'</td>';str1=str1+'</tr> </table><div style="height:2px"> </div></td> </tr></table></td>';if(ctr%4==0)
{str1=str1+"</tr><tr>";}
j=j+1;ctr=ctr+1;document.getElementById("totalResults").value=j;document.getElementById("nocnt").value=j;}
document.getElementById("productcnt").value=0;document.getElementById("strid").innerHTML="";document.getElementById("nocnt").value=0;str1=str1+"</table>";document.getElementById("resultTable").innerHTML=str1;document.getElementById("userTotalResults").innerHTML=j;var index=0;mainDataArray=new Array();sponsoredDataArray=[];for(var a in resultFinal["4"])
{if(parseInt(resultFinal["4"][a]["kyxValues"]['recommendedPrice'])>parseInt(resultFinal["4"][a]["kyxValues"]['mRPrice'])){if(parseInt(resultFinal["4"][a]["kyxValues"]['mRPrice'])>0){mainDataArray=mainDataArray.concat({brand:resultFinal["4"][a]["kyxValues"]["policyName"],price:resultFinal["4"][a]["kyxValues"]["mRPrice"],rowIndex:index});}else{mainDataArray=mainDataArray.concat({brand:resultFinal["4"][a]["kyxValues"]["policyName"],price:resultFinal["4"][a]["kyxValues"]["recommendedPrice"],rowIndex:index});}}else{if(parseInt(resultFinal["4"][a]["kyxValues"]['recommendedPrice'])>0){mainDataArray=mainDataArray.concat({brand:resultFinal["4"][a]["kyxValues"]["policyName"],price:resultFinal["4"][a]["kyxValues"]["recommendedPrice"],rowIndex:index});}else{mainDataArray=mainDataArray.concat({brand:resultFinal["4"][a]["kyxValues"]["policyName"],price:resultFinal["4"][a]["kyxValues"]["mRPrice"],rowIndex:index});}}
index++;}
sortAsNum[0]='price';flagAscDesc['brand']=false;flagAscDesc['price']=false;sortTable(document.getElementById("select").value,resultFinal["4"].length,0,1);document.getElementById('processingResultsDiv').style.height=0;document.getElementById('processingResultsDiv').style.width=0;document.getElementById('processingResults').style.display="none";}else{document.getElementById("userTotalResults").innerHTML="0";document.getElementById("totalResults").value="0";document.getElementById("resultTable").innerHTML="No results found for your search criteria";document.getElementById('processingResultsDiv').style.height=0;document.getElementById('processingResultsDiv').style.width=0;document.getElementById('processingResults').style.display="none";}}
function checkHandsetforComparison()
{var mainOffering='';if(document.getElementById("productcnt").value=="1"||document.getElementById("productcnt").value=="0"){var msg="You can select minimum 2 handsets and maximum 4 hadsets to compare.\n";alert(msg);return false;}
var length=document.frmComparatorBank.elements.length;for(i=0;i<length;i++)
{var type1=document.frmComparatorBank.elements[i].type;if(type1=="hidden")
{if(document.frmComparatorBank.elements[i].name.toString()=="offeringIds")
{mainOffering+='-'+document.frmComparatorBank.elements[i].value.replace(" ","_");}}}
document.getElementById("url").value=mainOffering.replace(" ","_");document.getElementById("url").value=document.getElementById("url").value.substring(1);return true;}
function checkHandsetforComparisonPage2()
{var mainOffering='';if(document.getElementById("productcnt").value=="1"||document.getElementById("productcnt").value=="0"){var msg="You can select minimum 2 handsets and maximum 4 hadsets to compare.\n";alert(msg);return false;}
var length=document.frmComparatorBank.elements.length;for(i=0;i<length;i++)
{var type1=document.frmComparatorBank.elements[i].type;if(type1=="checkbox")
{if(document.frmComparatorBank.elements[i].checked)
{mainOffering+='-'+document.frmComparatorBank.elements[i].value.replace(" ","_");}}}
document.getElementById("url").value=mainOffering.replace(" ","_");document.getElementById("url").value=document.getElementById("url").value.substring(1);return true;}
function checkHandsetsForComparison()
{var msg;var checkbox_choices=0;var length=document.frmComparatorBank.elements.length;for(i=0;i<length;i++)
{var type1=document.frmComparatorBank.elements[i].type;if(type1=="checkbox")
{if(document.frmComparatorBank.elements[i].checked)
{checkbox_choices=checkbox_choices+1;}}}
if(checkbox_choices==0||checkbox_choices>3)
{flagS='true';}
else
{flagS='false';}
if(flagS=='true')
{msg="You can select a maximum of up to 4 handsets to compare including your current selection.\n";alert(msg);return false;}
var mainOffering=document.getElementById("mainOffering").value;var length=document.frmComparatorBank.elements.length;for(i=0;i<length;i++)
{var type1=document.frmComparatorBank.elements[i].type;if(type1=="checkbox")
{if(document.frmComparatorBank.elements[i].checked)
{mainOffering+='-'+document.frmComparatorBank.elements[i].value.replace(" ","_");}}}
document.getElementById("url").value=mainOffering.replace(" ","_");return true;}
function checkPlansforComparison()
{var msg;checkcheckboxCompare();if(flagS=='true')
{msg="You can select minimum 1 plan and maximum 2 plans to compare.\n";alert(msg);return false;}
var mainOffering=document.getElementById("mainOffering").value;var length=document.frmComparatorBank.elements.length;for(i=0;i<length;i++)
{var type1=document.frmComparatorBank.elements[i].type;if(type1=="checkbox")
{if(document.frmComparatorBank.elements[i].checked)
{mainOffering+='-'+document.frmComparatorBank.elements[i].value.replace(" ","_");}}}
document.getElementById("url").value=mainOffering.replace(" ","_");return true;}
function getAgeForCriticalInsurance(offeringId,container,pageFlag)
{var formParams="";formParams+="id="+document.getElementById('offerId').value+"&offeringId="+offeringId;var ajaxUrl="/"+nameSpace+"/ajax/kyxHelper.html"
var receiveReq=window.getXmlHttpRequestObject();if(receiveReq.readyState==4||receiveReq.readyState==0)
{receiveReq.open("POST",ajaxUrl,true);receiveReq.setRequestHeader("Content-Length",formParams.length);receiveReq.setRequestHeader("Content-Type","application/x-www-form-urlencoded");receiveReq.onreadystatechange=function()
{if(receiveReq.readyState==4)
{var response=receiveReq.responseText;var ageArray=response.split("#");if(pageFlag==2)
{document.getElementById(container).innerHTML=ageArray[0]+" to "+ageArray[1];}
else
{document.getElementById(container).innerHTML=ageArray[1];}}};receiveReq.send(formParams);}}
function openDivAndHideSelectBox(divId)
{var selects=document.getElementsByTagName('select');for(var i=0;i<selects.length;i++)
{if(selects[i].form!=null)
{if("formRegistration"==selects[i].form.id)
{selects[i].style.visibility="hidden";}}}}
function closeDivAndShowSelectBox()
{var selects=document.getElementsByTagName('select');for(var i=0;i<selects.length;i++)
{selects[i].style.visibility="visible";}}
function Customer(name,countryCodeId,mobileNo,email,age,cityId,forAX,needsValidation,hasCreditCard,mIncome)
{this.name=name;this.countryCodeId=countryCodeId;this.mobileNo=mobileNo;this.email=email;this.age=age;this.cityId=cityId;this.forAX=forAX;this.needsValidation=needsValidation;this.hasCreditCard=hasCreditCard;this.monthlyIncome=mIncome;}
function Application(productId,cust,jTag,principalId,policyId,loanAmt)
{this.productId=productId;this.customer=cust;this.source=jTag;this.principalId=principalId;this.orderId=null;this.listingContactId=null;this.policyId=policyId;this.loanAmt=loanAmt;this.getApplyQS=function()
{var qs="productId="+this.productId+"&mobile="+encodeURIComponent(this.customer.mobileNo)+"&countryCode="+this.customer.countryCodeId+"&city="+this.customer.cityId+"&name="+encodeURIComponent(this.customer.name)+"&email="+encodeURIComponent(this.customer.email);;qs+="&"+getSourceQueryString(this.source);qs+="&vm="+this.customer.needsValidation;if(this.customer.age!=null){qs+="&age="+this.customer.age;}
if(this.customer.forAX)
{qs+="&apnaExchange="+"Y";}
if(apnaloan.isNotNull(this.policyId)){qs+='&policyId='+this.policyId;}
if(apnaloan.isNotNull(this.customer.hasCreditCard)&&this.customer.hasCreditCard!='')
{qs+="&hasCreditCard="+this.customer.hasCreditCard;}
if(apnaloan.isNotNull(this.customer.monthlyIncome))
{qs+="&monthlyIncome="+this.customer.monthlyIncome;}
qs+="&principalId="+this.principalId;qs+="&orderId="+this.orderId;if(apnaloan.isNotNull(this.loanAmt))
{qs+="&leadLoanAmt="+this.loanAmt;}
return qs;};this.getGPNQS=function()
{var qs="mobile="+this.customer.mobileNo+"&countryCode="+this.customer.countryCodeId+"&email="+this.customer.email+"&name="+this.customer.name;qs+="&isBank=true&principalId="+this.principalId+"&listingContactId="+this.listingContactId+"&productId="+this.productId+"&cityId="+this.customer.cityId+"&city="+this.customer.cityId;qs+="&"+getSourceQueryString(this.source);if(this.customer.age!=null){qs+="&age="+this.customer.age;}
if(apnaloan.isNotNull(this.policyId)){qs+='&policyId='+this.policyId;}
return qs;};}
var jTag2Source={"comp":"COMPARE_QUOTE","fap":"FIND_A_PROVIDER","ss":"SMART_SEARCH","rates":"COMPARE_RATE","emi":"COMPARE_EMI","premium":"COMPARE_PREMIUM","eligibility":"COMPARE_ELIGIBILITY","MARKET_PLACE":"MARKET_PLACE"};function getSourceQueryString(jTag)
{var qs="jTag="+jTag;var j=jTag2Source[jTag];if(apnaloan.isNotNull(j)&&typeof(gIsModified)!='undefined'&&gIsModified!==true){j+="_DEFAULT";}
qs+="&j="+j;return qs;};var Range=function(lower,upper)
{if(typeof(lower)!="number"||typeof(upper)!="number")
{alert("ERROR: lower or upper or both not numeric...\n\tlower = "+lower+"\n\tupper = "+upper);return false;}
this.lower=lower;this.upper=upper;this.contains=function(val)
{if(isNaN(val))
{return false;}
return val>=lower&&val<=upper;};this.toString=function()
{return lower+"-"+upper;};this.getRangeIndices=function()
{var rngIndices=[];for(var i=this.lower;i<=this.upper;i++){rngIndices.push(i);}
return rngIndices;};};var WeightedDistribution=function(items)
{this.items=items;this.totalWeight=0;var _distributedWeights=[];var _index2Range=[];if(apnaloan.isNotNull(items))
{for(var i=0;i<items.length;i++)
{var item=items[i];var rngLowr=this.totalWeight;var rngUppr=this.totalWeight+item.weight-1;var range=new Range(rngLowr,rngUppr);item.distributedWeightRange=range;for(var w=this.totalWeight;w<item.weight+this.totalWeight;w++)
{_distributedWeights.push(item);_index2Range.push(range);}
this.totalWeight=rngUppr+1;}}
this.distributedWeights=_distributedWeights;this.index2Range=_index2Range;this.getWeightedRandom=function()
{var idx=apnaloan.generateRandomInteger(this.totalWeight);return this.distributedWeights[idx];};this.numItemsRemoved=0;this.remove=function(item)
{var indicesToBeRmvd=item.distributedWeightRange.getRangeIndices();for(var i=0;i<indicesToBeRmvd.length;i++)
{this.distributedWeights[i]=null;}
this.numItemsRemoved++;};this.allItemsRemoved=function()
{return this.numItemsRemoved>=this.items.length};};var Dispatcher=function(oi2Csr,rt2OiList,appliedOis)
{this.oi2Csr=oi2Csr;var _type2Li2Listing={"p":{},"f":{}};var _type2Li2Ois={"p":{},"f":{}};var _oi2Wd={};if(oi2Csr)
{for(var oi in oi2Csr)
{var csr=oi2Csr[oi];var pool=csr.candidateListingsPool;if(pool)
{if(pool.paidListingCandidatesCount>0)
{var pList=pool.paidListingCandidates;for(var i=0;i<pList.length;i++)
{var p=pList[i];var li=p.identifier;p.weight=Math.round(p.ECPC+1);if(_type2Li2Ois['p'][li]){_type2Li2Ois['p'][li].push(oi);}
else{_type2Li2Ois['p'][li]=[oi];}
_type2Li2Listing['p'][li]=p;}
_oi2Wd[oi]=new WeightedDistribution(pList);}
pool.freeListingCandidatesAvailCount=pool.freeListingCandidatesCount;pool.freeListingCandidatesAvail=pool.freeListingCandidates;if(pool.freeListingCandidatesCount>0)
{var fList=pool.freeListingCandidates;if(fList)
{for(var i=0;i<fList.length;i++)
{var f=fList[i];_type2Li2Listing['f'][f.identifier]=f;if(_type2Li2Ois['f'][li]){_type2Li2Ois['f'][li].push(oi);}
else{_type2Li2Ois['f'][li]=[oi];}}}}}}}
this.oi2Wd=_oi2Wd;this.type2Li2Ois=_type2Li2Ois;this.type2Li2Listing=_type2Li2Listing;this.rt2OiList=rt2OiList;this.appliedOis=appliedOis?appliedOis:[];this.allListingsAvailability={"p":{},"f":{}};this.selectCandidate=function(oi)
{var c=null;var wd=this.oi2Wd[oi];if(wd&&!wd.allItemsRemoved())
{do{c=wd.getWeightedRandom();}
while(c==null);}
else
{var pool=this.oi2Csr[oi].candidateListingsPool;if(pool.freeListingCandidatesAvailCount>0)
{var fList=pool.freeListingCandidates;if(fList)
{var fLen=fList.length;if(fLen>0)
{var a=0
do
{var idx=apnaloan.generateRandomInteger(fLen-1);c=fList[idx];a++}while(!c||(a<2*fLen&&!this.isListingAvailable(c)));}}}}
return c;};this.isListingAvailable=function(l)
{return l&&this.allListingsAvailability[l.type.substr(0,1).toLowerCase()][l.identifier]!==false;};this.preDispatch=function(oi,refVars)
{var csr=this.oi2Csr[oi];if(gIsModified===true)
{var c=this.selectCandidate(oi);if(c)
{if(refVars.isWidg){scrollBy(350,0);}
if(c.type=='PAID')
{popKyxApply(csr.kyxOffering,document.getElementById(refVars.txnBtnId),c);}
else if(c.type=='FREE')
{popKyxGPN(csr.kyxOffering,document.getElementById(refVars.txnBtnId),c);}}}
else
{popKyxApply(csr.kyxOffering,document.getElementById(refVars.txnBtnId),c);}};this.postDispatch=function(disptchInfo,refVars)
{if(apnaloan.isNotNull(disptchInfo.type)&&apnaloan.isNotNull(disptchInfo.li))
{var l=this.type2Li2Listing[disptchInfo.type][disptchInfo.li];if(l)
{var avlbltyKey=l.type.substr(0,1).toLowerCase();var oiList=this.type2Li2Ois[avlbltyKey][l.identifier]
if(l.type=='PAID')
{for(var i=0;i<oiList.length;i++)
{var oi=oiList[i];var wd=this.oi2Wd[oi]
wd.remove(l);}}
else
{var csr=this.oi2Csr[oi];csr.candidateListingsPool.freeListingCandidatesAvailCount--;}
this.allListingsAvailability[disptchInfo.type][disptchInfo.li]=false;}}
this.appliedOis.push(disptchInfo.oi);setActionButtons(this.oi2Csr,this.rt2OiList,refVars.pi2ImgUrl,this.allListingsAvailability,refVars.isWidg);};this.isAppliedForOi=function(oi)
{for(var i=0;i<this.appliedOis.length;i++)
{if(oi==this.appliedOis[i]){return true;}}
return false;};this.getNextCandidateType=function(oi)
{var wd=this.oi2Wd[oi];if(!wd||wd.allItemsRemoved())
{var pool=this.oi2Csr[oi].candidateListingsPool;if(pool&&pool.freeListingCandidatesAvailCount>0){return'gpn';}
else{return null;}}
else
{return"app";}};};function setActionButtons(oi2Csr,rt2OiList,pi2ImgUrl,avlbltyMap,isWidg)
{if(!dispatcher)
{alert("ERROR: dispatcher not initialized");return false;}
for(var rt in rt2OiList)
{var oiList=rt2OiList[rt];var csr_index=0
for(var i=0;i<oiList.length;i++,csr_index++)
{var oi=oiList[i];var btn=document.getElementById("btn_action_"+rt+"_"+oi);var csr=oi2Csr[oi.toString()];if(btn)
{if(dispatcher.isAppliedForOi(oi))
{btn.value='Already applied';btn.style.fontSize="11px";btn.disabled=true;continue;}
var btnParent=btn.parentNode;var co=dispatcher.getNextCandidateType(oi);var off={id:csr.kyxOffering.id,pi:csr.kyxOffering.principal.principalId,oti:csr.kyxOffering.offeringTypeId,listType:rt,opos:csr_index+1,imageUri:pi2ImgUrl[csr.kyxOffering.principal.principalId],principalName:csr.kyxOffering.principal.name,orderIndex:csr_index};setActionBtnProps(btn,co,off,isWidg);}}}}
function setActionBtnProps(btn,aOrG,off,isWidg)
{if(!btn.disabled)
{var btnParent=btn.parentNode;if(gIsModified===true&&!aOrG)
{btnParent.innerHTML='NA';return;}
var onclickFnHtml='dispatcher.preDispatch('+off.id+', {"isWidg" : '+isWidg+', "txnBtnId" : "'+btn.id+'"});';var btnLabel;if(gIsModified===false){btnLabel="Quick Apply";}
else if(aOrG=='app'){btnLabel='Apply';}
else if(off.oti==22||off.oti==23||off.oti==24){btnLabel='Proceed';}
else{btnLabel='Get Phone No.';}
if(typeof(gActBtnProps)!="undefined"&&gActBtnProps!="")
{btnParent.innerHTML='<input id="'+btn.id+'" type="button" value="'+btnLabel+'" onclick=\''+onclickFnHtml+'\' '+gActBtnProps+' />';}
else
{if(gPt==1)
{btnParent.innerHTML='<input id="'+btn.id+'" type="button" value="'+btnLabel+'" style="background-image: url(/images/loan/Bttn-Grey-Loan.gif); height:23px; width:130px; border:0px; background-color:transparent; font-family:Verdana; font-size:11px;" onMouseover="this.style.backgroundImage=\'url(/images/loan/Bttn-Pink-Loan.gif)\';" onMouseout="this.style.backgroundImage=\'url(/images/loan/Bttn-Grey-Loan.gif)\';" onclick=\''+onclickFnHtml+'\' />'}
else
{if(off.oti==5||off.oti==8)
{btnParent.innerHTML='<input id="'+btn.id+'" type="button" value="'+btnLabel+'" style="background-image: url(/images/genIns/Apply-Bttn.gif); height:23px; width:107px;border:0px; background-color:transparent; font-family:Verdana; font-size:11px;" onMouseover="this.style.backgroundImage=\'url(/images/genIns/Apply-Bttn-R.gif)\';" onMouseout="this.style.backgroundImage=\'url(/images/genIns/Apply-Bttn.gif)\';" onclick=\''+onclickFnHtml+'\' />';}
else
{btnParent.innerHTML='<input id="'+btn.id+'" type="button" value="'+btnLabel+'" class="buttonglobal" style="width: 130px;" onclick=\''+onclickFnHtml+'\' />';}}}}}
function isAlreadyAppliedToListing(type,id,avlbltyMap)
{if(avlbltyMap)
{return avlbltyMap[type][id]===false;}
else{alert("avlbltyMap is undefined");}}
function onNoneLeftToApplyForAnOffering(type,list)
{alert("details already submitted to all listings avaiable for this");}
function reportClick(ordid,principalId,productId,jTag,city)
{var params="ordid="+ordid+"&principalId="+principalId+"&productId="+productId+"&jTag="+jTag+"&city="+city;var url="/ajax/reportClick.html";var req=window.getXmlHttpRequestObject();if(req.readyState==4||req.readyState==0)
{req.open("POST",url,true);req.setRequestHeader("Content-Length",params.length);req.setRequestHeader("Content-Type","application/x-www-form-urlencoded")
req.send(params);}}
function reportClickForMarketPlace(bankIds,productId,jTag,city)
{var params="bankIds="+bankIds+"&city="+city+"&productId="+productId+"&jTag="+jTag;var url="/ajax/reportClick.html";var req=window.getXmlHttpRequestObject();if(req.readyState==4||req.readyState==0)
{req.open("POST",url,true);req.setRequestHeader("Content-Length",params.length);req.setRequestHeader("Content-Type","application/x-www-form-urlencoded")
req.send(params);}}
function getApplyOrGpnForOffering(offeringId)
{var applyGpnValue='NA';var csr=gOi2Csr[offeringId];var candidatePool=csr.candidateListingsPool;if(candidatePool!=null)
{var maxECPC=candidatePool.candidateWithMaxECPC;if(maxECPC!=null)
{applyGpnValue=maxECPC.ECPC.toString();}
else
{applyGpnValue='NA';}}
return applyGpnValue;}
function isAppliedForOi(oi)
{if(gAppliedOis)
{for(var i=0;i<gAppliedOis.length;i++)
{if(oi==gAppliedOis[i]){return true;}}}
return false;}
if(!this.JSON){this.JSON={};}
(function(){function f(n){return n<10?'0'+n:n;}
if(typeof Date.prototype.toJSON!=='function'){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+'-'+
f(this.getUTCMonth()+1)+'-'+
f(this.getUTCDate())+'T'+
f(this.getUTCHours())+':'+
f(this.getUTCMinutes())+':'+
f(this.getUTCSeconds())+'Z':null;};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf();};}
var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==='string'?c:'\\u'+('0000'+a.charCodeAt(0).toString(16)).slice(-4);})+'"':'"'+string+'"';}
function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==='object'&&typeof value.toJSON==='function'){value=value.toJSON(key);}
if(typeof rep==='function'){value=rep.call(holder,key,value);}
switch(typeof value){case'string':return quote(value);case'number':return isFinite(value)?String(value):'null';case'boolean':case'null':return String(value);case'object':if(!value){return'null';}
gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==='[object Array]'){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||'null';}
v=partial.length===0?'[]':gap?'[\n'+gap+
partial.join(',\n'+gap)+'\n'+
mind+']':'['+partial.join(',')+']';gap=mind;return v;}
if(rep&&typeof rep==='object'){length=rep.length;for(i=0;i<length;i+=1){k=rep[i];if(typeof k==='string'){v=str(k,value);if(v){partial.push(quote(k)+(gap?': ':':')+v);}}}}else{for(k in value){if(Object.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?': ':':')+v);}}}}
v=partial.length===0?'{}':gap?'{\n'+gap+partial.join(',\n'+gap)+'\n'+
mind+'}':'{'+partial.join(',')+'}';gap=mind;return v;}}
if(typeof JSON.stringify!=='function'){JSON.stringify=function(value,replacer,space){var i;gap='';indent='';if(typeof space==='number'){for(i=0;i<space;i+=1){indent+=' ';}}else if(typeof space==='string'){indent=space;}
rep=replacer;if(replacer&&typeof replacer!=='function'&&(typeof replacer!=='object'||typeof replacer.length!=='number')){throw new Error('JSON.stringify');}
return str('',{'':value});};}
if(typeof JSON.parse!=='function'){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==='object'){for(k in value){if(Object.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v;}else{delete value[k];}}}}
return reviver.call(holder,key,value);}
cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return'\\u'+
('0000'+a.charCodeAt(0).toString(16)).slice(-4);});}
if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,'@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']').replace(/(?:^|:|,)(?:\s*\[)+/g,''))){j=eval('('+text+')');return typeof reviver==='function'?walk({'':j},''):j;}
throw new SyntaxError('JSON.parse');};}}());function selectNRIStatus(val)
{if(val=='N')
{document.getElementById('is_nri_n').value="N";document.getElementById('country_code').value="91";document.getElementById('country_code').disabled=true;document.getElementById('mobile').setAttribute('maxLength','10');}
else
{document.getElementById('is_nri_y').value="Y";document.getElementById('country_code').value="0";document.getElementById('country_code').disabled=false;document.getElementById('mobile').setAttribute('maxLength','15');}}
function checkAll(field)
{for(i=0;i<field.length;i++)
field[i].checked=true;}
function uncheckAll(field)
{for(i=0;i<field.length;i++)
field[i].checked=false;}
function validateEmailForApply(str)
{var at="@"
var dot="."
var lat=str.indexOf(at)
var lstr=str.length
var ldot=str.indexOf(dot)
if(str.indexOf(at)==-1){return false}
if(str.indexOf(at)==-1||str.indexOf(at)==0||str.indexOf(at)==lstr){return false}
if(str.indexOf(dot)==-1||str.indexOf(dot)==0||str.indexOf(dot)==lstr){return false}
if(str.indexOf(at,(lat+1))!=-1){return false}
if(str.substring(lat-1,lat)==dot||str.substring(lat+1,lat+2)==dot){return false}
if(str.indexOf(dot,(lat+2))==-1){return false}
if(str.indexOf(" ")!=-1){return false}
return true}
function validateSmartApplyForm(productId)
{if(document.getElementById("city").value=="0")
{alert("Please choose your city");document.getElementById("city").focus();return false;}
if(document.getElementById("name").value==""||!isNaN(document.getElementById("name").value))
{document.getElementById("name").focus();var nameMsg=document.getElementById("nameMsg");nameMsg.innerHTML="Please enter your name";nameMsg.setAttribute("class","applyFormRight applyFormError");return false;}
if(!validateEmailForApply(document.getElementById("email").value))
{document.getElementById("email").focus();var emailMsg=document.getElementById("emailMsg");emailMsg.innerHTML="Please enter a valid Email Address";emailMsg.setAttribute("class","applyFormRight applyFormError");return false;}
if(document.getElementById("subProduct").value==0)
{document.getElementById("subProduct").focus();var subProductMsg=document.getElementById("subProductMsg");subProductMsg.setAttribute("class","applyFormRight applyFormError");subProductMsg.innerHTML="Please Choose a Sub Product.";return false;}
if(productId!=3&&document.getElementById('flag').value!="apnainsurance")
{if(document.getElementById("loanAmount").value==""||isNaN(document.getElementById("loanAmount").value))
{document.getElementById("loanAmount").focus();var loanAmtMsg=document.getElementById("loanAmtMsg");loanAmtMsg.setAttribute("class","applyFormRight applyFormError");loanAmtMsg.innerHTML="Please Enter Loan Amount.";return false;}}
if(document.getElementById('flag').value!="apnainsurance")
{if(document.getElementById("monthlyIncome").value==""||isNaN(document.getElementById("monthlyIncome").value))
{document.getElementById('monthlyIncome').focus();var incomeMsg=document.getElementById("incomeMsg");incomeMsg.setAttribute("class","applyFormRight applyFormError");incomeMsg.innerHTML="Please Enter Your Monthly Income.";return false;}}
if(document.getElementById("dobDay").value=="0"||document.getElementById("dobMonth").value=="0"||document.getElementById("dobYear").value=="0")
{var dobMsg=document.getElementById("dobMsg");dobMsg.innerHTML="Please Enter Correct Date Of Birth.";dobMsg.setAttribute("class","applyFormRight applyFormError");return false;}
if(document.getElementById("professionType").value=="0")
{document.getElementById('professionType').focus();var professionMsg=document.getElementById("professionMsg");professionMsg.innerHTML="Please Choose a Profession Type.";professionMsg.setAttribute("class","applyFormRight applyFormError");return false;}
if(document.getElementById("has_credit_card_y").checked==false&&document.getElementById("has_credit_card_n").checked==false)
{document.getElementById('professionType').focus();var professionMsg=document.getElementById("creditCardMsg");professionMsg.innerHTML="Please Select If You Have Credit Card.";professionMsg.setAttribute("class","applyFormRight applyFormError");return false;}
return true;}
function calculateInterestAmount(loanAmt,interestRate)
{var newIR=parseFloat(interestRate/(12*100));var interestAmt=(loanAmt*newIR);return interestAmt;}
function roundDecimals(original_number,decimals){var result1=original_number*Math.pow(10,decimals)
var result2=Math.round(result1)
var result3=result2/Math.pow(10,decimals)
return(result3)}
var helpMsgArray=new Array('Kindly enter valid email id as an activation code will be mailed & you have to enter the same code in your application form for validation or confirm by clicking on the link sent in the mail','Kindly enter valid mobile number as an activation code will be sent by SMS to that number & you have to enter the same code in your application form for validation or reply to the SMS through the same mobile','Select the appropriate reason for which you need this loan. Provide exact reason or purpose to facilitate appropriate action','Provide Gross Monthly Income. You can club income of co-borrowers (i.e. Spouse+Parents+Children+Siblings). You should only include income that you can prove through relevant documents such as ITR,Salary Slip, Form 16 OR Bank Statement','Directors in Pvt. Ltd.Co. with shareholding in the company should select Self Employed','Provide the city name where you are presently staying','The information you provide here will help us understand your needs better so that we may connect you to the correct banks. We take consumer privacy seriously. Please refer to our Privacy Policy to find out how we use this information.','You can select Multiple cards that you are currently holding.','Select the appropriate type of card that you wish to apply for','Provide Gross Monthly Income. You should only include income that you can prove through relevant documents such as ITR,Salary Slip, Form 16 OR Bank Statement','Directors in Pvt. Ltd.Co. with shareholding should select Self Employed','This information will enable the banks to contact you','This will enable the banks to understand your existing loan amounts. Some banks provide special schemes for consumers with good payment track record.','Please re-enter mobile number','Please enter a 4 digit numeric password / mobile pin','Please re-enter the 4 digit numeric password / mobile pin','Please re-enter email address','Enter total amount of fees such as processing fees, administrative fees, legal fees, technical fees etc','Enter the rate for a genuine fixed rate loan. Genuine Fixed Interest rate means that rate which remains constant throughout the tenure of the loan.','Here put in the rate available on safe investment option such as Bank Fixed Deposits ,Debt Mutual Funds, etc','This is calculated as ( (pre-tax return) x (1 - Marginal Tax Rate) )','Also called Adjustable rate or Variable rate of Interest','Enter the expected floating rate here','Enter the number of months (from the last change date) after which the change in Floating rate takes place','Enter here the highest rate at which you pay tax','This is a calculated figure and is your actual interest rate multiplied by (1 minus the marginal tax rate)','Maximum benefit available under Section 80C for the financial year ending on March 31, 2009 is Rs. 1,00,000/-. Here enter the amount by which your current claim for deduction under this section  is falling short of the maximum amount of Rs. 1,00,000/-. If you are already enjoying the full deduction of Rs. 1,00,000 under Section 80C then enter 0 here.','Amount that is pre-paid is eligible for deduction under section 80C','Prepayment Charges are eligible for deduction as interest under section 24. See tax tips section.','This is a calculated figure and is equal to the pre-payment charges less tax break available on the pre-payment charge','Enter here the gross pre-tax return on investment avenues that you consider safe','This is a calculated figure and is equivalent to the pre-tax return multiplied by (1-marginal tax rate)','Enter Yes if you have been claiming deduction under section 80C on the principal portion of your loan repayment','Enter what you want the bank to do � reduce the loan tenure or reduce the EMI. Normally most banks only agree to reduce the tenure','hi how r u?');helpLoanMsgArray=new Array();helpLoanMsgArray[0]="Please select loan type from quick apply.";helpLoanMsgArray[1]="To buy a ready flat: Loan required to purchase a ready to occupy flat. All construction work is already finished <br /><br />";helpLoanMsgArray[1]+="'To buy an under construction flat: Loan required to purchase a property where the construction work is still going  on' <br /><br /> 'To buy a resale property: Loan required to purchase a ready to occupy flat which is already owned by someone else & the owner has agreed to sell it to you for a price' <br /><br /> 'To buy a plot: Loan required to purchase a piece of land/plot' <br /><br /> 'To buy a commercial property: Loan required to purchase property which can be used as an Office, Bussiness Unit or for some other commercial purpose' <br /><br /> 'To finance self construction costs: Loan required for building of house,shop on owned plots/land' <br /><br /> 'Home Improvement Loan: Loan required to refurnish, re-develop, decorate or re-decorate the existing property' <br /><br /> 'To transfer existing loan to another lender: Also commonly known as Balance Transfer where you transfer your existing outstanding loan amount from one lender to another at lower rate of interest or for other benefits' <br /><br /> 'To transfer existing loan with top up: Avail for an Balance transfer where you transfer your existing outstanding loan amount from one lender to another alongwith additional amount which you can use for renovation or other purposes' <br /><br />";helpLoanMsgArray[1]+="'To buy a shop: Loan required to purchase a property which will be used as an retail/wholesale trading place'";helpLoanMsgArray[2]="Select the appropriate reason for which you need this loan. Provide exact reason or purpose to facilitate appropriate action";helpLoanMsgArray[3]="Select the appropriate type of card that you wish to apply for";helpLoanMsgArray[4]="Select the appropriate type of car for which you need this loan.";helpLoanMsgArray[19]="Loan against property";helpLoanMsgArray[21]="Commercial property / shop";helpLoanMsgArray[17]="Plot of land";helpLoanMsgArray[23]="Others";function showMe(element,param,msg,mode){if(mode!=1){gapX=5;gapY=10;}else{gapX=-280;gapY=10;}
posX=element.offsetLeft
posY=element.offsetTop;width=element.clientWidth;if(!width){width=element.offsetWidth;}
TheElement=element.offsetParent;while(TheElement!=null){posX+=TheElement.offsetLeft
posY+=TheElement.offsetTop;TheElement=TheElement.offsetParent;}
posX+=gapX;posY+=gapY;document.getElementById(param).style.display="block";document.getElementById(param).style.left=posX+'px';document.getElementById(param).style.top=posY+'px';document.getElementById('txtMsg').innerHTML=msg;}
function hideMe(param){document.getElementById(param).style.display="none";}
function isNumberKey(evt,element,mode)
{if(mode==1)
{var val=element.value;var result=val.indexOf('.');if(result==-1){tstflag=0;}}
var oEvent=(window.event)?window.event:evt;var charCode=oEvent.keyCode?oEvent.keyCode:oEvent.which?oEvent.which:void 0;if((charCode>31)&&(charCode<48||charCode>57)){if(mode==1){if(charCode==46&&tstflag==0)
{tstflag=1;return true;}else{return false;}}else{return false;}}else{return true;}}
function sugen_calculateEMI(loanAmt,interestRate,tenure)
{if(parseFloat(interestRate)!=0)
{var interestRateForMonth=interestRate/12;var interestRateForMonthFraction=interestRateForMonth/100;var emi=1/Math.pow((1+interestRateForMonthFraction),tenure);var emiPerLakh=(loanAmt*interestRateForMonthFraction)/(1-emi)
return emiPerLakh;}
else
{var emi=loanAmt/tenure;return emiPerLakh;}}
function displayTermsConditions(str)
{w=window.open("","Apnaloan","directories=0,location=0,menubar=0,resizable=1,scrollbars=1,status=0,toolbar=0,left=100,top=300,width=500px,height=500px");w.document.write(str);w.document.write("<br><input type='button' name='print' value='print' onclick='window.print();'>");}
function askExpertSingleAnswer()
{var questionId=document.getElementById("userInputQuestionId").value;if(questionId=='')
{alert('Please Enter Your Question Id');return false;}
var baseUri='/'+document.getElementById("currentQueryTypeValue").value+'/';uri=baseUri+questionId+'-query.html';document.getElementById('askSingleAnswer').action=uri;}
function SortableTable(tableEl){this.tbody=tableEl.getElementsByTagName('tbody');this.thead=tableEl.getElementsByTagName('thead');this.tfoot=tableEl.getElementsByTagName('tfoot');this.getInnerText=function(el){if(typeof(el.textContent)!='undefined')return el.textContent;if(typeof(el.innerText)!='undefined')return el.innerText;if(typeof(el.innerHTML)=='string')return el.innerHTML.replace(/<[^<>]+>/g,'');}
this.getParent=function(el,pTagName){if(el==null)return null;else if(el.nodeType==1&&el.tagName.toLowerCase()==pTagName.toLowerCase())
return el;else
return this.getParent(el.parentNode,pTagName);}
this.hideOthers=function(currentElement)
{for(var i=1;i<=this.thead[0].rows[0].cells.length-2;i++)
{var cell=this.thead[0].rows[0].cells[i];if(currentElement!=cell.cellIndex)
{cell.style.background="url(/images/table_header_bottom.gif) top left repeat-x";}}}
this.sort=function(cell){if(cell.className=='nosort')
{return;}
var column=cell.cellIndex;var rowCount=this.tbody[0].rows.length;for(i=0;i<rowCount;i++)
{if(this.tbody[0].rows[i].cells[column].innerHTML=="NA"||this.tbody[0].rows[i].cells[column].innerHTML=="9999999999999")
{if(cell.getAttribute("sortdir")=='down')
this.tbody[0].rows[i].cells[column].innerHTML="-100";else
this.tbody[0].rows[i].cells[column].innerHTML="9999999999999";}}
var itm=this.getInnerText(this.tbody[0].rows[1].cells[column]);var sortfn=this.sortCaseInsensitive;if(itm.match(/\d\d[-]+\d\d[-]+\d\d\d\d/))sortfn=this.sortDate;if(itm.replace(/^\s+|\s+$/g,"").match(/^[\d\.]+$/))sortfn=this.sortNumeric;this.sortColumnIndex=column;var newRows=new Array();for(j=0;j<this.tbody[0].rows.length;j++){newRows[j]=this.tbody[0].rows[j];}
newRows.sort(sortfn);if(cell.getAttribute("sortdir")=='down')
{newRows.reverse();cell.style.background="url(/images/up.gif) no-repeat";cell.style.backgroundColor='#FDD017';cell.setAttribute('sortdir','up');this.hideOthers(cell.cellIndex);}else{cell.style.background="url(/images/down.gif) no-repeat";cell.style.backgroundColor='#FDD017';cell.setAttribute('sortdir','down');this.hideOthers(cell.cellIndex);}
for(i=0;i<newRows.length;i++)
{this.tbody[0].appendChild(newRows[i]);if(i%2==0)
{newRows[i].className="alt";}
else
{newRows[i].className="";}}
var rowCount=this.tbody[0].rows.length;for(i=0;i<rowCount;i++)
{if(this.tbody[0].rows[i].cells[column].innerHTML=="-100")
{this.tbody[0].rows[i].cells[column].innerHTML="NA";}
if(this.tbody[0].rows[i].cells[column].innerHTML=="9999999999999")
{this.tbody[0].rows[i].cells[column].innerHTML="NA";}}}
this.sortCaseInsensitive=function(a,b){aa=thisObject.getInnerText(a.cells[thisObject.sortColumnIndex]).toLowerCase();bb=thisObject.getInnerText(b.cells[thisObject.sortColumnIndex]).toLowerCase();if(aa==bb)return 0;if(aa<bb)
{return-1;}
else{return 1;}}
this.sortDate=function(a,b){aa=thisObject.getInnerText(a.cells[thisObject.sortColumnIndex]);bb=thisObject.getInnerText(b.cells[thisObject.sortColumnIndex]);date1=aa.substr(6,4)+aa.substr(3,2)+aa.substr(0,2);date2=bb.substr(6,4)+bb.substr(3,2)+bb.substr(0,2);if(date1==date2)return 0;if(date1<date2)return-1;return 1;}
this.sortNumeric=function(a,b){aa=parseFloat(thisObject.getInnerText(a.cells[thisObject.sortColumnIndex]));if(isNaN(aa))aa=0;bb=parseFloat(thisObject.getInnerText(b.cells[thisObject.sortColumnIndex]));if(isNaN(bb))bb=0;return aa-bb;}
var thisObject=this;var sortSection=this.thead;if(!(this.tbody&&this.tbody[0].rows&&this.tbody[0].rows.length>0))return;if(sortSection&&sortSection[0].rows&&sortSection[0].rows.length>0){var sortRow=sortSection[0].rows[0];}else{return;}
for(var i=0;i<sortRow.cells.length;i++){sortRow.cells[i].sTable=this;sortRow.cells[i].onclick=function(){this.sTable.sort(this);}}}
function changediv(section,divid)
{if(section==1)
{document.getElementById('bodharsh').style.display='none';document.getElementById('bodbalaraj').style.display='none';document.getElementById('bodramaraj').style.display='none';document.getElementById('bodbajpai').style.display='none';document.getElementById('bodkasi').style.display='none';document.getElementById('bodsridhar').style.display='none';document.getElementById('bodharshlink').style.color='';document.getElementById('bodbalarajlink').style.color='';document.getElementById('bodramarajlink').style.color='';document.getElementById('bodbajpailink').style.color='';document.getElementById('bodkasilink').style.color='';document.getElementById('bodsridharlink').style.color='';document.getElementById(divid).style.display='block';document.getElementById(divid+'link').style.color='#395DD0';}
if(section==2)
{document.getElementById('teamhemang').style.display='none';document.getElementById('teamharsh').style.display='none';document.getElementById('teambalwant').style.display='none';document.getElementById('teamrajesh').style.display='none';document.getElementById('teamkairav').style.display='none';document.getElementById('teamnaresh').style.display='none';document.getElementById('teamamod').style.display='none';document.getElementById('teamhemanglink').style.color='';document.getElementById('teamharshlink').style.color='';document.getElementById('teambalwantlink').style.color='';document.getElementById('teamrajeshlink').style.color='';document.getElementById('teamkairavlink').style.color='';document.getElementById('teamnareshlink').style.color='';document.getElementById('teamamodlink').style.color='';document.getElementById(divid).style.display='block';document.getElementById(divid+'link').style.color='#395DD0';}}
function generateProviderUrl(formid)
{var url=(document.getElementById(formid).city.options[document.getElementById(formid).city.selectedIndex].text).replace(/ /g,"_").toLowerCase().replace("%20","_");if(document.getElementById(formid).bankId.value!=0)
{url+='-'+(document.getElementById(formid).bankId.options[document.getElementById(formid).bankId.selectedIndex].text).replace(/ /g,"_").toLowerCase().replace("%20","_");}
return url;}
function showPurposeHLInterestRate(purpose)
{var strSelectedPurposeStart='<tr> <td width="8"><img src="/images/Tabs-Selected-Bg_01.gif" width="8" height="40" /></td> <td width="96" align="center" background="/images/Tabs-Selected-Bg_02.gif"><strong>';var strSelectedPurposeEnd='</strong></td> <td width="10" align="left"><img src="/images/Tabs-Selected-Bg_03.gif" width="8" height="40" /></td> </tr>';var strPurposeStart='<tr> <td width="8"><img src="/images/Tabs-Bg_01.gif" width="8" height="40" /></td> <td width="96" align="center" background="/images/Tabs-Bg_02.gif"><strong> ';var strPurposeEnd='</strong></td> <td width="10" align="left"><img src="/images/Tabs-Bg_03.gif" width="8" height="40" /></td> </tr>';var cols=new Array("residential","repairs","plotloan");for(var i=0;i<cols.length;i++){if(cols[i]!=purpose){document.getElementById('hlir_td_img1_'+cols[i]).src='/images/Tabs-Bg_01.gif';document.getElementById('hlir_td_img2_'+cols[i]).background='/images/Tabs-Bg_02.gif';document.getElementById('hlir_td_img3_'+cols[i]).src='/images/Tabs-Bg_03.gif';}else{document.getElementById('hlir_td_img1_'+cols[i]).src='/images/Tabs-Selected-Bg_01.gif';document.getElementById('hlir_td_img2_'+cols[i]).background='/images/Tabs-Selected-Bg_02.gif';document.getElementById('hlir_td_img3_'+cols[i]).src='/images/Tabs-Selected-Bg_03.gif';}}
if(purpose=="residential")
{document.getElementById('residentialTable').style.display='block';document.getElementById('repairsTable').style.display='none';document.getElementById('plotOfLandTable').style.display='none';displayDataResidential(document.getElementById('tenure').value);}
else
{}
if(purpose=="repairs")
{document.getElementById('residentialTable').style.display='none';document.getElementById('repairsTable').style.display='block';document.getElementById('plotOfLandTable').style.display='none';displayDataRepairs(document.getElementById('loanAmountRepairs').value);}
else
{}
if(purpose=="plotloan")
{document.getElementById('residentialTable').style.display='none';document.getElementById('repairsTable').style.display='none';document.getElementById('plotOfLandTable').style.display='block';displayDataPlotOfLand(document.getElementById('loanAmountPlotOfLand').value);}
else
{}
if(purpose=="transferloan")
{document.getElementById('residentialTable').style.display='none';document.getElementById('repairsTable').style.display='none';document.getElementById('plotOfLandTable').style.display='none';document.getElementById('transferExistingLoanTable').style.display='block';displayDataTransferExistingLoan(document.getElementById('loanAmountTransferExistingLoan').value);}
else
{}}
function createDynamicObject(objectType,attributesKeys,attributesValues)
{var dynamicObject=document.createElement(objectType);if(attributesKeys.length>0&&attributesValues.length>0)
{for(i=0;i<attributesKeys.length;i++)
{dynamicObject.setAttribute(attributesKeys[i],attributesValues[i]);}}
return dynamicObject;}
function displayDataResidential(tenure)
{var hlRateList=new Array();hlRateList=tenureWiseHLRateListResidential[tenure];if(hlRateList!=undefined)
{document.getElementById('tableDataDivResidential').innerHTML="";var mainDiv=document.getElementById("tableDataDivResidential");var attributesKeys=new Array('id','width','border','cellpadding','cellspacing');var attributesValues=new Array('interestRateTable','692','0','2','1');var dynTable=createDynamicObject('table',attributesKeys,attributesValues);var dynTableHead=document.createElement("thead");var dynTableHeadRow=document.createElement("tr");var dynTableHeadRowLeft=document.createElement("td");dynTableHeadRowLeft.setAttribute('width','1px');dynTableHeadRow.appendChild(dynTableHeadRowLeft);var attributesKeys=new Array('style','width','height','bgcolor');var attributesValues=new Array('cursor:pointer;','127','24','#ebe4cd');var dynTableHeadCell1=createDynamicObject('td',attributesKeys,attributesValues);dynTableHeadCell1.innerHTML="<strong> Bank/product name </strong>";dynTableHeadRow.appendChild(dynTableHeadCell1);var attributesKeys=new Array('class','width','align','bgcolor');var attributesValues=new Array('nosort','57','center','#EBE4CD');var dynTableHeadCell2=createDynamicObject('td',attributesKeys,attributesValues);dynTableHeadCell2.innerHTML="<strong> Interest rate type </strong>";dynTableHeadRow.appendChild(dynTableHeadCell2);var attributesKeys=new Array('style','width','align','bgcolor');var attributesValues=new Array('cursor:pointer','71','center','#EBE4CD');var dynTableHeadCell3=createDynamicObject('td',attributesKeys,attributesValues);dynTableHeadCell3.innerHTML="<strong> upto 5 lakh </strong>";dynTableHeadRow.appendChild(dynTableHeadCell3);var attributesKeys=new Array('style','id','width','align');var attributesValues=new Array('cursor:pointer;','defaultSortResidential','60','center','#EBE4CD');var dynTableHeadCell4=createDynamicObject('td',attributesKeys,attributesValues);dynTableHeadCell4.innerHTML="<strong> 5-20 lakh </strong>";dynTableHeadRow.appendChild(dynTableHeadCell4);var attributesKeys=new Array('style','width','align','bgcolor');var attributesValues=new Array('cursor:pointer','98','center','#EBE4CD');var dynTableHeadCell5=createDynamicObject('td',attributesKeys,attributesValues);dynTableHeadCell5.innerHTML="<strong> 20-30 lakh </strong>";dynTableHeadRow.appendChild(dynTableHeadCell5);var attributesKeys=new Array('style','width','align','bgcolor');var attributesValues=new Array('cursor:pointer','68','center','#EBE4CD');var dynTableHeadCell6=createDynamicObject('td',attributesKeys,attributesValues);dynTableHeadCell6.innerHTML="<strong> 30-50 lakh </strong>";dynTableHeadRow.appendChild(dynTableHeadCell6);var attributesKeys=new Array('style','width','align','bgcolor');var attributesValues=new Array('cursor:pointer','68','center','#EBE4CD');var dynTableHeadCell7=createDynamicObject('td',attributesKeys,attributesValues);dynTableHeadCell7.innerHTML="<strong> 50-75 lakh </strong>";dynTableHeadRow.appendChild(dynTableHeadCell7);var attributesKeys=new Array('style','width','align','bgcolor');var attributesValues=new Array('cursor:pointer','59','center','#EBE4CD');var dynTableHeadCell8=createDynamicObject('td',attributesKeys,attributesValues);dynTableHeadCell8.innerHTML="<strong> > 75 lakh </strong>";dynTableHeadRow.appendChild(dynTableHeadCell8);var dynTableHeadRowRight=document.createElement("td");dynTableHeadRowRight.setAttribute('width','1px');dynTableHeadRow.appendChild(dynTableHeadRowRight);dynTableHead.appendChild(dynTableHeadRow);dynTable.appendChild(dynTableHead);var floatArray=new Array('5-1','20-1','30-1','50-1','75-1','99-1');var fixedArray1=new Array('5-2','20-2','30-2','50-2','75-2','99-2');var fixedArray2=new Array('5-3','20-3','30-3','50-3','75-3','99-3');var dynTableBody=document.createElement("tbody");var rowIndex=0;for(i=0;i<hlRateList.length;i++)
{var loanAmtList=hlRateList[i].loanAmountInterestRate;var floatFlag=6;for(j=0;j<floatArray.length;j++)
{if(loanAmtList[floatArray[j]]==undefined&&loanAmtList[floatArray[j]]=="NA")
{floatFlag--;}}
if(floatFlag>0)
{var dynTableRow1=document.createElement("tr");if(rowIndex%2==0)
{dynTableRow1.setAttribute('bgcolor','#F9F8F0');}
else
{dynTableRow1.setAttribute('bgcolor','#FFFFFF');}
var dynTableCellLeft=document.createElement("td");dynTableCellLeft.setAttribute('bgcolor','#ffffff');dynTableRow1.appendChild(dynTableCellLeft);var dynTableCell1=document.createElement("td");dynTableCell1.setAttribute('height','24');dynTableCell1.setAttribute('width','127');dynTableCell1.innerHTML="<strong>"+hlRateList[i].bankName+"</strong>";dynTableRow1.appendChild(dynTableCell1);var dynTableCell2=document.createElement("td");dynTableCell2.setAttribute('width','57');dynTableCell2.setAttribute('align','center');dynTableCell2.appendChild(document.createTextNode("Floating"));dynTableRow1.appendChild(dynTableCell2);for(j=0;j<floatArray.length;j++)
{var dynTableCellFloat=document.createElement("td");dynTableCellFloat.setAttribute('align','center');if(loanAmtList[floatArray[j]]&&loanAmtList[floatArray[j]]!="NA")
{dynTableCellFloat.innerHTML=loanAmtList[floatArray[j]];}
else
{dynTableCellFloat.appendChild(document.createTextNode("NA"));}
dynTableRow1.appendChild(dynTableCellFloat);}
var dynTableCellRight=document.createElement("td");dynTableCellRight.setAttribute('bgcolor','#ffffff');dynTableRow1.appendChild(dynTableCellRight);dynTableBody.appendChild(dynTableRow1);rowIndex++;}
var fixedFlag=6;for(j=0;j<fixedArray1.length;j++)
{if((loanAmtList[fixedArray1[j]]==undefined||loanAmtList[fixedArray1[j]]=="NA")&&(loanAmtList[fixedArray2[j]]==undefined||loanAmtList[fixedArray2[j]]=="NA"))
{fixedFlag--;}}
if(fixedFlag>0)
{var dynTableRow2=document.createElement("tr");if(rowIndex%2==0)
{dynTableRow2.setAttribute('bgcolor','#F9F8F0');}
else
{dynTableRow2.setAttribute('bgcolor','#FFFFFF');}
var dynTableCellLeft=document.createElement("td");dynTableCellLeft.setAttribute('bgcolor','#ffffff');dynTableRow2.appendChild(dynTableCellLeft);var dynTableCell1=document.createElement("td");dynTableCell1.setAttribute('id','bankName_'+rowIndex);dynTableCell1.setAttribute('height','24');dynTableCell1.setAttribute('width','127');dynTableCell1.innerHTML="<strong>"+hlRateList[i].bankName+"</strong>";dynTableRow2.appendChild(dynTableCell1);var dynTableCell2=document.createElement("td");dynTableCell2.setAttribute('id','rateType_'+rowIndex);dynTableCell2.setAttribute('width','57');dynTableCell2.setAttribute('align','center');dynTableCell2.appendChild(document.createTextNode("Fixed"));dynTableRow2.appendChild(dynTableCell2);for(j=0;j<fixedArray1.length;j++)
{var dynTableCellFixed=document.createElement("td");dynTableCellFixed.setAttribute('align','center');if(loanAmtList[fixedArray1[j]]==undefined&&loanAmtList[fixedArray2[j]]==undefined)
{dynTableCellFixed.appendChild(document.createTextNode("NA"));}else if(loanAmtList[fixedArray1[j]]&&loanAmtList[fixedArray1[j]]!="NA")
{dynTableCellFixed.appendChild(document.createTextNode(loanAmtList[fixedArray1[j]]));}
else if(loanAmtList[fixedArray2[j]]&&loanAmtList[fixedArray2[j]]!="NA")
{dynTableCellFixed.appendChild(document.createTextNode(loanAmtList[fixedArray2[j]]));}
else
{dynTableCellFixed.appendChild(document.createTextNode("NA"));}
dynTableRow2.appendChild(dynTableCellFixed);}
var dynTableCellRight=document.createElement("td");dynTableCellRight.setAttribute('bgcolor','#ffffff');dynTableRow2.appendChild(dynTableCellRight);dynTableBody.appendChild(dynTableRow2);rowIndex++;}}
dynTable.appendChild(dynTableBody);mainDiv.appendChild(dynTable);var t=new SortableTable(document.getElementById('interestRateTable'),100);t.sort(document.getElementById('defaultSortResidential'));}
else
{document.getElementById('tableDataDivResidential').innerHTML="<font size='4'> No Results Found !!! </font>";}}
function displayDataRepairs(loanAmount)
{var hlRateList=new Array();hlRateList=loanAmountWiseHLRateListRepairs[loanAmount];if(hlRateList!=undefined)
{document.getElementById('tableDataDivRepairs').innerHTML="";var mainDiv=document.getElementById("tableDataDivRepairs");var attributesKeys=new Array('id','width','border','cellpadding','cellspacing','bgcolor');var attributesValues=new Array('interestRateTableRepairs','692','0','2','1','#E0D7B1');var dynTable=createDynamicObject('table',attributesKeys,attributesValues);var dynTableHead=document.createElement("thead");var dynTableHeadRow=document.createElement("tr");var dynTableHeadRowLeft=document.createElement("td");dynTableHeadRowLeft.setAttribute('width','1px');dynTableHeadRow.appendChild(dynTableHeadRowLeft);var attributesKeys=new Array('style','width','height','bgcolor');var attributesValues=new Array('cursor:pointer','127','24','#EBE4CD');var dynTableHeadCell1=createDynamicObject('td',attributesKeys,attributesValues);dynTableHeadCell1.innerHTML="<strong> Bank/product name </strong>";dynTableHeadRow.appendChild(dynTableHeadCell1);var attributesKeys=new Array('class','width','align','bgcolor');var attributesValues=new Array('nosort','70','center','#EBE4CD');var dynTableHeadCell2=createDynamicObject('td',attributesKeys,attributesValues);dynTableHeadCell2.innerHTML="<strong> Interest rate type </strong>";dynTableHeadRow.appendChild(dynTableHeadCell2);var attributesKeys=new Array('id','style','width','align','bgcolor');var attributesValues=new Array('defaultSortRepairs','cursor:pointer','78','center','#EBE4CD');var dynTableHeadCell3=createDynamicObject('td',attributesKeys,attributesValues);dynTableHeadCell3.innerHTML="<strong> 5 yrs </strong>";dynTableHeadRow.appendChild(dynTableHeadCell3);var attributesKeys=new Array('style','width','align','bgcolor');var attributesValues=new Array('cursor:pointer','70','center','#EBE4CD');var dynTableHeadCell4=createDynamicObject('td',attributesKeys,attributesValues);dynTableHeadCell4.innerHTML="<strong> 10 yrs </strong>";dynTableHeadRow.appendChild(dynTableHeadCell4);var attributesKeys=new Array('style','width','align','bgcolor');var attributesValues=new Array('cursor:pointer','98','center','#EBE4CD');var dynTableHeadCell5=createDynamicObject('td',attributesKeys,attributesValues);dynTableHeadCell5.innerHTML="<strong> 15 yrs </strong>";dynTableHeadRow.appendChild(dynTableHeadCell5);var attributesKeys=new Array('style','width','align','bgcolor');var attributesValues=new Array('cursor:pointer','68','center','#EBE4CD');var dynTableHeadCell6=createDynamicObject('td',attributesKeys,attributesValues);dynTableHeadCell6.innerHTML="<strong> 20 yrs </strong>";dynTableHeadRow.appendChild(dynTableHeadCell6);var attributesKeys=new Array('style','width','align','bgcolor');var attributesValues=new Array('cursor:pointer','68','center','#EBE4CD');var dynTableHeadCell7=createDynamicObject('td',attributesKeys,attributesValues);dynTableHeadCell7.innerHTML="<strong> 25 yrs </strong>";dynTableHeadRow.appendChild(dynTableHeadCell7);var dynTableHeadRowRight=document.createElement("td");dynTableHeadRowRight.setAttribute('width','1px');dynTableHeadRow.appendChild(dynTableHeadRowRight);dynTableHead.appendChild(dynTableHeadRow);dynTable.appendChild(dynTableHead);var floatArray=new Array('5-1','10-1','15-1','20-1','25-1');var fixedArray1=new Array('5-2','10-2','15-2','20-2','25-2');var fixedArray2=new Array('5-3','10-3','15-3','20-3','25-3');var dynTableBody=document.createElement("tbody");var rowIndex=0;for(i=0;i<hlRateList.length;i++)
{var loanAmtList=hlRateList[i].tenureInterestRate;var floatFlag=5;for(j=0;j<floatArray.length;j++)
{if(loanAmtList[floatArray[j]]==undefined&&loanAmtList[floatArray[j]]==0)
{floatFlag--;}}
if(floatFlag==5)
{var dynTableRow1=document.createElement("tr");if(rowIndex%2==0)
{dynTableRow1.setAttribute('bgcolor','#F9F8F0');}
else
{dynTableRow1.setAttribute('bgcolor','#FFFFFF');}
var dynTableCellLeft=document.createElement("td");dynTableCellLeft.setAttribute('bgcolor','#ffffff');dynTableRow1.appendChild(dynTableCellLeft);var dynTableCell1=document.createElement("td");dynTableCell1.setAttribute('id','bankName_'+rowIndex);dynTableCell1.setAttribute('height','24');dynTableCell1.setAttribute('width','127');dynTableCell1.innerHTML="<strong>"+hlRateList[i].bankName+"</strong>";dynTableRow1.appendChild(dynTableCell1);var dynTableCell2=document.createElement("td");dynTableCell2.setAttribute('id','rateType_'+rowIndex);dynTableCell2.setAttribute('width','57');dynTableCell2.setAttribute('align','center');dynTableCell2.appendChild(document.createTextNode("Floating"));dynTableRow1.appendChild(dynTableCell2);for(j=0;j<floatArray.length;j++)
{var dynTableCellFloat=document.createElement("td");dynTableCellFloat.setAttribute('align','center');if(loanAmtList[floatArray[j]]&&loanAmtList[floatArray[j]]!=0.0)
{dynTableCellFloat.innerHTML=loanAmtList[floatArray[j]];}
else
{dynTableCellFloat.appendChild(document.createTextNode("NA"));}
dynTableRow1.appendChild(dynTableCellFloat);}
var dynTableCellRight=document.createElement("td");dynTableCellRight.setAttribute('bgcolor','#ffffff');dynTableRow1.appendChild(dynTableCellRight);dynTableBody.appendChild(dynTableRow1);rowIndex++;}
var fixedFlag=5;for(j=0;j<fixedArray1.length;j++)
{if((!loanAmtList[fixedArray1[j]]||loanAmtList[fixedArray1[j]]==0)&&(!loanAmtList[fixedArray2[j]]||loanAmtList[fixedArray2[j]]==0))
{fixedFlag--;}}
if(fixedFlag==5)
{var dynTableRow2=document.createElement("tr");if(rowIndex%2==0)
{dynTableRow2.setAttribute('bgcolor','#F9F8F0');}
else
{dynTableRow2.setAttribute('bgcolor','#FFFFFF');}
var dynTableCell1=document.createElement("td");dynTableCell1.setAttribute('id','bankName_'+rowIndex);dynTableCell1.setAttribute('height','24');dynTableCell1.setAttribute('width','127');dynTableCell1.innerHTML="<strong>"+hlRateList[i].bankName+"</strong>";dynTableRow2.appendChild(dynTableCell1);var dynTableCell2=document.createElement("td");dynTableCell2.setAttribute('id','rateType_'+rowIndex);dynTableCell2.setAttribute('width','57');dynTableCell2.setAttribute('align','center');dynTableCell2.appendChild(document.createTextNode("Fixed"));dynTableRow2.appendChild(dynTableCell2);for(j=0;j<fixedArray1.length;j++)
{var dynTableCellFixed=document.createElement("td");dynTableCellFixed.setAttribute('align','center');if(loanAmtList[fixedArray1[j]]&&loanAmtList[fixedArray1[j]]!=0.0)
{dynTableCellFixed.appendChild(document.createTextNode(loanAmtList[fixedArray1[j]]));}
else if(loanAmtList[fixedArray2[j]]&&loanAmtList[fixedArray2[j]]!=0.0)
{dynTableCellFixed.appendChild(document.createTextNode(loanAmtList[fixedArray2[j]]));}
else
{dynTableCellFixed.appendChild(document.createTextNode("NA"));}
dynTableRow2.appendChild(dynTableCellFixed);}
var dynTableCellRight=document.createElement("td");dynTableRow2.appendChild(dynTableCellRight);dynTableBody.appendChild(dynTableRow2);rowIndex++;}}
dynTable.appendChild(dynTableBody);mainDiv.appendChild(dynTable);var t=new SortableTable(document.getElementById('interestRateTableRepairs'));t.sort(document.getElementById('defaultSortRepairs'));}
else
{document.getElementById('tableDataDivRepairs').innerHTML="<font size='4'> No Results Found !!! </font>";}}
function displayDataPlotOfLand(loanAmount)
{var hlRateList=new Array();hlRateList=loanAmountWiseHLRateListPlotOfLand[loanAmount];if(hlRateList!=undefined)
{document.getElementById('tableDataDivPlotOfLand').innerHTML="";var mainDiv=document.getElementById("tableDataDivPlotOfLand");var attributesKeys=new Array('id','width','border','cellpadding','cellspacing','bgcolor');var attributesValues=new Array('interestRateTablePlotOfLand','692','0','2','1','#E0D7B1');var dynTable=createDynamicObject('table',attributesKeys,attributesValues);var dynTableHead=document.createElement("thead");var dynTableHeadRow=document.createElement("tr");var dynTableHeadRowLeft=document.createElement("td");dynTableHeadRowLeft.setAttribute('width','1px');dynTableHeadRow.appendChild(dynTableHeadRowLeft);var attributesKeys=new Array('style','width','height','bgcolor');var attributesValues=new Array('cursor:pointer','127','24','#EBE4CD');var dynTableHeadCell1=createDynamicObject('td',attributesKeys,attributesValues);dynTableHeadCell1.innerHTML="<strong> Bank/product name </strong>";dynTableHeadRow.appendChild(dynTableHeadCell1);var attributesKeys=new Array('class','width','align','bgcolor');var attributesValues=new Array('nosort','70','center','#EBE4CD');var dynTableHeadCell2=createDynamicObject('td',attributesKeys,attributesValues);dynTableHeadCell2.innerHTML="<strong> Interest rate type </strong>";dynTableHeadRow.appendChild(dynTableHeadCell2);var attributesKeys=new Array('style','id','width','align','bgcolor');var attributesValues=new Array('cursor:pointer','defaultSortPlotOfLand','78','center','#EBE4CD');var dynTableHeadCell3=createDynamicObject('td',attributesKeys,attributesValues);dynTableHeadCell3.innerHTML="<strong> 5 yrs </strong>";dynTableHeadRow.appendChild(dynTableHeadCell3);var attributesKeys=new Array('style','width','align','bgcolor');var attributesValues=new Array('cursor:pointer','70','center','#EBE4CD');var dynTableHeadCell4=createDynamicObject('td',attributesKeys,attributesValues);dynTableHeadCell4.innerHTML="<strong> 10 yrs </strong>";dynTableHeadRow.appendChild(dynTableHeadCell4);var attributesKeys=new Array('style','width','align','bgcolor');var attributesValues=new Array('cursor:pointer','98','center','#EBE4CD');var dynTableHeadCell5=createDynamicObject('td',attributesKeys,attributesValues);dynTableHeadCell5.innerHTML="<strong> 15 yrs </strong>";dynTableHeadRow.appendChild(dynTableHeadCell5);var attributesKeys=new Array('style','width','align','bgcolor');var attributesValues=new Array('cursor:pointer','68','center','#EBE4CD');var dynTableHeadCell6=createDynamicObject('td',attributesKeys,attributesValues);dynTableHeadCell6.innerHTML="<strong> 20 yrs </strong>";dynTableHeadRow.appendChild(dynTableHeadCell6);var attributesKeys=new Array('style','width','align','bgcolor');var attributesValues=new Array('cursor:pointer','68','center','#EBE4CD');var dynTableHeadCell7=createDynamicObject('td',attributesKeys,attributesValues);dynTableHeadCell7.innerHTML="<strong> 25 yrs </strong>";dynTableHeadRow.appendChild(dynTableHeadCell7);var dynTableHeadRowRight=document.createElement("td");dynTableHeadRowRight.setAttribute('width','1px');dynTableHeadRow.appendChild(dynTableHeadRowRight);dynTableHead.appendChild(dynTableHeadRow);dynTable.appendChild(dynTableHead);var floatArray=new Array('5-1','10-1','15-1','20-1','25-1');var fixedArray1=new Array('5-2','10-2','15-2','20-2','25-2');var fixedArray2=new Array('5-3','10-3','15-3','20-3','25-3');var dynTableBody=document.createElement("tbody");var rowIndex=0;for(i=0;i<hlRateList.length;i++)
{var loanAmtList=hlRateList[i].tenureInterestRate;var floatFlag=6;for(j=0;j<floatArray.length;j++)
{if(loanAmtList[floatArray[j]]==undefined&&loanAmtList[floatArray[j]]==0)
{floatFlag--;}}
if(floatFlag==6)
{var dynTableRow1=document.createElement("tr");if(rowIndex%2==0)
{dynTableRow1.setAttribute('bgcolor','#F9F8F0');}
else
{dynTableRow1.setAttribute('bgcolor','#FFFFFF');}
var dynTableCellLeft=document.createElement("td");dynTableCellLeft.setAttribute('bgcolor','#ffffff');dynTableRow1.appendChild(dynTableCellLeft);var dynTableCell1=document.createElement("td");dynTableCell1.setAttribute('id','bankName_'+rowIndex);dynTableCell1.setAttribute('height','24');dynTableCell1.setAttribute('width','127');dynTableCell1.innerHTML="<strong>"+hlRateList[i].bankName+"</strong>";dynTableRow1.appendChild(dynTableCell1);var dynTableCell2=document.createElement("td");dynTableCell2.setAttribute('id','rateType_'+rowIndex);dynTableCell2.setAttribute('width','57');dynTableCell2.setAttribute('align','center');dynTableCell2.appendChild(document.createTextNode("Floating"));dynTableRow1.appendChild(dynTableCell2);for(j=0;j<floatArray.length;j++)
{var dynTableCellFloat=document.createElement("td");dynTableCellFloat.setAttribute('align','center');if(loanAmtList[floatArray[j]]&&loanAmtList[floatArray[j]]!=0.0)
{dynTableCellFloat.innerHTML=loanAmtList[floatArray[j]];}
else
{dynTableCellFloat.appendChild(document.createTextNode("NA"));}
dynTableRow1.appendChild(dynTableCellFloat);}
var dynTableCellRight=document.createElement("td");dynTableCellRight.setAttribute('bgcolor','#ffffff');dynTableRow1.appendChild(dynTableCellRight);dynTableBody.appendChild(dynTableRow1);rowIndex++;}
var fixedFlag=6;for(j=0;j<fixedArray1.length;j++)
{if((!loanAmtList[fixedArray1[j]]||loanAmtList[fixedArray1[j]]==0)&&(!loanAmtList[fixedArray2[j]]||loanAmtList[fixedArray2[j]]==0))
{fixedFlag--;}}
if(fixedFlag==6)
{var dynTableRow2=document.createElement("tr");if(rowIndex%2==0)
{dynTableRow2.setAttribute('bgcolor','#F9F8F0');}
else
{dynTableRow2.setAttribute('bgcolor','#FFFFFF');}
var dynTableCell1=document.createElement("td");dynTableCell1.setAttribute('id','bankName_'+rowIndex);dynTableCell1.setAttribute('height','24');dynTableCell1.setAttribute('width','127');dynTableCell1.innerHTML="<strong>"+hlRateList[i].bankName+"</strong>";dynTableRow2.appendChild(dynTableCell1);var dynTableCell2=document.createElement("td");dynTableCell2.setAttribute('id','rateType_'+rowIndex);dynTableCell2.setAttribute('width','57');dynTableCell2.setAttribute('align','center');dynTableCell2.appendChild(document.createTextNode("Fixed"));dynTableRow2.appendChild(dynTableCell2);for(j=0;j<fixedArray1.length;j++)
{var dynTableCellFixed=document.createElement("td");dynTableCellFixed.setAttribute('align','center');if(loanAmtList[fixedArray1[j]]&&loanAmtList[fixedArray1[j]]!=0.0)
{dynTableCellFixed.appendChild(document.createTextNode(loanAmtList[fixedArray1[j]]));}
else if(loanAmtList[fixedArray2[j]]&&loanAmtList[fixedArray2[j]]!=0.0)
{dynTableCellFixed.appendChild(document.createTextNode(loanAmtList[fixedArray2[j]]));}
else
{dynTableCellFixed.appendChild(document.createTextNode("NA"));}
dynTableRow2.appendChild(dynTableCellFixed);}
var dynTableCellRight=document.createElement("td");dynTableRow2.appendChild(dynTableCellRight);dynTableBody.appendChild(dynTableRow2);rowIndex++;}}
dynTable.appendChild(dynTableBody);mainDiv.appendChild(dynTable);var t=new SortableTable(document.getElementById('interestRateTablePlotOfLand'));t.sort(document.getElementById('defaultSortPlotOfLand'));}
else
{document.getElementById('tableDataDivPlotOfLand').innerHTML="<font size='4'> No Results Found !!! </font>";}}
function displayDataTransferExistingLoan(loanAmount)
{var hlRateList=new Array();hlRateList=loanAmountWiseHLRateListTransferExistingLoan[loanAmount];if(hlRateList!=undefined)
{document.getElementById('tableDataDivTransferExistingLoan').innerHTML="";var mainDiv=document.getElementById("tableDataDivTransferExistingLoan");var attributesKeys=new Array('id','width','border','cellpadding','cellspacing','bgcolor');var attributesValues=new Array('interestRateTableTransferExistingLoan','692','0','2','1','#E0D7B1');var dynTable=createDynamicObject('table',attributesKeys,attributesValues);var dynTableHead=document.createElement("thead");var dynTableHeadRow=document.createElement("tr");var dynTableHeadRowLeft=document.createElement("td");dynTableHeadRowLeft.setAttribute('width','1px');dynTableHeadRow.appendChild(dynTableHeadRowLeft);var attributesKeys=new Array('style','width','height','bgcolor');var attributesValues=new Array('cursor:pointer','127','24','#EBE4CD');var dynTableHeadCell1=createDynamicObject('td',attributesKeys,attributesValues);dynTableHeadCell1.innerHTML="<strong> Bank/product name </strong>";dynTableHeadRow.appendChild(dynTableHeadCell1);var attributesKeys=new Array('class','width','align','bgcolor');var attributesValues=new Array('nosort','70','center','#EBE4CD');var dynTableHeadCell2=createDynamicObject('td',attributesKeys,attributesValues);dynTableHeadCell2.innerHTML="<strong> Interest rate type </strong>";dynTableHeadRow.appendChild(dynTableHeadCell2);var attributesKeys=new Array('style','id','width','align','bgcolor');var attributesValues=new Array('cursor:pointer','defaultSortTransferExistingLoan','78','center','#EBE4CD');var dynTableHeadCell3=createDynamicObject('td',attributesKeys,attributesValues);dynTableHeadCell3.innerHTML="<strong> 5 yrs </strong>";dynTableHeadRow.appendChild(dynTableHeadCell3);var attributesKeys=new Array('style','width','align','bgcolor');var attributesValues=new Array('cursor:pointer','70','center','#EBE4CD');var dynTableHeadCell4=createDynamicObject('td',attributesKeys,attributesValues);dynTableHeadCell4.innerHTML="<strong> 10 yrs </strong>";dynTableHeadRow.appendChild(dynTableHeadCell4);var attributesKeys=new Array('style','width','align','bgcolor');var attributesValues=new Array('cursor:pointer','98','center','#EBE4CD');var dynTableHeadCell5=createDynamicObject('td',attributesKeys,attributesValues);dynTableHeadCell5.innerHTML="<strong> 15 yrs </strong>";dynTableHeadRow.appendChild(dynTableHeadCell5);var attributesKeys=new Array('style','width','align','bgcolor');var attributesValues=new Array('cursor:pointer','68','center','#EBE4CD');var dynTableHeadCell6=createDynamicObject('td',attributesKeys,attributesValues);dynTableHeadCell6.innerHTML="<strong> 20 yrs </strong>";dynTableHeadRow.appendChild(dynTableHeadCell6);var attributesKeys=new Array('style','width','align','bgcolor');var attributesValues=new Array('cursor:pointer','68','center','#EBE4CD');var dynTableHeadCell7=createDynamicObject('td',attributesKeys,attributesValues);dynTableHeadCell7.innerHTML="<strong> 25 yrs </strong>";dynTableHeadRow.appendChild(dynTableHeadCell7);var dynTableHeadRowRight=document.createElement("td");dynTableHeadRowRight.setAttribute('width','1px');dynTableHeadRow.appendChild(dynTableHeadRowRight);dynTableHead.appendChild(dynTableHeadRow);dynTable.appendChild(dynTableHead);var floatArray=new Array('5-1','10-1','15-1','20-1','25-1');var fixedArray1=new Array('5-2','10-2','15-2','20-2','25-2');var fixedArray2=new Array('5-3','10-3','15-3','20-3','25-3');var dynTableBody=document.createElement("tbody");var rowIndex=0;for(i=0;i<hlRateList.length;i++)
{var loanAmtList=hlRateList[i].tenureInterestRate;var floatFlag=6;for(j=0;j<floatArray.length;j++)
{if(loanAmtList[floatArray[j]]==undefined&&loanAmtList[floatArray[j]]==0)
{floatFlag--;}}
if(floatFlag==6)
{var dynTableRow1=document.createElement("tr");if(rowIndex%2==0)
{dynTableRow1.setAttribute('bgcolor','#F9F8F0');}
else
{dynTableRow1.setAttribute('bgcolor','#FFFFFF');}
var dynTableCellLeft=document.createElement("td");dynTableCellLeft.setAttribute('bgcolor','#ffffff');dynTableRow1.appendChild(dynTableCellLeft);var dynTableCell1=document.createElement("td");dynTableCell1.setAttribute('height','24');dynTableCell1.setAttribute('width','127');dynTableCell1.innerHTML="<strong>"+hlRateList[i].bankName+"</strong>";dynTableRow1.appendChild(dynTableCell1);var dynTableCell2=document.createElement("td");dynTableCell2.setAttribute('width','57');dynTableCell2.setAttribute('align','center');dynTableCell2.appendChild(document.createTextNode("Floating"));dynTableRow1.appendChild(dynTableCell2);for(j=0;j<floatArray.length;j++)
{var dynTableCellFloat=document.createElement("td");dynTableCellFloat.setAttribute('align','center');if(loanAmtList[floatArray[j]]&&loanAmtList[floatArray[j]]!=0.0)
{dynTableCellFloat.innerHTML=loanAmtList[floatArray[j]];}
else
{dynTableCellFloat.appendChild(document.createTextNode("NA"));}
dynTableRow1.appendChild(dynTableCellFloat);}
var dynTableCellRight=document.createElement("td");dynTableCellRight.setAttribute('bgcolor','#ffffff');dynTableRow1.appendChild(dynTableCellRight);dynTableBody.appendChild(dynTableRow1);rowIndex++;}
var fixedFlag=6;for(j=0;j<fixedArray1.length;j++)
{if((!loanAmtList[fixedArray1[j]]||loanAmtList[fixedArray1[j]]==0)&&(!loanAmtList[fixedArray2[j]]||loanAmtList[fixedArray2[j]]==0))
{fixedFlag--;}}
if(fixedFlag==6)
{var dynTableRow2=document.createElement("tr");if(rowIndex%2==0)
{dynTableRow2.setAttribute('bgcolor','#F9F8F0');}
else
{dynTableRow2.setAttribute('bgcolor','#FFFFFF');}
var dynTableCell1=document.createElement("td");dynTableCell1.setAttribute('height','24');dynTableCell1.setAttribute('width','127');dynTableCell1.innerHTML="<strong>"+hlRateList[i].bankName+"</strong>";dynTableRow2.appendChild(dynTableCell1);var dynTableCell2=document.createElement("td");dynTableCell2.setAttribute('width','57');dynTableCell2.setAttribute('align','center');dynTableCell2.appendChild(document.createTextNode("Fixed"));dynTableRow2.appendChild(dynTableCell2);for(j=0;j<fixedArray1.length;j++)
{var dynTableCellFixed=document.createElement("td");dynTableCellFixed.setAttribute('align','center');if(loanAmtList[fixedArray1[j]]&&loanAmtList[fixedArray1[j]]!=0.0)
{dynTableCellFixed.appendChild(document.createTextNode(loanAmtList[fixedArray1[j]]));}
else if(loanAmtList[fixedArray2[j]]&&loanAmtList[fixedArray2[j]]!=0.0)
{dynTableCellFixed.appendChild(document.createTextNode(loanAmtList[fixedArray2[j]]));}
else
{dynTableCellFixed.appendChild(document.createTextNode("NA"));}
dynTableRow2.appendChild(dynTableCellFixed);}
var dynTableCellRight=document.createElement("td");dynTableRow2.appendChild(dynTableCellRight);dynTableBody.appendChild(dynTableRow2);rowIndex++;}}
dynTable.appendChild(dynTableBody);mainDiv.appendChild(dynTable);var t=new SortableTable(document.getElementById('interestRateTableTransferExistingLoan'));t.sort(document.getElementById('defaultSortTransferExistingLoan'));}
else
{document.getElementById('tableDataDivTransferExistingLoan').innerHTML="<font size='4'> No Results Found !!! </font>";}}
function swapImage(obj,srcFileName)
{obj.src=srcFileName;}
function validateSubdomainCampaignFormInsure(productId)
{if(document.getElementById("name").value==""||!isNaN(document.getElementById("name").value))
{alert("Please enter a valid name");document.getElementById("name").focus();return false;}
if(document.getElementById('mobile').value==''||isNaN(document.getElementById('mobile').value)||document.getElementById('mobile').value.length<10||(document.getElementById("mobile").value.indexOf(9)!=0&&document.getElementById("mobile").value.indexOf(8)!=0&&document.getElementById("mobile").value.indexOf(7)!=0)||document.getElementById('mobile').value.length>10)
{alert("Please enter a valid mobile number");document.getElementById("mobile").value='';document.getElementById("mobile").focus();return false;}
if(document.getElementById("dobDay").value=="0"||document.getElementById("dobMonth").value=="0"||document.getElementById("dobYear").value=="0")
{if(document.getElementById("dobDay").value=="0")
{alert("Please select a valid 'day' for your Date of Birth");return false;}
if(document.getElementById("dobMonth").value=="0")
{alert("Please select a valid 'month' for your Date of Birth");return false;}
if(document.getElementById("dobYear").value=="0")
{alert("Please select a valid 'year' for your Date of Birth");return false;}}
if(!validateEmail(document.getElementById("email").value))
{document.getElementById("email").focus();return false;}
if(productId==1||productId==2)
{if(isNaN(document.getElementById("income").value)||document.getElementById("income").value=="")
{alert("Please enter a valid monthly income");document.getElementById("income").focus();return false;}
if(isNaN(document.getElementById("loanAmount").value)||document.getElementById("loanAmount").value=="")
{alert("Please enter a valid Loan amount");document.getElementById("loanAmount").focus();return false;}}
if(productId==4)
{var newCarElem=document.getElementById("newCar");var oldCarElem=document.getElementById("oldCar");if(typeof newCarElem!='undefined'&&typeof oldCarElem!='undefined'&&(!newCarElem.checked)&&(!oldCarElem.checked))
{alert("Please select Loan for (Old/New)");return false;}}
if(productId==9||productId==8)
{var hasCreditCardYesElem=document.getElementById("hasCreditCardYes");var hasCreditCardNoElem=document.getElementById("hasCreditCardNo");if(typeof hasCreditCardNoElem!='undefined'&&typeof hasCreditCardYesElem!='undefined'&&(!hasCreditCardYesElem.checked)&&(!hasCreditCardNoElem.checked))
{alert("Do u have Credit Card ?");document.getElementById("hasCreditCardYes").focus();return false;}}
if(productId==9)
{if(document.getElementById("manufacturer").value=="0"&&document.getElementById("models").value=="0")
{alert("Please select a manufacturer and corresponding model");return false;}
if(document.getElementById("manufacturer").value=="0")
{alert("Please select a manufacturer");return false;}
if(document.getElementById("models").value=="0")
{alert("Please select a Model");return false;}}
var cityElement=document.getElementById("formRegistration").city;var cityTextBoxElement=document.getElementById("formRegistration").cityTextBox;if(cityElement.value=="0")
{alert("Please select city");cityTextBoxElement.focus();return false;}
if(typeof(formRegistration)=='undefined'||formRegistration==null){formRegistration=document.getElementById('formRegistration');}
var benefit=formRegistration.benefit;if(typeof benefit!='undefined')
{for(var i=0;i<benefit.length;i++)
{if(benefit[i].checked)
{filledIn=true;}}
if(benefit.value!=null&&benefit.value!='')
{filledIn=true;}
if(!filledIn)
{alert('Please select at least one benefit you are looking for!');return(false);}}
var filledIn=false;for(var counter=0;counter<formRegistration.bankId.length;counter++)
{if(formRegistration.bankId[counter].checked)
{filledIn=true;}
if(formRegistration.bankId.checked)
{filledIn=true;}}
if(!filledIn){var msg;if(productId>=7)
{msg="Please select at least one insurance company to proceed!";}
else
{msg="Please select at least one bank to proceed!";}
alert(msg);return(false);}
if(!document.getElementById("checkTerms").checked)
{alert("Please check terms & condition check box");document.getElementById('checkTerms').focus();return false;}
var apnaExchangePolicyElem=document.getElementById("apnaExchangePolicy");var apnaExchangeCheckBoxValueElem=document.getElementById("apnaExchangeCheckBoxValue");if(apnaExchangePolicyElem&&apnaExchangePolicyElem.checked)
{apnaExchangeCheckBoxValueElem.value="checked";apnaExchangePolicyElem.value="Y";}
else
{if(typeof apnaExchangeCheckBoxValueElem!="undefined"&&apnaExchangeCheckBoxValueElem!=null)
{apnaExchangeCheckBoxValueElem.value="unchecked";}}
var bankIds=new Array();for(i=0,j=0;i<document.formRegistration.bankId.length;i++)
{if(document.formRegistration.bankId[i].checked)
{bankIds[j]=document.formRegistration.bankId[i].value;j++;}}
var city=document.getElementById("city").value;reportClickForMarketPlace(bankIds,productId,"marketPlace",city);document.getElementById('campaignId').value=getURLParamSub('AdGroupId');document.formRegistration.submit();}
function validateMarketPlaceForm(productId)
{var formRegistration=document.getElementById("formRegistration");if(formRegistration.product.value==0)
{alert("Please select product");formRegistration.product.focus();return false;}
if(formRegistration.name.value==""||formRegistration.name.value=="Name"||!isNaN(formRegistration.name.value))
{alert("Please enter a valid name");formRegistration.name.focus();return false;}
if(formRegistration.dobDay.value=="0"||formRegistration.dobMonth.value=="0"||formRegistration.dobYear.value=="0")
{if(formRegistration.dobDay.value=="0")
{alert("Please select a valid 'day' for your Date of Birth");return false;}
if(formRegistration.dobMonth.value=="0")
{alert("Please select a valid 'month' for your Date of Birth");return false;}
if(formRegistration.dobYear.value=="0")
{alert("Please select a valid 'year' for your Date of Birth");return false;}}
var city=formRegistration.city.value;if(formRegistration.city.value=="0")
{alert("Please choose your city");formRegistration.city.focus();return false;}
if(!validateEmail(formRegistration.email.value))
{formRegistration.email.focus();return false;}
if(formRegistration.mobile.value==''||isNaN(formRegistration.mobile.value)||formRegistration.mobile.value.length<10||(formRegistration.mobile.value.indexOf(9)!=0&&formRegistration.mobile.value.indexOf(8)!=0&&formRegistration.mobile.value.indexOf(7)!=0)||formRegistration.mobile.value.length>10)
{alert("Please enter valid mobile number");formRegistration.mobile.value='';formRegistration.mobile.focus();return false;}
if(productId==1||productId==2||productId==12||productId==4)
{if(apnaloan.isNotNull(formRegistration.loanAmt))
{if(formRegistration.loanAmt.value=="")
{alert("Please enter Loan Amount");formRegistration.loanAmt.focus();return false;}
var i=formRegistration.loanAmt.value.replace(/,/g,"");if(isNaN(i))
{alert("Please enter number only in Loan Amount");formRegistration.loanAmt.value="";formRegistration.loanAmt.focus();return false;}}
if(apnaloan.isNotNull(formRegistration.monthlyIncome))
{if(formRegistration.monthlyIncome.value=="")
{alert("Please enter Monthly Income");formRegistration.monthlyIncome.focus();return false;}
var j=formRegistration.monthlyIncome.value.replace(/,/g,"");if(isNaN(j))
{alert("Please enter number only in Monthly Income");formRegistration.monthlyIncome.value="";formRegistration.monthlyIncome.focus();return false;}}}
if(productId==8||productId==9)
{if(apnaloan.isNotNull(document.getElementById("creditCardYes"))&&apnaloan.isNotNull(document.getElementById("creditCardNo")))
{if((!document.getElementById("creditCardYes").checked)&&(!document.getElementById("creditCardNo").checked))
{alert("Do u have Credit Card ?");document.getElementById("creditCardYes").focus();return false;}}}
if(productId==4)
{if(apnaloan.isNotNull(document.getElementById("carTypeNew"))&&apnaloan.isNotNull(document.getElementById("carTypeOld")))
{if((!document.getElementById("carTypeNew").checked)&&(!document.getElementById("carTypeOld").checked))
{alert("Select Type of car");document.getElementById("carTypeNew").focus();return false;}}
if(document.getElementById('manufacturer').selectedIndex==0)
{alert("Please select car manufacturer");return false;}}
if(productId==7)
{if(apnaloan.isNotNull(document.getElementById("planForRetirement"))&&apnaloan.isNotNull(document.getElementById("planForChildsFuture"))&&apnaloan.isNotNull(document.getElementById("riskCover")))
{if((!document.getElementById("planForRetirement").checked)&&(!document.getElementById("planForChildsFuture").checked)&&(!document.getElementById("riskCover").checked))
{alert("Select Main Benefit");document.getElementById("planForRetirement").focus();return false;}}}
if(productId==12)
{var propertyElem=document.getElementById("propertyValue");if(apnaloan.isNotNull(propertyElem))
{if(apnaloan.trim(propertyElem.value)=="")
{alert("Please enter Property Value");propertyElem.focus();return false;}
var tmp=propertyElem.value.replace(/,/g,"");if(isNaN(tmp))
{alert("Please enter number only in Property Value");propertyElem.value="";propertyElem.focus();return false;}}}
var filledIn=false;for(var counter=0;counter<formRegistration.bankId.length;counter++)
{if(formRegistration.bankId[counter].checked)
{filledIn=true;}
if(formRegistration.bankId.checked)
{filledIn=true;}}
var elem=document.getElementsByName("anyBrand");if(elem.length>0)
{for(var e=0;e<elem.length;e++)
{if(elem[e].checked)
{filledIn=true;break;}}
var pCount=document.getElementById("principalCount_"+productId).value;if(parseInt(pCount)>0)
{var strAllPrincipal=null;for(var b=0;b<pCount;b++)
{if(b==0)
strAllPrincipal=document.getElementById("bankId_"+productId+"_"+b).value;else strAllPrincipal=strAllPrincipal+","+document.getElementById("bankId_"+productId+"_"+b).value;}
document.getElementById("allPrincipalIds").value=strAllPrincipal;}}
if(!filledIn){alert('Please select at least one Company to proceed!');return(false);}
if(!formRegistration.checkTerms.checked)
{alert("Please check Terms & condition check box");formRegistration.checkTerms.focus();return false;}
if(document.getElementById("apnaExchangeCheckBox").checked){document.getElementById("apnaExchangePolicy").value="Y";}
else{document.getElementById("apnaExchangePolicy").value="N";}
var apnaExchangePolicyElem=document.getElementById("apnaExchangePolicy1");var apnaExchangeCheckBoxValueElem=document.getElementById("apnaExchangeCheckBoxValue");if(apnaExchangePolicyElem)
{if(apnaExchangePolicyElem&&apnaExchangePolicyElem.checked)
{apnaExchangeCheckBoxValueElem.value="checked";apnaExchangePolicyElem.value="Y";}
else
{apnaExchangeCheckBoxValueElem.value="unchecked";}}
formRegistration.campaignId.value=getURLParamSub('AdGroupId');var bankIds=new Array();for(i=0,j=0;i<document.formRegistration.bankId.length;i++)
{if(document.formRegistration.bankId[i].checked)
{bankIds[j]=document.formRegistration.bankId[i].value;j++;}}
var locationArray=location.href.split(".");var actionUri=locationArray[0];if(productId==7||productId==8||productId==9){actionUri+=".apnainsurance.com/simple-search-result.html";}
else{actionUri+=".apnaloan.com/simple-search-result.html"}
document.formRegistration.action=actionUri;if(apnaloan.isNotNull(formRegistration.loanAmount)){formRegistration.loanAmount.value=formRegistration.loanAmount.value.replace(/,/g,"");}
if(apnaloan.isNotNull(formRegistration.income)){formRegistration.income.value=formRegistration.income.value.replace(/,/g,"");}
reportClickForMarketPlace(bankIds,productId,"marketPlace",city);document.formRegistration.submit();}
function getURLParamSub(strParamName)
{var strReturn="";var strHref=window.location.href;if(strHref.indexOf("?")>-1)
{var strQueryString=strHref.substr(strHref.indexOf("?")).toLowerCase();var aQueryString=strQueryString.split("&");for(var iParam=0;iParam<aQueryString.length;iParam++)
{if(aQueryString[iParam].indexOf(strParamName.toLowerCase()+"=")>-1)
{var aParam=aQueryString[iParam].split("=");strReturn=aParam[1];break;}}}
return decodeURI(strReturn);}
function isValidIndianMobileNumber(mobileNo)
{if(mobileNo!=null&&mobileNo!=""&&!isNaN(mobileNo)&&mobileNo.length==10)
{var firstDigit=mobileNo.substring(0,1);return firstDigit>='7'&&firstDigit<='9';}
return false;}
function MM_swapImgRestore(){var i,x,a=document.MM_sr;for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)x.src=x.oSrc;}
function MM_findObj(n,d){var p,i,x;if(!d)d=document;if((p=n.indexOf("?"))>0&&parent.frames.length){d=parent.frames[n.substring(p+1)].document;n=n.substring(0,p);}
if(!(x=d[n])&&d.all)x=d.all[n];for(i=0;!x&&i<d.forms.length;i++)x=d.forms[i][n];for(i=0;!x&&d.layers&&i<d.layers.length;i++)x=MM_findObj(n,d.layers[i].document);if(!x&&d.getElementById)x=d.getElementById(n);return x;}
function MM_swapImage(){var i,j=0,x,a=MM_swapImage.arguments;document.MM_sr=new Array;for(i=0;i<(a.length-2);i+=3)
if((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x;if(!x.oSrc)x.oSrc=x.src;x.src=a[i+2];}}
var isIE=(navigator.appVersion.indexOf("MSIE")!=-1)?true:false;var isWin=(navigator.appVersion.toLowerCase().indexOf("win")!=-1)?true:false;var isOpera=(navigator.userAgent.indexOf("Opera")!=-1)?true:false;function ControlVersion()
{var version;var axo;var e;try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");version=axo.GetVariable("$version");}catch(e){}
if(!version)
{try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");version="WIN 6,0,21,0";axo.AllowScriptAccess="always";version=axo.GetVariable("$version");}catch(e){}}
if(!version)
{try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");version=axo.GetVariable("$version");}catch(e){}}
if(!version)
{try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");version="WIN 3,0,18,0";}catch(e){}}
if(!version)
{try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");version="WIN 2,0,0,11";}catch(e){version=-1;}}
return version;}
function GetSwfVer(){var flashVer=-1;if(navigator.plugins!=null&&navigator.plugins.length>0){if(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]){var swVer2=navigator.plugins["Shockwave Flash 2.0"]?" 2.0":"";var flashDescription=navigator.plugins["Shockwave Flash"+swVer2].description;var descArray=flashDescription.split(" ");var tempArrayMajor=descArray[2].split(".");var versionMajor=tempArrayMajor[0];var versionMinor=tempArrayMajor[1];var versionRevision=descArray[3];if(versionRevision==""){versionRevision=descArray[4];}
if(versionRevision[0]=="d"){versionRevision=versionRevision.substring(1);}else if(versionRevision[0]=="r"){versionRevision=versionRevision.substring(1);if(versionRevision.indexOf("d")>0){versionRevision=versionRevision.substring(0,versionRevision.indexOf("d"));}}
var flashVer=versionMajor+"."+versionMinor+"."+versionRevision;}}
else if(navigator.userAgent.toLowerCase().indexOf("webtv/2.6")!=-1)flashVer=4;else if(navigator.userAgent.toLowerCase().indexOf("webtv/2.5")!=-1)flashVer=3;else if(navigator.userAgent.toLowerCase().indexOf("webtv")!=-1)flashVer=2;else if(isIE&&isWin&&!isOpera){flashVer=ControlVersion();}
return flashVer;}
function DetectFlashVer(reqMajorVer,reqMinorVer,reqRevision)
{versionStr=GetSwfVer();if(versionStr==-1){return false;}else if(versionStr!=0){if(isIE&&isWin&&!isOpera){tempArray=versionStr.split(" ");tempString=tempArray[1];versionArray=tempString.split(",");}else{versionArray=versionStr.split(".");}
var versionMajor=versionArray[0];var versionMinor=versionArray[1];var versionRevision=versionArray[2];if(versionMajor>parseFloat(reqMajorVer)){return true;}else if(versionMajor==parseFloat(reqMajorVer)){if(versionMinor>parseFloat(reqMinorVer))
return true;else if(versionMinor==parseFloat(reqMinorVer)){if(versionRevision>=parseFloat(reqRevision))
return true;}}
return false;}}
function AC_AddExtension(src,ext)
{if(src.indexOf('?')!=-1)
return src.replace(/\?/,ext+'?');else
return src+ext;}
function AC_Generateobj(objAttrs,params,embedAttrs)
{var str='';if(isIE&&isWin&&!isOpera)
{str+='<object ';for(var i in objAttrs)
str+=i+'="'+objAttrs[i]+'" ';str+='>';for(var i in params)
str+='<param name="'+i+'" value="'+params[i]+'" /> ';str+='</object>';}else{str+='<embed ';for(var i in embedAttrs)
str+=i+'="'+embedAttrs[i]+'" ';str+='> </embed>';}
document.write(str);}
function AC_FL_RunContent(){var ret=AC_GetArgs
(arguments,".swf","movie","clsid:d27cdb6e-ae6d-11cf-96b8-444553540000","application/x-shockwave-flash");AC_Generateobj(ret.objAttrs,ret.params,ret.embedAttrs);}
function AC_GetArgs(args,ext,srcParamName,classid,mimeType){var ret=new Object();ret.embedAttrs=new Object();ret.params=new Object();ret.objAttrs=new Object();for(var i=0;i<args.length;i=i+2){var currArg=args[i].toLowerCase();switch(currArg){case"classid":break;case"pluginspage":ret.embedAttrs[args[i]]=args[i+1];break;case"src":case"movie":args[i+1]=AC_AddExtension(args[i+1],ext);ret.embedAttrs["src"]=args[i+1];ret.params[srcParamName]=args[i+1];break;case"onafterupdate":case"onbeforeupdate":case"onblur":case"oncellchange":case"onclick":case"ondblClick":case"ondrag":case"ondragend":case"ondragenter":case"ondragleave":case"ondragover":case"ondrop":case"onfinish":case"onfocus":case"onhelp":case"onmousedown":case"onmouseup":case"onmouseover":case"onmousemove":case"onmouseout":case"onkeypress":case"onkeydown":case"onkeyup":case"onload":case"onlosecapture":case"onpropertychange":case"onreadystatechange":case"onrowsdelete":case"onrowenter":case"onrowexit":case"onrowsinserted":case"onstart":case"onscroll":case"onbeforeeditfocus":case"onactivate":case"onbeforedeactivate":case"ondeactivate":case"type":case"codebase":ret.objAttrs[args[i]]=args[i+1];break;case"id":case"width":case"height":case"align":case"vspace":case"hspace":case"class":case"title":case"accesskey":case"name":case"tabindex":ret.embedAttrs[args[i]]=ret.objAttrs[args[i]]=args[i+1];break;default:ret.embedAttrs[args[i]]=ret.params[args[i]]=args[i+1];}}
ret.objAttrs["classid"]=classid;if(mimeType)ret.embedAttrs["type"]=mimeType;return ret;}
function getCalendarHeader(text)
{return'<table cellpadding="3" cellspacing="1" class="'+document.calendarProps.tblClass+'">'
+'<tr>'
+'<td class="'+document.calendarProps.headClass+'" style="cursor: pointer" onclick="calendarPrevYear();"><<</td>'
+'<td class="'+document.calendarProps.headClass+'" style="cursor: pointer" onclick="calendarPrevMonth();"><</td>'
+'<td class="'+document.calendarProps.headClass+'" style="cursor: pointer" onclick="calendarHide();" colspan="3">[Close]</td>'
+'<td class="'+document.calendarProps.headClass+'" style="cursor: pointer" onclick="calendarNextMonth();">></td>'
+'<td class="'+document.calendarProps.headClass+'" style="cursor: pointer" onclick="calendarNextYear();">>></td>'
+'</tr>'
+'<tr>'
+'<td colspan="7" class="'+document.calendarProps.headClass+'">'+text+'</td>'
+'</tr>'
+'<tr>';}
function drawCalendar(month,year)
{var monthNames=['January','February','March','April','May','June','July','August','September','October','November','December'];var dayNames=['Sun','Mon','Tue','Wed','Thu','Fri','Sat'];var i,html='';html+=getCalendarHeader(monthNames[month-1]+' '+year);for(i=0;i<dayNames.length;i++){html+='<td class="'+document.calendarProps.subHeadClass+'">'+dayNames[i]+'</td>';}
var date=new Date();date.setMonth(month-1);date.setFullYear(year);date.setDate(1);var days;if(month==1||month==3||month==5||month==7||month==8||month==10||month==12){days=31;}else if(month==4||month==6||month==9||month==11){days=30;}else{days=(year%4==0)?29:28;}
var firstDay=date.getDay();var firstLoop=true;html+='</tr><tr>';if(firstDay!=0){html+='<td colspan="'+firstDay+'"></td>'}
var j=firstDay;for(i=0;i<days;i++){if(j==0&&!firstLoop){html+='</tr><tr>';}
html+='<td class="'+document.calendarProps.cellClass+'" onclick="calendarOnClick(this,'+(i+1)+','+month+','+year+')">'+(i+1)+'</td>'
j=(j+1)%7;firstLoop=false;}
html+='</tr>';if(document.calendarProps.showTime){html+='<tr><td colspan="7" class="'+document.calendarProps.subHeadClass+'">Time: <select id="calHour_'+document.calendarProps.selectedId+'" onchange="calendarSetTextValue();">';var padded;for(i=0;i<12;i++){padded=(i<10)?('0'+i):i;html+='<option value="'+i+'">'+padded+'</option>';}
html+='</select>:<select id="calMins_'+document.calendarProps.selectedId+'" onchange="calendarSetTextValue();">';for(i=0;i<60;i++){padded=(i<10)?('0'+i):i;html+='<option value="'+i+'">'+padded+'</option>';}
html+='</select>&nbsp;&nbsp;<select id="calAMPM_'+document.calendarProps.selectedId+'" onchange="calendarSetTextValue();"><option value="AM">AM</option><option value="PM">PM</option></select></td></tr>';}
html+='</table>';document.getElementById(document.calendarProps.calendarId).innerHTML=html;document.getElementById(document.calendarProps.containerId).scrollIntoView();}
function initCalendar(id,showTime,boxClass,tblClass,headClass,subHeadClass,cellClass)
{if(typeof(document.calendars)=='undefined'){document.calendars=new Array();}
document.calendars[id]={};document.calendarProps={};document.calendarProps.selectedId=id;document.calendarProps.selectedYear=null;document.calendarProps.selectedMonth=null;document.calendarProps.selectedDay=null;document.calendarProps.showTime=showTime;document.calendarProps.containerId='apCalCon_'+id;document.calendarProps.calendarId='apCalTd_'+id;document.calendarProps.boxClass=(boxClass==null)?'calendarBox':boxClass;document.calendarProps.tblClass=(tblClass==null)?'calendarTbl':tblClass;document.calendarProps.headClass=(headClass==null)?'calendarHead':headClass;document.calendarProps.subHeadClass=(subHeadClass==null)?'calendarSubHead':subHeadClass;document.calendarProps.cellClass=(cellClass==null)?'calendarCell':cellClass;document.calendars[id]=document.calendarProps;document.write('<table class="'+document.calendarProps.boxClass+'" cellpadding="0" cellspacing="0" '+'id="'+document.calendarProps.containerId+'" style="display: none;"><tr><td id="'+
document.calendarProps.calendarId+'"></td></tr></table>');}
function getLeftPosition(elem)
{var result=elem.offsetLeft;elem=elem.offsetParent
while(elem){result+=elem.offsetLeft;elem=elem.offsetParent;}
return result;}
function getTopPosition(elem)
{var result=elem.offsetTop;elem=elem.offsetParent
while(elem){result+=elem.offsetTop;elem=elem.offsetParent;}
return result;}
function showCalendar(id,elem)
{if(typeof(document.calendarProps)=='undefined'){alert('No calendars initialized');return false;}
if(document.calendarProps.selectedId!=id){calendarHide();}
document.calendarProps=null;var i;for(i=0;i<document.calendars.length;i++){if(document.calendars[i]!=null&&document.calendars[i].selectedId==id){document.calendarProps=document.calendars[i];}}
if(document.calendarProps==null){alert('No such calendar: '+id);return false;}
document.calendarProps.selectedCell=null;var date=new Date();document.calendarProps.dateField=elem;document.calendarProps.month=date.getMonth()+1;document.calendarProps.year=date.getFullYear();drawCalendar(document.calendarProps.month,document.calendarProps.year);var container=document.getElementById(document.calendarProps.containerId);container.style.display='block';container.style.left=getLeftPosition(elem)+'px';container.style.top=getTopPosition(elem)+elem.offsetHeight+'px';container.scrollIntoView();return true;}
function calendarHide()
{document.getElementById(document.calendarProps.containerId).style.display='none';}
function calendarNextMonth()
{document.calendarProps.month++;if(document.calendarProps.month>12){document.calendarProps.month=1;document.calendarProps.year++;}
drawCalendar(document.calendarProps.month,document.calendarProps.year);}
function calendarPrevMonth()
{document.calendarProps.month--;if(document.calendarProps.month<1){document.calendarProps.month=12;document.calendarProps.year--;}
drawCalendar(document.calendarProps.month,document.calendarProps.year);}
function calendarNextYear()
{document.calendarProps.year++;drawCalendar(document.calendarProps.month,document.calendarProps.year);}
function calendarPrevYear()
{document.calendarProps.year--;drawCalendar(document.calendarProps.month,document.calendarProps.year);}
function calendarOnClick(cell,d,m,y)
{if(document.calendarProps.selectedCell!=null){document.calendarProps.selectedCell.setAttribute('class','calendarCell');document.calendarProps.selectedCell.setAttribute('className','calendarCell');}
document.calendarProps.selectedCell=cell;document.calendarProps.selectedYear=y;document.calendarProps.selectedMonth=m;document.calendarProps.selectedDay=d;cell.setAttribute('class','calendarSelectedCell');cell.setAttribute('className','calendarSelectedCell');calendarSetTextValue();if(!document.calendarProps.showTime){calendarHide();}}
function getCalendarPaddedDay(d)
{return(d<10)?('0'+d):d;}
function calendarSetTextValue()
{var value='';if(document.calendarProps.selectedDay!=null&&document.calendarProps.selectedMonth!=null&&document.calendarProps.selectedYear!=null){value=getCalendarPaddedDay(document.calendarProps.selectedDay)
+'-'+getCalendarPaddedDay(document.calendarProps.selectedMonth)
+'-'+document.calendarProps.selectedYear;if(document.calendarProps.showTime){var hourElem=document.getElementById('calHour_'+document.calendarProps.selectedId);var minElem=document.getElementById('calMins_'+document.calendarProps.selectedId);var amElem=document.getElementById('calAMPM_'+document.calendarProps.selectedId);var hour=hourElem.options[hourElem.selectedIndex].value;var min=minElem.options[minElem.selectedIndex].value;var ampm=amElem.options[amElem.selectedIndex].value;if(ampm=='PM'){hour=parseInt(hour)+12;}
value+=' '+getCalendarPaddedDay(hour)+':'+getCalendarPaddedDay(min)+':00';}}
document.calendarProps.dateField.value=value;}
function calendarChangeTimeHour(elem)
{var hour=elem.options[elem.selectedIndex].value;var val=document.calendarProps.dateField.value;var pos=val.indexOf(' ');var timestr=pos<0?'00:00:00':val.substring(pos+1);alert(val.substring(0,pos));document.calendarProps.dateField.value=val.substring(0,pos)+' '+timestr.replace(/^([0-9]+):(.+)/,(''+hour)+':$2');}function showAffiliatePreview(affType,affSize)
{if(affSize=="")
{alert("Please select Size of Affiliate");return false;}
if(affType=="")
{alert("Please select product");return false;}
var affiliateType=document.getElementById("affiliateType").value;var affiliateSize=document.getElementById("affiliateSize").value;var affiliateWidth=document.getElementById("affiliateWidth").value;var affiliateHeight=document.getElementById("affiliateHeight").value;var backColor=document.getElementById("backColor").value;var fontColor=document.getElementById("fontColor").value;var pattern="#";if(backColor!="")
{var backColorArr=backColor.split(pattern);backColor=backColorArr[1];}
else
{backColor="f4f4d8";}
if(fontColor!="")
{var fontColorArr=fontColor.split(pattern);fontColor=fontColorArr[1];}
else
{fontColor="000000";}
var url='/widgetBox.html?type='+affiliateType+'&size='+affiliateSize+'&id=1&backgroundColor='+backColor+'&fontColor='+fontColor;var Url='/ajax/affiliateCode.html?type='+affiliateType+'&size='+affiliateSize+'&backgroundColor='+backColor+'&fontColor='+fontColor+'&affiliateWidth='+affiliateWidth+'&affiliateHeight='+affiliateHeight;xmlHttp=window.getXmlHttpRequestObject();xmlHttp.onreadystatechange=affiliateChanged;xmlHttp.open("GET",Url,true);xmlHttp.send(null);}
function affiliateChanged()
{var affiliateType=document.getElementById("affiliateType").value;var affiliateSize=document.getElementById("affiliateSize").value;var affiliateWidth=document.getElementById("affiliateWidth").value;var affiliateHeight=document.getElementById("affiliateHeight").value;var backColor=document.getElementById("backColor").value;var fontColor=document.getElementById("fontColor").value;var pattern="#";if(backColor!="")
{var backColorArr=backColor.split(pattern);backColor=backColorArr[1];}
else
{backColor="f4f4d8";}
if(fontColor!="")
{var fontColorArr=fontColor.split(pattern);fontColor=fontColorArr[1];}
else
{fontColor="000000";}
var url='/widgetBox.html?type='+affiliateType+'&size='+affiliateSize+'&id=1&backgroundColor='+backColor+'&fontColor='+fontColor;if(xmlHttp.readyState==4)
{if(xmlHttp.responseText=="SUCCESS")
{var myRef=window.open(url,'Affiliate','left=600,top=200,resizable=0,width='+affiliateWidth+',height='+affiliateHeight);myRef.focus();return true;}
else
{alert("Choose another LoginId.");document.getElementById("loginid").focus();}}}
function setAffiliateSize(affiliateSize,affiliateWidth,affiliateHeight)
{if(document.getElementById('affiliateSize'))
{document.getElementById("affiliateSize").value=affiliateSize;document.getElementById("affiliateWidth").value=affiliateWidth;document.getElementById("affiliateHeight").value=affiliateHeight;}}
function setAffiliateType(affiliateType)
{if(document.getElementById('affiliateType'))
{document.getElementById("affiliateType").value=affiliateType;}}
function validateEmail(str)
{var at="@"
var dot="."
var lat=str.indexOf(at)
var lstr=str.length
var ldot=str.indexOf(dot)
if(str==null||str==" ")
{alert("Invalid E-mail ID")
return false}
if(str.indexOf(at)==-1){alert("Invalid E-mail ID")
return false}
if(str.indexOf(at)==-1||str.indexOf(at)==0||str.indexOf(at)==lstr){alert("Invalid E-mail ID")
return false;}
if(str.indexOf(dot)==-1||str.indexOf(dot)==0||str.indexOf(dot)==lstr-1){alert("Invalid E-mail ID")
return false;}
if(str.indexOf(at,(lat+1))!=-1){alert("Invalid E-mail ID")
return false;}
if(str.substring(lat-1,lat)==dot||str.substring(lat+1,lat+2)==dot){alert("Invalid E-mail ID")
return false;}
if(str.indexOf(dot,(lat+2))==-1){alert("Invalid E-mail ID")
return false;}
if(str.indexOf(" ")!=-1){alert("Invalid E-mail ID")
return false;}
return true;}
function validNaming(str)
{var Length=str.length
var iChars="!@#$%^&*()+=-[]\\\';,/{}|\":<>?0123456789";for(var i=0;i<Length;i++){if(iChars.indexOf(str.charAt(i))!=-1){alert("Username has special characters or numbers. \nThese are not allowed.\n Please remove them and try again.");return false}}
if(str=="")
{alert("Enter Name!!!");return false}
return true;}
function checkForm()
{if(document.getElementById("nameofthesite").value=="")
{alert("Please Enter SiteName!");document.getElementById("nameofthesite").focus();return false;}
if(document.getElementById("url").value=="")
{alert("URL must be entered properly!!");document.getElementById("url").focus();return false;}
if(!validNaming(document.getElementById("name").value))
{document.getElementById("name").focus();document.getElementById("name").value='';return false;}
if(document.getElementById('phone').value==''||isNaN(document.getElementById('phone').value))
{alert("Please enter valid phone number");document.getElementById("phone").focus();return false;}
if(!validateEmail(document.getElementById("email").value))
{document.getElementById("email").focus();return false;}
if(document.getElementById("loginid").value=="")
{alert(" LoginID cannot be blank!");document.getElementById("loginid").focus();return false;}
var re=/^\w+$/;if(!re.test(document.getElementById("loginid").value))
{alert(" LoginID must contain only letters, numbers and underscores!");document.getElementById("loginid").focus();document.getElementById("loginid").value="";return false;}
if(document.getElementById("password").value=="")
{alert("Please Enter Password!!");document.getElementById("password").focus();return false;}
if(document.getElementById("password").value.length<6)
{alert("Minimum Password length should be 6 characters");document.getElementById("password").focus();return false;}
var reg=/^[0-9a-zA-Z]+$/;if(!document.getElementById("password").value.match(reg))
{alert("Please enter alpha-numeric characters for Password!!\n No Special Characters Allowed")
document.getElementById("password").focus();return false;}
if(document.getElementById("loginid").value==document.getElementById("password").value)
{alert("Login ID and Password must be different");document.getElementById("password").focus();document.getElementById("password").value='';return false;}else if(document.getElementById("loginid").value==document.getElementById("verifypassword").value)
{alert("Login ID and Password must be different");document.getElementById("verifypassword").focus();document.getElementById("verifypassword").value='';return false;}
if(document.getElementById("verifypassword").value=="")
{alert("Please Enter VerifyPassword");document.getElementById("verifypassword").focus();return false;}
if(document.getElementById("password").value!=document.getElementById("verifypassword").value)
{alert("Password and Verify Password must be of equal length");document.getElementById("password").focus();document.getElementById("password").value='';return false;}
if(document.getElementById("verifypassword").value.length<6)
{alert("VerifyPassword length should be 6 characters");document.getElementById("verifypassword").focus();return false;}
if(!document.getElementById("verifypassword").value.match(reg))
{alert("Please enter alpha-numeric characters for VerifyPassword!!\n No Special Characters Allowed")
document.getElementById("verifypassword").focus();return false;}
var pay=/^[a-zA-Z0-9-\&.\/@,#*$%() ]+$/;if(!document.getElementById("payableto").value.match(pay)||document.getElementById("payableto").value=="")
{alert("Enter Name for Payment ");document.getElementById("payableto").focus();document.getElementById("payableto").value='';return false;}
var pan=/^[a-zA-Z0-9]+$/;if(!document.getElementById("pan").value.match(pan)||document.getElementById("pan").value==""||document.getElementById("pan").value==document.getElementById("name").value||document.getElementById("pan").value==document.getElementById("loginid").value)
{alert("Proper PAN Card Information is mandatory for making the payment \n\nIf you dont have PAN Card, enter 'NO' ");document.getElementById("pan").focus();document.getElementById("pan").value='';return false;}
var add=/^[A-Za-z0-9-\&@#$*()*\/., ]+$/;if(!document.getElementById("address").value.match(add)||document.getElementById("address").value=="")
{alert("Enter Correct Address");document.getElementById("address").focus();document.getElementById("address").value='';return false;}
var city=/^[A-Za-z ]+$/;if(!document.getElementById("city").value.match(city)||document.getElementById("city").value=="")
{alert("Enter Proper City Name ");document.getElementById("city").focus();document.getElementById("city").value='';return false;}
var state=/^[A-Za-z ]+$/;if(!document.getElementById("state").value.match(state)||document.getElementById("state").value=="")
{alert("Enter State name ");document.getElementById("state").focus();document.getElementById("state").value='';return false;}
var cnt=/^[A-Za-z ]+$/;if(document.getElementById("country").value==""||!document.getElementById("country").value.match(cnt))
{alert("Enter Country name ");document.getElementById("country").focus();document.getElementById("country").value='';return false;}
var cc=/^[0-9 ]+$/;if(!document.getElementById("postalcode").value.match(cc)||document.getElementById("postalcode").value=="")
{alert("Enter Postal Code ");document.getElementById("postalcode").focus();document.getElementById("postalcode").value='';return false;}
if(!document.getElementById("chkbox").checked)
{alert("Please click on Terms&Conditions Checkbox to proceed further");return false;}
if(document.getElementById("loginid").value!=""&&document.getElementById("password").value!="")
{var loginid=document.getElementById("loginid").value;var Url="/ajax/checkCampaignUserLoginId.html?loginid="+loginid;xmlHttp=window.getXmlHttpRequestObject();xmlHttp.onreadystatechange=stateChangeForCheckForm;xmlHttp.open("GET",Url,true);xmlHttp.send(null);}}
function stateChangeForCheckForm()
{if(xmlHttp.readyState==4)
{if(xmlHttp.status==200)
{if(xmlHttp.responseText==0)
{var loginid=document.getElementById("loginid").value;var password=document.getElementById("password").value;var nameofthesite=document.getElementById("nameofthesite").value;var url=document.getElementById("url").value;var name=document.getElementById("name").value;var phone=document.getElementById("phone").value;var email=document.getElementById("email").value;var payableto=document.getElementById("payableto").value;var pan=document.getElementById("pan").value;var address=document.getElementById("address").value;var city=document.getElementById("city").value;var state=document.getElementById("state").value;var country=document.getElementById("country").value;var postalcode=document.getElementById("postalcode").value;var Url="/ajax/addCampaignUser.html?loginid="+loginid+"&password="+password+"&nameofthesite="+nameofthesite+"&url="+url+"&name="+name+"&phone="+phone+"&email="+email+"&payableto="+payableto+"&pan="+pan+"&address="+address+"&city="+city+"&state="+state+"&country="+country+"&postalcode="+postalcode;xmlHttps=window.getXmlHttpRequestObject();xmlHttps.onreadystatechange=stateChangeForSave;xmlHttps.open("GET",Url,true);xmlHttps.send(null);}
else
{alert("Choose another LoginId.");}}}}
function stateChangeForSave()
{if(xmlHttps.readyState==4)
{if(xmlHttps.status==200)
{window.location.replace("/affiliate-download.html");}}}
function linkToLoginPage()
{window.location.replace("/affiliatelogin.html");}
function validateLogin()
{if(document.getElementById("loginid").value=="")
{alert(" LoginID cannot be blank!");document.getElementById("loginid").focus();return false;}
var re=/^\w+$/;if(!re.test(document.getElementById("loginid").value))
{alert(" LoginID must contain only letters, numbers and underscores!");document.getElementById("loginid").focus();document.getElementById("loginid").value="";return false;}
if(document.getElementById("password").value=="")
{alert("Please Enter Password!!");document.getElementById("password").focus();return false;}
var reg=/^[0-9a-zA-Z]+$/;if(!document.getElementById("password").value.match(reg))
{alert("Please enter alpha-numeric characters for Password!!\n No Special Characters Allowed")
document.getElementById("password").focus();return false;}
if(document.getElementById("password").value.length<6)
{alert("Minimum Password length should be 6 characters");document.getElementById("password").focus();return false;}
if(document.getElementById("loginid").value==document.getElementById("password").value)
{alert("Login ID and Password must be different");document.getElementById("password").focus();document.getElementById("password").value='';return false;}
var loginid=document.getElementById("loginid").value;var password=document.getElementById("password").value;var Url="/ajax/loginCampaignUser.html?loginid="+loginid+"&password="+password;xmlHttp=window.getXmlHttpRequestObject();xmlHttp.onreadystatechange=stateChangedForLogin;xmlHttp.open("GET",Url,true);xmlHttp.send(null);}
function stateChangedForLogin()
{if(xmlHttp.readyState==4)
{if(xmlHttp.responseText==0)
{alert("UserId/password is incorrect.Try to login again.");}
else
{window.location.replace("/affiliate-download.html");}}}
function validLoginId()
{var user=/^\w+$/;if(!user.test(document.getElementById("loginid").value)||document.getElementById("loginid").value=="")
{alert(" LoginID must contain only letters, numbers and underscores!");document.getElementById("loginid").focus();document.getElementById("loginid").value="";return false;}
else
{var loginid=document.getElementById("loginid").value;var Url="/ajax/checkCampaignUserLoginId.html?loginid="+loginid;xmlHttp=window.getXmlHttpRequestObject();xmlHttp.onreadystatechange=stateChangedForLoginId;xmlHttp.open("GET",Url,true);xmlHttp.send(null);}}
function stateChangedForLoginId()
{if(xmlHttp.readyState==4)
{if(xmlHttp.responseText==0)
{alert("LoginId is available for use.");document.getElementById("password").focus();}
else
{alert("Choose another LoginId.");document.getElementById("loginid").focus();}}}
function resultPage(redirectTo,city,serverName)
{if(city=="Select a City")
{alert("Please,select a city");return false;}
var AdGroupId=document.getElementById("AdGroupId").value;var cityName=city.replace(" ","_");var uri="http://"+serverName+redirectTo+cityName+".html?AdGroupId="+AdGroupId;parent.location.href=uri;}
function resultPageForPartner(resultPath,cityName)
{if(cityName=="Select a City")
{alert("Please,select a city");return false;}
var AdGroupId=document.getElementById("AdGroupId").value;var uri=resultPath+"?cityName="+cityName+"&AdGroupId="+AdGroupId;parent.location.href=uri;}
function generate()
{var randomInt=Math.round((Math.random()*1000000000000));return randomInt;}
function downLoadAffiliateCode()
{var Url='/ajax/getAffiliateCode.html?subcampaignid='+generate();xmlHttp=window.getXmlHttpRequestObject();xmlHttp.onreadystatechange=writeAffiliateCode;xmlHttp.open("GET",Url,true);xmlHttp.send(null);}
function writeAffiliateCode()
{if(xmlHttp.readyState==4)
{document.getElementById("affCodeTr").style.display="block";document.getElementById("affCode").value=xmlHttp.responseText;}}function setApplyForm(param)
{var formParams='isProductId='+(param.isProductId?'true':'false');if(param.isProductId=='true')
{formParams+='&id='+param.id;}else{formParams+='&id='+param.id;}
if(param.sid!=undefined||param.sid!='')
{formParams+='&sid='+param.sid;}
var receiveReq;if(window.XMLHttpRequest)
{receiveReq=new XMLHttpRequest();}
else if(window.ActiveXObject)
{receiveReq=new ActiveXObject("Microsoft.XMLHTTP");}
var ajaxUrl="/ajax/autoPostFormcontent.html";if(receiveReq.readyState==4||receiveReq.readyState==0)
{receiveReq.open("POST",ajaxUrl,true);receiveReq.setRequestHeader("Content-Length",formParams.length);receiveReq.setRequestHeader("Content-Type","application/x-www-form-urlencoded");receiveReq.onreadystatechange=function()
{if(receiveReq.readyState==4)
{document.getElementById(param.container).innerHTML=receiveReq.responseText;document.getElementById('orderId').value=param.orderId;populateCity(param.orderId);displayApnaExchangePopupDiv();displayApnaExchangeTextDiv();}};receiveReq.send(formParams);}}
function populateCity(orderId)
{var receiveReqCity;if(window.XMLHttpRequest)
{receiveReqCity=new XMLHttpRequest();}
else if(window.ActiveXObject)
{receiveReqCity=new ActiveXObject("Microsoft.XMLHTTP");}
var ajaxCityUrl="/ajax/getCitiesForOrder.html";var orderIds='orderId='+orderId;if(receiveReqCity.readyState==4||receiveReqCity.readyState==0)
{receiveReqCity.open("POST",ajaxCityUrl,true);receiveReqCity.setRequestHeader("Content-Length",orderIds.length);receiveReqCity.setRequestHeader("Content-Type","application/x-www-form-urlencoded");receiveReqCity.onreadystatechange=function()
{if(receiveReqCity.readyState==4)
{var response=eval("("+receiveReqCity.responseText+")");var elSel=document.getElementById('custCtiy');removeUnwantedCity(response.city);}};receiveReqCity.send(orderIds);}}
function removeUnwantedCity(cityIds)
{var elSel=document.getElementById('custCity');var i;for(i=elSel.options.length-1;i>0;i--){var isCityFound=false;for(j=0;j<cityIds.length;j++){if(cityIds[j]==elSel.options[i].value)
{isCityFound=true;break;}}
if(!isCityFound)
{elSel.remove(i);}}}
function validate()
{var length=document.getElementById('autoPostForm').elements.length;for(i=0;i<length;i++)
{var elementType=document.getElementById('autoPostForm').elements[i].type;var rowElement=document.getElementById(document.getElementById('autoPostForm').elements[i].id+"Row");if((rowElement==null||rowElement==undefined)||rowElement.style.display=='')
{if(elementType=="select-one")
{if(document.getElementById('autoPostForm').elements[i].value==0)
{alert('Please select a value for : '+document.getElementById('autoPostForm').elements[i].title);document.getElementById('autoPostForm').elements[i].focus();return false;}}
if(elementType=="text")
{if(document.getElementById('autoPostForm').elements[i].value==0||document.getElementById('autoPostForm').elements[i].value=='')
{alert('Please enter a value for : '+document.getElementById('autoPostForm').elements[i].title);document.getElementById('autoPostForm').elements[i].focus();return false;}}
var privPol=document.getElementById("checkPrivacy");if(!privPol.checked)
{alert("Please check the privacy policy");privPol.focus();return false;}
var apnaExchangePolicyElem=document.getElementById("apnaExchangePolicy");var apnaExchangeCheckBoxValueElem=document.getElementById("apnaExchangeCheckBoxValue");if(apnaExchangePolicyElem&&apnaExchangePolicyElem.checked)
{apnaExchangeCheckBoxValueElem.value="checked";apnaExchangePolicyElem.value="Y";}
else
{apnaExchangeCheckBoxValueElem.value="unchecked";}}}}
function onlyNumbers(element)
{if(element.value=='')
{return false;}
if(element.id=='custMobile')
{if(element.value.length!=10)
{alert('Mobile number should be a 10-digit valid number');element.value='';return false;}
if(element.value.substr(0,1)!='9'&&element.value.substr(0,1)!='8')
{alert('Mobile Numbers should start with 8 or 9');element.value='';return false;}}
var regex=/^[\d]+$/;if(!regex.test(element.value))
{alert("Only numeric values allowed for "+element.title);element.value='';return false;}
return true;}
function email(element)
{if(element.value=='')
{return false;}
var regex=/^[A-Za-z]{1}[a-zA-Z0-9]*((\.|\_|-|\'){1}[a-zA-Z0-9]+)*@([a-zA-Z0-9]+([\-]{1}[a-zA-Z0-9]+)*[\.]{1})+[a-zA-Z]{2,4}$/;if(!regex.test(element.value))
{alert("Please enter a valid email");element.value='';return false;}
return true;}
function onlyChars(element)
{if(element.value=='')
{return false;}
var regex=/^[A-Za-z\ ]+$/;if(!regex.test(element.value))
{alert("Only character allowed for "+element.title);element.value='';return false;}
return true;}
function displayApnaExchangePopupDiv()
{var fileName="/im/apnaExchange-loan.ftl";var formParams="fileName="+fileName;var uri="/ajax/generateFtlFile.html";var receiveReq=window.getXmlHttpRequestObject();if(receiveReq.readyState==4||receiveReq.readyState==0)
{receiveReq.open("POST",uri,true);receiveReq.setRequestHeader("Content-Length",formParams.length);receiveReq.setRequestHeader("Content-Type","application/x-www-form-urlencoded");receiveReq.onreadystatechange=function()
{if(receiveReq.readyState==4)
{var response=receiveReq.responseText;document.getElementById('popupDiv').innerHTML=response;}}};receiveReq.send(formParams);}
function displayApnaExchangeTextDiv()
{var fileName="/ftl/apnaExchange.ftl";var formParams="fileName="+fileName;var uri="/ajax/generateFtlFile.html";var receiveReq=window.getXmlHttpRequestObject();if(receiveReq.readyState==4||receiveReq.readyState==0)
{receiveReq.open("POST",uri,true);receiveReq.setRequestHeader("Content-Length",formParams.length);receiveReq.setRequestHeader("Content-Type","application/x-www-form-urlencoded");receiveReq.onreadystatechange=function()
{if(receiveReq.readyState==4)
{var response=receiveReq.responseText;document.getElementById('axPolDiv').innerHTML=response;}}};receiveReq.send(formParams);}
function renderDynamicMarketPlaceWidget()
{var source;source=vertical+"/widget/marketplacedynamicwidget.html"
if(typeof uri!="undefined"&&uri!=null){source+="?uri="+uri;if(adGroupId&&adGroupId!=null){source+="&marketPlaceAdGroupId="+adGroupId;}}else{if(adGroupId&&adGroupId!=null){source+="?marketPlaceAdGroupId="+adGroupId;}}
if(typeof defaultProductId!="undefined"&&defaultProductId!=null){source+="&defaultProductId="+defaultProductId;}
document.write("<iframe id='iframeDynamicMP' src='"+source+"' frameborder='0' scrolling='no' target='_parent' style='width:234px;height:800px;'></iframe>");}
function renderStaticMarketPlaceWidget(config)
{var mPWidget=typeof config.mPWidget!='undefined'&&config.mPWidget!=''?config.mPWidget:'';var productType=typeof config.productType!='undefined'&&config.productType!=''?config.productType:'loan';var bgColor=typeof config.bgColor!='undefined'&&config.bgColor!=''?config.bgColor:'#EEF5E4';var src='';if(productType=="loan"){src='http://www.apnaloan.com/widget/marketplacestaticwidget.html?widgetToShow=';src=src+mPWidget;src=src+'&bgColor='+bgColor;}
else if(productType=="insurance"){src='http://www.apnainsurance.com/widget/marketplacestaticwidget.html?widgetToShow=';src=src+mPWidget;src=src+'&bgColor='+bgColor;}
if(productType=="loan"){document.write("<iframe id='marketPlaceStaticWidget'  onload='scrollBy(0,0);'  src='"+src+"' style='width:574px;height:445px;position:inherit'  scrolling='no' frameborder='0' ></iframe>");}
else if(productType=="insurance"){document.write("<iframe id='marketPlaceStaticWidget'  onload='scrollBy(0,0);'  src='"+src+"' style='width:574px;height:445px;position:inherit'  scrolling='no' frameborder='0' ></iframe>");}}
var IE=document.all?true:false
if(!IE)document.captureEvents(Event.MOUSEMOVE)
document.onmousemove=getMouseXY;var mouseCordinate={xPos:0,yPos:0};function getMouseXY(e){if(IE){tempX=event.clientX+document.body.scrollLeft
tempY=event.clientY+document.body.scrollTop}else{tempX=e.pageX
tempY=e.pageY}
if(tempX<0){tempX=0}
if(tempY<0){tempY=0}
mouseCordinate.xPos=tempX;mouseCordinate.yPos=tempY;return true}
function showMessage(id,alignReq)
{if(alignReq=='no'){document.getElementById(id).style.display='block';}
else{var container=document.getElementById(id);container.style.top=mouseCordinate.yPos-135;container.style.left=mouseCordinate.xPos-80;container.style.display='block';}}
function hideMessage(id)
{document.getElementById(id).style.display='none';}
