var timer1=null;function less_div(){var a=$("more_div_content");a.close();$("more_div_content_tb").removeChild($("more_div_content_bottom"))}function more_div(c){$("more_div_content").style.display="block";var j=navigator.appName;var i=navigator.userAgent;var g;var h=document.createElement("div");try{$("more_div_content_tb").appendChild(h);h.setAttribute("id","more_div_content_bottom");h.setAttribute("class","textBlackMedium");h.style.overflow="auto";h.style.paddingRight="10px"}catch(d){}if(j.indexOf("Netscape")!=-1){if(document.body.offsetWidth<800){var f=0}else{var f=(document.body.offsetWidth-700)/2-90}var b=(window.innerHeight-430)/2+document.body.scrollTop}else{if(j.indexOf("Explorer")!=-1&&i.indexOf("Opera")==-1){if(document.body.offsetWidth<800){var f=0}else{var f=(document.body.offsetWidth-700)/2-90}var b=(document.body.offsetHeight-430)/2+document.body.scrollTop}else{if(document.body.offsetWidth<800){var f=0}else{var f=(document.body.offsetWidth-700)/2-90}var b=(document.body.offsetHeight-430)/2+document.body.scrollTop}}$("more_div_content").style.left=f;$("more_div_content").style.top=b;$("more_div_content").style.zIndex="200";if(c=="tab_details_full"||c=="tab_details"){g="Details"}if(c=="tab_gettingthere_full"||c=="tab_gettingthere"){g="Getting There"}if(c=="tab_history_full"||c=="tab_history"){g="History"}if(c=="tab_tours_full"||c=="tab_tours"){g="General Info"}if(c=="place_desc_more2"){g="Amenities";$("more_div_content_top").innerHTML="";$("more_div_content_bottom_picture").innerHTML="";$("more_div_content_bottom").innerHTML="";$("more_div_content_top").innerHTML=$("featured_title").innerHTML;$("more_div_content_top").className="headingBlueBig";$("more_div_content_bottom_picture").innerHTML=$("featured_picture").innerHTML;$("more_div_content_bottom").innerHTML=$(c).innerHTML}else{$("more_div_content_bottom").innerHTML="";$("more_div_content_top").innerHTML="";$("more_div_content_top").innerHTML=$("featured_title").innerHTML;$("more_div_content_top").className="headingBlueBig";$("more_div_content_bottom").innerHTML=$("featured_picture").innerHTML;$("more_div_content_bottom").innerHTML+=$(c).innerHTML}var a=$("more_div_content");new WAYN.Popup(a,true)}function ShowAddToTripSelection(){if(timer1!=null){window.clearTimeout(timer1)}var a;if(document.getElementById("AddToTripList").style.display=="none"){a="block";document.getElementById("AddToTripListLink").innerHTML="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Close&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"}else{if(document.getElementById("AddToTripList").style.display=="block"){a="none";document.getElementById("AddToTripListLink").innerHTML="Add to trip"}}document.getElementById("AddToTripList").style.display=a}function PlanATrip_onClick(b){var a="/wayntravels.html?wci=mytrips"+b;document.location.href=a}function AddDestinationToTrip(h,q,m,a){var r=document.getElementById("add_destination_date1").value;var p=document.getElementById("add_destination_date2").value;var n=document.getElementById("add_destination_date1Detail").value;var j=document.getElementById("add_destination_date2Detail").value;var f;var g;if(r==""){r=="not set";alert("Please set start date.");return}if(p==""){p=="not set";alert("Please set finish date.");return}try{try{oXMLHTTP=new XMLHttpRequest()}catch(l){var o=new Array("MSXML2.XMLHTTP.5.0","MSXML2.XMLHTTP.4.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP");var s=false;for(var d=0;d<o.length&&!s;d++){try{oXMLHTTP=new ActiveXObject(o[d]);s=true}catch(l){}}if(!s){try{oXMLHTTP=new HTML_AJAX_IframeXHR()}catch(l){alert("Sorry. We are unable to load xml file. Please try again later.")}}}var b="/wayntrips.html?wci=AddTrip&wce=AddDestination";var k="type=xml&date_start="+r+"&date_end="+p+"&dat_start_detail="+n+"&dat_end_detail="+j+"&dest_name="+unicodeEscape(q)+"&dest_key="+m+"&trip_key="+h+"&destination_id="+a;oXMLHTTP.open("POST",b,true);oXMLHTTP.setRequestHeader("Content-Type","application/x-www-form-urlencoded");oXMLHTTP.onreadystatechange=function(){if(oXMLHTTP.readyState==4){var i=oXMLHTTP.responseXML.getElementsByTagName("addLocation").item(0);var e=i.getElementsByTagName("errCode").item(0).firstChild.data;if(e==0){document.location.href="/wayntrips.html?wci=view&trip_key="+h}else{alert(errMsg)}}};closeNewDestBox();oXMLHTTP.send(k)}catch(c){alert("Sorry, server is not available at this time to process your request.")}}function closeNewDestBox(){try{document.getElementById("newDestBox").style.display="none";document.getElementById("showbox_a").style.display="block"}catch(a){}}var flag_addtotripbox;function UpdateAddToTripBox(){var a="AddToTripList";var d="add_to_trip_box";var s="";var q="";var t="";var j="";if(flag_addtotripbox!=1){try{if((j==null)||(j<=0)||(j=="")){timernames["timername_"+a]=d}}catch(r){alert(r.message)}if(timernames["timername_"+a]!=d){return}if((j==null)||(j<0)||(j=="")){j=0}j++;if(j>10){return}var f=null;try{var p="";if((q!=null)&&(q!="undefined")){p=q}var g="/wayntravels.html?wci=destination&wce=getbox&box=";var u=document.getElementById(a);if((u!=null)&&(d!=null)){var k="<center><b>please wait whilst loading data ...</b><center>";var m=u.offsetHeight;u.style.height=m;u.innerHTML=k;var o=$("country_code").value;var h=$("city_key").value;var l=$("town_key").value;var n=$("country_name").value;var b=$("city_full_name").value;var c=$("town_name").value;p+="&country_code="+o+"&city_key="+h+"&town_key="+l;p+="&town_name="+c+"&city_name="+b+"&country_name="+n;f=new Ajax.Request(g+d+p,{method:"GET",onSuccess:function(z){if(timernames["timername_"+a]!=d){return}responseXml=z.responseXML;for(var B=responseXml.firstChild;B!=null;B=B.nextSibling){for(var A=B.firstChild;A!=null;A=A.nextSibling){if(A.nodeValue!=null&&A.nodeValue!=""){if(a){u.style.height="";u.innerHTML=A.nodeValue}}}}if(d=="add_to_trip_box"){try{var E=document.createElement("div");E.setAttribute("id","add_destination_date1Container");var y=document.createElement("script");var w='new DatetimeToolbocks({inputValue:"", elementId:"add_destination_date1", inputName:"add_destination_date1",elementNextId:"add_destination_date2", nextCond: "plus",inputDetailValue:"",startDate:"true",calendarOptions: {}})';y.text=w;var x=$("start_date_dateContainer");x.appendChild(E);x.appendChild(y);var D=document.createElement("div");D.setAttribute("id","add_destination_date2Container");var F=document.createElement("script");var G='new DatetimeToolbocks({inputValue:"", elementId:"add_destination_date2", 	inputName:"add_destination_date2",elementNextId:"add_destination_date1", nextCond: "minus", inputDetailValue:"",startDate:"false",calendarOptions: {}})';F.text=G;var v=$("end_date_dateContainer");v.appendChild(D);v.appendChild(F)}catch(C){console.debug(C)}}ShowAddToTripSelection()},onFailure:function(e){$(a).innerHTML="<center><b>Sorry we're unable to load data at the moment. We will try again in few seconds.</b></center>";if(timernames["timername_"+a]==d){setTimeout("updateBox('"+d+"','"+a+"', '', '"+q+"', '"+t+"',"+j+");",3000*j)}return},onException:function(e){$(a).innerHTML="<center><b>Sorry we're unable to load data at the moment. We will try again in few seconds.</b></center>";if(timernames["timername_"+a]==d){setTimeout("updateBox('"+d+"','"+a+"', '', '"+q+"', '"+t+"',"+j+");",3000*j)}return}});flag_addtotripbox=1}else{}}catch(i){}}else{ShowAddToTripSelection()}}function SubmitForm(d){if(d=="search_advanced"){if(($("gender_male").checked==false)&&($("gender_female").checked==false)){alert("Please select gender.");return}}if($("gender_male").checked==true&&$("gender_female").checked==false){$("member_sex").value="male"}if($("gender_female").checked==true&&$("gender_male").checked==false){$("member_sex").value="female"}if($("gender_female").checked==true&&$("gender_male").checked==true){$("member_sex").value=""}$("preloader").style.display="block";if(d=="search_simply"&&$("add_location_key").value=="0"){$("preloader").style.display="none";return false}$("submittype").value=d;var g=document.forms.searchform.elements;var f="";var a="";for(var c=0;c<g.length;c++){if(g[c].name.match(/lt\;/)==null){if(g[c].type!="checkbox"){f=f+g[c].name+"="+g[c].value+"&"}else{if(g[c].checked==true){f=f+g[c].name+"=on&"}}}}try{var b="wayntrips.html?wci=search&wce=enter";xmlRequest=new Ajax.Request(b,{method:"POST",postBody:f,onSuccess:function(h){for(var l=h.responseXML.firstChild;l!=null;l=l.nextSibling){for(var k=l.firstChild;k!=null;k=k.nextSibling){if(k.nodeValue!=null&&k.nodeValue!=""){a=a+k.nodeValue}}}if(a.split(/:/)[0]=="ok"){var n=a.split(/:/)[1];try{xmlRequest2=new Ajax.Request(n,{method:"GET",onSuccess:function(i){htmlresponse=i.responseText;window.document.body.innerHTML=htmlresponse;DisplaySearchRes(null,d,$("rescount").value,n)},onFailure:function(i){alert("Sorry we're unable to update content. Please try again later (2-"+xmlRequest.status+").");return}})}catch(m){alert("smartxml:"+m)}}else{$("preloader").style.display="none"}},onFailure:function(h){}})}catch(e){}return false}function DisplaySearchRes(j,d,a,b){if(document.getElementById("baseurl").value!=""){b=document.getElementById("baseurl").value}var e=b.split(/\?/)[1];var h=e.split(/\&/);b="wayntrips.html?";if(!(d)){d=document.getElementById("submittype").value;a=document.getElementById("rescount").value}for(var f=0;f<h.length;f++){if((f==1)&&(h[f].split(/=/)[0]!="wce")&&(h[f].split(/=/)[1]!="showresults")){b=b+"wce=showresults&"+h[f].split(/=/)[0]+"="+h[f].split(/=/)[1]+"&"}else{if((j)&&(h[f].split(/=/)[0]=="page")){b=b+"page="+j+"&"}else{b=b+h[f].split(/=/)[0]+"="+h[f].split(/=/)[1]+"&"}}}try{var g=b+"list=true&pages="+a+"&submittype="+d+"&tripkeys="+document.getElementById("tripkeys").value;xmlRequest=new Ajax.Request(g,{method:"GET",onSuccess:function(k){responseXml=k.responseXML;for(var m=responseXml.firstChild;m!=null;m=m.nextSibling){for(var l=m.firstChild;l!=null;l=l.nextSibling){if(l.nodeValue!=null&&l.nodeValue!=""){document.getElementById("search_container").innerHTML=l.nodeValue}}}if(document.getElementById("noresults")){document.getElementById("search_container").innerHTML=document.getElementById("noresults").innerHTML;document.getElementById("noresults").innerHTML=""}document.getElementById("preloader").style.display="none"},onFailure:function(i){alert("Sorry we're unable to update content. Please try again later (2-"+xmlRequest.status+").");return}})}catch(c){alert("smartxml:"+c)}document.getElementById("submittype").value=d;document.getElementById("rescount").value=a;if(document.getElementById("baseurl").value==""){document.getElementById("baseurl").value=b}}function SetPredictorAndFullContent(b,a,c){if(a.length>390){$(b).innerHTML=a.substring(0,390);$(b).innerHTML=$(b).innerHTML+$(b+"_link_more").innerHTML;$(b+"_full").innerHTML=a}else{$(b).innerHTML=a}c.innerHTML=$(b).innerHTML}function GetTabContent(b,g){var d=$("tab_content");if($(b).innerHTML==""){var a=$("directory_key").value;var f=$("town_key").value;var c=$("country_code").value;var h=$("town_name").value;var e=$("city_key").value;new Ajax.Request("/wayntravels.html?wci=destination&wce=GetTabContent&tab_name="+b+"&town_key="+f+"&directory_key="+a+"&country_code="+c+"&city_key="+e+"&town_name="+h,{method:"get",onSuccess:function(j){var i=j.responseText;switch(b){case"tab_keyfacts":$(b).innerHTML=i;d.innerHTML=$(b).innerHTML;break;case"tab_details_full":$(b).innerHTML=i;more_div(b);break;case"tab_tours":SetPredictorAndFullContent(b,i,d);break;case"tab_history":SetPredictorAndFullContent(b,i,d);break;case"tab_gettingthere":SetPredictorAndFullContent(b,i,d);break;default:$(b).innerHTML=i;d.innerHTML=$(b).innerHTML;break}},onFailure:function(){alert("Something went wrong...")}})}else{switch(b){case"tab_history_full":more_div(b);break;case"tab_tours_full":more_div(b);break;case"tab_details_full":more_div(b);break;case"tab_gettingthere_full":more_div(b);break;case"tab_details":d.innerHTML=$(b).innerHTML;$("tab_details").style.display="none";break;default:d.innerHTML=$(b).innerHTML;break}}}function authorbar_Change(b,a){if(a=="stories"){a="ne_stories"}switch(b){case"friends":updateBox(a,"DestinationContent","friends","","","");break;case"my":updateBox(a,"DestinationContent","my","","","");break;default:updateBox(a,"DestinationContent","allmembers","","","");break}reload_combo()}function reload_combo(){menuObjectLightCombo.clear();window.setTimeout("WAYN.menu.autoinit()",1000)};
