function popWindow(d,b,c){var a;a=window.open(d,b,c);a.focus()}function IsIE(){return(navigator.appName=="Microsoft Internet Explorer")}function cantUseLayers(){return((document.layers)?1:0)}function MM_findObj(f,e){var c,b,a;if(!e){e=document}if((c=f.indexOf("?"))>0&&parent.frames.length){e=parent.frames[f.substring(c+1)].document;f=f.substring(0,c)}if(!(a=e[f])&&e.all){a=e.all[f]}for(b=0;!a&&b<e.forms.length;b++){a=e.forms[b][f]}for(b=0;!a&&e.layers&&b<e.layers.length;b++){a=MM_findObj(f,e.layers[b].document)}if(!a&&e.getElementById){a=e.getElementById(f)}return a}function renderFlashObject(d,g,b,e){var a="";var c=getFlashVersion();var f="";if(c==6){}else{f="wmode='transparent'"}if(IEVersion!="7"&&IEVersion!="6"&&IEVersion!="8"){a+="<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'";a+="codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0'";a+="WIDTH='"+b+"' HEIGHT='"+e+"' id='nz route map8' ALIGN='' "+f+"'>";a+="<PARAM NAME=movie VALUE='/"+g+"/images/flash/"+d+"'>";a+="<PARAM NAME=quality VALUE='high'>";a+="<PARAM NAME=bgcolor VALUE='#FFFFFF'>";a+="<EMBED "+f+"' src='/"+g+"/images/flash/"+d+"' quality=high bgcolor=#FFFFFF  WIDTH='"+b+"' HEIGHT='"+e+"' NAME='nz_route_map' ALIGN=''";a+="TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/go/getflashplayer'></EMBED>";a+="</OBJECT>"}else{a+="<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' width='"+b+"' height='"+e+"'>";a+="  <param name='movie' VALUE='/"+g+"/images/flash/"+d+"'>";a+="  <param name='quality' value='high'>";a+="  <param name='wmode' value='transparent'>";a+="  <embed src='/"+g+"/images/flash/"+d+"' width='"+b+"' height='"+e+"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' wmode='window' scale='exactfit' PLUGINSPAGE='http://www.macromedia.com/go/getflashplayer'></embed>";a+="</OBJECT>"}document.write(a)}function getFlashVersion(){var a=false;var b=new MM_FlashInfo();if(b.installed){if(b.version){return b.version}}return -1}var bookingScenario="scenario_normal";var iTD;var defaultGoSite="nzairnz01";var erequestURL="http://erequest.airnz.co.nz/nz/";var isPDA=false;var strNav=navigator.userAgent;var isCE=strNav.indexOf("Windows CE");if(isCE!=-1){isPDA=true}isCE=strNav.indexOf("240x320");if(isCE!=-1){isPDA=true}var DM="We are sorry, but we cannot accept online bookings from Pocket PC's at this time.\n\nPlease call\nAir New Zealand Reservations on\n";var nzpdamessage=DM+"0800 737 000";var aupdamessage=DM+"13 24 76";var formIndexGetThere=1;var formIndexiTD=2;var formNames=["frmGetThere","frmiTD"];var fieldTypeText="text";var fieldTypeSelect="select";var dDate=new Date();var monthOffset=(dDate.getMonth());var serviceClassesGetThere=[["coach","Economy - lowest"],["coach","Economy"],["business","Business"]];var serviceClassesGetTherePremium=[["coach","Economy - lowest"],["coach","Economy"],["coach","Premium Economy"],["business","Business"]];var serviceClassesiTD=[["smartsaver","Lowest Available"],["flexisaver","Flexi Saver Fare"],["fullyflexi","Flexi Fare"]];var serviceClassesiTDtasman=[["smartsaver","Lowest Available"],["flexisaver","Flexi Saver"],["fullyflexi","Flexi"],["business","Business Class"]];var arrMonths=[["JAN","1"],["FEB","2"],["MAR","3"],["APR","4"],["MAY","5"],["JUN","6"],["JUL","7"],["AUG","8"],["SEP","9"],["OCT","10"],["NOV","11"],["DEC","12"]];function popNoAPD(a){var d;var c=new Date();var b=new Date(2004,10,16,0,0,0);if(b.valueOf()<=c.valueOf()){d=window.open("http://erequest.airnz.co.nz/booking_support/noapd_"+a+".htm","noapd","scrollbars=no,resizable=no,toolbar=no,location=no,menubar=no,status=no,height=260,width=345")}}function checkPromoCode(){if(document.getElementById("flightsRadio")){if(document.getElementById("flightsRadio").checked){if(document.getElementById("promoCodeFFF")){setPromoCode(document.getElementById("promoCodeFFF").value)}else{setPromoCode("")}}else{if(document.getElementById("hotelsRadio")&&document.getElementById("hotelsRadio").checked){if(document.getElementById("promoCodeHotel")){setPromoCode(document.getElementById("promoCodeHotel").value)}else{setPromoCode("")}}else{if(document.getElementById("holidaysRadio")&&document.getElementById("holidaysRadio").checked){if(document.getElementById("promoCodeOLH")){setPromoCode(document.getElementById("promoCodeOLH").value)}else{setPromoCode("")}}}}}else{if(document.getElementById("promoCodeFFF")){setPromoCode(document.getElementById("promoCodeFFF").value)}else{setPromoCode("")}}}function setPromoCode(a){if(document.getElementById("s_promoCode")){document.getElementById("s_promoCode").value=a}}function SendToFD(L,aq,ap,ao,an,ak,aj,ai,ag,af,ac,ab,aa,Z,X,W,V,U,ad){checkPromoCode();checkHotelPackage();if(L=="1"){var S=aq;var s=window.open("about:blank","booking","","");s.focus();if(S=="h_"){document.getElementById("prefix").value="h_"}try{if(isKioskBooking){document.getElementById("finder_type").value="FFFAgent"}}catch(B){}document.getElementById("FFFsendForm").action=SendString;document.getElementById("FFFsendForm").submit()}if(L=="2"){var y=aq;if(y=="VO"){var ah=ap;var A=ao;var K=getLocale();SendString=SendStringORG;SendString=SendString+"?engine="+y;SendString=SendString+"&finder_type=BNPP";SendString=SendString+"&locale="+K;SendString=SendString+"&cityPair="+ah;SendString=SendString+"&programId="+A}else{var J=ap;var v=ao;var Y=an;var O=ak.split("/");var al=aj.split("/");var C=ai;var P=ag;var ar=af;var w=ac;var G=ab;var u=aa;var ah=Z;var A=X;var K=getLocale();var r;var am;var F=O[0];var z=O[1];var N=O[2];var M;var T;var x=al[0];var ae=al[1];var H=al[2];if(N&&z&&F){var R=new Date();R.setFullYear(N,z-1,F);var t=new Date();if(t>R){R=t;R.setDate(R.getDate()+1);N=R.getFullYear();z=R.getMonth();F=R.getDate()}r=R.getDate();am=R.getFullYear()+"-"+parseInt(R.getMonth()+1);if(J=="return"&&(!H||!ae||!x)){var I=new Date();I.setDate(R.getDate());I.setMonth(R.getMonth());I.setYear(R.getFullYear());I.setDate(I.getDate()+1);M=I.getDate();T=I.getFullYear()+"-"+parseInt(I.getMonth()+1)}else{if(J=="return"){M=x;T=H+"-"+ae}}}SendString=SendStringORG;SendString=SendString+"?engine="+y;SendString=SendString+"&finder_type=BNPP";SendString=SendString+"&locale="+K;SendString=SendString+"&fare_type="+J;if(typeof(v)!="undefined"||v==""){SendString=SendString+"&depart_loc="+v}if(typeof(Y)!="undefined"||Y==""){SendString=SendString+"&arrival_loc="+Y}if(typeof(r)!="undefined"||r==""){SendString=SendString+"&depart_date="+r}if(typeof(am)!="undefined"||am==""){SendString=SendString+"&depart_yearmonth="+am}if(typeof(M)!="undefined"||M==""){SendString=SendString+"&arrival_date="+M}if(typeof(T)!="undefined"||T==""){SendString=SendString+"&arrival_yearmonth="+T}if(typeof(w)!="undefined"||w==""){SendString=SendString+"&adults="+w}if(typeof(G)!="undefined"||G==""){SendString=SendString+"&children="+G}if(typeof(u)!="undefined"||u==""){SendString=SendString+"&infants="+u}if(typeof(C)!="undefined"||C==""){SendString=SendString+"&service_class="+C}if(typeof(P)!="undefined"||P==""){SendString=SendString+"&searchType="+P}if(typeof(ar)!="undefined"||ar==""){SendString=SendString+"&iata="+ar}if(typeof(ad)!="undefined"||ad==""){SendString=SendString+"&promoCode="+ad}}var s=window.open("about:blank","ISISbooking","","");s.focus();document.getElementById("BNPP").action=SendString;document.getElementById("BNPP").submit()}if(L=="3"){var J=aq;var v=ap;var Y=ao;var Q=an;var D=ak;var K=getLocale();SendString=SendStringORG;SendString=SendString+"?finder_type=FFF";SendString=SendString+"&locale="+K;SendString=SendString+"&fare_type="+J;SendString=SendString+"&depart_loc="+v;SendString=SendString+"&arrival_loc="+Y;var s=window.open("about:blank","ISISbooking","","");s.focus();document.getElementById("BNPP").action=SendString;document.getElementById("BNPP").submit()}}function checkHotelPackage(){if(document.getElementById("holidaysRadio")&&document.getElementById("holidaysRadio").checked){document.getElementById("s_h_depart_loc").value=document.getElementById("h_depart_loc").value;document.getElementById("s_h_arrival_loc").value=document.getElementById("h_arrival_loc").value;document.getElementById("s_h_depart_date").value=document.getElementById("h_depart_date").value;document.getElementById("s_h_depart_yearmonth").value=document.getElementById("h_depart_yearmonth").value;document.getElementById("s_h_arrival_date").value=document.getElementById("h_arrival_date").value;document.getElementById("s_h_arrival_yearmonth").value=document.getElementById("h_arrival_yearmonth").value;document.getElementById("s_numOfNights").value=document.getElementById("h_numOfNights").value;document.getElementById("s_numOfTravellers").value=document.getElementById("h_numOfTravellers").value;document.getElementById("s_ageOfChild_1").value=document.getElementById("h_ageOfChild_1").value;document.getElementById("s_ageOfChild_2").value=document.getElementById("h_ageOfChild_2").value;document.getElementById("s_ageOfChild_3").value=document.getElementById("h_ageOfChild_3").value;document.getElementById("s_ageOfChild_4").value=document.getElementById("h_ageOfChild_4").value;document.getElementById("s_ageOfChild_5").value=document.getElementById("h_ageOfChild_5").value}else{if(document.getElementById("hotelsRadio")&&document.getElementById("hotelsRadio").checked){document.getElementById("s_h_depart_loc").value="";document.getElementById("s_h_arrival_loc").value=document.getElementById("hh_arrival_loc").value;document.getElementById("s_h_depart_date").value=document.getElementById("hh_depart_date").value;document.getElementById("s_h_depart_yearmonth").value=document.getElementById("hh_depart_yearmonth").value;document.getElementById("s_h_arrival_date").value=document.getElementById("hh_arrival_date").value;document.getElementById("s_h_arrival_yearmonth").value=document.getElementById("hh_arrival_yearmonth").value;document.getElementById("s_numOfNights").value=document.getElementById("hh_numOfNights").value;document.getElementById("s_numOfTravellers").value=document.getElementById("hh_numOfTravellers").value;document.getElementById("s_ageOfChild_1").value=document.getElementById("hh_ageOfChild_1").value;document.getElementById("s_ageOfChild_2").value=document.getElementById("hh_ageOfChild_2").value;document.getElementById("s_ageOfChild_3").value=document.getElementById("hh_ageOfChild_3").value;document.getElementById("s_ageOfChild_4").value=document.getElementById("hh_ageOfChild_4").value;document.getElementById("s_ageOfChild_5").value=document.getElementById("hh_ageOfChild_5").value;document.getElementById("finder_type").value="OLH-H01"}}}iehover=function(){if(navigator.userAgent.toLowerCase().indexOf("msie")==-1){return}var b=document.getElementById("topNavContainer");if(b){var f=b.getElementsByTagName("li");for(var d=0;d<f.length;d++){var a=f[d];if(a.className.indexOf("navTop")>-1){a.onmouseover=function(){this.className+=" csshover"};a.onmouseout=function(){this.className=this.className.replace(" csshover","")};var c=a.getElementsByTagName("ul")[0];if(c){var e=document.createElement("iframe");e.src="about:blank";e.style.height=(c.offsetHeight)+"px";e.style.width=(c.offsetWidth)+"px";a.appendChild(e);e.style.zIndex=2;c.style.zIndex=3;if(d==0){}}}}}};if(window.attachEvent){window.attachEvent("onload",iehover)}var cookieName="surveyCookie";var cookieExpiry=60;this.regionalDomains=[["New Zealand","airnz.co.nz","airnewzealand.co.nz","www.airnz.co.nz","www.airnewzealand.co.nz"],["Australia","airnz.com.au","airnewzealand.com.au","www.airnz.com.au","www.airnewzealand.com.au"],["Singapore","airnz.com.sg","airnewzealand.com.sg","www.airnz.com.sg","www.airnewzealand.com.sg"],["Japan EN","jp.airnz.com","jp.airnewzealand.com","www.jp.airnz.com","www.jp.airnewzealand.com"],["Japan JP","airnz.co.jp","www.airnz.co.jp"],["Hong Kong","airnz.com.hk","www.airnz.com.hk","airnewzealand.com.hk","www.airnewzealand.com.hk"],["Canada","ca.airnz.com","www.ca.airnz.com","ca.airnewzealand.com","www.ca.airnewzealand.com"],["UK","airnz.co.uk","www.airnz.co.uk","airnewzealand.co.uk","www.airnewzealand.co.uk"],["PI","pi.airnz.com","www.pi.airnz.com","pacificislands.airnz.com","www.pacificislands.airnz.com","pacificislands.airnewzealand.com","www.pacificislands.airnewzealand.com","www.pi.airnewzealand.com"],["EU","eu.airnz.com","www.eu.airnz.com","eu.airnewzealand.com","www.eu.airnewzealand.com"],["CN","cn.airnz.com","cn.airnewzealand.com","www.cn.airnz.com","www.cn.airnewzealand.com"],["TW","tw.airnz.com","tw.airnewzealand.com","www.tw.airnz.com","www.tw.airnewzealand.com"],["RW","www.rw.airnewzealand.com"],["USA","airnz.com","www.airnz.com","airnewzealand.com","www.airnewzealand.com"]];this.regionalSurveyStats=[["New Zealand",0],["Australia",0],["Singapore",0],["Japan EN",0],["Japan JP",0],["Hong Kong",0],["Canada",0],["UK",0],["USA",0]];this.regionalSurveyURLs=[["New Zealand","http://airnz.terabyte.co.nz/survey.aspx?id=1"],["Australia","http://airnz.terabyte.co.nz/survey.aspx?id=2"],["Singapore","http://airnz.terabyte.co.nz/survey.aspx?id=5"],["Japan EN","http://airnz.terabyte.co.nz/survey.aspx?id=4"],["Japan JP","http://airnz.terabyte.co.nz/survey.aspx?id=9"],["Hong Kong","http://airnz.terabyte.co.nz/survey.aspx?id=3"],["UK","http://airnz.terabyte.co.nz/survey.aspx?id=6"],["Canada","http://airnz.terabyte.co.nz/survey.aspx?id=8"],["USA","http://airnz.terabyte.co.nz/survey.aspx?id=7"]];function doSurvey(){var a=getRegion(location.hostname);if(readCookie(cookieName)==null&&isSelected(a)){writeCookie(cookieName,cookieExpiry);popupSurvey(a)}}function popupSurvey(g){var c="www.airnz.co.nz/noRegionFound.htm";for(var d=0;d<this.regionalSurveyURLs.length;d++){if(g==this.regionalSurveyURLs[d][0]){c=this.regionalSurveyURLs[d][1];break}}var b;var f=565;var e=500;var a=screen.availWidth/2-f/2;var h=screen.availHeight/2-e/2;b=window.open(c,"AirNZSurvey","left="+a+",top="+h+",scrollbars=yes,resizeable=no,width="+f+",height="+e);b.blur();window.focus}function isSelected(c){if(location.href.indexOf("http://www.airnewzealand.com/gateway.jsp?mode=select")!=-1){return false}var a=0;for(var b=0;b<this.regionalSurveyStats.length;b++){if(c==this.regionalSurveyStats[b][0]){a=this.regionalSurveyStats[b][1];break}}if(Math.random()<a){return true}return false}function getRegion(a){for(var c=0;c<this.regionalDomains.length;c++){for(var b=1;b<this.regionalDomains[c].length;b++){if(a.indexOf(this.regionalDomains[c][b])!=-1){return this.regionalDomains[c][0]}}}return""}function writeCookie(b,c){var a=new Date();createCookie(b,a.toGMTString(),c)}function createCookie(c,d,e){if(e){var b=new Date();b.setTime(b.getTime()+(e*24*60*60*1000));var a="; expires="+b.toGMTString()}else{var a=""}document.cookie=c+"="+d+a+"; path=/"}function readCookie(b){var e=b+"=";var a=document.cookie.split(";");for(var d=0;d<a.length;d++){var f=a[d];while(f.charAt(0)==" "){f=f.substring(1,f.length)}if(f.indexOf(e)==0){return f.substring(e.length,f.length)}}return null}var NUM_DOMESTIC=26;function bookiTDNow(a,b){if(isPDA){if(getLocale()=="en_AU"){alert(aupdamessage)}else{alert(nzpdamessage)}}else{winPop=window.open(a,"iTD","toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=808,height=610,left=0,top=0");winPop.focus();if(bookingScenario=="scenario_iTDRedemptionsDown"){popNoAPD(b)}}}var the_dept_city="";var the_dest_city="";var the_fare_type="";var arrMonths=[["JAN","1"],["FEB","2"],["MAR","3"],["APR","4"],["MAY","5"],["JUN","6"],["JUL","7"],["AUG","8"],["SEP","9"],["OCT","10"],["NOV","11"],["DEC","12"]];var serviceClassesGetThere=[["coach","Economy - lowest"],["coach","Economy"],["business","Business"]];function getElm(a){return document.getElementById(a)}var detect=navigator.userAgent.toLowerCase();var browser;function stretch(){var a=0,d=0;var e,g,c;e=getElm("nav2");if(e!=undefined){g=e.getElementsByTagName("ul");c=e.getElementsByTagName("div")}if(g!=undefined){for(var b=0;b<g.length;b++){if(b==0){a=g[b].clientHeight}if(b==1){d=g[b].clientHeight}}}if(c!=undefined){for(var b=0;b<c.length;b++){var h=c[b];if(h!=undefined){a+=h.clientHeight}}}var f=d-a;if(f>0){e.style.paddingBottom=f+"px"}}function initialiseOLSXMLHttp(){var a=false;try{a=new ActiveXObject("Msxml2.XMLHTTP")}catch(c){try{a=new ActiveXObject("Microsoft.XMLHTTP")}catch(b){a=false}}if(!a&&typeof XMLHttpRequest!="undefined"){a=new XMLHttpRequest()}return a}function checkOLS(d){var b=initialiseOLSXMLHttp();if(b){var a=d;b.open("GET",a,false);b.send(null);if(b.status==200){var c=new String();c=b.responseText;if(c.indexOf("down")>0){document.LoginForm.action="https://redirect.airnewzealand.com/redirectweb/servlet/FareDirector?finder_type=OLSLink"}}}}function bookISIS(E,n,q,t,s,o,m,r,v,A,p,u){var J="IS_DO";var I=t;var H=E;var G=n;var F=s+"/"+o+"/"+m;var D="";var C=q;var B=r;var z=v;var y=A;var x=p;var w=u;if(!s&&!o&&!m){F=""}SendToFD("2",J,I,H,G,F,D,C,B,null,y,x,w,null,null,null,null,null,z)}function forgotPass(){var b="";var a;if(document.frmLogin.username.value!=""){b=document.frmLogin.username.value}TempCurrsiteValue=getSiteURL();if(TempCurrsiteValue=="www.airnewzealand.cn"){TempCurrsiteValue="www.cn.airnz.com"}window.location.href="https://registration.airnewzealand.com/spr/challenge_phrase/challenge_phrase.jsp?username="+b+"&currsite="+TempCurrsiteValue};