function hideWindow(a){nodeWindow=document.getElementById(a);nodeWindow=document.getElementById("BasketNote");nodeWindow.style.display="none"}function showWindow(a,b,c,d){nodeWindow=document.getElementById(a);if(objWindowTime[a]){clearTimeout(objWindowTime[a])}b.parentNode.appendChild(nodeWindow);nodeWindow.style.display="block";nodeWindow.replaceChild(document.createTextNode(c),nodeWindow.firstChild);objWindowTime[a]=setTimeout('hideWindow( "'+a+'" )',d)}function changeBasketCount(a){intValue=parseInt(a.responseText);objBasketCount=document.getElementById("BasketCount");objBasketContener=document.getElementById("BasketContener");if(intValue>0){objBasketContener.className="menu-koszyk";objBasketCount.replaceChild(document.createTextNode(intValue),objBasketCount.firstChild)}else{objBasketContener.className="menu-koszyk-brak";objBasketCount.replaceChild(document.createTextNode("brak"),objBasketCount.firstChild)}}function addToBasket(a,b){if(b.checked){strOperation="add";showWindow("BasketNote",b,"Dodano do schowka",800)}else{strOperation="delete";showWindow("BasketNote",b,"Usunięto ze schowka",800)}advAJAX.get({url:"http://"+location.hostname+"/basket.php",parameters:{offer:a,oper:strOperation},onSuccess:function(a){return false},onError:function(a){if(console!=undefined){console.info("Error: "+a.status)}else{return false}}})}function TabNavigation_old(a,b,c,d,e){this.sNavId=a;this.sActiveClassName=b;this.sDisplayNoneClassName=c;this.bAllowAdressNav=d||false;this.aTargets=e||new Array;this.sDefaultTarget=new String}function SelectNavigation(a){this.navId=a;this.targets=new Array;this.defaultActive=new String}function setSize(){var a=document.getElementById("sidebar1");var b=document.getElementById("sidebar2");var c=document.getElementById("main");var d=document.getElementById("content");var e=document.getElementById("subheader");if(c&&b){var f=Math.max(a.offsetHeight,b.offsetHeight);var g=Math.max(f,c.offsetHeight);document.getElementById("sidebar1").style.height=g+"px";document.getElementById("sidebar2").style.height=g+"px";document.getElementById("main").style.height=g+"px"}if(d&&e){var h=d.offsetHeight+e.offsetHeight+4;var g=Math.max(a.offsetHeight,h);document.getElementById("sidebar1").style.height=g+10+"px";document.getElementById("content").style.height=g-e.offsetHeight-4+"px"}else{return false}}function activateDetailView(){var a=document.getElementsByTagName("A");for(var b=0;b<a.length;b++){if(a[b].className.indexOf("detail")==-1)continue;a[b].onclick=function(){var a=findParentElement(this,"TR");if(a){a=a.nextSibling;while(a.nodeType!=1)a=a.nextSibling;if(!a)return true;var b=a.cells[0];if(b.style.display!="none"&&b.style.display!=""){b.style.display="none";if(ie)a.style.display="none"}else{if(ie){b.style.display="block";a.style.display=""}else{b.style.display="table-cell"}}}return false}}}function findParentElement(a,b){var c=null;b=b.toUpperCase();while(a&&a.tagName!=b){a=a.parentNode}if(a&&a.tagName==b)c=a;return c}function setTabSheet2(a){var b=document.getElementById("info-panel");var c=b.getElementsByTagName("DIV");pages=new Array;for(i=0;i<c.length;i++){pages[i]=document.getElementById("page"+i)}for(j=0;j<pages.length;j++){if(pages[j]!=null){if(pages[j].className.indexOf("front")!=-1){pages[j].className=pages[j].className.replace("front","back")}}}pages[a].className=pages[a].className.replace("back","front")}function setTabSheet(a){var b=document.getElementsByTagName("UL");for(i=0;i<b.length;i++){if(b[i].className!="tabs")continue;var c=b[i].getElementsByTagName("LI");for(j=0;j<c.length;j++){if(c[j].className.indexOf("front")!=-1){c[j].className=c[j].className.replace("front","back");var d=document.getElementById("page"+j);if(d){d.className=d.className.replace("front","back")}c[a].className=c[a].className.replace("back","front");var e=document.getElementById("page"+a);if(e){e.className=e.className.replace("back","front")}}}}}function activateTabSheet(){var a=document.getElementById("tabs2");if(!a){return}var b=a.getElementsByTagName("LI");for(j=0;j<b.length;j++)b[j].onclick=changeTabSheet}function googlemapsiframe(a){var b=a.getElementsByTagName("iframe")[0];if(b&&b.nowyiframe){return}else if(b){var c=document.createElement("iframe");c.src=b.src;if(parseInt(b.width)>570){c.width=570}else{c.width=b.width}c.height=b.height;c.nowyiframe=1;b.parentNode.replaceChild(c,b)}}function changeTabSheet(){if(!this||this.className=="front")return false;var a=this.parentNode;var b=a.getElementsByTagName("LI");for(var c=0;c<b.length;c++){if(b[c].id=="googlemaptrigg"){googlemapsiframe(document.getElementById("page"+c))}b[c].className=b[c]==this?b[c].className.replace("back","front"):b[c].className.replace("front","back");var d=document.getElementById("page"+c);if(d){d.className=b[c]==this?d.className.replace("back","front"):d.className.replace("front","back")}}return false}var op=/opera/i.test(navigator.userAgent);var ie=!op&&/msie/i.test(navigator.userAgent);var mz=!op&&/mozilla\/5/i.test(navigator.userAgent);SelectNavigation.prototype.init=function(){var a=document.getElementById(this.navId);if(!a)return;var b=this;var c=a.getElementsByTagName("option");var d=new Array;this.defaultActive=c[0].value.substring(1);for(var e=0;e<c.length;e++){if(c[e].value){this.targets.push(c[e].value);a.onchange=function(a){b._run(this.value)}}}};SelectNavigation.prototype._run=function(a){for(var b=0;b<this.targets.length;b++){if(a==this.targets[b]){if(document.getElementById(this.targets[b]))document.getElementById(this.targets[b]).style.display="block";else document.getElementById(this.defaultActive).style.display="block"}else{if(document.getElementById(this.targets[b]))document.getElementById(this.targets[b]).style.display="none"}}};TabNavigation_old.prototype.init=function(){var a=document.getElementById(this.sNavId);if(!a)return;var b=a.getElementsByTagName("a");var c=this;var d=this.aTargets.length;var e=new Array;for(var f=0;f<b.length;f++){if(b[f].hash&&b[f].hash!="#"){if(this.sActiveClassName&&this._isClass(b[f],this.sActiveClassName)==true)this.sDefaultTarget=b[f].hash.substring(1);if(d==0)this.aTargets.push(b[f].hash.substring(1));if(window.location.hash&&window.location.hash==b[f].hash)var g=window.location.hash.substring(1);b[f].onclick=function(a){c._run(this.hash.substring(1),b,true,a)};e.push(b[f].hash.substring(1))}}if(this.sDefaultTarget=="")this.sDefaultTarget=e[0];if(g&&this.bAllowAdressNav==true)this._run(g);else if(this.sDefaultTarget!="")this._run(this.sDefaultTarget,b)};TabNavigation_old.prototype._run=function(a,b,c,d){if(c){if(!d)d=window.event;if(d.preventDefault)d.preventDefault();else d.returnValue=false}for(var e=0;e<b.length;e++){if(b[e].hash=="#"+a){this._addClass(b[e],this.sActiveClassName)}else{this._removeClass(b[e],this.sActiveClassName)}}for(var e=0;e<this.aTargets.length;e++){if(a==this.aTargets[e]){if(document.getElementById(this.aTargets[e]))this._show(document.getElementById(this.aTargets[e]),this.sDisplayNoneClassName);else if(this.sDefaultTarget)this._show(document.getElementById(this.sDefaultTarget),this.sDisplayNoneClassName)}else{if(document.getElementById(this.aTargets[e]))this._hide(document.getElementById(this.aTargets[e]),this.sDisplayNoneClassName)}}if(this.bAllowAdressNav==true)window.location.replace("#"+a)};TabNavigation_old.prototype._show=function(a,b){if(!b){a.style.display="block"}else{this._removeClass(a,b)}};TabNavigation_old.prototype._hide=function(a,b){if(!b){a.style.display="none"}else{this._addClass(a,b)}};TabNavigation_old.prototype._addClass=function(a,b){if(!a.className.match(new RegExp(""+b+"","i")))a.className+=(a.className?" ":"")+b};TabNavigation_old.prototype._isClass=function(a,b){if(a.className.match(new RegExp(""+b+"","i")))return true;else return false};TabNavigation_old.prototype._removeClass=function(a,b){a.className=a.className.replace(new RegExp(" \\b"+b+"\\b|\\b"+b+"\\b ?","gi"),"")};objWindowTime=new Array;var initialize=new Object;initialize.init=function(){var a="place-select";if(document.getElementById(a)!="undefined"){var b=new SelectNavigation(a);b.init()}var c="tripTips";if(document.getElementById(c)!="undefined"){var d=new TabNavigation_old(c,"active","back");d.init()}};window.onload=function(){activateTabSheet();activateDetailView();makeHover.init();initialize.init()}
