function CancelCall(){xmlHttp=GetXmlHttpObject();if(xmlHttp==null){alert("Your browser not support AJAX");return false}var a="http://"+domainName+"/C4CWidgetNew/cancelCall?requestID="+requestID+"&orignalIP="+sourceIP;xmlHttp.onreadystatechange=function(){if(xmlHttp.readyState==4){var a=xmlHttp.responseText.substring(0,3);if(a=="ACK"){document.getElementById("div_response").innerHTML="Please wait...<br> While we cancel your call.";document.getElementById("CancelRow").style.visibility="hidden";document.getElementById("CancelColumn").style.visibility="hidden";CancelCallResponse="ACK"}else{document.getElementById("div_response").innerHTML="Sorry, Your call Can not be disconnected.";document.getElementById("imgLoading").style.visibility="hidden"}}};xmlHttp.open("GET",a,true);xmlHttp.send(null)}function chkNumberBlacklist(a,b,c,d,e,f,g,h,i,j,k){xmlHttp=GetXmlHttpObject();if(xmlHttp==null){alert("Your browser not support AJAX");return false}var l="http://"+domainName+"/C4CWidgetNew/chkNumberBlacklist";l+="?custtoken="+a+"&sourceIP_Number="+b;xmlHttp.onreadystatechange=function(){if(xmlHttp.readyState==4){var l=parseInt(xmlHttp.responseText);var m='<a href="#" id="anchUnblock">Request Unblock</a>';if(l==1){document.getElementById("div_response").innerHTML="This Number is not valid for Click4Call Services."+m;document.getElementById("imgLoading").style.visibility="hidden";var n=document.getElementById("anchUnblock");n.onclick=function(){addRequestToUnblock(a,b,false)}}else if(l==0){performCrossDomainAction(b,a,c,d,e,f,g,h,i,j,k)}else{document.getElementById("div_response").innerHTML="Number Blacklist Exception";document.getElementById("imgLoading").style.visibility="hidden"}}};xmlHttp.open("GET",l,true);xmlHttp.send(null)}function updateStatusOfRequest(){if(xmlHttp.readyState==4){var a=parseInt(xmlHttp.responseText);if(a>=1)document.getElementById("div_response").innerHTML="Request Successfully Sent !!!";else if(a==0)document.getElementById("div_response").innerHTML="Request Exist !!!";else if(a==-1)document.getElementById("div_response").innerHTML="Request Failure - DB Error !!!";else document.getElementById("div_response").innerHTML="Request Failure - Other Error !!!"}}function addRequestToUnblock(a,b,c){xmlHttp=GetXmlHttpObject();if(xmlHttp==null){alert("Your browser not support AJAX");return}var d="http://"+domainName+"/C4CWidgetNew/setUnblockRequest";d+="?custtoken="+a+"&sourceIP_Number="+b;if(c)d+="&requestFor=1";else d+="&requestFor=2";xmlHttp.onreadystatechange=updateStatusOfRequest;xmlHttp.open("GET",d,true);xmlHttp.send(null)}function includeCSS(){var a=document.createElement("link");a.rel="stylesheet";a.type="text/css";a.href="http://www.phonon.in/C4C/modal-message-ITCWG.css";document.getElementsByTagName("head")[0].appendChild(a)}function retriveCallAcknowledge(){var a="ACK";var b=callResponse.substring(0,3);if(b==a||CancelCallResponse=="ACK"){updateCurrCallStatus()}else{document.getElementById("imgLoading").style.visibility="hidden";document.getElementById("div_response").innerHTML=SORRY}}function updateCurrCallStatus(){var a=responseStatus.split(";");for(var b=0;b<a.length;b++){var c=a[b].split(":");a[b]=c[1]}var d=a[1];var e=a[0];var f=a[2];var g="";if(d==CANCEL_CALL||e==CANCEL_CALL){g=VIS_ADV_CANCELED+"<br>"+THANK_YOU;document.getElementById("CancelRow").style.visibility="hidden";document.getElementById("CancelColumn").style.visibility="hidden";clearInterval(intervalId)}else if((d==IDLE||d==TO_BE_CONNECTED||d==NOT_CONNECTED)&&e==TO_BE_CONNECTED){g=CALLING_VIS}else if((d==CONNECTED||d==SUCCESS)&&e==TO_BE_CONNECTED){g=CALLING_ADV}else if((d==CONNECTED||d==SUCCESS)&&(e==CONNECTED||e==SUCCESS)){g=VIS_ADV_CONNECTED+"<br><br>"+THANK_YOU}else if((d==CONNECTED||d==SUCCESS)&&e==BUSY){g=ADV_CAN_NOT_CONTACTED;document.getElementById("CancelRow").style.visibility="hidden";document.getElementById("CancelColumn").style.visibility="hidden"}else if((d==CONNECTED||d==SUCCESS)&&e==NO_REPLY){g=ADV_CAN_NOT_CONTACTED;document.getElementById("CancelRow").style.visibility="hidden";document.getElementById("CancelColumn").style.visibility="hidden"}else if((d==CONNECTED||d==SUCCESS)&&(e==OTHER||e==NOT_CONNECTED||e==UNOBTAINABLE_NUMBER)){g=ADV_CAN_NOT_CONTACTED;document.getElementById("CancelRow").style.visibility="hidden";document.getElementById("CancelColumn").style.visibility="hidden"}else if((d==CONNECTED||d==SUCCESS)&&e==USER_HANGUP){g=THANK_YOU;document.getElementById("CancelRow").style.visibility="hidden";document.getElementById("CancelColumn").style.visibility="hidden"}else if((d==CONNECTED||d==SUCCESS)&&e==INVALID_NUMBER_FORMAT){g=INVALID_NO;document.getElementById("CancelRow").style.visibility="hidden";document.getElementById("CancelColumn").style.visibility="hidden"}else if(d==BUSY&&e==TO_BE_CONNECTED){g=VIS_CAN_NOT_CONTACTED;document.getElementById("CancelRow").style.visibility="hidden";document.getElementById("CancelColumn").style.visibility="hidden"}else if(d==NO_REPLY&&e==TO_BE_CONNECTED){g=VIS_CAN_NOT_CONTACTED;document.getElementById("CancelRow").style.visibility="hidden";document.getElementById("CancelColumn").style.visibility="hidden"}else if((d==OTHER||d==NOT_CONNECTED||d==UNOBTAINABLE_NUMBER)&&e==TO_BE_CONNECTED){g=VIS_CAN_NOT_CONTACTED;document.getElementById("CancelRow").style.visibility="hidden";document.getElementById("CancelColumn").style.visibility="hidden"}else if(d==USER_HANGUP){g=THANK_YOU;document.getElementById("CancelRow").style.visibility="hidden";document.getElementById("CancelColumn").style.visibility="hidden"}else if(d==INVALID_NUMBER_FORMAT&&e==TO_BE_CONNECTED){g=INVALID_NO+INVALID_NO_MSG;document.getElementById("CancelRow").style.visibility="hidden";document.getElementById("CancelColumn").style.visibility="hidden"}document.getElementById("div_response").innerHTML=g;if(f!=CONNECTION_ALIVE){if(intervalId!=0)clearInterval(intervalId);document.getElementById("imgLoading").style.visibility="hidden"}}function GetXmlHttpObject(){var a=null;try{a=new XMLHttpRequest}catch(b){try{a=new ActiveXObject("Msxml2.XMLHTTP")}catch(b){a=new ActiveXObject("Microsoft.XMLHTTP")}}return a}function CrossDomainStatusResponse(){if(xmlHttp.readyState==4){callResponse=xmlHttp.responseText;xmlHttp=null;if(callResponse.indexOf("NACK")>=0){var a=callResponse;var b=a.substring(0,3);if(b=="DNC")REASON=callResponse.substring(8);else REASON="Reason : "+callResponse.substring(5);if(callResponse.indexOf("Session Timeout")>=0){msg="Your session timed out. Please try again after closing this window.";document.getElementById("imgLoading").style.visibility="hidden"}else if(callResponse.indexOf("Captcha Not Verified")>=0||callResponse.indexOf("Captcha Spam Blocked")>=0){var c=document.getElementById("JSessionId").value;var d=new Date;var e="<br><img src='CaptchaServletITC?time="+d.getTime()+"&sessionID="+c+"'><br><span id='captchamsg' style='color:red'>Please enter the characters shown in above image.</span><br><input type='text' name='textCaptcha' id='textCaptcha'><br><input type='button' value='Retry' id='btnRetry' style='background-color:#EF9A48;'>";msg=CAPTCHA_INVALID+"<br><br>"+REASON+e;document.getElementById("div_response").innerHTML=msg;document.getElementById("imgLoading").style.visibility="hidden";var e=document.getElementById("btnRetry");e.onclick=function(){var a=document.getElementById("textCaptcha").value;if(a!=null||a!=""){retryCaptcha(a,c)}else{alert("Please enter Captcha text first.")}}}else if(callResponse.indexOf("Captcha Retry Exceeded")>=0){msg=MAX_TRY+"<br><br>"+REASON;document.getElementById("div_response").innerHTML=msg;document.getElementById("imgLoading").style.visibility="hidden"}else if(callResponse.indexOf("IP Blacklisted")>=0){var f="<br><a href='#' id='anchUnblockIP'>Request Unblock</a>";msg=IP_BLACKLISTED+"<br><br>"+REASON+f;document.getElementById("div_response").innerHTML=msg;document.getElementById("imgLoading").style.visibility="hidden";var g=document.getElementById("anchUnblockIP");g.onclick=function(){addRequestToUnblock(custtoken,sourceIP,true)}}else if(callResponse.indexOf("Number Blacklisted")>=0){var h='<br><a href="#" id="anchUnblockNo">Request Unblock</a>';msg=NUMBER_BLACKLISTED+"<br><br>"+REASON+f;document.getElementById("div_response").innerHTML=msg;document.getElementById("imgLoading").style.visibility="hidden";var i=document.getElementById("anchUnblockNo");i.onclick=function(){addRequestToUnblock(custtoken,visitorNo,false)}}else if(callResponse.indexOf("Max Simultaneous Calls")>=0){msg="Sorry, we could not start your call presently <br> since maximum simultaneous call limit of customer is reached. <br> Please try again after some time.";document.getElementById("div_response").innerHTML=msg;document.getElementById("imgLoading").style.visibility="hidden"}else if(b=="DNC"){msg=REASON;document.getElementById("div_response").innerHTML=msg;document.getElementById("imgLoading").style.visibility="hidden"}else{msg=TRY_AGAIN+"<br><br>"+REASON;document.getElementById("div_response").innerHTML=msg;document.getElementById("imgLoading").style.visibility="hidden"}}else if(callResponse.indexOf("ACK")>=0){document.getElementById("CancelRow").style.display="block";document.getElementById("CancelColumn").style.display="block";var j=callResponse.length-20;var k=callResponse.substring(j);getCurrCallStatus(k)}}}function retryCaptcha(a,b){document.getElementById("div_response").innerHTML=CALLING_VIS;document.getElementById("imgLoading").style.visibility="visible";xmlHttp=GetXmlHttpObject();if(xmlHttp==null){alert("Your browser not support AJAX");return}var c="http://"+domainName+"/C4CWidgetNew/C2CRequest";c=c+"?IsRetry=T&captcha="+a+"&JSessionId="+b;xmlHttp.onreadystatechange=CrossDomainStatusResponse;xmlHttp.open("GET",c,true);xmlHttp.send(null)}function performCrossDomainAction(a,b,c,d,e,f,g,h,i,j,k){visitorNo=a;custtoken=b;sourceIP=c;xmlHttp=GetXmlHttpObject();if(xmlHttp==null){alert("Your browser not support AJAX");return}var l="http://"+domainName+"/C4CWidgetNew/C2CRequest";l=l+"?visitor="+visitorNo+"&custtoken="+custtoken+"&sourceIP="+sourceIP+"&"+d+"&referrer="+e+"&visitorLocation="+f+"&sessionID="+g+"&challenge="+h+"&response="+i+"&captcha="+j+"&JSessionId="+k;xmlHttp.onreadystatechange=CrossDomainStatusResponse;xmlHttp.open("GET",l,true);xmlHttp.send(null)}function iresponse(){if(xmlHttp.readyState==4){responseStatus=xmlHttp.responseText;xmlHttp=null;retriveCallAcknowledge()}}function retriveCurrCallStatus(){if(localvariable>12)return;localvariable++;if(uniqueid!=null||custtoken!=null||uniqueid!=""||custtoken!=""){xmlHttp=GetXmlHttpObject();if(xmlHttp==null){alert("Your browser not support AJAX");return}var a="http://"+domainName+"/C4CWidgetNew/RetrieveStatus";var b=new Date;a=a+"?reqID="+requestID+"&time="+b.getTime();xmlHttp.onreadystatechange=iresponse;xmlHttp.open("GET",a,true);xmlHttp.send(null)}}function getCurrCallStatus(a){requestID=a;var b="retriveCurrCallStatus()";intervalId=window.setInterval(b,7e3)}function closeMessage(){messageObj.close()}function callme(a,b,c,d,e,f){var g="http://"+domainName+"/C4CWidgetNew/CallMe_ITC.jsp";var h="325";var i="362";var j="http://www.phonon.in/C4C/Images/close.gif";var k="http://www.phonon.in/C4C/Images/ITCLogo.gif";var l=g+"?custtoken="+a+"&udf1="+b+"&udf2="+c+"&udf3="+d+"&udf4="+e+"&udf5="+f+"&newSession=T";var m='<table class="modalDialog_titleArea" width = "100%"><tr><td align="center" width="15%">';m=m+'<img src="'+k+'" border="0"> </td><td align="center" width="70%">';if(c.match("room")){m=m+"Reserve A Room";CALLING_ADV=CALLING_ADV_ROOM}else if(c.match("table")){m=m+"Reserve A Table";CALLING_ADV=CALLING_ADV_TABLE}else{m=m+"ITC Hotels' Click-to-Call"}m=m+'</td><td align="center" width="15%"><img src="'+j+'" border="0" WIDTH="14" HEIGHT="14" onclick="closeMessage();return false"> </td></tr></table>';var n='<iframe style=vertical-align:middle; src="'+l+'" id="iframePopup" class="frame" width="'+(h-8)+'" height="'+(i-47)+'" frameborder="0"></iframe>';messageObj.setHtmlContent(m+n);messageObj.setSize(h,i);messageObj.display()}var custtoken;var sourceIP;var intervalId=0;var uniqueid;var callResponse;var CancelCallResponse;var responseStatus;var requestID;var localvariable=0;var timeOut=-1;var domainName="c4c.phonon.in";var IDLE=0;var CONNECTED=1;var BUSY=2;var NO_REPLY=3;var OTHER=4;var SUCCESS=5;var USER_HANGUP=6;var TO_BE_CONNECTED=7;var NOT_CONNECTED=8;var INVALID_NUMBER_FORMAT=9;var UNOBTAINABLE_NUMBER=10;var CANCEL_CALL=11;var CONNECTION_ALIVE="-6";var ADV_CAN_NOT_CONTACTED="ITC Hotels' travel professional could not be contacted at this moment. We request you to call us back shortly.";var VIS_CAN_NOT_CONTACTED="We are unable to contact your number.";var VIS_ADV_CANCELED="Your call has been Cancelled.";var CALLING_VIS="calling you...<br/>you'll get a call from +912653930100.";var CALLING_ADV_ROOM="Please wait...<br/>While the call is connected to ITC Hotels' travel professional.";var CALLING_ADV_TABLE="Please wait...<br/>While the call is connected to ITC Hotels' reservation team.";var CALLING_ADV="Please wait...<br>We are connecting your call.";var INVALID_NO="You have entered an invalid number";var INVALID_NO_MSG="<br/>Please enter a valid 10 digit India number without 0 but with city code / full mobile number and no spaces.";var THANK_YOU="Thank you for using ITC Hotels Click to Call service. We hope to hear from you soon.";var SORRY="Sorry, We are unable to contact you. Please call us later.";var CAPTCHA_INVALID="Captcha entered is invalid.";var NUMBER_BLACKLISTED="Sorry, Your Phone number is in Blacklist.";var IP_BLACKLISTED="Sorry, Your IP address is in Blacklist.";var TRY_AGAIN="Unable to contact you. Please try again later.";var MAX_TRY="You have exceeded the maximum number of attempts.<br>Please close this window and try again.";var REASON="";includeCSS();DHTML_modalMessage=function(){var a;var b;var c;var d;var e;var f;var g;var h;var i;var j;var k;var l;var m;var n;this.url="";this.htmlOfModalMessage="";this.layoutCss="modal-message.css";this.height=200;this.width=400;this.cssClassOfMessageBox=false;this.shadowDivVisible=true;this.shadowOffset=5;this.MSIE=false;if(navigator.userAgent.indexOf("MSIE")>=0)this.MSIE=true};DHTML_modalMessage.prototype={close:function(){this.divs_content.style.display="none";this.divs_shadow.style.display="none";if(this.MSIE)this.iframe.style.display="none"},setHtmlContent:function(a){this.htmlOfModalMessage=a},setSize:function(a,b){if(a)this.width=a;if(b)this.height=b},display:function(){if(!this.divs_transparentDiv){this.__createDivs()}this.divs_content.style.display="block";this.divs_shadow.style.display="block";if(this.MSIE)this.iframe.style.display="block";this.__resizeDivs();window.refToThisModalBoxObj=this;setTimeout("window.refToThisModalBoxObj.__resizeDivs()",150);this.__insertContent()},__createDivs:function(){this.divs_content=document.createElement("DIV");this.divs_content.className="modalDialog_contentDiv";this.divs_content.id="DHTMLSuite_modalBox_contentDiv";this.divs_content.style.zIndex=1e5;if(this.MSIE){this.iframe=document.createElement('<IFRAME src="about:blank" frameborder=0>');this.iframe.style.zIndex=9e4;this.iframe.style.position="absolute";document.body.appendChild(this.iframe)}document.body.appendChild(this.divs_content);this.divs_shadow=document.createElement("DIV");this.divs_shadow.className="modalDialog_contentDiv_shadow";this.divs_shadow.style.zIndex=95e3;document.body.appendChild(this.divs_shadow)},__resizeDivs:function(){var a=Math.max(document.body.scrollTop,document.documentElement.scrollTop);if(this.cssClassOfMessageBox)this.divs_content.className=this.cssClassOfMessageBox;else this.divs_content.className="modalDialog_contentDiv";var b=Math.max(document.body.scrollTop,document.documentElement.scrollTop);var c=Math.max(document.body.scrollLeft,document.documentElement.scrollLeft);window.scrollTo(c,b);setTimeout("window.scrollTo("+c+","+b+");",10);this.__repositionTransparentDiv();var d=this.__getBrowserSize();var e=d[0];var f=d[1];this.divs_content.style.width=this.width+"px";this.divs_content.style.height=this.height+"px";var g=this.divs_content.offsetWidth;var h=this.divs_content.offsetHeight;this.divs_content.style.left=Math.ceil((e-g)/2)+"px";this.divs_content.style.top=Math.ceil((f-h)/2)+a+"px";if(this.MSIE){this.iframe.style.left=this.divs_content.style.left;this.iframe.style.top=this.divs_content.style.top;this.iframe.style.width=this.divs_content.style.width;this.iframe.style.height=this.divs_content.style.height}this.divs_shadow.style.left=this.divs_content.style.left.replace("px","")/1+this.shadowOffset+"px";this.divs_shadow.style.top=this.divs_content.style.top.replace("px","")/1+this.shadowOffset+"px";this.divs_shadow.style.height=h+"px";this.divs_shadow.style.width=g+"px";if(!this.shadowDivVisible)this.divs_shadow.style.display="none"},__repositionTransparentDiv:function(){},__insertContent:function(){if(this.url){ajax_loadContent("DHTMLSuite_modalBox_contentDiv",this.url)}else{this.divs_content.innerHTML=this.htmlOfModalMessage}},__getBrowserSize:function(){var a=document.documentElement.clientWidth;var b=document.documentElement.clientHeight;var a,b;if(self.innerHeight){a=self.innerWidth;b=self.innerHeight}else if(document.documentElement&&document.documentElement.clientHeight){a=document.documentElement.clientWidth;b=document.documentElement.clientHeight}else if(document.body){a=document.body.clientWidth;b=document.body.clientHeight}return[a,b]}};var messageObj=new DHTML_modalMessage;messageObj.setShadowOffset;messageObj.setCssClassMessageBox;messageObj.setShadowDivVisible
