/* mati - this is WP file from wp-includes/js .  I added to it ruthsarian_utilities.js which is needed by the theme , the combination is for paster load time 
also added js for switching text in ads */
function event_attach(event,func){if(window.attachEvent){window.attachEvent(event,func)}else{if((typeof(func)).toLowerCase()!="function"){return}if((typeof(document.event_handlers)).toLowerCase()=="undefined"){document.event_handlers=new Array()}if((typeof(document.event_handlers[event])).toLowerCase()=="undefined"){document.event_handlers[event]=new Array()}if((typeof(eval("window."+event))).toLowerCase()!="function"){eval("window."+event+" = function () { if ( ( typeof( document.event_handlers[ '"+event+"' ] ) ).toLowerCase() != 'undefined' ) { for ( i = document.event_handlers[ '"+event+"' ].length - 1 ; i >= 0  ; i-- ) { document.event_handlers[ '"+event+"' ][ i ](); } } } ")}document.event_handlers[event][document.event_handlers[event].length]=func}}function browser_detect(){var a=navigator.userAgent.toLowerCase();this.isGecko=(a.indexOf("gecko")!=-1&&a.indexOf("safari")==-1);this.isAppleWebKit=(a.indexOf("applewebkit")!=-1);this.isKonqueror=(a.indexOf("konqueror")!=-1);this.isSafari=(a.indexOf("safari")!=-1);this.isOmniweb=(a.indexOf("omniweb")!=-1);this.isDreamcast=(a.indexOf("dreamcast")!=-1);this.isOpera=(a.indexOf("opera")!=-1);this.isIcab=(a.indexOf("icab")!=-1);this.isAol=(a.indexOf("aol")!=-1);this.isIE=(a.indexOf("msie")!=-1&&!this.isOpera&&(a.indexOf("webtv")==-1));this.isMozilla=(this.isGecko&&a.indexOf("gecko/")+14==a.length);this.isFirebird=(a.indexOf("firebird/")!=-1);this.isNS=((this.isGecko)?(a.indexOf("netscape")!=-1):((a.indexOf("mozilla")!=-1)&&!this.isOpera&&!this.isSafari&&(a.indexOf("spoofer")==-1)&&(a.indexOf("compatible")==-1)&&(a.indexOf("webtv")==-1)&&(a.indexOf("hotjava")==-1)));this.isIECompatible=((a.indexOf("msie")!=-1)&&!this.isIE);this.isNSCompatible=((a.indexOf("mozilla")!=-1)&&!this.isNS&&!this.isMozilla);this.geckoVersion=((this.isGecko)?a.substring((a.lastIndexOf("gecko/")+6),(a.lastIndexOf("gecko/")+14)):-1);this.equivalentMozilla=((this.isGecko)?parseFloat(a.substring(a.indexOf("rv:")+3)):-1);this.appleWebKitVersion=((this.isAppleWebKit)?parseFloat(a.substring(a.indexOf("applewebkit/")+12)):-1);this.versionMinor=parseFloat(navigator.appVersion);if(this.isGecko&&!this.isMozilla){this.versionMinor=parseFloat(a.substring(a.indexOf("/",a.indexOf("gecko/")+6)+1))}else{if(this.isMozilla){this.versionMinor=parseFloat(a.substring(a.indexOf("rv:")+3))}else{if(this.isIE&&this.versionMinor>=4){this.versionMinor=parseFloat(a.substring(a.indexOf("msie ")+5))}else{if(this.isKonqueror){this.versionMinor=parseFloat(a.substring(a.indexOf("konqueror/")+10))}else{if(this.isSafari){this.versionMinor=parseFloat(a.substring(a.lastIndexOf("safari/")+7))}else{if(this.isOmniweb){this.versionMinor=parseFloat(a.substring(a.lastIndexOf("omniweb/")+8))}else{if(this.isOpera){this.versionMinor=parseFloat(a.substring(a.indexOf("opera")+6))}else{if(this.isIcab){this.versionMinor=parseFloat(a.substring(a.indexOf("icab")+5))}}}}}}}}this.versionMajor=parseInt(this.versionMinor);this.isDOM1=(document.getElementById);this.isDOM2Event=(document.addEventListener&&document.removeEventListener);this.mode=document.compatMode?document.compatMode:"BackCompat";this.isWin=(a.indexOf("win")!=-1);this.isWin32=(this.isWin&&(a.indexOf("95")!=-1||a.indexOf("98")!=-1||a.indexOf("nt")!=-1||a.indexOf("win32")!=-1||a.indexOf("32bit")!=-1||a.indexOf("xp")!=-1));this.isMac=(a.indexOf("mac")!=-1);this.isUnix=(a.indexOf("unix")!=-1||a.indexOf("sunos")!=-1||a.indexOf("bsd")!=-1||a.indexOf("x11")!=-1);this.isLinux=(a.indexOf("linux")!=-1);this.isNS4x=(this.isNS&&this.versionMajor==4);this.isNS40x=(this.isNS4x&&this.versionMinor<4.5);this.isNS47x=(this.isNS4x&&this.versionMinor>=4.7);this.isNS4up=(this.isNS&&this.versionMinor>=4);this.isNS6x=(this.isNS&&this.versionMajor==6);this.isNS6up=(this.isNS&&this.versionMajor>=6);this.isNS7x=(this.isNS&&this.versionMajor==7);this.isNS7up=(this.isNS&&this.versionMajor>=7);this.isIE4x=(this.isIE&&this.versionMajor==4);this.isIE4up=(this.isIE&&this.versionMajor>=4);this.isIE5x=(this.isIE&&this.versionMajor==5);this.isIE55=(this.isIE&&this.versionMinor==5.5);this.isIE5up=(this.isIE&&this.versionMajor>=5);this.isIE6x=(this.isIE&&this.versionMajor==6);this.isIE6up=(this.isIE&&this.versionMajor>=6);this.isIE7x=(this.isIE&&this.versionMajor==7);this.isIE7up=(this.isIE&&this.versionMajor>=7);this.isIE4xMac=(this.isIE4x&&this.isMac)}var IEPNGFix=window.IEPNGFix||{};IEPNGFix.tileBG=function(g,q,n){var F=this.data[g.uniqueID],b=Math.max(g.clientWidth,g.scrollWidth),h=Math.max(g.clientHeight,g.scrollHeight),j=g.currentStyle.backgroundPositionX,i=g.currentStyle.backgroundPositionY,o=g.currentStyle.backgroundRepeat;if(!F.tiles){F.tiles={elm:g,src:"",cache:[],img:new Image(),old:{}}}var B=F.tiles,u=B.img.width,c=B.img.height;if(q){if(!n&&q!=B.src){B.img.onload=function(){this.onload=null;IEPNGFix.tileBG(g,q,1)};return B.img.src=q}}else{if(B.src){n=1}u=c=0}B.src=q;if(!n&&b==B.old.w&&h==B.old.h&&j==B.old.x&&i==B.old.y&&o==B.old.r){return}var e={top:"0%",left:"0%",center:"50%",bottom:"100%",right:"100%"},l,k,a;l=e[j]||j;k=e[i]||i;if(a=l.match(/(\d+)%/)){l=Math.round((b-u)*(parseInt(a[1])/100))}if(a=k.match(/(\d+)%/)){k=Math.round((h-c)*(parseInt(a[1])/100))}l=parseInt(l);k=parseInt(k);var D={repeat:1,"repeat-x":1}[o],A={repeat:1,"repeat-y":1}[o];if(D){l%=u;if(l>0){l-=u}}if(A){k%=c;if(k>0){k-=c}}this.hook.enabled=0;if(!({relative:1,absolute:1}[g.currentStyle.position])){g.style.position="relative"}var f=0,m,z=D?b:l+0.1,r,v=A?h:k+0.1,w,p,C;if(u&&c){for(m=l;m<z;m+=u){for(r=k;r<v;r+=c){C=0;if(!B.cache[f]){B.cache[f]=document.createElement("div");C=1}var t=(m+u>b?b-m:u),E=(r+c>h?h-r:c);w=B.cache[f];p=w.style;p.behavior="none";p.left=m+"px";p.top=r+"px";p.width=t+"px";p.height=E+"px";p.clip="rect("+(r<0?0-r:0)+"px,"+t+"px,"+E+"px,"+(m<0?0-m:0)+"px)";p.display="block";if(C){p.position="absolute";p.zIndex=-999;if(g.firstChild){g.insertBefore(w,g.firstChild)}else{g.appendChild(w)}}this.fix(w,q,0);f++}}}while(f<B.cache.length){this.fix(B.cache[f],"",0);B.cache[f++].style.display="none"}this.hook.enabled=1;B.old={w:b,h:h,x:j,y:i,r:o}};IEPNGFix.update=function(){for(var b in IEPNGFix.data){var a=IEPNGFix.data[b].tiles;if(a&&a.elm&&a.src){IEPNGFix.tileBG(a.elm,a.src)}}};IEPNGFix.update.timer=0;if(window.attachEvent&&!window.opera){window.attachEvent("onresize",function(){clearTimeout(IEPNGFix.update.timer);IEPNGFix.update.timer=setTimeout(IEPNGFix.update,100)})}function sfHover(b,d){var a=new browser_detect();if(a.isIE5up&&!a.isIE7up){var e=document.getElementById(b).getElementsByTagName("LI");for(var c=0;c<e.length;c++){if(!d&&!a.isMac&&(a.isIE55||a.isIE6x)){e[c].onmouseover=function(){this.className+=(this.className.length>0?" ":"")+"sfhover";var f=this.getElementsByTagName("UL")[0];if(f){var g=document.createElement("IFRAME");g.style.width=f.offsetWidth+"px";g.style.height=f.offsetHeight+"px";g.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)";f.insertBefore(g,f.firstChild);g.style.zIndex="-1"}};e[c].onmouseout=function(){this.className=this.className.replace(new RegExp("( ?|^)sfhover\\b"),"");var f=this.getElementsByTagName("ul")[0];if(f){f.removeChild(f.firstChild)}}}else{e[c].onmouseover=function(){this.className+=(this.className.length>0?" ":"")+"sfhover"};e[c].onmouseout=function(){this.className=this.className.replace(new RegExp("( ?|^)sfhover\\b"),"")}}}}}function isDefined(a){return(typeof(window[a])=="undefined")?false:true}function pause(a){var c=new Date();var b=null;do{b=new Date()}while((b-c)<a)};
function scroll(message_loop,cityName){ var messages = new Array();messages[0] = "רוצה להזמין מלון ב" + cityName + "? <br/> מחפש פרטים על המלון בדיל שרכשת ? ";messages[1] = "מנוע חיפוש משווה עבורך מחירי מלונות ב-30 האתרים מובילים ברשת !";messages[2] = " <br/>לחץ כאן עכשיו<br/>ובדוק לפני שתחליט >>> ";if(message_loop >= messages.length) { message_loop = 0; } document.getElementById("hc1_messages").innerHTML = messages[message_loop]; message_loop++; setTimeout("scroll("+message_loop+",\'"+cityName+"\')",4000);return;};
/* mati - end */
function sack(file){this.xmlhttp=null;this.resetData=function(){this.method="POST";this.queryStringSeparator="?";this.argumentSeparator="&";this.URLString="";this.encodeURIString=true;this.execute=false;this.element=null;this.elementObj=null;this.requestFile=file;this.vars=new Object();this.responseStatus=new Array(2)};this.resetFunctions=function(){this.onLoading=function(){};this.onLoaded=function(){};this.onInteractive=function(){};this.onCompletion=function(){};this.onError=function(){};this.onFail=function(){}};this.reset=function(){this.resetFunctions();this.resetData()};this.createAJAX=function(){try{this.xmlhttp=new ActiveXObject("Msxml2.XMLHTTP")}catch(e1){try{this.xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")}catch(e2){this.xmlhttp=null}}if(!this.xmlhttp){if(typeof XMLHttpRequest!="undefined"){this.xmlhttp=new XMLHttpRequest()}else{this.failed=true}}};this.setVar=function(name,value){this.vars[name]=Array(value,false)};this.encVar=function(name,value,returnvars){if(true==returnvars){return Array(encodeURIComponent(name),encodeURIComponent(value))}else{this.vars[encodeURIComponent(name)]=Array(encodeURIComponent(value),true)}};this.processURLString=function(string,encode){encoded=encodeURIComponent(this.argumentSeparator);regexp=new RegExp(this.argumentSeparator+"|"+encoded);varArray=string.split(regexp);for(i=0;i<varArray.length;i++){urlVars=varArray[i].split("=");if(true==encode){this.encVar(urlVars[0],urlVars[1])}else{this.setVar(urlVars[0],urlVars[1])}}};this.createURLString=function(urlstring){if(this.encodeURIString&&this.URLString.length){this.processURLString(this.URLString,true)}if(urlstring){if(this.URLString.length){this.URLString+=this.argumentSeparator+urlstring}else{this.URLString=urlstring}}this.setVar("rndval",new Date().getTime());urlstringtemp=new Array();for(key in this.vars){if(false==this.vars[key][1]&&true==this.encodeURIString){encoded=this.encVar(key,this.vars[key][0],true);delete this.vars[key];this.vars[encoded[0]]=Array(encoded[1],true);key=encoded[0]}urlstringtemp[urlstringtemp.length]=key+"="+this.vars[key][0]}if(urlstring){this.URLString+=this.argumentSeparator+urlstringtemp.join(this.argumentSeparator)}else{this.URLString+=urlstringtemp.join(this.argumentSeparator)}};this.runResponse=function(){eval(this.response)};this.runAJAX=function(urlstring){if(this.failed){this.onFail()}else{this.createURLString(urlstring);if(this.element){this.elementObj=document.getElementById(this.element)}if(this.xmlhttp){var self=this;if(this.method=="GET"){totalurlstring=this.requestFile+this.queryStringSeparator+this.URLString;this.xmlhttp.open(this.method,totalurlstring,true)}else{this.xmlhttp.open(this.method,this.requestFile,true);try{this.xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded")}catch(e){}}this.xmlhttp.onreadystatechange=function(){switch(self.xmlhttp.readyState){case 1:self.onLoading();break;case 2:self.onLoaded();break;case 3:self.onInteractive();break;case 4:self.response=self.xmlhttp.responseText;self.responseXML=self.xmlhttp.responseXML;self.responseStatus[0]=self.xmlhttp.status;self.responseStatus[1]=self.xmlhttp.statusText;if(self.execute){self.runResponse()}if(self.elementObj){elemNodeName=self.elementObj.nodeName;elemNodeName.toLowerCase();if(elemNodeName=="input"||elemNodeName=="select"||elemNodeName=="option"||elemNodeName=="textarea"){self.elementObj.value=self.response}else{self.elementObj.innerHTML=self.response}}if(self.responseStatus[0]=="200"){self.onCompletion()}else{self.onError()}self.URLString="";break}};this.xmlhttp.send(this.URLString)}}};this.reset();this.createAJAX()};