var keepAliveAlive;var rememberEIW=false;var showEIW=false;if(typeof(keepAliveAlive)=="undefined"){keepAliveAlive=false}function checkLoadArray(nocheck){var count=afterLoadArray.length;var cmd;for(i=0;i<count;i++){cmd=afterLoadArray[i];eval(cmd)}}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}function readGetParam(b){b=b.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var a="[\\?&]"+b+"(=([^&#]*)){0,1}";var d=new RegExp(a);var c=d.exec(window.location.href);if(c==null){return""}else{return c[1]}}function loadEIW(a){var b=readCookie("showeiw");var c=readGetParam("noeiw");if(b==null&&c==""){fb.start(a,{roundCorners:"all",cornerRadius:8,outerBorder:0,innerBorder:0,width:500,height:280,outsideClickCloses:false,controlsPos:"tr",color:"custom",panelPadding:5,padding:0,overlayOpacity:90,afterBoxEnd:setEIWCookie})}}function setEIWCookie(){if(rememberEIW){var a=new Date();a.setDate(a.getDate()+14);document.cookie="showeiw="+showEIW+"; expires="+a.toUTCString()}if(showEIW){document.location.reload(true)}}function changeEIWState(a){rememberEIW=a.checked}function changeshowEIW(a){showEIW=a}function prepareDealFilterSorting(){hasSelectOrigin=true;hasSelectDestination=true;hasSortOptions=true;selectOrigin=document.getElementById("origin");selectDestination=document.getElementById("destination");selectSort=document.getElementById("sort");if(selectOrigin!=null){selectOrigin.onchange=function(){applyDealFilter(false)}}else{hasSelectOrigin=false}if(selectDestination!=null){selectDestination.onchange=function(){applyDealFilter(false)}}else{hasSelectDestination=false}if(selectSort!=null){selectSort.onchange=function(){var a=this.options[this.selectedIndex];if(a.value!=""){applyDealFilter(false)}}}else{hasSortOptions=false}}function applyDealFilter(a){var c;var d;var e;var k="";var j="";var l="htt[p|s]://[^/]*/([^/?]*)";var h=new RegExp(l,"i");var m=h.exec(window.location.href);var f=m[1].toLowerCase();l="(stage=stage|stage=live)";h=new RegExp(l,"i");m=h.exec(window.location.search.substring(1));if(m!=null){j="?"+m[1]}if(hasSelectOrigin){c=encodeURIComponent(selectOrigin.options[selectOrigin.selectedIndex].value).replace("%2F","%252F")}else{c=""}if(hasSelectDestination){d=encodeURIComponent(selectDestination.options[selectDestination.selectedIndex].value).replace("%2F","%252F")}else{d=""}if(hasSortOptions){e=encodeURIComponent(selectSort.options[selectSort.selectedIndex].value).replace("%2F","%252F")}else{e=""}if(f=="flight-deals"||f=="airfare-deals"||f=="stopover-options"){if(c!=""&&d!=""){k="/flights-from-"+c+"-to-"+d}else{if(d!=""&&d!=""){k="/flights-to-"+d}else{if(c!=""){k="/"+c}}}}else{if(f=="holiday-packages"||f=="vacation-packages"){if(c!=""&&d!=""){k="/ex-"+c+"/holidays-in-"+d}else{if(d!=""){k="/holidays-in-"+d}else{if(c!=""){k="/"+c}}}}else{if(f=="cruise-deals"||f=="events-packages"||f=="ski-holidays"){var b="events";var g="in";if(f=="cruise-deals"){b="cruises";g="to"}else{if(f=="ski-holidays"){b="holidays";g="to"}}if(c!=""&&d!=""){k="/"+b+"-ex-"+c+"-"+g+"-"+d}else{if(d!=""){k="/"+b+"-"+g+"-"+d}else{if(c!=""){k="/"+c}}}}else{if(f=="hotel-deals"){if(d!=""){k="/accommodation-in-"+d}}}}}if(e!=""&&e!="clear"){k+="/"+e}window.location.href="/"+f+k+j}function attachPPbehaviour(e,a){ppdiv=document.getElementById(e);if(ppdiv!=null){var b=new Array();if(document.getElementsByClassName){b=document.getElementsByClassName("ppDeal")}else{if(document.querySelectorAll){b=document.querySelectorAll("div.ppDeal")}else{ppTemp=ppdiv.getElementsByTagName("div");var f=ppTemp.length;var d;for(var c=0;c<f;c++){d=ppTemp[c];if(d.className=="ppDeal"||d.className.match(new RegExp(" ppDeal"))){b.push(d)}}}}var g=b.length;for(var c=0;c<g;c++){b[c].onmouseover=function(){ppHoverOn(this,a)};b[c].onmouseout=function(){ppHoverOff(this,a)}}}}function ppHoverOn(b,a){if(b.id!=""){if(b.id=="ppfirst"||b.id=="ppsingle"){el=document.getElementById("ppTop");if(el!=null){el.style.background="#fff url('"+a+"/themes/airnz001/images/pp-bg-top-over.jpg') repeat-x left top"}b.style.background="none";b.style.backgroundColor="#fff6dd"}else{b.style.background="#fff6dd url('"+a+"/themes/airnz001/images/pp-bg-tile-over.jpg') repeat-x left top"}if(b.id=="pplast"||b.id=="ppsingle"){el=document.getElementById("ppBot");if(el!=null){el.style.background="#fff url('"+a+"/themes/airnz001/images/pp-bg-bottom-over.jpg') repeat-x left top"}}}return true}function ppHoverOff(b,a){if(b.id!=""){if(b.id=="ppfirst"||b.id=="ppsingle"){el=document.getElementById("ppTop");if(el!=null){el.style.background="#fff url('"+a+"/themes/airnz001/images/pp-bg-top-up.jpg') repeat-x left"}}if(b.id=="pplast"||b.id=="ppsingle"){el=document.getElementById("ppBot");if(el!=null){el.style.background="#fff url('"+a+"/themes/airnz001/images/pp-bg-bottom-up.jpg') repeat-x left top"}}b.style.background="#fff url('"+a+"/themes/airnz001/images/pp-bg-tile-up.jpg') repeat-x left top";b.style.backgroundColor="#fff"}return true}function forgotPass(){var a="";if(document.frmLogin.username.value!=""){a=document.frmLogin.username.value}window.location.href="https://registration.airnewzealand.com/spr/challenge_phrase/challenge_phrase.jsp?username="+a+"&currsite="+curSite;return false}function onlineServices(d,c,e,b){var g="?";if(d.indexOf("?")>-1){g="&"}var a=getLocale();var f=d+g+"currsite="+curSite+"&locale="+a;if(typeof c=="string"){window.open(f,c,"location=yes,menubar=yes,scrollbars=yes,resizable=yes,toolbar=yes,titlebar=yes,status=yes,width="+e+",height="+b)}else{window.location.href=f}}function goToTimatic(){if(checkTimaticForm()){var f="http://www.timaticweb.com/cgi-bin/tim_website_client.cgi?SpecData=1&VISA=1";var b=document.spdb.NA.value;var c=document.spdb.AR.value;var a=getMultiple(document.spdb.DE,"&DE=");var e=getMultiple(document.spdb.TR,"&TR=");var d=document.spdb.PASSTPES.value;f+="&NA="+b+"&AR="+c+"&DE="+a+"&TR="+e+"&PASSTPES="+d;f+="&user=NZB2C&subuser=NZB2C";document.location.href=f}}function getMultiple(d,c){var e=0;var a="00";for(var b=0;b<d.length;b++){if(d.options[b].selected){e++;if(e==1){a=d.options[b].value}else{a+=c+d.options[b].value}}}return(a)}function checkTimaticForm(){var a=false;if(document.spdb.NA.value==""||document.spdb.NA.value=="00"){alert("Please select Nationality of Passport.")}else{if(document.spdb.DE.value==""||document.spdb.DE.value=="00"){alert("Please select at least one Destination.")}else{a=true}}return(a)}function getLinksByClass(b){var f=new Array();if(document.getElementsByClassName){f=document.getElementsByClassName(b)}else{if(document.querySelectorAll){f=document.querySelectorAll(b)}else{var a=document.getElementsByTagName("a");var e=a.length;var d;for(var c=0;c<e;c++){d=a[c];if(d.className==b||d.className.match(new RegExp(" "+b))||d.className.match(new RegExp(b+" "))){f.push(d)}}}}return f}function assignEvent(a,c,b){if(link.attachEvent){link.attachEvent("onclick",function(d){fireOnClick(d.srcElement)})}else{link.addEventListener("click",function(d){fireOnClick(d.target)},false)}}function attachLinkEvent(){var a=document.getElementsByTagName("A");var d=a.length;for(i=0;i<d;i++){var c=a[i];var b=c.className;if(b!=undefined&&b!=""&&b.match(/(booking)|(popup)|(tevent)|(onlineservices)/i)){if(c.attachEvent){c.attachEvent("onclick",function(f){f.returnValue=fireOnClick(f.srcElement)})}else{c.addEventListener("click",function(f){if(!fireOnClick(f.target)){f.preventDefault()}},false)}}}}function overRideHref(link){var func=/^_function_([a-zA-Z]{1,})/.exec(link.id);func=func[1];switch(func){case"bookisis":var args=link.id.replace(/^_function_bookisis-args:/,"").replace(/\.[a-z0-9]{32}$/i,"");args=args.replace(/\./g,",");args=args.replace(new RegExp(".trackEvent=[0-9a-z=+/]{1,}$","i"),"");var functionCall="getIsisHREF("+args+");";try{link.href=eval(functionCall)}catch(err){}break;case"trisept":var args=link.id.replace(/^_function_trisept-args:/,"").replace(/\.[a-z0-9]{32}$/i,"");args=args.replace(/\./g,",");args=args.replace(new RegExp(".trackEvent=[0-9a-z=+/]{1,}$","i"),"");var functionCall="getTriseptHREF("+args+");";try{link.href=eval(functionCall)}catch(err){}break}}function fireTrackEvent(e){var a=e.match(new RegExp(".trackEvent=([a-z0-9+/=]+).","i"));if(a!=null&&a.length==2){a=base64_decode(a[1]);var d=a.split(",");var c=d.length;if(c>=2||c<=4){for(var b=0;b<c;b++){d[b]=d[b].replace(/^\s*/,"").replace(/\s*$/,"")}switch(c){case 2:_gaq.push(["_trackEvent",d[0],d[1]]);break;case 3:_gaq.push(["_trackEvent",d[0],d[1],d[2]]);break;case 4:_gaq.push(["_trackEvent",d[0],d[1],d[2],d[3]]);break}}}}function fireOnClick(obj){if(obj.tagName!="A"){do{obj=obj.parentNode}while(obj.tagName!="A")}var className=obj.className;var rev=obj.rev;if(className.match("tevent")){}var props=rev.split(",");var length=props.length;for(var i=0;i<length;i++){var item=props[i];var itemArray=item.split(":");if(itemArray.length==2){if(itemArray[0]=="tevent"){var funcCall=base64_decode(itemArray[1]);eval(funcCall);rev=rev.replace(new RegExp(",{0,1}"+item,"i"),"")}}}className=className.replace("tevent","");className=className.replace(/^\s+|\s+$/g,"");switch(className){case"popup":var itemArray=rev.split(":");if(itemArray.length==2){var args=base64_decode(itemArray[1]);var argsArray=args.split(new RegExp(",s{0,}"));var windowName=argsArray[0].replace(new RegExp("^'"),"").replace(new RegExp("'$"),"");if(windowName.length==0){var funcCall="window.open('"+obj.href+"', "+args+");"}else{var funcCall=windowName+" = window.open('"+obj.href+"', "+args+");"}eval(funcCall);return false}else{return true}break;case"booking":if(!isIE&&bookingWindow){bookingWindow.close()}bookingWindow=window.open(obj.href,"ISISbooking");bookingWindow.focus();return false;break;case"onlineservices":var itemArray=rev.split(":");if(itemArray.length==2){var args=base64_decode(itemArray[1]);var argArray=args.split(",");if(argArray.length==3){var name=argArray[0];var width=argArray[1];var height=argArray[2]}else{var name="";var width=800;var height=600}onlineServices(obj.href,name,width,height)}return false;break;default:return true}}var popupWindow;function openWindow(c){if(c.tagName!="A"){do{c=c.parentNode}while(c.tagName!="A")}var a=c.id.replace(/^_function_popup-/i,"").replace(/\.[a-z0-9]{32}$/i,"");a=a.replace(/\./g,",");a=a.replace(/:/g,"=");var b=a.match(/window=[\w-]{1,},{0,1}/i);if(b!=null){if(b.length!=0){a=a.replace(b,"");b=b[0].replace(/window=/i,"");b=b.replace(/,$/i,"")}else{b="mywindow"}popWindow(c.href,b,a)}}function popWindow(c,a,b){if(!isIE&&popupWindow){popupWindow.close()}popupWindow=window.open(c,a,b);popupWindow.focus()}function insertFlashHTML(f,b,a,h,d,g,c){g=parseInt(g);c=parseInt(c);if(f=="/assets/"||f=="/assets"){return}if(FlashDetect.installed&&FlashDetect.major>7){add="";if(typeof(g)=="number"&&g>0){add=add+" height='"+g+"' "}if(typeof(c)=="number"&&c>0){add=add+" width='"+c+"' "}flashhtml='<object wmode="transparent" '+add+'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"><param value="'+f+'" name="movie"/><param name="allowScriptAccess" value="always"/><param value="transparent" name="wmode"/><param value="high" name="quality"/><embed pluginspage="http://www.macromedia.com/go/getflashplayer" '+add+' type="application/x-shockwave-flash" quality="high" src="'+f+'" allowScriptAccess="always" wmode="transparent"/></object>';flashdiv=document.getElementById(b);if(flashdiv!=undefined){flashdiv.innerHTML=flashhtml;var j=MM_findObj(d);var e=j.getElementsByTagName("img");e[0].src="/themes/airnz001/images/spacer.gif"}}else{img=MM_findObj(a);if(img){img.src=h;if(c>0){img.width=c}if(g>0){img.height=g}}div=MM_findObj(d);if(div){div.style.display="block"}}}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 checkOLS(b){var a=initialiseOLSXMLHttp();return true;if(a){try{a.open("GET",b,false);a.send(null);if(a.status==200){var d=new String();d=a.responseText;if(d.indexOf("down")>0){document.LoginForm.action="https://redirect.airnewzealand.com/redirectweb/servlet/FareDirector?finder_type=OLSLink"}}}catch(c){}}}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 Region_show(){var a=MM_findObj("RegionPanel");if(a){a.style.display="block"}}function processKeepAlive(c){var b=MM_findObj("loginfieldset");if(b&&keepAliveAlive){b.style.display="block";if(c.keepAlive.populated=="true"){var a='<span class="message">Kia Ora ';a+=c.keepAlive.givenName;a+='</span><span class="message" style="margin-top:3px;"><a href="https://myairnz.com/myairnz/portal/logout.do" title="Logout of myairnz.com. "><img width="65" height="18" alt="Logout." src="/themes/airnz001/images/logout.gif" /></a></span>';b.innerHTML=a}}}function processOLS(){}function kickOffKeepAlive(){var a=MM_findObj("loginfieldset");if(a&&keepAliveAlive){importJSPostLoad("https://myairnz.com/myairnz/portal/keepAlive.do?callback=processKeepAlive");importJSPostLoad("https://registration.airnewzealand.com/spr/status/keepAlive.jsp?callback=processOLS")}}function importJSPostLoad(b){var c=document.getElementsByTagName("head")[0];var a=document.createElement("script");a.src=b;c.insertBefore(a,c.firstChild)}var hasIE6NavSetup=false;iehover=function(){var f=navigator.userAgent.toLowerCase();if(f.indexOf("msie 6")==-1){return}var b=MM_findObj("TopNavContainer");if(b&&!hasIE6NavSetup){hasIE6NavSetup=true;var g=b.getElementsByTagName("li");for(var d=0;d<g.length;d++){var a=g[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}}}}};function base64_decode(h){var d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";var c,b,a,m,l,k,j,n,g=0,o=0,e="",f=[];if(!h){return h}h+="";do{m=d.indexOf(h.charAt(g++));l=d.indexOf(h.charAt(g++));k=d.indexOf(h.charAt(g++));j=d.indexOf(h.charAt(g++));n=m<<18|l<<12|k<<6|j;c=n>>16&255;b=n>>8&255;a=n&255;if(k==64){f[o++]=String.fromCharCode(c)}else{if(j==64){f[o++]=String.fromCharCode(c,b)}else{f[o++]=String.fromCharCode(c,b,a)}}}while(g<h.length);e=f.join("");e=this.utf8_decode(e);return e}function utf8_decode(a){var c=[],e=0,g=0,f=0,d=0,b=0;a+="";while(e<a.length){f=a.charCodeAt(e);if(f<128){c[g++]=String.fromCharCode(f);e++}else{if((f>191)&&(f<224)){d=a.charCodeAt(e+1);c[g++]=String.fromCharCode(((f&31)<<6)|(d&63));e+=2}else{d=a.charCodeAt(e+1);b=a.charCodeAt(e+2);c[g++]=String.fromCharCode(((f&15)<<12)|((d&63)<<6)|(b&63));e+=3}}}return c.join("")}function clearEmail(){var a=document.getElementById("EmailAddr");var c="Enter email address";var b="";b=a.value;if(b.toLowerCase()==c.toLowerCase()){a.value=""}}var bookingWindow=null;var manageBookingWindow=null;var holidaybookings=null;var popupWindow=null;var isIE=(navigator.userAgent.indexOf("MSIE")>-1);function bookISIS(){var a=getIsisURL(arguments);if(!isIE&&bookingWindow){bookingWindow.close()}bookingWindow=window.open(a,"ISISbooking");bookingWindow.focus()}function checkAgencyCode(a){var f="0123456789";var b;var e="";for(var d=0;d<a.value.length;d++){b=""+a.value.substring(d,d+1);if(f.indexOf(b)=="-1"){e="invalid";break}}if(e==""){if(document.domain.indexOf("au")!=-1){if(a.value.length==0){return true}else{if(a.value.length==7){var c=["960","966","967","968","020","009","023","230","034","223"];var g=false;for(var d=0;d<c.length;d++){if(a.value.substring(0,3)==c[d]){g=true}}if(!g){e="invalid"}}else{if(a.value.length==8){var c=["960","966","967","968"];var g=false;for(var d=0;d<c.length;d++){if(a.value.substring(0,3)==c[d]){g=true}}if(!g){e="invalid"}}else{e="invalid"}}}}else{if(a.value.length==7||a.value.length==8){var c=["243"];var g=false;for(var d=0;d<c.length;d++){if(a.value.substring(0,3)==c[d]){g=true}}if(!g){e="invalid"}}else{e="invalid"}}}if(e!=""){popWindow("/invalid-iata-number","termsWindow","scrollbars=yes,resizable=yes,width=750,height=410,left=0,top=0");return false}return true}function ManageBookingRadioClick(a,b){ManageBookingType=a;ManageBookingFormType=b;if(a=="booking options"){document.getElementById("emailfield").style.display="block";if(ManageBookingFormType=="Manage-Bookings-Agents"){document.getElementById("agencycodefield").style.display="block"}}else{if(a=="upgrade product"){document.getElementById("emailfield").style.display="none";if(ManageBookingFormType=="Manage-Bookings-Agents"){document.getElementById("agencycodefield").style.display="block"}}else{if(a=="check in"){document.getElementById("emailfield").style.display="none";if(ManageBookingFormType=="Manage-Bookings-Agents"){document.getElementById("agencycodefield").style.display="none"}}}}}function inArray(e,d){var c=d.length;for(var a=0;a<c;a++){var b=d[a];if(e==b){return true}}return false}function doBookingsForm(){var e=document.getElementById("bookingsformtype").value;if(e!="Seat-Request"){var h=document.getElementById("manageBkg").mbradio;var f=h.length;for(var d=0;d<f;d++){if(h[d].checked){var c=h[d].id}}}if(e=="Seat-Request"||c=="checkin"||c=="passportDetails"){var b=new Array("bookingReference","familyName","workflowAction")}else{if(c=="upgradeProduct"){var b=new Array("bookingReference","familyName","workflowAction","agencyID")}else{if(c=="bookingDetails"){var b=new Array("bookingReference","familyName","emailAddress","agencyID")}}}var g=document.getElementById("manageBkg").action+"?";var a=document.getElementById("manageBkg").elements;var f=a.length;for(var d=0;d<f;d++){var j=a[d];if(j.name!=undefined&&j.name!=""&&inArray(j.name,b)){g+=j.name+"="+escape(j.value)+"&"}}if((e=="Manage-Bookings-Agents"||e=="Manage-Bookings-Skycouch-Agents")&&c!="checkin"&&!checkAgencyCode(document.getElementById("agencycode"))){return false}manageBookingWindow=window.open(g,"ISISbooking","scrollbars=yes,location=yes,menubar=yes,resizable=yes,width=785,height=600,left=100,top=100");manageBookingWindow.focus();return false}function changeBookingForm(e){var c=document.getElementById("manageBkg");var b=document.getElementById("bookingsformtype").value;var a=e.id;if(a=="bookingDetails"){var d=isBookBaseURL+"/review/initNewManageBooking.do";c.action=d;document.getElementById("emailfield").style.display="block"}else{if(a=="upgradeProduct"){var d=isBookBaseURL+"/review/initNewWebCheckIn.do";c.action=d;document.getElementById("emailfield").style.display="none";document.getElementById("workflowAction").value="PRODUCT_UPGRADE"}else{if(a=="checkin"){var d=isBookBaseURL+"/review/initNewWebCheckIn.do";c.action=d;document.getElementById("emailfield").style.display="none";document.getElementById("workflowAction").value="SEAT_REQUEST"}else{if(a=="passportDetails"){var d=isBookBaseURL+"/review/initNewWebCheckIn.do";c.action=d;document.getElementById("emailfield").style.display="none";document.getElementById("workflowAction").value="PASSPORT_DETAILS"}}}}if((b=="Manage-Bookings-Agents"||b=="Manage-Bookings-Skycouch-Agents")&&a!="checkin"){document.getElementById("agencycodefield").style.display="block"}else{if(document.getElementById("agencycodefield")){document.getElementById("agencycodefield").style.display="none"}}}function SendSeatRequest(c){var h=isBookBaseURL;if(isBookBaseURL==""){return}try{var b=document.getElementById("bookingReference").value;var a=document.getElementById("familyName").value;if(ManageBookingType=="check in"||ManageBookingType=="upgrade product"){h+="/review/initNewWebCheckIn.do?";h+="bookingReference="+escape(b)+"&";h+="familyName="+escape(a)+"&";if(c=="Manage-Bookings-Agents"&&ManageBookingType=="upgrade product"){if(!checkAgencyCode(document.getElementById("agencycode"))){return}else{var f=document.getElementById("agencycode").value;h+="agencyID="+escape(f)+"&"}}h+="workflowAction=";if(ManageBookingType=="check in"){h+="SEAT_REQUEST"}else{h+="PRODUCT_UPGRADE"}}else{var g=document.getElementById("emailAddress").value;h+="/review/initNewManageBooking.do?";h+="bookingReference="+escape(b)+"&";h+="familyName="+escape(a)+"&";h+="emailAddress="+escape(g);if(c=="Manage-Bookings-Agents"){if(!checkAgencyCode(document.getElementById("agencycode"))){return}else{var f=document.getElementById("agencycode").value;h+="&agencyID="+escape(f)}}}if(!isIE&&manageBookingWindow){manageBookingWindow.close()}manageBookingWindow=window.open(h,"ISISbooking","scrollbars=yes,location=yes,menubar=yes,resizable=yes,width=785,height=600,left=100,top=100");manageBookingWindow.focus()}catch(d){}}function trisept(){var a=getTriseptURL(arguments);if(!isIE&&holidaybookings){holidaybookings.close()}holidaybookings=window.open(a,"HolidayBookings");holidaybookings.focus()}function getIsisHREF(){return getIsisURL(arguments)}function getTriseptHREF(){return getTriseptURL(arguments)}function getIsisURL(d){var e="";var c=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];bookingEngine=d[d.length-1];if(bookingEngine=="vbook"){var o=isBookBaseURL.lastIndexOf("/");var b=isBookBaseURL.substring(0,o)+"/vbook/actions/ext-search?";var s=["searchLegs[0].originPoint","searchLegs[0].destinationPoint","bookingClass","tripType","searchLegs[0].tripStartDate/searchLegs[0].tripStartMonth/ignore","searchLegs[1].tripStartDate/searchLegs[1].tripStartMonth/ignore","searchType","promoCode","adults","children","infants","displaySearchForFlight"]}else{var b=isBookBaseURL+"/book/initNewSearchForFlights.do?";var s=["originPoint0","destinationPoint0","bookingClass","tripType","tripStartDate/tripStartMonth/ignore","tripEndDate/tripEndMonth/ignore","searchType","promoCode","adults","children","infants"]}var a=d.length;var m=s.length;for(var n=0;n<a&&n<m;n++){var q=s[n];if(typeof(d[n])!="undefined"&&d[n]!=""&&d[n]!=null){var f=""+d[n];if(!n==7){f=f.toLowerCase()}if(!n==7){f=f.toLowerCase()}if(n<2){f=f.toUpperCase()}var p=[];var g=q.split("/");var t=f.split("/");for(var l=0;l<g.length&&l<t.length;l++){var r={};r.name=g[l];r.val=t[l];if(r.name.indexOf("Month")>-1){r.val=c[(Math.round(parseFloat(r.val))-1)].toUpperCase()}if(r.name!="ignore"){p.push(r)}}var h=p.length-1;while(h>-1){b+=e+p[h].name+"="+p[h].val;e="&";h--}}}return b}function getTriseptURL(c){var a=TriseptBaseURL;if(typeof(c[0])!="undefined"&&c[0]!=""&&c[0]!=null){var b=""+c[0];a+=b}return a}function handleDisplay(b){var a;var h="+";var f="-";var g=document.getElementById(b.getAttribute("id"));var e=document.getElementById(g.parentNode.id);var d=e.childNodes;var c=d.length;for(i=0;i<c;i++){a=d[i];if(a.nodeName=="DIV"){if(a.style.display=="none"){a.style.display="block"}else{a.style.display="none"}}}if(g.innerHTML==h){g.innerHTML=f;g.title="Hide links"}else{g.innerHTML=h;g.title="Show links"}}function convertNumeric(a){a.value=a.value.replace(/[^0-9]/g,"")}function submitForm(){if(validDate()){document.frmEnquiry.submit()}}function resetForm(){var a=document.frmEnquiry;a.EnquiryType[0].checked=false;a.EnquiryType[1].checked=false;a.LastName.value="";a.FirstName1.value="";a.FirstName2.value="";a.FirstName3.value="";a.lstDOBDay.options[0].selected=true;a.lstDOBMonth.options[0].selected=true;a.lstDOBYear.options[a.lstDOBYear.length-1].selected=true;a.Gender[0].checked=false;a.Gender[0].checked=false;a.Nationality.value="";a.MaritalStatus.value="";a.TravelWith.value="";a.CallerRelationship.value="";a.CallerLastName.value="";a.CallerFirstName1.value="";a.CallerFirstName2.value="";a.CallerFirstName3.value="";a.StreetNumber.value="";a.Street.value="";a.City.value="";a.lstCountry.options[0].selected=true;a.PostalCode.value="";a.Phone.value="";a.Mobile.value="";a.Fax.value="";a.Language.value="";a.Company.value=""}function redirectForm(a){var b="Your form has been successfully submitted.\n\nAn Air New Zealand representative will be in contact with you shortly.";if(validDate()){alert(b);location.href=a}}function daysInMonth(b){var a=31;if(b==4||b==6||b==9||b==11){a=30}if(b==2){a=29}return a}function daysInFebruary(a){return(((a%4==0)&&((!(a%100==0))||(a%400==0)))?29:28)}function validDate(){var g=document.frmEnquiry;var f=new Date();var d=f.getFullYear();var a=g.lstDOBDay.value;var h=g.lstDOBMonth.value;var c=g.lstDOBYear.value;var e=document.getElementById("lstDOBMonth");if(a>daysInMonth(h)){alert("The month of "+g.lstDOBMonth.options[g.lstDOBMonth.selectedIndex].text+" does not have "+a.toString()+" days in it.");if(e){e.focus()}return false}if(h==2&&a>daysInFebruary(c)){alert("February was not a leap year in "+c.toString()+".");if(e){e.focus()}return false}var b=new Date(c,h-1,a);if(b>f){alert("The Date of Birth can not be after today.");if(e){e.focus()}return false}return true};
