//BROWSER SELECTOR var css_browser_selector = function() { var ua=navigator.userAgent.toLowerCase(), is=function(t){return ua.indexOf(t) != -1;}, h=document.getElementsByTagName('html')[0], b=(!(/opera|webtv/i.test(ua))&&/msie (\d)/.test(ua))?('ie ie'+RegExp.$1):is('firefox/2')?'gecko ff2':is('firefox/3')?'gecko ff3':is('gecko/')?'gecko':is('opera/9')?'opera opera9':/opera (\d)/.test(ua)?'opera opera'+RegExp.$1:is('konqueror')?'konqueror':is('chrome')?'chrome webkit safari':is('applewebkit/')?'webkit safari':is('mozilla/')?'gecko':'', os=(is('x11')||is('linux'))?' linux':is('mac')?' mac':is('win')?' win':''; var c=b+os+' js'; h.className =''; h.className += h.className?' '+c:c; var getbrower = b.split(' '); brower = getbrower[0]; fullBrower = getbrower[0] + ' ' + getbrower[1]; }(); if( fullBrower == 'ie ie6'){ ieHover = function() { var ieLIs = document.getElementById('top_des'); if( ieLIs ){ ieLIs.style.zIndex="99"; var ieMat = document.createElement('iframe'); var att_frameborder = document.createAttribute("frameborder"); att_frameborder.value = 5; ieMat.setAttributeNode(att_frameborder); ieMat.style.width= "118px"; ieMat.style.height="305px"; ieLIs.insertBefore(ieMat,ieLIs.firstChild); } } if (window.attachEvent) window.attachEvent('onload', ieHover); } //Newslettes function PopupResultNewsletter() { var windowprops = "height=200,width=671,location=no,"+"scrollbars=no,menubars=no,toolbars=no,resizable=no"; var URL = "http://directrooms.com/cgi/v3contact.cgi?contacttype="+document.newsletter.contacttype.value+"+email="+document.newsletter.email.value+"+refererurl="+window.location; popup = window.open(URL,"NewsletterPopup",windowprops); popup.focus(); } function ClearEmail(email) { if (email.indexOf('enter your email') != -1) { document.newsletter.email.value=""; } } //Tell a friend function openTellafriendPopup(myLink) { if(! window.focus)return; var myWin=window.open(myLink,"","toolbar=1,status=1,menubar=1,scrollbars=1,resizable=1,width=671,height=550"); myWin.focus(); } // Exchanges var currency_value; function chk_currencyid() { if (document.exchangecurrency.currencyid.options[document.exchangecurrency.currencyid.selectedIndex].value != '') { currency_value = document.exchangecurrency.currencyid.options[document.exchangecurrency.currencyid.selectedIndex].value; return true; } alert('Select one to exchange rates'); return false; } function ShowExchangeRate() { if(!chk_currencyid()) return; var windowprops = "height=450,width=700,location=no,"+"scrollbars=yes,menubars=no,toolbars=no,resizable=yes"; var URL = "http://directrooms.com/cgi/changecurrency.cgi?action=send+hotelid="+document.exchangecurrency.hotelid.value+"+currencyid="+currency_value; popup = window.open(URL,"MenuPopup",windowprops); popup.focus(); } function openPopup(myLink) { if(! window.focus)return; var myWin=window.open(myLink,"","toolbar=1,status=1,menubar=1,scrollbars=1,resizable=1,width=671,height=550"); myWin.focus(); } var scriptLoc = 'http://www.myaffiliateprogram.com/u/drooms/rep.asp'; var cookies_age = 90; // age of cookies in number of days var kbId = 0; var queryString = window.location.search.substring(1); var imgdata = ''; var subdata = ''; var overwrite = 0; var base_url = 'http://directrooms.com/cgi/2/cd.cgi'; var source = ''; var c = ''; var r = ''; var h = ''; var k = ''; if (queryString.length > 0) { var pairs = queryString.split('&'); for(var i = 0; i < pairs.length; i++) { var pairs2 = pairs[i].split('='); switch(pairs2[0].toLowerCase()) { case 'kbid': kbId = pairs2[1]; break; case 'clearcookie': if (pairs2[1] == 1) { DeleteCookie("kbid"); } break; case 'img': imgdata = pairs2[1]; break; case 'sub': subdata = pairs2[1]; break; case 'source': source = pairs2[1]; break; case 'c': c = pairs2[1]; break; case 'r': r = pairs2[1]; break; case 'h': h = pairs2[1]; break; case 'k': k = pairs2[1]; break; } } //end for }//end if if (GetCookie("kbid") == null || overwrite == 1) { if (kbId != 0) { var img = new Image(); var url = scriptLoc + '?id=' + kbId; if (imgdata != '') { url += '&img=' + imgdata } if (subdata != '') { url += '&sub=' + subdata } img.src = url; SetCookie("kbid", kbId, cookies_age); } }//end if // if ((source.length > 0) && (c.length > 0) && (r.length > 0) && (h.length > 0) && (k.length > 0)) if (source.length > 0) { var img = new Image(); var url = base_url + "?" + queryString; img.src = url; //SetCookie("kbid", kbId, 1); //alert ("source = " + source + ", c = " + c + ", r = " + r + ", h = " + h + ", k = " + k ); //alert (url); }//end if function getCookieVal (offset) { var endstr = document.cookie.indexOf (";", offset); if (endstr == -1) endstr = document.cookie.length; return unescape(document.cookie.substring(offset, endstr)); } function GetCookie (name) { var arg = name + "="; var alen = arg.length; var clen = document.cookie.length; var i = 0; while (i < clen) { var j = i + alen; if (document.cookie.substring(i, j) == arg) return getCookieVal (j); i = document.cookie.indexOf(" ", i) + 1; if (i == 0) break; } return null; } function WriteCookie (name, value, expires) { var argv = SetCookie.arguments; var argc = SetCookie.arguments.length; var path = (argc > 3) ? argv[3] : null; var domain = (argc > 4) ? argv[4] : null; var secure = (argc > 5) ? argv[5] : false; var cookie = name + "=" + escape(value) + ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + ((path == null) ? "" : ("; path=" + path)) + ((domain == null) ? "" : ("; domain=" + domain)) + ((secure == true) ? "; secure" : ""); document.cookie = cookie; } function DeleteCookie (name) { var exp = new Date(); exp.setTime (exp.getTime() - 1000000000); // This cookie is history (changed -1 to make it previous time) var cval = GetCookie (name); document.cookie =name + "=" + cval + "; expires=" + exp.toGMTString(); } function SetCookie(name, value, expiredays) { var expdate = new Date(); expdate.setTime(expdate.getTime() + (24 * 60 * 60 * 1000 * expiredays)); WriteCookie(name, value, expdate); }