tanto.namespace("ndm.newscomau");travel={};travel.cityGuide=function(){jQuery(".city-guides-module").each(function(){jQuery("select.city-guides-select",this).bind("change",function(){jQuery(".download-guide-link",jQuery(this).parent()).attr("href",jQuery(this).val())})})};jQuery.fn.nGoDo=function(a){jQuery(this).each(function(){var f=jQuery.extend({insertion:"ul.godo-list",root:"div.content",container:"div.module.godo",btn:"button.godo-btn",statelist:"select.godo-state",numOfFeeds:3,LINK_URL_PREFIX:"http://travelactivities.news.com.au",API_URL_PREFIX:"http://vpe.news.com.au/getFeed?src=godo&subject=activity&category=10"},a||{});switch(ndm.page.site){case"NEWS":f.LINK_URL_PREFIX="http://travelactivities.news.com.au";break;case"TAUS":f.LINK_URL_PREFIX="http://travelactivities.theaustralian.com.au";break;case"TCM":f.LINK_URL_PREFIX="http://travelactivities.couriermail.com.au";break;case"ADV":f.LINK_URL_PREFIX="http://travelactivities.adelaidenow.com.au";break;case"TST":f.LINK_URL_PREFIX="http://travelactivities.perthnow.com.au";break;case"HWT":f.LINK_URL_PREFIX="http://travelactivities.heraldsun.com.au";break;case"DTM":f.LINK_URL_PREFIX="http://travelactivities.dailytelegraph.com.au";break;default:break}var e=jQuery(this).find(f.insertion);var d=jQuery(this).find(f.btn);var c=jQuery(this).find(f.statelist);var h=jQuery(c).val();var g=function(l){if(!l){return false}var k="";for(var j=0;j!=f.numOfFeeds;j++){k+='<li><a target="_blank" href="'+f.LINK_URL_PREFIX+l.productList.products[j].productUrl+'"><strong>'+l.productList.products[j].region+"</strong> "+l.productList.products[j].subcategory+"<span>$"+l.productList.products[j].maxPrice+"</span></a></li>"}jQuery(e).html(k)};jQuery(d).click(function(){h=jQuery(c).val();jQuery(e).html('<div style="width:297px;height:68px;text-align:centre;"><img style="margin:25px 0 0 125px;" src="http://www.news.com.au/travel/css/images/activity3a6085.gif" alt="loading content" /></div>');b()});var b=function(){var i=f.API_URL_PREFIX+"&cb=tanto.ajax.callbackHandler&state="+h;ndm.ajax.callbackJSON(i,g,false,true)};jQuery(e).html('<div style="width:297px;height:68px;text-align:centre;"><img style="margin:25px 0 0 125px;" src="http://www.news.com.au/travel/css/images/activity3a6085.gif" alt="loading content" /></div>');b()})};travel.googleMaps=function(b,a,c){ndm.controls.googlemaps.nmGoogleMaps(b,a,c,11,{})};travel.setCity=function(){var a=[];a.Algeria=[{value:"160134",text:"Algiers"}];a.Austria=[{value:"160212",text:"Vienna"}];a.Argentina=[{value:"160227",text:"Buenos Aires"}];a.Bangladesh=[{value:"160378",text:"Dhaka"}];a.Bahamas=[{value:"160131",text:"Nassau"}];a.Bermuda=[{value:"160001",text:"Bermuda"}];a.Belgium=[{value:"160266",text:"Brussels"}];a.Brazil=[{value:"160087",text:"Rio de Janeiro"}];a.Brunei=[{value:"160033",text:"Brunei Darussalam"}];a.Bulgaria=[{value:"160071",text:"Sofia"}];a.Cambodia=[{value:"160119",text:"Phnom Penh"}];a.Canada=[{value:"160182",text:"Ottawa"},{value:"160179",text:"Toronto"},{value:"160130",text:"Vancouver"}];a.Chile=[{value:"160271",text:"Santiago"}];a.China=[{value:"160059",text:"Beijing"},{value:"160285",text:"Hong Kong"},{value:"160211",text:"Shanghai"}];a.Cuba=[{value:"160153",text:"Havana"}];a.Colombia=[{value:"160009",text:"Bogota"}];a.Cyprus=[{value:"160289",text:"Nicosia"}];a["Czech Republic"]=[{value:"160166",text:"Prague"}];a.Denmark=[{value:"160149",text:"Copenhagen"}];a["East Timor"]=[{value:"160421",text:"Dili"}];a.Egypt=[{value:"160305",text:"Cairo"}];a.Fiji=[{value:"160073",text:"Nadi"}];a.Finland=[{value:"160133",text:"Helsinki"}];a.France=[{value:"160185",text:"Paris"}];a["French Polynesia"]=[{value:"160160",text:"Tahiti"}];a.Germany=[{value:"160065",text:"Berlin"},{value:"160007",text:"Munich"}];a.Greece=[{value:"160252",text:"Athens"}];a.Hungary=[{value:"160210",text:"Budapest"}];a.India=[{value:"160154",text:"New Delhi"}];a.Indonesia=[{value:"160025",text:"Jakarta"}];a.Iran=[{value:"160215",text:"Tehran"}];a.Ireland=[{value:"160238",text:"Dublin"}];a.Italy=[{value:"160003",text:"Rome"}];a.Israel=[{value:"160225",text:"Tel Aviv"}];a.Jamaica=[{value:"160042",text:"Kingston"}];a.Japan=[{value:"160069",text:"Tokyo"}];a.Kenya=[{value:"160308",text:"Nairobi"}];a.Kuwait=[{value:"160157",text:"Kuwait"}];a.Lebanon=[{value:"160055",text:"Beirut"}];a.Malaysia=[{value:"160159",text:"Kuala Lumpur"}];a.Mexico=[{value:"160272",text:"Mexico City"}];a.Malta=[{value:"160297",text:"Malta"}];a.Morocco=[{value:"160248",text:"Casablanca"}];a.Netherlands=[{value:"160122",text:"Amsterdam"}];a["New Zealand"]=[{value:"160183",text:"Auckland"},{value:"160061",text:"Christchurch"},{value:"160086",text:"Wellington"}];a["North Korea"]=[{value:"160406",text:"Pyongyang"}];a.Pakistan=[{value:"160079",text:"Karachi"}];a.Peru=[{value:"160107",text:"Lima"}];a.Poland=[{value:"160277",text:"Warsaw"}];a.Romania=[{value:"160276",text:"Bucharest"}];a.Russia=[{value:"160268",text:"Vladivostok"}];a["Serbia and Montenegro"]=[{value:"160020",text:"Belgrade"}];a["Solomon Islands"]=[{value:"160309",text:"Honiara"}];a["South Africa"]=[{value:"160094",text:"Johannesburg"}];a["South Korea"]=[{value:"160270",text:"Seoul"}];a["Solomon Islands"]=[{value:"160309",text:"Honiara"}];a["Sri Lanka"]=[{value:"160409",text:"Colombo"}];a.Spain=[{value:"160075",text:"Barcelona"},{value:"160000",text:"Madrid"}];a.Sweden=[{value:"160121",text:"Stockholm"}];a.Switzerland=[{value:"160111",text:"Zurich"}];a.Taiwan=[{value:"160011",text:"Taipei"}];a.Thailand=[{value:"160052",text:"Bangkok"}];a.Turkey=[{value:"160049",text:"Istanbul"}];a["United Arab Emirates"]=[{value:"160053",text:"Dubai"}];a["United Kingdom"]=[{value:"160012",text:"Glasgow"},{value:"160127",text:"London"}];a["United States"]=[{value:"160369",text:"Las Vegas"},{value:"160207",text:"Los Angeles"},{value:"160008",text:"Miami"},{value:"160232",text:"New York"},{value:"160004",text:"San Francisco"},{value:"160136",text:"Washington DC"}];a["Viet Nam"]=[{value:"160246",text:"Ho Chi Minh"}];setOptions=function(c){var f=c.options[c.selectedIndex].text,b=a[f],d="",e;for(e=0;e<b.length;e++){d+='<option value="'+b[e].value+'">'+b[e].text+"</option>"}jQuery(".searchselect.city").html(d)};return function(){jQuery(".searchselect.country").bind("change",function(){setOptions(this)})}};jQuery(document).ready(function(){var a=travel.setCity();a();travel.cityGuide();jQuery(".godo").nGoDo()});var myCityList=[];myCityList[0]=[];myCityList[0][0]=["Botswana",628];myCityList[0][1]=["Cairo",28482];myCityList[0][2]=["Cape Town",35474];myCityList[0][3]=["Democratic Republic of Congo",761];myCityList[0][4]=["Egypt",845];myCityList[0][5]=["Ethiopia",876];myCityList[0][6]=["Johannesburg",37710];myCityList[0][7]=["Kenya",1988];myCityList[0][8]=["Madagascar",2128];myCityList[0][9]=["Mauritius",2167];myCityList[0][10]=["Morocco",2236];myCityList[0][11]=["Mozambique",2243];myCityList[0][12]=["Namibia",2249];myCityList[0][13]=["Senegal",2732];myCityList[0][14]=["Seychelles",2735];myCityList[0][15]=["South Africa",3210];myCityList[0][16]=["Tanzania",3364];myCityList[0][17]=["Tunisia",3577];myCityList[0][18]=["Uganda",3613];myCityList[0][19]=["Zambia",3730];myCityList[0][20]=["Zimbabwe",];myCityList[1]=[];myCityList[1][0]=["Antarctica",34];myCityList[2]=[];myCityList[2][0]=["Bali",66936];myCityList[2][1]=["Bangkok",29620];myCityList[2][2]=["Beijing",4688];myCityList[2][3]=["Brunei",644];myCityList[2][4]=["Cambodia",660];myCityList[2][5]=["China",704];myCityList[2][6]=["Delhi",14409];myCityList[2][7]=["Hanoi",18753];myCityList[2][8]=["Ho Chi Minh City",25057];myCityList[2][9]=["Hong Kong",1303];myCityList[2][10]=["Indonesia",1810];myCityList[2][11]=["Japan",1935];myCityList[2][12]=["Ko Samui",67766];myCityList[2][13]=["Kuala Lumpur",17266];myCityList[2][14]=["Kyoto",25047];myCityList[2][15]=["Laos",2032];myCityList[2][16]=["Lombok",66938];myCityList[2][17]=["Malaysia",2134];myCityList[2][18]=["Manila",17498];myCityList[2][19]=["Mongolia",2226];myCityList[2][20]=["Myanmar",2246];myCityList[2][21]=["North Korea",1998];myCityList[2][22]=["Osaka",39720];myCityList[2][23]=["Penang",67753];myCityList[2][24]=["Philippines",2372];myCityList[2][25]=["Phnom Penh",43861];myCityList[2][26]=["Phuket Province",67767];myCityList[2][27]=["Seoul",17636];myCityList[2][28]=["Shanghai",4949];myCityList[2][29]=["Siem Reap",162284];myCityList[2][30]=["Singapore",96714];myCityList[2][31]=["South Korea",2001];myCityList[2][32]=["Taipei",9972];myCityList[2][33]=["Taiwan",3358];myCityList[2][34]=["Thailand",3367];myCityList[2][35]=["Tibet",4681];myCityList[2][36]=["Tokyo",18278];myCityList[2][37]=["Vietnam",3693];myCityList[3]=[];myCityList[3][0]=["Adelaide",4649];myCityList[3][1]=["Airlie Beach",1000114458];myCityList[3][2]=["Alice Springs",43771];myCityList[3][3]=["Barossa Valley",1000114459];myCityList[3][4]=["Brisbane",4663];myCityList[3][5]=["Broome",43773];myCityList[3][6]=["Byron Bay",43783];myCityList[3][7]=["Cairns",39930];myCityList[3][8]=["Canberra",3814];myCityList[3][9]=["Darwin",3844];myCityList[3][10]=["Daylesford",1000114460];myCityList[3][11]=["Esperance",1000109725];myCityList[3][12]=["Gold Coast",1000114461];myCityList[3][13]=["Great Ocean Road",67029];myCityList[3][14]=["Hobart",3870];myCityList[3][15]=["Kangaroo Island",1000114507];myCityList[3][16]=["Margaret River",1000119122];myCityList[3][17]=["Melbourne",3888];myCityList[3][18]=["Mildura",1000114504];myCityList[3][19]=["Monkey Mia",1000114470];myCityList[3][20]=["New South Wales",67012];myCityList[3][21]=["Perth",4025];myCityList[3][22]=["Sydney",4043];myCityList[3][23]=["Western Australia",117711];myCityList[3][24]=["Yarra Valley",67611];myCityList[4]=[];myCityList[4][0]=["Bahamas",304];myCityList[4][1]=["Barbados",341];myCityList[4][2]=["Belize",590];myCityList[4][3]=["Cayman Islands",680];myCityList[4][4]=["Costa Rica",767];myCityList[4][5]=["Cuba",780];myCityList[4][6]=["El Salvador",848];myCityList[4][7]=["Guatemala",1251];myCityList[4][8]=["Jamaica",1932];myCityList[4][9]=["Nicaragua",2302];myCityList[4][10]=["Panama",2352];myCityList[4][11]=["Puerto Rico",2446];myCityList[4][12]=["St Martin",25108];myCityList[5]=[];myCityList[5][0]=["Aberdeen",40841];myCityList[5][1]=["Alicante",40637];myCityList[5][2]=["Amsterdam",14644];myCityList[5][3]=["Athens",21392];myCityList[5][4]=["Austria",272];myCityList[5][5]=["Barcelona",9067];myCityList[5][6]=["Bath",117982];myCityList[5][7]=["Belfast",30368];myCityList[5][8]=["Belgium",545];myCityList[5][9]=["Belgrade",44289];myCityList[5][10]=["Bergen",1000163334];myCityList[5][11]=["Berlin",7687];myCityList[5][12]=["Birmingham",35070];myCityList[5][13]=["Bologna",39278];myCityList[5][14]=["Bordeaux",67011];myCityList[5][15]=["Bosnia-Hercegovina",625];myCityList[5][16]=["Bratislava",44299];myCityList[5][17]=["Bristol",119980];myCityList[5][18]=["Budapest",34582];myCityList[5][19]=["Bulgaria",651];myCityList[5][20]=["Cannes",40759];myCityList[5][21]=["Copenhagen",30573];myCityList[5][22]=["Croatia",773];myCityList[5][23]=["Cyprus",783];myCityList[5][24]=["Czech Republic",794];myCityList[5][25]=["Denmark",815];myCityList[5][26]=["Dublin",18779];myCityList[5][27]=["Dubrovnik",44081];myCityList[5][28]=["Edinburgh",19769];myCityList[5][29]=["England",5182];myCityList[5][30]=["Estonia",869];myCityList[5][31]=["Finland",888];myCityList[5][32]=["Florence",15484];myCityList[5][33]=["France",909];myCityList[5][34]=["Frankfurt",26956];myCityList[5][35]=["Germany",992];myCityList[5][36]=["Glasgow",32885];myCityList[5][37]=["Greece",1042];myCityList[5][38]=["Greenland",1064];myCityList[5][39]=["Helsinki",35698];myCityList[5][40]=["Hungary",1785];myCityList[5][41]=["Ibiza",67908];myCityList[5][42]=["Iceland",1792];myCityList[5][43]=["Ireland",1835];myCityList[5][44]=["Istanbul",24591];myCityList[5][45]=["Italy",1872];myCityList[5][46]=["Krakow",39320];myCityList[5][47]=["Latvia",2039];myCityList[5][48]=["Leeds",40615];myCityList[5][49]=["Lisbon",23055];myCityList[5][50]=["Liverpool",36216];myCityList[5][51]=["London",5217];myCityList[5][52]=["Luxembourg",2092];myCityList[5][53]=["Macedonia",2125];myCityList[5][54]=["Madrid",20146];myCityList[5][55]=["Mallorca",67007];myCityList[5][56]=["Malta",2147];myCityList[5][57]=["Manchester",35112];myCityList[5][58]=["Marseille",21014];myCityList[5][59]=["Milan",27363];myCityList[5][60]=["Monaco",2203];myCityList[5][61]=["Montenegro",1000109856];myCityList[5][62]=["Moscow",8560];myCityList[5][63]=["Munich",31388];myCityList[5][64]=["Naples",39558];myCityList[5][65]=["Netherlands",2262];myCityList[5][66]=["Newcastle",39699];myCityList[5][67]=["Nice",33144];myCityList[5][68]=["Norway",2340];myCityList[5][69]=["Oxford",44105];myCityList[5][70]=["Paris",6277];myCityList[5][71]=["Poland",2382];myCityList[5][72]=["Portugal",2385];myCityList[5][73]=["Prague",23750];myCityList[5][74]=["Romania",2463];myCityList[5][75]=["Rome",16373];myCityList[5][76]=["Rotterdam",40825];myCityList[5][77]=["Russia",2466];myCityList[5][78]=["Santorini",165179];myCityList[5][79]=["Scotland",3754];myCityList[5][80]=["Serbia",1000109923];myCityList[5][81]=["Slovakia",3186];myCityList[5][82]=["Slovenia",3193];myCityList[5][83]=["Spain",3213];myCityList[5][84]=["St Petersburg",9029];myCityList[5][85]=["Stockholm",28746];myCityList[5][86]=["Sweden",3275];myCityList[5][87]=["Switzerland",3278];myCityList[5][88]=["Turkey",3592];myCityList[5][89]=["Ukraine",3616];myCityList[5][90]=["Venice",22104];myCityList[5][91]=["Wales",3786];myCityList[5][92]=["Warsaw",39023];myCityList[5][93]=["Zurich",27677];myCityList[6]=[];myCityList[6][0]=["Dubai",18703];myCityList[6][1]=["Mumbai",14612];myCityList[6][2]=["Iran",1813];myCityList[6][3]=["Iraq",1832];myCityList[6][4]=["Israel",1000110068];myCityList[6][5]=["Jerusalem",44487];myCityList[6][6]=["Jordan",1966];myCityList[6][7]=["Lebanon",2046];myCityList[6][8]=["Oman",2343];myCityList[6][9]=["Qatar",2453];myCityList[6][10]=["Saudi Arabia",2725];myCityList[6][11]=["Syria",3339];myCityList[6][12]=["The Palestinian Territories",67022];myCityList[6][13]=["United Arab Emirates",3619];myCityList[6][14]=["Yemen",3712];myCityList[7]=[];myCityList[7][0]=["Acapulco",36242];myCityList[7][1]=["Atlanta",10337];myCityList[7][2]=["Boston",10528];myCityList[7][3]=["Canada",670];myCityList[7][4]=["Chicago",10726];myCityList[7][5]=["Hawaii",66934];myCityList[7][6]=["Honolulu and Waikiki",10323];myCityList[7][7]=["Las Vegas",11091];myCityList[7][8]=["Los Angeles",11298];myCityList[7][9]=["Mexico",2174];myCityList[7][10]=["Mexico City",10116];myCityList[7][11]=["Miami",11832];myCityList[7][12]=["New Orleans",12314];myCityList[7][13]=["New York City",12496];myCityList[7][14]=["Niagara Falls",73507];myCityList[7][15]=["Phoenix",13386];myCityList[7][16]=["San Diego",13412];myCityList[7][17]=["San Francisco",13430];myCityList[7][18]=["Tijuana",1000163745];myCityList[7][19]=["Toronto",18168];myCityList[7][20]=["USA",3622];myCityList[7][21]=["Vancouver",18170];myCityList[7][22]=["Washington DC",13960];myCityList[7][23]=["Whistler",1000159165];myCityList[8]=[];myCityList[8][0]=["Adelaide",4649];myCityList[8][1]=["Airlie Beach",1000114458];myCityList[8][2]=["Alice Springs",43771];myCityList[8][3]=["Auckland",36474];myCityList[8][4]=["Australia",245];myCityList[8][5]=["Barossa Valley",1000114459];myCityList[8][6]=["Brisbane",4663];myCityList[8][7]=["Broome",43773];myCityList[8][8]=["Byron Bay",43783];myCityList[8][9]=["Cairns",39930];myCityList[8][10]=["Canberra",3814];myCityList[8][11]=["Christchurch",40106];myCityList[8][12]=["Cook Islands",764];myCityList[8][13]=["Darwin",3844];myCityList[8][14]=["Daylesford",1000114460];myCityList[8][15]=["Esperance",1000109725];myCityList[8][16]=["Fiji",885];myCityList[8][17]=["French Polynesia",973];myCityList[8][18]=["Gold Coast",1000114461];myCityList[8][19]=["Great Ocean Road",67029];myCityList[8][20]=["Hobart",3870];myCityList[8][21]=["Kangaroo Island",1000114507];myCityList[8][22]=["Margaret River",1000119122];myCityList[8][23]=["Melbourne",3888];myCityList[8][24]=["Mildura",1000114504];myCityList[8][25]=["Monkey Mia",1000114470];myCityList[8][26]=["New Caledonia",2292];myCityList[8][27]=["New South Wales",67012];myCityList[8][28]=["New Zealand",2295];myCityList[8][29]=["Papua New Guinea",2355];myCityList[8][30]=["Perth",4025];myCityList[8][31]=["Queenstown",164900];myCityList[8][32]=["Samoa",2676];myCityList[8][33]=["Solomon Islands",3200];myCityList[8][34]=["Sydney",4043];myCityList[8][35]=["Tahiti",43847];myCityList[8][36]=["Tonga",3384];myCityList[8][37]=["Tuvalu",3610];myCityList[8][38]=["Vanuatu",3679];myCityList[8][39]=["Wellington",43793];myCityList[8][40]=["Western Australia",117711];myCityList[8][41]=["Yarra Valley",67611];myCityList[9]=[];myCityList[9][0]=["Argentina",224];myCityList[9][1]=["Bolivia",622];myCityList[9][2]=["Brazil",638];myCityList[9][3]=["Buenos Aires",18228];myCityList[9][4]=["Chile",701];myCityList[9][5]=["Colombia",748];myCityList[9][6]=["Easter Island Rapa Nui",67429];myCityList[9][7]=["Ecuador",842];myCityList[9][8]=["French Guiana",970];myCityList[9][9]=["Galapagos Islands",67434];myCityList[9][10]=["Paraguay",2358];myCityList[9][11]=["Peru",2365];myCityList[9][12]=["Rio de Janeiro",18238];myCityList[9][13]=["Sao Paulo",36426];myCityList[9][14]=["Uruguay",3673];myCityList[9][15]=["Venezuela",3686];ndm.newscomau.travelTaxonomy={init:function(){var b=document.getElementById("ddl-region");var c=document.getElementById("cityList");var a=document.getElementById("regionForm");b.onchange=function(){ndm.newscomau.travelTaxonomy.changeSelection(this)};a.onsubmit=function(){var f=c.options[c.selectedIndex].value.toLowerCase();if(f=="country/city"){alert("Please select the country/city");return false}var e=f.replace(/\s+/g,"+");var d="/travel/world/destination/"+e;window.location=d;return false};ndm.newscomau.travelTaxonomy.changeSelection(b)},changeSelection:function(e){var a=e.selectedIndex-1;var c=myCityList[a];var f;var b;if(typeof(c)=="undefined"){return}var d=document.getElementById("cityList");d.options.length=0;for(b=0;b<c.length;b++){f=b+1;d.options[b]=new Option(myCityList[a][b][0],myCityList[a][b][0],false,false)}}};(function(a){a.fn.bgIframe=a.fn.bgiframe=function(c){if(a.browser.msie&&/6.0/.test(navigator.userAgent)){c=a.extend({top:"auto",left:"auto",width:"auto",height:"auto",opacity:true,src:"javascript:false;"},c||{});var d=function(e){return e&&e.constructor==Number?e+"px":e},b='<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+c.src+'"style="display:block;position:absolute;z-index:-1;'+(c.opacity!==false?"filter:Alpha(Opacity='0');":"")+"top:"+(c.top=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+'px')":d(c.top))+";left:"+(c.left=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+'px')":d(c.left))+";width:"+(c.width=="auto"?"expression(this.parentNode.offsetWidth+'px')":d(c.width))+";height:"+(c.height=="auto"?"expression(this.parentNode.offsetHeight+'px')":d(c.height))+';"/>';return this.each(function(){if(a("> iframe.bgiframe",this).length==0){this.insertBefore(document.createElement(b),this.firstChild)}})}return this}})(jQuery);(function(a){a.fn.extend({autocomplete:function(b,c){var d=typeof b=="string";c=a.extend({},a.Autocompleter.defaults,{url:d?b:null,data:d?null:b,delay:d?a.Autocompleter.defaults.delay:10,max:c&&!c.scroll?10:150},c);c.highlight=c.highlight||function(e){return e};return this.each(function(){new a.Autocompleter(this,c)})},result:function(b){return this.bind("result",b)},search:function(b){return this.trigger("search",[b])},flushCache:function(){return this.trigger("flushCache")},setOptions:function(b){return this.trigger("setOptions",[b])},unautocomplete:function(){return this.trigger("unautocomplete")}});a.Autocompleter=function(l,g){var c={UP:38,DOWN:40,DEL:46,TAB:9,RETURN:13,ESC:27,COMMA:188,PAGEUP:33,PAGEDOWN:34};var b=a(l).attr("autocomplete","off").addClass(g.inputClass);var j;var p="";var m=a.Autocompleter.Cache(g);var e=0;var u;var w={mouseDownOnSelect:false};var r=a.Autocompleter.Select(g,l,d,w);b.keydown(function(x){u=x.keyCode;switch(x.keyCode){case c.UP:x.preventDefault();if(r.visible()){r.prev()}else{t(0,true)}break;case c.DOWN:x.preventDefault();if(r.visible()){r.next()}else{t(0,true)}break;case c.PAGEUP:x.preventDefault();if(r.visible()){r.pageUp()}else{t(0,true)}break;case c.PAGEDOWN:x.preventDefault();if(r.visible()){r.pageDown()}else{t(0,true)}break;case g.multiple&&a.trim(g.multipleSeparator)==","&&c.COMMA:case c.TAB:d();break;case c.RETURN:if(d()){x.preventDefault();x.stopPropagation()}break;case c.ESC:r.hide();break;default:clearTimeout(j);j=setTimeout(t,g.delay);break}}).keypress(function(x){if(x.keyCode==c.RETURN&&d()){x.preventDefault();x.stopPropagation();return false}}).focus(function(){e++}).blur(function(){e=0;if(!w.mouseDownOnSelect){s()}}).click(function(){if(e++>1&&!r.visible()){t(0,true)}}).bind("search",function(){var x=(arguments.length>1)?arguments[1]:null;function y(C,B){var z;if(B&&B.length){for(var A=0;A<B.length;A++){if(B[A].result.toLowerCase()==C.toLowerCase()){z=B[A];break}}}if(typeof x=="function"){x(z)}else{b.trigger("result",z&&[z.data,z.value])}}a.each(h(b.val()),function(z,A){f(A,y,y)})}).bind("flushCache",function(){m.flush()}).bind("setOptions",function(){a.extend(g,arguments[1]);if("data" in arguments[1]){m.populate()}}).bind("unautocomplete",function(){r.unbind();b.unbind()});function d(){var y=r.selected();if(!y){return false}var x=y.result;p=x;if(g.multiple){var z=h(b.val());if(z.length>1){x=z.slice(0,z.length-1).join(g.multipleSeparator)+g.multipleSeparator+x}x+=g.multipleSeparator}b.val(x);v();b.trigger("result",[y.data,y.value]);return true}function t(z,y){if(u==c.DEL){r.hide();return}var x=b.val();if(y){return}if(!y&&x==p){return}p=x;x=i(x);if(x.length>=g.minChars){b.addClass(g.loadingClass);if(!g.matchCase){x=x.toLowerCase()}f(x,k,v)}else{n();r.hide()}}function h(y){if(!y){return[""]}var z=y.split(g.multipleSeparator);var x=[];a.each(z,function(A,B){if(a.trim(B)){x[A]=a.trim(B)}});return x}function i(x){if(!g.multiple){return x}var y=h(x);return y[y.length-1]}function q(x,y){if(g.autoFill&&(i(b.val()).toLowerCase()==x.toLowerCase())&&u!=8){b.val(b.val()+y.substring(i(p).length));a.Autocompleter.Selection(l,p.length,p.length+y.length)}}function s(){clearTimeout(j);j=setTimeout(v,200)}function v(){r.hide();clearTimeout(j);n();if(g.mustMatch){b.search(function(x){if(!x){b.val("")}})}}function k(y,x){if(x&&x.length&&e){n();r.display(x,y);q(y,x[0].value);r.show()}else{v()}}function f(y,A,x){if(!g.matchCase){y=y.toLowerCase()}var z=m.load(y);if(z&&z.length){A(y,z)}else{if((typeof g.url=="string")&&(g.url.length>0)){var B={};a.each(g.extraParams,function(C,D){B[C]=typeof D=="function"?D():D});a.ajax({mode:"abort",port:"autocomplete"+l.name,dataType:g.dataType,jsonp:g.jsonp||"callback",url:g.url,data:a.extend({q:i(y),limit:g.max},B),success:function(D){var C=g.parse&&g.parse(D)||o(D);m.add(y,C);A(y,C)}})}else{x(y)}}}function o(A){var x=[];var z=A.split("\n");for(var y=0;y<z.length;y++){var B=a.trim(z[y]);if(B){B=B.split("|");x[x.length]={data:B,value:B[0],result:g.formatResult&&g.formatResult(B,B[0])||B[0]}}}return x}function n(){b.removeClass(g.loadingClass)}};a.Autocompleter.defaults={inputClass:"ac_input",resultsClass:"ac_results",loadingClass:"ac_loading",minChars:1,delay:400,matchCase:false,matchSubset:true,matchContains:false,cacheLength:10,max:100,mustMatch:false,extraParams:{},selectFirst:true,formatItem:function(b){return b[0]},autoFill:false,width:0,multiple:false,multipleSeparator:", ",highlight:function(c,b){return c.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)("+b.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi,"\\$1")+")(?![^<>]*>)(?![^&;]+;)","gi"),"<strong>$1</strong>")},scroll:true,scrollHeight:180,attachTo:"body"};a.Autocompleter.Cache=function(c){var f={};var d=0;function h(l,k){if(!c.matchCase){l=l.toLowerCase()}var j=l.indexOf(k);if(j==-1){return false}return j==0||c.matchContains}function g(j,i){if(d>c.cacheLength){b()}if(!f[j]){d++}f[j]=i}function e(){if(!c.data){return false}var k={},j=0;if(!c.url){c.cacheLength=1}k[""]=[];for(var m=0,l=c.data.length;m<l;m++){var p=c.data[m];p=(typeof p=="string")?[p]:p;var o=c.formatItem(p,m+1,c.data.length);if(o===false){continue}var n=o.charAt(0).toLowerCase();if(!k[n]){k[n]=[]}var q={value:o,data:p,result:c.formatResult&&c.formatResult(p)||o};k[n].push(q);if(j++<c.max){k[""].push(q)}}a.each(k,function(r,s){c.cacheLength++;g(r,s)})}setTimeout(e,25);function b(){f={};d=0}return{flush:b,add:g,populate:e,load:function(n){if(!c.cacheLength||!d){return null}if(!c.url&&c.matchContains){var m=[];for(var j in f){if(j.length>0){var o=f[j];a.each(o,function(p,k){if(h(k.value,n)){m.push(k)}})}}return m}else{if(f[n]){return f[n]}else{if(c.matchSubset){for(var l=n.length-1;l>=c.minChars;l--){var o=f[n.substr(0,l)];if(o){var m=[];a.each(o,function(p,k){if(h(k.value,n)){m[m.length]=k}});return m}}}}}return null}}};a.Autocompleter.Select=function(e,j,l,p){var i={ACTIVE:"ac_over"};var k,f=-1,r,m="",s=true,c,o;function n(){if(!s){return}c=a("<div/>").hide().addClass(e.resultsClass).css("position","absolute").appendTo(e.attachTo);o=a("<ul>").appendTo(c).mouseover(function(t){if(q(t).nodeName&&q(t).nodeName.toUpperCase()=="LI"){f=a("li",o).removeClass(i.ACTIVE).index(q(t));a(q(t)).addClass(i.ACTIVE)}}).click(function(t){a(q(t)).addClass(i.ACTIVE);l();j.focus();return false}).mousedown(function(){p.mouseDownOnSelect=true}).mouseup(function(){p.mouseDownOnSelect=false});if(e.width>0){c.css("width",e.width)}s=false}function q(u){var t=u.target;while(t&&t.tagName!="LI"){t=t.parentNode}if(!t){return[]}return t}function h(t){k.slice(f,f+1).removeClass();g(t);var v=k.slice(f,f+1).addClass(i.ACTIVE);if(e.scroll){var u=0;k.slice(0,f).each(function(){u+=this.offsetHeight});if((u+v[0].offsetHeight-o.scrollTop())>o[0].clientHeight){o.scrollTop(u+v[0].offsetHeight-o.innerHeight())}else{if(u<o.scrollTop()){o.scrollTop(u)}}}}function g(t){f+=t;if(f<0){f=k.size()-1}else{if(f>=k.size()){f=0}}}function b(t){return e.max&&e.max<t?e.max:t}function d(){o.empty();var u=b(r.length);for(var v=0;v<u;v++){if(!r[v]){continue}var w=e.formatItem(r[v].data,v+1,u,r[v].value,m);if(w===false){continue}var t=a("<li>").html(e.highlight(w,m)).addClass(v%2==0?"ac_event":"ac_odd").appendTo(o)[0];a.data(t,"ac_data",r[v])}k=o.find("li");if(e.selectFirst){k.slice(0,1).addClass(i.ACTIVE);f=0}o.bgiframe()}return{display:function(u,t){n();r=u;m=t;d()},next:function(){h(1)},prev:function(){h(-1)},pageUp:function(){if(f!=0&&f-8<0){h(-f)}else{h(-8)}},pageDown:function(){if(f!=k.size()-1&&f+8>k.size()){h(k.size()-1-f)}else{h(8)}},hide:function(){c&&c.hide();f=-1},visible:function(){return c&&c.is(":visible")},current:function(){return this.visible()&&(k.filter("."+i.ACTIVE)[0]||e.selectFirst&&k[0])},show:function(){var v=a(j).offset();c.css({top:v.top+j.offsetHeight,left:v.left}).show();if(e.scroll){o.scrollTop(0);o.css({maxHeight:e.scrollHeight,overflow:"auto"});if(a.browser.msie&&typeof document.body.style.maxHeight==="undefined"){var t=0;k.each(function(){t+=this.offsetHeight});var u=t>e.scrollHeight;o.css("height",u?e.scrollHeight:t);if(!u){k.width(o.width()-parseInt(k.css("padding-left"),10)-parseInt(k.css("padding-right"),10))}}}},selected:function(){var t=k&&k.filter("."+i.ACTIVE).removeClass(i.ACTIVE);return t&&t.length&&a.data(t[0],"ac_data")},unbind:function(){c&&c.remove()}}};a.Autocompleter.Selection=function(d,e,c){if(d.createTextRange){var b=d.createTextRange();b.collapse(true);b.moveStart("character",e);b.moveEnd("character",c);b.select()}else{if(d.setSelectionRange){d.setSelectionRange(e,c)}else{if(d.selectionStart){d.selectionStart=e;d.selectionEnd=c}}}d.focus()}})(jQuery);tanto.namespace("ndm.controls");validate=ndm.forms.validation.validate;jQuery.fn.nNestTabs=function(a){var b=jQuery.extend({tabList:"ul.tab-list",tabHandle:"li.tab",tabContent:"div.content-item"},a||{});this.each(function(){jQuery(this).find("> "+b.tabList).each(function(){jQuery(this).find(b.tabHandle).each(function(){var c=jQuery(this);var d=jQuery(jQuery(this).find("> a").attr("href"));if(c.hasClass("active")){d.addClass("active")}else{d.removeClass("active")}jQuery(this).find("> a").click(function(){if(jQuery(this).parent().hasClass("active")){}else{jQuery(this).parent().parent().find(b.tabHandle+".active").removeClass("active");jQuery(this).parent().addClass("active");jQuery(jQuery(this).attr("href")).parent().find("> "+b.tabContent+".active").removeClass("active");jQuery(jQuery(this).attr("href")).addClass("active");jQuery(this).parent().parent().parent().parent().find("a[href="+jQuery(this).attr("rel")+"]").click()}return false})})})})};var wego_tscode;_global_["@namespace"]("ndm.newscomau");_global_["@namespace"]("ndm.newscomau.travel.offers");_global_["@namespace"]("ndm.newscomau.travel.bezurk");ndm.newscomau.travel.offers.mergeOject=function(a,d){var b={},c;for(c in a){if(a.hasOwnProperty(c)){b[c]=a[c]}}for(c in d){if(d.hasOwnProperty(c)){b[c]=d[c]}}return b};ndm.newscomau.travel.offers.setup=function(){wego_tscode=document.getElementById("tscode").value;jQuery("div.module-travel-offers").nNestTabs();jQuery("div.module-travel-offers div.content-item").nNestTabs({tabList:".sub-tab-list",tabContent:"div.sub-content-item"});ndm.newscomau.travel.offers.packages();ndm.newscomau.travel.offers.hotels();ndm.newscomau.travel.offers.flights()};ndm.newscomau.travel.offers.flights=function(){var d=document.getElementById("fromEntered");var f=document.getElementById("toEntered");var b=false;var c=false;var a=[];var e=function(){ndm.controls.calendar.create("outboundDatePicker","dd/mm/yy","",14);ndm.controls.calendar.create("inboundDatePicker","dd/mm/yy","",21);ndm.controls.calendar.create("checkinDatePicker","dd/mm/yy","",7);ndm.controls.calendar.create("checkoutDatePicker","dd/mm/yy","",9);a=["fromEntered","toEntered","adults","children","location","numRooms","numGuests"];var i=function(j){ndm.controls.calendar.hideCalendar()};for(var g=0;g<a.length;g++){var h=document.getElementById(a[g]);if(h){ndm.dom.events.add(h,"focus",i)}}jQuery("#pop-calendar").bgIframe()};tanto.load("http://network.news.com.au/js/ndm.controls.calendar.js").oncomplete(e);jQuery("#travel-offers-flight-search-form #fromEntered, #travel-offers-flight-search-form #toEntered").autocomplete("http://www.wego.com/p/flights/locations/search",{dataType:"jsonp",delay:200,minChars:2,matchSubset:false,matchContains:true,extraParams:{format:"jsonp",limit:50},parse:function(m){if(m&&m.r&&m.r.length>0){var j=[];for(var k=0,h=m.r.length;k<h;k++){var g=m.r[k];j[k]={data:g,value:g.id,result:g.fn}}return j}else{return[{data:{fn:"No matching locations"},value:"",result:""}]}},formatItem:function(g){return g.fn}});jQuery("#travel-offers-flight-search-form #fromEntered").result(function(h,j,i,g){jQuery("#from_id").val(j.c)});jQuery("#travel-offers-flight-search-form #toEntered").result(function(h,j,i,g){jQuery("#to_id").val(j.c)})};ndm.newscomau.travel.offers.flightdeals=function(a){var e=document.getElementById("dom-flight-select-destination");var f=document.getElementById("bezurk-flight-offers-insert");var g=0;var h=["CBR","NTL","DRW","ADL","OOL","MCY","CNS","BNE","HBA","PER","MEL"];var d={loadingImage:"http://www.news.com.au/travel/css/images/wego/iconsearch.gif",defaultDept:h,defaultArriv:h,feedURL:"http://vpe.news.com.au/getFeed?",limit:5,cookieName:"travelDefaultDept",cookieExpiry:365,ignoreCookie:false};d=ndm.newscomau.travel.offers.mergeOject(d,a);if(d.ignoreCookie===false){var j=ndm.util.cookies.read(d.cookieName);if(!!j){d.defaultDept=[j];for(g=0;g<e.options.length;g++){if(e.options[g].value==j){e.selectedIndex=g}}}else{Array.prototype.exists=function(i){for(g=0;g<this.length;g++){if(this[g]==i){return true}else{return false}}var k=null;for(g=1;g<e.options.length;g++){if(!h.exists(e.options[g].value)){d.defaultDept=[e.options[g].value];e.selectedIndex=g}}}}var b=function(m){var l='<ul class="offers">';var n="";if(!!m&&!!m.list&&!!m.list.flightDeal){if(!!m.list.flightDeal.length){for(var k=0;k!=m.list.flightDeal.length;k++){n=m.list.flightDeal[k];l+='<li><a href="'+n.offerUrl.replace(/deals.wego.com/,"news.wego.com")+'" rel="track-wego-flight">'+n.originCity+" to "+n.destinationCity+', <span class="price"> $'+n.price+"</span></a> from "+n.airlineName+"</li>"}}else{n=m.list.flightDeal;l+='<li><a href="'+n.offerUrl.replace(/deals.wego.com/,"news.wego.com")+'" rel="track-wego-flight">'+n.originCity+" to "+n.destinationCity+', <span class="price"> $'+n.price+"</span></a> from "+n.airlineName+"</li>"}}else{l+="<li>No current flight offers to the selected city</li>"}l+="</ul>";f.innerHTML=l};var c=this.value;e.onchange=function(){if(!!this.value){f.innerHTML='<img src="'+d.loadingImage+'" alt="loading content" />';ndm.ajax.callbackJSON("http://vpe.news.com.au/getFeed?ts_code="+wego_tscode+"&src=bezurk&subject=flights&dept="+this.value+"&arriv="+d.defaultArriv.join(",")+"&lmt=5&cb=tanto.ajax.callbackHandler",b,false,false);ndm.util.cookies.create(d.cookieName,this.value,d.cookieExpiry)}else{f.innerHTML='<img src="'+d.loadingImage+'" alt="loading content" />';var i=["CBR","NTL","DRW","ADL","OOL","MCY","CNS","BNE","HBA","PER","MEL"];ndm.ajax.callbackJSON("http://vpe.news.com.au/getFeed?ts_code="+wego_tscode+"&src=bezurk&subject=flights&dept="+i.join(",")+"&arriv="+d.defaultArriv.join(",")+"&lmt=5&cb=tanto.ajax.callbackHandler",b,false,false);ndm.util.cookies.create(d.cookieName,this.value,d.cookieExpiry)}};if(!!f){f.innerHTML='<img src="'+d.loadingImage+'" alt="loading content" />';ndm.ajax.callbackJSON(d.feedURL+"ts_code="+wego_tscode+"&src=bezurk&subject=flights&dept="+d.defaultDept.join(",")+"&arriv="+d.defaultArriv.join(",")+"&lmt="+d.limit+"&cb=tanto.ajax.callbackHandler",b,false,false)}}};ndm.newscomau.travel.offers.hotels=function(b){var a=false;var c=document.getElementById("location");var d=document.getElementById("travel-offers-hotel-search-form");jQuery("#travel-offers-hotel-search-form #location").autocomplete("http://www.wego.com/hotels/locations/search",{dataType:"jsonp",delay:200,minChars:2,matchSubset:false,matchContains:true,extraParams:{format:"jsonp",limit:50},parse:function(j){if(j&&j.r&&j.r.length>0){var g=[];for(var h=0,f=j.r.length;h<f;h++){var e=j.r[h];g[h]={data:e,value:e.id,result:e.fn}}return g}else{return[{data:{fn:"No matching locations"},value:"",result:""}]}},formatItem:function(e){return e.fn}});jQuery("#travel-offers-hotel-search-form #location").result(function(f,h,g,e){jQuery("#location_id").val(h.id)})};ndm.newscomau.travel.offers.hoteldeals=function(c){var b={defaultLoct:["AU"],loadingImage:"http://www.news.com.au/travel/css/images/wego/iconsearch.gif",limit:5,feedURL:"http://vpe.news.com.au/getFeed?"};b=ndm.newscomau.travel.offers.mergeOject(b,c);var a=document.getElementById("travel-offers-hotel-offers-insert");var d=function(g){var f='<ul class="offers">';var h="";if(!!g&&!!g.list&&!!g.list.hotelDeal){if(!!g.list.hotelDeal.length){for(var e=0;e!=g.list.hotelDeal.length;e++){h=g.list.hotelDeal[e];f+="<li>"+h.city+',  <a href="'+h.offerUrl.replace(/deals.wego.com/,"news.wego.com")+'" rel="track-wego-hotel">'+h.propertyName+', <span class="price"> $'+h.price+"</span></a></li>"}}else{h=g.list.hotelDeal;f+='<li><a href="'+h.offerUrl.replace(/deals.wego.com/,"news.wego.com")+'" rel="track-wego-hotel">'+h.city+", "+h.propertyName+', <span class="price"> $'+h.price+"</span></a></li>"}}else{f+="<li>No current hotel offers to the selected city</li>"}f+="</ul>";a.innerHTML=f};if(!!a){a.innerHTML='<img src="'+b.loadingImage+'" alt="loading content" />';ndm.ajax.callbackJSON(b.feedURL+"ts_code="+wego_tscode+"&src=bezurk&subject=hotels&loct="+b.defaultLoct.join(",")+"&lmt="+b.limit+"&cb=tanto.ajax.callbackHandler",d,false,false)}};ndm.newscomau.travel.offers.packages=function(){jQuery("#travel-offers-package-search-form #packageFrom, #travel-offers-package-search-form #packageTo").autocomplete("http://www.wego.com/hotels/locations/search",{dataType:"jsonp",delay:200,minChars:2,matchSubset:false,matchContains:true,extraParams:{format:"jsonp",limit:50},parse:function(e){if(e&&e.r&&e.r.length>0){var c=[];for(var d=0,b=e.r.length;d<b;d++){var a=e.r[d];c[d]={data:a,value:a.id,result:a.fn}}return c}else{return[{data:{fn:"No matching locations"},value:"",result:""}]}},formatItem:function(a){return a.fn}});jQuery("#travel-offers-package-search-form #packageFrom").result(function(b,d,c,a){jQuery("#packageFromHidden").val(d.c)});jQuery("#travel-offers-package-search-form #packageTo").result(function(b,d,c,a){jQuery("#packageToHidden").val(d.c)})};ndm.newscomau.travel.offers.travelValidate=function(b){var k=false,a=false,i,h,e,j,d="",g=null,c,f;a=validate(b);if(b.id=="travel-offers-flight-search-form"){i=document.getElementById("outboundDatePicker").value;h=document.getElementById("inboundDatePicker").value;if(i.length>0&&h.length>0){date1_arr=i.split("/");j=h.split("/");i=new Date("20"+date1_arr[2],date1_arr[1]-1,date1_arr[0]);h=new Date("20"+j[2],j[1]-1,j[0]);if(i>=h){d="Departure date cannot be after return date<br />"}else{if(i<new Date()){d="Departure date cannot be in the past<br />"}else{if(h<=i){d="Return date cannot be before return date<br />"}}}}else{d="Please enter missing dates<br />"}}else{if(b.id=="travel-offers-hotel-search-form"){i=document.getElementById("checkinDatePicker").value;h=document.getElementById("checkoutDatePicker").value;if(i.length>0&&h.length>0){date1_arr=i.split("/");j=h.split("/");i=new Date("20"+date1_arr[2],date1_arr[1]-1,date1_arr[0]);h=new Date("20"+j[2],j[1]-1,j[0]);if(i>=h){d="Check-in date cannot be after or equal to check-out date<br />"}else{if(i<new Date()){d="Check-in date cannot be in the past<br />"}else{if(h<=i){d="Check-out date cannot be before check-in date<br />"}}}}else{d="Please enter missing dates<br />"}}}if(d.length>0){if(!document.getElementById("single-error")){g=document.createElement("p");g.className="error";g.id="single-error"}else{g=document.getElementById("single-error");g.innerHTML=""}g.innerHTML=g.innerHTML+d;g.style.color="#000000";f=b.getElementsByTagName("fieldset")[0];if(f){formErrorLegend=f.getElementsByTagName("legend")[0];if(formErrorLegend){if(f.className.indexOf("error-parent")>=0){formErrorLegend.innerHTML=out;formErrorLegend.id="single-error";formErrorLegend.className+=" error"}}else{if(f.className.indexOf("error-parent")>=0){f.insertBefore(g,f.firstChild);c=new ndm.controls.ColorTween(g.style,"color",ndm.controls.Tween.functors.easeInOutQuad,"000000","D40303",0.5);c.start()}else{b.insertBefore(g,b.firstChild);c=new ndm.controls.ColorTween(g.style,"color",ndm.controls.Tween.functors.easeInOutQuad,"000000","D40303",0.5);c.start()}}}else{b.insertBefore(g,b.firstChild);c=new ndm.controls.ColorTween(g.style,"color",ndm.controls.Tween.functors.easeInOutQuad,"000000","D40303",0.5);c.start()}return false}else{if(a){return true}else{return false}}return false};ndm.newscomau.travel.offers.packagedeals=function(d){var e=document.getElementById("packageFrom");var b=document.getElementById("packageTo");var c={defaultLoct:["AU"],loadingImage:"http://www.news.com.au/travel/css/images/wego/iconsearch.gif",limit:5,feedURL:"http://10.68.201.19:8080/thirdpartycontent/getFeed?"};c=ndm.newscomau.travel.offers.mergeOject(c,d);var a=document.getElementById("travel-offers-package-offers-insert");var f=function(j){var h='<ul class="offers">';var k="";if(!!j&&!!j.deals){if(!!j.deals.length){for(var g=0;g!=j.deals.length;g++){k=j.deals[g];h+='<li><a href="'+k["offer-url"].replace(/deals.wego.com/,"news.wego.com")+'" rel="track-wego-package">'+k.headline+' from <span class="price">'+k["currency-code"]+" "+k.price+"</span></a></li>"}}else{k=j.deals.package_deal;h+='<li><a href="'+k["offer-url"].replace(/deals.wego.com/,"news.wego.com")+'" rel="track-wego-package">'+k.headline+' from <span class="price">'+k["currency-code"]+" "+k.price+"</span></a></li>"}}else{h+="<li>No current package offers to the selected city</li>"}h+="</ul>";a.innerHTML=h};if(!!a){a.innerHTML='<img src="'+c.loadingImage+'" alt="loading content" />';ndm.ajax.callbackJSON("http://vpe.news.com.au/getFeed?ts_code="+wego_tscode+"&src=bezurk&subject=packages&target=AU&lmt="+c.limit+"&cb=tanto.ajax.callbackHandler",f,false,false)}};ndm.newscomau.travel.bezurk.offers=function(){var g=document.getElementById("bezurk-domestic-offers");var a=document.getElementById("bezurk-international-offers");var d=["CBR","NTL","DRW","ADL","OOL","MCY","CNS","BNE","HBA","PER","MEL"];var f=function(n){var m='<ul class="offers">';if(!!n&&!!n.list&&!!n.list.flightDeal&&n.list.flightDeal.length!==0){if(!!n.list.flightDeal.length){for(var l=0;l!=n.list.flightDeal.length;l++){deal=n.list.flightDeal[l];m+='<li><a href="'+deal.offerUrl.replace(/deals.wego.com/,"news.wego.com")+'">'+deal.originCity+" to "+deal.destinationCity+', <span class="price"> $'+deal.price+"</span></a> from "+deal.airlineName+"</li>";if(l===3){break}}}else{deal=n.list.flightDeal;m+='<li><a href="'+deal.offerUrl.replace(/deals.wego.com/,"news.wego.com")+'">'+deal.originCity+" to "+deal.destinationCity+', <span class="price"> $'+deal.price+"</span></a> from "+deal.airlineName+"</li>"}m+="</ul>";g.innerHTML=m}else{g.innerHTML='<ul class="offers"><li>No current flight offers to the selected city</li></ul>'}};var b=function(n){var m='<ul class="offers">';if(!!n&&!!n.list&&!!n.list.flightDeal){if(!!n.list.flightDeal.length){for(var l=0;l!=n.list.flightDeal.length;l++){deal=n.list.flightDeal[l];m+='<li><a href="'+deal.offerUrl.replace(/deals.wego.com/,"news.wego.com")+'">'+deal.originCity+" to "+deal.destinationCity+', <span class="price"> $'+deal.price+"</span></a> from "+deal.airlineName+"</li>";if(l===3){break}}}else{deal=n.list.flightDeal;m+='<li><a href="'+deal.offerUrl.replace(/deals.wego.com/,"news.wego.com")+'">'+deal.originCity+" to "+deal.destinationCity+', <span class="price"> $'+deal.price+"</span></a> from "+deal.airlineName+"</li>"}m+="</ul>";a.innerHTML=m}else{a.innerHTML='<ul class="offers"><li>No current flight offers to the selected city</li></ul>'}};var h=document.getElementById("bezurk-international-selector");if(!!h){h.onchange=function(i){if(this.value.toLowerCase().indexOf("more")>=0){window.location.href="http://travelsearch.news.com.au/";return false}var l=this.value;a.innerHTML='<div class="js-loading-flight-deal" style=height:110px;width:324px;background:#fff;"><img style="margin:30px 0 30px 152px;" src="/travel/css/images/activitytransparent.gif"  alt="loading"/></div>';ndm.ajax.callbackJSON("http://vpe.news.com.au/getFeed?ts_code="+wego_tscode+"&src=bezurk&subject=flights&dept=AU&arriv="+l+"&lmt=3&cb=tanto.ajax.callbackHandler",b,false,true)}}var k=[];var j;for(var c=0;c<h.options.length;++c){j=h.options[c].value;if(!!j&&j.length==3){k.push(j)}}var e=document.getElementById("bezurk-domestic-selector");if(!!e){e.onchange=function(i){if(this.value.toLowerCase().indexOf("more")>=0){window.location.href="http://travelsearch.news.com.au/";return false}var l=this.value;if(this.selectedIndex===0){l="AU"}g.innerHTML='<div class="js-loading-flight-deal" style=height:110px;width:324px;background:#fff;"><img style="margin:30px 0 30px 152px;" src="/travel/css/images/activitytransparent.gif"  alt="loading"/></div>';ndm.ajax.callbackJSON("http://vpe.news.com.au/getFeed?ts_code="+wego_tscode+"&src=bezurk&subject=flights&dept="+d.join(",")+"&arriv="+l+"&lmt=3&cb=tanto.ajax.callbackHandler",f,false,true)}}if(!!h&&!!e){ndm.ajax.callbackJSON("http://vpe.news.com.au/getFeed?ts_code="+wego_tscode+"&src=bezurk&subject=flights&dept="+d.join(",")+"&arriv="+d.join(",")+"&lmt=3&cb=tanto.ajax.callbackHandler",f,false,true);ndm.ajax.callbackJSON("http://vpe.news.com.au/getFeed?ts_code="+wego_tscode+"&src=bezurk&subject=flights&dept="+d.join(",")+"&arriv="+k.join(",")+"&lmt=3&cb=tanto.ajax.callbackHandler",b,false,true)}};_global_["@namespace"]("ndm.newscomau.travel.godo");ndm.newscomau.travel.godo.hotActivities=function(a){var e=document.getElementById(a.insertId);var m=document.getElementById(a.selectId);var c=document.getElementById(a.containerId);var d=document.getElementById(a.buttonId);var o=c.getElementsByTagName("H2")[0]||null;var j=o.innerHTML;var i=a.displayNum;var h="http://travelactivities.news.com.au";var k="http://vpe.news.com.au/getFeed?src=godo&subject=activity&category=10";var b,g;var l=function(r){if(!r){return false}m.className=m.className.replace(/over/gi,"");o.innerHTML=j;var q="";for(var p=0;p!=i;p++){q+='<li><a target="_blank" href="'+h+r.productList.products[p].productUrl+'"><strong>'+r.productList.products[p].region+"</strong> "+r.productList.products[p].subcategory+"<span>$"+r.productList.products[p].maxPrice+"</span></a></li>"}e.innerHTML=q};var f=function(){e.innerHTML='<div style="width:297px;height:68px;text-align:centre;"><img style="margin:25px 0 0 125px;" src="/travel/css/images/activity3a6085.gif" alt="loading content" /></div>';ndm.ajax.callbackJSON(b,l,false,true)};var n=function(p){b=k+"&cb=tanto.ajax.callbackHandler&state="+p};m.onchange=function(){n(this.value)};d.onclick=function(){f()};n(m.value);f()};ndm.dom.addLoadEvent(function(){ndm.newscomau.travel.godo.hotActivities({selectId:"godo-state",buttonId:"godo-btn",containerId:"hot-activities",insertId:"godo-list",linksId:"godo-states",displayNum:3})},function(){return !!document.getElementById("hot-activities")},function(){return true});ndm.dom.addLoadEvent(function(){var a=ndm.controls.carousel.Standard({viewportWidth:"648",unitWidth:"162",increment:"2",sliderWidth:"618"})},function(){return !!document.getElementById("carousel-viewport")},function(){return true});ndm.dom.addLoadEvent(function(){document.getElementById("city-guides-select").onchange=function(){document.getElementById("download-guide-link").href=this.value}},function(){return !!document.getElementById("download-guide-link")},function(){return true});ndm.dom.addLoadEvent(function(){ndm.newscomau.travel.bezurk.offers()},function(){return !!(document.getElementById("international-flights")&&document.getElementById("domestic-flights"))},function(){return true});ndm.dom.addLoadEvent(function(){if(document.getElementById("travel-offers-flight-search-form")){var a=document.getElementById("travel-offers-flight-search-form");a.onsubmit=function(){return ndm.newscomau.travel.offers.travelValidate(a)}}},function(){return true});ndm.dom.addLoadEvent(function(){if(document.getElementById("travel-offers-hotel-search-form")){var a=document.getElementById("travel-offers-hotel-search-form");a.onsubmit=function(){return ndm.newscomau.travel.offers.travelValidate(a)}}},function(){return true});ndm.dom.addLoadEvent(function(){if(document.getElementById("wegoFlightTab")){if(ndm.newscomau.travel.offers.defaultTab){jQuery("#wegoFlightTab").addClass("active");jQuery("#wegoSearchTab").removeClass("active")}tanto.load("http://network.news.com.au/js/ndm.util.cookies.js").oncomplete(function(){ndm.newscomau.travel.offers.setup();if(!ndm.newscomau.travel.offers.defaultArriv){ndm.newscomau.travel.offers.flightdeals()}else{ndm.newscomau.travel.offers.flightdeals({defaultArriv:ndm.newscomau.travel.offers.defaultArriv})}if(!ndm.newscomau.travel.offers.defaultLoct){ndm.newscomau.travel.offers.hoteldeals()}else{ndm.newscomau.travel.offers.hoteldeals({defaultLoct:ndm.newscomau.travel.offers.defaultLoct})}ndm.newscomau.travel.offers.packagedeals()})}},function(){return true});ndm.newscomau.mediasearch.options.correctorder=true;ndm.utils.delegateinit.popmenu("#nav #nav-wrap ul li",{parentHoverClass:"js-hover",additionalHoverClassRegex:/nav-[0-9a-z\-_]*/g,showTimer:20,hideTimer:10});jQuery(document).ready(function(){jQuery("body").nJSClassReset();jQuery("div.flash-embed[class*='text-m-diva']").diva();if(jQuery("#story div.group.diva").length){if(jQuery("#comments").length){jQuery("#comments").before(jQuery("body.story #story div.group.diva"))}else{jQuery("#story .story-footer").after(jQuery("body.story #story div.group.diva"))}jQuery("#story").addClass("js-story-diva-ready")}jQuery("#nav-wrap ul li").nPopMenu({parentHoverClass:"js-hover",additionalHoverClassRegex:/(nav-[0-9a-z\-_]*)/g});jQuery(".js-popmenu").nPopMenu();jQuery(".js-popmenu-parent").nPopMenu();jQuery(".story-header-tools li.button-share").nPopMenu();jQuery(".js-accordion").nAccordion();jQuery("#story .js-fader").nFader({preserveImageSize:true});jQuery(".js-fader").nFader({preserveImageSize:true,automatic:true});jQuery(".js-story-fader").nStoryFader({auto:true});jQuery(".js-story-scroller").nStoryFader({auto:true,animationType:"scroll",contentItem:".js-scroller-item",controls:".js-scroller-controls",next:".js-scroller-next",prev:".js-scroller-prev",counter:".js-scroller-counter"});jQuery(".js-tabbed").nTabs({uniformHeight:true});jQuery(".js-scroller").nScroller({autoHeight:true});jQuery(".js-font-inc").nFontResizer();jQuery(".js-font-dec").nFontResizer({step:-1});jQuery(".js-clickable-content").nClickableContent();jQuery("#section-header-nav dd").hover(function(){jQuery(this).addClass("js-hover")},function(){jQuery(this).removeClass("js-hover")});poll.init();ndm.controls.popups.listen()});
