/* CaterMap JavaScript, (C) Optimalworks.net */
if(!owl){var owl={};owl.Version=0.1;owl.UserAgent=navigator.userAgent.toLowerCase();owl.Browser={IE:/msie/.test(owl.UserAgent)&&!/opera/.test(owl.UserAgent),Mozilla:/mozilla/.test(owl.UserAgent)&&!/(compatible|webkit)/.test(owl.UserAgent),Opera:/opera/.test(owl.UserAgent),Safari:/webkit/.test(owl.UserAgent),Konqueror:/konqueror/.test(owl.UserAgent)};owl.Browser.Version=owl.UserAgent.replace(/^.+[ox|ra|on|or][\/: ]/,"");if(owl.Browser.Version.indexOf("msie")>=0){owl.Browser.Version=owl.Browser.Version.replace(/^.+[ie][\/: ]/,"")}owl.Browser.Version=owl.Browser.Version.replace(/([^\d.].+$)/,"");owl.Browser.VerNum=parseFloat(owl.Browser.Version);owl.Number=function(){var A=/[^0-9-.]/g;function C(E){var F=String(E);F=F.replace(A,"");var D=parseInt(F,10);return(isNaN(D)?0:D)}function B(D){if(isNaN(D)){D=0}return(Math.min(1,Math.max(-1,D)))}return{toInt:C,Sign:B}}();owl.String=function(){var E=/^\s*|\s*$/g;var B=/[^\w|\s|@|&|.|,|!|%|(|)|+|-]/g;var A=/[_|\s]+/g;function F(H){return String(H).replace(E,"")}function G(H){return F(String(H).replace(B,"").replace(A," "))}function C(J,I,H){J=String(J);I=owl.Number.toInt(I);if(typeof H=="undefined"){H=" "}else{H=String(H);if(H.length<1){H=" "}}while(J.length<I){J=H+J}return J}function D(K,J){if(typeof J=="string"){J=[J]}if(J&&J.length){for(var I=0,H=J.length;I<H;I++){K=K.replace(new RegExp("(^|[^%])%"+I+"([^0-9]|$)","g"),"$1"+J[I]+"$2")}}return K}return{Trim:F,Clean:G,Pad:C,Format:D}}();if(owl&&!owl.Array){owl.Array=function(){function B(E){return !!(E&&E.constructor==Array)}function A(F,E){F[F.length]=E}function C(F){var E=null;if(F.length>0){E=F[F.length-1];F.length--}return E}function D(E,F){return(E?(B(E)?E:[E]):(typeof F=="undefined"?[]:(B(F)?F:[F])))}return{Is:B,Push:A,Pop:C,Make:D}}()}owl.Each=function(F,D){if(F.length){for(var C=0,B=F.length,A=F[0];C<B&&D(A,C)!==false;A=F[++C]){}}else{for(var E in F){if(D(F[E],E)===false){break}}}};owl.Property=function(){function A(F){if(!F.owlP){F.owlP={};F.owlP.length=0}}function D(G,F,H){owl.Each(owl.Array.Make(G),function(I){A(I);I.owlP[F]=H;I.owlP.length++})}function E(G,F){return(B(G,F)?G.owlP[F]:null)}function B(G,F){return(G&&G.owlP&&typeof G.owlP[F]!="undefined")}function C(G,F){owl.Each(owl.Array.Make(G),function(H){if(H.owlP&&H.owlP[F]){delete H.owlP[F];H.owlP.length--;if(H.owlP.length==0){H.owlP=null}}})}return{Set:D,Get:E,Exists:B,Delete:C}}();owl.Object=function(){function Exists(object,item){return(typeof object[item]!="undefined")}function PropertyExists(object,item){var type=typeof (object[item]);return(type!="undefined"&&type!="function")}function MethodExists(object,item){return(typeof object[item]=="function")}function Serialize(object){var json=[];owl.Each(object,function(v,k){if(typeof v=="undefined"){v="null"}else{if(typeof v=="string"){v='"'+v+'"'}else{if(typeof v=="object"){if(!v){v="null"}else{if(owl.Array.Is(v)){v="["+String(v)+"]"}else{v=Serialize(v)}}}}}owl.Array.Push(json,k+":"+v)});return"{"+json.join()+"}"}function DeSerialize(serial){if(serial===""){serial='""'}eval("var ret = "+serial+";");return ret}return{Exists:Exists,PropertyExists:PropertyExists,MethodExists:MethodExists,Serialize:Serialize,DeSerialize:DeSerialize}}()}if(owl&&!owl.Css){owl.Css=function(){function B(G,F){var H=true;if(F){owl.Each(owl.Array.Make(G),function(I){var J=" "+I.className+" ";H=(J.indexOf(" "+F+" ")>=0);return H})}return H}function E(G,F){owl.Each(owl.Array.Make(G),function(H){var I=" "+H.className+" ";if(I.indexOf(" "+F+" ")<0){I+=F;H.className=owl.String.Trim(I)}})}function D(G,F){owl.Each(owl.Array.Make(G),function(H){var I="";if(F){I=" "+H.className+" ";I=owl.String.Trim(I.replace(new RegExp(" "+F+" ","gi")," "))}H.className=I})}function A(I,G,F){G=Math.min(Math.max(G,0),99.999999);var H=G/100;owl.Each(owl.Array.Make(I),function(J){if(F!==false){if(J.style.visibility=="hidden"){if(G>0){J.style.visibility="visible"}}else{if(G==0){J.style.visibility="hidden"}}}J.style.opacity=H;J.style.MozOpacity=H;J.style.filter="alpha(opacity:"+G+")";J.style.KHTMLOpacity=H})}function C(F,H){var G="";if(F){if(document.defaultView&&document.defaultView.getComputedStyle){G=document.defaultView.getComputedStyle(F,"").getPropertyValue(H)}else{if(F.currentStyle){H=H.replace(/\-(\w)/g,function(I,J){return J.toUpperCase()});G=F.currentStyle[H]}}}return G}return{ClassExists:B,ClassApply:E,ClassRemove:D,Opacity:A,ComputedStyle:C}}()}if(owl&&owl.Browser&&owl.Browser.IE&&Math.floor(owl.Browser.VerNum)==6){try{document.execCommand("BackgroundImageCache",false,true)}catch(e){}}if(owl&&owl.Css&&!owl.Dom&&document.getElementById&&document.getElementsByTagName){owl.Dom=function(){var S=1;var P=2;var R=3;var L=8;var K=/[^\w|\s|-|#|\.|,|\[|\]|=|~|!|*]/g;var H=/\s+/g;var Q=/^[^#|\.|\[]*/;var F=/#[^#|\.|\[]+/;var G=/\.[^#|\.|\[]+/;var I=/\[(.+)\]/;var M=/([~|!|*]*=)/;var N=/(^[^=|~|!|*])+/;var U=owl.Array,W=[document];function E(d,Y){Y=U.Make(Y,W);d=owl.String.Trim(String(d).replace(K,"").replace(H," "));var X=[],h=d.split(","),j,c,i,f,g,b;for(i=0,f=h.length;i<f;i++){j=owl.String.Trim(h[i]);var Z=Y.slice();c=j.split(" ");for(g=0,b=c.length;g<b;g++){if(Y.length>0){Z=J(c[g],Z)}}owl.Each(Z,function(a){U.Push(X,a)})}return X}function J(d,l){var h=[],r,i,k,a,g,q,f,b;var c={Tag:"",ID:"",Class:"",AttribCheck:function(){return true}};c.Tag=Q.exec(d);c.Tag=(c.Tag?c.Tag[0].toLowerCase():"*");if(c.Tag==""){c.Tag="*"}c.ID=F.exec(d);c.ID=(c.ID?c.ID[0].substr(1):"");c.Class=G.exec(d);c.Class=(c.Class?c.Class[0].substr(1):"");var m=I.exec(d);if(m){m=m[1];var Y,o=null,Z=M.exec(m);Z=(Z?Z[1]:null);if(Z){var j=m.indexOf(Z);Y=m.substr(0,j);o=m.substr(j+Z.length)}else{Y=m}c.AttribCheck=function(p){var n;switch(Y){case"class":n=p.className;break;case"for":n=p.htmlFor;break;default:n=p.getAttribute(Y);break}n=(n?n:"");return((n==""&&(!Z||Z=="!="))||(!Z||((Z=="="&&n==o)||(Z=="!="&&n!=o)||(Z=="*="&&n.indexOf(o)>=0)||(Z=="~="&&(" "+n+" ").indexOf(" "+o+" ")>=0))))}}for(k=0,a=l.length;k<a;k++){r=[];if(c.ID){i=document.getElementById(c.ID);if(i&&(c.Tag=="*"||i.nodeName.toLowerCase()==c.Tag)&&(!c.Class||owl.Css.ClassExists(i,c.Class))&&c.AttribCheck(i)){r[0]=i}}else{var X=function(n){return((c.Tag=="*"||n.nodeName.toLowerCase()==c.Tag)&&(c.Class==""||owl.Css.ClassExists(n,c.Class))&&c.AttribCheck(n))};if(c.Tag=="*"){r=O(l[k],0,X)}else{i=l[k].getElementsByTagName(c.Tag);for(f=0,b=i.length;f<b;f++){if(X(i[f])){r[r.length]=i[f]}}}}for(g=0,q=r.length;g<q;g++){h[h.length]=r[g]}}return h}function O(Z,X,b){var a=function(g,i){var h=[],f,c,d;if(!i){i=1}for(f=0,c=g.childNodes.length;f<c;f++){d=g.childNodes[f];if(d.nodeType==S&&d.nodeName!="!"){if(!b||b(d)){h[h.length]=d}if(g.childNodes.length>0&&(!X||i<X)){h=h.concat(a(d,i++))}}}return h};Z=U.Make(Z,W);var Y=[];owl.Each(Z,function(c){Y=Y.concat(a(c))});return Y}function D(Y,X){var Z=[];X=(X.toLowerCase()||"div");owl.Each(U.Make(Y),function(b,a){while(b.nodeName.toLowerCase()!=X&&b.parentNode){b=b.parentNode}Z[a]=(b.nodeName.toLowerCase()==X?b:null)});if(!owl.Array.Is(Y)){Z=Z[0]}return Z}function A(a,Z,Y,X){a=U.Make(a,W);Z=U.Make(Z,W);owl.Each(Z,function(f,d){if(X){C(f)}var g=Math.min(d,a.length-1);for(var c=0,b=a[g].childNodes.length;c<b;c++){f.appendChild(a[g].childNodes[c].cloneNode(true))}if(Y){C(a[g])}else{V(f)}})}function V(X){owl.Each(U.Make(X,W),function(Y){O(Y,null,function(Z){if(Z.id){Z.removeAttribute("id")}return true})})}function C(X){owl.Each(U.Make(X,W),function(Y){while(Y.lastChild){Y.removeChild(Y.lastChild)}})}function B(Y){var Z=false;for(var a=0,X=Y.childNodes.length;a<X&&!Z;a++){Z=(Y.childNodes[a].nodeType==R?Y.childNodes[a]:B(Y.childNodes[a]))}return Z}function T(X,Z){var Y=(typeof Z!="undefined");Z=(Y?(typeof Z=="string"?[Z]:Z):"");owl.Each(U.Make(X,W),function(c,b){var a=B(c);if(Y){var d=Z[Math.min(b,Z.length-1)];if(a){a.nodeValue=d}else{a=c.appendChild(document.createTextNode(d))}}else{if(a){Z+=(Z==""?"":"\n")+a.nodeValue}}});return(Y?true:Z)}return{ElementNode:S,AttributeNode:P,TextNode:R,CommentNode:L,Get:E,Descendents:O,Ancestors:D,Clone:A,RemoveIDs:V,RemoveChildren:C,Text:T}}()}if(owl&&!owl.Event){owl.Event=function(B,D,C,A){B=owl.Array.Make(B,[window]);C=(typeof C=="function"?C:null);A=(A||A==0?owl.Number.toInt(A):null);var E=[];owl.Each(B,function(F){E[E.length]=owl.EventRegister.Add(F,D,C,A)});this.Detach=function(){for(var G=0,F=B.length;G<F;G++){owl.EventRegister.Detach(B[G],D,E[G],true)}}};owl.EventRegister=function(){var B=[],I=[],A=[],E=0,F=false;var G="EventRegister";function K(O,Q,P,N){var L=owl.Property.Get(O,G);if(!L){L={};B[B.length]=O}if(!L[Q]){E++;I[E]=[];L[Q]=E;owl.Property.Set(O,G,L);var M=O["on"+Q];if(M){new owl.Event(O,Q,M)}O["on"+Q]=owl.EventRegister.Handler;if(E==1){new owl.Event(window,"unload",owl.EventRegister.CleanUp,1e+100)}}var R=L[Q];var S=I[R].length;I[R][S]={Handler:P,Priority:N};C(O,Q,R);return{Reg:R,Func:S}}function C(M,O,P){var L=[];for(var Q=0,N=I[P].length;Q<N;Q++){if(I[P][Q].Handler!=null){L[L.length]={Index:Q,Priority:I[P][Q].Priority}}}if(L.length>0){L.sort(function(S,R){return S.Priority-R.Priority})}else{M["on"+O]=null;delete M.owlP[G][O];L=null}A[P]=L;F=false}function D(O){var M=true,Q=new owl.EventInformation(this,O);if(Q.Index&&Q.Index.Reg){var L=A[Q.Index.Reg].slice();for(var P=0,N=L.length;P<N;P++){Q.Index.Func=L[P].Index;if(Q.AllowNext&&I[Q.Index.Reg][Q.Index.Func].Handler){M&=(I[Q.Index.Reg][Q.Index.Func].Handler(Q)!==false)}}}if(F){C(Q.Element,Q.Type,Q.Index.Reg)}return M}function H(N,O,L,M){I[L.Reg][L.Func].Handler=null;if(M){C(N,O,L.Reg)}else{F=true}}function J(){for(var O=0,N=B.length,L=B[0];O<N;L=B[++O]){for(var M in owl.Property.Get(L,G)){L["on"+M]=null}owl.Property.Delete(L,G)}B=null;I=null;A=null}return{Namespace:G,Add:K,Handler:D,Detach:H,CleanUp:J}}();owl.EventInformation=function(A,B){this.Element=A;this.Event=(B?B:window.event);if(this.Event){this.Type=this.Event.type.toLowerCase();this.Target=(this.Event.target?this.Event.target:this.Event.srcElement);this.Index={Reg:this.Element.owlP[owl.EventRegister.Namespace][this.Type],Func:null};this.AllowNext=true}};owl.EventInformation.prototype.Key=function(){if(!this.KeySet){this.KeySet={Pressed:"",Function:"",Shift:this.Event.shiftKey,Ctrl:this.Event.ctrlKey,Alt:this.Event.altKey};if(owl.EventKey.test(this.Type)){var B=this.Event.keyCode;var A=(typeof this.Event.charCode!="undefined"?this.Event.charCode:null);if(A>0){this.KeySet.Pressed=String.fromCharCode(A)}else{if(owl.EventCK[B]&&(A!=null||B<32||(this.Type!="keypress"||(!this.Shift&&B<112&&B!=35&&B!=39&&B!=45&&B!=46)))){this.KeySet.Function=owl.EventCK[B]}else{if(B>=32){this.KeySet.Pressed=String.fromCharCode(B)}}}}}return this.KeySet};owl.EventInformation.prototype.Mouse=function(){if(!this.MouseSet){this.MouseSet={X:0,Y:0};if(owl.EventMouse.test(this.Type)){this.MouseSet.X=(this.Event.pageX?this.Event.pageX:this.Event.clientX+Math.max(document.documentElement.scrollLeft,document.body.scrollLeft));this.MouseSet.Y=(this.Event.pageY?this.Event.pageY:this.Event.clientY+Math.max(document.documentElement.scrollTop,document.body.scrollTop))}}return this.MouseSet};owl.EventInformation.prototype.Detach=function(){owl.EventRegister.Detach(this.Element,this.Type,this.Index)};owl.EventInformation.prototype.StopHandlers=function(){this.AllowNext=false};owl.EventInformation.prototype.StopPropagation=function(){if(this.Event.stopPropagation){this.Event.stopPropagation()}this.Event.cancelBubble=true};owl.EventInformation.prototype.StopDefaultAction=function(){if(this.Event.preventDefault){this.Event.preventDefault()}this.Event.returnValue=false};owl.EventKey=/^key/i;owl.EventMouse=/mouse|click/i;owl.EventCK=[];owl.EventCK[8]="backspace";owl.EventCK[9]="tab";owl.EventCK[13]="enter";owl.EventCK[19]="break";owl.EventCK[27]="esc";owl.EventCK[33]="pageup";owl.EventCK[34]="pagedown";owl.EventCK[35]="end";owl.EventCK[36]="home";owl.EventCK[37]="left";owl.EventCK[38]="up";owl.EventCK[39]="right";owl.EventCK[40]="down";owl.EventCK[45]="insert";owl.EventCK[46]="delete";owl.EventCK[112]="f1";owl.EventCK[113]="f2";owl.EventCK[114]="f3";owl.EventCK[115]="f4";owl.EventCK[116]="f5";owl.EventCK[117]="f6";owl.EventCK[118]="f7";owl.EventCK[119]="f8";owl.EventCK[120]="f9";owl.EventCK[121]="f10";owl.EventCK[122]="f11";owl.EventCK[123]="f12";owl.EventCK[144]="numlock";owl.EventCK[145]="scrolllock";if(history&&history.navigationMode){history.navigationMode="compatible"}}if(owl&&owl.Dom&&owl.Event&&!owl.Ajax){owl.Ajax=function(D,F){this.ID=null;this.Form=null;this.URL=null;this.Method="GET";this.Async=true;this.Timeout=10000;this.Callback={Start:null,Success:null,Fail:null,Timeout:null,Abort:null};this.Status={Active:false,Complete:true,Success:true,Timeout:false,Abort:false};this.Response={Text:null,XML:null};var A={};var E=null;var C=null;var B=null;this.Argument=function(G,H){A[G]=escape(owl.String.Trim(H))};this.Call=function(J){if(!this.Status.Active){C=null;if(this.Method=="SCRIPT"){if(!B){B=owl.Dom.Get("head");if(B.length==1){B=B[0]}}if(B){C=document.createElement("script")}}else{C=this.HttpRequest()}if(C){this.Status={Active:true,Complete:false,Success:false,Timeout:false,Abort:false};this.Response={Text:null,XML:null};this.SetCallback(J);this.CallbackHandler(this.Callback.Start);var G=this;if(this.Form){owl.Each(this.Form.elements,function(L){if(L.name&&L.value){var K=(L.type=="checkbox"||L.type=="radio"?(L.checked?L.value:""):L.value);if(K){G.Argument(L.name,K)}}})}if(owl.Ajax.Config.AjaxIdentifier!=""){this.Argument(owl.Ajax.Config.AjaxIdentifier,owl.Ajax.CallCount++)}var I,H="";for(I in A){if(typeof (A[I])!="function"){H+="&"+I+"="+A[I]}}if(H.length>0){H=H.substr(1)}if(this.Async||this.Method=="SCRIPT"){C.onreadystatechange=function(){G.StateChange()};if(this.Timeout>0){E=setTimeout(function(){G.StateTimeout()},this.Timeout)}}switch(this.Method){case"SCRIPT":C.src=this.URL+(H.length>0?"?"+H:"");C.onload=C.onreadystatechange;B.appendChild(C);break;case"POST":C.open("POST",this.URL,this.Async);C.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");C.send(H);break;default:C.open("GET",this.URL+(H.length>0?"?"+H:""),this.Async);C.send(null);break}if(!this.Async&&this.Method!="SCRIPT"){this.StateChange()}}}};this.StateChange=function(){if(this.Status.Active){this.Status.Complete=(this.Method=="SCRIPT"&&(!C.readyState||C.readyState=="loaded"||C.readyState=="complete"))||(this.Method!="SCRIPT"&&C.readyState==4);if(this.Status.Complete){this.Status.Active=false;if(this.Method=="SCRIPT"){this.Status.Success=true}else{this.Status.Success=((C.status>=200&&C.status<300)||C.status==304||C.status==1223||(owl.Browser.Safari&&C.status==undefined));if(this.Status.Success){this.Response.Text=C.responseText;this.Response.XML=C.responseXML;if(!this.Response.XML||!this.Response.XML.documentElement){this.Response.XML=null}}}this.ClearUp();this.CallbackHandler((this.Status.Success?this.Callback.Success:this.Callback.Fail))}}};this.ClearUp=function(){this.Status.Complete=true;if(E){clearTimeout(E)}E=null;if(C){if(this.Method=="SCRIPT"){B.removeChild(C)}else{C.abort()}}C=null};this.Hijax(D);if(typeof F=="function"){this.SetCallback(F);if(!this.Form){this.Call()}}};owl.Ajax.CallCount=0;owl.Ajax.prototype.Hijax=function(B){if(B&&B.nodeName&&B.nodeName.toLowerCase()=="form"){this.Form=B;this.ID=B.id;this.URL=B.action;this.Method=owl.String.Trim(B.method.toUpperCase());if(this.Method!="GET"&&this.Method!="POST"){this.Method="POST"}var A=this;new owl.Event(B,"submit",function(C){C.StopHandlers();C.StopDefaultAction();A.Call()},999999)}};owl.Ajax.prototype.SetCallback=function(A){if(typeof A=="function"){this.Callback={Start:A,Success:A,Fail:A,Timeout:A,Abort:A}}};owl.Ajax.prototype.CallbackHandler=function(A){if(typeof A=="function"){A(this)}};owl.Ajax.prototype.StateTimeout=function(){if(this.Status.Active){this.Status.Active=false;this.Status.Success=false;this.Status.Timeout=true;this.ClearUp();this.CallbackHandler(this.Callback.Timeout)}};owl.Ajax.prototype.Abort=function(){if(this.Status.Active){this.Status.Active=false;this.Status.Success=false;this.Status.Abort=true;this.ClearUp();this.CallbackHandler(this.Callback.Abort)}};owl.Ajax.prototype.HttpRequest=function(){var C;if(window.XMLHttpRequest){try{C=new XMLHttpRequest()}catch(E){C=null}}else{var A=["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP","Microsoft.XMLHTTP"];for(var D=0,B=A.length;!C&&D<B;D++){try{C=new ActiveXObject(A[D])}catch(E){C=null}}}return C};owl.Ajax.Config={AjaxIdentifier:"ajax"}}if(owl&&!owl.Timer){owl.Timer=function(A,L,D,N,F,C,M){var B=null,E=(D||D==0?D:(A<L?1:-1));var I=(N?N:20),K=(F?F:0),J=(C?C:0);this.StartValue=(A?A:0);this.StopValue=(L||L==0?L:100);this.Value=this.StartValue;this.CallBack=(M?M:null);this.OnStart=null;this.OnStop=null;this.OnReverse=null;var H=false;var G=this;this.SetStep=function(O){if(O==0){this.Stop();E=0}else{if((O<0&&this.StartValue<this.StopValue)||(O>0&&this.StartValue>this.StopValue)){E=-O;this.Reverse()}else{E=O}this.Start()}};this.GetStep=function(){return E};this.Start=function(){if(!B){H=false;var P=function(Q){if(!H){if(Q){if(G.OnStart){G.OnStart(G)}if(G.CallBack){G.CallBack(G)}}B=setInterval(function(){G.Run()},I)}};var O=(this.Value==this.StartValue);if(O&&K>0){setTimeout(function(){P(O)},K)}else{P(O)}}};this.Run=function(){this.Value+=E;this.Value=(E>0?Math.min(this.Value,this.StopValue):Math.max(this.Value,this.StopValue));if(this.CallBack){this.CallBack(this)}if(this.Value==this.StopValue){this.Stop()}};this.Reverse=function(){var O=this.StartValue;this.StartValue=this.StopValue;this.StopValue=O;E=-E;if(this.OnReverse){this.OnReverse(this)}};this.Stop=function(){H=true;if(B){B=clearInterval(B);if(this.Value==this.StopValue){setTimeout(function(){if(G.OnStop){G.OnStop(G)}},J)}}};if(this.CallBack){this.Start()}}}if(owl&&owl.Dom&&owl.Timer&&!owl.Screen){owl.Screen=function(){var I=function(){var K=owl.Dom.Get("body");if(K.length==1){I=function(){return K[0]};return I()}else{return null}};function F(K){var L={X:K.offsetLeft-K.scrollLeft,Y:K.offsetTop-K.scrollTop};while((K=K.offsetParent)){L.X+=K.offsetLeft-K.scrollLeft;L.Y+=K.offsetTop-K.scrollTop}return L}var H;function G(){if(!H){if(window.innerWidth){H=function(){return{Width:window.innerWidth,Height:window.innerHeight}}}else{if(document.documentElement&&document.documentElement.clientWidth){H=function(){return{Width:document.documentElement.clientWidth,Height:document.documentElement.clientHeight}}}else{H=function(){return{Width:(I()?I().clientWidth:0),Height:(I()?I().clientHeight:0)}}}}}return H()}function B(){return{X:window.pageXOffset||(document.documentElement&&document.documentElement.scrollLeft)||(I()&&I().scrollLeft),Y:window.pageYOffset||(document.documentElement&&document.documentElement.scrollTop)||(I()&&I().scrollTop)}}function J(){var K={Width:0,Height:0};if(I()){if(document.documentElement&&document.documentElement.scrollWidth){K.Width=document.documentElement.scrollWidth;K.Height=document.documentElement.scrollHeight}else{if(I().offsetWidth){K.Width=I().offsetWidth;K.Height=I().offsetHeight}}}return K}var A=function(){var K={};K.Width=(screen.width?screen.width:null);K.Height=(screen.height?screen.height:null);K.AvailWidth=(screen.availWidth?screen.availWidth:K.Width);K.AvailHeight=(screen.availHeight?screen.availHeight:K.Height);K.AvailLeft=(screen.availLeft?screen.availTop:0);K.AvailTop=(screen.availTop?screen.availTop:0);K.ColorDepth=(screen.colorDepth?screen.colorDepth:(screen.pixelDepth?screen.pixelDepth:null));A=function(){return K};return A()};var E=null;function C(M,L,K,N){if(K===false){window.scrollTo(M,L);if(typeof N=="function"){N()}}else{if(E){E.Stop()}E=new owl.Timer(owl.Screen.Config.MoveFrames,1,-1,owl.Screen.Config.MovePause,0,0,function(Q){var P=B();var R=Math.sqrt(Q.Value);window.scrollTo(P.X+Math.ceil((M-P.X)/R),P.Y+Math.ceil((L-P.Y)/R));var O=B();if(O.X==P.X&&O.Y==P.Y){Q.Stop();if(typeof N=="function"){N();N=null}}})}}function D(O,N,U,R,K,T,M,V){if(T!==true){var L=G();N=Math.floor((N/100)*L.Width);U=Math.ceil((U/100)*L.Width);R=Math.floor((R/100)*L.Height);K=Math.ceil((K/100)*L.Height)}var P=F(O);var W=B();var S=(P.X<W.X+N?P.X-N:(P.X>W.X+U?P.X-U:W.X));var Q=(P.Y<W.Y+R?P.Y-R:(P.Y>W.Y+K?P.Y-K:W.Y));C(S,Q,M,V)}return{Location:F,ViewPort:G,ViewScroll:B,Page:J,Resolution:A,ScrollTo:C,ScrollToElement:D}}();owl.Screen.Config={MoveFrames:50,MovePause:20}}var cm={};cm.Initialise=function(){cm.Setup={EmailNode:"a.email",Refer:{Form:"#refer",Check:[{Field:"#refername",Validate:cm.Validate.String,Req:true,Min:1,Max:80},{Field:"#referemail",Validate:cm.Validate.Email,Req:true,Min:6,Max:80},{Field:"#yourname",Validate:cm.Validate.String,Req:true,Min:1,Max:80},{Field:"#youremail",Validate:cm.Validate.Email,Req:true,Min:6,Max:80}],StatusElement:"p",ErrorClass:"error",AjaxClass:{Send:"active",Fail:"error"},AjaxMessage:{Send:"\u00A0",Fail:"referral failed - please try later"}},Contact:{Form:"#enquiry",ErrorClass:"error",Check:[{Field:"#school",Validate:cm.Validate.String,Req:true,Min:5,Max:100},{Field:"#contact",Validate:cm.Validate.String,Req:true,Min:1,Max:80},{Field:"#telephone",Validate:cm.Validate.String,Req:false,Min:6,Max:20,Additonal:function(C){var A=true;if(C==""){var B=owl.Dom.Get("#email");if(B.length==1){A=cm.Validate.Email(B[0].value,true,6,80)}}return A}},{Field:"#email",Validate:cm.Validate.Email,Req:false,Min:6,Max:80,Additonal:function(C){var A=true;if(C==""){var B=owl.Dom.Get("#telephone");if(B.length==1){A=(owl.String.Trim(B[0].value).length>=6)}}return A}}]},Analytics:"UA-114126-10"}};cm.Start=function(){cm.Initialise();cm.EmailParse();cm.Refer.Init();new cm.Validator(cm.Setup.Contact);cm.Analytics()};new owl.Event(window,"load",cm.Start,0);cm.EmailParse=function(){owl.Each(owl.Dom.Get(cm.Setup.EmailNode),function(A){if(A.firstChild){var B=A.firstChild.nodeValue;B=B.replace(/dot/ig,".");B=B.replace(/\{at\}/ig,"@");B=B.replace(/\s/g,"");A.href="mailto:"+B;owl.Dom.Text(A,B)}})};cm.Refer=function(){var B,D,C,G,A;function F(){B=cm.Setup.Refer;D=owl.Dom.Get(B.Form);if(D.length==1){D=D[0];var H=owl.Dom.Get("input",D);C=H[0];G=H[1];A=owl.Dom.Get(B.StatusElement,D)[0];new cm.Validator(B);new owl.Ajax(D,E)}}function E(H){owl.Css.ClassRemove(A,B.AjaxClass.Fail);if(!H.Status.Complete){owl.Css.ClassApply(A,B.AjaxClass.Send);owl.Screen.ScrollToElement(A,0,100,0,90);owl.Dom.Text(A,B.AjaxMessage.Send)}else{owl.Css.ClassRemove(A,B.AjaxClass.Send);if(H.Status.Success){var I=H.Response.XML;var J=(I.getElementsByTagName("success")[0].firstChild.nodeValue.toLowerCase()=="true");owl.Dom.Text(A,String(I.getElementsByTagName("message")[0].firstChild.nodeValue));if(J){C.value="";G.value="";C.select();C.focus()}else{owl.Css.ClassApply(A,B.AjaxClass.Fail)}}else{owl.Css.ClassApply(A,B.AjaxClass.Fail);owl.Dom.Text(A,B.AjaxMessage.Fail)}}}return{Init:F}}();cm.Validator=function(A){var C=owl.Dom.Get(A.Form);if(C.length==1){this.Form=C[0];this.ErrorClass=A.ErrorClass;this.Fields=A.Check;var B=this;new owl.Event(C,"submit",function(D){B.Check(D)},0)}};cm.Validator.prototype.Check=function(A){var D=true;var C=this.Form;var B=this.ErrorClass;owl.Each(this.Fields,function(G){var H=owl.Dom.Get(G.Field,C);if(H.length==1){H=H[0]}if(H&&G.Validate){var F=owl.String.Trim(H.value);if(F!=H.value){H.value=F}var E=G.Validate(F,G.Req,G.Min,G.Max);if(G.Additonal){E&=G.Additonal(F)}if(!E){if(D&&H.select&&H.focus){H.select();H.focus()}owl.Css.ClassApply(H.parentNode,B);D=false}else{owl.Css.ClassRemove(H.parentNode,B)}}});if(!D){A.StopDefaultAction();A.StopHandlers()}return D};cm.Validate=function(){function B(G,F,E,D){return !F||(G&&(!E||G.length>=E)&&(!D||G.length<=D))}var A=/^[^@]+@[a-z0-9]+([_\.\-]{0,1}[a-z0-9]+)*([\.]{1}[a-z0-9]+)+$/;function C(H,G,E,D){H=H.toLowerCase();var F=(H!=""&&(!E||H.length>=E)&&(!D||H.length<=D)&&(H.replace(A,"")==""));return(F||(!G&&H==""))}return{String:B,Email:C}}();cm.Analytics=function(){if(typeof _gat!="undefined"&&_gat._getTracker){var A=_gat._getTracker(cm.Setup.Analytics);A._initData();A._trackPageview()}};