var mznModel;var sitesChecked;var count=0;var searchForHotelsModel;function removeErrorMessages(){$("specifyCity").style.display="none";$("invalidCity").style.display="none"}function onLinkToHotelsMzn(){if($("mznCityName").value==""||$("mznCityName").value==$("mznCityName").defaultValue){$("specifyCity").style.display="block";return false}if(searchForHotelsModel==null){searchForHotelsModel=new SearchForHotelsModel()}searchForHotelsModel.cityName=document.getElementById("mznCityName").value;SearchForHotels.searchForHotels(searchForHotelsModel,onLinkToHotelsMznSuccess,onFailureMznLink)}function onFailureMznLink(a,b){}function onLinkToHotelsMznSuccess(a,b){searchForHotelsModel=new SearchForHotelsModel();searchForHotelsModel=a;if(searchForHotelsModel.invalid!="invalid"){window.location=searchForHotelsModel.link}else{$("invalidCity").style.display="block"}}function SetupCalendar(a){Calendar.setup({inputField:a,ifFormat:"%d/%m/%Y",showsTime:false,step:1,dateStatusFunc:dateStatus,align:null})}function dateStatus(b){var a=new Date();if(b<a){return true}else{return false}}function autoFillCheckOut(b,a){var c=$(b).value;c=c.split(/\D+/);c=new Date(c[2],c[1]-1,(parseInt(c[0])+3));c=getTwoChars(c.getDate())+"/"+getTwoChars(c.getMonth()+1)+"/"+c.getFullYear();$(a).value=c;if(mznModel!=null&&mznModel!=undefined){mznModel.completeCheckOutDate=c}}function getTwoChars(a){if(a.toString().length==1){a="0"+a}return a}function focusInputField(a){document.getElementById(a).focus()}function checkIfDateGreater(b,a){var c=b;c=c.split(/\D+/);newDate1=new Date(c[2],c[1],c[0]);c=a;c=c.split(/\D+/);newDate2=new Date(c[2],c[1],c[0]);DaysDiff=Math.floor((newDate1.getTime()-newDate2.getTime())/(1000*60*60*24));if(DaysDiff>0){return true}else{return false}}function sureShotFailure(a,b){}function sureShotFailure1(a,b){}function onSuccessCombined(a,b){mznModel=new MznCombinedModel();mznModel=a;$("mznContainer").innerHTML=mznModel.UI;SetupCalendar("rfrCheckInDate");SetupCalendar("rfrCheckOutDate");SetupCalendar("checkInDate");SetupCalendar("checkOutDate");loadRevCompParams();defineFunctions()}function OnFailure(a){this.codeLocation=a;this.onFailure=function(b,c){}}var onFailure=function(){new OnFailure("main").onFailure()};function onSuccessStore(a,b){}var mmtChild;function MM_openBrWindow(c,a,b){if($(a+"CBactual")!=null&&$(a+"CBactual").checked){sitesChecked[count]=a;++count;if(a=="HWSForm"){c=mznModel.hotelWebsiteURL}var d=window.open(c,a,b);oneWindowOpened=true;if(a!="HWSForm"){$(a).submit()}}}function checkRatesOnline(){if(checkIfDateGreater($("checkInDate").value,$("checkOutDate").value)){$("checkDates").style.display="block";return false}else{$("checkDates").style.display="none"}sitesChecked=new Array();loadRevCompParams();var b="width=620, height=600,toolbar=yes, menubar=yes,scrollbars=yes,resizable=yes";oneWindowOpened=false;for(i=0;i<mznModel.otaCodes.length;i++){var a=mznModel.otaCodes[i]+"Form";MM_openBrWindow("about:blank",a,b)}if(oneWindowOpened==true){MznService.storeStats(mznModel,sitesChecked,onSuccessStore,function(){new OnFailure(1).onFailure()});$("noOTAselected").style.display="none"}else{$("noOTAselected").style.display="block"}}function checkRatesOnlineForLanding(){var a=$("mznCityName").value;if(a==""||a==$("mznCityName").defaultValue){$("specifyCity").style.display="block";return false}else{$("specifyCity").style.display="none"}if(checkIfDateGreater($("checkInDate").value,$("checkOutDate").value)){$("checkDates").style.display="block";return false}else{$("checkDates").style.display="none"}MznService.getHTMLHotelsLanding(a,checkRatesOnlineForLandingSecondServerCall,sureShotFailure)}checkRatesOnlineForLandingSecondServerCall=function(a,b){mznModel=a;checkRatesOnline()};function splitCheckInCheckOutDate(){var b=$("checkInDate").value;var a=$("checkOutDate").value;mznModel.checkInDay=b.split("/")[0];mznModel.checkInMonth=b.split("/")[1];mznModel.checkInYear=b.split("/")[2];mznModel.checkOutDay=a.split("/")[0];mznModel.checkOutMonth=a.split("/")[1];mznModel.checkOutYear=a.split("/")[2]}function loadRevCompParams(){splitCheckInCheckOutDate();$("TGU_CID").value=mznModel.checkInDay;$("TGU_CIM").value=mznModel.checkInMonth;$("TGU_CIY").value=mznModel.checkInYear;$("TGU_COD").value=mznModel.checkOutDay;$("TGU_COM").value=mznModel.checkOutMonth;$("TGU_COY").value=mznModel.checkOutYear;$("tgcity").value=mznModel.city;$("TOC_CID").value=mznModel.checkInDay;$("TOC_CIM").value=mznModel.checkInMonth;$("TOC_COD").value=mznModel.checkOutDay;$("TOC_COM").value=mznModel.checkOutMonth;$("toccity").value=mznModel.city;var a=1000*60*60*24;dateCheckOut=new Date(mznModel.checkOutYear,mznModel.checkOutMonth-1,mznModel.checkOutDay);dateCheckIn=new Date(mznModel.checkInYear,mznModel.checkInMonth-1,mznModel.checkInDay);var b=(dateCheckOut.getTime()-dateCheckIn.getTime())/a;$("TOC_LOS").value=b;$("YRA_CID").value=mznModel.checkInDay+"/"+mznModel.checkInMonth+"/"+mznModel.checkInYear;$("ycity").value=mznModel.city;$("YRA_COD").value=mznModel.checkOutDay+"/"+mznModel.checkOutMonth+"/"+mznModel.checkOutYear;$("CTP_CID").value=mznModel.checkInDay+"/"+mznModel.checkInMonth+"/"+mznModel.checkInYear;$("CTP_COD").value=mznModel.checkOutDay+"/"+mznModel.checkOutMonth+"/"+mznModel.checkOutYear;$("ctcity").value=mznModel.CTPCity;$("MMT_CID").value=mznModel.checkInDay+"/"+mznModel.checkInMonth+"/"+mznModel.checkInYear;$("MMTDeep_CID").value=mznModel.checkInDay+"/"+mznModel.checkInMonth+"/"+mznModel.checkInYear;$("MMT_COD").value=mznModel.checkOutDay+"/"+mznModel.checkOutMonth+"/"+mznModel.checkOutYear;$("MMTDeep_COD").value=mznModel.checkOutDay+"/"+mznModel.checkOutMonth+"/"+mznModel.checkOutYear;$("MMTcitycode").value=mznModel.cityCode;$("MMTDeepcitycode").value=mznModel.cityCode;$("MMTcityName").value=mznModel.city;$("MMTcityName2").value=mznModel.city;$("MMTDeepcityName").value=mznModel.city;$("MMTDeepHotelName").value=mznModel.mmtDeepHotelName;$("MMTDeepHotelCode").value=mznModel.mmtDeepHotelCode}function onSuccessBOP(a,b){mznModel=new MznBookOnPhoneModel();mznModel=a;$("mznContainer").innerHTML=mznModel.UI}function onSuccessRequestPhone(a,b){if(a=="Y"){$("smsSentNotification"+currDivID).innerHTML='<font color="green">Hotel Number has been sent as an SMS!</font>'}else{$("smsSentNotification"+currDivID).innerHTML='<font color="red">Sorry! Hotel Number could not be found</font>'}}var currDivID;function requestPhone(a){currDivID=a;var b=$("visitorMobile"+currDivID).value;if(b!="Enter your Mobile number"){MznService.requestPhone(mznModel.hotelID,mznModel.hotelName,b,onSuccessRequestPhone,new OnFailure(0).onFailure());$("visitorMobile"+currDivID).value=$("visitorMobile"+currDivID).defaultValue;$("invalidNumber"+currDivID).style.display="none";return true}else{$("invalidNumber"+currDivID).style.display="block";return false}}function onSuccessRFR(a,b){mznModel=new MznRequestForRatesModel();mznModel=a;$("mznContainer").innerHTML=mznModel.UI;SetupCalendar("rfrCheckInDate");SetupCalendar("rfrCheckOutDate")}function handleRequest(){if(checkIfDateGreater($("rfrCheckInDate").value,$("rfrCheckOutDate").value)){$("rfrCheckDates").style.display="block";return false}else{$("rfrCheckDates").style.display="none"}if(validateEmailConsistency()){MznService.TrackThis("Send Request",window.location.href,OnTrackSuccess,onTrackFailure);MM_openBrWindowRFR("about:blank","formtarget","width=610, height=580,toolbar=no, menubar=no,scrollbars=auto,resizable=no");copyFieldsToProxyForm();document.hiddenForm.submit();return true}else{return false}}function OnTrackSuccess(){}function onTrackFailure(){}function MM_openBrWindowRFR(c,a,b){window.open(c,a,b)}function copyFieldsToProxyForm(){$("proxyName").value=$("fullName").value;mznModel.name=$("fullName").value;$("proxyEmail").value=$("emailID1").value;mznModel.email=$("emailID1").value;$("proxyHotelId").value=mznModel.hotelID}var confirmPrompt="Confirm your Email ID";function validateEmailConsistency(){if($("mznCityName2")!=null&&$("mznCityName2").value==$("mznCityName2").defaultValue){if($("specifyCity2")){$("specifyCity2").style.display="block"}$("emailsnotentered").style.display="none";$("emailmismatch").style.display="none";$("invalidEmailId").style.display="none";$("invalidName").style.display="none";$("mznCityName2").focus();return false}else{if($("emailID1").value==""){$("emailsnotentered").style.display="block";$("emailmismatch").style.display="none";$("invalidEmailId").style.display="none";$("invalidName").style.display="none";if($("specifyCity2")){$("specifyCity2").style.display="none"}$("emailID1").focus();return false}else{if($("emailID2").value==""){$("emailsnotentered").style.display="block";$("emailmismatch").style.display="none";$("invalidEmailId").style.display="none";$("invalidName").style.display="none";if($("specifyCity2")){$("specifyCity2").style.display="none"}$("emailID2").focus();return false}else{if($("fullName").value=="Enter your Full Name"||$("fullName").value.length<5){$("emailsnotentered").style.display="none";$("emailmismatch").style.display="none";$("invalidEmailId").style.display="none";$("invalidName").style.display="block";if($("specifyCity2")){$("specifyCity2").style.display="none"}$("fullName").focus();return false}else{if($("emailID1").value!="Enter your Email ID"&&$("emailID2").value!=confirmPrompt&&!doEmailsMatch()){$("emailsnotentered").style.display="none";$("emailmismatch").style.display="block";$("invalidEmailId").style.display="none";$("invalidName").style.display="none";if($("specifyCity2")){$("specifyCity2").style.display="none"}$("emailID1").focus();return false}else{if(echeck($("emailID1").value)==false){$("emailsnotentered").style.display="none";$("emailmismatch").style.display="none";$("invalidEmailId").style.display="block";$("invalidName").style.display="none";if($("specifyCity2")){$("specifyCity2").style.display="none"}$("emailID1").focus();return false}else{if(echeck($("emailID2").value)==false){$("emailsnotentered").style.display="none";$("emailmismatch").style.display="none";$("invalidEmailId").style.display="block";$("invalidName").style.display="none";if($("specifyCity2")){$("specifyCity2").style.display="none"}$("emailID2").focus();return false}else{$("emailsnotentered").style.display="none";$("emailmismatch").style.display="none";$("invalidEmailId").style.display="none";$("invalidName").style.display="none";if($("specifyCity2")!=null){$("specifyCity2").style.display="none"}}}}}}}}if($("emailID1").value!=""&&doEmailsMatch()&&echeck($("emailID1").value)){return new Boolean(true)}}function reqFormOnload(){clearResidentOf=function(){new handleID("reqForm_CityOfResidence").clear()};notifyResidentOf=function(){new handleID("reqForm_CityOfResidence").notify()};clearPhone=function(){new handleID("reqForm_phone").clear()};notifyPhone=function(){new handleID("reqForm_phone").notify()};clearLL=function(){new handleID("reqForm_landlinePhone").clear()};notifyLL=function(){new handleID("reqForm_landlinePhone").notify()};opener.mznModel.purposeOfTrip="Leisure";opener.mznModel.perDayBudget="Less than Rs.1500";opener.mznModel.nights=3;opener.mznModel.numRooms=1;opener.mznModel.adults=1;opener.mznModel.children=0;opener.mznModel.arrivingBy="Self Drive";var b=opener.mznModel.name;var a=opener.mznModel.email;if($("reqForm_visitorEmail")){$("reqForm_visitorEmail").value=a}$("reqForm_firstName").value=b;opener.mznModel.firstName=$("reqForm_firstName").value;if(opener.mznModel.exitPopupVisitorMobile!=""&&opener.mznModel.exitPopupVisitorMobile!=null){$("reqForm_phone").value=opener.mznModel.exitPopupVisitorMobile}if(opener.mznModel.residentOf!=""&&opener.mznModel.residentOf!=null){$("reqForm_CityOfResidence").value=opener.mznModel.residentOf}if(opener.mznModel.completeCheckInDate!=null&&opener.mznModel.completeCheckInDate!=""){if($("reqForm_DateOfCheckIn")){$("reqForm_DateOfCheckIn").value=opener.mznModel.completeCheckInDate}}if(opener.mznModel.completeCheckOutDate!=null&&opener.mznModel.completeCheckOutDate!=""){if($("reqForm_DateOfCheckOut")){$("reqForm_DateOfCheckOut").value=opener.mznModel.completeCheckOutDate}}if(opener.mznModel.hotelName==null||opener.mznModel.hotelName==""){if(opener.mznModel.city!=null&&opener.mznModel.city!=""){$("hotelName").innerHTML="Hotels in "+opener.mznModel.city}else{if(opener.mznModel.currentCity!=null&&opener.mznModel.currentCity!=""){$("hotelName").innerHTML="Hotels in "+opener.mznModel.currentCity}}}else{$("hotelName").innerHTML=opener.mznModel.hotelName}if(opener.mznModel.hotelName!=null){$("hotelAddress").innerHTML=opener.mznModel.address}}function setTodaysDatePlusSeven(){var c=new Date();var b=new Date(c.getFullYear(),c.getMonth(),c.getDate()+7);var a=$("reqForm_DateOfCheckIn");a.value=b.getDate()+"/"+(b.getMonth()-1+2)+"/"+b.getFullYear()}function trim(b,a){return ltrim(rtrim(b,a),a)}function ltrim(b,a){a=a||"\\s";return b.replace(new RegExp("^["+a+"]+","g"),"")}function rtrim(b,a){a=a||"\\s";return b.replace(new RegExp("["+a+"]+$","g"),"")}function onSuccessRFRForm(){if(opener.mznModel.hotelName!=null&&opener.mznModel.hotelName!=""){packageName=opener.mznModel.hotelName+" "+opener.mznModel.city}else{packageName="Hotels in "+opener.mznModel.city}packageName=packageName.replace(/ /g,"-");journeyDate=opener.mznModel.completeCheckInDate;day=journeyDate.split("/")[0];month=journeyDate.split("/")[1];year=journeyDate.split("/")[2];if(day.length<2){day="0"+day}if(month.length<2){month="0"+month}journeyDate=day+"/"+month+"/"+year;userDestination=opener.mznModel.residentOf;if(userDestination.indexOf(",")!=-1){userCity=trim(userDestination.split(",")[0]).replace(" ","-");userCountry=trim(userDestination.split(",")[1]).replace(" ","-")}else{userCity=trim(userDestination).replace(" ","-");userCountry="India"}window.location.href="http://172.16.8.192/mmtlms/LeadTracker.aspx?pkgCode=OKTBNONPKG_PC&pkgName="+packageName+"&userEmail="+opener.mznModel.email+"&userPhone="+opener.mznModel.phone1+"&userCity="+userCity+"&JourneyDate="+journeyDate+"&source=Webform&autoqualified=N&rlink=http://www.oktatabyebye.com/hotels/Hotel-RequestRate-Thanks.aspx&pubid=01&numAdult="+opener.mznModel.adults+"&numChild="+opener.mznModel.children+"&userQuery="+opener.mznModel.additionalRequest+"&depCountry="+userCountry+"&website=OKTTBB&user_firstname="+firstName+"&user_lastname="+lastName+"&depCity="+userCity+"&lob=DOM&pkgCat=l1&addInfo=test&userCountry="+userCountry+""}var firstName,lastName;function requestRatesEmail(){if(validateRFRForm()){$("reqForm_RequestRatesButton").style.display="none";$("wait").style.display="block";MznService.TrackThis("Submit",opener.location.href,OnTrackSuccess,onTrackFailure);mznModelRFR=new MznCombinedModel();var b=opener.mznModel.firstName;var a=opener.mznModel.firstName.indexOf(" ");if(a!=-1){firstName=b.substring(0,a);lastName=b.substring(a+1,b.length)}else{firstName=b;lastName=""}mznModelRFR.firstName=firstName;mznModelRFR.lastName=lastName;mznModelRFR.title=$("reqForm_title").value;mznModelRFR.residentOf=opener.mznModel.residentOf;mznModelRFR.phone1=opener.mznModel.phone1;mznModelRFR.email=opener.mznModel.email;mznModelRFR.completeCheckInDate=opener.mznModel.completeCheckInDate;mznModelRFR.completeCheckOutDate=opener.mznModel.completeCheckOutDate;mznModelRFR.numRooms=opener.mznModel.numRooms;mznModelRFR.arrivingBy=opener.mznModel.arrivingBy;mznModelRFR.perDayBudget=opener.mznModel.perDayBudget;mznModelRFR.purposeOfTrip=opener.mznModel.purposeOfTrip;mznModelRFR.adults=opener.mznModel.adults;mznModelRFR.children=opener.mznModel.children;mznModelRFR.hotelCity=opener.mznModel.hotelCity;mznModelRFR.hotelID=opener.mznModel.hotelID;mznModelRFR.additionalRequest=opener.mznModel.additionalRequest;if(mznModelRFR.additionalRequest==null){mznModelRFR.additionalRequest=""}mznModelRFR.city=opener.mznModel.city;MznService.requestRatesEmail(mznModelRFR,onSuccessRFRForm,sureShotFailure)}return false}var idValue={fullName:"Enter your Full Name",emailID1:"Enter your Email ID",emailID2:"Confirm your Email ID",reqForm_CityOfResidence:"Enter your City of Residence",reqForm_phone:"09xxxxxxxxx",reqForm_landlinePhone:"(STD)xxxxxxx",mznCityName:"Type in the City",mznCityName2:"Type in the City",mznCityName3:"Type in the City",visitorMobile:"Enter your Mobile number",visitorMobileo:"Enter your Mobile number",visitorMobilee:"Enter your Mobile number",floatfullName:"Enter your Full Name",floatemailID1:"Enter your Email ID",floatemailID2:"Confirm your Email ID",visitorMobileFloat:"Enter your Mobile number",visitorMobileFloato:"Enter your Mobile number",visitorMobileFloate:"Enter your Mobile number"};function $(a){return document.getElementById(a)}function handleID(a){this.id=a;this.clear=function(){if($(this.id).value==idValue[this.id]){$(this.id).value=""}};this.notify=function(){if($(this.id).value==""){$(this.id).value=idValue[this.id]}}}function defineFunctions(){clearName=function(){new handleID("fullName").clear()};notifyName=function(){new handleID("fullName").notify()};clearEmail1=function(){new handleID("emailID1").clear()};notifyEmail1=function(){new handleID("emailID1").notify()};clearEmail2=function(){new handleID("emailID2").clear()};notifyEmail2=function(){new handleID("emailID2").notify()};clearCityName=function(){new handleID("mznCityName").clear()};notifyCityName=function(){new handleID("mznCityName").notify()};clearCityName2=function(){new handleID("mznCityName2").clear()};notifyCityName2=function(){mznModel.CityName=$("mznCityName2").value;new handleID("mznCityName2").notify()};clearCityName3=function(){new handleID("mznCityName3").clear()};notifyCityName3=function(){new handleID("mznCityName3").notify()};clearMobileo=function(){new handleID("visitorMobileo").clear()};notifyMobileo=function(){new handleID("visitorMobileo").notify()};clearMobilee=function(){new handleID("visitorMobilee").clear()};notifyMobilee=function(){new handleID("visitorMobilee").notify()};floatclearName=function(){new handleID("floatfullName").clear()};floatnotifyName=function(){new handleID("floatfullName").notify()};floatclearEmail1=function(){new handleID("floatemailID1").clear()};floatnotifyEmail1=function(){new handleID("floatemailID1").notify()};floatclearEmail2=function(){new handleID("floatemailID2").clear()};floatnotifyEmail2=function(){new handleID("floatemailID2").notify()};floatclearMobileo=function(){new handleID("visitorMobileFloato").clear()};floatnotifyMobileo=function(){new handleID("visitorMobileFloato").notify()};floatclearMobilee=function(){new handleID("visitorMobileFloate").clear()};floatnotifyMobilee=function(){new handleID("visitorMobileFloate").notify()}}function echeck(a){emailpat=/^([a-zA-Z0-9])+([\.a-zA-Z0-9_-])*@([a-zA-Z0-9])+(\.[a-zA-Z0-9_-]+)+$/;if(!emailpat.test(a)){return false}return true}function phonecheck(a){mobilepat=/^([0-9])+-*([0-9])*$/;if(!mobilepat.test(a)){return false}else{return true}}function callTabPhoneCheck(c,a){var b=(c.which)?c.which:c.keyCode;if(b==8||b==9){return true}var d=$("visitorMobile"+a).value;if(b!=13){d+=String.fromCharCode(b)}callTabMobilePat=/^9([0-9])*$/;if(!callTabMobilePat.test(d)){return false}else{if(b==13){requestPhone();return false}return true}}function validateRFRForm(){var d=$("reqForm_firstName").value;var f=$("reqForm_title").value;if($("reqForm_visitorEmail")){var c=$("reqForm_visitorEmail").value}var a=$("reqForm_phone").value;if(f==""||d=="Enter your Name"||d==""){$("firstNameError").style.display="block";return false}else{$("firstNameError").style.display="none";if($("reqForm_visitorEmail")&&(c=="Enter your Email ID"||c==""||echeck(c)==false)){$("emailError").style.display="block";return false}else{if(!phonecheck(a)){$("emailError").style.display="none";$("phoneError").style.display="block";return false}else{var b=$("reqForm_CityOfResidence").value;if(b=="Enter your City of Residence"||b==""||b.indexOf(",")==-1){$("CityError").style.display="block";$("phoneError").style.display="none";return false}else{$("emailError").style.display="none";$("phoneError").style.display="none";$("CityError").style.display="none";return true}}}}}function doEmailsMatch(){return $("emailID1").value.toLowerCase()==$("emailID2").value.toLowerCase()}function toggleWgtChecking(){if($("mznWgt1").style.display!="none"){$("mznWgt1").style.display="none";$("mznWgt2").style.display="none"}else{$("mznWgt1").style.display="block";$("mznWgt2").style.display="block"}}var t=null;function blinkMzn(a){if(t!=null){clearTimeout(t)}if($("cro")){$("cro").style.border="1px solid blue"}if($("rfr")){$("rfr").style.border="1px solid blue"}if($("bop")){$("bop").style.border="1px solid blue"}++a;t=setTimeout("clearMzn("+a+")",500)}function clearMzn(a){clearTimeout(t);if($("cro")){$("cro").style.border=""}if($("rfr")){$("rfr").style.border=""}if($("bop")){$("bop").style.border=""}if(a==6){return}t=setTimeout("blinkMzn("+a+")",500)}var takeToNextPage=0;function Set_Cookie(d,f,a){var c=new Date();c.setTime(c.getTime());if(a){a=a*1000*60*60*24}var b=new Date(c.getTime()+(a));f=f+"||expires="+b;document.cookie=d+"="+escape(f)+((a)?";expires="+b.toGMTString():"")}function Get_CookieDate(b){var j=document.cookie.split(";");var d="";var h="";var g="";var f=false;for(i=0;i<j.length;i++){d=j[i].split("=");h=d[0].replace(/^\s+|\s+$/g,"");if(h==b){f=true;if(d.length==2){var c=unescape(d[1].replace(/^\s+|\s+$/g,""));var a=c.split("||");g=a[1].split("=")[1]}return g;break}d=null;h=""}if(!f){return null}}function Get_CookieName(b){var j=document.cookie.split(";");var d="";var g="";var h="";var f=false;for(i=0;i<j.length;i++){d=j[i].split("=");g=d[0].replace(/^\s+|\s+$/g,"");if(g==b){f=true;if(d.length==2){var c=unescape(d[1].replace(/^\s+|\s+$/g,""));var a=c.split("||");h=a[0]}return h;break}d=null;g=""}if(!f){return null}}var URL=window.location.href;var popUpUrl="";var cookieDate=Get_CookieDate("POPUP_COOKIE_NAME");var cookiesExDate=new Date(cookieDate);var currentDate=new Date();try{var screenWidth=screen.width;var screenHeight=screen.height}catch(e){}var showPopup=function(){Set_Cookie("POPUP_SESSION_COOKIE_NAME",new Date());Set_Cookie("POPUP_COOKIE_NAME","true","POPUP_COOKIE_AGE_IN_DAYS");try{var b=window.open(popUpUrl,"popupwindow","height=500,width=800,location=no,scrollbars=no,menubars=no,toolbars=no,resizable=yes");if(!b.closed){b.blur()}}catch(a){}window.focus()};function findYourHotelExitPopup(a){popUpUrl="http://www.oktatabyebye.com/Hotels/findyourhotel.aspx?cityName="+a;if(takeToNextPage==1){Set_Cookie("POPUP_SESSION_COOKIE_NAME","takeToNextPage");takeToNextPage=0}else{Set_Cookie("POPUP_SESSION_COOKIE_NAME","","-1")}if(Get_CookieName("POPUP_SESSION_COOKIE_NAME")!="takeToNextPage"){if(Get_CookieName("POPUP_COOKIE_NAME")=="true"){if(cookiesExDate.getTime()<currentDate.getTime()){showPopup()}}else{showPopup()}}}if(Get_CookieName("POPUP_SESSION_COOKIE_NAME")!=null&&Get_CookieName("POPUP_SESSION_COOKIE_NAME")!="null"&&Get_CookieName("POPUP_SESSION_COOKIE_NAME")!="takeToNextPage"){var lastTimeOpen=Get_CookieName("POPUP_SESSION_COOKIE_NAME");var lastTimeOpenDate=new Date(lastTimeOpen);var currentTime=new Date();if(currentTime.getTime()-lastTimeOpenDate.getTime()<100000){Set_Cookie("POPUP_COOKIE_NAME","","-1");try{var newwindow=window.open(popUpUrl,"popupwindow","toolbar=yes,location=yes,resizable=yes,scrollbars=yes,height=1,width=1,left="+screenWidth+",top="+screenHeight+",screenX="+screenWidth+",screenY="+screenHeight+"");if(!newwindow.closed){newwindow.close()}}catch(e){}}else{var cookieDate=Get_CookieDate("POPUP_COOKIE_NAME");var cookiesExDate=new Date(cookieDate);var diffinTime=cookiesExDate-currentTime;var diffinDates=diffinTime/(1000*60*60*24);Set_Cookie("POPUP_COOKIE_NAME","true",diffinDates)}}function isNumber(b){var a=(b.which)?b.which:b.keyCode;if((a>=48&&a<=57)){return false}return true};