var pathVar="";var winIE6=($j.browser.version.substr(0,3)=="6.0"&&$j.browser.msie)?true:false;if(winIE6){$j("div").filter(".tripplanner").find("select").css("visibility","hidden")}var filterType={distance:["close","mid","far"],location:["city","nature","beach"],experience:["relax","culture","adventure"]};var filterBreakUp=20;var arrDistance=new Array();var arrLocation=new Array();var arrExperience=new Array();var map=null;var geocoder=null;var address=null;function loadGoogleMap(){hideShortList();hideFrame();showFrame("map");address=$j(this).attr("title");geocoder=new google.maps.Geocoder();var a={zoom:8,mapTypeId:google.maps.MapTypeId.ROADMAP};map=new google.maps.Map($j("div").filter(".tp_popup").children().filter(".content")[0],a);showAddress(address)}function showAddress(a){if(geocoder){geocoder.geocode({address:a},function(d,c){if((c==google.maps.GeocoderStatus.OK)&&(c!=google.maps.GeocoderStatus.ZERO_RESULTS)){map.setCenter(d[0].geometry.location);var b=new google.maps.Marker({map:map,position:d[0].geometry.location})}else{alert("Error returning results")}})}}function initSliders(){$j("div").filter(".filter_distance").slider({stepping:filterBreakUp,min:0,max:100,change:function(b,a){arrDistance=new Array();switch(Math.ceil(a.value)){case 0:arrDistance.push(filterType.distance[0]);break;case 20:arrDistance.push(filterType.distance[0]);arrDistance.push(filterType.distance[1]);break;case 40:arrDistance.push(filterType.distance[1]);break;case 60:arrDistance.push(filterType.distance[1]);arrDistance.push(filterType.distance[2]);break;case 80:arrDistance.push(filterType.distance[2]);break;default:arrDistance.push(filterType.distance[0]);arrDistance.push(filterType.distance[1]);arrDistance.push(filterType.distance[2])}doFilter()}});$j("div").filter(".filter_location").slider({stepping:filterBreakUp,min:0,max:100,change:function(b,a){arrLocation=new Array();switch(Math.ceil(a.value)){case 0:arrLocation.push(filterType.location[0]);break;case 20:arrLocation.push(filterType.location[0]);arrLocation.push(filterType.location[1]);break;case 40:arrLocation.push(filterType.location[1]);break;case 60:arrLocation.push(filterType.location[1]);arrLocation.push(filterType.location[2]);break;case 80:arrLocation.push(filterType.location[2]);break;default:arrLocation.push(filterType.location[0]);arrLocation.push(filterType.location[1]);arrLocation.push(filterType.location[2])}doFilter()}});$j("div").filter(".filter_experience").slider({stepping:filterBreakUp,min:0,max:100,change:function(b,a){arrExperience=new Array();switch(Math.ceil(a.value)){case 0:arrExperience.push(filterType.experience[0]);break;case 20:arrExperience.push(filterType.experience[0]);arrExperience.push(filterType.experience[1]);break;case 40:arrExperience.push(filterType.experience[1]);break;case 60:arrExperience.push(filterType.experience[1]);arrExperience.push(filterType.experience[2]);break;case 80:arrExperience.push(filterType.experience[2]);break;default:arrExperience.push(filterType.experience[0]);arrExperience.push(filterType.experience[1]);arrExperience.push(filterType.experience[2])}doFilter()}})}function doFilter(){hidePop();$j("div").filter(".tp_list_item").each(function(a){$j(this).parent().attr("class","result");for(var b=-1;b<=arrDistance.length;b++){if($j(this).children("h4").attr("title").indexOf(arrDistance[b])>=0){$j(this).parent().addClass("ok_dist")}}for(var b=-1;b<arrLocation.length;b++){if($j(this).children("h4").attr("title").indexOf(arrLocation[b])>=0){$j(this).parent().addClass("ok_loc")}}for(var b=-1;b<arrExperience.length;b++){if($j(this).children("h4").attr("title").indexOf(arrExperience[b])>=0){$j(this).parent().addClass("ok_exp")}}if($j(this).parent().attr("class").indexOf("ok_exp")>=0&&$j(this).parent().attr("class").indexOf("ok_loc")>=0&&$j(this).parent().attr("class").indexOf("ok_dist")>=0){$j(this).parent().addClass("showResult");$j(this).parent().show();$j(this).parent().removeClass("hidden")}else{$j(this).parent().addClass("hidden");$j(this).parent().hide();$j(this).parent().removeClass("showResult")}});$j("div").filter(".tp_subheader").children("h3").html($j("div").filter(".showResult").length+" "+cityOrCity($j("div").filter(".showResult").length));$j("div").filter(".tp_keywords").children("p").html(keywords(arrDistance+","+arrLocation+","+arrExperience))}function keywords(a){return a.replace(/,/g,", ")}function sortBy(a){switch(a){case"Alphabetical":$j("div.result").tsort(".dynTitle");break;case"Flight Price":$j("div.result").tsort(".flightPrice");break;case"Popular":$j("div.result").tsort(".popular");break;default:$j("div.result").tsort(".popular")}}function popShow(a){$j("div").filter(a).bind("mouseover",function(){$j("body").unbind("click")});$j("div").filter(a).bind("mouseenter",function(){$j("body").unbind("click")});$j("div").filter(a).bind("mouseleave",function(){$j("body").bind("click",hidePop)});setTimeout("hideTimer()",1)}function hidePop(){hidePopup();hideShortList();hideFrame()}function hideTimer(){$j("body").bind("click",hidePop)}function popHide(a){$j("div").filter(a).unbind("mouseenter mouseleave");$j("body").unbind("click")}function showPopup(a){hidePop();var b;if(a.length!=3){b=$j(this).parent();$j("div").filter(".tp_image").css("position","static");b.children(".tp_list_item").addClass("tp_list_item_pop");b.children(".tp_list_item").prepend('<a href="javascript:void(0);" class="close">Close</a>');$j("a").filter(".close").bind("click",hidePopup);b.children(".tp_list_item_pop").css("top",getObjPosition);b.children(".tp_list_item_pop").show()}else{b=$j("div").filter(".tp_list_item").children("h4").filter("."+a).parent();$j(b).addClass("tp_list_item_pop").prepend('<a href="javascript:void(0);" class="close">Close</a>');$j("a").filter(".close").bind("click",hidePopup);$j(b).css("top",getObjPosition).show()}popShow(".tp_list_item_pop",hidePopup)}function showShortList(){hidePop();$j("div.main").addClass("slView");var a=$j("div").filter(".tp_shortlist");$j(a).prepend('<a href="javascript:void(0);" class="close">Close</a>');$j(a).children("table").children("tbody").html(drawShortList());$j(a).show();$j("a").filter(".close").bind("click",hideShortList);$j("a").filter(".remove").bind("click",removeShortListItem);toggleShortList();popShow(".tp_shortlist",hideShortList)}function showFrame(a){var b=$j("div").filter(".tp_popup");$j(b).css("top",getObjPosition).show().html(buildFrame(a));$j("a").filter(".close").bind("click",hideFrame);popShow(".tp_popup",hideFrame)}function getObjPosition(){var a=400;if($j(window).scrollTop()>250){a=$j(window).scrollTop()+150}return a}function hidePopup(){$j("div").filter(".tp_list_item_pop").hide();$j("div").filter(".tp_list_item_pop").removeClass("tp_list_item_pop");$j("a").filter(".close").unbind("click",hidePopup);$j("a").filter(".close").remove();popHide(".tp_list_item_pop")}function hideShortList(){$j("div#main").removeClass("slView");$j("div").filter(".tp_shortlist").hide();if(!($j("div").filter(".tp_list_item_pop").length>0)){$j("a").filter(".close").unbind("click",hidePopup);$j("a").filter(".remove").unbind("click");$j("a").filter(".close").remove()}popHide(".tp_shortlist")}function hideFrame(a){$j("div").filter(".tp_popup").hide();$j("#flashPopContent").html("");popHide(".tp_popup")}function buildFrame(b){var a="";a+="<div class='header'>";a+='<a href="javascript:void(0);" class="close">Close</a>';switch(b){case"map":a+="Map";break;case"climate":a+="Climate";break;default:return false}a+="</div>";a+="<div class='content'>";if(b=="climate"&&hasRightVersion){a+="<div id='flashPopContent'></div>"}else{a+='<p>You need Adobe Flash Player 8 or higher to view weather guide.</p><p>You can download the latest version of Flash Player from <a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" target="_blank" title="Get Adobe Flash Player">Adobe</a>.</p>'}a+="</div>";return a}function loadClimate(){hideShortList();hideFrame();showFrame("climate");altContext='<div class="flashAlt"><p>You need Adobe Flash Player 8 or higher to view video.</p><p>You can download the latest version of Flash Player from <a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" target="_blank" title="Get Adobe Flash Player">Adobe</a>.</p></div>';$j($j("div").filter(".tp_popup").children().filter(".content")[0]).html(writeSimpleFlash($j(this).attr("title"),442,348,"","","flashPopContent","window"))}function toggleTabs(){hidePop();$j("div").filter(".tp_list_item").hide();$j("a").filter(".tp_image_item").hide();$j("div").filter(".tp_tabs").children("a").children("img").each(function(a){$j(this).attr("src",$j(this).attr("src").replace("_on.gif","_off.gif"))});$j(this).children("img").attr("src",$j(this).children("img").attr("src").replace("_off.gif","_on.gif"));$j("div").filter(".tp_subcontent").children("div").attr("class","clearit tp_"+$j(this).attr("title"));$j(".tp_"+$j(this).attr("title")+"_item").show()}function toggleShortList(){if($j("div").filter(".tp_shortlist").children("table").children("tbody").children().length>0){$j("div").filter(".tp_shortlist").children("table").show();$j("div").filter(".tp_shortlist").children("p").filter(".noSavedCities").hide()}else{$j("div").filter(".tp_shortlist").children("table").hide();$j("div").filter(".tp_shortlist").children("p").filter(".noSavedCities").show()}}function toggleSaveToShortList(){hideFrame();$j("span").filter(".dynShortListNo").text($j("label").filter(".save").children("input:checked").length+" "+cityOrCity($j("label").filter(".save").children("input:checked").length))}function removeShortListItem(){$j("#save_"+$j(this).attr("title")).attr("checked",false);$j(this).parent().parent().remove();toggleShortList();toggleSaveToShortList()}function cityOrCity(a){return(a==1)?"city":"cities"}function getNewData(){hidePop();if($j(this).val()!=""&&$j(this).val()!=null&&$j(this).val()!="undefined"){document.getElementById("departureAirportCode").value=$j("#depCity").children("option:selected").val();document.getElementById("travelDate").value=($j("#monthOfTravel").children("option:selected").val().length>1?$j("#monthOfTravel").children("option:selected").val():$j($j("#monthOfTravel").children("option")[2]).val());document.tripForm.submit()}}function pageInit(){if(json.departureAirports){detectFlash();$j("label").filter(".selDepCity").children("select").html(renderDepAirports());$j("label").filter(".selDepCity").children("select").change(getNewData);$j("label").filter(".selMonthOfTravel").children("select").html(renderMonthOfTravel());$j("label").filter(".selMonthOfTravel").children("select").change(getNewData);$j(filterType.distance).each(function(a,b){arrDistance.push(b)});$j(filterType.location).each(function(a,b){arrLocation.push(b)});$j(filterType.experience).each(function(a,b){arrExperience.push(b)});initSliders();$j("div").filter(".tp_noresults").after(renderDestinations());$j("div").filter(".tp_loaderBG").height($j("div").filter(".tripplanner").height()+10);sortBy($j("label").filter(".tp_sortby").children("select").children("option:selected").text());$j("label").filter(".tp_sortby").children("select").change(function(){hidePop();sortBy($j("label").filter(".tp_sortby").children("select").children("option:selected").text())});$j("div").filter(".view_shortlist").children("a").click(showShortList);$j("label").filter(".save").children("input").click(toggleSaveToShortList);toggleSaveToShortList();$j("div").filter(".tp_tabs").children("a").click(toggleTabs);$j("li").filter(".view_map").children("a").click(loadGoogleMap);$j("li").filter(".view_weather").children("a").click(loadClimate);$j("a").filter(".tp_image_item").click(showPopup);$j("div").filter(".tp_list_item").hide();doFilter();$j("label").filter(".tp_sortby").children("select").show();$j("label").filter(".selDepCity").children("select").show();$j("label").filter(".selMonthOfTravel").children("select").show();$j("div").filter(".tp_loader").fadeOut("normal",function(){$j("div").filter(".tp_loaderBG").fadeOut("normal",function(){if(winIE6){$j("div").filter(".tripplanner").find("select").css("visibility","visible")}})});$j("div#tp_disclaimer").html(displayDisclaimer(json.selectedDepartureAirportCode));$j("div").filter(".tripplanner").before('<p class="printOnly"><b>Printing Shortlist Instructions:</b> Please save destinations you wish to print to shortlist then click on "View Shortlist" before printing</p>')}else{$j("div").filter(".tp_loader").fadeOut("normal",function(){$j("div").filter(".tp_loader").html("There was an error").fadeIn()})}}function displayDisclaimer(a){if(a=="JNB"){return"<p style='margin-top: 0pt;'>*Flight prices are in South African Rand and exclude charges and taxes.<br/>^ Hotels prices are per room per night in Australian dollars, except New Zealand cities where prices are in New Zealand dollars. Prices are based on payment by Debit Mastercard. For credit card payments, a fee of A$4.95 applies to all hotel bookings, excluding New Zealand hotels where a fee of NZ$5.75 applies. For international hotels (excluding New Zealand), a maximum of one room per booking applies.</p>"}if(a=="EZE"){return"<p style='margin-top: 0pt;'>* Flight prices are based on round trip purchase and include fuel surcharges of approximately US$300 plus 5% of the published fare (for Argentina's tourism tax) and approximately US$176 of airport taxes and charges. These amounts may vary depending on the rate exchange.<br/>^ Hotels prices are per room per night in Australian dollars, except New Zealand cities where prices are in New Zealand dollars. Prices are based on payment by Debit Mastercard. For credit card payments, a fee of A$4.95 applies to all hotel bookings, excluding New Zealand hotels where a fee of NZ$5.75 applies. For international hotels (excluding New Zealand), a maximum of one room per booking applies.</p>"}if((a=="BOS")||(a=="ORD")||(a=="DFW")||(a=="DEN")||(a=="HNL")||(a=="LAS")||(a=="LAX")||(a=="MIA")||(a=="JFK")||(a=="EWR")||(a=="MCO")||(a=="PDX")||(a=="SAN")||(a=="SFO")||(a=="SEA")||(a=="STL")||(a=="IAD")){return"<p style='margin-top: 0pt;'>* Flight prices are round trip in US dollars and include fuel surcharges of US$160 from the US. US and foreign taxes, fees, including September 11th Security Fee, are an additional US$150 to US$200 depending upon itinerary.<br/>^ Hotels prices are per room per night in Australian dollars, except New Zealand cities where prices are in New Zealand dollars. Prices are based on payment by Debit Mastercard. For credit card payments, a fee of A$4.95 applies to all hotel bookings, excluding New Zealand hotels where a fee of NZ$5.75 applies. For international hotels (excluding New Zealand), a maximum of one room per booking applies.</p>"}if((a=="CUN")||(a=="GDL")||(a=="MEX")||(a=="SJD")){return"<p style='margin-top: 0pt;'>* Flight prices are in US dollars and include fuel surcharges of US$160 from Mexico. US and foreign taxes, fees, including September 11th Security Fee, are an additional US$150 to US$200 depending upon itinerary.<br/>^ Hotels prices are per room per night in Australian dollars, except New Zealand cities where prices are in New Zealand dollars. Prices are based on payment by Debit Mastercard. For credit card payments, a fee of A$4.95 applies to all hotel bookings, excluding New Zealand hotels where a fee of NZ$5.75 applies. For international hotels (excluding New Zealand), a maximum of one room per booking applies.</p>"}if((a=="TXL")||(a=="CGN")||(a=="DUS")||(a=="HAM")||(a=="HAJ")||(a=="MUC")||(a=="NUE")||(a=="STR")||(a=="FRA")){return"<p style='margin-top: 0pt;'>* Flight prices are quoted in Euro and include charges and taxes. This may fluctuate due to changes in charges/taxes.<br/>^ Hotels prices are per room per night in Australian dollars, except New Zealand cities where prices are in New Zealand dollars. Prices are based on payment by Debit Mastercard. For credit card payments, a fee of A$4.95 applies to all hotel bookings, excluding New Zealand hotels where a fee of NZ$5.75 applies. For international hotels (excluding New Zealand), a maximum of one room per booking applies.</p>"}if((a=="ABZ")||(a=="EDI")||(a=="GLA")||(a=="LHR")||(a=="MAN")||(a=="NCL")){return"<p style='margin-top: 0pt;'>* Flight prices are quoted in British Pounds and include charges and taxes. This may fluctuate due to changes in charges/taxes.<br/>^ Hotels prices are per room per night in Australian dollars, except New Zealand cities where prices are in New Zealand dollars. Prices are based on payment by Debit Mastercard. For credit card payments, a fee of A$4.95 applies to all hotel bookings, excluding New Zealand hotels where a fee of NZ$5.75 applies. For international hotels (excluding New Zealand), a maximum of one room per booking applies.</p>"}if((a=="YYZ")||(a=="YVR")){return"<p style='margin-top: 0pt;'>* Flight prices listed are in Canadian dollars and include the fare without fuel and insurance charges. Fuel surcharges of approximately C$230 and government-imposed taxes and fees between C$70 and C$200 (depending on routing selected) are additional.<br/>^ Hotels prices are per room per night in Australian dollars, except New Zealand cities where prices are in New Zealand dollars. Prices are based on payment by Debit Mastercard. For credit card payments, a fee of A$4.95 applies to all hotel bookings, excluding New Zealand hotels where a fee of NZ$5.75 applies. For international hotels (excluding New Zealand), a maximum of one room per booking applies.</p>"}if((a=="SCL")){return"<p style='margin-top: 0pt;'>* Flight prices listed are in US dollars and include fuel surcharges of US$300 round trip and government-imposed taxes and fees between of approximately US$115 (depending on routing selected).<br/>^ Hotels prices are per room per night in Australian dollars, except New Zealand cities where prices are in New Zealand dollars. Prices are based on payment by Debit Mastercard. For credit card payments, a fee of A$4.95 applies to all hotel bookings, excluding New Zealand hotels where a fee of NZ$5.75 applies. For international hotels (excluding New Zealand), a maximum of one room per booking applies.</p>"}if((a=="BKK")){return"<p style='margin-top: 0pt;'>* Flight prices are quoted in Thai Baht and exclude charges and taxes.<br/>^ Hotels prices are per room per night in Australian dollars, except New Zealand cities where prices are in New Zealand dollars. Prices are based on payment by Debit Mastercard. For credit card payments, a fee of A$4.95 applies to all hotel bookings, excluding New Zealand hotels where a fee of NZ$5.75 applies. For international hotels (excluding New Zealand), a maximum of one room per booking applies.</p>"}if((a=="SGN")){return"<p style='margin-top: 0pt;'>* Flight prices are quoted in US Dollars and exclude charges and taxes.<br/>^ Hotels prices are per room per night in Australian dollars, except New Zealand cities where prices are in New Zealand dollars. Prices are based on payment by Debit Mastercard. For credit card payments, a fee of A$4.95 applies to all hotel bookings, excluding New Zealand hotels where a fee of NZ$5.75 applies. For international hotels (excluding New Zealand), a maximum of one room per booking applies.</p>"}if((a=="HKG")){return"<p style='margin-top: 0pt;'>* Flight prices are quoted in Hong Kong Dollars and exclude charges and taxes.<br/>^ Hotels prices are per room per night in Australian dollars, except New Zealand cities where prices are in New Zealand dollars. Prices are based on payment by Debit Mastercard. For credit card payments, a fee of A$4.95 applies to all hotel bookings, excluding New Zealand hotels where a fee of NZ$5.75 applies. For international hotels (excluding New Zealand), a maximum of one room per booking applies.</p>"}if((a=="CGK")){return"<p style='margin-top: 0pt;'>* Flight prices are quoted in US Dollars and exclude charges and taxes.<br/>^ Hotels prices are per room per night in Australian dollars, except New Zealand cities where prices are in New Zealand dollars. Prices are based on payment by Debit Mastercard. For credit card payments, a fee of A$4.95 applies to all hotel bookings, excluding New Zealand hotels where a fee of NZ$5.75 applies. For international hotels (excluding New Zealand), a maximum of one room per booking applies.</p>"}if((a=="MNL")){return"<p style='margin-top: 0pt;'>* Flight prices are quoted in US Dollars and exclude charges and taxes.<br/>^ Hotels prices are per room per night in Australian dollars, except New Zealand cities where prices are in New Zealand dollars. Prices are based on payment by Debit Mastercard. For credit card payments, a fee of A$4.95 applies to all hotel bookings, excluding New Zealand hotels where a fee of NZ$5.75 applies. For international hotels (excluding New Zealand), a maximum of one room per booking applies.</p>"}if((a=="ICN")){return"<p style='margin-top: 0pt;'>* Flight prices are quoted in Korean Won and exclude charges and taxes.<br/>^ Hotels prices are per room per night in Australian dollars, except New Zealand cities where prices are in New Zealand dollars. Prices are based on payment by Debit Mastercard. For credit card payments, a fee of A$4.95 applies to all hotel bookings, excluding New Zealand hotels where a fee of NZ$5.75 applies. For international hotels (excluding New Zealand), a maximum of one room per booking applies.</p>"}if((a=="SIN")){return"<p style='margin-top: 0pt;'>* Flight prices are quoted in Singapore Dollars and include charges and taxes.<br/>^ Hotels prices are per room per night in Australian dollars, except New Zealand cities where prices are in New Zealand dollars. Prices are based on payment by Debit Mastercard. For credit card payments, a fee of A$4.95 applies to all hotel bookings, excluding New Zealand hotels where a fee of NZ$5.75 applies. For international hotels (excluding New Zealand), a maximum of one room per booking applies.</p>"}if((a=="TPE")){return"<p style='margin-top: 0pt;'>* Flight prices are quoted in Taiwan Dollars and exclude charges and taxes.<br/>^ Hotels prices are per room per night in Australian dollars, except New Zealand cities where prices are in New Zealand dollars. Prices are based on payment by Debit Mastercard. For credit card payments, a fee of A$4.95 applies to all hotel bookings, excluding New Zealand hotels where a fee of NZ$5.75 applies. For international hotels (excluding New Zealand), a maximum of one room per booking applies.</p>"}if((a=="VIE")){return"<p style='margin-top: 0pt;'>* Flight prices are quoted in Euro and include charges and taxes. This may fluctuate due to changes in charges/taxes.<br/>^ Hotels prices are per room per night in Australian dollars, except New Zealand cities where prices are in New Zealand dollars. Prices are based on payment by Debit Mastercard. For credit card payments, a fee of A$4.95 applies to all hotel bookings, excluding New Zealand hotels where a fee of NZ$5.75 applies. For international hotels (excluding New Zealand), a maximum of one room per booking applies.</p>"}if((a=="AMS")){return"<p style='margin-top: 0pt;'>* Flight prices are quoted in Euro and include charges and taxes. This may fluctuate due to changes in charges/taxes.<br/>^ Hotels prices are per room per night in Australian dollars, except New Zealand cities where prices are in New Zealand dollars. Prices are based on payment by Debit Mastercard. For credit card payments, a fee of A$4.95 applies to all hotel bookings, excluding New Zealand hotels where a fee of NZ$5.75 applies. For international hotels (excluding New Zealand), a maximum of one room per booking applies.</p>"}if((a=="FCO")){return"<p style='margin-top: 0pt;'>* Flight prices are quoted in Euro and include charges and taxes. This may fluctuate due to changes in charges/taxes.<br/>^ Hotels prices are per room per night in Australian dollars, except New Zealand cities where prices are in New Zealand dollars. Prices are based on payment by Debit Mastercard. For credit card payments, a fee of A$4.95 applies to all hotel bookings, excluding New Zealand hotels where a fee of NZ$5.75 applies. For international hotels (excluding New Zealand), a maximum of one room per booking applies.</p>"}if((a=="NAN")){return"<p style='margin-top: 0pt;'>* Flight prices are in Fijian Dollars and exclude taxes and charges.<br/>^ Hotels prices are per room per night in Australian dollars, except New Zealand cities where prices are in New Zealand dollars. Prices are based on payment by Debit Mastercard. For credit card payments, a fee of A$4.95 applies to all hotel bookings, excluding New Zealand hotels where a fee of NZ$5.75 applies. For international hotels (excluding New Zealand), a maximum of one room per booking applies.</p>"}if((a=="NOU")){return"<p style='margin-top: 0pt;'>* Flight prices are in Pacific Francs and exclude taxes and charges.<br/>^ Hotels prices are per room per night in Australian dollars, except New Zealand cities where prices are in New Zealand dollars. Prices are based on payment by Debit Mastercard. For credit card payments, a fee of A$4.95 applies to all hotel bookings, excluding New Zealand hotels where a fee of NZ$5.75 applies. For international hotels (excluding New Zealand), a maximum of one room per booking applies.</p>"}if((a=="PPT")){return"<p style='margin-top: 0pt;'>* Flight prices are in Pacific Francs and exclude taxes and charges.<br/>^ Hotels prices are per room per night in Australian dollars, except New Zealand cities where prices are in New Zealand dollars. Prices are based on payment by Debit Mastercard. For credit card payments, a fee of A$4.95 applies to all hotel bookings, excluding New Zealand hotels where a fee of NZ$5.75 applies. For international hotels (excluding New Zealand), a maximum of one room per booking applies.</p>"}if((a=="VLI")){return"<p style='margin-top: 0pt;'>* Flight prices are in Vanuatu Vatu and exclude taxes and charges.<br/>^ Hotels prices are per room per night in Australian dollars, except New Zealand cities where prices are in New Zealand dollars. Prices are based on payment by Debit Mastercard. For credit card payments, a fee of A$4.95 applies to all hotel bookings, excluding New Zealand hotels where a fee of NZ$5.75 applies. For international hotels (excluding New Zealand), a maximum of one room per booking applies.</p>"}if((a=="PEK")||(a=="PVG")){return"<p style='margin-top: 0pt;'>* Flight prices are quoted in CNY Dollars and exclude charges and taxes.<br/>^ Hotels prices are per room per night in Australian dollars, except New Zealand cities where prices are in New Zealand dollars. Prices are based on payment by Debit Mastercard. For credit card payments, a fee of A$4.95 applies to all hotel bookings, excluding New Zealand hotels where a fee of NZ$5.75 applies. For international hotels (excluding New Zealand), a maximum of one room per booking applies.</p>"}if((a=="DEL")||(a=="BOM")){return"<p style='margin-top: 0pt;'>* Flight prices are quoted in Indian Rupees and include charges and taxes.<br/>^ Hotels prices are per room per night in Australian dollars, except New Zealand cities where prices are in New Zealand dollars. Prices are based on payment by Debit Mastercard. For credit card payments, a fee of A$4.95 applies to all hotel bookings, excluding New Zealand hotels where a fee of NZ$5.75 applies. For international hotels (excluding New Zealand), a maximum of one room per booking applies.</p>"}if((a=="NRT")||(a=="KIX")){return"<p style='margin-top: 0pt;'>* Flight prices are quoted in Japanese Yen and exclude charges and taxes.<br/>^ Hotels prices are per room per night in Australian dollars, except New Zealand cities where prices are in New Zealand dollars. Prices are based on payment by Debit Mastercard. For credit card payments, a fee of A$4.95 applies to all hotel bookings, excluding New Zealand hotels where a fee of NZ$5.75 applies. For international hotels (excluding New Zealand), a maximum of one room per booking applies.</p>"}if((a=="MAD")||(a=="BCN")){return"<p style='margin-top: 0pt;'>* Flight prices are quoted in Euro and include charges and taxes. This may fluctuate due to changes in charges/taxes.<br/>^ Hotels prices are per room per night in Australian dollars, except New Zealand cities where prices are in New Zealand dollars. Prices are based on payment by Debit Mastercard. For credit card payments, a fee of A$4.95 applies to all hotel bookings, excluding New Zealand hotels where a fee of NZ$5.75 applies. For international hotels (excluding New Zealand), a maximum of one room per booking applies.</p>"}if((a=="GVA")||(a=="ZRH")){return"<p style='margin-top: 0pt;'>* Flight prices are quoted in Swiss Francs and include charges and taxes. This may fluctuate due to changes in charges/taxes.<br/>^ Hotels prices are per room per night in Australian dollars, except New Zealand cities where prices are in New Zealand dollars. Prices are based on payment by Debit Mastercard. For credit card payments, a fee of A$4.95 applies to all hotel bookings, excluding New Zealand hotels where a fee of NZ$5.75 applies. For international hotels (excluding New Zealand), a maximum of one room per booking applies.</p>"}if((a=="LYS")||(a=="NCE")||(a=="CDG")){return"<p style='margin-top: 0pt;'>* Flight prices are quoted in Euro and include charges and taxes. This may fluctuate due to changes in charges/taxes.<br/>^ Hotels prices are per room per night in Australian dollars, except New Zealand cities where prices are in New Zealand dollars. Prices are based on payment by Debit Mastercard. For credit card payments, a fee of A$4.95 applies to all hotel bookings, excluding New Zealand hotels where a fee of NZ$5.75 applies. For international hotels (excluding New Zealand), a maximum of one room per booking applies.</p>"}if((a=="AKL")||(a=="CHC")||(a=="WLG")){return"<p style='margin-top: 0pt;'>* Flight prices are in New Zealand dollars and include ticket surcharges and taxes but may fluctuate due to changes in surcharges and taxes. Prices exclude New Zealand departure fee of NZ$25 payable at Wellington, Christchurch and Queenstown airports.<br/>^ Hotels prices are per room per night in Australian dollars, except New Zealand cities where prices are in New Zealand dollars. Prices are based on payment by Debit Mastercard. For credit card payments, a fee of A$4.95 applies to all hotel bookings, excluding New Zealand hotels where a fee of NZ$5.75 applies. For international hotels (excluding New Zealand), a maximum of one room per booking applies.</p>"}return"<p style='margin-top: 0pt;'>* Flight prices are in Australian dollars and include charges/taxes for the most direct route. Valid for payment at qantas.com by BPAY (when booking a flight a week or more from departure) or Debit MasterCard (when booking a flight within a week of departure). Credit and charge card payments attract a fee of A$7.70 per passenger per booking for destinations in Australia and New Zealand and A$25 per passenger per booking for other international destinations.<br/>^ Hotels prices are per room per night in Australian dollars, except New Zealand cities where prices are in New Zealand dollars. Prices are based on payment by Debit Mastercard. For credit card payments, a fee of A$4.95 applies to all hotel bookings, excluding New Zealand hotels where a fee of NZ$5.75 applies. For international hotels (excluding New Zealand), a maximum of one room per booking applies.</p>"}$j(document).ready(pageInit);function drawShortList(){var a="";$j("label").filter(".save").children("input:checked").each(function(b){var c=$j(this).attr("id").split("_")[1];var d=json.tripPlannerDestinationMap[c];a+="<tr>";a+="<th>"+d.destinationAirport.displayName+"</th>";if(d.flightPrice!=null){a+="<td>"+buildPrices((d.flightPrice.dealTypeCode=="G")?"international":"domestic",(d.flightPrice.currencySymbol!=null)?d.flightPrice.currencySymbol:null,(d.flightPrice.currencyCode)?d.flightPrice.currencyCode:null,d.flightPrice.totalPrice,(d.destinationCityHotelPrice!=null)?((d.destinationCityHotelPrice.countryCode!=null)?d.destinationCityHotelPrice.countryCode:null):null,(d.destinationCityHotelPrice!=null)?d.destinationCityHotelPrice.currencyValue:null,(d.destinationCityHotelPrice!=null)?d.destinationCityHotelPrice.priceValue:null,c,d.marketingRegionCode,(d.destinationCityHotelPrice!=null)?d.destinationCityHotelPrice.displayName:null)+"</td>"}else{a+="<td></td>"}a+="<td>"+d.time+"</td>";if(d.temperatureInfo!=null){a+="<td><strong>High</strong> "+d.temperatureInfo.highCelsius+"&#176;c<br /><strong>Low</strong> "+d.temperatureInfo.lowCelsius+"&#176;c</td>"}else{a+="<td></td>"}if(d.destinationGuide!=null){a+="<td>"+buildHighlights(d.destinationGuide.highlight,d.airportInfo.destinationGuideUrl)+"</td>"}else{a+="<td></td>"}a+="<td><a href='javascript:void(0)' title='"+c+"' class='remove'>Remove</a></td>";a+="</tr>"});return a}function renderDepAirports(){var a='<option value="">Select a City</option>\n';a+='<option value="">-----</option>\n';for(i=0;i<json.departureAirports.length;i++){if(json.departureAirports[i].code!=json.selectedDepartureAirportCode){a+="<option value='"+json.departureAirports[i].code+"'>"+json.departureAirports[i].displayName+"</option>\n"}else{a+="<option value='"+json.departureAirports[i].code+"' selected='yes'>"+json.departureAirports[i].displayName+"</option>\n"}}return a}function renderMonthOfTravel(){var c=new Date();var b=new Array(12);b[0]="January";b[1]="February";b[2]="March";b[3]="April";b[4]="May";b[5]="June";b[6]="July";b[7]="August";b[8]="September";b[9]="October";b[10]="November";b[11]="December";Date.prototype.dateStr=function(e,d){return isNaN(this)?"NaN":((e>=0)?[d,e>8?e+1:"0"+(e+1),"01"].join(""):[this.getFullYear(),this.getMonth()>8?this.getMonth()+1:"0"+(this.getMonth()+1),this.getDate()>9?this.getDate():"0"+this.getDate()].join(""))};var a='<option value="">Select a Month</option>\n';a+='<option value="">-----</option>\n';for(i=0;i<b.length;i++){if(i==c.getMonth()){a+="<option "+((json.travelDateString==new Date().dateStr())?"selected=yes":"")+" value='"+new Date().dateStr()+"'>"+b[i]+" "+c.getFullYear()+"</option>"}else{if(i>c.getMonth()){a+="<option "+((json.travelDateString==new Date().dateStr(i,c.getFullYear()))?"selected=yes":"")+" value='"+new Date().dateStr(i,c.getFullYear())+"'>"+b[i]+" "+c.getFullYear()+"</option>"}}}for(i=0;i<b.length;i++){if(i<c.getMonth()){a+="<option "+((json.travelDateString==new Date().dateStr(i,c.getFullYear()+1))?"selected=yes":"")+" value='"+new Date().dateStr(i,c.getFullYear()+1)+"'>"+b[i]+" "+(c.getFullYear()+1)+"</option>"}}return a}function renderDestinations(){var a="";$j.each(json.tripPlannerDestinationMap,function(c,D){var v=D.marketingRegionCode;var w=c;var p=D.destinationAirport.displayName;var l=D.popular;var C=D.airportInfo.airportGuideURL;var n=D.airportInfo.destinationGuideUrl;var b=D.airportInfo.weatherGuideURL;var x=D.airportInfo.activitiesUrl;if(D.flightPrice!=null){var A=(D.flightPrice.dealTypeCode=="G")?"international":"domestic";var j=D.flightPrice.currencyCode;var z=D.flightPrice.totalPrice;var h=D.flightPrice.currencySymbol;var r=D.flightPrice.tripType}if(D.destinationCityHotelPrice!=null){var t=D.destinationCityHotelPrice.priceValue;var f=D.destinationCityHotelPrice.currencyValue;var k=(D.destinationCityHotelPrice.countryCode!=null)?D.destinationCityHotelPrice.countryCode:null;var g=D.destinationCityHotelPrice.displayName}var u=D.time;var q=buildFilters(D.airportInfo.environmentType,D.airportInfo.holidayType,u);if(D.destinationGuide!=null){var y=(D.destinationGuide.highlight!=null)?buildHighlights(D.destinationGuide.highlight):null;var e=(D.destinationGuide.keyEventList!=null)?buildEvents(D.destinationGuide.keyEventList):null;if(D.destinationGuide.destination!=null){var m=(D.destinationGuide.destination.intro!=null)?D.destinationGuide.destination.intro:null;var B=(D.destinationGuide.destination.googleMapAddress!=null)?D.destinationGuide.destination.googleMapAddress:null;var o=(D.destinationGuide.destination.nearestAirportDisplayName!=null)?buildNearAirport(D.destinationGuide.destination.nearestAirportDisplayName):null}}if(D.temperatureInfo!=null){var s=(D.temperatureInfo.highCelsius!=null)?D.temperatureInfo.highCelsius:null;var d=(D.temperatureInfo.lowCelsius!=null)?D.temperatureInfo.lowCelsius:null}if(D.destinationGuide==null||(D.destinationGuide.destination.intro==null||D.destinationGuide.highlight==null||D.destinationGuide.keyEventList==null||D.destinationGuide.keyEventList.length==0)||D.flightPrice==null){}else{a+="<div class='result'>";a+="<a href='javascript:void(0)' class='tp_image_item tripType"+r+"'>";a+="<span class='dynTitle'>"+p.replace(/\(.*\)/,"")+"</span>";a+="<img src='/img/110x90/cities/"+removeChar(" ",p)+".jpg' alt='"+p+"' /><em>";if(z!=null){a+="from <strong><span class='dynCurrency symbol"+h+"'>";if(h!=null&&h!=""){a+=h}a+="</span><span class='dynPrice code"+j+"'>"+z+"*</span></strong>"}a+="</em></a>";a+="<div class='tp_list_item'>";a+="<h4 class="+c+" title='"+q+"'>"+p+"</h4>";a+="<div class='item_price_save clearit'>";a+="<form><label class='save' for='save_"+w+"'><input type='checkbox' value='Save' id='save_"+w+"'  onclick=javascript:submitSiteCatalyst('"+c+"','"+json.selectedDepartureAirportCode+"','save_"+w+"') /> Save to shortlist to compare</label></form>";a+=buildPrices(A,h,j,z,k,f,t,c,v,g);a+="</div>";if(m!=null){a+="<div class='item_summary'>"+m+"</div>"}a+=buildContentSummary(y,e,c,C,B,s,d,x,p,n);a+="</div>";if(D.popular){a+="<span class='popular'><img src='/img/_red08/specific/tripplanner/icon_popular.gif' alt='Popular' /></span>"}a+="</div>"}});return a}function objAirport(a,b){this.name=a;this.code=b}function buildPrices(e,l,a,m,j,o,f,d,c,h){var n="<dl class='prices clearit'><dt class='hidden'>Price</dt>";if(m!=null){n+="<dd class='price_flights'><span class='hidden'>Flights</span>Flights from <a href='"+pathVar+"/travel/airlines/"+e+"-flight-specials/global/en?departureAirportCode="+json.selectedDepartureAirportCode+"&arrivalAirportCode="+d+"' target='_blank'><span class='dynCurrency'>";if(l!=null&&l!=""){n+=l}n+="</span><span class='flightPrice'>"+m;n+="</span></a>*</dd>"}var k=displayHotels(json.marketingRegionCode,json.countryCode,j);if(k=="true"&&f!=null){setLambadaCityList();for(var g=0;g<ALL.length-1;g++){var b=ALL[g].name;if(b==h){d=ALL[g].code}}n+="<dd class='price_accom'><span class='hidden'>Accomodations</span>Hotels from ";if(o!=null){if(o.indexOf("NZ")>0){n+="<a href='"+o+pathVar+"/travel/airlines/hotels/global/en?depCity="+d+"&depCountry="+j+"' target='_blank'>NZ"}else{n+="<a href='"+pathVar+"/travel/airlines/hotels/global/en?depCity="+d+"&depCountry="+j+"' target='_blank'>"}}if(o=="AUD"){o="A"}if(o=="NZD"){o="NZ"}if(o!=null&&o!=""){n+=o}n+="<span class='dynCurrency'>";n+="$</span><span class='accomPrice'>"+f+"</span></a>^</dd>"}n+="</dl>";return n}function displayHotels(c,b,a){if(c=="AU"){return"true"}if(c=="AM"){return"false"}if(c=="SP"&&b=="NZ"){return"true"}if(a=="AU"||a=="NZ"){return"true"}else{return"false"}}function buildContentSummary(f,k,e,a,d,c,l,g,b,j){var h="<div class='item_content clearit'><div class='item_img'><img src='/img/140x140/cities/"+removeChar(" ",b)+".jpg' alt='"+b+"' class='' /></div>";if(f!=null){h+="<div class='highlights'><h5><img src='/img/_red08/specific/tripplanner/h_highlights.gif' alt='Highlights' /></h5>"+f+"</div>"}if(k!=null){h+="<div class='events'><h5><img src='/img/_red08/specific/tripplanner/h_events.gif' alt='Events' /></h5>"+k+"</div>"}if(a!=null||g!=null||d!=null||c!=null){h+="<div class='quicklinks'><ul class='clearit'>";if(a!=null){h+="<li class='view_airport'><a href='"+a+"' target='_blank'>Airport guide</a></li>"}if(j!=null){j="http://travelinsider.qantas.com.au/"+j.substring(j.indexOf("destination-guide"),j.indexOf("/global/en"))+".htm";h+="<li class='view_destination'><a href='"+j+"' target='_blank'>Destination guide</a></li>"}if(c!=null){h+="<li class='view_weather'><a href='javascript:void(0)' title='"+pathVar+"/flash/weatherv2/standAlone/map_live.swf?newDepartureCity="+e+"'>Weather</a></li>"}if(d!=null){h+="<li class='view_map'><a href='javascript:void(0)' title='"+d+"'>Map</a></li>"}if(g!=null){h+="<li class='view_activity'><a href='"+g+"' target='_blank'>Activities</a></li>"}h+="</ul></div>"}h+="</div>";return h}function removeChar(a,b){while(b.indexOf(a,0)!=-1){position=b.indexOf(a,0);firstHalf=b.substr(0,position);secondHalf=b.substr(position+1,b.length-position);b=firstHalf+secondHalf}if((b.indexOf("("))==-1){}else{b=b.substring(0,b.indexOf("("))}b=b.toLowerCase();return b}function buildFilters(a,b,c){return a+"|"+b+"|"+getDistance(c)}function getDistance(a){var a=String(a.match(/\d{1,}/g)).replace(/,/,"");var b;switch(a.length){case 3:a="0"+a;break;case 2:a="00"+a;break;default:b=filterType.distance.join("|")}if(a<=430){b=filterType.distance[0]}if(a>=431&&a<=800){b=filterType.distance[1]}if(a>=801){b=filterType.distance[2]}return b}function buildEvents(d){var c=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");if(d!=null&&d!=""){phtml="<ul>\n";for(i=0;i<3;i++){if(d[i]!=null){var b=new Date(d[i].eventStartDate.timeInMillis);var f=b.getMonth();var h=b.getDate();var a=new Date(d[i].eventEndDate.timeInMillis);var e=a.getMonth();var g=a.getDate();if(h!=g){if(f==e){phtml+="<li><span class='eDates'>"+h+" - "+g+" "+c[e]+" </span>"+d[i].eventName+"</li>\n"}else{phtml+="<li><span class='eDates'>"+h+" "+c[f]+" - "+g+" "+c[e]+" </span>"+d[i].eventName+"</li>\n"}}else{phtml+="<li><span class='eDates'>"+h+" "+c[e]+" </span>"+d[i].eventName+"</li>\n"}}}phtml+="</ul>";return phtml}else{return null}}function buildNearAirport(a){return"<p>Nearest airport:<br /><strong>"+a+"</strong></p>"}function buildHighlights(b,a){if(b!=null&&b!=""&&b.itemList!=null&&b.itemList!=""){phtml="<ul class='contentHighlights'>\n";for(i=0;i<b.itemList.length;i++){phtml+="<li>"+b.itemList[i]+"</li>\n"}phtml+="</ul>";if(a!=null){a="http://travelinsider.qantas.com.au/"+a.substring(a.indexOf("destination-guide"),a.indexOf("/global/en"))+".htm";phtml+="<p><a href='"+a+"' target='_blank'>Destination guide</a></p>\n"}return phtml}else{return""}};
