(function(){var b=(function(){var t=function(){};var u=function(J,K){var L=this[J];if(L){K(L.value)}else{var I="_"+J;var H=this[I];if(!H){this[I]=[K]}else{H.push(K)}}};var C=function(K,H){this[K]={value:H};var J=this["_"+K];if(J){for(var I=0;I!==J.length;J[I++](H)){}}};t.prototype={constructor:t,done:function(H){u.call(this,"reply",H);return this},callDone:function(H){C.call(this,"reply",H);this.callThen();return this},fail:function(H){u.call(this,"error",H);return this},callFail:function(H){C.call(this,"error",H);this.callThen();return this},then:function(H){u.call(this,"either",H);return this},callThen:function(){C.call(this,"either",true);return this}};var x=function(K){var J=K.split(/\W+/g);var H=J[0].toLowerCase();for(var I=1;I<J.length;++I){H+=J[I].charAt(0).toUpperCase();if(J[I].length>1){H+=J[I].substring(1).toLowerCase()}}return H};var p="hifx-";var G=function(K,L){for(var M=K.firstChild;M;M=M.nextSibling){if(M.nodeType===1){if(M.className&&M.className.split){var J=M.className.split(/\s+/g);for(var I=0;I!==J.length;++I){var H=x(J[I].substring(p.length));L[H]=L[H]||[];L[H].push(M)}}G(M,L)}}};var F=function(H){return H.replace(/\./g,"."+p)};var r=function(H){return new RegExp("(\\s|^)"+p+H+"(\\s|$)")};var E=function(I,H){I.style.opacity=H;I.style.filter="Alpha(opacity="+Math.ceil(H*100)+")"};var D=document.createElement("style");D.setAttribute("type","text/css");D.innerHTML="#id1bf2c1 .hifx-outer{\n    box-sizing: content-box;\n    border-radius: 10px;\n    border: 1px solid #b8b8b8;\n    background-color: #fff;\n    font-family: Helvetica, sans-serif;\n    line-height: normal;\n    width: 370px;\n}#id1bf2c1 .hifx-heading{\n    box-sizing: content-box;\n    text-align: center;\n    color: #004753;\n    display: block;\n    font-size: 16px;\n    font-weight: 100;\n    background-color: #f6f6f6;\n    border-top-left-radius: 10px;\n    border-top-right-radius: 10px;\n    height: 12px;\n    margin: 0px;\n    padding: 13px;\n    text-transform: uppercase;\n}#id1bf2c1 .hifx-outer .hifx-content{\n    padding: 18px 32px;\n}#id1bf2c1 .hifx-outer label{\n    box-sizing: content-box;\n    -webkit-box-sizing: border-box;\n    -moz-box-sizing: border-box;\n    box-sizing: border-box;\n    clear: left;\n    float: left;\n    font-size: 14px;\n    margin: 4px 0;\n    text-transform: uppercase;\n    width: 25%;\n}#id1bf2c1 .hifx-outer label.hifx-additional-label{\n    width: auto;\n}#id1bf2c1 .hifx-buttons{\n    margin-top: 8px;\n    text-align: center;\n}#id1bf2c1 .hifx-send{\n    box-sizing: content-box;\n    background-color: #633691;\n    border: medium none;\n    border-radius: 5px;\n    color: #fff;\n    font-size: 14px;\n    padding: 6px;\n    width: 110px;\n    background-color: #005968;\n}#id1bf2c1 .hifx-outer .hifx-message{\n    margin: 0px;\n    font-size: 14px;\n    padding-bottom: 9px;\n}#id1bf2c1 .hifx-outer input{\n    box-sizing: content-box;\n    border: 1px solid #b8b8b8;\n    border-radius: 5px;\n    -webkit-box-sizing: border-box;\n    -moz-box-sizing: border-box;\n    box-sizing: border-box;\n    float: left;\n    font-size: 12px;\n    margin: 4px 0;\n    padding: 4px;\n    width: 75%;\n}#id1bf2c1 .hifx-outer .hifx-additional-input{\n    box-sizing: content-box;\n    border: 1px solid #b8b8b8;\n    border-radius: 5px;\n    height: 45px;\n    resize: vertical;\n    width: 100%;\n}#id1bf2c1 .hifx-powered-by{\n    clear: both;\n    padding-top: 17px;\n    text-align: center;\n}#id1bf2c1 .hifx-powered-by .hifx-powered{\n    display: inline-block;\n    font-family: Helvetica, sans-serif;\n    font-size: 12px;\n    margin-right: 5px;\n    vertical-align: middle;\n}#id1bf2c1 .hifx-powered-by .hifx-logo{\n    box-sizing: content-box;\n    background-position: 0 center;\n    background-repeat: no-repeat;\n    display: inline-block;\n    height: 20px;\n    vertical-align: middle;\n    width: 43px;\n}";document.getElementsByTagName("head")[0].appendChild(D);var o=document.getElementById("id1bf2c1");E(o,0);var A=function(I,N,M,K){E(I,N);var H=new t();var J=(M-N)/Math.ceil(K/50);var L=function(){N+=J;if((J>0&&N>M)||(J<0&&N<M)){N=M}E(I,N);if(N!==M){setTimeout(L,50)}else{H.callDone(I)}};L();return H};o.innerHTML='<div class="hifx-outer"><div class="hifx-heading">BRAND_NAME ENQUIRY FORM</div><div class="hifx-content"><p class="hifx-message"> Please complete the form below and BRAND_NAME will contact you as soon as possible to discuss your international money transfer requirements. </p><label class="hifx-name-label">Name *</label><input type="text" class="hifx-name-input" /><label class="hifx-phone-label">Phone *</label><input type="text" class="hifx-phone-input" /><label class="hifx-email-label">Email *</label><input type="text" class="hifx-email-input" /><label class="hifx-additional-label">Questions and additional information</label><br /><textarea class="hifx-additional-input"></textarea><br /><div class="hifx-buttons"><button class="hifx-send">Send</button></div><div class="hifx-powered-by"><span class="hifx-powered">Powered by</span><span class="hifx-logo" style="background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACsAAAAUCAYAAAAUccS4AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2hpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9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C0A2fVeoGTNZlTATpoNYGo70lv+oTuAg8vWrsTi9AXcjwXGmJdv9Q6yjA4ghdvn8J+qGocxtvor4XD1gqNNSdCZICfy4k3sA24xnNlUXHOV/4UlWQL53CndwIdGmuPADpEAmlrAgfsMpOVs4Rm6tOrTnfnFARKgJAZkqXcOaqx9ne+3pIeLMTYJVVYXtFynJJs1TRFofg/yD6FrfwZyJ0HNgA/gNPssMMoCg8QCg/n7oDNstW2Zq1nstROpSzvq0Z/R05bo8MhcQuC7OOWbNqhat7ZOuRYmSR5dwiIByoWimepKKQDDuC4PLls6TARLZLL+fiI/uC8koVXsxR3gpKcFGu3cj3eaL/ri/nJdt1jk5LmhSyI6jguqX/pb6u5nWCv033iljIbvOAYGZr2hAthAOw8tnPOVObTdp5r1LBhUFSteuRZrz8hZIIeHLAteEyjsdcugqVI3DcWRDOZw1XjCL8XICxkslfJ7Ss5odNFg2rzKqAZSAW+yucA+AbE8c585/wbwiVYAvqAJSxHNnIAFADRwEUhgvXI1hreJbpmenmXd7FsD5ABNJGXiWwBv8DBJAUbGOAxvayGr3RvgK0cc/RRXxSFIhm4Dxxjkj9pR5l0v+++8K+kJrPuZ8DIjtkE0OHKY9kxuq/zByymECLPvANG2HAfG3zPH+Bk75FBm+8OazI7WS4WGFSU11AmVuWTnfwXQd5LZEfQS/cBT1jWwfYT+P1JsN/Kf58kfu8Q90Ta+EeAAQCiygE1lNY+YgAAAABJRU5ErkJggg==);"></span></div></div></div> ';var v={};G(o,v);for(var B in v){if(v[B].length===1){v[B]=v[B][0]}else{delete v[B]}}var q=(function(){var H=document.currentScript||(function(){var I=document.getElementsByTagName("script");return I[I.length-1]})();return H.src})();var s={};var B=q.indexOf("?");if(B!==-1){var w=q.substring(B+1).replace(/&amp;/g,"&").split("&");for(var B=0;B!==w.length;++B){var y=/^([^=]+)=?(.*)/.exec(w[B]);if(y){s[decodeURIComponent(y[1])]=decodeURIComponent(y[2])}}}var z=function(){};z.prototype={constructor:z,add:function(H){var I={thing:H};if(this.tail){this.tail.next=I;I.last=this.tail;this.tail=I}else{this.tail=this.head=I}},each:function(H){for(var I=this.head;I&&H.call(this,I)!==false;I=I.next){}},apply:function(H){this.each(function(I){I.thing(H)})},remove:function(H){this.each(function(I){if(I.thing===H){if(I.last){I.last.next=I.next}if(I.next){I.next.last=I.last}if(I===this.head){this.head=I.next}if(I===this.tail){this.tail=I.last}return false}})}};A(o,0,1,500);return{element:o,mixIn:function(J,H){for(var I in H){J[I]=H[I]}return J},isA:function(H,I){if(typeof H==="object"){for(var J=H;J;J=J.prototype){if(J.prototype===I.prototype){return true}}}return false},getPosition:function(I){var H={x:0,y:0};while(I){H.x+=I.offsetLeft;H.y+=I.offsetTop;I=I.offsetParent}return H},getMaxZIndex:function(H){var J=document.querySelectorAll("*"),K=0;for(var I=0;I!==J.length;++I){if(H!==J[I]){var L=this.currentStyle(J[I]).zIndex;if(L&&/^\d+$/.test(L)){L=parseInt(L);if(L>K){K=L}}}}return K},getScrollPosition:function(){if(window.scrollX!==undefined){return{x:window.scrollX,y:window.scrollY}}else{if(window.pageXOffset!==undefined){return{x:window.pageXOffset,y:window.pageYOffset}}else{return{x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}}}},findPositionOfRelativeParent:function(H){for(var I=H.parentElement;I;I=I.parentElement){var J=this.currentStyle(I).position;if(J==="relative"||J==="absolute"||J==="fixed"){var K=this.getPosition(I);K.fixed=J==="fixed"?I:null;return K}}return{x:0,y:0,fixed:null}},getMousePosition:function(J){var I={};if(J){if(J.clientX!==undefined){I.x=J.clientX;I.y=J.clientY}else{if(J.touches!==undefined){I.x=J.touches[0].pageX;I.y=J.touches[0].pageY}else{if(J.pageX!==undefined){I.x=J.pageX;I.y=J.pageY}else{throw J}}}}else{I.x=event.clientX;I.y=event.clientY}var H=this.getScrollPosition();I.x+=H.x;I.y+=H.y;return I},camelCase:x,querySelector:function(I,H){return(H||o).querySelector(F(I))},querySelectorAll:function(I,H){return(H||o).querySelectorAll(F(I))},addCssClass:function(I,H){if(!r(H).test(I.className)){I.className+=" "+p+H}},removeCssClass:function(J,H){var I=r(H);J.className=J.className.replace(I," ").replace(/\s+/g," ")},addListener:function(I,H,K){I._listeners=I._listeners||{};if(!I._listeners[H]){I._listeners[H]=new z();var J="on"+H;if(I[J]){I._listeners[H].add(I[J])}I[J]=function(){b.callListener(I,H,arguments.length?arguments[0]:null)}}I._listeners[H].add(K)},removeListener:function(I,H,J){if(I._listeners&&I._listeners[H]){I._listeners[H].remove(J)}},callListener:function(I,H,J){if(I._listeners&&I._listeners[H]){I._listeners[H].apply(J)}},generateUniqueId:function(){var H="id"+((Math.random()*8388607)&8388607).toString(16);while(document.getElementById(H)){H+="_"}return H},currentStyle:function(H){return(window.getComputedStyle)?getComputedStyle(H):H.currentStyle},fadeIn:function(H,I){return A(H,0,1,I||150)},fadeOut:function(H,I){return A(H,1,0,I||150)},fade:A,pixToInt:function(I){var H=/(-?\d+)/.exec(I);return H?parseInt(H[1]):0},setOpacity:E,translateQuerySelector:F,src:q,Defer:t,parameters:s,elements:v,classPrefix:p}})();b.rpc=(function(){var u=(window.XDomainRequest?(function(){var v=new XDomainRequest();return function(x,w){v.open("POST",b.src);v.onload=function(){w.callDone(v.responseText)};v.onerror=function(){w.callFail(v.responseText)};v.send(x);return w}}):(function(){var v=new XMLHttpRequest();return function(x,w){v.onreadystatechange=function(){if(v.readyState===4){if(v.status===200){w.callDone(v.responseText)}else{w.callFail(v.responseText)}}};v.open("POST",b.src,true);v.setRequestHeader("Content-Type","application/json");v.send(x);return w}}))();var p=["sendReport","sendLead"];var t=0;var o=function(v,x){var z={id:++t,method:v,params:new Array(x.length)};for(var y=0;y!==x.length;++y){z.params[y]=x[y]}var w=new b.Defer();u(JSON.stringify(z),new b.Defer()).done(function(A){A=JSON.parse(A);if(!A.error){w.callDone(A.result)}else{w.callFail(A.error)}}).fail(function(){w.callFail.apply(w,arguments)});return w};var q={};var s=function(v){q[v]=function(){return o(v,arguments)}};for(var r=0;r!==p.length;s(p[r++])){}return q})();var n=(function(){var o=function(q,p){if(n.id){return b.rpc.sendReport({affiliateId:n.id,regionCode:n.regionName,widgetType:q,click:p})}else{return(new b.Defer()).callDone()}};return b.mixIn({regionName:"NZ",brand:"HIFX",transferURL:"https://secure.hifx.co.nz/signup/Track/redirect?_clientagentname= &_clientagentid=",addURL:"https://tools.hifx.com/signup?_clientagentid=",poweredURL:"https://www.hifxonline.co.nz/registration/?_clientagentname= &_clientagentid=",transferText:"hifx.co.nz",countryCode:"NZ"},{trackImpression:function(p){return o(p,false)},trackClickThrough:function(p){return o(p,true)},fillUrlParameters:function(p){return p.replace("= ","="+encodeURIComponent(this.affiliateName))+this.id},clickThroughTo:function(q,p){p=this.fillUrlParameters(p);this.trackClickThrough(q).then(function(){document.location.href=p})},goToWidgetLandingPage:function(r,t){var s=/(\/\/[^/]+\/)/.exec(b.src);if(s){var p=s[1]+"partners/"+this.id+"/?widget="+r;for(var q in t){p+="&"+q+"="+t[q]}document.location.href=p}},id:"HIFX0110789482",affiliateName:null})})();var e=(function(){var o=function(q,p,r){this.element=q;this.failMessage=p;this.validate=r};return{email:function(q,p){return new o(q,p,function(){return/\w+[\w\.\-]+@\w[\w\-]*\.\w[\w\.\-]+/.test(q.value)})},notBlank:function(q,p){return new o(q,p,function(){return q.value.length!==0})},custom:function(q,r,p){return new o(q,p,function(){return r.test(q.value)})},phoneNumber:function(r,q,p){return new o(r,p,function(){return new RegExp("\\+?\\d{"+q+",}").test(r.value.replace(/\s+/g,""))})},validate:function(){var p=new b.Defer();for(var q=0;q!==arguments.length;++q){if(!arguments[q].validate()){return p.callFail(arguments[q])}}return p.callDone(this)},Validator:o}})();i="Contact refferal form";var g="border-color: #f00; background-color: #fffafa;",l=function(){j("Message sent. We will contact you shortly");a.emailInput.value=a.nameInput.value=a.phoneInput.value=a.additionalInput="";a.emailInput.disabled=true;a.nameInput.disabled=true;a.send.disabled=true;a.phoneInput.disabled=true;a.additionalInput.disabled=true};var c=function(o){o.style.backgroundColor="#fffafa";o.style.borderColor="#f00"};var d=function(o){o.style.cssText=""};n.trackImpression(i);var a=b.elements,i;var k=function(p,o){var q=b.generateUniqueId();o.setAttribute("id",q);p.setAttribute("for",q)};k(a.nameLabel,a.nameInput);k(a.emailLabel,a.emailInput);k(a.phoneLabel,a.phoneInput);k(a.additionalLabel,a.additionalInput);var f=a.message.innerHTML;var m=false;var j=function(o){var p=new b.Defer();b.fadeOut(a.message).then(function(){a.message.innerHTML=o;b.fadeIn(a.message).then(function(){p.callDone()})});return p};var h=function(o){j(o.failMessage).then(function(){c(o.element);a.message.style.cssText="color: #c00";setTimeout(function(){j(f).then(function(){d(o.element);a.message.style.cssText=""})},2000)})};a.send.onclick=function(){if(m){return}e.validate(e.email(a.emailInput,"Please enter a valid email address"),e.phoneNumber(a.phoneInput,6,"Please enter a valid phone number"),e.notBlank(a.nameInput,"Please enter your name")).done(function(){m=true;j("Sending...").then(function(){n.trackClickThrough(i).then(function(){b.rpc.sendLead(n.id,a.nameInput.value,a.phoneInput.value,a.emailInput.value,a.additionalInput.value).done(l)})})}).fail(h)};a.heading.innerHTML=a.heading.innerHTML.replace("BRAND_NAME","HiFX");a.message.innerHTML=a.message.innerHTML.replace("BRAND_NAME","HiFX")})();