var build_date="Thu Mar 18 12:34:14 2010";var s2KeyCode={BACKSPACE:8,TAB:9,ENTER:13,ESC:27,leftarrow:37,uparrow:38,rightarrow:39,downarrow:40};(function(){var L=this,G,Y=L.jQuery,P=L.$,O=L.jQuery=L.$=function(e,f){return new O.fn.init(e,f)},d=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,F=/^.[^:#\[\.,]*$/;O.fn=O.prototype={init:function(e,h){e=e||document;if(e.nodeType){this[0]=e;this.length=1;this.context=e;return this}if(typeof e==="string"){var g=d.exec(e);if(g&&(g[1]||!h)){if(g[1]){e=O.clean([g[1]],h)}else{var m=document.getElementById(g[3]);if(m&&m.id!=g[3]){return O().find(e)}var f=O(m||[]);f.context=document;f.selector=e;return f}}else{return O(h).find(e)}}else{if(O.isFunction(e)){return O(document).ready(e)}}if(e.selector&&e.context){this.selector=e.selector;this.context=e.context}return this.setArray(O.isArray(e)?e:O.makeArray(e))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(e){return e===G?Array.prototype.slice.call(this):this[e]},pushStack:function(f,h,e){var g=O(f);g.prevObject=this;g.context=this.context;if(h==="find"){g.selector=this.selector+(this.selector?" ":"")+e}else{if(h){g.selector=this.selector+"."+h+"("+e+")"}}return g},setArray:function(e){this.length=0;Array.prototype.push.apply(this,e);return this},each:function(f,e){return O.each(this,f,e)},index:function(e){return O.inArray(e&&e.jquery?e[0]:e,this)},attr:function(f,h,g){var e=f;if(typeof f==="string"){if(h===G){return this[0]&&O[g||"attr"](this[0],f)}else{e={};e[f]=h}}return this.each(function(m){for(f in e){O.attr(g?this.style:this,f,O.prop(this,e[f],g,m,f))}})},css:function(e,f){if((e=="width"||e=="height")&&parseFloat(f)<0){f=G}return this.attr(e,f,"curCSS")},text:function(f){if(typeof f!=="object"&&f!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(f))}var e="";O.each(f||this,function(){O.each(this.childNodes,function(){if(this.nodeType!=8){e+=this.nodeType!=1?this.nodeValue:O.fn.text([this])}})});return e},wrapAll:function(e){if(this[0]){var f=O(e,this[0].ownerDocument).clone();if(this[0].parentNode){f.insertBefore(this[0])}f.map(function(){var g=this;while(g.firstChild){g=g.firstChild}return g}).append(this)}return this},wrapInner:function(e){return this.each(function(){O(this).contents().wrapAll(e)})},wrap:function(e){return this.each(function(){O(this).wrapAll(e)})},append:function(){return this.domManip(arguments,true,function(e){if(this.nodeType==1){this.appendChild(e)}})},prepend:function(){return this.domManip(arguments,true,function(e){if(this.nodeType==1){this.insertBefore(e,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(e){this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,false,function(e){this.parentNode.insertBefore(e,this.nextSibling)})},end:function(){return this.prevObject||O([])},push:[].push,sort:[].sort,splice:[].splice,find:function(e){if(this.length===1){var f=this.pushStack([],"find",e);f.length=0;O.find(e,this[0],f);return f}else{return this.pushStack(O.unique(O.map(this,function(g){return O.find(e,g)})),"find",e)}},clone:function(g){var e=this.map(function(){if(!O.support.noCloneEvent&&!O.isXMLDoc(this)){var m=this.outerHTML;if(!m){var n=this.ownerDocument.createElement("div");n.appendChild(this.cloneNode(true));m=n.innerHTML}return O.clean([m.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(g===true){var h=this.find("*").andSelf(),f=0;e.find("*").andSelf().each(function(){if(this.nodeName!==h[f].nodeName){return}var m=O.data(h[f],"events");for(var o in m){for(var n in m[o]){O.event.add(this,o,m[o][n],m[o][n].data)}}f++})}return e},filter:function(e){return this.pushStack(O.isFunction(e)&&O.grep(this,function(g,f){return e.call(g,f)})||O.multiFilter(e,O.grep(this,function(f){return f.nodeType===1})),"filter",e)},closest:function(e){var g=O.expr.match.POS.test(e)?O(e):null,f=0;return this.map(function(){var h=this;while(h&&h.ownerDocument){if(g?g.index(h)>-1:O(h).is(e)){O.data(h,"closest",f);return h}h=h.parentNode;f++}})},not:function(e){if(typeof e==="string"){if(F.test(e)){return this.pushStack(O.multiFilter(e,this,true),"not",e)}else{e=O.multiFilter(e,this)}}var f=e.length&&e[e.length-1]!==G&&!e.nodeType;return this.filter(function(){return f?O.inArray(this,e)<0:this!=e})},add:function(e){return this.pushStack(O.unique(O.merge(this.get(),typeof e==="string"?O(e):O.makeArray(e))))},is:function(e){return !!e&&O.multiFilter(e,this).length>0},hasClass:function(e){return !!e&&this.is("."+e)},val:function(o){if(o===G){var e=this[0];if(e){if(O.nodeName(e,"option")){return(e.attributes.value||{}).specified?e.value:e.text}if(O.nodeName(e,"select")){var m=e.selectedIndex,p=[],q=e.options,h=e.type=="select-one";if(m<0){return null}for(var f=h?m:0,n=h?m+1:q.length;f<n;f++){var g=q[f];if(g.selected){o=O(g).val();if(h){return o}p.push(o)}}return p}return(e.value||"").replace(/\r/g,"")}return G}if(typeof o==="number"){o+=""}return this.each(function(){if(this.nodeType!=1){return}if(O.isArray(o)&&/radio|checkbox/.test(this.type)){this.checked=(O.inArray(this.value,o)>=0||O.inArray(this.name,o)>=0)}else{if(O.nodeName(this,"select")){var t=O.makeArray(o);O("option",this).each(function(){this.selected=(O.inArray(this.value,t)>=0||O.inArray(this.text,t)>=0)});if(!t.length){this.selectedIndex=-1}}else{this.value=o}}})},html:function(e){return e===G?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(e)},replaceWith:function(e){return this.after(e).remove()},eq:function(e){return this.slice(e,+e+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(e){return this.pushStack(O.map(this,function(g,f){return e.call(g,f,g)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(n,q,p){if(this[0]){var m=(this[0].ownerDocument||this[0]).createDocumentFragment(),f=O.clean(n,(this[0].ownerDocument||this[0]),m),h=m.firstChild;if(h){for(var g=0,e=this.length;g<e;g++){p.call(o(this[g],h),this.length>1||g>0?m.cloneNode(true):m)}}if(f){O.each(f,Z)}}return this;function o(t,u){return q&&O.nodeName(t,"table")&&O.nodeName(u,"tr")?(t.getElementsByTagName("tbody")[0]||t.appendChild(t.ownerDocument.createElement("tbody"))):t}}};O.fn.init.prototype=O.fn;function Z(e,f){if(f.src){O.ajax({url:f.src,async:false,dataType:"script"})}else{O.globalEval(f.text||f.textContent||f.innerHTML||"")}if(f.parentNode){f.parentNode.removeChild(f)}}function E(){return +new Date}O.extend=O.fn.extend=function(){var n=arguments[0]||{},h=1,m=arguments.length,e=false,g;if(typeof n==="boolean"){e=n;n=arguments[1]||{};h=2}if(typeof n!=="object"&&!O.isFunction(n)){n={}}if(m==h){n=this;--h}for(;h<m;h++){if((g=arguments[h])!=null){for(var f in g){var o=n[f],p=g[f];if(n===p){continue}if(e&&p&&typeof p==="object"&&!p.nodeType){n[f]=O.extend(e,o||(p.length!=null?[]:{}),p)}else{if(p!==G){n[f]=p}}}}}return n};var B=/z-?index|font-?weight|opacity|zoom|line-?height/i,Q=document.defaultView||{},S=Object.prototype.toString;O.extend({noConflict:function(e){L.$=P;if(e){L.jQuery=Y}return O},isFunction:function(e){return S.call(e)==="[object Function]"},isArray:function(e){return S.call(e)==="[object Array]"},isXMLDoc:function(e){return e.nodeType===9&&e.documentElement.nodeName!=="HTML"||!!e.ownerDocument&&O.isXMLDoc(e.ownerDocument)},globalEval:function(g){if(g&&/\S/.test(g)){var f=document.getElementsByTagName("head")[0]||document.documentElement,e=document.createElement("script");e.type="text/javascript";if(O.support.scriptEval){e.appendChild(document.createTextNode(g))}else{e.text=g}f.insertBefore(e,f.firstChild);f.removeChild(e)}},nodeName:function(f,e){return f.nodeName&&f.nodeName.toUpperCase()==e.toUpperCase()},each:function(g,o,f){var e,h=0,m=g.length;if(f){if(m===G){for(e in g){if(o.apply(g[e],f)===false){break}}}else{for(;h<m;){if(o.apply(g[h++],f)===false){break}}}}else{if(m===G){for(e in g){if(o.call(g[e],e,g[e])===false){break}}}else{for(var n=g[0];h<m&&o.call(n,h,n)!==false;n=g[++h]){}}}return g},prop:function(h,m,g,f,e){if(O.isFunction(m)){m=m.call(h,f)}return typeof m==="number"&&g=="curCSS"&&!B.test(e)?m+"px":m},className:{add:function(e,f){O.each((f||"").split(/\s+/),function(g,h){if(e.nodeType==1&&!O.className.has(e.className,h)){e.className+=(e.className?" ":"")+h}})},remove:function(e,f){if(e.nodeType==1){e.className=f!==G?O.grep(e.className.split(/\s+/),function(g){return !O.className.has(f,g)}).join(" "):""}},has:function(f,e){return f&&O.inArray(e,(f.className||f).toString().split(/\s+/))>-1}},swap:function(h,g,m){var e={};for(var f in g){e[f]=h.style[f];h.style[f]=g[f]}m.call(h);for(var f in g){h.style[f]=e[f]}},css:function(h,f,n,e){if(f=="width"||f=="height"){var p,g={position:"absolute",visibility:"hidden",display:"block"},o=f=="width"?["Left","Right"]:["Top","Bottom"];function m(){p=f=="width"?h.offsetWidth:h.offsetHeight;if(e==="border"){return}O.each(o,function(){if(!e){p-=parseFloat(O.curCSS(h,"padding"+this,true))||0}if(e==="margin"){p+=parseFloat(O.curCSS(h,"margin"+this,true))||0}else{p-=parseFloat(O.curCSS(h,"border"+this+"Width",true))||0}})}if(h.offsetWidth!==0){m()}else{O.swap(h,g,m)}return Math.max(0,Math.round(p))}return O.curCSS(h,f,n)},curCSS:function(m,f,g){var p,e=m.style;if(f=="opacity"&&!O.support.opacity){p=O.attr(e,"opacity");return p==""?"1":p}if(f.match(/float/i)){f=W}if(!g&&e&&e[f]){p=e[f]}else{if(Q.getComputedStyle){if(f.match(/float/i)){f="float"}f=f.replace(/([A-Z])/g,"-$1").toLowerCase();var q=Q.getComputedStyle(m,null);if(q){p=q.getPropertyValue(f)}if(f=="opacity"&&p==""){p="1"}}else{if(m.currentStyle){var n=f.replace(/\-(\w)/g,function(t,u){return u.toUpperCase()});p=m.currentStyle[f]||m.currentStyle[n];if(!/^\d+(px)?$/i.test(p)&&/^\d/.test(p)){var h=e.left,o=m.runtimeStyle.left;m.runtimeStyle.left=m.currentStyle.left;e.left=p||0;p=e.pixelLeft+"px";e.left=h;m.runtimeStyle.left=o}}}}return p},clean:function(f,o,m){o=o||document;if(typeof o.createElement==="undefined"){o=o.ownerDocument||o[0]&&o[0].ownerDocument||document}if(!m&&f.length===1&&typeof f[0]==="string"){var h=/^<(\w+)\s*\/?>$/.exec(f[0]);if(h){return[o.createElement(h[1])]}}var g=[],e=[],p=o.createElement("div");O.each(f,function(v,y){if(typeof y==="number"){y+=""}if(!y){return}if(typeof y==="string"){y=y.replace(/(<(\w+)[^>]*?)\/>/g,function(Aa,Ab,z){return z.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?Aa:Ab+"></"+z+">"});var u=y.replace(/^\s+/,"").substring(0,10).toLowerCase();var w=!u.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!u.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||u.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!u.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!u.indexOf("<td")||!u.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!u.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!O.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];p.innerHTML=w[1]+y+w[2];while(w[0]--){p=p.lastChild}if(!O.support.tbody){var x=/<tbody/i.test(y),t=!u.indexOf("<table")&&!x?p.firstChild&&p.firstChild.childNodes:w[1]=="<table>"&&!x?p.childNodes:[];for(var q=t.length-1;q>=0;--q){if(O.nodeName(t[q],"tbody")&&!t[q].childNodes.length){t[q].parentNode.removeChild(t[q])}}}if(!O.support.leadingWhitespace&&/^\s/.test(y)){p.insertBefore(o.createTextNode(y.match(/^\s*/)[0]),p.firstChild)}y=O.makeArray(p.childNodes)}if(y.nodeType){g.push(y)}else{g=O.merge(g,y)}});if(m){for(var n=0;g[n];n++){if(O.nodeName(g[n],"script")&&(!g[n].type||g[n].type.toLowerCase()==="text/javascript")){e.push(g[n].parentNode?g[n].parentNode.removeChild(g[n]):g[n])}else{if(g[n].nodeType===1){g.splice.apply(g,[n+1,0].concat(O.makeArray(g[n].getElementsByTagName("script"))))}m.appendChild(g[n])}}return e}return g},attr:function(n,g,o){if(!n||n.nodeType==3||n.nodeType==8){return G}var h=!O.isXMLDoc(n),p=o!==G;g=h&&O.props[g]||g;if(n.tagName){var f=/href|src|style/.test(g);if(g=="selected"&&n.parentNode){n.parentNode.selectedIndex}if(g in n&&h&&!f){if(p){if(g=="type"&&O.nodeName(n,"input")&&n.parentNode){throw"type property can't be changed"}n[g]=o}if(O.nodeName(n,"form")&&n.getAttributeNode(g)){return n.getAttributeNode(g).nodeValue}if(g=="tabIndex"){var m=n.getAttributeNode("tabIndex");return m&&m.specified?m.value:n.nodeName.match(/(button|input|object|select|textarea)/i)?0:n.nodeName.match(/^(a|area)$/i)&&n.href?0:G}return n[g]}if(!O.support.style&&h&&g=="style"){return O.attr(n.style,"cssText",o)}if(p){n.setAttribute(g,""+o)}var e=!O.support.hrefNormalized&&h&&f?n.getAttribute(g,2):n.getAttribute(g);return e===null?G:e}if(!O.support.opacity&&g=="opacity"){if(p){n.zoom=1;n.filter=(n.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(o)+""=="NaN"?"":"alpha(opacity="+o*100+")")}return n.filter&&n.filter.indexOf("opacity=")>=0?(parseFloat(n.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}g=g.replace(/-([a-z])/ig,function(q,t){return t.toUpperCase()});if(p){n[g]=o}return n[g]},trim:function(e){return(e||"").replace(/^\s+|\s+$/g,"")},makeArray:function(g){var e=[];if(g!=null){var f=g.length;if(f==null||typeof g==="string"||O.isFunction(g)||g.setInterval){e[0]=g}else{while(f){e[--f]=g[f]}}}return e},inArray:function(g,h){for(var e=0,f=h.length;e<f;e++){if(h[e]===g){return e}}return -1},merge:function(h,e){var f=0,g,m=h.length;if(!O.support.getAll){while((g=e[f++])!=null){if(g.nodeType!=8){h[m++]=g}}}else{while((g=e[f++])!=null){h[m++]=g}}return h},unique:function(p){var g=[],f={};try{for(var h=0,m=p.length;h<m;h++){var o=O.data(p[h]);if(!f[o]){f[o]=true;g.push(p[h])}}}catch(n){g=p}return g},grep:function(f,n,e){var g=[];for(var h=0,m=f.length;h<m;h++){if(!e!=!n(f[h],h)){g.push(f[h])}}return g},map:function(e,n){var f=[];for(var g=0,h=e.length;g<h;g++){var m=n(e[g],g);if(m!=null){f[f.length]=m}}return f.concat.apply([],f)}});var c=navigator.userAgent.toLowerCase();O.browser={version:(c.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(c),opera:/opera/.test(c),msie:/msie/.test(c)&&!/opera/.test(c),mozilla:/mozilla/.test(c)&&!/(compatible|webkit)/.test(c)};O.each({parent:function(e){return e.parentNode},parents:function(e){return O.dir(e,"parentNode")},next:function(e){return O.nth(e,2,"nextSibling")},prev:function(e){return O.nth(e,2,"previousSibling")},nextAll:function(e){return O.dir(e,"nextSibling")},prevAll:function(e){return O.dir(e,"previousSibling")},siblings:function(e){return O.sibling(e.parentNode.firstChild,e)},children:function(e){return O.sibling(e.firstChild)},contents:function(e){return O.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:O.makeArray(e.childNodes)}},function(e,f){O.fn[e]=function(g){var h=O.map(this,f);if(g&&typeof g=="string"){h=O.multiFilter(g,h)}return this.pushStack(O.unique(h),e,g)}});O.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,f){O.fn[e]=function(g){var n=[],p=O(g);for(var o=0,h=p.length;o<h;o++){var m=(o>0?this.clone(true):this).get();O.fn[f].apply(O(p[o]),m);n=n.concat(m)}return this.pushStack(n,e,g)}});O.each({removeAttr:function(e){O.attr(this,e,"");if(this.nodeType==1){this.removeAttribute(e)}},addClass:function(e){O.className.add(this,e)},removeClass:function(e){O.className.remove(this,e)},toggleClass:function(f,e){if(typeof e!=="boolean"){e=!O.className.has(this,f)}O.className[e?"add":"remove"](this,f)},remove:function(e){if(!e||O.filter(e,[this]).length){O("*",this).add([this]).each(function(){O.event.remove(this);O.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){O(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(e,f){O.fn[e]=function(){return this.each(f,arguments)}});function J(e,f){return e[0]&&parseInt(O.curCSS(e[0],f,true),10)||0}var H="jQuery"+E(),V=0,a={};O.extend({cache:{},data:function(f,e,g){f=f==L?a:f;var h=f[H];if(!h){h=f[H]=++V}if(e&&!O.cache[h]){O.cache[h]={}}if(g!==G){O.cache[h][e]=g}return e?O.cache[h][e]:h},removeData:function(g,f){g=g==L?a:g;var m=g[H];if(f){if(O.cache[m]){delete O.cache[m][f];f="";for(f in O.cache[m]){break}if(!f){O.removeData(g)}}}else{try{delete g[H]}catch(h){if(g.removeAttribute){g.removeAttribute(H)}}delete O.cache[m]}},queue:function(f,e,h){if(f){e=(e||"fx")+"queue";var g=O.data(f,e);if(!g||O.isArray(h)){g=O.data(f,e,O.makeArray(h))}else{if(h){g.push(h)}}}return g},dequeue:function(h,g){var e=O.queue(h,g),f=e.shift();if(!g||g==="fx"){f=e[0]}if(f!==G){f.call(h)}}});O.fn.extend({data:function(e,g){var h=e.split(".");h[1]=h[1]?"."+h[1]:"";if(g===G){var f=this.triggerHandler("getData"+h[1]+"!",[h[0]]);if(f===G&&this.length){f=O.data(this[0],e)}return f===G&&h[1]?this.data(h[0]):f}else{return this.trigger("setData"+h[1]+"!",[h[0],g]).each(function(){O.data(this,e,g)})}},removeData:function(e){return this.each(function(){O.removeData(this,e)})},queue:function(e,f){if(typeof e!=="string"){f=e;e="fx"}if(f===G){return O.queue(this[0],e)}return this.each(function(){var g=O.queue(this,e,f);if(e=="fx"&&g.length==1){g[0].call(this)}})},dequeue:function(e){return this.each(function(){O.dequeue(this,e)})}});(function(){var y=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,q=0,m=Object.prototype.toString;var g=function(Ae,Aa,Ah,Ai){Ah=Ah||[];Aa=Aa||document;if(Aa.nodeType!==1&&Aa.nodeType!==9){return[]}if(!Ae||typeof Ae!=="string"){return Ah}var Af=[],Ac,Al,Ao,e,Aj,Ab,Ad=true;y.lastIndex=0;while((Ac=y.exec(Ae))!==null){Af.push(Ac[1]);if(Ac[2]){Ab=RegExp.rightContext;break}}if(Af.length>1&&t.exec(Ae)){if(Af.length===2&&n.relative[Af[0]]){Al=o(Af[0]+Af[1],Aa)}else{Al=n.relative[Af[0]]?[Aa]:g(Af.shift(),Aa);while(Af.length){Ae=Af.shift();if(n.relative[Ae]){Ae+=Af.shift()}Al=o(Ae,Al)}}}else{var Ak=Ai?{expr:Af.pop(),set:f(Ai)}:g.find(Af.pop(),Af.length===1&&Aa.parentNode?Aa.parentNode:Aa,x(Aa));Al=g.filter(Ak.expr,Ak.set);if(Af.length>0){Ao=f(Al)}else{Ad=false}while(Af.length){var An=Af.pop(),Am=An;if(!n.relative[An]){An=""}else{Am=Af.pop()}if(Am==null){Am=Aa}n.relative[An](Ao,Am,x(Aa))}}if(!Ao){Ao=Al}if(!Ao){throw"Syntax error, unrecognized expression: "+(An||Ae)}if(m.call(Ao)==="[object Array]"){if(!Ad){Ah.push.apply(Ah,Ao)}else{if(Aa.nodeType===1){for(var Ag=0;Ao[Ag]!=null;Ag++){if(Ao[Ag]&&(Ao[Ag]===true||Ao[Ag].nodeType===1&&p(Aa,Ao[Ag]))){Ah.push(Al[Ag])}}}else{for(var Ag=0;Ao[Ag]!=null;Ag++){if(Ao[Ag]&&Ao[Ag].nodeType===1){Ah.push(Al[Ag])}}}}}else{f(Ao,Ah)}if(Ab){g(Ab,Aa,Ah,Ai);if(h){hasDuplicate=false;Ah.sort(h);if(hasDuplicate){for(var Ag=1;Ag<Ah.length;Ag++){if(Ah[Ag]===Ah[Ag-1]){Ah.splice(Ag--,1)}}}}}return Ah};g.matches=function(e,Aa){return g(e,null,null,Aa)};g.find=function(Ag,e,Ah){var Af,Ad;if(!Ag){return[]}for(var Ac=0,Ab=n.order.length;Ac<Ab;Ac++){var Ae=n.order[Ac],Ad;if((Ad=n.match[Ae].exec(Ag))){var Aa=RegExp.leftContext;if(Aa.substr(Aa.length-1)!=="\\"){Ad[1]=(Ad[1]||"").replace(/\\/g,"");Af=n.find[Ae](Ad,e,Ah);if(Af!=null){Ag=Ag.replace(n.match[Ae],"");break}}}}if(!Af){Af=e.getElementsByTagName("*")}return{set:Af,expr:Ag}};g.filter=function(Aj,Ai,Am,Ac){var Ab=Aj,Ao=[],Ag=Ai,Ae,e,Af=Ai&&Ai[0]&&x(Ai[0]);while(Aj&&Ai.length){for(var Ah in n.filter){if((Ae=n.match[Ah].exec(Aj))!=null){var Aa=n.filter[Ah],An,Al;e=false;if(Ag==Ao){Ao=[]}if(n.preFilter[Ah]){Ae=n.preFilter[Ah](Ae,Ag,Am,Ao,Ac,Af);if(!Ae){e=An=true}else{if(Ae===true){continue}}}if(Ae){for(var Ad=0;(Al=Ag[Ad])!=null;Ad++){if(Al){An=Aa(Al,Ae,Ad,Ag);var Ak=Ac^!!An;if(Am&&An!=null){if(Ak){e=true}else{Ag[Ad]=false}}else{if(Ak){Ao.push(Al);e=true}}}}}if(An!==G){if(!Am){Ag=Ao}Aj=Aj.replace(n.match[Ah],"");if(!e){return[]}break}}}if(Aj==Ab){if(e==null){throw"Syntax error, unrecognized expression: "+Aj}else{break}}Ab=Aj}return Ag};var n=g.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(e){return e.getAttribute("href")}},relative:{"+":function(Ag,e,Af){var Ad=typeof e==="string",Ah=Ad&&!/\W/.test(e),Ae=Ad&&!Ah;if(Ah&&!Af){e=e.toUpperCase()}for(var Ac=0,Ab=Ag.length,Aa;Ac<Ab;Ac++){if((Aa=Ag[Ac])){while((Aa=Aa.previousSibling)&&Aa.nodeType!==1){}Ag[Ac]=Ae||Aa&&Aa.nodeName===e?Aa||false:Aa===e}}if(Ae){g.filter(e,Ag,true)}},">":function(Af,Aa,Ag){var Ad=typeof Aa==="string";if(Ad&&!/\W/.test(Aa)){Aa=Ag?Aa:Aa.toUpperCase();for(var Ab=0,e=Af.length;Ab<e;Ab++){var Ae=Af[Ab];if(Ae){var Ac=Ae.parentNode;Af[Ab]=Ac.nodeName===Aa?Ac:false}}}else{for(var Ab=0,e=Af.length;Ab<e;Ab++){var Ae=Af[Ab];if(Ae){Af[Ab]=Ad?Ae.parentNode:Ae.parentNode===Aa}}if(Ad){g.filter(Aa,Af,true)}}},"":function(Ac,Aa,Ae){var Ab=q++,e=z;if(!Aa.match(/\W/)){var Ad=Aa=Ae?Aa:Aa.toUpperCase();e=w}e("parentNode",Aa,Ab,Ac,Ad,Ae)},"~":function(Ac,Aa,Ae){var Ab=q++,e=z;if(typeof Aa==="string"&&!Aa.match(/\W/)){var Ad=Aa=Ae?Aa:Aa.toUpperCase();e=w}e("previousSibling",Aa,Ab,Ac,Ad,Ae)}},find:{ID:function(Aa,Ab,Ac){if(typeof Ab.getElementById!=="undefined"&&!Ac){var e=Ab.getElementById(Aa[1]);return e?[e]:[]}},NAME:function(Ab,Ae,Af){if(typeof Ae.getElementsByName!=="undefined"){var Aa=[],Ad=Ae.getElementsByName(Ab[1]);for(var Ac=0,e=Ad.length;Ac<e;Ac++){if(Ad[Ac].getAttribute("name")===Ab[1]){Aa.push(Ad[Ac])}}return Aa.length===0?null:Aa}},TAG:function(e,Aa){return Aa.getElementsByTagName(e[1])}},preFilter:{CLASS:function(Ac,Aa,Ab,e,Af,Ag){Ac=" "+Ac[1].replace(/\\/g,"")+" ";if(Ag){return Ac}for(var Ad=0,Ae;(Ae=Aa[Ad])!=null;Ad++){if(Ae){if(Af^(Ae.className&&(" "+Ae.className+" ").indexOf(Ac)>=0)){if(!Ab){e.push(Ae)}}else{if(Ab){Aa[Ad]=false}}}}return false},ID:function(e){return e[1].replace(/\\/g,"")},TAG:function(Aa,e){for(var Ab=0;e[Ab]===false;Ab++){}return e[Ab]&&x(e[Ab])?Aa[1]:Aa[1].toUpperCase()},CHILD:function(e){if(e[1]=="nth"){var Aa=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(e[2]=="even"&&"2n"||e[2]=="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(Aa[1]+(Aa[2]||1))-0;e[3]=Aa[3]-0}e[0]=q++;return e},ATTR:function(Ad,Aa,Ab,e,Ae,Af){var Ac=Ad[1].replace(/\\/g,"");if(!Af&&n.attrMap[Ac]){Ad[1]=n.attrMap[Ac]}if(Ad[2]==="~="){Ad[4]=" "+Ad[4]+" "}return Ad},PSEUDO:function(Ad,Aa,Ab,e,Ae){if(Ad[1]==="not"){if(Ad[3].match(y).length>1||/^\w/.test(Ad[3])){Ad[3]=g(Ad[3],null,null,Aa)}else{var Ac=g.filter(Ad[3],Aa,Ab,true^Ae);if(!Ab){e.push.apply(e,Ac)}return false}}else{if(n.match.POS.test(Ad[0])||n.match.CHILD.test(Ad[0])){return true}}return Ad},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){e.parentNode.selectedIndex;return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(Ab,Aa,e){return !!g(e[3],Ab).length},header:function(e){return/h\d/i.test(e.nodeName)},text:function(e){return"text"===e.type},radio:function(e){return"radio"===e.type},checkbox:function(e){return"checkbox"===e.type},file:function(e){return"file"===e.type},password:function(e){return"password"===e.type},submit:function(e){return"submit"===e.type},image:function(e){return"image"===e.type},reset:function(e){return"reset"===e.type},button:function(e){return"button"===e.type||e.nodeName.toUpperCase()==="BUTTON"},input:function(e){return/input|select|textarea|button/i.test(e.nodeName)}},setFilters:{first:function(Aa,e){return e===0},last:function(Ab,Aa,e,Ac){return Aa===Ac.length-1},even:function(Aa,e){return e%2===0},odd:function(Aa,e){return e%2===1},lt:function(Ab,Aa,e){return Aa<e[3]-0},gt:function(Ab,Aa,e){return Aa>e[3]-0},nth:function(Ab,Aa,e){return e[3]-0==Aa},eq:function(Ab,Aa,e){return e[3]-0==Aa}},filter:{PSEUDO:function(Af,Ab,Ac,Ag){var Aa=Ab[1],Ad=n.filters[Aa];if(Ad){return Ad(Af,Ac,Ab,Ag)}else{if(Aa==="contains"){return(Af.textContent||Af.innerText||"").indexOf(Ab[3])>=0}else{if(Aa==="not"){var Ae=Ab[3];for(var Ac=0,e=Ae.length;Ac<e;Ac++){if(Ae[Ac]===Af){return false}}return true}}}},CHILD:function(e,Ac){var Af=Ac[1],Aa=e;switch(Af){case"only":case"first":while(Aa=Aa.previousSibling){if(Aa.nodeType===1){return false}}if(Af=="first"){return true}Aa=e;case"last":while(Aa=Aa.nextSibling){if(Aa.nodeType===1){return false}}return true;case"nth":var Ab=Ac[2],Ai=Ac[3];if(Ab==1&&Ai==0){return true}var Ae=Ac[0],Ah=e.parentNode;if(Ah&&(Ah.sizcache!==Ae||!e.nodeIndex)){var Ad=0;for(Aa=Ah.firstChild;Aa;Aa=Aa.nextSibling){if(Aa.nodeType===1){Aa.nodeIndex=++Ad}}Ah.sizcache=Ae}var Ag=e.nodeIndex-Ai;if(Ab==0){return Ag==0}else{return(Ag%Ab==0&&Ag/Ab>=0)}}},ID:function(Aa,e){return Aa.nodeType===1&&Aa.getAttribute("id")===e},TAG:function(Aa,e){return(e==="*"&&Aa.nodeType===1)||Aa.nodeName===e},CLASS:function(Aa,e){return(" "+(Aa.className||Aa.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(Ae,Ac){var Ab=Ac[1],e=n.attrHandle[Ab]?n.attrHandle[Ab](Ae):Ae[Ab]!=null?Ae[Ab]:Ae.getAttribute(Ab),Af=e+"",Ad=Ac[2],Aa=Ac[4];return e==null?Ad==="!=":Ad==="="?Af===Aa:Ad==="*="?Af.indexOf(Aa)>=0:Ad==="~="?(" "+Af+" ").indexOf(Aa)>=0:!Aa?Af&&e!==false:Ad==="!="?Af!=Aa:Ad==="^="?Af.indexOf(Aa)===0:Ad==="$="?Af.substr(Af.length-Aa.length)===Aa:Ad==="|="?Af===Aa||Af.substr(0,Aa.length+1)===Aa+"-":false},POS:function(Ad,Aa,Ab,Ae){var e=Aa[2],Ac=n.setFilters[e];if(Ac){return Ac(Ad,Ab,Aa,Ae)}}}};var t=n.match.POS;for(var v in n.match){n.match[v]=RegExp(n.match[v].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var f=function(Aa,e){Aa=Array.prototype.slice.call(Aa);if(e){e.push.apply(e,Aa);return e}return Aa};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(u){f=function(Ad,Ac){var Aa=Ac||[];if(m.call(Ad)==="[object Array]"){Array.prototype.push.apply(Aa,Ad)}else{if(typeof Ad.length==="number"){for(var Ab=0,e=Ad.length;Ab<e;Ab++){Aa.push(Ad[Ab])}}else{for(var Ab=0;Ad[Ab];Ab++){Aa.push(Ad[Ab])}}}return Aa}}var h;if(document.documentElement.compareDocumentPosition){h=function(Aa,e){var Ab=Aa.compareDocumentPosition(e)&4?-1:Aa===e?0:1;if(Ab===0){hasDuplicate=true}return Ab}}else{if("sourceIndex" in document.documentElement){h=function(Aa,e){var Ab=Aa.sourceIndex-e.sourceIndex;if(Ab===0){hasDuplicate=true}return Ab}}else{if(document.createRange){h=function(Ac,Aa){var Ab=Ac.ownerDocument.createRange(),e=Aa.ownerDocument.createRange();Ab.selectNode(Ac);Ab.collapse(true);e.selectNode(Aa);e.collapse(true);var Ad=Ab.compareBoundaryPoints(Range.START_TO_END,e);if(Ad===0){hasDuplicate=true}return Ad}}}}(function(){var Aa=document.createElement("form"),Ab="script"+(new Date).getTime();Aa.innerHTML="<input name='"+Ab+"'/>";var e=document.documentElement;e.insertBefore(Aa,e.firstChild);if(!!document.getElementById(Ab)){n.find.ID=function(Ad,Ae,Af){if(typeof Ae.getElementById!=="undefined"&&!Af){var Ac=Ae.getElementById(Ad[1]);return Ac?Ac.id===Ad[1]||typeof Ac.getAttributeNode!=="undefined"&&Ac.getAttributeNode("id").nodeValue===Ad[1]?[Ac]:G:[]}};n.filter.ID=function(Ae,Ac){var Ad=typeof Ae.getAttributeNode!=="undefined"&&Ae.getAttributeNode("id");return Ae.nodeType===1&&Ad&&Ad.nodeValue===Ac}}e.removeChild(Aa)})();(function(){var e=document.createElement("div");e.appendChild(document.createComment(""));if(e.getElementsByTagName("*").length>0){n.find.TAG=function(Aa,Ae){var Ad=Ae.getElementsByTagName(Aa[1]);if(Aa[1]==="*"){var Ac=[];for(var Ab=0;Ad[Ab];Ab++){if(Ad[Ab].nodeType===1){Ac.push(Ad[Ab])}}Ad=Ac}return Ad}}e.innerHTML="<a href='#'></a>";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){n.attrHandle.href=function(Aa){return Aa.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var e=g,Aa=document.createElement("div");Aa.innerHTML="<p class='TEST'></p>";if(Aa.querySelectorAll&&Aa.querySelectorAll(".TEST").length===0){return}g=function(Ae,Ad,Ab,Ac){Ad=Ad||document;if(!Ac&&Ad.nodeType===9&&!x(Ad)){try{return f(Ad.querySelectorAll(Ae),Ab)}catch(Af){}}return e(Ae,Ad,Ab,Ac)};g.find=e.find;g.filter=e.filter;g.selectors=e.selectors;g.matches=e.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var e=document.createElement("div");e.innerHTML="<div class='test e'></div><div class='test'></div>";if(e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}n.order.splice(1,0,"CLASS");n.find.CLASS=function(Aa,Ab,Ac){if(typeof Ab.getElementsByClassName!=="undefined"&&!Ac){return Ab.getElementsByClassName(Aa[1])}}})()}function w(Aa,Af,Ae,Aj,Ag,Ai){var Ah=Aa=="previousSibling"&&!Ai;for(var Ac=0,Ab=Aj.length;Ac<Ab;Ac++){var e=Aj[Ac];if(e){if(Ah&&e.nodeType===1){e.sizcache=Ae;e.sizset=Ac}e=e[Aa];var Ad=false;while(e){if(e.sizcache===Ae){Ad=Aj[e.sizset];break}if(e.nodeType===1&&!Ai){e.sizcache=Ae;e.sizset=Ac}if(e.nodeName===Af){Ad=e;break}e=e[Aa]}Aj[Ac]=Ad}}}function z(Aa,Af,Ae,Aj,Ag,Ai){var Ah=Aa=="previousSibling"&&!Ai;for(var Ac=0,Ab=Aj.length;Ac<Ab;Ac++){var e=Aj[Ac];if(e){if(Ah&&e.nodeType===1){e.sizcache=Ae;e.sizset=Ac}e=e[Aa];var Ad=false;while(e){if(e.sizcache===Ae){Ad=Aj[e.sizset];break}if(e.nodeType===1){if(!Ai){e.sizcache=Ae;e.sizset=Ac}if(typeof Af!=="string"){if(e===Af){Ad=true;break}}else{if(g.filter(Af,[e]).length>0){Ad=e;break}}}e=e[Aa]}Aj[Ac]=Ad}}}var p=document.compareDocumentPosition?function(Aa,e){return Aa.compareDocumentPosition(e)&16}:function(Aa,e){return Aa!==e&&(Aa.contains?Aa.contains(e):true)};var x=function(e){return false;return e.nodeType===9&&e.documentElement.nodeName!=="HTML"||!!e.ownerDocument&&x(e.ownerDocument)};var o=function(e,Ag){var Ac=[],Ad="",Ae,Ab=Ag.nodeType?[Ag]:Ag;while((Ae=n.match.PSEUDO.exec(e))){Ad+=Ae[0];e=e.replace(n.match.PSEUDO,"")}e=n.relative[e]?e+"*":e;for(var Af=0,Aa=Ab.length;Af<Aa;Af++){g(e,Ab[Af],Ac)}return g.filter(Ad,Ac)};O.find=g;O.filter=g.filter;O.expr=g.selectors;O.expr[":"]=O.expr.filters;g.selectors.filters.hidden=function(e){return e.offsetWidth===0||e.offsetHeight===0};g.selectors.filters.visible=function(e){return e.offsetWidth>0||e.offsetHeight>0};g.selectors.filters.animated=function(e){return O.grep(O.timers,function(Aa){return e===Aa.elem}).length};O.multiFilter=function(Ab,e,Aa){if(Aa){Ab=":not("+Ab+")"}return g.matches(Ab,e)};O.dir=function(Ab,Aa){var e=[],Ac=Ab[Aa];while(Ac&&Ac!=document){if(Ac.nodeType==1){e.push(Ac)}Ac=Ac[Aa]}return e};O.nth=function(Ad,e,Ab,Ac){e=e||1;var Aa=0;for(;Ad;Ad=Ad[Ab]){if(Ad.nodeType==1&&++Aa==e){break}}return Ad};O.sibling=function(Ab,Aa){var e=[];for(;Ab;Ab=Ab.nextSibling){if(Ab.nodeType==1&&Ab!=Aa){e.push(Ab)}}return e};return;L.Sizzle=g})();O.event={add:function(m,f,h,o){if(m.nodeType==3||m.nodeType==8){return}if(m.setInterval&&m!=L){m=L}if(!h.guid){h.guid=this.guid++}if(o!==G){var g=h;h=this.proxy(g);h.data=o}var e=O.data(m,"events")||O.data(m,"events",{}),n=O.data(m,"handle")||O.data(m,"handle",function(){return typeof O!=="undefined"&&!O.event.triggered?O.event.handle.apply(arguments.callee.elem,arguments):G});n.elem=m;O.each(f.split(/\s+/),function(q,t){var u=t.split(".");t=u.shift();h.type=u.slice().sort().join(".");var p=e[t];if(O.event.specialAll[t]){O.event.specialAll[t].setup.call(m,o,u)}if(!p){p=e[t]={};if(!O.event.special[t]||O.event.special[t].setup.call(m,o,u)===false){if(m.addEventListener){m.addEventListener(t,n,false)}else{if(m.attachEvent){m.attachEvent("on"+t,n)}}}}p[h.guid]=h;O.event.global[t]=true});m=null},guid:1,global:{},remove:function(o,h,n){if(o.nodeType==3||o.nodeType==8){return}var g=O.data(o,"events"),f,e;if(g){if(h===G||(typeof h==="string"&&h.charAt(0)==".")){for(var m in g){this.remove(o,m+(h||""))}}else{if(h.type){n=h.handler;h=h.type}O.each(h.split(/\s+/),function(q,u){var w=u.split(".");u=w.shift();var t=RegExp("(^|\\.)"+w.slice().sort().join(".*\\.")+"(\\.|$)");if(g[u]){if(n){delete g[u][n.guid]}else{for(var v in g[u]){if(t.test(g[u][v].type)){delete g[u][v]}}}if(O.event.specialAll[u]){O.event.specialAll[u].teardown.call(o,w)}for(f in g[u]){break}if(!f){if(!O.event.special[u]||O.event.special[u].teardown.call(o,w)===false){if(o.removeEventListener){o.removeEventListener(u,O.data(o,"handle"),false)}else{if(o.detachEvent){o.detachEvent("on"+u,O.data(o,"handle"))}}}f=null;delete g[u]}}})}for(f in g){break}if(!f){var p=O.data(o,"handle");if(p){p.elem=null}O.removeData(o,"events");O.removeData(o,"handle")}}},trigger:function(n,p,m,f){var h=n.type||n;if(!f){n=typeof n==="object"?n[H]?n:O.extend(O.Event(h),n):O.Event(h);if(h.indexOf("!")>=0){n.type=h=h.slice(0,-1);n.exclusive=true}if(!m){n.stopPropagation();if(this.global[h]){O.each(O.cache,function(){if(this.events&&this.events[h]){O.event.trigger(n,p,this.handle.elem)}})}}if(!m||m.nodeType==3||m.nodeType==8){return G}n.result=G;n.target=m;p=O.makeArray(p);p.unshift(n)}n.currentTarget=m;var o=O.data(m,"handle");if(o){o.apply(m,p)}if((!m[h]||(O.nodeName(m,"a")&&h=="click"))&&m["on"+h]&&m["on"+h].apply(m,p)===false){n.result=false}if(!f&&m[h]&&!n.isDefaultPrevented()&&!(O.nodeName(m,"a")&&h=="click")){this.triggered=true;try{m[h]()}catch(q){}}this.triggered=false;if(!n.isPropagationStopped()){var g=m.parentNode||m.ownerDocument;if(g){O.event.trigger(n,p,g,true)}}},handle:function(o){var n,e;o=arguments[0]=O.event.fix(o||L.event);o.currentTarget=this;var p=o.type.split(".");o.type=p.shift();n=!p.length&&!o.exclusive;var m=RegExp("(^|\\.)"+p.slice().sort().join(".*\\.")+"(\\.|$)");e=(O.data(this,"events")||{})[o.type];for(var g in e){var h=e[g];if(n||m.test(h.type)){o.handler=h;o.data=h.data;var f=h.apply(this,arguments);if(f!==G){o.result=f;if(f===false){o.preventDefault();o.stopPropagation()}}if(o.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(h){if(h[H]){return h}var f=h;h=O.Event(f);for(var g=this.props.length,n;g;){n=this.props[--g];h[n]=f[n]}if(!h.target){h.target=h.srcElement||document}if(h.target.nodeType==3){h.target=h.target.parentNode}if(!h.relatedTarget&&h.fromElement){h.relatedTarget=h.fromElement==h.target?h.toElement:h.fromElement}if(h.pageX==null&&h.clientX!=null){var m=document.documentElement,e=document.body;h.pageX=h.clientX+(m&&m.scrollLeft||e&&e.scrollLeft||0)-(m.clientLeft||0);h.pageY=h.clientY+(m&&m.scrollTop||e&&e.scrollTop||0)-(m.clientTop||0)}if(!h.which&&((h.charCode||h.charCode===0)?h.charCode:h.keyCode)){h.which=h.charCode||h.keyCode}if(!h.metaKey&&h.ctrlKey){h.metaKey=h.ctrlKey}if(!h.which&&h.button){h.which=(h.button&1?1:(h.button&2?3:(h.button&4?2:0)))}return h},proxy:function(f,e){e=e||function(){return f.apply(this,arguments)};e.guid=f.guid=f.guid||e.guid||this.guid++;return e},special:{ready:{setup:b,teardown:function(){}}},specialAll:{live:{setup:function(e,f){O.event.add(this,f[0],C)},teardown:function(g){if(g.length){var e=0,f=RegExp("(^|\\.)"+g[0]+"(\\.|$)");O.each((O.data(this,"events").live||{}),function(){if(f.test(this.type)){e++}});if(e<1){O.event.remove(this,g[0],C)}}}}}};O.Event=function(e){if(!this.preventDefault){return new O.Event(e)}if(e&&e.type){this.originalEvent=e;this.type=e.type}else{this.type=e}this.timeStamp=E();this[H]=true};function K(){return false}function U(){return true}O.Event.prototype={preventDefault:function(){this.isDefaultPrevented=U;var f=this.originalEvent;if(!f){return}if(f.preventDefault){f.preventDefault()}f.returnValue=false},stopPropagation:function(){this.isPropagationStopped=U;var f=this.originalEvent;if(!f){return}if(f.stopPropagation){f.stopPropagation()}f.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=U;this.stopPropagation()},isDefaultPrevented:K,isPropagationStopped:K,isImmediatePropagationStopped:K};var A=function(g){var f=g.relatedTarget;while(f&&f!=this){try{f=f.parentNode}catch(h){f=this}}if(f!=this){g.type=g.data;O.event.handle.apply(this,arguments)}};O.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(f,e){O.event.special[e]={setup:function(){O.event.add(this,f,A,e)},teardown:function(){O.event.remove(this,f,A)}}});O.fn.extend({bind:function(f,g,e){return f=="unload"?this.one(f,g,e):this.each(function(){O.event.add(this,f,e||g,e&&g)})},one:function(g,h,f){var e=O.event.proxy(f||h,function(m){O(this).unbind(m,e);return(f||h).apply(this,arguments)});return this.each(function(){O.event.add(this,g,e,f&&h)})},unbind:function(f,e){return this.each(function(){O.event.remove(this,f,e)})},trigger:function(e,f){return this.each(function(){O.event.trigger(e,f,this)})},triggerHandler:function(e,g){if(this[0]){var f=O.Event(e);f.preventDefault();f.stopPropagation();O.event.trigger(f,g,this[0]);return f.result}},toggle:function(g){var e=arguments,f=1;while(f<e.length){O.event.proxy(g,e[f++])}return this.click(O.event.proxy(g,function(h){this.lastToggle=(this.lastToggle||0)%f;h.preventDefault();return e[this.lastToggle++].apply(this,arguments)||false}))},hover:function(e,f){return this.mouseenter(e).mouseleave(f)},ready:function(e){b();if(O.isReady){e.call(document,O)}else{O.readyList.push(e)}return this},live:function(g,f){var e=O.event.proxy(f);e.guid+=this.selector+g;O(document).bind(I(g,this.selector),this.selector,e);return this},die:function(f,e){O(document).unbind(I(f,this.selector),e?{guid:e.guid+this.selector+f}:null);return this}});function C(h){var e=RegExp("(^|\\.)"+h.type+"(\\.|$)"),g=true,f=[];O.each(O.data(this,"events").live||[],function(m,n){if(e.test(n.type)){var o=O(h.target).closest(n.data)[0];if(o){f.push({elem:o,fn:n})}}});f.sort(function(n,m){return O.data(n.elem,"closest")-O.data(m.elem,"closest")});O.each(f,function(){if(this.fn.call(this.elem,h,this.fn.data)===false){return(g=false)}});return g}function I(f,e){return["live",f,e.replace(/\./g,"`").replace(/ /g,"|")].join(".")}O.extend({isReady:false,readyList:[],ready:function(){if(!O.isReady){O.isReady=true;if(O.readyList){O.each(O.readyList,function(){this.call(document,O)});O.readyList=null}O(document).triggerHandler("ready")}}});var X=false;function b(){if(X){return}X=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);O.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);O.ready()}});if(document.documentElement.doScroll&&L==L.top){(function(){if(O.isReady){return}try{document.documentElement.doScroll("left")}catch(e){setTimeout(arguments.callee,0);return}O.ready()})()}}}O.event.add(L,"load",O.ready)}O.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(f,e){O.fn[e]=function(g){return g?this.bind(e,g):this.trigger(e)}});O(L).bind("unload",function(){for(var e in O.cache){if(e!=1&&O.cache[e].handle){O.event.remove(O.cache[e].handle.elem)}}});(function(){O.support={};var g=document.documentElement,h=document.createElement("script"),p=document.createElement("div"),o="script"+(new Date).getTime();p.style.display="none";p.innerHTML='   <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var m=p.getElementsByTagName("*"),f=p.getElementsByTagName("a")[0];if(!m||!m.length||!f){return}O.support={leadingWhitespace:p.firstChild.nodeType==3,tbody:!p.getElementsByTagName("tbody").length,objectAll:!!p.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/red/.test(f.getAttribute("style")),hrefNormalized:f.getAttribute("href")==="/a",opacity:f.style.opacity==="0.5",cssFloat:!!f.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};h.type="text/javascript";try{h.appendChild(document.createTextNode("window."+o+"=1;"))}catch(n){}g.insertBefore(h,g.firstChild);if(L[o]){O.support.scriptEval=true;delete L[o]}g.removeChild(h);if(p.attachEvent&&p.fireEvent){p.attachEvent("onclick",function(){O.support.noCloneEvent=false;p.detachEvent("onclick",arguments.callee)});p.cloneNode(true).fireEvent("onclick")}O(function(){var e=document.createElement("div");e.style.width=e.style.paddingLeft="1px";document.body.appendChild(e);O.boxModel=O.support.boxModel=e.offsetWidth===2;document.body.removeChild(e).style.display="none"})})();var W=O.support.cssFloat?"cssFloat":"styleFloat";O.props={"for":"htmlFor","class":"className","float":W,cssFloat:W,styleFloat:W,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};O.fn.extend({_load:O.fn.load,load:function(g,n,o){if(typeof g!=="string"){return this._load(g)}var m=g.indexOf(" ");if(m>=0){var e=g.slice(m,g.length);g=g.slice(0,m)}var h="GET";if(n){if(O.isFunction(n)){o=n;n=null}else{if(typeof n==="object"){n=O.param(n);h="POST"}}}var f=this;O.ajax({url:g,type:h,dataType:"html",data:n,complete:function(q,p){if(p=="success"||p=="notmodified"){f.html(e?O("<div/>").append(q.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(e):q.responseText)}if(o){f.each(o,[q.responseText,p,q])}}});return this},serialize:function(){return O.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?O.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(e,f){var g=O(this).val();return g==null?null:O.isArray(g)?O.map(g,function(m,h){return{name:f.name,value:m}}):{name:f.name,value:g}}).get()}});O.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(e,f){O.fn[f]=function(g){return this.bind(f,g)}});var R=E();O.extend({get:function(e,g,h,f){if(O.isFunction(g)){h=g;g=null}return O.ajax({type:"GET",url:e,data:g,success:h,dataType:f})},getScript:function(e,f){return O.get(e,null,f,"script")},getJSON:function(e,f,g){return O.get(e,f,g,"json")},post:function(e,g,h,f){if(O.isFunction(g)){h=g;g={}}return O.ajax({type:"POST",url:e,data:g,success:h,dataType:f})},ajaxSetup:function(e){O.extend(O.ajaxSettings,e)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return L.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(t){t=O.extend(true,t,O.extend(true,{},O.ajaxSettings,t));var Ad,g=/=\?(&|$)/g,y,Ac,h=t.type.toUpperCase();if(t.data&&t.processData&&typeof t.data!=="string"){t.data=O.param(t.data)}if(t.dataType=="jsonp"){if(h=="GET"){if(!t.url.match(g)){t.url+=(t.url.match(/\?/)?"&":"?")+(t.jsonp||"callback")+"=?"}}else{if(!t.data||!t.data.match(g)){t.data=(t.data?t.data+"&":"")+(t.jsonp||"callback")+"=?"}}t.dataType="json"}if(t.dataType=="json"&&(t.data&&t.data.match(g)||t.url.match(g))){Ad="jsonp"+R++;if(t.data){t.data=(t.data+"").replace(g,"="+Ad+"$1")}t.url=t.url.replace(g,"="+Ad+"$1");t.dataType="script";L[Ad]=function(Ae){Ac=Ae;n();q();L[Ad]=G;try{delete L[Ad]}catch(Af){}if(m){m.removeChild(Aa)}}}if(t.dataType=="script"&&t.cache==null){t.cache=false}if(t.cache===false&&h=="GET"){var f=E();var Ab=t.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+f+"$2");t.url=Ab+((Ab==t.url)?(t.url.match(/\?/)?"&":"?")+"_="+f:"")}if(t.data&&h=="GET"){t.url+=(t.url.match(/\?/)?"&":"?")+t.data;t.data=null}if(t.global&&!O.active++){O.event.trigger("ajaxStart")}var x=/^(\w+:)?\/\/([^\/?#]+)/.exec(t.url);if(t.dataType=="script"&&h=="GET"&&x&&(x[1]&&x[1]!=location.protocol||x[2]!=location.host)){var m=document.getElementsByTagName("head")[0];var Aa=document.createElement("script");Aa.src=t.url;if(t.scriptCharset){Aa.charset=t.scriptCharset}if(!Ad){var v=false;Aa.onload=Aa.onreadystatechange=function(){if(!v&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){v=true;n();q();Aa.onload=Aa.onreadystatechange=null;m.removeChild(Aa)}}}m.appendChild(Aa);return G}var p=false;var o=t.xhr();if(t.username){o.open(h,t.url,t.async,t.username,t.password)}else{o.open(h,t.url,t.async)}try{if(t.data){o.setRequestHeader("Content-Type",t.contentType)}if(t.ifModified){o.setRequestHeader("If-Modified-Since",O.lastModified[t.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}o.setRequestHeader("X-Requested-With","XMLHttpRequest");o.setRequestHeader("Accept",t.dataType&&t.accepts[t.dataType]?t.accepts[t.dataType]+", */*":t.accepts._default)}catch(z){}if(t.beforeSend&&t.beforeSend(o,t)===false){if(t.global&&!--O.active){O.event.trigger("ajaxStop")}o.abort();return false}if(t.global){O.event.trigger("ajaxSend",[o,t])}var u=function(Ae){if(o.readyState==0){if(w){clearInterval(w);w=null;if(t.global&&!--O.active){O.event.trigger("ajaxStop")}}}else{if(!p&&o&&(o.readyState==4||Ae=="timeout")){p=true;if(w){clearInterval(w);w=null}y=Ae=="timeout"?"timeout":!O.httpSuccess(o)?"error":t.ifModified&&O.httpNotModified(o,t.url)?"notmodified":"success";if(y=="success"){try{Ac=O.httpData(o,t.dataType,t)}catch(Ag){y="parsererror"}}if(y=="success"){var Af;try{Af=o.getResponseHeader("Last-Modified")}catch(Ag){}if(t.ifModified&&Af){O.lastModified[t.url]=Af}if(!Ad){n()}}else{O.handleError(t,o,y)}q();if(Ae){o.abort()}if(t.async){o=null}}}};if(t.async){var w=setInterval(u,13);if(t.timeout>0){setTimeout(function(){if(o&&!p){u("timeout")}},t.timeout)}}try{o.send(t.data)}catch(z){O.handleError(t,o,null,z)}if(!t.async){u()}function n(){if(t.success){t.success(Ac,y)}if(t.global){O.event.trigger("ajaxSuccess",[o,t])}}function q(){if(t.complete){t.complete(o,y)}if(t.global){O.event.trigger("ajaxComplete",[o,t])}if(t.global&&!--O.active){O.event.trigger("ajaxStop")}}return o},handleError:function(g,m,f,h){if(g.error){g.error(m,f,h)}if(g.global){O.event.trigger("ajaxError",[m,g,h])}},active:0,httpSuccess:function(g){try{return !g.status&&location.protocol=="file:"||(g.status>=200&&g.status<300)||g.status==304||g.status==1223}catch(f){}return false},httpNotModified:function(h,f){try{var m=h.getResponseHeader("Last-Modified");return h.status==304||m==O.lastModified[f]}catch(g){}return false},httpData:function(n,h,g){var f=n.getResponseHeader("content-type"),e=h=="xml"||!h&&f&&f.indexOf("xml")>=0,m=e?n.responseXML:n.responseText;if(e&&m.documentElement.tagName=="parsererror"){throw"parsererror"}if(g&&g.dataFilter){m=g.dataFilter(m,h)}if(typeof m==="string"){if(h=="script"){O.globalEval(m)}if(h=="json"){m=L["eval"]("("+m+")")}}return m},param:function(e){var g=[];function h(m,n){g[g.length]=encodeURIComponent(m)+"="+encodeURIComponent(n)}if(O.isArray(e)||e.jquery){O.each(e,function(){h(this.name,this.value)})}else{for(var f in e){if(O.isArray(e[f])){O.each(e[f],function(){h(f,this)})}else{h(f,O.isFunction(e[f])?e[f]():e[f])}}}return g.join("&").replace(/%20/g,"+")}});var M={},N,D=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function T(f,e){var g={};O.each(D.concat.apply([],D.slice(0,e)),function(){g[this]=f});return g}O.fn.extend({show:function(n,p){if(n){return this.animate(T("show",3),n,p)}else{for(var h=0,f=this.length;h<f;h++){var e=O.data(this[h],"olddisplay");this[h].style.display=e||"";if(O.css(this[h],"display")==="none"){var g=this[h].tagName,o;if(M[g]){o=M[g]}else{var m=O("<"+g+" />").appendTo("body");o=m.css("display");if(o==="none"){o="block"}m.remove();M[g]=o}O.data(this[h],"olddisplay",o)}}for(var h=0,f=this.length;h<f;h++){this[h].style.display=O.data(this[h],"olddisplay")||""}return this}},hide:function(h,m){if(h){return this.animate(T("hide",3),h,m)}else{for(var g=0,f=this.length;g<f;g++){var e=O.data(this[g],"olddisplay");if(!e&&e!=="none"){O.data(this[g],"olddisplay",O.css(this[g],"display"))}}for(var g=0,f=this.length;g<f;g++){this[g].style.display="none"}return this}},_toggle:O.fn.toggle,toggle:function(g,f){var e=typeof g==="boolean";return O.isFunction(g)&&O.isFunction(f)?this._toggle.apply(this,arguments):g==null||e?this.each(function(){var h=e?g:O(this).is(":hidden");O(this)[h?"show":"hide"]()}):this.animate(T("toggle",3),g,f)},fadeTo:function(e,g,f){return this.animate({opacity:g},e,f)},animate:function(m,f,h,g){var e=O.speed(f,h,g);return this[e.queue===false?"each":"queue"](function(){var o=O.extend({},e),t,q=this.nodeType==1&&O(this).is(":hidden"),n=this;for(t in m){if(m[t]=="hide"&&q||m[t]=="show"&&!q){return o.complete.call(this)}if((t=="height"||t=="width")&&this.style){o.display=O.css(this,"display");o.overflow=this.style.overflow}}if(o.overflow!=null){this.style.overflow="hidden"}o.curAnim=O.extend({},m);O.each(m,function(u,y){var x=new O.fx(n,o,u);if(/toggle|show|hide/.test(y)){x[y=="toggle"?q?"show":"hide":y](m)}else{var w=y.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),z=x.cur(true)||0;if(w){var p=parseFloat(w[2]),v=w[3]||"px";if(v!="px"){n.style[u]=(p||1)+v;z=((p||1)/x.cur(true))*z;n.style[u]=z+v}if(w[1]){p=((w[1]=="-="?-1:1)*p)+z}x.custom(z,p,v)}else{x.custom(z,y,"")}}});return true})},stop:function(f,e){var g=O.timers;if(f){this.queue([])}this.each(function(){for(var h=g.length-1;h>=0;h--){if(g[h].elem==this){if(e){g[h](true)}g.splice(h,1)}}});if(!e){this.dequeue()}return this}});O.each({slideDown:T("show",1),slideUp:T("hide",1),slideToggle:T("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(e,f){O.fn[e]=function(g,h){return this.animate(f,g,h)}});O.extend({speed:function(g,h,f){var e=typeof g==="object"?g:{complete:f||!f&&h||O.isFunction(g)&&g,duration:g,easing:f&&h||h&&!O.isFunction(h)&&h};e.duration=O.fx.off?0:typeof e.duration==="number"?e.duration:O.fx.speeds[e.duration]||O.fx.speeds._default;e.old=e.complete;e.complete=function(){if(e.queue!==false){O(this).dequeue()}if(O.isFunction(e.old)){e.old.call(this)}};return e},easing:{linear:function(g,h,e,f){return e+f*g},swing:function(g,h,e,f){return((-Math.cos(g*Math.PI)/2)+0.5)*f+e}},timers:[],fx:function(f,e,g){this.options=e;this.elem=f;this.prop=g;if(!e.orig){e.orig={}}}});O.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(O.fx.step[this.prop]||O.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(f){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var e=parseFloat(O.css(this.elem,this.prop,f));return e&&e>-10000?e:parseFloat(O.curCSS(this.elem,this.prop))||0},custom:function(m,h,g){this.startTime=E();this.start=m;this.end=h;this.unit=g||this.unit||"px";this.now=this.start;this.pos=this.state=0;var e=this;function f(n){return e.step(n)}f.elem=this.elem;if(f()&&O.timers.push(f)&&!N){N=setInterval(function(){var o=O.timers;for(var n=0;n<o.length;n++){if(!o[n]()){o.splice(n--,1)}}if(!o.length){clearInterval(N);N=G}},13)}},show:function(){this.options.orig[this.prop]=O.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());O(this.elem).show()},hide:function(){this.options.orig[this.prop]=O.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(h){var g=E();if(h||g>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var e=true;for(var f in this.options.curAnim){if(this.options.curAnim[f]!==true){e=false}}if(e){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(O.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){O(this.elem).hide()}if(this.options.hide||this.options.show){for(var m in this.options.curAnim){O.attr(this.elem.style,m,this.options.orig[m])}}this.options.complete.call(this.elem)}return false}else{var o=g-this.startTime;this.state=o/this.options.duration;this.pos=O.easing[this.options.easing||(O.easing.swing?"swing":"linear")](this.state,o,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};O.extend(O.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(e){O.attr(e.elem.style,"opacity",e.now)},_default:function(e){if(e.elem.style&&e.elem.style[e.prop]!=null){e.elem.style[e.prop]=e.now+e.unit}else{e.elem[e.prop]=e.now}}}});if(document.documentElement.getBoundingClientRect){O.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return O.offset.bodyOffset(this[0])}var g=this[0].getBoundingClientRect(),n=this[0].ownerDocument,f=n.body,e=n.documentElement,p=e.clientTop||f.clientTop||0,o=e.clientLeft||f.clientLeft||0,m=g.top+(self.pageYOffset||O.boxModel&&e.scrollTop||f.scrollTop)-p,h=g.left+(self.pageXOffset||O.boxModel&&e.scrollLeft||f.scrollLeft)-o;return{top:m,left:h}}}else{O.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return O.offset.bodyOffset(this[0])}O.offset.initialized||O.offset.initialize();var n=this[0],g=n.offsetParent,f=n,u=n.ownerDocument,q,h=u.documentElement,o=u.body,p=u.defaultView,e=p.getComputedStyle(n,null),t=n.offsetTop,m=n.offsetLeft;while((n=n.parentNode)&&n!==o&&n!==h){q=p.getComputedStyle(n,null);t-=n.scrollTop,m-=n.scrollLeft;if(n===g){t+=n.offsetTop,m+=n.offsetLeft;if(O.offset.doesNotAddBorder&&!(O.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(n.tagName))){t+=parseInt(q.borderTopWidth,10)||0,m+=parseInt(q.borderLeftWidth,10)||0}f=g,g=n.offsetParent}if(O.offset.subtractsBorderForOverflowNotVisible&&q.overflow!=="visible"){t+=parseInt(q.borderTopWidth,10)||0,m+=parseInt(q.borderLeftWidth,10)||0}e=q}if(e.position==="relative"||e.position==="static"){t+=o.offsetTop,m+=o.offsetLeft}if(e.position==="fixed"){t+=Math.max(h.scrollTop,o.scrollTop),m+=Math.max(h.scrollLeft,o.scrollLeft)}return{top:t,left:m}}}O.offset={initialize:function(){if(this.initialized){return}var p=document.body,f=document.createElement("div"),h,g,t,m,q,e,n=p.style.marginTop,o='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';q={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(e in q){f.style[e]=q[e]}f.innerHTML=o;p.insertBefore(f,p.firstChild);h=f.firstChild,g=h.firstChild,m=h.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(g.offsetTop!==5);this.doesAddBorderForTableAndCells=(m.offsetTop===5);h.style.overflow="hidden",h.style.position="relative";this.subtractsBorderForOverflowNotVisible=(g.offsetTop===-5);p.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(p.offsetTop===0);p.style.marginTop=n;p.removeChild(f);this.initialized=true},bodyOffset:function(e){O.offset.initialized||O.offset.initialize();var g=e.offsetTop,f=e.offsetLeft;if(O.offset.doesNotIncludeMarginInBodyOffset){g+=parseInt(O.curCSS(e,"marginTop",true),10)||0,f+=parseInt(O.curCSS(e,"marginLeft",true),10)||0}return{top:g,left:f}}};O.fn.extend({position:function(){var m=0,h=0,f;if(this[0]){var g=this.offsetParent(),n=this.offset(),e=/^body|html$/i.test(g[0].tagName)?{top:0,left:0}:g.offset();n.top-=J(this,"marginTop");n.left-=J(this,"marginLeft");e.top+=J(g,"borderTopWidth");e.left+=J(g,"borderLeftWidth");f={top:n.top-e.top,left:n.left-e.left}}return f},offsetParent:function(){var e=this[0].offsetParent||document.body;while(e&&(!/^body|html$/i.test(e.tagName)&&O.css(e,"position")=="static")){e=e.offsetParent}return O(e)}});O.each(["Left","Top"],function(f,e){var g="scroll"+e;O.fn[g]=function(h){if(!this[0]){return null}return h!==G?this.each(function(){this==L||this==document?L.scrollTo(!f?h:O(L).scrollLeft(),f?h:O(L).scrollTop()):this[g]=h}):this[0]==L||this[0]==document?self[f?"pageYOffset":"pageXOffset"]||O.boxModel&&document.documentElement[g]||document.body[g]:this[0][g]}});O.each(["Height","Width"],function(m,g){var e=m?"Left":"Top",h=m?"Right":"Bottom",f=g.toLowerCase();O.fn["inner"+g]=function(){return this[0]?O.css(this[0],f,false,"padding"):null};O.fn["outer"+g]=function(o){return this[0]?O.css(this[0],f,false,o?"margin":"border"):null};var n=g.toLowerCase();O.fn[n]=function(o){return this[0]==L?document.compatMode=="CSS1Compat"&&document.documentElement["client"+g]||document.body["client"+g]:this[0]==document?Math.max(document.documentElement["client"+g],document.body["scroll"+g],document.documentElement["scroll"+g],document.body["offset"+g],document.documentElement["offset"+g]):o===G?(this.length?O.css(this[0],n):null):this.css(n,typeof o==="string"?o:o+"px")}})})();var joosetop=this;Joose=function(){this.cc=null;this.currentModule=null;this.top=joosetop;this.globalObjects=[];this.anonymouseClassCounter=0};Joose.A={};Joose.A.each=function(C,B){for(var A=0;A<C.length;A++){B(C[A],A)}};Joose.A.exists=function(C,B){for(var A=0;A<C.length;A++){if(C[A]==B){return true}}return false};Joose.A.concat=function(A,B){A.push.apply(A,B);return A};Joose.A.grep=function(C,B){var A=[];Joose.A.each(C,function(D){if(B(D)){A.push(D)}});return A};Joose.A.remove=function(C,B){var A=[];Joose.A.each(C,function(D){if(D!==B){A.push(D)}});return A};Joose.S={};Joose.S.uppercaseFirst=function(A){var C=A.substr(0,1);var B=A.substr(1,A.length-1);C=C.toUpperCase();return C+B};Joose.S.isString=function(A){if(typeof A=="string"){return true}return false};Joose.O={};Joose.O.each=function(A,C){for(var B in A){C(A[B],B)}};Joose.O.eachSafe=function(A,C){for(var B in A){if(A.hasOwnProperty(B)){C(A[B],B)}}};Joose.O.extend=function(D,C){for(var B in C){var A=C[B];D[B]=A}};Joose.prototype={addToString:function(A,B){A.toString=B},isInstance:function(A){if(!A.meta){throw"isInstance only works with Joose objects and classes."}if(A.constructor===A.meta.c){return true}return false},init:function(){this.builder=new Joose.Builder();this.builder.globalize()},components:function(){return["Joose.Builder","Joose.Class","Joose.Method","Joose.ClassMethod","Joose.Attribute","Joose.Role","Joose.SimpleRequest","Joose.Gears","Joose.Storage","Joose.Storage.Unpacker","Joose.Decorator","Joose.Module","Joose.Prototype","Joose.TypeConstraint","Joose.TypeCoercion","Joose.Types"]},loadComponents:function(B){var A="";Joose.A.each(this.components(),function(D){var C=""+B+"/"+D.split(".").join("/")+".js";A+='<script type="text/javascript" src="'+C+'"><\/script>'});document.write(A)}};Joose.copyObject=function(B,C){var A="";Joose.O.each(B,function(E,D){A+=", "+D;C[D]=E});return C};Joose.emptyFunction=function(){};var joose=new Joose();Joose.bootstrap=function(){var B=new Joose.MetaClassBootstrap();B.builder=Joose.MetaClassBootstrap;Joose.MetaClass=B.createClass("Joose.MetaClass");Joose.MetaClass.meta.addNonJooseSuperClass("Joose.MetaClassBootstrap",B);Joose.MetaClass.meta.addMethod("initialize",function(){this._name="Joose.MetaClass"});var A=new Joose.MetaClass();A.builder=Joose.MetaClass;Joose.Class=A.createClass("Joose.Class");Joose.Class.meta.addSuperClass(Joose.MetaClass);Joose.MetaClass.meta.addMethod("initialize",function(){this._name="Joose.Class"})};Joose.bootstrap2=function(){Joose.Builder.Globals.joosify("Joose.Method",Joose.Method);Joose.Builder.Globals.joosify("Joose.Attribute",Joose.Attribute)};Joose.bootstrap3=function(){};Joose.MetaClassBootstrap=function(){this._name="Joose.MetaClassBootstrap";this.methodNames=[];this.attributeNames=["_name","isAbstract","isDetached","methodNames","attributeNames","methods","parentClasses","roles","c"];this.attributes={},this.methods={};this.classMethods={};this.parentClasses=[];this.roles=[];this.myRoles=[];this.isAbstract=false;this.isDetached=false};Joose.MetaClassBootstrap.prototype={toString:function(){if(this.meta){return"a "+this.meta.className()}return"NoMeta"},className:function(){return this._name},getName:function(){return this.className()},newMetaClass:function(){var B=this;var A=this.builder;var D=new A();D.builder=A;D._name=this._name;D.methodNames=[];D.attributeNames=[];D.methods={};D.classMethods={};D.parentClasses=[];D.roles=[];D.myRoles=[];D.attributes={};var C=this.meta;if(!C){C=this}D.meta=C;return D},createClass:function(B,A,D){var E=this.newMetaClass();var F;if(A){F=A}else{F=this.defaultClassFunctionBody();if(D){D.addElement(F)}}F.prototype.meta=E;F.meta=E;if(B==null){E._name="__anonymous__"}else{var C=B;if(D){C=D.getName()+"."+B}E._name=C}E.c=F;if(!D){joose.globalObjects.push(F)}E.addInitializer();E.addToString();E.addDetacher();return F},buildComplete:function(){},initializeFromProps:function(A){this._initializeFromProps(A)},_initializeFromProps:function(B){var C=this;if(B){if(joose.top.CHAOTIC_TRAVERSION_ORDER){Joose.A.each(["isa","does","has","method","methods"],function(E){if(E in B){var F=B[E];C._initializeFromProp(E,F,B);delete B[E]}})}Joose.O.eachSafe(B,function(F,E){C._initializeFromProp(E,F,B)});for(var A=0;A<this.roles.length;A++){var D=this.roles[A];D.meta.applyMethodModifiers(this.c)}C.buildComplete();C.validateClass()}},_initializeFromProp:function(E,D,C){var B=D;var A="handleProp"+E;if(this.meta.can(A)){this[A](B,C)}else{throw new Error("Called invalid builder "+E+" while creating class "+this.className())}},instantiate:function(){var A=function(){};A.prototype=this.c.prototype;A.prototype.constructor=this.c;var B=new A();this.c.apply(B,arguments);return B},defaultClassFunctionBody:function(){var A=function(){this.initialize.apply(this,arguments)};joose.addToString(A,function(){return this.meta.className()});return A},addToString:function(){this.addMethod("toString",function(){if(this.stringify){return this.stringify()}return"a "+this.meta.className()})},addInitializer:function(){if(!this.c.prototype.initialize){this.addMethod("initialize",this.initializer())}},initializer:function(){return function A(E){var G=this;if(this.meta.isAbstract){var D=this.meta.className();throw""+D+" is an abstract class and may not instantiated."}var C=this.meta.getAttributes();for(var F in C){if(C.hasOwnProperty(F)){var B=C[F];B.doInitialization(G,E)}}}},dieIfString:function(A){if(Joose.S.isString(A)){throw new TypeError("Parameter must not be a string.")}},addRole:function(A){this.dieIfString(A);var B=this.getClassObject();if(A.meta.apply(B)){this.roles.push(A);this.myRoles.push(A)}},getClassObject:function(){return this.c},classNameToClassObject:function(D){var F=joose.top;var E=D.split(".");var B=F;for(var C=0;C<E.length;C++){var A=E[C];B=B[A];if(!B){throw"Unable to find class "+D}}return B},addNonJooseSuperClass:function(C,B){var D=new Joose.MetaClassBootstrap();D.builder=Joose.MetaClassBootstrap;var A=D.createClass(C);Joose.O.each(B,function(F,E){if(typeof(F)=="function"){A.meta.addMethod(E,F)}else{A.meta.addAttribute(E,{init:F})}});this.addSuperClass(A)},addSuperClass:function(G){this.dieIfString(G);var I=this;var H=G.meta.getMethodNames();for(var E=0;E<H.length;E++){var B=H[E];var C=G.meta.getMethodObject(B);if(C){var A=C.copy();A.setIsFromSuperClass(true);I.addMethodObject(A)}C=G.meta.getClassMethodObject(B);if(C){var A=C.copy();A.setIsFromSuperClass(true);I.addMethodObject(A)}}Joose.O.eachSafe(G.meta.attributes,function(J,K){I.addAttribute(K,J.getProps())});var F=G.meta.roles;for(var E=0;E<F.length;E++){var D=F[E];I.roles.push(D)}this.parentClasses.unshift(G)},_fixMetaclassIncompatability:function(D){var A=D.meta;var C=A.meta.className();if(C=="Joose.Class"||C=="Joose.MetaClass"||C=="Joose.MetaClassBootstrap"){return}if(this.meta.meta.isa(A)){return}var E=A.meta.instantiate(this);for(var B in E){this[B]=E[B]}},isa:function(D){this.dieIfString(D);var A=D.meta.className();if(this.className()==A){return true}for(var B=0;B<this.parentClasses.length;B++){var C=this.parentClasses[B].meta;if(C.className()==A){return true}if(C.isa(D)){return true}}return false},wrapMethod:function(B,D,C,A){var E=this.getMethodObject(B);if(E){this.addMethodObject(E[D](C))}else{if(A){A()}else{throw new Error("Unable to apply "+D+" method modifier because method "+B+" does not exist")}}},dispatch:function(A){return this.getMethodObject(A).asFunction()},hasMethod:function(A){return this.methods[A]!=null||this.classMethods[A]!=null},addMethod:function(B,D,C){var A=new Joose.Method(B,D,C);this.addMethodObject(A)},addClassMethod:function(B,D,C){var A=new Joose.ClassMethod(B,D,C);this.addMethodObject(A)},addMethodObject:function(C){var A=C;var B=A.getName();if(!this.methods[B]&&!this.classMethods[B]){this.methodNames.push(B)}if(A.isClassMethod()){this.classMethods[B]=A}else{this.methods[B]=A}C.addToClass(this.c)},attributeMetaclass:function(){return Joose.Attribute},addAttribute:function(B,C){var D=this.attributeMetaclass();if(C&&C.metaclass){D=C.metaclass}var A=new D(B,C);A.apply(this.c)},getAttributes:function(){return this.attributes},getAttribute:function(A){return this.attributes[A]},setAttribute:function(A,B){return this.attributes[A]=B},getMethodObject:function(A){return this.methods[A]},getClassMethodObject:function(A){return this.classMethods[A]},getAttributeNames:function(){return this.attributeNames},getInstanceMethods:function(){var A=[];Joose.O.eachSafe(this.methods,function(B){A.push(B)});return A},getClassMethods:function(){var A=[];Joose.O.eachSafe(this.classMethods,function(B){A.push(B)});return A},getSuperClasses:function(){return this.parentClasses},getSuperClass:function(){return this.parentClasses[0]},getRoles:function(){return this.roles},getMethodNames:function(){return this.methodNames},makeAnonSubclass:function(){var A=this.createClass(this.className()+"__anon__"+joose.anonymouseClassCounter++);A.meta.addSuperClass(this.getClassObject());return A},addDetacher:function(){this.addMethod("detach",function A(){var C=this.meta;if(C.isDetached){return}var D=C.makeAnonSubclass();D.meta.isDetached=true;this.meta=D.meta;this.constructor=D;var B;if(!this.__proto__){B=this}else{B={};Joose.copyObject(this,B)}D.prototype=B;this.__proto__=D.prototype;return})},validateClass:function(){var C=this.getClassObject();var B=this;var A=true;Joose.A.each(this.roles,function(D){D.meta.isImplementedBy(C,A)})},can:function(A){var B=this.methods[A];if(!B){return false}return true},classCan:function(A){var B=this.classMethods[A];if(!B){return false}return true},does:function(B){for(var A=0;A<this.roles.length;A++){if(B===this.roles[A]){return true}}for(var A=0;A<this.roles.length;A++){if(this.roles[A].meta.does(B)){return true}}return false},implementsMyMethods:function(B){var A=true;Joose.A.each(this.getMethodNames(),function(D){var C=B.meta.can(D);if(!C){A=false}});return A},handleProprequires:function(A){var B=this;if(!this.meta.isa(Joose.Role)){throw ("Keyword 'requires' only available classes with a meta class of type Joose.Role")}if(A instanceof Array){Joose.A.each(A,function(C){B.addRequirement(C)})}else{B.addRequirement(A)}},handlePropisAbstract:function(A){this.isAbstract=A},handlePropisa:function(A){this.addSuperClass(A)},handlePropdoes:function(B){var A=this;if(B instanceof Array){Joose.A.each(B,function(C){A.addRole(C)})}else{A.addRole(B)}},handleProphas:function(D){var C=this;if(typeof D=="string"){var A=arguments[0];var B=arguments[1];C.addAttribute(A,B)}else{Joose.O.eachSafe(D,function(F,E){C.addAttribute(E,F)})}},handlePropmethod:function(A,C,B){this.addMethod(A,C,B)},handlePropmethods:function(B){var A=this;Joose.O.eachSafe(B,function(D,C){A.addMethod(C,D)})},handlePropclassMethods:function(B){var A=this;Joose.O.eachSafe(B,function(C,D){A.addMethodObject(new Joose.ClassMethod(D,C))})},handlePropworkers:function(B){var A=this;Joose.O.eachSafe(B,function(D,C){A.addWorker(C,D)})},handlePropbefore:function(B){var A=this;Joose.O.eachSafe(B,function(D,C){A.wrapMethod(C,"before",D)})},handlePropafter:function(B){var A=this;Joose.O.eachSafe(B,function(D,C){A.wrapMethod(C,"after",D)})},handleProparound:function(B){var A=this;Joose.O.eachSafe(B,function(D,C){A.wrapMethod(C,"around",D)})},handlePropoverride:function(B){var A=this;Joose.O.eachSafe(B,function(D,C){A.wrapMethod(C,"override",D)})},handlePropaugment:function(B){var A=this;Joose.O.eachSafe(B,function(D,C){A.wrapMethod(C,"augment",D,function(){A.addMethod(C,D)})})},handlePropdecorates:function(B){var A=this;Joose.O.eachSafe(B,function(D,C){A.decorate(D,C)})}};Joose.Attribute=function(A,B){this.initialize(A,B)};Joose.Attribute.prototype={_name:null,_props:null,getName:function(){return this._name},getProps:function(){return this._props},initialize:function(A,B){this._name=A;this.setProps(B)},setProps:function(A){if(A){this._props=A}else{this._props={}}},getIsa:function(){var A=this.getProps();if(A.isa){if(!A.isa.meta){return A.isa()}return A.isa}return},addSetter:function(G){var I=G.meta;var A=this.getName();var H=this.getProps();var F=this.getIsa();var C;if(F){if(!F.meta){throw new Error("Isa declarations in attribute declarations must be Joose classes, roles or type constraints")}var J=false;var D=false;if(Joose.Role&&F.meta.meta.isa(Joose.Role)){J=true}else{if(Joose.TypeConstraint&&F.meta.isa(Joose.TypeConstraint)){D=true}}C=function B(P,M){var N=P;try{if(H.nullable===true&&N==undefined){}else{if(D){var L=null;if(H.coerce){L=F.coerce(N)}if(L==null&&H.nullable!==true){F.validate(N)}else{N=L}}else{if(!N||!N.meta){throw new ReferenceError("The attribute "+A+" only accepts values that have a meta object.")}var K=J?N.meta.does(F):N.meta.isa(F);if(!K){throw new ReferenceError("The attribute "+A+" only accepts values that are objects of type "+F.meta.className()+".")}}}}catch(O){if(M){M.call(this,O,F)}else{throw O}}this[A]=N;return this}}else{C=function E(K){this[A]=K;return this}}I.addMethod(this.setterName(),C)},addGetter:function(E){var G=E.meta;var B=this.getName();var C=this.getProps();var D=function A(){return this[B]};var H=C.init;if(C.lazy){D=function F(){var I=this[B];if(typeof I=="function"&&I===H){this[B]=I.apply(this)}return this[B]}}G.addMethod(this.getterName(),D)},initializerName:function(){return this.toPublicName()},getterName:function(){if(this.__getterNameCache){return this.__getterNameCache}this.__getterNameCache="get"+Joose.S.uppercaseFirst(this.toPublicName());return this.__getterNameCache},setterName:function(){if(this.__setterNameCache){return this.__setterNameCache}this.__setterNameCache="set"+Joose.S.uppercaseFirst(this.toPublicName());return this.__setterNameCache},isPrivate:function(){return this.getName().charAt(0)=="_"},toPublicName:function(){if(this.__publicNameCache){return this.__publicNameCache}var A=this.getName();if(this.isPrivate()){this.__publicNameCache=A.substr(1);return this.__publicNameCache}this.__publicNameCache=A;return this.__publicNameCache},handleIs:function(D){var E=D.meta;var A=this.getName();var B=this.getProps();var C=B.is;if(C=="rw"||C=="ro"){this.addGetter(D)}if(C=="rw"){this.addSetter(D)}},handleInit:function(D){var C=this.getProps();var A=this.getName();D.prototype[A]=null;if(typeof C.init!="undefined"){var E=C.init;var B=typeof E;D.prototype[A]=E}},handleProps:function(A){this.handleIs(A);this.handleInit(A)},apply:function(B){var C=B.meta;var A=this.getName();this.handleProps(B);C.attributeNames.push(A);C.setAttribute(A,this);C.attributes[A]=this}};Joose.Method=function(A,C,B){this.initialize(A,C,B)};Joose.Method.prototype={_name:null,_body:null,_props:null,_isFromSuperClass:false,getName:function(){return this._name},getBody:function(){return this._body},getProps:function(){return this._props},isFromSuperClass:function(){return this._isFromSuperClass},setIsFromSuperClass:function(A){this._isFromSuperClass=A},copy:function(){return new Joose.Method(this.getName(),this.getBody(),this.getProps())},initialize:function(A,C,B){this._name=A;this._body=C;this._props=B;C.name=A;C.meta=this},isClassMethod:function(){return false},apply:function(A,B){return this._body.apply(A,B)},addToClass:function(A){A.prototype[this.getName()]=this.asFunction()},asFunction:function(){return this._body}};Joose.bootstrap();Joose.Builder=function(){this.globalize=function(){Joose.O.each(Joose.Builder.Globals,function(C,A){var B="Joose"+A;if(typeof joose.top[A]=="undefined"){joose.top[A]=C}joose.top[B]=C})}};Joose.Builder.Globals={Module:function(B,A){return Joose.Module.setup(B,A)},Role:function(A,B){if(!B.meta){B.meta=Joose.Role}return JooseClass(A,B)},Prototype:function(A,B){if(!B.meta){B.meta=Joose.Prototype}return JooseClass(A,B)},Class:function(A,G){var F=null;if(A){var E=A;if(joose.currentModule){E=joose.currentModule.getName()+"."+A}var H=joose.top;var C=E.split(".");for(var D=0;D<C.length;D++){H=H[C[D]]}F=H}if(F==null){var I;if(G&&G.meta){I=G.meta;delete G.meta}else{if(G&&G.isa&&G.isa!=Joose.Class){I=G.isa.meta.builder}else{I=Joose.Class}}var J=new I();J.builder=I;var F=J.createClass(A,null,joose.currentModule);F.meta.builder=I;var E=F.meta.className();if(A&&E){var H=joose.top;var B=new String(E);var C=B.split(".");for(var D=0;D<C.length-1;D++){if(H[C[D]]==null){H[C[D]]={}}H=H[C[D]]}H[C[C.length-1]]=F}}F.meta.initializeFromProps(G);return F},Type:function(B,D){var C=Joose.TypeConstraint.newFromTypeBuilder(B,D);var A=joose.currentModule;if(!A){JooseModule("TYPE");A=TYPE.meta}A.addElement(C);A.getContainer()[B]=C;return C},joosify:function(F,G){var H=G;var A=new Joose.Class();A.builder=Joose.Class;H.toString=function(){return this.meta.className()};H=A.createClass(F,H);var E=H.meta;for(var B in G.prototype){if(B=="meta"){continue}var D=G.prototype[B];if(typeof(D)=="function"){E.addMethod(B,D)}else{var C={};if(typeof(D)!="undefined"){C.init=D}E.addAttribute(B,C)}}return H},rw:"rw",ro:"ro"};joose.init();Joose.bootstrap2();(function(A){A("Joose.Method",{methods:{copy:function(){return this.meta.instantiate(this.getName(),this.getBody(),this.getProps())},_makeWrapped:function(B){return this.meta.instantiate(this.getName(),B)},around:function(B){var D=this.getBody();return this._makeWrapped(function C(){var F=this;var E=function(){return D.apply(F,arguments)};return B.apply(this,Joose.A.concat([E],arguments))})},before:function(C){var D=this.getBody();return this._makeWrapped(function B(){C.apply(this,arguments);return D.apply(this,arguments)})},after:function(C){var D=this.getBody();return this._makeWrapped(function B(){var E=D.apply(this,arguments);C.apply(this,arguments);return E})},override:function(C){var D=this.getBody();return this._makeWrapped(function B(){var G=this;var F=function(){return D.apply(G,arguments)};var H=this.SUPER;this.SUPER=F;var E=C.apply(this,arguments);this.SUPER=H;return E})},augment:function(C){var D=this.getBody();D.source=D.toString();return this._makeWrapped(function B(){var I=D;var G=this;var E=C;E.source=E.toString();if(!this.__INNER_STACK__){this.__INNER_STACK__=[]}this.__INNER_STACK__.push(E);var H=this.INNER;this.INNER=function(){return G.__INNER_STACK__.pop().apply(G,arguments)};var F=D.apply(this,arguments);this.INNER=H;return F})}}})})(JooseClass);(function(A){A("Joose.ClassMethod",{isa:Joose.Method,methods:{isClassMethod:function(){return true},addToClass:function(B){B[this.getName()]=this.asFunction()},copy:function(){return new Joose.ClassMethod(this.getName(),this.getBody(),this.getProps())}}})})(JooseClass);(function(A){A("Joose.Attribute",{after:{handleProps:function(B){this.handleHandles(B);this.handlePredicate(B)}},methods:{isPersistent:function(){var B=this.getProps();if(B.persistent==false){return false}return true},doInitialization:function(C,J){var B=this.initializerName();var H=this.getName();var G;var F=false;if(typeof J!="undefined"&&typeof J[B]!="undefined"){G=J[B];F=true}else{var E=this.getProps();var I=E.init;if(typeof I=="function"&&!E.lazy){G=I.call(C);F=true}else{if(E.required){throw"Required initialization parameter missing: "+B+"(While initializing "+C+")"}}}if(F){var D=this.setterName();if(C.meta.can(D)){C[D](G)}else{C[H]=G}}},handleHandles:function(F){var G=F.meta;var B=this.getName();var D=this.getProps();var C=D.handles;var H=D.isa;if(C){if(C=="*"){if(!H){throw"I need an isa property in order to handle a class"}var E=D.handleWith;G.decorate(H,B,E)}else{throw"Unsupported value for handles: "+C}}},handlePredicate:function(F){var G=F.meta;var D=this.getName();var E=this.getProps();var C=E.predicate;var B=this.getterName();if(C){G.addMethod(C,function(){var H=this[B]();return H?true:false})}}}})})(JooseClass);(function(A){A("Joose.Role",{isa:Joose.Class,has:["requiresMethodNames","methodModifiers","metaRoles"],methods:{wrapMethod:function(C,E,D,B){this.methodModifiers.push(arguments);var F=this.methodModifiers},requiresMethod:function(C){var B=false;Joose.A.each(this.requiresMethodNames,function(D){if(C==D){B=true}});return B},addInitializer:Joose.emptyFunction,defaultClassFunctionBody:function(){var B=function(){throw new Error("Roles may not be instantiated.")};joose.addToString(B,function(){return this.meta.className()});return B},addSuperClass:function(){throw new Error("Roles may not inherit from a super class.")},initialize:function(){this._name="Joose.Role";this.requiresMethodNames=[];this.methodModifiers=[]},addRequirement:function(B){this.requiresMethodNames.push(B)},unapply:function(C){if(!joose.isInstance(C)){throw new Error("You way only remove roles from instances.")}if(!C.meta.isDetached){throw new Error("You may only remove roles that were applied at runtime")}var D=this.getClassObject();var F=C.meta.myRoles;var J=false;var B=[];for(var E=0;E<F.length;E++){if(F[E]===D){J=true}else{B.push(F[E])}}if(!J){throw new Error("The role "+this.className()+" was not applied to the object at runtime")}var I=C.meta.getSuperClass();var H=I.meta.makeAnonSubclass();var G=new H();for(var E=0;E<B.length;E++){var D=B[E];H.meta.addRole(D)}H.prototype=G;C.meta=H.meta;C.constructor=H;C.__proto__=G},addMethodToClass:function(E,C){var B=E.getName();var D;if(E.isClassMethod()){D=C.meta.getClassMethodObject(B)}else{D=C.meta.getMethodObject(B)}if(!D||D.isFromSuperClass()){C.meta.addMethodObject(E)}},apply:function(D){if(D.meta.does(this.getClassObject())){return false}if(joose.isInstance(D)){D.detach();D.meta.addRole(this.getClassObject());this.applyMethodModifiers(D);var C=true;this.isImplementedBy(D,C)}else{var E=this;var F=this.getMethodNames();Joose.A.each(F,function G(I){var H=E.getMethodObject(I);if(H){E.addMethodToClass(H,D)}H=E.getClassMethodObject(I);if(H){E.addMethodToClass(H,D)}});if(this.metaRoles){Joose.A.each(this.metaRoles,function B(H){H.meta.apply(D.meta)})}}return true},applyMethodModifiers:function(B){Joose.A.each(this.methodModifiers,function C(D){B.meta.wrapMethod.apply(B.meta,D)})},hasRequiredMethods:function(E,C){var D=this;var B=true;Joose.A.each(this.requiresMethodNames,function(G){var F=E.meta.can(G);if(!F){if(C){throw ("Class "+E.meta.className()+" does not fully implement the role "+D.className()+". The method is "+G+" missing.")}B=false;return}});return B},isImplementedBy:function(D,C){var B=this.hasRequiredMethods(D,C);if(B){B=this.implementsMyMethods(D)}return B},handlePropmetaRoles:function(B){this.metaRoles=B}}});Joose.Role.anonymousClassCounter=0})(JooseClass);(function(A){A("Joose.SimpleRequest",{has:{_req:{}},methods:{initialize:function(){if(window.XMLHttpRequest){this._req=new XMLHttpRequest()}else{this._req=new ActiveXObject("Microsoft.XMLHTTP")}},getText:function(B){this._req.open("GET",B,false);try{this._req.send(null);if(this._req.status==200||this._req.status==0){return this._req.responseText}}catch(C){throw ("File not found: "+B);return null}throw ("File not found: "+B);return null}}})})(JooseClass);(function(A){A("Joose.Gears",{isa:Joose.Class,has:{wp:{},calls:{init:{}},callIndex:{init:0}},methods:{initialize:function(){JooseGearsInitializeGears();if(this.canGears()){this.wp=google.gears.factory.create("beta.workerpool");var B=this;this.wp.onmessage=function(D,C,E){B.handleGearsMessage(E)}}},handleGearsMessage:function(E){var D=E.body;var F=D.to;var C=D.ret;var B=this.calls[D.index];if(B.meta.can(F)){B[F].call(B,C)}},canGears:function(){return window.google&&window.google.gears&&window.google.gears.factory},addWorker:function(C,D,I){var E="on"+Joose.S.uppercaseFirst(C);var L=this.meta.getClassObject().ajaxRequest;if(!this.canGears()){var J=function(){var P=this;var O={sendReturn:function(Q,R){if(P.meta.can(R)){P[R].call(P,Q)}},clientHasGears:function(){return false},ajaxRequest:L};var N=D.apply(O,arguments);O.sendReturn(N,E)};this.addMethod(C,J,I);return}var G=this.can("jsonURL")?this.c.jsonURL():"json2.js";var M=new Joose.SimpleRequest().getText(G);var B="var timer = google.gears.factory.create('beta.timer');\nfunction aClass () {}; aClass.prototype."+C+" = "+D.toString()+"\n\naClass.prototype.clientHasGears = function () { return true }\naClass.prototype.ajaxRequest = "+L.toString()+"\n\nvar wp = google.gears.workerPool;\nwp.onmessage = function (a,b,message) {\nvar paras = message.body;\nvar o = new aClass();\no.sendReturn = function (ret, cbName) { wp.sendMessage({ ret: ret, to: cbName, index: paras.index }, message.sender) } \nvar ret = o."+C+".apply(o, paras.args); if(!ret) ret = null; \no.sendReturn(ret, paras.cbName);\n}\n\n";B+=M;var K=this.wp;var F=K.createWorker(B);var H=this;var J=function(){var N=[];for(var O=0;O<arguments.length;O++){N.push(arguments[O])}var P={args:N,cbName:E,index:H.callIndex};K.sendMessage(P,F);H.calls[H.callIndex]=this;H.callIndex++};this.addMethod(C,J,I)}},classMethods:{setupGearsCompat:function(){window.timer={setTimeout:function(B,C){return window.setTimeout(B,C)},setInterval:function(B,C){return window.setInterval(B,C)},clearTimeout:function(B){return window.clearTimeout(B)},clearInterval:function(B){return window.clearInterval(B)}}},clientHasGears:function(){return window.google&&window.google.gears&&window.google.gears.factory},ajaxRequest:function(B,C,F,K,H){var E;if(this.clientHasGears()){E=google.gears.factory.create("beta.httprequest")}else{E=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()}var I="";if(F){for(var G in F){I+=encodeURIComponent(G)+"="+encodeURIComponent(F[G])+"&"}}var D=C;if(F&&B=="GET"){D+="?"+I}E.open(B,D,true);E.onreadystatechange=function J(){if(E.readyState==4){if(E.status>=200&&E.status<400){var L=E.responseText;K(L)}else{if(H){return H(E)}else{throw new Error("Error fetching url "+D+". Response code: "+E.status+" Response text: "+E.responseText)}}}};if(F&&B=="POST"){E.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");E.send(I)}else{I="";E.send(I)}}}})})(JooseClass);function JooseGearsInitializeGears(){if(window.google&&google.gears){return}var A=null;if(typeof GearsFactory!="undefined"){A=new GearsFactory()}else{try{A=new ActiveXObject("Gears.Factory");if(A.getBuildInfo().indexOf("ie_mobile")!=-1){A.privateSetGlobalObject(this)}}catch(B){if(navigator.mimeTypes["application/x-googlegears"]){A=document.createElement("object");A.style.display="none";A.width=0;A.height=0;A.type="application/x-googlegears";document.documentElement.appendChild(A)}}}if(!A){return}if(!window.google){google={}}if(!google.gears){google.gears={factory:A}}}(function(A,B){B("Joose.Storage",{methods:{toJSON:function(){var C=this.pack(Joose.Storage.TEMP_SEEN);C.toJSON=function(){return this};return C},identity:function(){if(this.__ID__){return this.__ID__}else{return this.__ID__=Joose.Storage.OBJECT_COUNTER++}},pack:function(C){return this.meta.c.storageEngine().pack(this,C)}},classMethods:{storageEngine:function(){return Joose.Storage.Engine},unpack:function(C){return this.storageEngine().unpack(this,C)}}});B("Joose.Storage.jsonpickle",{does:Joose.Storage,classMethods:{storageEngine:function(){return Joose.Storage.Engine.jsonpickle}}});Joose.Storage.OBJECT_COUNTER=1;A("Joose.Storage.Engine",{classMethods:{pack:function(E,C){if(C){var I=E.identity();var G=C[I];if(G){return{__ID__:I}}}if(E.meta.can("prepareStorage")){E.prepareStorage()}if(C){C[E.identity()]=true}var H={__CLASS__:this.packedClassName(E),__ID__:E.identity()};var D=E.meta.getAttributes();Joose.O.eachSafe(D,function F(J,K){if(J.isPersistent()){H[K]=E[K]}});return H},unpack:function(E,D){var G=E.meta;var C=G.instantiate();var F=false;Joose.O.eachSafe(D,function H(K,I){if(I=="__CLASS__"){var J=Joose.Storage.Unpacker.packedClassNameToJSClassName(K);if(J!=C.meta.className()){throw new Error("Storage data is of wrong type "+J+". I am "+C.meta.className()+".")}F=true;return}C[I]=K});if(!F){throw new Error("Serialized data needs to include a __CLASS__ attribute.: "+D)}delete C.__ID__;if(C.meta.can("finishUnpack")){C.finishUnpack()}return C},packedClassName:function(D){if(D.meta.can("packedClassName")){return D.packedClassName()}var C=D.meta.className();var E=C.split(".");return E.join("::")}}});A("Joose.Storage.Engine.jsonpickle",{classMethods:{pack:function(E,C){if(C){var I=E.identity();var G=C[I];if(G){return{objectid__:I}}}if(E.meta.can("prepareStorage")){E.prepareStorage()}if(C){C[E.identity()]=true}var H={classname__:this.packedClassName(E),classmodule__:this.packedModuleName(E),objectid__:E.identity()};var D=E.meta.getAttributes();Joose.O.eachSafe(D,function F(J,K){if(J.isPersistent()){H[K]=E[K]}});return H},unpack:function(E,D){var G=E.meta;var C=G.instantiate();var F=false;Joose.O.eachSafe(D,function H(L,I){if(I=="classname__"){var K=L;var J=D.classmodule__;if(J){K=""+J+"."+L}if(K!=C.meta.className()){throw new Error("Storage data is of wrong type "+K+". I am "+C.meta.className()+".")}F=true;return}if(I=="classmodule__"){return}C[I]=L});if(!F){throw new Error("Serialized data needs to include a __CLASS__ attribute.: "+D)}if(C.meta.can("finishUnpack")){C.finishUnpack()}return C},packedClassName:function(D){var C=D.meta.className();var E=C.split(".");return E.pop()},packedModuleName:function(D){var C=D.meta.className();var E=C.split(".");E.pop();return E.join(".")}}});Joose.Storage.storageEngine=Joose.Storage.Engine;Joose.Storage.jsonpickle.storageEngine=Joose.Storage.Engine.jsonpickle})(JooseClass,JooseRole);(function(A){A("Joose.Storage.Unpacker",{classMethods:{unpack:function(D){var C=D.__CLASS__;if(!C){throw ("Serialized data needs to include a __CLASS__ attribute.")}var B=this.packedClassNameToJSClassName(C);var F=this.meta.classNameToClassObject(B);var E=F.unpack(D);var G;if(Joose.Storage.CACHE&&(G=D.__ID__)){Joose.Storage.CACHE[G]=E}return E},packedClassNameToJSClassName:function(B){var C=B.split("-");C=C[0].split("::");return C.join(".")},jsonParseFilter:function(B,C){if(C!=null&&typeof C=="object"){if(C.__CLASS__){return Joose.Storage.Unpacker.unpack(C)}if(C.__ID__){return Joose.Storage.CACHE[C.__ID__]}}return C},patchJSON:function(){var D=JSON.parse;var B=this.jsonParseFilter;JSON.parse=function(G,F){Joose.Storage.CACHE={};return D(G,function E(H,I){var J=I;if(F){J=F(H,I)}return B(H,J)})};var C=JSON.stringify;JSON.stringify=function(){Joose.Storage.TEMP_SEEN={};return C.apply(JSON,arguments)}}}});A("Joose.Storage.Unpacker.jsonpickle",{isa:Joose.Storage.Unpacker,classMethods:{unpack:function(D){var C=D.classname__;if(!C){throw ("Serialized data needs to include a classname__ attribute.")}var B=this.packedClassNameToJSClassName(C,D.classmodule__);var F=this.meta.classNameToClassObject(B);var E=F.unpack(D);var G;if(Joose.Storage.CACHE&&(G=D.objectid__)){Joose.Storage.CACHE[G]=E}return E},packedClassNameToJSClassName:function(D,C){var B="";if(C){B+=C+"."}B+=D;return B},jsonParseFilter:function(B,C){if(C!=null&&typeof C=="object"){if(C.classname__){return Joose.Storage.Unpacker.jsonpickle.unpack(C)}if(C.objectid__){return Joose.Storage.CACHE[C.objectid__]}}return C}}})})(JooseClass);(function(A){A("Joose.Decorator",{meta:Joose.Role,methods:{decorate:function(F,D,C){var E=this;var B=F.meta.getInstanceMethods();Joose.A.each(B,function(G){var H=G.getName();var J=D;if(!E.can(H)){var I=function(){var K=this[J];return K[H].apply(K,arguments)};if(C){I=C(H)}E.addMethod(H,I)}})}}});Joose.Decorator.meta.apply(Joose.Class)})(JooseClass);(function(A){A("Joose.Module",{has:{_name:{is:"rw"},_elements:{is:"rw"},_container:{is:"rw"}},classMethods:{setup:function(B,C){var J=this;var G=B.split(".");var F=joose.top;var I=[];var E;for(var H=0;H<G.length;H++){var D=G[H];if(D=="meta"){throw"Module names may not include a part called 'meta'."}var L=F[D];I.push(D);var B=I.join(".");if(typeof L=="undefined"){F[D]={};E=new Joose.Module(B);E.setContainer(F[D]);F[D].meta=E;Joose.Module._allModules.push(F[D])}else{E=L.meta;if(!(E&&E.meta&&(E.meta.isa(Joose.Module)))){throw"Trying to setup module "+B+" failed. There is already something else: "+E}}F=F[D]}var K=joose.currentModule;joose.currentModule=E;if(C){C(F)}joose.currentModule=K;return F},getAllModules:function(){return this._allModules}},methods:{alias:function(B){var C=this;if(arguments.length==0){return this}Joose.A.each(this.getElements(),function(D){var E=C.globalName(D.meta.className());if(B[E]===D){return}if(typeof B[E]!="undefined"){throw"There is already something else in the spot "+E}B[E]=D})},globalName:function(C){var B=this.getName();if(C.indexOf(B)!=0){throw"All things inside me should have a name that starts with "+B+". Name is "+C}var D=C.substr(B.length+1);if(D.indexOf(".")!=-1){throw"The things inside me should have no more dots in there name. Name is "+D}return D},removeGlobalSymbols:function(){Joose.A.each(this.getElements(),function(B){var C=this.globalName(B.getName());delete joose.top[C]})},initialize:function(B){this.setElements([]);this.setName(B)},isEmpty:function(){return this.getElements().length==0},addElement:function(B){if(!(B||B.meta)){throw"You may only add things that are Joose objects"}this._elements.push(B)},getNames:function(){var B=[];Joose.A.each(this.getElements(),function(C){B.push(C.meta.getName())});return B}}})})(JooseClass);__global__={};__global__.meta=new Joose.Module();__global__.meta.setName("__global__");__global__.meta.setContainer(__global__);Joose.Module._allModules=[__global__];JooseModule("__global__.nomodule",function(){});__global__.nomodule.meta._elements=joose.globalObjects;(function(A){A("Joose.Prototype",{isa:Joose.Class,override:{initializer:function(){var B=this.SUPER();return function(){B.apply(this,arguments);var C=this.meta;this.meta=new Joose.PrototypeLazyMetaObjectProxy();this.meta.metaObject=C;this.meta.object=this}}}});A("Joose.PrototypeLazyMetaObjectProxy",{has:{metaObject:{is:"rw",isa:Joose.Class,handles:"*",handleWith:function(B){return function(){var C=this.object;C.meta=this.metaObject;C.detach();C.meta[B].apply(C.meta,arguments)}}},object:{is:"rw"}}});Joose.bootstrap3()})(JooseClass);(function(A){A("Joose.TypeConstraint",{has:{_constraints:{is:"ro",init:function(){return[]}},_coercions:{is:"ro",init:function(){return[]}},_messages:{is:"ro",init:function(){return[]}},_callback:{is:"ro",init:function(){return function(B){throw new ReferenceError(B)}}},_name:{is:"ro"},_uses:{is:"ro"},props:{is:"rw"}},classMethods:{newFromTypeBuilder:function(C,F){var E=new Joose.TypeConstraint({name:C});if(F.uses&&typeof F.uses.meta!="undefined"&&F.uses.meta.isa(Joose.TypeConstraint)){E._uses=F.uses}if(F.where){E.addConstraint(F.where,F.message)}E.setProps(F);if(F.coerce){for(var D=0;D<F.coerce.length;D++){var B=F.coerce[D];E.addCoercion(new Joose.TypeCoercion({from:B.from,via:B.via}))}}return E}},methods:{stringify:function(){return this._name},makeSubType:function(B){var C=new Joose.TypeConstraint({name:B});Joose.A.each(this._constraints,function(D){C.addConstraint(D)});return C},addCoercion:function(B){this._coercions.push(B)},addConstraint:function(C,B){this._constraints.push(C);this._messages.push(B)},getConstraintList:function(){var B=this._constraints;if(this._uses){var C=this._uses.getConstraintList();return C.concat(B)}return B},getMessageList:function(){var C=this._messages;if(this._uses){var B=this._uses.getMessageList();return B.concat(C)}return C},validateBool:function(C){var B=this._validate(C);if(B==-1){return true}return false},validate:function(E){var B=this._validate(E);if(B==-1){return true}var D=this.getMessageList();var C=D[B]?D[B].call(this,E):"The passed value ["+E+"] is not a "+this;this._callback(C)},_validate:function(G){var D=this.getConstraintList();var E,C;for(E=0,C=D.length;E<C;E++){var F=D[E];var B=false;if(F instanceof RegExp){B=F.test(G)}else{B=F.call(this,G)}if(!B){return E}}return -1},coerce:function(G){if(this.validateBool(G)){return G}var F=this._coercions;for(var E=0,C=F.length;E<C;E++){var D=F[E];var B=D.coerce(G);if(B!==null){return B}}return null}}})})(JooseClass);(function(B,A){A("CoercionFrom",{where:function(C){if(C.meta&&C.meta.isa(Joose.TypeConstraint)){return true}return false}});B("Joose.TypeCoercion",{has:{_from:{isa:TYPE.CoercionFrom,is:"rw"},_via:{is:"rw"}},methods:{coerce:function(C){if(this._from.validateBool(C)){return this._via(C)}return null}}})})(JooseClass,JooseType);(function(A){A("Any",{where:function(B){return true}});A("Null",{uses:TYPE.Any,where:function(B){if(B===null){return true}return false}});A("NotNull",{uses:TYPE.Any,where:function(B){if(B===null){return false}return true}});A("Enum",{uses:TYPE.NotNull,message:function(B){return"The passed value ["+B+"] is not "+(this.getProps().strictMatch?"*strictly* ":"")+"one of ["+this.getProps().values.join(",")+"]"},where:function(D){var C=this;if(!C.getProps()||C.getProps().values===undefined||!(C.getProps().values instanceof Array)){throw"Enum Type needs Array of values in 'values' property of Type declaration"}var B=function(E){if(C.getProps().strictMatch===true){return(E===D)}return(E==D)};if(Joose.A.grep(C.getProps().values,B).length!=0){return true}return false}});A("Obj",{uses:TYPE.NotNull,where:function(B){if(B instanceof Object){return true}return false}});A("Str",{uses:TYPE.NotNull,where:function(B){if(typeof B=="string"||B instanceof String){return true}return false},coerce:[{from:TYPE.Any,via:function(B){if(B==null){return""}else{return""+B}}}]});A("Num",{uses:TYPE.NotNull,where:function(B){if(typeof B=="number"||B instanceof Number){return true}return false},coerce:[{from:TYPE.Str,via:function(B){if(B==null||B==""){return undefined}return parseFloat(B)}}]});A("Bool",{uses:TYPE.NotNull,where:function(C){if(C===true||C===false){return true}return false},coerce:[{from:TYPE.Any,via:function(B){if(B==null||B===""){return undefined}if(B==1||B=="1"||B=="true"){return true}if(B==0||B=="0"||B=="false"){return false}return null}}]});A("Int",{uses:TYPE.Num,where:function(C){var B=String(C);if(B.match(/^\d*\.\d$/)){return false}return true},coerce:[{from:TYPE.Str,via:function(B){if(B==null||B==""){return undefined}if(B.match(/^-{0,1}\d+$/)){return parseInt(B)}return}}]});A("Float",{uses:TYPE.Num,where:function(B){return true}});A("Func",{uses:TYPE.Obj,where:function(B){if(typeof B=="function"){return true}return false}});A("Array",{uses:TYPE.Obj,where:function(B){if(B instanceof Array){return true}return false}});A("Date",{uses:TYPE.Obj,where:function(B){if(B instanceof Date){return true}return false},coerce:[{from:TYPE.Str,via:function(C){var B;if(C==undefined||C==""){return undefined}else{if(B=C.match(/\s*(\d+)-(\d+)-(\d+)/)){return new Date(B[1],B[2]-1,[B[3]])}}return null}}]});A("Joose",{uses:TYPE.Obj,where:function(B){if(B.meta&&B.meta.meta.isa(Joose.Class)){return true}return false}})})(JooseType);if(!this.JSON){JSON={}}(function(){function f(n){return n<10?"0"+n:n}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(key){return this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z"};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf()}}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+string+'"'}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==="object"&&typeof value.toJSON==="function"){value=value.toJSON(key)}if(typeof rep==="function"){value=rep.call(holder,key,value)}switch(typeof value){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null"}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==="[object Array]"){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||"null"}v=partial.length===0?"[]":gap?"[\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"]":"["+partial.join(",")+"]";gap=mind;return v}if(rep&&typeof rep==="object"){length=rep.length;for(i=0;i<length;i+=1){k=rep[i];if(typeof k==="string"){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}else{for(k in value){if(Object.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}v=partial.length===0?"{}":gap?"{\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"}":"{"+partial.join(",")+"}";gap=mind;return v}}if(typeof JSON.stringify!=="function"){JSON.stringify=function(value,replacer,space){var i;gap="";indent="";if(typeof space==="number"){for(i=0;i<space;i+=1){indent+=" "}}else{if(typeof space==="string"){indent=space}}rep=replacer;if(replacer&&typeof replacer!=="function"&&(typeof replacer!=="object"||typeof replacer.length!=="number")){throw new Error("JSON.stringify")}return str("",{"":value})}}if(typeof JSON.parse!=="function"){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==="object"){for(k in value){if(Object.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v}else{delete value[k]}}}}return reviver.call(holder,key,value)}cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})}if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof reviver==="function"?walk({"":j},""):j}throw new SyntaxError("JSON.parse")}}})();Module("JooseX.DOMBinding",function(A){Role("JQueryMetaRole",{requires:["getAttribute"],methods:{handlePropbind:function(B){var C=this;var D=[];Joose.O.each(B,function(L,F){var M=C.getAttribute(F);if(!M){throw new Error("Cant find attribute "+F+" for binding")}D.push(F);var O={selector:null,accessor:"val",args:[],notifyOn:[]};Joose.O.extend(O,L);var I=O.selector;var K=O.accessor;var N=O.args;var H=O.notifyOn;var Q=M.getterName();var J=M.setterName();C.wrapMethod(Q,"before",function P(){var U=F;var T=this.$;if(I){T=this.$.find(I)}var S=T[K].apply(T,N);this[F]=S});C.wrapMethod(J,"after",function R(){var V=this[F];var U=this.$;if(I){U=this.$.find(I)}var S=[];for(var T=0;T<N.length;T++){S.push(N[T])}S.push(V);U[K].apply(U,S)});C.wrapMethod("draw","after",function G(){var U=this;for(var T=0;T<H.length;T++){var S=H[T];var V=this.$;if(I){V=V.find(I)}V.bind(S,function(W){U.notify(S,this,W)})}})});C.addMethod("redraw",function E(){for(var G=0;G<D.length;G++){var F=D[G];var I=this.meta.getAttribute(F).setterName();var H=this[F];this[I](H)}})}}});Role("JQuery",{metaRoles:[A.JQueryMetaRole],methods:{draw:function(){this.$=this.create();this.destination().append(this.$)},destination:function(){return jQuery(document.body)},notify:function(C,D,B){}},after:{initialize:function(){this.draw()}}})});Module("JooseX",function(A){var C={};var B=true;Role("Singleton",{before:{initialize:function(){if(B){var D=this.meta.className();throw new Error("The class "+D+" is a singleton. Please use the class method getInstance().")}}},methods:{singletonInitialize:function(){}},classMethods:{getInstance:function(){var E=this.meta.className();var D=C[E];if(D){return D}B=false;D=this.meta.instantiate();B=true;D.singletonInitialize();C[E]=D;return D}}})});Module("JooseX.Culture",function(A){var B="en-US";A.setCurrentCulture=function(D){B=D};A.makeFloatFormatter=function(D,E){return function(K,L){var J=L?A.sprintf(L,K):""+K;var F=J.split(".");var I=F[0];var G=F.length>1?D+F[1]:"";var H=/(\d+)(\d{3})/;while(H.test(I)){I=I.replace(H,"$1"+E+"$2")}return I+G}};var C={};Class("Factory",{classMethods:{register:function(D){C[D.identifier()]=D},get:function(E){var F=E||B;var D=C[F];if(!D){throw new Error("Unknown culture "+F)}return D}}});Class("EnUs",{does:[JooseX.Singleton],methods:{identifier:function(){return"en-US"},subIdentifier:function(){return this.identifier().split("-")[1]},majorIdentifier:function(){return this.identifier().split("-")[0]},parseNumber:function(D){var E=D+"";E=E.replace(/,/g,"");return parseFloat(E,10)},formatNumber:A.makeFloatFormatter(".",","),parseDate:function(D){return Date.parse(D)},formatDate:function(D){return D.toString("mm/MM/yyyy")}}});A.Factory.register(A.EnUs.getInstance());Class("EnGb",{isa:JooseX.Culture.EnUs,methods:{identifier:function(){return"en-GB"},formatDate:function(D){return D.toString("dd/MM/yyyy")}}});A.Factory.register(A.EnGb.getInstance());Class("DeDe",{isa:JooseX.Culture.EnUs,methods:{identifier:function(){return"de-DE"},parseNumber:function(E){var D=""+E;D=D.replace(/\./g,"");D=D.replace(/\,/,".");return parseFloat(D,10)},formatNumber:A.makeFloatFormatter(",","."),formatDate:function(D){return D.toString("dd.MM.yyyy")}}});A.Factory.register(A.DeDe.getInstance());Class("ItIt",{isa:JooseX.Culture.DeDe,methods:{identifier:function(){return"it-IT"},formatDate:function(D){return D.toString("dd/MM/yyyy")}}});A.Factory.register(A.ItIt.getInstance());Class("EsEs",{isa:JooseX.Culture.DeDe,methods:{identifier:function(){return"es-ES"},formatDate:function(D){return D.toString("dd.MM.yyyy")}}});A.Factory.register(A.EsEs.getInstance());sprintfWrapper={init:function(){if(typeof arguments=="undefined"){return null}if(arguments.length<1){return null}if(typeof arguments[0]!="string"){return null}if(typeof RegExp=="undefined"){return null}var L=arguments[0];var F=new RegExp(/(%([%]|(\-)?(\+|\x20)?(0)?(\d+)?(\.(\d)?)?([bcdfosxX])))/g);var J=new Array();var N=new Array();var D=0;var K=0;var O=0;var G=0;var M="";var I=null;while(I=F.exec(L)){if(I[9]){D+=1}K=G;O=F.lastIndex-I[0].length;N[N.length]=L.substring(K,O);G=F.lastIndex;J[J.length]={match:I[0],left:I[3]?true:false,sign:I[4]||"",pad:I[5]||" ",min:I[6]||0,precision:I[8],code:I[9]||"%",negative:parseInt(arguments[D])<0?true:false,argument:String(arguments[D])}}N[N.length]=L.substring(G);if(J.length==0){return L}if((arguments.length-1)<D){return null}var E=null;var I=null;var H=null;for(H=0;H<J.length;H++){if(J[H].code=="%"){substitution="%"}else{if(J[H].code=="b"){J[H].argument=String(Math.abs(parseInt(J[H].argument)).toString(2));substitution=sprintfWrapper.convert(J[H],true)}else{if(J[H].code=="c"){J[H].argument=String(String.fromCharCode(parseInt(Math.abs(parseInt(J[H].argument)))));substitution=sprintfWrapper.convert(J[H],true)}else{if(J[H].code=="d"){J[H].argument=String(Math.abs(parseInt(J[H].argument)));substitution=sprintfWrapper.convert(J[H])}else{if(J[H].code=="f"){J[H].argument=String(Math.abs(parseFloat(J[H].argument)).toFixed(J[H].precision?J[H].precision:6));substitution=sprintfWrapper.convert(J[H])}else{if(J[H].code=="o"){J[H].argument=String(Math.abs(parseInt(J[H].argument)).toString(8));substitution=sprintfWrapper.convert(J[H])}else{if(J[H].code=="s"){J[H].argument=J[H].argument.substring(0,J[H].precision?J[H].precision:J[H].argument.length);substitution=sprintfWrapper.convert(J[H],true)}else{if(J[H].code=="x"){J[H].argument=String(Math.abs(parseInt(J[H].argument)).toString(16));substitution=sprintfWrapper.convert(J[H])}else{if(J[H].code=="X"){J[H].argument=String(Math.abs(parseInt(J[H].argument)).toString(16));substitution=sprintfWrapper.convert(J[H]).toUpperCase()}else{substitution=J[H].match}}}}}}}}}M+=N[H];M+=substitution}M+=N[H];return M},convert:function(E,G){if(G){E.sign=""}else{E.sign=E.negative?"-":E.sign}var D=E.min-E.argument.length+1-E.sign.length;var F=new Array(D<0?0:D).join(E.pad);if(!E.left){if(E.pad=="0"||G){return E.sign+F+E.argument}else{return F+E.sign+E.argument}}else{if(E.pad=="0"||G){return E.sign+E.argument+F.replace(/0/g," ")}else{return E.sign+E.argument+F}}}};A.sprintf=sprintfWrapper.init});Module("JooseX",function(B){var A="  ";Class("Dumper",{does:[JooseX.Singleton],has:{logger:{is:"rw",init:function(){var C=window.console||{log:function(){}};return C}}},methods:{dump:function(E){var C=E.meta.getAttributes();var D=this.logger;D.log("Dumping "+E);Joose.O.each(C,function(G){var H=G.getName();var F=G.getterName();var I;if(F&&E[F]){I=E[F]()}else{I=E[I]}D.log(A+H+" = "+I)})}}});Role("DumpAfterInit",{after:{initialize:function(){B.Dumper.getInstance().dump(this)}}});Role("Dumpable",{methods:{dump:function(){B.Dumper.getInstance().dump(this)}}})});(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};C.formatMatch=C.formatMatch||C.formatItem;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(N,I){var C={UP:38,DOWN:40,DEL:46,TAB:9,RETURN:13,ESC:27,COMMA:188,PAGEUP:33,PAGEDOWN:34,BACKSPACE:8};var O;var D=function(){return new Date().getTime()};var B=A(N).attr("autocomplete","off").addClass(I.inputClass);var L;var V="";var R=A.Autocompleter.Cache(I);var F=0;var Z;var d={mouseDownOnSelect:false};var W=A.Autocompleter.Select(I,N,E,d);W.init();var c;A.browser.opera&&A(N.form).bind("submit.autocomplete",function(){if(c){c=false;return false}});var a;var Q=false;var J=true;B.bind((A.browser.opera?"keypress":"keydown")+".autocomplete",function(e){Z=e.keyCode;switch(e.keyCode){case C.UP:e.preventDefault();if(W.visible()){W.prev()}else{Y(0,true)}break;case C.DOWN:e.preventDefault();if(W.visible()){W.next()}else{Y(0,true)}break;case C.PAGEUP:e.preventDefault();if(W.visible()){W.pageUp()}else{Y(0,true)}break;case C.PAGEDOWN:e.preventDefault();if(W.visible()){W.pageDown()}else{Y(0,true)}break;case I.multiple&&A.trim(I.multipleSeparator)==","&&C.COMMA:case C.TAB:if(E()){e.preventDefault();c=true;return true}break;case C.RETURN:if(E()){e.preventDefault();c=true;return false}break;case C.ESC:W.hide();break;default:clearTimeout(L);L=setTimeout(Y,I.delay);break}}).focus(function(){s2.Logger.debug("focus");F++}).blur(function(){F=0;if(!d.mouseDownOnSelect){X();s2.Logger.debug("blur/hide")}}).click(function(){I.showAllOnFullMatch=true;if(F++>0&&!W.visible()){Y(0,true);O=D()}I.showAllOnFullMatch=false}).bind("search",function(){var e=(arguments.length>1)?arguments[1]:null;function f(n,m){var g;if(m&&m.length){for(var h=0;h<m.length;h++){if(m[h].result.toLowerCase()==n.toLowerCase()){g=m[h];break}}}if(typeof e=="function"){e(g)}else{B.trigger("result",g&&[g.data,g.value])}}A.each(H(B.val()),function(g,h){G(h,f,f)})}).bind("flushCache",function(){R.flush()}).bind("setOptions",function(){A.extend(I,arguments[1]);if("data" in arguments[1]){R.populate()}}).bind("unautocomplete",function(){W.unbind();B.unbind();A(N.form).unbind(".autocomplete")}).bind("s2:closeIfOpen",function(){if(F>0&&D()-O>300){X()}});var P=function(e){e=jQuery("<span>"+e+"</span>").text()};function E(){var f=W.selected();if(!f){return false}var e=f.result;V=e;if(I.multiple){var g=H(B.val());if(g.length>1){e=g.slice(0,g.length-1).join(I.multipleSeparator)+I.multipleSeparator+e}e+=I.multipleSeparator}B.val(P(e));b();B.trigger("result",[f.data,f.value]);return true}function Y(g,f){if(Z==C.DEL){W.hide();return}s2.Logger.debug("Open");var e=B.val();if(e.match(/\.\.\.$/)){e=B.data("completeValue")}if(!f&&e==V){return}s2.Logger.debug("Open2");V=e;e=K(e);if(e.length>=I.minChars){B.addClass(I.loadingClass);if(!I.matchCase){e=e.toLowerCase()}G(e,M,b);s2.Logger.debug("Open3")}else{S();W.hide();s2.Logger.debug("Open4")}}function H(f){if(!f){return[""]}var g=f.split(I.multipleSeparator);var e=[];A.each(g,function(h,m){if(A.trim(m)){e[h]=A.trim(m)}});return e}function K(e){if(!I.multiple){return e}var f=H(e);return f[f.length-1]}function U(e,f){if(I.autoFill&&(K(B.val()).toLowerCase()==e.toLowerCase())&&Z!=C.BACKSPACE){B.val(P(B.val()+f.substring(K(V).length)));A.Autocompleter.Selection(N,V.length,V.length+f.length)}}function X(){b()}function b(){s2.tuifly.controller.AirportInfoHideEvent.trigger();var e=W.visible();W.hide();clearTimeout(L);S();if(I.mustMatch){B.search(function(f){if(!f){if(I.multiple){var g=H(B.val()).slice(0,-1);B.val(P(g.join(I.multipleSeparator)+(g.length?I.multipleSeparator:"")))}else{B.val("")}}})}if(e){A.Autocompleter.Selection(N,N.value.length,N.value.length)}}function M(f,e){if(e&&e.length&&F){S();W.display(e,f);U(f,e[0].value);W.show();W.scrollTo(B.val())}else{b()}}function G(f,h,e){if(!I.matchCase){f=f.toLowerCase()}var g=R.load(f);s2.Logger.debug("Open4.5");if(g&&g.length){s2.Logger.debug("Open5 "+g.length);h(f,g)}else{if((typeof I.url=="string")&&(I.url.length>0)){var m={timestamp:+new Date()};A.each(I.extraParams,function(n,o){m[n]=typeof o=="function"?o():o});A.ajax({mode:"abort",port:"autocomplete"+N.name,dataType:I.dataType,url:I.url,data:A.extend({q:K(f),limit:I.max},m),success:function(o){var n=I.parse&&I.parse(o)||T(o);R.add(f,n);h(f,n)}})}else{W.emptyList();e(f)}}}function T(h){var e=[];var g=h.split("\n");for(var f=0;f<g.length;f++){var m=A.trim(g[f]);if(m){m=m.split("|");e[e.length]={data:m,value:m[0],result:I.formatResult&&I.formatResult(m,m[0])||m[0]}}}return e}function S(){B.removeClass(I.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]},formatMatch:null,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};A.Autocompleter.Cache=function(C){var F={};var D=0;function H(K,J){if(!C.matchCase){K=K.toLowerCase()}var I=K.indexOf(J);if(I==-1){return false}return I==0||C.matchContains}function G(J,I){if(D>C.cacheLength){B()}if(!F[J]){D++}F[J]=I}function E(){s2.Logger.debug("Pipulate cache");if(!C.data){return false}var J={},I=0;if(!C.url){C.cacheLength=1}J[""]=[];for(var L=0,K=C.data.length;L<K;L++){var O=C.data[L];O=(typeof O=="string")?[O]:O;var N=C.formatMatch(O,L+1,C.data.length);if(N===false){continue}var M=N.charAt(0).toLowerCase();if(!J[M]){J[M]=[]}var P={value:N,data:O,result:C.formatResult&&C.formatResult(O)||N};J[M].push(P);if(I++<C.max){J[""].push(P)}}A.each(J,function(Q,R){C.cacheLength++;G(Q,R)});s2.Logger.debug("Pipulate cache2")}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=[];var L=[];for(var I in F){if(I.length>0){var O=F[I];A.each(O,function(Q,P){if(H(P.value,N)){M.push(P)}L.push(P)})}}if(C.handleResult){var J=C.handleResult(C,M,L,N);if(J){return J}}return M}else{if(F[N]){return F[N]}else{if(C.matchSubset){for(var K=N.length-1;K>=C.minChars;K--){var O=F[N.substr(0,K)];if(O){var M=[];A.each(O,function(Q,P){if(H(P.value,N)){M[M.length]=P}});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(document.body);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){window.triggerClickCompactSearchAllowed=true;A(Q(T)).addClass(I.ACTIVE);L();try{J.focus()}catch(U){}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(I.ACTIVE);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)}}}s2.tuifly.controller.AirportInfoShowEvent.trigger(V)}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 W=0;W<U;W++){if(!R[W]){continue}var Y=E.formatItem(R[W].data,W+1,U,R[W].value,M);if(Y===false){continue}var X=W%2==0?"ac_even":"ac_odd";var T=A("<li class='ac_element "+X+"'/>");var V=E.highlight(Y,M);T.get(0).innerHTML=V;T.appendTo(O);T=T[0];A.data(T,"ac_data",R[W])}K=O.find("li");if(E.selectFirst){K.slice(0,1).addClass(I.ACTIVE);F=0}if(A.fn.bgiframe){O.bgiframe()}}return{display:function(U,T){N();R=U;M=T;D();s2.tuifly.controller.AutoCompleteShowEvent.trigger()},init:function(){N()},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();K&&K.removeClass(I.ACTIVE);F=-1;if(jQuery.browser.msie){A("#flugsuche select").removeClass("hidden")}},visible:function(){return C&&C.is(":visible")},current:function(){return this.visible()&&(K.filter("."+I.ACTIVE)[0]||E.selectFirst&&K[0])},show:function(){if(jQuery.browser.msie){A("#flugsuche select").addClass("hidden")}var V=A(J).offset();C.css({width:typeof E.width=="string"||E.width>0?E.width:A(J).width(),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"))-parseInt(K.css("padding-right")))}}}},selected:function(){var T=K&&K.filter("."+I.ACTIVE).removeClass(I.ACTIVE);return T&&T.length&&A.data(T[0],"ac_data")},emptyList:function(){O&&O.empty()},unbind:function(){C&&C.remove()},scrollTo:function(V){var U=O.get(0);V=V.replace(/\([^(]*$/,"").replace(/\.\.\.$/,"");var T=O.find("li:contains('"+V+"')");if(T.length>0){var X=T.get(0);var W=T.position().top;s2.Logger.debug("Scroll pos "+W+";"+U.scrollTop);U.scrollTop=W;s2.Logger.debug("Scroll pos "+W+";"+U.scrollTop)}else{s2.Logger.debug("not found")}}}};A.Autocompleter.Selection=function(E,F,C){if(E.createTextRange){var B=E.createTextRange();B.collapse(true);B.moveStart("character",F);B.moveEnd("character",C);try{B.select()}catch(D){}}else{if(E.setSelectionRange){try{E.setSelectionRange(F,C)}catch(D){}}else{if(E.selectionStart){E.selectionStart=F;E.selectionEnd=C}}}try{E.focus()}catch(D){}}})(jQuery);(function(){var A;var B=false;jQuery.fn.typingEnded=function(E,D){var C=this;D=jQuery.extend({delay:600},D);var F=D.delay;C.keydown(function(){var G=this;var H=arguments;if(A){clearTimeout(A)}A=setTimeout(function(){E.apply(G,H)},F)});return C}})();(function(){var A={};var B=function(D){var F=this;var E=A;if(F instanceof jQuery){if(F.QUERY_CACHE==null){F.QUERY_CACHE={}}E=F.QUERY_CACHE}if(D in E){return E[D]}var C;if(F instanceof jQuery){C=F.find(D)}else{C=jQuery(D)}E[D]=C;return C};jQuery.cachedFind=B;jQuery.fn.cachedFind=B;jQuery(window).bind("unload",function(){for(var C in A){delete A[C]}})})();(function($){$.extend_deep=function(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options;if(target.constructor==Boolean){deep=target;target=arguments[1]||{};i=2}if(typeof target!="object"&&typeof target!="function"){target={}}if(length==1){target=this;i=0}for(;i<length;i++){if((options=arguments[i])!=null){for(var name in options){if(target===options[name]){continue}if(deep&&options[name]&&typeof options[name]=="object"&&target[name]&&!options[name].nodeType){target[name]=$.extend_deep(true,target[name],options[name])}else{if(options[name]!=undefined){target[name]=options[name]}}}}}return target};$.metaobjects=function(options){options=$.extend({context:document,clean:true,selector:"object.metaobject"},options);function _value(value){eval("value = "+value+";");return value}function _object(name,value){var names=name.split(".");var result={};var current=result;for(var i=0,iLast=names.length-1;i<=iLast;i++){if(names[i]){current=current[names[i]]=i==iLast?value:{}}}return result}return $(options.selector,options.context).each(function(){var settings={target:this.parentNode,cache:false};$("> param[name=metaparam]",this).each(function(){$.extend(settings,_value(this.value))});$("> param",this).not("[name=metaparam]").each(function(){var name=this.name;var value=_value(this.value);if(settings.cache){var rest=name.split(".");var first=rest.shift();rest=rest.join(".");var mixed=rest?_object(rest,value):value;$(settings.target).each(function(){var data=$.data(this,first);if(!data){$.data(this,first,mixed)}else{$.extend_deep(true,data,mixed)}})}else{$(settings.target).each(function(){$.extend_deep(true,this,_object(name,value))})}});if(options.clean){$(this).remove()}})}})(jQuery);(function(A){A.fn.checkboxChecked=function(B){if(arguments.length==0){var C=true;this.each(function(){var D=this.checked;if(!D){C=false;return false}});return C}else{this.each(function(){this.checked=B});return this}}})(jQuery);jQuery.fn.extend({selectbox:function(A){return this.each(function(){new jQuery.SelectBox(this,A)})}});jQuery.expr[":"].startsWith=function(D,C,A){var B=A[3];if(!B){return false}return RegExp("^\\s*"+B,"i").test($(D).text())};jQuery.SelectBox=function(e,M){var K=M||{};K.inputClass=K.inputClass||"selectbox";K.containerClass=K.containerClass||"selectbox-wrapper";K.hoverClass=K.hoverClass||"current";K.currentClass=K.selectedClass||"selected";K.debug=K.debug||false;var m=e.id;var Q;var A;var F;var Z="";var U;var c=-1;var S=false;var P=0;var V=false;var h=$(e);var D=R(K);var W=g(K);if(M.maxlength){var O=W.val;W.val=function(o){if(arguments.length>0){o=""+o;return O.call(this,o.substring(0,parseInt(M.maxlength)))}return O.call(this)}}if(M.abbreviate){var O=W.val;var J="...";W.val=function(q){if(arguments.length>0){q=""+q;var p=new s2.tuifly.util.TextMetrics(W,q);var o=p.elementWidth();if((0<o)&&(o<p.width())){q=q.substr(0,p.getIndexAtX(o-(new s2.tuifly.util.TextMetrics(W,J).width())))+J}return O.call(this,q)}return O.call(this)}}h.hide().before(W).before(D);var N=D.show;var a=false;D.show=function(){if(!a){f()}a=true;N.apply($(this));Q.filter("."+K.hoverClass).removeClass(K.hoverClass);var o=Q.filter(function(p){return $(this).text().match(RegExp("^\\s*"+n().replace(/\.\.\.$/,"").replace(/([()^$.*+?\\[\]\/])/g,"\\$1"),"i"))}).eq(0).addClass(K.hoverClass);c=Q.index(o);F.scrollTop(o.position().top-A.position().top)};var b=function(){return new Date().getTime()};var H=0;var L=false;var d=function(){var p=W.position();var o=p.top+W.outerHeight();D.css("top",o+"px");D.css("left",p.left+"px")};var B=false;W.click(function(){if(B&&b()-H>200){D.hide();B=false}else{D.show();B=true}}).focus(function(){if(D.not(":visible")){d();S=true;D.show();B=true;H=b()}}).keydown(function(o){switch(o.keyCode){case 38:o.preventDefault();X(-1);break;case 40:o.preventDefault();X(1);break;case 13:o.preventDefault();$("li."+K.hoverClass,D).trigger("click");break;case 27:o.preventDefault();C();break}}).keypress(function(t){if(P>0){return}var p;if(t.which==null){p=t.keyCode}else{if(t.which>0){p=t.which}}var u=String.fromCharCode(p);if(p&&(31<p)&&(p!=127)&&u.match(/[^\\\.\*\+\?\[\]\(\)\^\$\/]/)){if(D.not(":visible").length>0){D.show()}Z=Z+u;var q=D.find("li:startsWith("+Z+")");if(((Z.match(/(.)\1/i))&&(q.length==0))||((Z.length==1)&&(q.filter("."+K.hoverClass).length==1)&&(q.length>1))){Z=u;q=(q.length>0)?(q):(D.find("li:startsWith("+Z+")"));var o=q.index(q.filter("."+K.hoverClass))+1;o=(o<q.length)?(o):(0);q=q.eq(o)}else{q=q.eq(0)}if(q.length>0){Q.filter("."+K.hoverClass).removeClass(K.hoverClass);q.addClass(K.hoverClass);c=Q.index(q);F.scrollTop(q.position().top-A.position().top);Q.filter("."+K.currentClass).removeClass(K.currentClass);q.addClass(K.currentClass);I()}if(U){window.clearTimeout(U)}U=window.setTimeout(function(){Z=""},1000)}}).blur(function(){if(P>0){if(K.debug){console.log("container visible and has focus")}}else{C()}});function C(){P=0;D.hide();B=false;if(V){V=false;h.trigger("customSelect_changedAndClosed")}}function f(){F=Y(W.attr("id"));F=$(F);D.append(F);Q=$("li",D);A=Q.eq(0)}function R(p){var o=document.createElement("div");D=$(o);D.attr("id",m+"_container");D.addClass(p.containerClass);D.css("position","absolute");D.hide();return D}function g(p){var o=document.createElement("input");var q=$(o);q.attr("id",m+"_input");q.attr("type","text");q.addClass(p.inputClass);q.attr("autocomplete","off");q.attr("readonly","readonly");q.attr("tabIndex",h.attr("tabindex"));return q}function X(o){if(!Q){return}if(P>0){return}if(D.not(":visible").length>0){D.show()}c=c+o;if(c<0){c=0}else{if(c>=Q.size()){c=Q.size()-1}}Q.filter("."+K.hoverClass).removeClass(K.hoverClass);Q.filter("."+K.currentClass).removeClass(K.currentClass);F.scrollTop($(Q[c]).addClass(K.hoverClass).addClass(K.currentClass).position().top-A.position().top);I()}function I(){var o=$("li."+K.currentClass,D).get(0);var p=(""+o.id).split("_");var q=p[p.length-1];h.val(q);W.val($(o).text());V=true;h.change();return true}var G=function(){W.val(h.find(":selected").text())};var T=function(){if(F){F.remove()}else{a=true}f()};h.data("update",G);h.data("updateList",T);$(window).load(G);s2.tuifly.events.AvailibilityCookieDataSet.observe(G);function E(){return h.val()}function n(){return W.val()}function Y(t){var u=new Array();var p=document.createElement("ul");if(h.closest(".queryCustomSelects").length>0){var q=h.closest(".queryCustomSelects").attr("optionWidth");var o=h.closest(".queryCustomSelects").attr("optionHeight");if(q&&o){$(p).css("height",o+"px");$(p).css("width",q+"px");$(p).css("overflow","auto")}}h.children("option").each(function(){var v=document.createElement("li");v.setAttribute("id",t+"_"+$(this).val());v.innerHTML=$(this).html();if($(this).is(":selected")){W.val($(this).text());$(v).addClass(K.currentClass)}p.appendChild(v);$(p).mouseout(function(){P=-1}).mouseover(function(){P=1});$(v).mouseover(function(w){P=1;if(K.debug){console.log("over on : "+this.id)}Q.filter("."+K.hoverClass).removeClass(K.hoverClass);c=Q.index($(w.target,D).addClass(K.hoverClass))}).mouseout(function(w){if(K.debug){console.log("out on : "+this.id)}}).click(function(w){if(K.debug){console.log("click on :"+this.id)}$("li."+K.currentClass,D).removeClass(K.currentClass);$(this).addClass(K.currentClass);c=Q.index($(this));I();C()})});return p}};jQuery.fn.ajaxSubmit=function(C){if(typeof C=="function"){C={success:C}}C=jQuery.extend({url:this.attr("action")||"",method:this.attr("method")||"GET"},C||{});C.success=C.success||C.after;C.beforeSubmit=C.beforeSubmit||C.before;C.type=C.type||C.method;var A=this.formToArray(C.semantic);if(C.beforeSubmit&&C.beforeSubmit(A,this,C)===false){return this}var E=jQuery.param(A);if(C.type.toUpperCase()=="GET"){C.url+=(C.url.indexOf("?")>=0?"&":"?")+E;C.data=null}else{C.data=E}var B=this,D=[];if(C.resetForm){D.push(function(){B.resetForm()})}if(C.clearForm){D.push(function(){B.clearForm()})}if(!C.dataType&&C.target){var F=C.success||function(){};D.push(function(H,G){jQuery(C.target).attr("innerHTML",H).evalScripts().each(F,[H,G])})}else{if(C.success){D.push(C.success)}}C.success=function(J,H){for(var I=0,G=D.length;I<G;I++){D[I](J,H)}};jQuery.ajax(C);return this};jQuery.fn.ajaxForm=function(A){return this.each(function(){jQuery("input:submit,input:image,button:submit",this).click(function(C){var B=this.form;B.clk=this;if(this.type=="image"){if(C.offsetX!=undefined){B.clk_x=C.offsetX;B.clk_y=C.offsetY}else{if(typeof jQuery.fn.offset=="function"){var D=jQuery(this).offset();B.clk_x=C.pageX-D.left;B.clk_y=C.pageY-D.top}else{B.clk_x=C.pageX-this.offsetLeft;B.clk_y=C.pageY-this.offsetTop}}}setTimeout(function(){B.clk=B.clk_x=B.clk_y=null},10)})}).submit(function(B){jQuery(this).ajaxSubmit(A);return false})};jQuery.fn.formToArray=function(L){var K=[];if(this.length==0){return K}var B=this[0];var F=L?B.getElementsByTagName("*"):B.elements;if(!F){return K}for(var G=0,I=F.length;G<I;G++){var C=F[G];var D=C.name;if(!D){continue}if(L&&B.clk&&C.type=="image"){if(!C.disabled&&B.clk==C){K.push({name:D+".x",value:B.clk_x},{name:D+".y",value:B.clk_y})}continue}var M=jQuery.fieldValue(C,true);if(M===null){continue}if(M.constructor==Array){for(var E=0,A=M.length;E<A;E++){K.push({name:D,value:M[E]})}}else{K.push({name:D,value:M})}}if(!L&&B.clk){var H=B.getElementsByTagName("input");for(var G=0,I=H.length;G<I;G++){var J=H[G];var D=J.name;if(D&&!J.disabled&&J.type=="image"&&B.clk==J){K.push({name:D+".x",value:B.clk_x},{name:D+".y",value:B.clk_y})}}}return K};jQuery.fn.formSerialize=function(A){return jQuery.param(this.formToArray(A))};jQuery.fn.fieldSerialize=function(B){var A=[];this.each(function(){var F=this.name;if(!F){return}var D=jQuery.fieldValue(this,B);if(D&&D.constructor==Array){for(var E=0,C=D.length;E<C;E++){A.push({name:F,value:D[E]})}}else{if(D!==null&&typeof D!="undefined"){A.push({name:this.name,value:D})}}});return jQuery.param(A)};jQuery.fn.fieldValue=function(G){var F,E;for(var C=0,A=this.length;C<A;C++){var D=this[C];var B=jQuery.fieldValue(D,G);if(B===null||typeof B=="undefined"||(B.constructor==Array&&!B.length)){continue}if(D.type!="checkbox"){return B}E=E||D.name;if(E!=D.name){return F}F=F||[];F.push(B)}return F};jQuery.fieldValue=function(A,G){var C=A.name,L=A.type,M=A.tagName.toLowerCase();if(typeof G=="undefined"){G=true}if(G&&(!C||A.disabled||L=="reset"||(L=="checkbox"||L=="radio")&&!A.checked||(L=="submit"||L=="image")&&A.form&&A.form.clk!=A||M=="select"&&A.selectedIndex==-1)){return null}if(M=="select"){var H=A.selectedIndex;if(H<0){return null}var J=[],B=A.options;var E=(L=="select-one");var I=(E?H+1:B.length);for(var D=(E?H:0);D<I;D++){var F=B[D];if(F.selected){var K=jQuery.browser.msie&&!(F.attributes.value.specified)?F.text:F.value;if(E){return K}J.push(K)}}return J}return A.value};jQuery.fn.clearForm=function(){return this.each(function(){jQuery("input,select,textarea",this).clearFields()})};jQuery.fn.clearFields=jQuery.fn.clearInputs=function(){return this.each(function(){var B=this.type,A=this.tagName.toLowerCase();if(B=="text"||B=="password"||A=="textarea"){this.value=""}else{if(B=="checkbox"||B=="radio"){this.checked=false}else{if(A=="select"){this.selectedIndex=-1}}}})};jQuery.fn.resetForm=function(){return this.each(function(){if(typeof this.reset=="function"||(typeof this.reset=="object"&&!this.reset.nodeType)){this.reset()}})};(function(C){var A=C.scrollTo=function(F,E,D){C(window).scrollTo(F,E,D)};A.defaults={axis:"y",duration:1};A.window=function(D){return C(window).scrollable()};C.fn.scrollable=function(){return this.map(function(){var G=this.parentWindow||this.defaultView,E=this.nodeName=="#document"?G.frameElement||G:this,F=E.contentDocument||(E.contentWindow||E).document,D=E.setInterval;return E.nodeName=="IFRAME"||D&&C.browser.safari?F.body:D?F.documentElement:this})};C.fn.scrollTo=function(F,E,D){if(typeof E=="object"){D=E;E=0}if(typeof D=="function"){D={onAfter:D}}D=C.extend({},A.defaults,D);E=E||D.speed||D.duration;D.queue=D.queue&&D.axis.length>1;if(D.queue){E/=2}D.offset=B(D.offset);D.over=B(D.over);return this.scrollable().each(function(){var M=this,K=C(M),L=F,J,H={},N=K.is("html,body");switch(typeof L){case"number":case"string":if(/^([+-]=)?\d+(px)?$/.test(L)){L=B(L);break}L=C(L,this);case"object":if(L.is||L.style){J=(L=C(L)).offset()}}C.each(D.axis.split(""),function(R,S){var T=S=="x"?"Left":"Top",V=T.toLowerCase(),Q="scroll"+T,O=M[Q],P=S=="x"?"Width":"Height",U=P.toLowerCase();if(J){H[Q]=J[V]+(N?0:O-K.offset()[V]);if(D.margin){H[Q]-=parseInt(L.css("margin"+T))||0;H[Q]-=parseInt(L.css("border"+T+"Width"))||0}H[Q]+=D.offset[V]||0;if(D.over[V]){H[Q]+=L[U]()*D.over[V]}}else{H[Q]=L[V]}if(/^\d+$/.test(H[Q])){H[Q]=H[Q]<=0?0:Math.min(H[Q],G(P))}if(!R&&D.queue){if(O!=H[Q]){I(D.onAfterFirst)}delete H[Q]}});I(D.onAfter);function I(O){K.animate(H,E,D.easing,O&&function(){O.call(this,F,D)})}function G(P){var O="scroll"+P,Q=M.ownerDocument;return N?Math.max(Q.documentElement[O],Q.body[O]):M[O]}}).end()};function B(D){return typeof D=="object"?D:{top:D,left:D}}})(jQuery);if(jQuery.browser.msie&&jQuery.browser.version.substr(0,1)=="6"){window.DD_belatedPNG={ns:"DD_belatedPNG",imgSize:{},createVmlNameSpace:function(){if(document.namespaces&&!document.namespaces[this.ns]){document.namespaces.add(this.ns,"urn:schemas-microsoft-com:vml")}if(window.attachEvent){window.attachEvent("onbeforeunload",function(){DD_belatedPNG=null})}},createVmlStyleSheet:function(){var A=document.createElement("style");document.documentElement.firstChild.insertBefore(A,document.documentElement.firstChild.firstChild);var B=A.styleSheet;B.addRule(this.ns+"\\:*","{behavior:url(#default#VML)}");B.addRule(this.ns+"\\:shape","position:absolute;");B.addRule("img."+this.ns+"_sizeFinder","behavior:none; border:none; position:absolute; z-index:-1; top:-10000px; visibility:hidden;");this.styleSheet=B},readPropertyChange:function(){var B=event.srcElement;if(event.propertyName.search("background")!=-1||event.propertyName.search("border")!=-1){DD_belatedPNG.applyVML(B)}if(event.propertyName=="style.display"){var C=(B.currentStyle.display=="none")?"none":"block";for(var A in B.vml){B.vml[A].shape.style.display=C}}if(event.propertyName.search("filter")!=-1){DD_belatedPNG.vmlOpacity(B)}},vmlOpacity:function(B){if(B.currentStyle.filter.search("lpha")!=-1){var A=B.currentStyle.filter;A=parseInt(A.substring(A.lastIndexOf("=")+1,A.lastIndexOf(")")),10)/100;B.vml.color.shape.style.filter=B.currentStyle.filter;B.vml.image.fill.opacity=A}},handlePseudoHover:function(A){setTimeout(function(){try{DD_belatedPNG.applyVML(A)}catch(B){s2.Logger.debug("Problem in DD_belatedPNG.applyVML "+B)}},1)},fix:function(A){var C=A.split(",");for(var B=0;B<C.length;B++){this.styleSheet.addRule(C[B],"behavior:expression(globalFixPng(this) )")}},applyVML:function(A){A.runtimeStyle.cssText="";this.vmlFill(A);this.vmlOffsets(A);this.vmlOpacity(A);if(A.isImg){this.copyImageBorders(A)}},attachHandlers:function(F){var C=this;var B={resize:"vmlOffsets",move:"vmlOffsets"};if(F.nodeName=="A"){var D={mouseleave:"handlePseudoHover",mouseenter:"handlePseudoHover",focus:"handlePseudoHover",blur:"handlePseudoHover"};for(var A in D){B[A]=D[A]}}for(var E in B){F.attachEvent("on"+E,function(){C[B[E]](F)})}F.attachEvent("onpropertychange",this.readPropertyChange)},giveLayout:function(A){A.style.zoom=1;if(A.currentStyle.position=="static"){A.style.position="relative"}},copyImageBorders:function(B){var C={borderStyle:true,borderWidth:true,borderColor:true};for(var A in C){B.vml.color.shape.style[A]=B.currentStyle[A]}},vmlFill:function(E){if(!E.currentStyle){return}else{var D=E.currentStyle}for(var C in E.vml){E.vml[C].shape.style.zIndex=D.zIndex}E.runtimeStyle.backgroundColor="";E.runtimeStyle.backgroundImage="";var A=(D.backgroundColor=="transparent");var F=true;if(D.backgroundImage!="none"||E.isImg){if(!E.isImg){E.vmlBg=D.backgroundImage;E.vmlBg=E.vmlBg.substr(5,E.vmlBg.lastIndexOf('")')-5)}else{E.vmlBg=E.src}var G=this;if(!G.imgSize[E.vmlBg]){var B=document.createElement("img");G.imgSize[E.vmlBg]=B;B.className=G.ns+"_sizeFinder";B.runtimeStyle.cssText="behavior:none; position:absolute; left:-10000px; top:-10000px; border:none;";B.attachEvent("onload",function(){this.width=this.offsetWidth;this.height=this.offsetHeight;G.vmlOffsets(E)});B.src=E.vmlBg;B.removeAttribute("width");B.removeAttribute("height");document.body.insertBefore(B,document.body.firstChild)}E.vml.image.fill.src=E.vmlBg;F=false}E.vml.image.fill.on=!F;E.vml.image.fill.color="none";E.vml.color.shape.style.backgroundColor=D.backgroundColor;E.runtimeStyle.backgroundImage="none";E.runtimeStyle.backgroundColor="transparent"},vmlOffsets:function(B){var F=B.currentStyle;var M={W:B.clientWidth+1,H:B.clientHeight+1,w:this.imgSize[B.vmlBg].width,h:this.imgSize[B.vmlBg].height,L:B.offsetLeft,T:B.offsetTop,bLW:B.clientLeft,bTW:B.clientTop};var A=(M.L+M.bLW==1)?1:0;var C=function(N,P,Q,O,R,S){N.coordsize=O+","+R;N.coordorigin=S+","+S;N.path="m0,0l"+O+",0l"+O+","+R+"l0,"+R+" xe";N.style.width=O+"px";N.style.height=R+"px";N.style.left=P+"px";N.style.top=Q+"px"};C(B.vml.color.shape,(M.L+(B.isImg?0:M.bLW)),(M.T+(B.isImg?0:M.bTW)),(M.W-1),(M.H-1),0);C(B.vml.image.shape,(M.L+M.bLW),(M.T+M.bTW),(M.W),(M.H),1);var E={X:0,Y:0};var L=function(P,N){var O=true;switch(N){case"left":case"top":E[P]=0;break;case"center":E[P]=0.5;break;case"right":case"bottom":E[P]=1;break;default:if(N.search("%")!=-1){E[P]=parseInt(N)*0.01}else{O=false}}var Q=(P=="X");E[P]=Math.ceil(O?((M[Q?"W":"H"]*E[P])-(M[Q?"w":"h"]*E[P])):parseInt(N));if(E[P]==0){E[P]++}};for(var H in E){L(H,F["backgroundPosition"+H])}B.vml.image.fill.position=(E.X/M.W)+","+(E.Y/M.H);var K=F.backgroundRepeat;var D={T:1,R:M.W+A,B:M.H,L:1+A};var J={X:{b1:"L",b2:"R",d:"W"},Y:{b1:"T",b2:"B",d:"H"}};if(K!="repeat"){var G={T:(E.Y),R:(E.X+M.w),B:(E.Y+M.h),L:(E.X)};if(K.search("repeat-")!=-1){var I=K.split("repeat-")[1].toUpperCase();G[J[I].b1]=1;G[J[I].b2]=M[J[I].d]}if(G.B>M.H){G.B=M.H}B.vml.image.shape.style.clip="rect("+G.T+"px "+(G.R+A)+"px "+G.B+"px "+(G.L+A)+"px)"}else{B.vml.image.shape.style.clip="rect("+D.T+"px "+D.R+"px "+D.B+"px "+D.L+"px)"}},fixPng:function(B){B.style.behavior="none";if(B.nodeName=="BODY"||B.nodeName=="TD"||B.nodeName=="TR"){return}B.isImg=false;if(B.nodeName=="IMG"){if(B.src.toLowerCase().search(/\.png$/)!=-1){B.isImg=true;B.style.visibility="hidden"}else{return}}else{if(B.currentStyle.backgroundImage.toLowerCase().search(".png")==-1){return}}var F=DD_belatedPNG;B.vml={color:{},image:{}};var A={shape:{},fill:{}};for(var C in B.vml){for(var E in A){var D=F.ns+":"+E;B.vml[C][E]=document.createElement(D)}B.vml[C].shape.stroked=false;B.vml[C].shape.appendChild(B.vml[C].fill);B.parentNode.insertBefore(B.vml[C].shape,B)}B.vml.image.shape.fillcolor="none";B.vml.image.fill.type="tile";B.vml.color.fill.on=false;F.attachHandlers(B);F.giveLayout(B);F.giveLayout(B.offsetParent);F.applyVML(B)}};try{document.execCommand("BackgroundImageCache",false,true)}catch(r){}DD_belatedPNG.createVmlNameSpace();DD_belatedPNG.createVmlStyleSheet()}function globalFixPng(A){if(DD_belatedPNG){DD_belatedPNG.fixPng(A)}}var swfobject=function(){var b="undefined",Q="object",n="Shockwave Flash",p="ShockwaveFlash.ShockwaveFlash",P="application/x-shockwave-flash",m="SWFObjectExprInst",j=window,K=document,T=navigator,o=[],N=[],i=[],d=[],J,Z=null,M=null,l=null,e=false,A=false;var h=function(){var v=typeof K.getElementById!=b&&typeof K.getElementsByTagName!=b&&typeof K.createElement!=b,AC=[0,0,0],x=null;if(typeof T.plugins!=b&&typeof T.plugins[n]==Q){x=T.plugins[n].description;if(x&&!(typeof T.mimeTypes!=b&&T.mimeTypes[P]&&!T.mimeTypes[P].enabledPlugin)){x=x.replace(/^.*\s+(\S+\s+\S+$)/,"$1");AC[0]=parseInt(x.replace(/^(.*)\..*$/,"$1"),10);AC[1]=parseInt(x.replace(/^.*\.(.*)\s.*$/,"$1"),10);AC[2]=/r/.test(x)?parseInt(x.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof j.ActiveXObject!=b){var y=null,AB=false;try{y=new ActiveXObject(p+".7")}catch(t){try{y=new ActiveXObject(p+".6");AC=[6,0,21];y.AllowScriptAccess="always"}catch(t){if(AC[0]==6){AB=true}}if(!AB){try{y=new ActiveXObject(p)}catch(t){}}}if(!AB&&y){try{x=y.GetVariable("$version");if(x){x=x.split(" ")[1].split(",");AC=[parseInt(x[0],10),parseInt(x[1],10),parseInt(x[2],10)]}}catch(t){}}}}var AD=T.userAgent.toLowerCase(),r=T.platform.toLowerCase(),AA=/webkit/.test(AD)?parseFloat(AD.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,q=false,z=r?/win/.test(r):/win/.test(AD),w=r?/mac/.test(r):/mac/.test(AD);
/*@cc_on q=true;@if(@_win32)z=true;@elif(@_mac)w=true;@end@*/
return{w3cdom:v,pv:AC,webkit:AA,ie:q,win:z,mac:w}}();var L=function(){if(!h.w3cdom){return}f(H);if(h.ie&&h.win){try{K.write("<script id=__ie_ondomload defer=true src=//:><\/script>");J=C("__ie_ondomload");if(J){I(J,"onreadystatechange",S)}}catch(q){}}if(h.webkit&&typeof K.readyState!=b){Z=setInterval(function(){if(/loaded|complete/.test(K.readyState)){E()}},10)}if(typeof K.addEventListener!=b){K.addEventListener("DOMContentLoaded",E,null)}R(E)}();function S(){if(J.readyState=="complete"){J.parentNode.removeChild(J);E()}}function E(){if(e){return}if(h.ie&&h.win){var v=a("span");try{var u=K.getElementsByTagName("body")[0].appendChild(v);u.parentNode.removeChild(u)}catch(w){return}}e=true;if(Z){clearInterval(Z);Z=null}var q=o.length;for(var r=0;r<q;r++){o[r]()}}function f(q){if(e){q()}else{o[o.length]=q}}function R(r){if(typeof j.addEventListener!=b){j.addEventListener("load",r,false)}else{if(typeof K.addEventListener!=b){K.addEventListener("load",r,false)}else{if(typeof j.attachEvent!=b){I(j,"onload",r)}else{if(typeof j.onload=="function"){var q=j.onload;j.onload=function(){q();r()}}else{j.onload=r}}}}}function H(){var t=N.length;for(var q=0;q<t;q++){var u=N[q].id;if(h.pv[0]>0){var r=C(u);if(r){N[q].width=r.getAttribute("width")?r.getAttribute("width"):"0";N[q].height=r.getAttribute("height")?r.getAttribute("height"):"0";if(c(N[q].swfVersion)){if(h.webkit&&h.webkit<312){Y(r)}W(u,true)}else{if(N[q].expressInstall&&!A&&c("6.0.65")&&(h.win||h.mac)){k(N[q])}else{O(r)}}}}else{W(u,true)}}}function Y(t){var q=t.getElementsByTagName(Q)[0];if(q){var w=a("embed"),y=q.attributes;if(y){var v=y.length;for(var u=0;u<v;u++){if(y[u].nodeName=="DATA"){w.setAttribute("src",y[u].nodeValue)}else{w.setAttribute(y[u].nodeName,y[u].nodeValue)}}}var x=q.childNodes;if(x){var z=x.length;for(var r=0;r<z;r++){if(x[r].nodeType==1&&x[r].nodeName=="PARAM"){w.setAttribute(x[r].getAttribute("name"),x[r].getAttribute("value"))}}}t.parentNode.replaceChild(w,t)}}function k(w){A=true;var u=C(w.id);if(u){if(w.altContentId){var y=C(w.altContentId);if(y){M=y;l=w.altContentId}}else{M=G(u)}if(!(/%$/.test(w.width))&&parseInt(w.width,10)<310){w.width="310"}if(!(/%$/.test(w.height))&&parseInt(w.height,10)<137){w.height="137"}K.title=K.title.slice(0,47)+" - Flash Player Installation";var z=h.ie&&h.win?"ActiveX":"PlugIn",q=K.title,r="MMredirectURL="+j.location+"&MMplayerType="+z+"&MMdoctitle="+q,x=w.id;if(h.ie&&h.win&&u.readyState!=4){var t=a("div");x+="SWFObjectNew";t.setAttribute("id",x);u.parentNode.insertBefore(t,u);u.style.display="none";var v=function(){u.parentNode.removeChild(u)};I(j,"onload",v)}U({data:w.expressInstall,id:m,width:w.width,height:w.height},{flashvars:r},x)}}function O(t){if(h.ie&&h.win&&t.readyState!=4){var r=a("div");t.parentNode.insertBefore(r,t);r.parentNode.replaceChild(G(t),r);t.style.display="none";var q=function(){t.parentNode.removeChild(t)};I(j,"onload",q)}else{t.parentNode.replaceChild(G(t),t)}}function G(v){var u=a("div");if(h.win&&h.ie){u.innerHTML=v.innerHTML}else{var r=v.getElementsByTagName(Q)[0];if(r){var w=r.childNodes;if(w){var q=w.length;for(var t=0;t<q;t++){if(!(w[t].nodeType==1&&w[t].nodeName=="PARAM")&&!(w[t].nodeType==8)){u.appendChild(w[t].cloneNode(true))}}}}}return u}function U(AG,AE,t){var q,v=C(t);if(v){if(typeof AG.id==b){AG.id=t}if(h.ie&&h.win){var AF="";for(var AB in AG){if(AG[AB]!=Object.prototype[AB]){if(AB.toLowerCase()=="data"){AE.movie=AG[AB]}else{if(AB.toLowerCase()=="styleclass"){AF+=' class="'+AG[AB]+'"'}else{if(AB.toLowerCase()!="classid"){AF+=" "+AB+'="'+AG[AB]+'"'}}}}}var AD="";for(var AA in AE){if(AE[AA]!=Object.prototype[AA]){AD+='<param name="'+AA+'" value="'+AE[AA]+'" />'}}v.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+AF+">"+AD+"</object>";i[i.length]=AG.id;q=C(AG.id)}else{if(h.webkit&&h.webkit<312){var AC=a("embed");AC.setAttribute("type",P);for(var z in AG){if(AG[z]!=Object.prototype[z]){if(z.toLowerCase()=="data"){AC.setAttribute("src",AG[z])}else{if(z.toLowerCase()=="styleclass"){AC.setAttribute("class",AG[z])}else{if(z.toLowerCase()!="classid"){AC.setAttribute(z,AG[z])}}}}}for(var y in AE){if(AE[y]!=Object.prototype[y]){if(y.toLowerCase()!="movie"){AC.setAttribute(y,AE[y])}}}v.parentNode.replaceChild(AC,v);q=AC}else{var u=a(Q);u.setAttribute("type",P);for(var x in AG){if(AG[x]!=Object.prototype[x]){if(x.toLowerCase()=="styleclass"){u.setAttribute("class",AG[x])}else{if(x.toLowerCase()!="classid"){u.setAttribute(x,AG[x])}}}}for(var w in AE){if(AE[w]!=Object.prototype[w]&&w.toLowerCase()!="movie"){F(u,w,AE[w])}}v.parentNode.replaceChild(u,v);q=u}}}return q}function F(t,q,r){var u=a("param");u.setAttribute("name",q);u.setAttribute("value",r);t.appendChild(u)}function X(r){var q=C(r);if(q&&(q.nodeName=="OBJECT"||q.nodeName=="EMBED")){if(h.ie&&h.win){if(q.readyState==4){B(r)}else{j.attachEvent("onload",function(){B(r)})}}else{q.parentNode.removeChild(q)}}}function B(t){var r=C(t);if(r){for(var q in r){if(typeof r[q]=="function"){r[q]=null}}r.parentNode.removeChild(r)}}function C(t){var q=null;try{q=K.getElementById(t)}catch(r){}return q}function a(q){return K.createElement(q)}function I(t,q,r){t.attachEvent(q,r);d[d.length]=[t,q,r]}function c(t){var r=h.pv,q=t.split(".");q[0]=parseInt(q[0],10);q[1]=parseInt(q[1],10)||0;q[2]=parseInt(q[2],10)||0;return(r[0]>q[0]||(r[0]==q[0]&&r[1]>q[1])||(r[0]==q[0]&&r[1]==q[1]&&r[2]>=q[2]))?true:false}function V(v,r){if(h.ie&&h.mac){return}var u=K.getElementsByTagName("head")[0],t=a("style");t.setAttribute("type","text/css");t.setAttribute("media","screen");if(!(h.ie&&h.win)&&typeof K.createTextNode!=b){t.appendChild(K.createTextNode(v+" {"+r+"}"))}u.appendChild(t);if(h.ie&&h.win&&typeof K.styleSheets!=b&&K.styleSheets.length>0){var q=K.styleSheets[K.styleSheets.length-1];if(typeof q.addRule==Q){q.addRule(v,r)}}}function W(t,q){var r=q?"visible":"hidden";if(e&&C(t)){C(t).style.visibility=r}else{V("#"+t,"visibility:"+r)}}function g(s){var r=/[\\\"<>\.;]/;var q=r.exec(s)!=null;return q?encodeURIComponent(s):s}var D=function(){if(h.ie&&h.win){window.attachEvent("onunload",function(){var w=d.length;for(var v=0;v<w;v++){d[v][0].detachEvent(d[v][1],d[v][2])}var t=i.length;for(var u=0;u<t;u++){X(i[u])}for(var r in h){h[r]=null}h=null;for(var q in swfobject){swfobject[q]=null}swfobject=null})}}();return{registerObject:function(u,q,t){if(!h.w3cdom||!u||!q){return}var r={};r.id=u;r.swfVersion=q;r.expressInstall=t?t:false;N[N.length]=r;W(u,false)},getObjectById:function(v){var q=null;if(h.w3cdom){var t=C(v);if(t){var u=t.getElementsByTagName(Q)[0];if(!u||(u&&typeof t.SetVariable!=b)){q=t}else{if(typeof u.SetVariable!=b){q=u}}}}return q},embedSWF:function(x,AE,AB,AD,q,w,r,z,AC){if(!h.w3cdom||!x||!AE||!AB||!AD||!q){return}AB+="";AD+="";if(c(q)){W(AE,false);var AA={};if(AC&&typeof AC===Q){for(var v in AC){if(AC[v]!=Object.prototype[v]){AA[v]=AC[v]}}}AA.data=x;AA.width=AB;AA.height=AD;var y={};if(z&&typeof z===Q){for(var u in z){if(z[u]!=Object.prototype[u]){y[u]=z[u]}}}if(r&&typeof r===Q){for(var t in r){if(r[t]!=Object.prototype[t]){if(typeof y.flashvars!=b){y.flashvars+="&"+t+"="+r[t]}else{y.flashvars=t+"="+r[t]}}}}f(function(){U(AA,y,AE);if(AA.id==AE){W(AE,true)}})}else{if(w&&!A&&c("6.0.65")&&(h.win||h.mac)){A=true;W(AE,false);f(function(){var AF={};AF.id=AF.altContentId=AE;AF.width=AB;AF.height=AD;AF.expressInstall=w;k(AF)})}}},getFlashPlayerVersion:function(){return{major:h.pv[0],minor:h.pv[1],release:h.pv[2]}},hasFlashPlayerVersion:c,createSWF:function(t,r,q){if(h.w3cdom){return U(t,r,q)}else{return undefined}},removeSWF:function(q){if(h.w3cdom){X(q)}},createCSS:function(r,q){if(h.w3cdom){V(r,q)}},addDomLoadEvent:f,addLoadEvent:R,getQueryParamValue:function(v){var u=K.location.search||K.location.hash;if(v==null){return g(u)}if(u){var t=u.substring(1).split("&");for(var r=0;r<t.length;r++){if(t[r].substring(0,t[r].indexOf("="))==v){return g(t[r].substring((t[r].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(A&&M){var q=C(m);if(q){q.parentNode.replaceChild(M,q);if(l){W(l,true);if(h.ie&&h.win){M.style.display="block"}}M=null;l=null;A=false}}}}}();(function(C){C.ui={plugin:{add:function(E,F,H){var G=C.ui[E].prototype;for(var D in H){G.plugins[D]=G.plugins[D]||[];G.plugins[D].push([F,H[D]])}},call:function(D,F,E){var H=D.plugins[F];if(!H){return}for(var G=0;G<H.length;G++){if(D.options[H[G][0]]){H[G][1].apply(D.element,E)}}}},cssCache:{},css:function(D){if(C.ui.cssCache[D]){return C.ui.cssCache[D]}var E=C('<div class="ui-gen">').addClass(D).css({position:"absolute",top:"-5000px",left:"-5000px",display:"block"}).appendTo("body");C.ui.cssCache[D]=!!((!(/auto|default/).test(E.css("cursor"))||(/^[1-9]/).test(E.css("height"))||(/^[1-9]/).test(E.css("width"))||!(/none/).test(E.css("backgroundImage"))||!(/transparent|rgba\(0, 0, 0, 0\)/).test(E.css("backgroundColor"))));try{C("body").get(0).removeChild(E.get(0))}catch(F){}return C.ui.cssCache[D]},disableSelection:function(D){C(D).attr("unselectable","on").css("MozUserSelect","none")},enableSelection:function(D){C(D).attr("unselectable","off").css("MozUserSelect","")},hasScroll:function(G,E){var D=/top/.test(E||"top")?"scrollTop":"scrollLeft",F=false;if(G[D]>0){return true}G[D]=1;F=G[D]>0?true:false;G[D]=0;return F}};var B=C.fn.remove;C.fn.remove=function(){C("*",this).add(this).triggerHandler("remove");return B.apply(this,arguments)};function A(E,F,G){var D=C[E][F].getter||[];D=(typeof D=="string"?D.split(/,?\s+/):D);return(C.inArray(G,D)!=-1)}C.widget=function(E,D){var F=E.split(".")[0];E=E.split(".")[1];C.fn[E]=function(J){var H=(typeof J=="string"),I=Array.prototype.slice.call(arguments,1);if(H&&A(F,E,J)){var G=C.data(this[0],E);return(G?G[J].apply(G,I):undefined)}return this.each(function(){var K=C.data(this,E);if(H&&K&&C.isFunction(K[J])){K[J].apply(K,I)}else{if(!H){C.data(this,E,new C[F][E](this,J))}}})};C[F][E]=function(I,H){var G=this;this.widgetName=E;this.widgetBaseClass=F+"-"+E;this.options=C.extend({},C.widget.defaults,C[F][E].defaults,H);this.element=C(I).bind("setData."+E,function(L,J,K){return G.setData(J,K)}).bind("getData."+E,function(K,J){return G.getData(J)}).bind("remove",function(){return G.destroy()});this.init()};C[F][E].prototype=C.extend({},C.widget.prototype,D)};C.widget.prototype={init:function(){},destroy:function(){this.element.removeData(this.widgetName)},getData:function(D){return this.options[D]},setData:function(D,E){this.options[D]=E;if(D=="disabled"){this.element[E?"addClass":"removeClass"](this.widgetBaseClass+"-disabled")}},enable:function(){this.setData("disabled",false)},disable:function(){this.setData("disabled",true)}};C.widget.defaults={disabled:false};C.ui.mouse={mouseInit:function(){var D=this;this.element.bind("mousedown."+this.widgetName,function(E){return D.mouseDown(E)});if(C.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},mouseDestroy:function(){this.element.unbind("."+this.widgetName);(C.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},mouseDown:function(F){(this._mouseStarted&&this.mouseUp(F));this._mouseDownEvent=F;var E=this,G=(F.which==1),D=(typeof this.options.cancel=="string"?C(F.target).parents().add(F.target).filter(this.options.cancel).length:false);if(!G||D||!this.mouseCapture(F)){return true}this._mouseDelayMet=!this.options.delay;if(!this._mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){E._mouseDelayMet=true},this.options.delay)}if(this.mouseDistanceMet(F)&&this.mouseDelayMet(F)){this._mouseStarted=(this.mouseStart(F)!==false);if(!this._mouseStarted){F.preventDefault();return true}}this._mouseMoveDelegate=function(H){return E.mouseMove(H)};this._mouseUpDelegate=function(H){return E.mouseUp(H)};C(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);return false},mouseMove:function(D){if(C.browser.msie&&!D.button){return this.mouseUp(D)}if(this._mouseStarted){this.mouseDrag(D);return false}if(this.mouseDistanceMet(D)&&this.mouseDelayMet(D)){this._mouseStarted=(this.mouseStart(this._mouseDownEvent,D)!==false);(this._mouseStarted?this.mouseDrag(D):this.mouseUp(D))}return !this._mouseStarted},mouseUp:function(D){C(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this.mouseStop(D)}return false},mouseDistanceMet:function(D){return(Math.max(Math.abs(this._mouseDownEvent.pageX-D.pageX),Math.abs(this._mouseDownEvent.pageY-D.pageY))>=this.options.distance)},mouseDelayMet:function(D){return this._mouseDelayMet},mouseStart:function(D){},mouseDrag:function(D){},mouseStop:function(D){},mouseCapture:function(D){return true}};C.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);(function(A){A.widget("ui.draggable",A.extend({},A.ui.mouse,{init:function(){var B=this.options;if(B.helper=="original"&&!(/(relative|absolute|fixed)/).test(this.element.css("position"))){this.element.css("position","relative")}this.element.addClass("ui-draggable");(B.disabled&&this.element.addClass("ui-draggable-disabled"));this.mouseInit()},mouseStart:function(F){var H=this.options;if(this.helper||H.disabled||A(F.target).is(".ui-resizable-handle")){return false}var C=!this.options.handle||!A(this.options.handle,this.element).length?true:false;A(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==F.target){C=true}});if(!C){return false}if(A.ui.ddmanager){A.ui.ddmanager.current=this}this.helper=A.isFunction(H.helper)?A(H.helper.apply(this.element[0],[F])):(H.helper=="clone"?this.element.clone():this.element);if(!this.helper.parents("body").length){this.helper.appendTo((H.appendTo=="parent"?this.element[0].parentNode:H.appendTo))}if(this.helper[0]!=this.element[0]&&!(/(fixed|absolute)/).test(this.helper.css("position"))){this.helper.css("position","absolute")}this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0)};this.cssPosition=this.helper.css("position");this.offset=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.offset.click={left:F.pageX-this.offset.left,top:F.pageY-this.offset.top};this.offsetParent=this.helper.offsetParent();var B=this.offsetParent.offset();if(this.offsetParent[0]==document.body&&A.browser.mozilla){B={top:0,left:0}}this.offset.parent={top:B.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:B.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)};var E=this.element.position();this.offset.relative=this.cssPosition=="relative"?{top:E.top-(parseInt(this.helper.css("top"),10)||0)+this.offsetParent[0].scrollTop,left:E.left-(parseInt(this.helper.css("left"),10)||0)+this.offsetParent[0].scrollLeft}:{top:0,left:0};this.originalPosition=this.generatePosition(F);this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()};if(H.cursorAt){if(H.cursorAt.left!=undefined){this.offset.click.left=H.cursorAt.left+this.margins.left}if(H.cursorAt.right!=undefined){this.offset.click.left=this.helperProportions.width-H.cursorAt.right+this.margins.left}if(H.cursorAt.top!=undefined){this.offset.click.top=H.cursorAt.top+this.margins.top}if(H.cursorAt.bottom!=undefined){this.offset.click.top=this.helperProportions.height-H.cursorAt.bottom+this.margins.top}}if(H.containment){if(H.containment=="parent"){H.containment=this.helper[0].parentNode}if(H.containment=="document"||H.containment=="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,A(H.containment=="document"?document:window).width()-this.offset.relative.left-this.offset.parent.left-this.helperProportions.width-this.margins.left-(parseInt(this.element.css("marginRight"),10)||0),(A(H.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.offset.relative.top-this.offset.parent.top-this.helperProportions.height-this.margins.top-(parseInt(this.element.css("marginBottom"),10)||0)]}if(!(/^(document|window|parent)$/).test(H.containment)){var D=A(H.containment)[0];var G=A(H.containment).offset();this.containment=[G.left+(parseInt(A(D).css("borderLeftWidth"),10)||0)-this.offset.relative.left-this.offset.parent.left,G.top+(parseInt(A(D).css("borderTopWidth"),10)||0)-this.offset.relative.top-this.offset.parent.top,G.left+Math.max(D.scrollWidth,D.offsetWidth)-(parseInt(A(D).css("borderLeftWidth"),10)||0)-this.offset.relative.left-this.offset.parent.left-this.helperProportions.width-this.margins.left-(parseInt(this.element.css("marginRight"),10)||0),G.top+Math.max(D.scrollHeight,D.offsetHeight)-(parseInt(A(D).css("borderTopWidth"),10)||0)-this.offset.relative.top-this.offset.parent.top-this.helperProportions.height-this.margins.top-(parseInt(this.element.css("marginBottom"),10)||0)]}}this.propagate("start",F);this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()};if(A.ui.ddmanager&&!H.dropBehaviour){A.ui.ddmanager.prepareOffsets(this,F)}this.helper.addClass("ui-draggable-dragging");this.mouseDrag(F);return true},convertPositionTo:function(C,D){if(!D){D=this.position}var B=C=="absolute"?1:-1;return{top:(D.top+this.offset.relative.top*B+this.offset.parent.top*B-(this.cssPosition=="fixed"||(this.cssPosition=="absolute"&&this.offsetParent[0]==document.body)?0:this.offsetParent[0].scrollTop)*B+(this.cssPosition=="fixed"?A(document).scrollTop():0)*B+this.margins.top*B),left:(D.left+this.offset.relative.left*B+this.offset.parent.left*B-(this.cssPosition=="fixed"||(this.cssPosition=="absolute"&&this.offsetParent[0]==document.body)?0:this.offsetParent[0].scrollLeft)*B+(this.cssPosition=="fixed"?A(document).scrollLeft():0)*B+this.margins.left*B)}},generatePosition:function(E){var F=this.options;var B={top:(E.pageY-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition=="fixed"||(this.cssPosition=="absolute"&&this.offsetParent[0]==document.body)?0:this.offsetParent[0].scrollTop)-(this.cssPosition=="fixed"?A(document).scrollTop():0)),left:(E.pageX-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition=="fixed"||(this.cssPosition=="absolute"&&this.offsetParent[0]==document.body)?0:this.offsetParent[0].scrollLeft)-(this.cssPosition=="fixed"?A(document).scrollLeft():0))};if(!this.originalPosition){return B}if(this.containment){if(B.left<this.containment[0]){B.left=this.containment[0]}if(B.top<this.containment[1]){B.top=this.containment[1]}if(B.left>this.containment[2]){B.left=this.containment[2]}if(B.top>this.containment[3]){B.top=this.containment[3]}}if(F.grid){var D=this.originalPosition.top+Math.round((B.top-this.originalPosition.top)/F.grid[1])*F.grid[1];B.top=this.containment?(!(D<this.containment[1]||D>this.containment[3])?D:(!(D<this.containment[1])?D-F.grid[1]:D+F.grid[1])):D;var C=this.originalPosition.left+Math.round((B.left-this.originalPosition.left)/F.grid[0])*F.grid[0];B.left=this.containment?(!(C<this.containment[0]||C>this.containment[2])?C:(!(C<this.containment[0])?C-F.grid[0]:C+F.grid[0])):C}return B},mouseDrag:function(B){this.position=this.generatePosition(B);this.positionAbs=this.convertPositionTo("absolute");this.position=this.propagate("drag",B)||this.position;if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px"}if(A.ui.ddmanager){A.ui.ddmanager.drag(this,B)}return false},mouseStop:function(C){var D=false;if(A.ui.ddmanager&&!this.options.dropBehaviour){var D=A.ui.ddmanager.drop(this,C)}if((this.options.revert=="invalid"&&!D)||(this.options.revert=="valid"&&D)||this.options.revert===true){var B=this;A(this.helper).animate(this.originalPosition,parseInt(this.options.revert,10)||500,function(){B.propagate("stop",C);B.clear()})}else{this.propagate("stop",C);this.clear()}return false},clear:function(){this.helper.removeClass("ui-draggable-dragging");if(this.options.helper!="original"&&!this.cancelHelperRemoval){this.helper.remove()}this.helper=null;this.cancelHelperRemoval=false},plugins:{},uiHash:function(B){return{helper:this.helper,position:this.position,absolutePosition:this.positionAbs,options:this.options}},propagate:function(C,B){A.ui.plugin.call(this,C,[B,this.uiHash()]);if(C=="drag"){this.positionAbs=this.convertPositionTo("absolute")}return this.element.triggerHandler(C=="drag"?C:"drag"+C,[B,this.uiHash()],this.options[C])},destroy:function(){if(!this.element.data("draggable")){return}this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable");this.mouseDestroy()}}));A.extend(A.ui.draggable,{defaults:{appendTo:"parent",axis:false,cancel:":input",delay:0,distance:1,helper:"original"}});A.ui.plugin.add("draggable","cursor",{start:function(D,C){var B=A("body");if(B.css("cursor")){C.options._cursor=B.css("cursor")}B.css("cursor",C.options.cursor)},stop:function(C,B){if(B.options._cursor){A("body").css("cursor",B.options._cursor)}}});A.ui.plugin.add("draggable","zIndex",{start:function(D,C){var B=A(C.helper);if(B.css("zIndex")){C.options._zIndex=B.css("zIndex")}B.css("zIndex",C.options.zIndex)},stop:function(C,B){if(B.options._zIndex){A(B.helper).css("zIndex",B.options._zIndex)}}});A.ui.plugin.add("draggable","opacity",{start:function(D,C){var B=A(C.helper);if(B.css("opacity")){C.options._opacity=B.css("opacity")}B.css("opacity",C.options.opacity)},stop:function(C,B){if(B.options._opacity){A(B.helper).css("opacity",B.options._opacity)}}});A.ui.plugin.add("draggable","iframeFix",{start:function(C,B){A(B.options.iframeFix===true?"iframe":B.options.iframeFix).each(function(){A('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1000}).css(A(this).offset()).appendTo("body")})},stop:function(C,B){A("div.DragDropIframeFix").each(function(){this.parentNode.removeChild(this)})}});A.ui.plugin.add("draggable","scroll",{start:function(D,C){var E=C.options;var B=A(this).data("draggable");E.scrollSensitivity=E.scrollSensitivity||20;E.scrollSpeed=E.scrollSpeed||20;B.overflowY=function(F){do{if(/auto|scroll/.test(F.css("overflow"))||(/auto|scroll/).test(F.css("overflow-y"))){return F}F=F.parent()}while(F[0].parentNode);return A(document)}(this);B.overflowX=function(F){do{if(/auto|scroll/.test(F.css("overflow"))||(/auto|scroll/).test(F.css("overflow-x"))){return F}F=F.parent()}while(F[0].parentNode);return A(document)}(this);if(B.overflowY[0]!=document&&B.overflowY[0].tagName!="HTML"){B.overflowYOffset=B.overflowY.offset()}if(B.overflowX[0]!=document&&B.overflowX[0].tagName!="HTML"){B.overflowXOffset=B.overflowX.offset()}},drag:function(D,C){var E=C.options;var B=A(this).data("draggable");if(B.overflowY[0]!=document&&B.overflowY[0].tagName!="HTML"){if((B.overflowYOffset.top+B.overflowY[0].offsetHeight)-D.pageY<E.scrollSensitivity){B.overflowY[0].scrollTop=B.overflowY[0].scrollTop+E.scrollSpeed}if(D.pageY-B.overflowYOffset.top<E.scrollSensitivity){B.overflowY[0].scrollTop=B.overflowY[0].scrollTop-E.scrollSpeed}}else{if(D.pageY-A(document).scrollTop()<E.scrollSensitivity){A(document).scrollTop(A(document).scrollTop()-E.scrollSpeed)}if(A(window).height()-(D.pageY-A(document).scrollTop())<E.scrollSensitivity){A(document).scrollTop(A(document).scrollTop()+E.scrollSpeed)}}if(B.overflowX[0]!=document&&B.overflowX[0].tagName!="HTML"){if((B.overflowXOffset.left+B.overflowX[0].offsetWidth)-D.pageX<E.scrollSensitivity){B.overflowX[0].scrollLeft=B.overflowX[0].scrollLeft+E.scrollSpeed}if(D.pageX-B.overflowXOffset.left<E.scrollSensitivity){B.overflowX[0].scrollLeft=B.overflowX[0].scrollLeft-E.scrollSpeed}}else{if(D.pageX-A(document).scrollLeft()<E.scrollSensitivity){A(document).scrollLeft(A(document).scrollLeft()-E.scrollSpeed)}if(A(window).width()-(D.pageX-A(document).scrollLeft())<E.scrollSensitivity){A(document).scrollLeft(A(document).scrollLeft()+E.scrollSpeed)}}}});A.ui.plugin.add("draggable","snap",{start:function(D,C){var B=A(this).data("draggable");B.snapElements=[];A(C.options.snap===true?".ui-draggable":C.options.snap).each(function(){var F=A(this);var E=F.offset();if(this!=B.element[0]){B.snapElements.push({item:this,width:F.outerWidth(),height:F.outerHeight(),top:E.top,left:E.left})}})},drag:function(J,N){var I=A(this).data("draggable");var L=N.options.snapTolerance||20;var D=N.absolutePosition.left,C=D+I.helperProportions.width,P=N.absolutePosition.top,O=P+I.helperProportions.height;for(var H=I.snapElements.length-1;H>=0;H--){var E=I.snapElements[H].left,B=E+I.snapElements[H].width,R=I.snapElements[H].top,M=R+I.snapElements[H].height;if(!((E-L<D&&D<B+L&&R-L<P&&P<M+L)||(E-L<D&&D<B+L&&R-L<O&&O<M+L)||(E-L<C&&C<B+L&&R-L<P&&P<M+L)||(E-L<C&&C<B+L&&R-L<O&&O<M+L))){continue}if(N.options.snapMode!="inner"){var K=Math.abs(R-O)<=20;var Q=Math.abs(M-P)<=20;var G=Math.abs(E-C)<=20;var F=Math.abs(B-D)<=20;if(K){N.position.top=I.convertPositionTo("relative",{top:R-I.helperProportions.height,left:0}).top}if(Q){N.position.top=I.convertPositionTo("relative",{top:M,left:0}).top}if(G){N.position.left=I.convertPositionTo("relative",{top:0,left:E-I.helperProportions.width}).left}if(F){N.position.left=I.convertPositionTo("relative",{top:0,left:B}).left}}if(N.options.snapMode!="outer"){var K=Math.abs(R-P)<=20;var Q=Math.abs(M-O)<=20;var G=Math.abs(E-D)<=20;var F=Math.abs(B-C)<=20;if(K){N.position.top=I.convertPositionTo("relative",{top:R,left:0}).top}if(Q){N.position.top=I.convertPositionTo("relative",{top:M-I.helperProportions.height,left:0}).top}if(G){N.position.left=I.convertPositionTo("relative",{top:0,left:E}).left}if(F){N.position.left=I.convertPositionTo("relative",{top:0,left:B-I.helperProportions.width}).left}}}}});A.ui.plugin.add("draggable","connectToSortable",{start:function(D,C){var B=A(this).data("draggable");B.sortables=[];A(C.options.connectToSortable).each(function(){if(A.data(this,"sortable")){var E=A.data(this,"sortable");B.sortables.push({instance:E,shouldRevert:E.options.revert});E.refreshItems();E.propagate("activate",D,B)}})},stop:function(D,C){var B=A(this).data("draggable");A.each(B.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;B.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert){this.instance.options.revert=true}this.instance.mouseStop(D);this.instance.element.triggerHandler("sortreceive",[D,A.extend(this.instance.ui(),{sender:B.element})],this.instance.options.receive);this.instance.options.helper=this.instance.options._helper}else{this.instance.propagate("deactivate",D,B)}})},drag:function(F,E){var D=A(this).data("draggable"),B=this;var C=function(K){var H=K.left,J=H+K.width,I=K.top,G=I+K.height;return(H<(this.positionAbs.left+this.offset.click.left)&&(this.positionAbs.left+this.offset.click.left)<J&&I<(this.positionAbs.top+this.offset.click.top)&&(this.positionAbs.top+this.offset.click.top)<G)};A.each(D.sortables,function(G){if(C.call(D,this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=A(B).clone().appendTo(this.instance.element).data("sortable-item",true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return E.helper[0]};F.target=this.instance.currentItem[0];this.instance.mouseCapture(F,true);this.instance.mouseStart(F,true,true);this.instance.offset.click.top=D.offset.click.top;this.instance.offset.click.left=D.offset.click.left;this.instance.offset.parent.left-=D.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=D.offset.parent.top-this.instance.offset.parent.top;D.propagate("toSortable",F)}if(this.instance.currentItem){this.instance.mouseDrag(F)}}else{if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance.mouseStop(F,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();if(this.instance.placeholder){this.instance.placeholder.remove()}D.propagate("fromSortable",F)}}})}});A.ui.plugin.add("draggable","stack",{start:function(D,B){var C=A.makeArray(A(B.options.stack.group)).sort(function(F,E){return(parseInt(A(F).css("zIndex"),10)||B.options.stack.min)-(parseInt(A(E).css("zIndex"),10)||B.options.stack.min)});A(C).each(function(E){this.style.zIndex=B.options.stack.min+E});this[0].style.zIndex=B.options.stack.min+C.length}})})(jQuery);(function(A){A.widget("ui.resizable",A.extend({},A.ui.mouse,{init:function(){var M=this,N=this.options;var Q=this.element.css("position");this.originalElement=this.element;this.element.addClass("ui-resizable").css({position:/static/.test(Q)?"relative":Q});A.extend(N,{_aspectRatio:!!(N.aspectRatio),helper:N.helper||N.ghost||N.animate?N.helper||"proxy":null,knobHandles:N.knobHandles===true?"ui-resizable-knob-handle":N.knobHandles});var H="1px solid #DEDEDE";N.defaultTheme={"ui-resizable":{display:"block"},"ui-resizable-handle":{position:"absolute",background:"#F2F2F2",fontSize:"0.1px"},"ui-resizable-n":{cursor:"n-resize",height:"4px",left:"0px",right:"0px",borderTop:H},"ui-resizable-s":{cursor:"s-resize",height:"4px",left:"0px",right:"0px",borderBottom:H},"ui-resizable-e":{cursor:"e-resize",width:"4px",top:"0px",bottom:"0px",borderRight:H},"ui-resizable-w":{cursor:"w-resize",width:"4px",top:"0px",bottom:"0px",borderLeft:H},"ui-resizable-se":{cursor:"se-resize",width:"4px",height:"4px",borderRight:H,borderBottom:H},"ui-resizable-sw":{cursor:"sw-resize",width:"4px",height:"4px",borderBottom:H,borderLeft:H},"ui-resizable-ne":{cursor:"ne-resize",width:"4px",height:"4px",borderRight:H,borderTop:H},"ui-resizable-nw":{cursor:"nw-resize",width:"4px",height:"4px",borderLeft:H,borderTop:H}};N.knobTheme={"ui-resizable-handle":{background:"#F2F2F2",border:"1px solid #808080",height:"8px",width:"8px"},"ui-resizable-n":{cursor:"n-resize",top:"0px",left:"45%"},"ui-resizable-s":{cursor:"s-resize",bottom:"0px",left:"45%"},"ui-resizable-e":{cursor:"e-resize",right:"0px",top:"45%"},"ui-resizable-w":{cursor:"w-resize",left:"0px",top:"45%"},"ui-resizable-se":{cursor:"se-resize",right:"0px",bottom:"0px"},"ui-resizable-sw":{cursor:"sw-resize",left:"0px",bottom:"0px"},"ui-resizable-nw":{cursor:"nw-resize",left:"0px",top:"0px"},"ui-resizable-ne":{cursor:"ne-resize",right:"0px",top:"0px"}};N._nodeName=this.element[0].nodeName;if(N._nodeName.match(/canvas|textarea|input|select|button|img/i)){var B=this.element;if(/relative/.test(B.css("position"))&&A.browser.opera){B.css({position:"relative",top:"auto",left:"auto"})}B.wrap(A('<div class="ui-wrapper"	style="overflow: hidden;"></div>').css({position:B.css("position"),width:B.outerWidth(),height:B.outerHeight(),top:B.css("top"),left:B.css("left")}));var J=this.element;this.element=this.element.parent();this.element.data("resizable",this);this.element.css({marginLeft:J.css("marginLeft"),marginTop:J.css("marginTop"),marginRight:J.css("marginRight"),marginBottom:J.css("marginBottom")});J.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});if(A.browser.safari&&N.preventDefault){J.css("resize","none")}N.proportionallyResize=J.css({position:"static",zoom:1,display:"block"});this.element.css({margin:J.css("margin")});this._proportionallyResize()}if(!N.handles){N.handles=!A(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}}if(N.handles.constructor==String){N.zIndex=N.zIndex||1000;if(N.handles=="all"){N.handles="n,e,s,w,se,sw,ne,nw"}var O=N.handles.split(",");N.handles={};var G={handle:"position: absolute; display: none; overflow:hidden;",n:"top: 0pt; width:100%;",e:"right: 0pt; height:100%;",s:"bottom: 0pt; width:100%;",w:"left: 0pt; height:100%;",se:"bottom: 0pt; right: 0px;",sw:"bottom: 0pt; left: 0px;",ne:"top: 0pt; right: 0px;",nw:"top: 0pt; left: 0px;"};for(var R=0;R<O.length;R++){var S=A.trim(O[R]),L=N.defaultTheme,F="ui-resizable-"+S,C=!A.ui.css(F)&&!N.knobHandles,P=A.ui.css("ui-resizable-knob-handle"),T=A.extend(L[F],L["ui-resizable-handle"]),D=A.extend(N.knobTheme[F],!P?N.knobTheme["ui-resizable-handle"]:{});var K=/sw|se|ne|nw/.test(S)?{zIndex:++N.zIndex}:{};var I=(C?G[S]:""),E=A(['<div class="ui-resizable-handle ',F,'" style="',I,G.handle,'"></div>'].join("")).css(K);N.handles[S]=".ui-resizable-"+S;this.element.append(E.css(C?T:{}).css(N.knobHandles?D:{}).addClass(N.knobHandles?"ui-resizable-knob-handle":"").addClass(N.knobHandles))}if(N.knobHandles){this.element.addClass("ui-resizable-knob").css(!A.ui.css("ui-resizable-knob")?{}:{})}}this._renderAxis=function(Y){Y=Y||this.element;for(var V in N.handles){if(N.handles[V].constructor==String){N.handles[V]=A(N.handles[V],this.element).show()}if(N.transparent){N.handles[V].css({opacity:0})}if(this.element.is(".ui-wrapper")&&N._nodeName.match(/textarea|input|select|button/i)){var W=A(N.handles[V],this.element),X=0;X=/sw|ne|nw|se|n|s/.test(V)?W.outerHeight():W.outerWidth();var U=["padding",/ne|nw|n/.test(V)?"Top":/se|sw|s/.test(V)?"Bottom":/^e$/.test(V)?"Right":"Left"].join("");if(!N.transparent){Y.css(U,X)}this._proportionallyResize()}if(!A(N.handles[V]).length){continue}}};this._renderAxis(this.element);N._handles=A(".ui-resizable-handle",M.element);if(N.disableSelection){N._handles.each(function(U,V){A.ui.disableSelection(V)})}N._handles.mouseover(function(){if(!N.resizing){if(this.className){var U=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)}M.axis=N.axis=U&&U[1]?U[1]:"se"}});if(N.autoHide){N._handles.hide();A(M.element).addClass("ui-resizable-autohide").hover(function(){A(this).removeClass("ui-resizable-autohide");N._handles.show()},function(){if(!N.resizing){A(this).addClass("ui-resizable-autohide");N._handles.hide()}})}this.mouseInit()},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,options:this.options,originalSize:this.originalSize,originalPosition:this.originalPosition}},propagate:function(C,B){A.ui.plugin.call(this,C,[B,this.ui()]);if(C!="resize"){this.element.triggerHandler(["resize",C].join(""),[B,this.ui()],this.options[C])}},destroy:function(){var D=this.element,C=D.children(".ui-resizable").get(0);this.mouseDestroy();var B=function(E){A(E).removeClass("ui-resizable ui-resizable-disabled").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};B(D);if(D.is(".ui-wrapper")&&C){D.parent().append(A(C).css({position:D.css("position"),width:D.outerWidth(),height:D.outerHeight(),top:D.css("top"),left:D.css("left")})).end().remove();B(C)}},mouseStart:function(K){if(this.options.disabled){return false}var J=false;for(var H in this.options.handles){if(A(this.options.handles[H])[0]==K.target){J=true}}if(!J){return false}var C=this.options,B=this.element.position(),D=this.element,I=function(O){return parseInt(O,10)||0},G=A.browser.msie&&A.browser.version<7;C.resizing=true;C.documentScroll={top:A(document).scrollTop(),left:A(document).scrollLeft()};if(D.is(".ui-draggable")||(/absolute/).test(D.css("position"))){var M=A.browser.msie&&!C.containment&&(/absolute/).test(D.css("position"))&&!(/relative/).test(D.parent().css("position"));var L=M?C.documentScroll.top:0,F=M?C.documentScroll.left:0;D.css({position:"absolute",top:(B.top+L),left:(B.left+F)})}if(A.browser.opera&&/relative/.test(D.css("position"))){D.css({position:"relative",top:"auto",left:"auto"})}this._renderProxy();var N=I(this.helper.css("left")),E=I(this.helper.css("top"));if(C.containment){N+=A(C.containment).scrollLeft()||0;E+=A(C.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:N,top:E};this.size=C.helper||G?{width:D.outerWidth(),height:D.outerHeight()}:{width:D.width(),height:D.height()};this.originalSize=C.helper||G?{width:D.outerWidth(),height:D.outerHeight()}:{width:D.width(),height:D.height()};this.originalPosition={left:N,top:E};this.sizeDiff={width:D.outerWidth()-D.width(),height:D.outerHeight()-D.height()};this.originalMousePosition={left:K.pageX,top:K.pageY};C.aspectRatio=(typeof C.aspectRatio=="number")?C.aspectRatio:((this.originalSize.height/this.originalSize.width)||1);if(C.preserveCursor){A("body").css("cursor",this.axis+"-resize")}this.propagate("start",K);return true},mouseDrag:function(I){var D=this.helper,C=this.options,J={},M=this,F=this.originalMousePosition,K=this.axis;var N=(I.pageX-F.left)||0,L=(I.pageY-F.top)||0;var E=this._change[K];if(!E){return false}var H=E.apply(this,[I,N,L]),G=A.browser.msie&&A.browser.version<7,B=this.sizeDiff;if(C._aspectRatio||I.shiftKey){H=this._updateRatio(H,I)}H=this._respectSize(H,I);this.propagate("resize",I);D.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});if(!C.helper&&C.proportionallyResize){this._proportionallyResize()}this._updateCache(H);this.element.triggerHandler("resize",[I,this.ui()],this.options.resize);return false},mouseStop:function(I){this.options.resizing=false;var E=this.options,H=function(M){return parseInt(M,10)||0},K=this;if(E.helper){var D=E.proportionallyResize,B=D&&(/textarea/i).test(D.get(0).nodeName),C=B&&A.ui.hasScroll(D.get(0),"left")?0:K.sizeDiff.height,G=B?0:K.sizeDiff.width;var L={width:(K.size.width-G),height:(K.size.height-C)},F=(parseInt(K.element.css("left"),10)+(K.position.left-K.originalPosition.left))||null,J=(parseInt(K.element.css("top"),10)+(K.position.top-K.originalPosition.top))||null;if(!E.animate){this.element.css(A.extend(L,{top:J,left:F}))}if(E.helper&&!E.animate){this._proportionallyResize()}}if(E.preserveCursor){A("body").css("cursor","auto")}this.propagate("stop",I);if(E.helper){this.helper.remove()}return false},_updateCache:function(B){var C=this.options;this.offset=this.helper.offset();if(B.left){this.position.left=B.left}if(B.top){this.position.top=B.top}if(B.height){this.size.height=B.height}if(B.width){this.size.width=B.width}},_updateRatio:function(D,E){var F=this.options,G=this.position,C=this.size,B=this.axis;if(D.height){D.width=(C.height/F.aspectRatio)}else{if(D.width){D.height=(C.width*F.aspectRatio)}}if(B=="sw"){D.left=G.left+(C.width-D.width);D.top=null}if(B=="nw"){D.top=G.top+(C.height-D.height);D.left=G.left+(C.width-D.width)}return D},_respectSize:function(H,I){var F=this.helper,E=this.options,N=E._aspectRatio||I.shiftKey,M=this.axis,P=H.width&&E.maxWidth&&E.maxWidth<H.width,J=H.height&&E.maxHeight&&E.maxHeight<H.height,D=H.width&&E.minWidth&&E.minWidth>H.width,O=H.height&&E.minHeight&&E.minHeight>H.height;if(D){H.width=E.minWidth}if(O){H.height=E.minHeight}if(P){H.width=E.maxWidth}if(J){H.height=E.maxHeight}var C=this.originalPosition.left+this.originalSize.width,L=this.position.top+this.size.height;var G=/sw|nw|w/.test(M),B=/nw|ne|n/.test(M);if(D&&G){H.left=C-E.minWidth}if(P&&G){H.left=C-E.maxWidth}if(O&&B){H.top=L-E.minHeight}if(J&&B){H.top=L-E.maxHeight}var K=!H.width&&!H.height;if(K&&!H.left&&H.top){H.top=null}else{if(K&&!H.top&&H.left){H.left=null}}return H},_proportionallyResize:function(){var F=this.options;if(!F.proportionallyResize){return}var D=F.proportionallyResize,C=this.helper||this.element;if(!F.borderDif){var B=[D.css("borderTopWidth"),D.css("borderRightWidth"),D.css("borderBottomWidth"),D.css("borderLeftWidth")],E=[D.css("paddingTop"),D.css("paddingRight"),D.css("paddingBottom"),D.css("paddingLeft")];F.borderDif=A.map(B,function(G,I){var H=parseInt(G,10)||0,J=parseInt(E[I],10)||0;return H+J})}D.css({height:(C.height()-F.borderDif[0]-F.borderDif[2])+"px",width:(C.width()-F.borderDif[1]-F.borderDif[3])+"px"})},_renderProxy:function(){var C=this.element,F=this.options;this.elementOffset=C.offset();if(F.helper){this.helper=this.helper||A('<div style="overflow:hidden;"></div>');var B=A.browser.msie&&A.browser.version<7,D=(B?1:0),E=(B?2:-1);this.helper.addClass(F.helper).css({width:C.outerWidth()+E,height:C.outerHeight()+E,position:"absolute",left:this.elementOffset.left-D+"px",top:this.elementOffset.top-D+"px",zIndex:++F.zIndex});this.helper.appendTo("body");if(F.disableSelection){A.ui.disableSelection(this.helper.get(0))}}else{this.helper=C}},_change:{e:function(D,C,B){return{width:this.originalSize.width+C}},w:function(F,C,B){var G=this.options,D=this.originalSize,E=this.originalPosition;return{left:E.left+C,width:D.width-C}},n:function(F,C,B){var G=this.options,D=this.originalSize,E=this.originalPosition;return{top:E.top+B,height:D.height-B}},s:function(D,C,B){return{height:this.originalSize.height+B}},se:function(D,C,B){return A.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[D,C,B]))},sw:function(D,C,B){return A.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[D,C,B]))},ne:function(D,C,B){return A.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[D,C,B]))},nw:function(D,C,B){return A.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[D,C,B]))}}}));A.extend(A.ui.resizable,{defaults:{cancel:":input",distance:1,delay:0,preventDefault:true,transparent:false,minWidth:10,minHeight:10,aspectRatio:false,disableSelection:true,preserveCursor:true,autoHide:false,knobHandles:false}});A.ui.plugin.add("resizable","containment",{start:function(I,K){var E=K.options,M=A(this).data("resizable"),G=M.element;var C=E.containment,F=(C instanceof A)?C.get(0):(/parent/.test(C))?G.parent().get(0):C;if(!F){return}M.containerElement=A(F);if(/document/.test(C)||C==document){M.containerOffset={left:0,top:0};M.containerPosition={left:0,top:0};M.parentData={element:A(document),left:0,top:0,width:A(document).width(),height:A(document).height()||document.body.parentNode.scrollHeight}}else{M.containerOffset=A(F).offset();M.containerPosition=A(F).position();M.containerSize={height:A(F).innerHeight(),width:A(F).innerWidth()};var J=M.containerOffset,B=M.containerSize.height,H=M.containerSize.width,D=(A.ui.hasScroll(F,"left")?F.scrollWidth:H),L=(A.ui.hasScroll(F)?F.scrollHeight:B);M.parentData={element:F,left:J.left,top:J.top,width:D,height:L}}},resize:function(H,K){var E=K.options,N=A(this).data("resizable"),C=N.containerSize,J=N.containerOffset,G=N.size,I=N.position,L=E._aspectRatio||H.shiftKey,B={top:0,left:0},D=N.containerElement;if(D[0]!=document&&/static/.test(D.css("position"))){B=N.containerPosition}if(I.left<(E.helper?J.left:B.left)){N.size.width=N.size.width+(E.helper?(N.position.left-J.left):(N.position.left-B.left));if(L){N.size.height=N.size.width*E.aspectRatio}N.position.left=E.helper?J.left:B.left}if(I.top<(E.helper?J.top:0)){N.size.height=N.size.height+(E.helper?(N.position.top-J.top):N.position.top);if(L){N.size.width=N.size.height/E.aspectRatio}N.position.top=E.helper?J.top:0}var F=(E.helper?N.offset.left-J.left:(N.position.left-B.left))+N.sizeDiff.width,M=(E.helper?N.offset.top-J.top:N.position.top)+N.sizeDiff.height;if(F+N.size.width>=N.parentData.width){N.size.width=N.parentData.width-F;if(L){N.size.height=N.size.width*E.aspectRatio}}if(M+N.size.height>=N.parentData.height){N.size.height=N.parentData.height-M;if(L){N.size.width=N.size.height/E.aspectRatio}}},stop:function(G,J){var C=J.options,L=A(this).data("resizable"),H=L.position,I=L.containerOffset,B=L.containerPosition,D=L.containerElement;var E=A(L.helper),M=E.offset(),K=E.innerWidth(),F=E.innerHeight();if(C.helper&&!C.animate&&/relative/.test(D.css("position"))){A(this).css({left:(M.left-I.left),top:(M.top-I.top),width:K,height:F})}if(C.helper&&!C.animate&&/static/.test(D.css("position"))){A(this).css({left:B.left+(M.left-I.left),top:B.top+(M.top-I.top),width:K,height:F})}}});A.ui.plugin.add("resizable","grid",{resize:function(H,J){var D=J.options,L=A(this).data("resizable"),G=L.size,E=L.originalSize,F=L.originalPosition,K=L.axis,I=D._aspectRatio||H.shiftKey;D.grid=typeof D.grid=="number"?[D.grid,D.grid]:D.grid;var C=Math.round((G.width-E.width)/(D.grid[0]||1))*(D.grid[0]||1),B=Math.round((G.height-E.height)/(D.grid[1]||1))*(D.grid[1]||1);if(/^(se|s|e)$/.test(K)){L.size.width=E.width+C;L.size.height=E.height+B}else{if(/^(ne)$/.test(K)){L.size.width=E.width+C;L.size.height=E.height+B;L.position.top=F.top-B}else{if(/^(sw)$/.test(K)){L.size.width=E.width+C;L.size.height=E.height+B;L.position.left=F.left-C}else{L.size.width=E.width+C;L.size.height=E.height+B;L.position.top=F.top-B;L.position.left=F.left-C}}}}});A.ui.plugin.add("resizable","animate",{stop:function(I,K){var F=K.options,L=A(this).data("resizable");var E=F.proportionallyResize,B=E&&(/textarea/i).test(E.get(0).nodeName),C=B&&A.ui.hasScroll(E.get(0),"left")?0:L.sizeDiff.height,H=B?0:L.sizeDiff.width;var D={width:(L.size.width-H),height:(L.size.height-C)},G=(parseInt(L.element.css("left"),10)+(L.position.left-L.originalPosition.left))||null,J=(parseInt(L.element.css("top"),10)+(L.position.top-L.originalPosition.top))||null;L.element.animate(A.extend(D,J&&G?{top:J,left:G}:{}),{duration:F.animateDuration||"slow",easing:F.animateEasing||"swing",step:function(){var M={width:parseInt(L.element.css("width"),10),height:parseInt(L.element.css("height"),10),top:parseInt(L.element.css("top"),10),left:parseInt(L.element.css("left"),10)};if(E){E.css({width:M.width,height:M.height})}L._updateCache(M);L.propagate("animate",I)}})}});A.ui.plugin.add("resizable","ghost",{start:function(E,D){var F=D.options,B=A(this).data("resizable"),G=F.proportionallyResize,C=B.size;if(!G){B.ghost=B.element.clone()}else{B.ghost=G.clone()}B.ghost.css({opacity:0.25,display:"block",position:"relative",height:C.height,width:C.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof F.ghost=="string"?F.ghost:"");B.ghost.appendTo(B.helper)},resize:function(D,C){var E=C.options,B=A(this).data("resizable"),F=E.proportionallyResize;if(B.ghost){B.ghost.css({position:"relative",height:B.size.height,width:B.size.width})}},stop:function(D,C){var E=C.options,B=A(this).data("resizable"),F=E.proportionallyResize;if(B.ghost&&B.helper){B.helper.get(0).removeChild(B.ghost.get(0))}}});A.ui.plugin.add("resizable","alsoResize",{start:function(E,C){var F=C.options,B=A(this).data("resizable"),D=function(G){A(G).each(function(){A(this).data("resizable-alsoresize",{width:parseInt(A(this).width(),10),height:parseInt(A(this).height(),10),left:parseInt(A(this).css("left"),10),top:parseInt(A(this).css("top"),10)})})};if(typeof(F.alsoResize)=="object"){if(F.alsoResize.length){F.alsoResize=F.alsoResize[0];D(F.alsoResize)}else{A.each(F.alsoResize,function(G,H){D(G)})}}else{D(F.alsoResize)}},resize:function(F,E){var G=E.options,C=A(this).data("resizable"),D=C.originalSize,I=C.originalPosition;var H={height:(C.size.height-D.height)||0,width:(C.size.width-D.width)||0,top:(C.position.top-I.top)||0,left:(C.position.left-I.left)||0},B=function(J,K){A(J).each(function(){var N=A(this).data("resizable-alsoresize"),M={},L=K&&K.length?K:["width","height","top","left"];A.each(L||["width","height","top","left"],function(O,Q){var P=(N[Q]||0)+(H[Q]||0);if(P&&P>=0){M[Q]=P||null}});A(this).css(M)})};if(typeof(G.alsoResize)=="object"){A.each(G.alsoResize,function(J,K){B(J,K)})}else{B(G.alsoResize)}},stop:function(C,B){A(this).removeData("resizable-alsoresize-start")}})})(jQuery);(function(B){var A={dragStart:"start.draggable",drag:"drag.draggable",dragStop:"stop.draggable",maxHeight:"maxHeight.resizable",minHeight:"minHeight.resizable",maxWidth:"maxWidth.resizable",minWidth:"minWidth.resizable",resizeStart:"start.resizable",resize:"drag.resizable",resizeStop:"stop.resizable"};B.widget("ui.dialog",{init:function(){var J=this,K=this.options,D=typeof K.resizable=="string"?K.resizable:"n,e,s,w,se,sw,ne,nw",E=this.element.addClass("ui-dialog-content").wrap("<div/>").wrap("<div/>"),G=(this.uiDialogContainer=E.parent().addClass("ui-dialog-container").css({position:"relative",width:"100%",height:"100%"})),H=K.title||E.attr("title")||"",C=(this.uiDialogTitlebar=B('<div class="ui-dialog-titlebar"/>')).append('<span class="ui-dialog-title">'+H+"</span>").append('<a href="#" class="ui-dialog-titlebar-close"><span>X</span></a>').prependTo(G),I=(this.uiDialog=G.parent()).appendTo(document.body).hide().addClass("ui-dialog").addClass(K.dialogClass).addClass(E.attr("className")).removeClass("ui-dialog-content").css({position:"absolute",width:K.width,height:K.height,overflow:"hidden",zIndex:K.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(L){if(K.closeOnEscape){var M=27;(L.keyCode&&L.keyCode==M&&J.close())}}).mousedown(function(){J.moveToTop()}),F=(this.uiDialogButtonPane=B("<div/>")).css({bottom:0}).addClass("ui-dialog-buttonpane").appendTo(I);this.uiDialogTitlebarClose=B(".ui-dialog-titlebar-close",C).hover(function(){B(this).addClass("ui-dialog-titlebar-close-hover")},function(){B(this).removeClass("ui-dialog-titlebar-close-hover")}).mousedown(function(L){L.stopPropagation()}).click(function(){J.close();return false});this.uiDialogTitlebar.find("*").add(this.uiDialogTitlebar).each(function(){B.ui.disableSelection(this)});if(B.fn.draggable){I.draggable({cancel:".ui-dialog-content",helper:K.dragHelper,handle:".ui-dialog-titlebar",start:function(M,L){J.moveToTop();(K.dragStart&&K.dragStart.apply(J.element[0],arguments))},drag:function(M,L){(K.drag&&K.drag.apply(J.element[0],arguments))},stop:function(M,L){(K.dragStop&&K.dragStop.apply(J.element[0],arguments));B.ui.dialog.overlay.resize()}});(K.draggable||I.draggable("disable"))}if(B.fn.resizable){I.resizable({cancel:".ui-dialog-content",helper:K.resizeHelper,maxWidth:K.maxWidth,maxHeight:K.maxHeight,minWidth:K.minWidth,minHeight:K.minHeight,start:function(){(K.resizeStart&&K.resizeStart.apply(J.element[0],arguments))},resize:function(M,L){(K.autoResize&&J.size.apply(J));(K.resize&&K.resize.apply(J.element[0],arguments))},handles:D,stop:function(M,L){(K.autoResize&&J.size.apply(J));(K.resizeStop&&K.resizeStop.apply(J.element[0],arguments));B.ui.dialog.overlay.resize()}});(K.resizable||I.resizable("disable"))}this.createButtons(K.buttons);this.isOpen=false;(K.bgiframe&&B.fn.bgiframe&&I.bgiframe());(K.autoOpen&&this.open())},setData:function(C,D){(A[C]&&this.uiDialog.data(A[C],D));switch(C){case"buttons":this.createButtons(D);break;case"draggable":this.uiDialog.draggable(D?"enable":"disable");break;case"height":this.uiDialog.height(D);break;case"position":this.position(D);break;case"resizable":(typeof D=="string"&&this.uiDialog.data("handles.resizable",D));this.uiDialog.resizable(D?"enable":"disable");break;case"title":B(".ui-dialog-title",this.uiDialogTitlebar).text(D);break;case"width":this.uiDialog.width(D);break}B.widget.prototype.setData.apply(this,arguments)},position:function(H){var D=B(window),E=B(document),F=E.scrollTop(),C=E.scrollLeft(),G=F;if(B.inArray(H,["center","top","right","bottom","left"])>=0){H=[H=="right"||H=="left"?H:"center",H=="top"||H=="bottom"?H:"middle"]}if(H.constructor!=Array){H=["center","middle"]}if(H[0].constructor==Number){C+=H[0]}else{switch(H[0]){case"left":C+=0;break;case"right":C+=D.width()-this.uiDialog.width();break;default:case"center":C+=(D.width()-this.uiDialog.width())/2}}if(H[1].constructor==Number){F+=H[1]}else{switch(H[1]){case"top":F+=0;break;case"bottom":F+=D.height()-this.uiDialog.height();break;default:case"middle":F+=(D.height()-this.uiDialog.height())/2}}F=Math.max(F,G);this.uiDialog.css({top:F,left:C})},size:function(){var D=this.uiDialogContainer,G=this.uiDialogTitlebar,E=this.element,F=parseInt(E.css("margin-top"),10)+parseInt(E.css("margin-bottom"),10),C=parseInt(E.css("margin-left"),10)+parseInt(E.css("margin-right"),10);E.height(D.height()-G.outerHeight()-F);E.width(D.width()-C)},open:function(){if(this.isOpen){return}this.overlay=this.options.modal?new B.ui.dialog.overlay(this):null;(this.uiDialog.next().length>0)&&this.uiDialog.appendTo("body");this.position(this.options.position);this.uiDialog.show(this.options.show);this.options.autoResize&&this.size();this.moveToTop(true);var C=null;var D={options:this.options};this.uiDialogTitlebarClose.focus();this.element.triggerHandler("dialogopen",[C,D],this.options.open);this.isOpen=true},moveToTop:function(E){if((this.options.modal&&!E)||(!this.options.stack&&!this.options.modal)){return this.element.triggerHandler("dialogfocus",[null,{options:this.options}],this.options.focus)}var D=this.options.zIndex,C=this.options;(this.overlay&&this.overlay.$el.css("z-index",++D));this.uiDialog.css("z-index",++D);this.element.triggerHandler("dialogfocus",[null,{options:this.options}],this.options.focus)},close:function(){(this.overlay&&this.overlay.destroy());this.uiDialog.hide(this.options.hide);var D=null;var C={options:this.options};this.element.triggerHandler("dialogclose",[D,C],this.options.close);B.ui.dialog.overlay.resize();this.isOpen=false},destroy:function(){(this.overlay&&this.overlay.destroy());this.uiDialog.hide();this.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content").hide().appendTo("body");this.uiDialog.remove()},createButtons:function(F){var E=this,C=false,D=this.uiDialogButtonPane;D.empty().hide();B.each(F,function(){return !(C=true)});if(C){D.show();B.each(F,function(G,H){B("<button/>").text(G).click(function(){H.apply(E.element[0],arguments)}).appendTo(D)})}}});B.extend(B.ui.dialog,{defaults:{autoOpen:true,autoResize:true,bgiframe:false,buttons:{},closeOnEscape:true,draggable:true,height:200,minHeight:100,minWidth:150,modal:false,overlay:{},position:"center",resizable:true,stack:true,width:300,zIndex:1000},overlay:function(C){this.$el=B.ui.dialog.overlay.create(C)}});B.extend(B.ui.dialog.overlay,{instances:[],events:B.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(C){return C+".dialog-overlay"}).join(" "),create:function(D){if(this.instances.length===0){setTimeout(function(){B("a, :input").bind(B.ui.dialog.overlay.events,function(){var F=false;var H=B(this).parents(".ui-dialog");if(H.length){var E=B(".ui-dialog-overlay");if(E.length){var G=parseInt(E.css("z-index"),10);E.each(function(){G=Math.max(G,parseInt(B(this).css("z-index"),10))});F=parseInt(H.css("z-index"),10)>G}else{F=true}}return F})},1);B(document).bind("keydown.dialog-overlay",function(F){var G=27;(F.keyCode&&F.keyCode==G&&D.close());if(F.keyCode&&F.keyCode==G){try{s2.tuifly.widget.dialog.divLayerClose()}catch(E){}}});B(window).bind("resize.dialog-overlay",B.ui.dialog.overlay.resize)}var C=B("<div/>").appendTo(document.body).addClass("ui-dialog-overlay").css(B.extend({borderWidth:0,margin:0,padding:0,position:"absolute",top:0,left:0,width:this.width(),height:this.height()},D.options.overlay));(D.options.bgiframe&&B.fn.bgiframe&&C.bgiframe());this.instances.push(C);return C},destroy:function(C){this.instances.splice(B.inArray(this.instances,C),1);if(this.instances.length===0){B("a, :input").add([document,window]).unbind(".dialog-overlay")}C.remove()},height:function(){if(B.browser.msie&&B.browser.version<7){var D=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);var C=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);if(D<C){return B(window).height()+"px"}else{return D+"px"}}else{return B(document).height()+"px"}},width:function(){if(B.browser.msie&&B.browser.version<7){var C=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth);var D=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth);if(C<D){return B(window).width()+"px"}else{return C+"px"}}else{return B(document).width()+"px"}},resize:function(){var C=B([]);B.each(B.ui.dialog.overlay.instances,function(){C=C.add(this)});C.css({width:0,height:0}).css({width:B.ui.dialog.overlay.width(),height:B.ui.dialog.overlay.height()})}});B.extend(B.ui.dialog.overlay.prototype,{destroy:function(){B.ui.dialog.overlay.destroy(this.$el)}})})(jQuery);(function($){var PROP_NAME="datepicker";function Datepicker(){this.debug=false;this._curInst=null;this._disabledInputs=[];this._datepickerShowing=false;this._inDialog=false;this._mainDivId="ui-datepicker-div";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";this._dialogClass="ui-datepicker-dialog";this._promptClass="ui-datepicker-prompt";this._unselectableClass="ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";this.regional=[];this.regional[""]={clearText:"Clear",clearStatus:"Erase the current date",closeText:"Close",closeStatus:"Close without change",prevText:"&#x3c;Prev",prevStatus:"Show the previous month",nextText:"Next&#x3e;",nextStatus:"Show the next month",currentText:"Today",currentStatus:"Show the current month",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],monthStatus:"Show a different month",yearStatus:"Show a different year",weekHeader:"Wk",weekStatus:"Week of the year",dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],dayStatus:"Set DD as first week day",dateStatus:"Select DD, M d",dateFormat:"mm/dd/yy",firstDay:0,initStatus:"Select a date",isRTL:false};this._defaults={showOn:"focus",showAnim:"show",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,closeAtTop:true,mandatory:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,changeMonth:true,changeYear:true,yearRange:"-10:+10",changeFirstDay:true,highlightWeek:false,showOtherMonths:false,showWeeks:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",showStatus:false,statusForDate:this.dateStatus,minDate:null,maxDate:null,duration:"normal",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,stepMonths:1,rangeSelect:false,rangeSeparator:" - ",altField:"",altFormat:""};$.extend(this._defaults,this.regional[""]);this.dpDiv=$('<div id="'+this._mainDivId+'" style="display: none;"></div>')}$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",log:function(){if(this.debug){console.log.apply("",arguments)}},setDefaults:function(settings){extendRemove(this._defaults,settings||{});return this},_attachDatepicker:function(target,settings){var inlineSettings=null;for(attrName in this._defaults){var attrValue=target.getAttribute("date:"+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase();var inline=(nodeName=="div"||nodeName=="span");if(!target.id){target.id="dp"+new Date().getTime()}var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{});if(nodeName=="input"){this._connectDatepicker(target,inst)}else{if(inline){this._inlineDatepicker(target,inst)}}},_newInst:function(target,inline){return{id:target[0].id,input:target,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:inline,dpDiv:(!inline?this.dpDiv:$('<div class="ui-datepicker-inline"></div>'))}},_connectDatepicker:function(target,inst){var input=$(target);if(input.hasClass(this.markerClassName)){return}var appendText=this._get(inst,"appendText");var isRTL=this._get(inst,"isRTL");if(appendText){input[isRTL?"before":"after"]('<span class="'+this._appendClass+'">'+appendText+"</span>")}var showOn=this._get(inst,"showOn");if(showOn=="focus"||showOn=="both"){input.focus(this._showDatepicker)}if(showOn=="button"||showOn=="both"){var buttonText=this._get(inst,"buttonText");var buttonImage=this._get(inst,"buttonImage");var trigger=$(this._get(inst,"buttonImageOnly")?$("<img/>").addClass(this._triggerClass).attr({src:buttonImage,alt:buttonText,title:buttonText}):$('<button type="button"></button>').addClass(this._triggerClass).html(buttonImage==""?buttonText:$("<img/>").attr({src:buttonImage,alt:buttonText,title:buttonText})));input[isRTL?"before":"after"](trigger);trigger.click(function(){if($.datepicker._datepickerShowing&&$.datepicker._lastInput==target){$.datepicker._hideDatepicker()}else{$.datepicker._showDatepicker(target)}return false})}input.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).bind("setData.datepicker",function(event,key,value){inst.settings[key]=value}).bind("getData.datepicker",function(event,key){return this._get(inst,key)});$.data(target,PROP_NAME,inst)},_inlineDatepicker:function(target,inst){var input=$(target);if(input.hasClass(this.markerClassName)){return}input.addClass(this.markerClassName).append(inst.dpDiv).bind("setData.datepicker",function(event,key,value){inst.settings[key]=value}).bind("getData.datepicker",function(event,key){return this._get(inst,key)});$.data(target,PROP_NAME,inst);this._setDate(inst,this._getDefaultDate(inst));this._updateDatepicker(inst)},_dialogDatepicker:function(input,dateText,onSelect,settings,pos){var inst=this._dialogInst;if(!inst){var id="dp"+new Date().getTime();this._dialogInput=$('<input type="text" id="'+id+'" size="1" style="position: absolute; top: -100px;"/>');this._dialogInput.keydown(this._doKeyDown);$("body").append(this._dialogInput);inst=this._dialogInst=this._newInst(this._dialogInput,false);inst.settings={};$.data(this._dialogInput[0],PROP_NAME,inst)}extendRemove(inst.settings,settings||{});this._dialogInput.val(dateText);this._pos=(pos?(pos.length?pos:[pos.pageX,pos.pageY]):null);if(!this._pos){var browserWidth=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;var browserHeight=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[(browserWidth/2)-100+scrollX,(browserHeight/2)-150+scrollY]}this._dialogInput.css("left",this._pos[0]+"px").css("top",this._pos[1]+"px");inst.settings.onSelect=onSelect;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);if($.blockUI){$.blockUI(this.dpDiv)}$.data(this._dialogInput[0],PROP_NAME,inst);return this},_destroyDatepicker:function(target){var nodeName=target.nodeName.toLowerCase();var $target=$(target);$.removeData(target,PROP_NAME);if(nodeName=="input"){$target.siblings("."+this._appendClass).remove().end().siblings("."+this._triggerClass).remove().end().removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress)}else{if(nodeName=="div"||nodeName=="span"){$target.removeClass(this.markerClassName).empty()}}},_enableDatepicker:function(target){target.disabled=false;$(target).siblings("button."+this._triggerClass).each(function(){this.disabled=false}).end().siblings("img."+this._triggerClass).css({opacity:"1.0",cursor:""});this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value)})},_disableDatepicker:function(target){target.disabled=true;$(target).siblings("button."+this._triggerClass).each(function(){this.disabled=true}).end().siblings("img."+this._triggerClass).css({opacity:"0.5",cursor:"default"});this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value)});this._disabledInputs[this._disabledInputs.length]=target},_isDisabledDatepicker:function(target){if(!target){return false}for(var i=0;i<this._disabledInputs.length;i++){if(this._disabledInputs[i]==target){return true}}return false},_changeDatepicker:function(target,name,value){var settings=name||{};if(typeof name=="string"){settings={};settings[name]=value}if(inst=$.data(target,PROP_NAME)){extendRemove(inst.settings,settings);this._updateDatepicker(inst)}},_setDateDatepicker:function(target,date,endDate){var inst=$.data(target,PROP_NAME);if(inst){this._setDate(inst,date,endDate);this._updateDatepicker(inst)}},_getDateDatepicker:function(target){var inst=$.data(target,PROP_NAME);if(inst){this._setDateFromField(inst)}return(inst?this._getDate(inst):null)},_doKeyDown:function(e){var inst=$.data(e.target,PROP_NAME);var handled=true;if($.datepicker._datepickerShowing){switch(e.keyCode){case 9:$.datepicker._hideDatepicker(null,"");break;case 13:$.datepicker._selectDay(e.target,inst.selectedMonth,inst.selectedYear,$("td.ui-datepicker-days-cell-over",inst.dpDiv)[0]);return false;break;case 27:$.datepicker._hideDatepicker(null,$.datepicker._get(inst,"duration"));break;case 33:$.datepicker._adjustDate(e.target,(e.ctrlKey?-1:-$.datepicker._get(inst,"stepMonths")),(e.ctrlKey?"Y":"M"));break;case 34:$.datepicker._adjustDate(e.target,(e.ctrlKey?+1:+$.datepicker._get(inst,"stepMonths")),(e.ctrlKey?"Y":"M"));break;case 35:if(e.ctrlKey){$.datepicker._clearDate(e.target)}break;case 36:if(e.ctrlKey){$.datepicker._gotoToday(e.target)}break;case 37:if(e.ctrlKey){$.datepicker._adjustDate(e.target,-1,"D")}break;case 38:if(e.ctrlKey){$.datepicker._adjustDate(e.target,-7,"D")}break;case 39:if(e.ctrlKey){$.datepicker._adjustDate(e.target,+1,"D")}break;case 40:if(e.ctrlKey){$.datepicker._adjustDate(e.target,+7,"D")}break;default:handled=false}}else{if(e.keyCode==36&&e.ctrlKey){$.datepicker._showDatepicker(this)}else{handled=false}}if(handled){e.preventDefault();e.stopPropagation()}},_doKeyPress:function(e){var inst=$.data(e.target,PROP_NAME);var chars=$.datepicker._possibleChars($.datepicker._get(inst,"dateFormat"));var chr=String.fromCharCode(e.charCode==undefined?e.keyCode:e.charCode);return e.ctrlKey||(chr<" "||!chars||chars.indexOf(chr)>-1)},_showDatepicker:function(input){input=input.target||input;if(input.nodeName.toLowerCase()!="input"){input=$("input",input.parentNode)[0]}if($.datepicker._isDisabledDatepicker(input)||$.datepicker._lastInput==input){return}var inst=$.data(input,PROP_NAME);var beforeShow=$.datepicker._get(inst,"beforeShow");extendRemove(inst.settings,(beforeShow?beforeShow.apply(input,[input,inst]):{}));$.datepicker._hideDatepicker(null,"");$.datepicker._lastInput=input;$.datepicker._setDateFromField(inst);if($.datepicker._inDialog){input.value=""}if(!$.datepicker._pos){$.datepicker._pos=$.datepicker._findPos(input);$.datepicker._pos[1]+=input.offsetHeight}var isFixed=false;$(input).parents().each(function(){isFixed|=$(this).css("position")=="fixed";return !isFixed});if(isFixed&&$.browser.opera){$.datepicker._pos[0]-=document.documentElement.scrollLeft;$.datepicker._pos[1]-=document.documentElement.scrollTop}var offset={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null;inst.rangeStart=null;inst.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});$.datepicker._updateDatepicker(inst);inst.dpDiv.width($.datepicker._getNumberOfMonths(inst)[1]*$(".ui-datepicker",inst.dpDiv[0])[0].offsetWidth);offset=$.datepicker._checkOffset(inst,offset,isFixed);inst.dpDiv.css({position:($.datepicker._inDialog&&$.blockUI?"static":(isFixed?"fixed":"absolute")),display:"none",left:offset.left+"px",top:offset.top+"px"});if(!inst.inline){var showAnim=$.datepicker._get(inst,"showAnim")||"show";var duration=$.datepicker._get(inst,"duration");var postProcess=function(){$.datepicker._datepickerShowing=true};if($.effects&&$.effects[showAnim]){inst.dpDiv.show(showAnim,$.datepicker._get(inst,"showOptions"),duration,postProcess)}else{inst.dpDiv[showAnim](duration,postProcess)}if(duration==""){postProcess()}if(inst.input[0].type!="hidden"){inst.input[0].focus()}$.datepicker._curInst=inst}},_updateDatepicker:function(inst){var dims={width:inst.dpDiv.width()+4,height:inst.dpDiv.height()+4};inst.dpDiv.empty().append(this._generateDatepicker(inst));var numMonths=this._getNumberOfMonths(inst);inst.dpDiv[(numMonths[0]!=1||numMonths[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");inst.dpDiv[(this._get(inst,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");if(inst.input&&inst.input[0].type!="hidden"){$(inst.input[0]).focus()}},_checkOffset:function(inst,offset,isFixed){var pos=inst.input?this._findPos(inst.input[0]):null;var browserWidth=window.innerWidth||document.documentElement.clientWidth;var browserHeight=window.innerHeight||document.documentElement.clientHeight;var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.scrollTop;if(this._get(inst,"isRTL")||(offset.left+inst.dpDiv.width()-scrollX)>browserWidth){offset.left=Math.max((isFixed?0:scrollX),pos[0]+(inst.input?inst.input.width():0)-(isFixed?scrollX:0)-inst.dpDiv.width()-(isFixed&&$.browser.opera?document.documentElement.scrollLeft:0))}else{offset.left-=(isFixed?scrollX:0)}if((offset.top+inst.dpDiv.height()-scrollY)>browserHeight&&false){offset.top=Math.max((isFixed?0:scrollY),pos[1]-(isFixed?scrollY:0)-(this._inDialog?0:inst.dpDiv.height())-(isFixed&&$.browser.opera?document.documentElement.scrollTop:0))}else{offset.top-=(isFixed?scrollY:0)}return offset},_findPos:function(obj){while(obj&&(obj.type=="hidden"||obj.nodeType!=1)){obj=obj.nextSibling}var position=$(obj).offset();return[position.left,position.top]},_hideDatepicker:function(input,duration){var inst=this._curInst;if(!inst){return}var rangeSelect=this._get(inst,"rangeSelect");if(rangeSelect&&this._stayOpen){this._selectDate("#"+inst.id,this._formatDate(inst,inst.currentDay,inst.currentMonth,inst.currentYear))}this._stayOpen=false;if(this._datepickerShowing){duration=(duration!=null?duration:this._get(inst,"duration"));var showAnim=this._get(inst,"showAnim");var postProcess=function(){$.datepicker._tidyDialog(inst)};if(duration!=""&&$.effects&&$.effects[showAnim]){inst.dpDiv.hide(showAnim,$.datepicker._get(inst,"showOptions"),duration,postProcess)}else{inst.dpDiv[(duration==""?"hide":(showAnim=="slideDown"?"slideUp":(showAnim=="fadeIn"?"fadeOut":"hide")))](duration,postProcess)}if(duration==""){this._tidyDialog(inst)}var onClose=this._get(inst,"onClose");if(onClose){onClose.apply((inst.input?inst.input[0]:null),[this._getDate(inst),inst])}this._datepickerShowing=false;this._lastInput=null;inst.settings.prompt=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if($.blockUI){$.unblockUI();$("body").append(this.dpDiv)}}this._inDialog=false}this._curInst=null},_tidyDialog:function(inst){inst.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker");$("."+this._promptClass,inst.dpDiv).remove()},_checkExternalClick:function(event){if(!$.datepicker._curInst){return}var $target=$(event.target);if(($target.parents("#"+$.datepicker._mainDivId).length==0)&&!$target.hasClass($.datepicker.markerClassName)&&!$target.hasClass($.datepicker._triggerClass)&&$.datepicker._datepickerShowing&&!($.datepicker._inDialog&&$.blockUI)){$.datepicker._hideDatepicker(null,"")}},_adjustDate:function(id,offset,period){var target=$(id);var inst=$.data(target[0],PROP_NAME);this._adjustInstDate(inst,offset,period);this._updateDatepicker(inst)},_gotoToday:function(id){var target=$(id);var inst=$.data(target[0],PROP_NAME);if(this._get(inst,"gotoCurrent")&&inst.currentDay){inst.selectedDay=inst.currentDay;inst.drawMonth=inst.selectedMonth=inst.currentMonth;inst.drawYear=inst.selectedYear=inst.currentYear}else{var date=new Date();inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear()}this._adjustDate(target);this._notifyChange(inst)},_selectMonthYear:function(id,select,period){var target=$(id);var inst=$.data(target[0],PROP_NAME);inst._selectingMonthYear=false;inst[period=="M"?"drawMonth":"drawYear"]=select.options[select.selectedIndex].value-0;this._adjustDate(target);this._notifyChange(inst)},_clickMonthYear:function(id){var target=$(id);var inst=$.data(target[0],PROP_NAME);if(inst.input&&inst._selectingMonthYear&&!$.browser.msie){inst.input[0].focus()}inst._selectingMonthYear=!inst._selectingMonthYear},_changeFirstDay:function(id,day){var target=$(id);var inst=$.data(target[0],PROP_NAME);inst.settings.firstDay=day;this._updateDatepicker(inst)},_selectDay:function(id,month,year,td){if($(td).hasClass(this._unselectableClass)){return}var target=$(id);var inst=$.data(target[0],PROP_NAME);var rangeSelect=this._get(inst,"rangeSelect");if(rangeSelect){this._stayOpen=!this._stayOpen;if(this._stayOpen){$(".ui-datepicker td").removeClass(this._currentClass);$(td).addClass(this._currentClass)}}inst.selectedDay=inst.currentDay=$("a",td).html();inst.selectedMonth=inst.currentMonth=month;inst.selectedYear=inst.currentYear=year;if(this._stayOpen){inst.endDay=inst.endMonth=inst.endYear=null}else{if(rangeSelect){inst.endDay=inst.currentDay;inst.endMonth=inst.currentMonth;inst.endYear=inst.currentYear}}this._selectDate(id,this._formatDate(inst,inst.currentDay,inst.currentMonth,inst.currentYear));if(this._stayOpen){inst.rangeStart=this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay));this._updateDatepicker(inst)}else{if(rangeSelect){inst.selectedDay=inst.currentDay=inst.rangeStart.getDate();inst.selectedMonth=inst.currentMonth=inst.rangeStart.getMonth();inst.selectedYear=inst.currentYear=inst.rangeStart.getFullYear();inst.rangeStart=null;if(inst.inline){this._updateDatepicker(inst)}}}},_clearDate:function(id){var target=$(id);var inst=$.data(target[0],PROP_NAME);if(this._get(inst,"mandatory")){return}this._stayOpen=false;inst.endDay=inst.endMonth=inst.endYear=inst.rangeStart=null;this._selectDate(target,"")},_selectDate:function(id,dateStr){var target=$(id);var inst=$.data(target[0],PROP_NAME);dateStr=(dateStr!=null?dateStr:this._formatDate(inst));if(this._get(inst,"rangeSelect")&&dateStr){dateStr=(inst.rangeStart?this._formatDate(inst,inst.rangeStart):dateStr)+this._get(inst,"rangeSeparator")+dateStr}if(inst.input){inst.input.val(dateStr)}this._updateAlternate(inst);var onSelect=this._get(inst,"onSelect");if(onSelect){onSelect.apply((inst.input?inst.input[0]:null),[dateStr,inst])}else{if(inst.input){inst.input.trigger("change")}}if(inst.inline){this._updateDatepicker(inst)}else{if(!this._stayOpen){this._hideDatepicker(null,this._get(inst,"duration"));this._lastInput=inst.input[0];if(typeof(inst.input[0])!="object"){inst.input[0].focus()}this._lastInput=null}}},_updateAlternate:function(inst){var altField=this._get(inst,"altField");if(altField){var altFormat=this._get(inst,"altFormat");var date=this._getDate(inst);dateStr=(isArray(date)?(!date[0]&&!date[1]?"":this.formatDate(altFormat,date[0],this._getFormatConfig(inst))+this._get(inst,"rangeSeparator")+this.formatDate(altFormat,date[1]||date[0],this._getFormatConfig(inst))):this.formatDate(altFormat,date,this._getFormatConfig(inst)));$(altField).each(function(){$(this).val(dateStr)})}},noWeekends:function(date){var day=date.getDay();return[(day>0&&day<6),""]},iso8601Week:function(date){var checkDate=new Date(date.getFullYear(),date.getMonth(),date.getDate());var firstMon=new Date(checkDate.getFullYear(),1-1,4);var firstDay=firstMon.getDay()||7;firstMon.setDate(firstMon.getDate()+1-firstDay);if(firstDay<4&&checkDate<firstMon){checkDate.setDate(checkDate.getDate()-3);return $.datepicker.iso8601Week(checkDate)}else{if(checkDate>new Date(checkDate.getFullYear(),12-1,28)){firstDay=new Date(checkDate.getFullYear()+1,1-1,4).getDay()||7;if(firstDay>4&&(checkDate.getDay()||7)<firstDay-3){checkDate.setDate(checkDate.getDate()+3);return $.datepicker.iso8601Week(checkDate)}}}return Math.floor(((checkDate-firstMon)/86400000)/7)+1},dateStatus:function(date,inst){return $.datepicker.formatDate($.datepicker._get(inst,"dateStatus"),date,$.datepicker._getFormatConfig(inst))},parseDate:function(format,value,settings){if(format==null||value==null){throw"Invalid arguments"}value=(typeof value=="object"?value.toString():value+"");if(value==""){return null}var shortYearCutoff=(settings?settings.shortYearCutoff:null)||this._defaults.shortYearCutoff;var dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort;var dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames;var monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort;var monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames;var year=-1;var month=-1;var day=-1;var literal=false;var lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)==match);if(matches){iFormat++}return matches};var getNumber=function(match){lookAhead(match);var origSize=(match=="@"?14:(match=="y"?4:2));var size=origSize;var num=0;while(size>0&&iValue<value.length&&value.charAt(iValue)>="0"&&value.charAt(iValue)<="9"){num=num*10+(value.charAt(iValue++)-0);size--}if(size==origSize){throw"Missing number at position "+iValue}return num};var getName=function(match,shortNames,longNames){var names=(lookAhead(match)?longNames:shortNames);var size=0;for(var j=0;j<names.length;j++){size=Math.max(size,names[j].length)}var name="";var iInit=iValue;while(size>0&&iValue<value.length){name+=value.charAt(iValue++);for(var i=0;i<names.length;i++){if(name==names[i]){return i+1}}size--}throw"Unknown name at position "+iInit};var checkLiteral=function(){if(value.charAt(iValue)!=format.charAt(iFormat)){throw"Unexpected literal at position "+iValue}iValue++};var iValue=0;for(var iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)=="'"&&!lookAhead("'")){literal=false}else{checkLiteral()}}else{switch(format.charAt(iFormat)){case"d":day=getNumber("d");break;case"D":getName("D",dayNamesShort,dayNames);break;case"m":month=getNumber("m");break;case"M":month=getName("M",monthNamesShort,monthNames);break;case"y":year=getNumber("y");break;case"@":var date=new Date(getNumber("@"));year=date.getFullYear();month=date.getMonth()+1;day=date.getDate();break;case"'":if(lookAhead("'")){checkLiteral()}else{literal=true}break;default:checkLiteral()}}}if(year<100){year+=new Date().getFullYear()-new Date().getFullYear()%100+(year<=shortYearCutoff?0:-100)}var date=this._daylightSavingAdjust(new Date(year,month-1,day));if(date.getFullYear()!=year||date.getMonth()+1!=month||date.getDate()!=day){throw"Invalid date"}return date},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TIMESTAMP:"@",W3C:"yy-mm-dd",formatDate:function(format,date,settings){if(!date){return""}var dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort;var dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames;var monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort;var monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames;var lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)==match);if(matches){iFormat++}return matches};var formatNumber=function(match,value){return(lookAhead(match)&&value<10?"0":"")+value};var formatName=function(match,value,shortNames,longNames){return(lookAhead(match)?longNames[value]:shortNames[value])};var output="";var literal=false;if(date){for(var iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)=="'"&&!lookAhead("'")){literal=false}else{output+=format.charAt(iFormat)}}else{switch(format.charAt(iFormat)){case"d":output+=formatNumber("d",date.getDate());break;case"D":output+=formatName("D",date.getDay(),dayNamesShort,dayNames);break;case"m":output+=formatNumber("m",date.getMonth()+1);break;case"M":output+=formatName("M",date.getMonth(),monthNamesShort,monthNames);break;case"y":output+=(lookAhead("y")?date.getFullYear():(date.getYear()%100<10?"0":"")+date.getYear()%100);break;case"@":output+=date.getTime();break;case"'":if(lookAhead("'")){output+="'"}else{literal=true}break;default:output+=format.charAt(iFormat)}}}}return output},_possibleChars:function(format){var chars="";var literal=false;for(var iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)=="'"&&!lookAhead("'")){literal=false}else{chars+=format.charAt(iFormat)}}else{switch(format.charAt(iFormat)){case"d":case"m":case"y":case"@":chars+="0123456789";break;case"D":case"M":return null;case"'":if(lookAhead("'")){chars+="'"}else{literal=true}break;default:chars+=format.charAt(iFormat)}}}return chars},_get:function(inst,name){return inst.settings[name]!==undefined?inst.settings[name]:this._defaults[name]},_setDateFromField:function(inst){var dateFormat=this._get(inst,"dateFormat");var dates=inst.input?inst.input.val().split(this._get(inst,"rangeSeparator")):null;inst.endDay=inst.endMonth=inst.endYear=null;var date=defaultDate=this._getDefaultDate(inst);if(dates.length>0){var settings=this._getFormatConfig(inst);if(dates.length>1){date=this.parseDate(dateFormat,dates[1],settings)||defaultDate;inst.endDay=date.getDate();inst.endMonth=date.getMonth();inst.endYear=date.getFullYear()}try{date=this.parseDate(dateFormat,dates[0],settings)||defaultDate}catch(e){this.log(e);date=defaultDate}}inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();inst.currentDay=(dates[0]?date.getDate():0);inst.currentMonth=(dates[0]?date.getMonth():0);inst.currentYear=(dates[0]?date.getFullYear():0);this._adjustInstDate(inst)},_getDefaultDate:function(inst){var date=this._determineDate(this._get(inst,"defaultDate"),new Date());var minDate=this._getMinMaxDate(inst,"min",true);var maxDate=this._getMinMaxDate(inst,"max");date=(minDate&&date<minDate?minDate:date);date=(maxDate&&date>maxDate?maxDate:date);return date},_determineDate:function(date,defaultDate){var offsetNumeric=function(offset){var date=new Date();date.setDate(date.getDate()+offset);return date};var offsetString=function(offset,getDaysInMonth){var date=new Date();var year=date.getFullYear();var month=date.getMonth();var day=date.getDate();var pattern=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g;var matches=pattern.exec(offset);while(matches){switch(matches[2]||"d"){case"d":case"D":day+=(matches[1]-0);break;case"w":case"W":day+=(matches[1]*7);break;case"m":case"M":month+=(matches[1]-0);day=Math.min(day,getDaysInMonth(year,month));break;case"y":case"Y":year+=(matches[1]-0);day=Math.min(day,getDaysInMonth(year,month));break}matches=pattern.exec(offset)}return new Date(year,month,day)};date=(date==null?defaultDate:(typeof date=="string"?offsetString(date,this._getDaysInMonth):(typeof date=="number"?(isNaN(date)?defaultDate:offsetNumeric(date)):date)));date=(date&&date.toString()=="Invalid Date"?defaultDate:date);if(date){date.setHours(0);date.setMinutes(0);date.setSeconds(0);date.setMilliseconds(0)}return this._daylightSavingAdjust(date)},_daylightSavingAdjust:function(date){if(!date){return null}date.setHours(date.getHours()>12?date.getHours()+2:0);return date},_setDate:function(inst,date,endDate){var clear=!(date);date=this._determineDate(date,new Date());inst.selectedDay=inst.currentDay=date.getDate();inst.drawMonth=inst.selectedMonth=inst.currentMonth=date.getMonth();inst.drawYear=inst.selectedYear=inst.currentYear=date.getFullYear();if(this._get(inst,"rangeSelect")){if(endDate){endDate=this._determineDate(endDate,null);inst.endDay=endDate.getDate();inst.endMonth=endDate.getMonth();inst.endYear=endDate.getFullYear()}else{inst.endDay=inst.currentDay;inst.endMonth=inst.currentMonth;inst.endYear=inst.currentYear}}this._adjustInstDate(inst);if(inst.input){inst.input.val(clear?"":this._formatDate(inst)+(!this._get(inst,"rangeSelect")?"":this._get(inst,"rangeSeparator")+this._formatDate(inst,inst.endDay,inst.endMonth,inst.endYear)))}},_getDate:function(inst){var startDate=(!inst.currentYear||(inst.input&&inst.input.val()=="")?null:this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));if(this._get(inst,"rangeSelect")){return[inst.rangeStart||startDate,(!inst.endYear?inst.rangeStart||startDate:this._daylightSavingAdjust(new Date(inst.endYear,inst.endMonth,inst.endDay)))]}else{return startDate}},_generateDatepicker:function(inst){var today=new Date();today=this._daylightSavingAdjust(new Date(today.getFullYear(),today.getMonth(),today.getDate()));var showStatus=this._get(inst,"showStatus");var isRTL=this._get(inst,"isRTL");var clear=(this._get(inst,"mandatory")?"":'<div class="ui-datepicker-clear"><a onclick="jQuery.datepicker._clearDate(\'#'+inst.id+"');\""+(showStatus?this._addStatus(inst,this._get(inst,"clearStatus")||"&#xa0;"):"")+">"+this._get(inst,"clearText")+"</a></div>");var headline="";if(inst.id==="datePickerFlight"){headline=this._get(inst,"flightHeadlineText")}else{if(inst.id==="datePickerReturn"){headline=this._get(inst,"returnHeadlineText")}}var controls='<div class="ui-datepicker-control"><strong class="ui-datepicker-headline">'+headline+"</strong>"+(isRTL?"":clear)+'<div class="ui-datepicker-close"><a onclick="jQuery.datepicker._hideDatepicker();"'+(showStatus?this._addStatus(inst,this._get(inst,"closeStatus")||"&#xa0;"):"")+">"+this._get(inst,"closeText")+"</a></div>"+(isRTL?clear:"")+"</div>";var prompt=this._get(inst,"prompt");var closeAtTop=this._get(inst,"closeAtTop");var hideIfNoPrevNext=this._get(inst,"hideIfNoPrevNext");var navigationAsDateFormat=this._get(inst,"navigationAsDateFormat");var numMonths=this._getNumberOfMonths(inst);var stepMonths=this._get(inst,"stepMonths");var isMultiMonth=(numMonths[0]!=1||numMonths[1]!=1);var currentDate=this._daylightSavingAdjust((!inst.currentDay?new Date(9999,9,9):new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));var minDate=this._getMinMaxDate(inst,"min",true);var maxDate=this._getMinMaxDate(inst,"max");var drawMonth=inst.drawMonth;var drawYear=inst.drawYear;if(maxDate){var maxDraw=this._daylightSavingAdjust(new Date(maxDate.getFullYear(),maxDate.getMonth()-numMonths[1]+1,maxDate.getDate()));maxDraw=(minDate&&maxDraw<minDate?minDate:maxDraw);while(this._daylightSavingAdjust(new Date(drawYear,drawMonth,1))>maxDraw){drawMonth--;if(drawMonth<0){drawMonth=11;drawYear--}}}var prevText=this._get(inst,"prevText");prevText=(!navigationAsDateFormat?prevText:this.formatDate(prevText,this._daylightSavingAdjust(new Date(drawYear,drawMonth-stepMonths,1)),this._getFormatConfig(inst)));var prev='<div class="ui-datepicker-prev">'+(this._canAdjustMonth(inst,-1,drawYear,drawMonth)?"<a onclick=\"jQuery.datepicker._adjustDate('#"+inst.id+"', -"+stepMonths+", 'M');\""+(showStatus?this._addStatus(inst,this._get(inst,"prevStatus")||"&#xa0;"):"")+">"+prevText+"</a>":(hideIfNoPrevNext?"":"<label>"+prevText+"</label>"))+"</div>";var nextText=this._get(inst,"nextText");nextText=(!navigationAsDateFormat?nextText:this.formatDate(nextText,this._daylightSavingAdjust(new Date(drawYear,drawMonth+stepMonths,1)),this._getFormatConfig(inst)));var next='<div class="ui-datepicker-next">'+(this._canAdjustMonth(inst,+1,drawYear,drawMonth)?"<a onclick=\"jQuery.datepicker._adjustDate('#"+inst.id+"', +"+stepMonths+", 'M');\""+(showStatus?this._addStatus(inst,this._get(inst,"nextStatus")||"&#xa0;"):"")+">"+nextText+"</a>":(hideIfNoPrevNext?"":"<label>"+nextText+"</label>"))+"</div>";var currentText=this._get(inst,"currentText");currentText=(!navigationAsDateFormat?currentText:this.formatDate(currentText,today,this._getFormatConfig(inst)));var html=(prompt?'<div class="'+this._promptClass+'">'+prompt+"</div>":"")+(closeAtTop&&!inst.inline?controls:"")+'<div class="ui-datepicker-links">'+(isRTL?next:prev)+(this._isInRange(inst,(this._get(inst,"gotoCurrent")&&inst.currentDay?currentDate:today))?'<div class="ui-datepicker-current"><a onclick="jQuery.datepicker._gotoToday(\'#'+inst.id+"');\""+(showStatus?this._addStatus(inst,this._get(inst,"currentStatus")||"&#xa0;"):"")+">"+currentText+"</a></div>":"")+(isRTL?prev:next)+"</div>";var firstDay=this._get(inst,"firstDay");var changeFirstDay=this._get(inst,"changeFirstDay");var dayNames=this._get(inst,"dayNames");var dayNamesShort=this._get(inst,"dayNamesShort");var dayNamesMin=this._get(inst,"dayNamesMin");var monthNames=this._get(inst,"monthNames");var beforeShowDay=this._get(inst,"beforeShowDay");var highlightWeek=this._get(inst,"highlightWeek");var showOtherMonths=this._get(inst,"showOtherMonths");var showWeeks=this._get(inst,"showWeeks");var calculateWeek=this._get(inst,"calculateWeek")||this.iso8601Week;var status=(showStatus?this._get(inst,"dayStatus")||"&#xa0;":"");var dateStatus=this._get(inst,"statusForDate")||this.dateStatus;var endDate=inst.endDay?this._daylightSavingAdjust(new Date(inst.endYear,inst.endMonth,inst.endDay)):currentDate;for(var row=0;row<numMonths[0];row++){for(var col=0;col<numMonths[1];col++){var selectedDate=this._daylightSavingAdjust(new Date(drawYear,drawMonth,inst.selectedDay));html+='<div class="ui-datepicker-one-month'+(col==0?" ui-datepicker-new-row":"")+'">'+this._generateMonthYearHeader(inst,drawMonth,drawYear,minDate,maxDate,selectedDate,row>0||col>0,showStatus,monthNames)+'<table class="ui-datepicker" cellpadding="0" cellspacing="0"><thead><tr class="ui-datepicker-title-row">'+(showWeeks?"<td>"+this._get(inst,"weekHeader")+"</td>":"");for(var dow=0;dow<7;dow++){var day=(dow+firstDay)%7;var dayStatus=(status.indexOf("DD")>-1?status.replace(/DD/,dayNames[day]):status.replace(/D/,dayNamesShort[day]));html+="<td"+((dow+firstDay+6)%7>=5?' class="ui-datepicker-week-end-cell"':"")+">"+(!changeFirstDay?"<span":"<a onclick=\"jQuery.datepicker._changeFirstDay('#"+inst.id+"', "+day+');"')+(showStatus?this._addStatus(inst,dayStatus):"")+' title="'+dayNames[day]+'">'+dayNamesMin[day]+(changeFirstDay?"</a>":"</span>")+"</td>"}html+="</tr></thead><tbody>";var daysInMonth=this._getDaysInMonth(drawYear,drawMonth);if(drawYear==inst.selectedYear&&drawMonth==inst.selectedMonth){inst.selectedDay=Math.min(inst.selectedDay,daysInMonth)}var leadDays=(this._getFirstDayOfMonth(drawYear,drawMonth)-firstDay+7)%7;var numRows=(isMultiMonth?6:Math.ceil((leadDays+daysInMonth)/7));var printDate=this._daylightSavingAdjust(new Date(drawYear,drawMonth,1-leadDays));for(var dRow=0;dRow<numRows;dRow++){html+='<tr class="ui-datepicker-days-row">'+(showWeeks?'<td class="ui-datepicker-week-col">'+calculateWeek(printDate)+"</td>":"");for(var dow=0;dow<7;dow++){var daySettings=(beforeShowDay?beforeShowDay.apply((inst.input?inst.input[0]:null),[printDate]):[true,""]);var otherMonth=false;var unselectable=otherMonth||!daySettings[0]||(minDate&&printDate<minDate)||(maxDate&&printDate>maxDate);var pickMonth=printDate.getMonth();var pickYear=printDate.getFullYear();var otherMonthOptic=(printDate.getMonth()!=drawMonth);html+='<td class="ui-datepicker-days-cell'+((dow+firstDay+6)%7>=5?" ui-datepicker-week-end-cell":"")+(otherMonthOptic?" ui-datepicker-otherMonth":"")+(printDate.getTime()==selectedDate.getTime()&&drawMonth==inst.selectedMonth?" ui-datepicker-days-cell-over":"")+(unselectable?" "+this._unselectableClass:"")+(otherMonth&&!showOtherMonths?"":" "+daySettings[1]+(printDate.getTime()>=currentDate.getTime()&&printDate.getTime()<=endDate.getTime()?" "+this._currentClass:"")+(printDate.getTime()==today.getTime()?" ui-datepicker-today":""))+'"'+((!otherMonth||showOtherMonths)&&daySettings[2]?' title="'+daySettings[2]+'"':"")+(unselectable?(highlightWeek?" onmouseover=\"jQuery(this).parent().addClass('ui-datepicker-week-over');\" onmouseout=\"jQuery(this).parent().removeClass('ui-datepicker-week-over');\"":""):" onmouseover=\"jQuery(this).addClass('ui-datepicker-days-cell-over')"+(highlightWeek?".parent().addClass('ui-datepicker-week-over')":"")+";"+(!showStatus||(otherMonth&&!showOtherMonths)?"":"jQuery('#ui-datepicker-status-"+inst.id+"').html('"+(dateStatus.apply((inst.input?inst.input[0]:null),[printDate,inst])||"&#xa0;")+"');")+"\" onmouseout=\"jQuery(this).removeClass('ui-datepicker-days-cell-over')"+(highlightWeek?".parent().removeClass('ui-datepicker-week-over')":"")+";"+(!showStatus||(otherMonth&&!showOtherMonths)?"":"jQuery('#ui-datepicker-status-"+inst.id+"').html('&#xa0;');")+'" onclick="jQuery.datepicker._selectDay(\'#'+inst.id+"',"+pickMonth+","+pickYear+', this);"')+">"+(otherMonth?(showOtherMonths?printDate.getDate():"&#xa0;"):(unselectable?printDate.getDate():"<a>"+printDate.getDate()+"</a>"))+"</td>";printDate.setDate(printDate.getDate()+1);printDate=this._daylightSavingAdjust(printDate)}html+="</tr>"}drawMonth++;if(drawMonth>11){drawMonth=0;drawYear++}html+="</tbody></table></div>"}}html+=(showStatus?'<div style="clear: both;"></div><div id="ui-datepicker-status-'+inst.id+'" class="ui-datepicker-status">'+(this._get(inst,"initStatus")||"&#xa0;")+"</div>":"")+(!closeAtTop&&!inst.inline?controls:"")+'<div style="clear: both;"></div>'+("");return html},_generateMonthYearHeader:function(inst,drawMonth,drawYear,minDate,maxDate,selectedDate,secondary,showStatus,monthNames){minDate=(inst.rangeStart&&minDate&&selectedDate<minDate?selectedDate:minDate);var html='<div class="ui-datepicker-header">';if(secondary||!this._get(inst,"changeMonth")){html+=monthNames[drawMonth]+"&#xa0;"}else{var inMinYear=(minDate&&minDate.getFullYear()==drawYear);var inMaxYear=(maxDate&&maxDate.getFullYear()==drawYear);html+='<select class="ui-datepicker-new-month" onchange="jQuery.datepicker._selectMonthYear(\'#'+inst.id+"', this, 'M');\" onclick=\"jQuery.datepicker._clickMonthYear('#"+inst.id+"');\""+(showStatus?this._addStatus(inst,this._get(inst,"monthStatus")||"&#xa0;"):"")+">";for(var month=0;month<12;month++){if((!inMinYear||month>=minDate.getMonth())&&(!inMaxYear||month<=maxDate.getMonth())){html+='<option value="'+month+'"'+(month==drawMonth?' selected="selected"':"")+">"+monthNames[month]+"</option>"}}html+="</select>"}if(secondary||!this._get(inst,"changeYear")){html+=drawYear}else{var years=this._get(inst,"yearRange").split(":");var year=0;var endYear=0;if(years.length!=2){year=drawYear-10;endYear=drawYear+10}else{if(years[0].charAt(0)=="+"||years[0].charAt(0)=="-"){year=endYear=new Date().getFullYear();year+=parseInt(years[0],10);endYear+=parseInt(years[1],10)}else{year=parseInt(years[0],10);endYear=parseInt(years[1],10)}}year=(minDate?Math.max(year,minDate.getFullYear()):year);endYear=(maxDate?Math.min(endYear,maxDate.getFullYear()):endYear);html+='<select class="ui-datepicker-new-year" onchange="jQuery.datepicker._selectMonthYear(\'#'+inst.id+"', this, 'Y');\" onclick=\"jQuery.datepicker._clickMonthYear('#"+inst.id+"');\""+(showStatus?this._addStatus(inst,this._get(inst,"yearStatus")||"&#xa0;"):"")+">";for(;year<=endYear;year++){html+='<option value="'+year+'"'+(year==drawYear?' selected="selected"':"")+">"+year+"</option>"}html+="</select>"}html+="</div>";return html},_addStatus:function(inst,text){return" onmouseover=\"jQuery('#ui-datepicker-status-"+inst.id+"').html('"+text+"');\" onmouseout=\"jQuery('#ui-datepicker-status-"+inst.id+"').html('&#xa0;');\""},_adjustInstDate:function(inst,offset,period){var year=inst.drawYear+(period=="Y"?offset:0);var month=inst.drawMonth+(period=="M"?offset:0);var day=Math.min(inst.selectedDay,this._getDaysInMonth(year,month))+(period=="D"?offset:0);var date=this._daylightSavingAdjust(new Date(year,month,day));var minDate=this._getMinMaxDate(inst,"min",true);var maxDate=this._getMinMaxDate(inst,"max");date=(minDate&&date<minDate?minDate:date);date=(maxDate&&date>maxDate?maxDate:date);inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();if(period=="M"||period=="Y"){this._notifyChange(inst)}},_notifyChange:function(inst){var onChange=this._get(inst,"onChangeMonthYear");if(onChange){onChange.apply((inst.input?inst.input[0]:null),[new Date(inst.selectedYear,inst.selectedMonth,1),inst])}},_getNumberOfMonths:function(inst){var numMonths=this._get(inst,"numberOfMonths");return(numMonths==null?[1,1]:(typeof numMonths=="number"?[1,numMonths]:numMonths))},_getMinMaxDate:function(inst,minMax,checkRange){var date=this._determineDate(this._get(inst,minMax+"Date"),null);return(!checkRange||!inst.rangeStart?date:(!date||inst.rangeStart>date?inst.rangeStart:date))},_getDaysInMonth:function(year,month){return 32-new Date(year,month,32).getDate()},_getFirstDayOfMonth:function(year,month){return new Date(year,month,1).getDay()},_canAdjustMonth:function(inst,offset,curYear,curMonth){var numMonths=this._getNumberOfMonths(inst);var date=this._daylightSavingAdjust(new Date(curYear,curMonth+(offset<0?offset:numMonths[1]),1));if(offset<0){date.setDate(this._getDaysInMonth(date.getFullYear(),date.getMonth()))}return this._isInRange(inst,date)},_isInRange:function(inst,date){var newMinDate=(!inst.rangeStart?null:this._daylightSavingAdjust(new Date(inst.selectedYear,inst.selectedMonth,inst.selectedDay)));newMinDate=(newMinDate&&inst.rangeStart<newMinDate?inst.rangeStart:newMinDate);var minDate=newMinDate||this._getMinMaxDate(inst,"min");var maxDate=this._getMinMaxDate(inst,"max");return((!minDate||date>=minDate)&&(!maxDate||date<=maxDate))},_getFormatConfig:function(inst){var shortYearCutoff=this._get(inst,"shortYearCutoff");shortYearCutoff=(typeof shortYearCutoff!="string"?shortYearCutoff:new Date().getFullYear()%100+parseInt(shortYearCutoff,10));return{shortYearCutoff:shortYearCutoff,dayNamesShort:this._get(inst,"dayNamesShort"),dayNames:this._get(inst,"dayNames"),monthNamesShort:this._get(inst,"monthNamesShort"),monthNames:this._get(inst,"monthNames")}},_formatDate:function(inst,day,month,year){if(!day){inst.currentDay=inst.selectedDay;inst.currentMonth=inst.selectedMonth;inst.currentYear=inst.selectedYear}var date=(day?(typeof day=="object"?day:this._daylightSavingAdjust(new Date(year,month,day))):this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));return this.formatDate(this._get(inst,"dateFormat"),date,this._getFormatConfig(inst))}});function extendRemove(target,props){$.extend(target,props);for(var name in props){if(props[name]==null||props[name]==undefined){target[name]=props[name]}}return target}function isArray(a){return(a&&(($.browser.safari&&typeof a=="object"&&a.length)||(a.constructor&&a.constructor.toString().match(/\Array\(\)/))))}$.fn.datepicker=function(options){var otherArgs=Array.prototype.slice.call(arguments,1);if(typeof options=="string"&&(options=="isDisabled"||options=="getDate")){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs))}return this.each(function(){typeof options=="string"?$.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this].concat(otherArgs)):$.datepicker._attachDatepicker(this,options)})};$.datepicker=new Datepicker();$(document).ready(function(){$(document.body).append($.datepicker.dpDiv).mousedown($.datepicker._checkExternalClick)})})(jQuery);jQuery(function(A){A.datepicker.regional.de={clearText:"löschen",clearStatus:"aktuelles Datum löschen",flightHeadlineText:"Hinflugdatum",returnHeadlineText:"Rückflugdatum",closeText:"schließen",closeStatus:"ohne Änderungen schließen",prevText:"&#x3c;zurück",prevStatus:"letzten Monat zeigen",nextText:"Vor&#x3e;",nextStatus:"nächsten Monat zeigen",currentText:"heute",currentStatus:"",monthNames:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],monthNamesShort:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],monthStatus:"anderen Monat anzeigen",yearStatus:"anderes Jahr anzeigen",weekHeader:"Wo",weekStatus:"Woche des Monats",dayNames:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],dayNamesShort:["So","Mo","Di","Mi","Do","Fr","Sa"],dayNamesMin:["So","Mo","Di","Mi","Do","Fr","Sa"],dayStatus:"Setze DD als ersten Wochentag",dateStatus:"Wähle D, M d",dateFormat:"dd.mm.yy",firstDay:1,initStatus:"Wähle ein Datum",isRTL:false}});jQuery(function(A){A.datepicker.regional.it={flightHeadlineText:"Data di partenza",returnHeadlineText:"Data di ritorno",closeText:"Chiudi",prevText:"&#x3c;Prec",nextText:"Succ&#x3e;",currentText:"Oggi",monthNames:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"],monthNamesShort:["Gen","Feb","Mar","Apr","Mag","Giu","Lug","Ago","Set","Ott","Nov","Dic"],dayNames:["Domenica","Luned&#236","Marted&#236","Mercoled&#236","Gioved&#236","Venerd&#236","Sabato"],dayNamesShort:["Dom","Lun","Mar","Mer","Gio","Ven","Sab"],dayNamesMin:["Do","Lu","Ma","Me","Gio","Ve","Sa"],dateFormat:"dd/mm/yy",firstDay:1,isRTL:false}});jQuery(function(A){A.datepicker.regional.gb={dateFormat:"dd/mm/yy",flightHeadlineText:"Date of outbound flight",returnHeadlineText:"Date of return flight"}});jQuery(function(A){A.datepicker.regional.es={flightHeadlineText:"Fecha del vuelo de ida",returnHeadlineText:"Fecha del vuelo de vuelta",dateFormat:"dd.mm.yy",firstDay:1,closeText:"Chiudi",prevText:"&#x3c;Prec",nextText:"Succ&#x3e;",currentText:"Oggi",monthNames:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],monthNamesShort:["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],dayNames:["Domingo","Lunes","Martes","Mi&#233rcoles","Jueves","Viernes","S&#225bado"],dayNamesShort:["Dom","Lun","Mar","Mi&#233","Jue","Vie","S&#225b"],dayNamesMin:["Do","Lu","Ma","Mi","Ju","Vi","S&#225"]}});var overrideBagInputValidation=false;function setViewFlash(A){s2.tuifly.helper.farefinderVerlaufSelector.trace("setView: "+A)}function filterString(B,A){return true}function addEvent(D,C,A){if(D.addEventListener){D.addEventListener(C,A,true);return true}else{if(D.attachEvent){var B=D.attachEvent("on"+C,A);return B}else{return false}}}function erase(B,A){if(B.value==A){B.value=""}}function set(B,A){if(B.value==""){B.value=A}}jQuery.extend(jQuery.expr[":"],{submitable:"!a.disabled&&(a.selected||a.checked||(a.nodeName.toUpperCase()=='TEXTAREA')||(a.nodeName.toUpperCase()=='INPUT'&&(a.type=='text'||a.type=='hidden'||a.type=='password')))",nothidden:"a.type&&a.type!='hidden'"});$(function(){document.SkySales=document.forms.SkySales});var errorsHeader="Please correct the following.\n\n";function Validate(E,D,A,F){this.form=E;this.namespace=D;this.errors="";this.setfocus=null;this.errorsHeader=A;this.namedErrors=new Array();if(F){this.regexElementIdFilter=F}this.requiredAttribute="required";this.requiredEmptyAttribute="requiredempty";this.validationTypeAttribute="validationtype";this.regexAttribute="regex";this.minLengthAttribute="minlength";this.numericMinLengthAttribute="numericminlength";this.maxLengthAttribute="maxlength";this.numericMaxLengthAttribute="numericmaxlength";this.minValueAttribute="minvalue";this.maxValueAttribute="maxvalue";this.equalsAttribute="equals";this.validateIfCheckedOnlyAttribute="validateIfCheckedOnly";this.validateIfNotCheckedOnlyAttribute="validateIfNotCheckedOnly";this.defaultErrorAttribute="error";this.requiredErrorAttribute="requirederror";this.validationTypeErrorAttribute="validationtypeerror";this.regexErrorAttribute="regexerror";this.minLengthErrorAttribute="minlengtherror";this.maxLengthErrorAttribute="maxlengtherror";this.minValueErrorAttribute="minvalueerror";this.maxValueErrorAttribute="maxvalueerror";this.equalsErrorAttribute="equalserror";this.defaultError="{label} is invalid.";this.defaultRequiredError="{label} is required.";this.defaultValidationTypeError="{label} is invalid.";this.defaultRegexError="{label} is invalid.";this.defaultMinLengthError="{label} is too short in length.";this.defaultMaxLengthError="{label} is too long in length.";this.defaultMinValueError="{label} must be greater than {minValue}.";this.defaultMaxValueError="{label} must be less than {maxValue}.";this.defaultEqualsError="{label} is not equal to {equals}";this.defaultNotEqualsError="{label} cannot equal {equals}";this.defaultValidationErrorClass="validationError";this.defaultValidationErrorLabelClass="validationErrorLabel";this.requiredErrorOccured=false;this.run=run;this.runBySelector=runBySelector;this.validateSingleElement=validateSingleElement;this.outputErrors=outputErrors;this.checkFocus=checkFocus;this.setError=setError;this.cleanAttributeForErrorDisplay=cleanAttributeForErrorDisplay;this.validateRequired=validateRequired;this.validateType=validateType;this.validateRegex=validateRegex;this.validateMinLength=validateMinLength;this.validateMaxLength=validateMaxLength;this.validateMinValue=validateMinValue;this.validateMaxValue=validateMaxValue;this.validateEquals=validateEquals;this.isExemptFromValidation=isExemptFromValidation;this.setValidateTypeError=setValidateTypeError;this.validateAmount=validateAmount;this.validateDate=validateDate;this.validateMod10=validateMod10;this.validateNumeric=validateNumeric;this.stringPattern="^.+$";this.upperCaseStringPattern="^[A-Z]([A-Z)|s)*$";this.numericPattern="^\\d+$";this.numericStripper=/\D/g;this.alphaNumericPattern="^\\w+$";var B="(\\.|,)";this.amountPattern="^(\\d+("+B+"\\d+)*)$";this.dateYearPattern="^\\d{4}$";this.dateMonthPattern="^\\d{2}$";this.dateDayPattern="^\\d{2}$";var C="[^:,;#$%&()+=/]+";this.emailPattern="^"+C+"(\\."+C+")?@"+C+"(\\."+C+")+$"}function run(){var B=$("#SkySales").find(":input").get();for(var A=0;A<B.length;A++){var C=B[A];if(!this.isExemptFromValidation(C)){this.validateSingleElement(C)}}return this.outputErrors()}function runBySelector(D){var C=$(D).find(":input").get();for(var A=0;A<C.length;A++){var B=C[A];this.validateSingleElement(B)}return false}function isExemptFromValidation(A){if(A.id.indexOf(this.namespace)!=0){return true}if((this.regexElementIdFilter)&&(!A.id.match(this.regexElementIdFilter))){return true}return false}function outputErrors(){if(this.errors){alert(this.errorsHeader+this.errors);if(this.setfocus){this.setfocus.focus()}return false}return true}function validateSingleElement(B){$(B).removeClass(this.defaultValidationErrorClass);$("label[for="+B.id+"]").eq(0).removeClass(this.defaultValidationErrorLabelClass);var C=this.errors.length;this.validateRequired(B);if(C+1==this.errors.length){this.errors[this.errors.length-1].isRequiredError=true;this.requiredErrorOccured=true}var A=getValue(B);if(this.errors.length<1&&A&&0<A.length){this.validateType(B);this.validateRegex(B);this.validateMinLength(B);this.validateMaxLength(B);this.validateMinValue(B);this.validateMaxValue(B);this.validateEquals(B)}}function checkFocus(A){if(!this.setfocus){this.setfocus=A}}function validateRequired(F){var H=this.requiredAttribute;var B=this.requiredEmptyAttribute;var G=F[H];var K=F[B];var D=this.validateIfCheckedOnlyAttribute;var C=this.validateIfNotCheckedOnlyAttribute;var A=F[D];var E=F[C];if(G==null){G=F.getAttribute(H)}if(K==null){K=F.getAttribute(this.requiredEmptyAttribute)}if(A==null){A=F.getAttribute(D)}if(E==null){E=F.getAttribute(C)}if(A!=null){var J=document.getElementById(A);if(!J){J=document.getElementById(this.namespace+A)}if(J!=null){if(($(J).attr("type")=="checkbox"&&!J.checked)||($(J).attr("type")!="checkbox"&&$(J).val()!="checked")){G=null}}}if(E!=null){var J=document.getElementById(this.namespace+E);if(J!=null){if(J.checked!=undefined){if((J.type=="checkbox"&&J.checked!=false)||(J.type!="checkbox"&&J.value=="checked")){G=null}}}}if(G!=null){G=G.toString();G=G.toLowerCase();if(K!=null){K=K.toLowerCase()}if(G=="true"){var I=getValue(F);if(I!=null){if((I.length<1)||(I.toLowerCase()==K)){this.setError(F,this.requiredErrorAttribute,this.defaultRequiredError)}}}}}function getValue(B){if(B){if(B.type=="radio"){if(B.getAttribute("name").length>0){var C=document.getElementsByName(B.getAttribute("name"));for(var A=0;A<C.length;A++){if(C[A].checked==true){return C[A].value}}}return""}else{if(B.type=="checkbox"){if(B.checked==true){return B.value}}else{return B.value}}}return""}function validateType(C){var A=$(C).attr(this.validationTypeAttribute);if(A==null){A=C.getAttribute(this.validationTypeAttribute)}var B=getValue(C);if(A){A=A.toLowerCase();if((A=="address")&&(!B.match(this.stringPattern))){this.setValidateTypeError(C)}else{if((A=="alphanumeric")&&(!B.match(this.alphaNumericPattern))){this.setValidateTypeError(C)}else{if((A=="amount")&&(!this.validateAmount(B))){this.setValidateTypeError(C)}else{if((A=="country")&&(!B.match(this.stringPattern))){this.setValidateTypeError(C)}else{if((A=="email")&&(!B.match(this.emailPattern))){this.setValidateTypeError(C)}else{if((A=="mod10")&&(!this.validateMod10(B))){this.setValidateTypeError(C)}else{if((A=="name")&&(!B.match(this.stringPattern))){this.setValidateTypeError(C)}else{if((A=="numeric")&&(!this.validateNumeric(B))){this.setValidateTypeError(C)}else{if((A.indexOf("date")==0)&&(!this.validateDate(C,A,B))){this.setValidateTypeError(C)}else{if((A=="state")&&(!B.match(this.stringPattern))){this.setValidateTypeError(C)}else{if((A=="string")&&(!B.match(this.stringPattern))){this.setValidateTypeError(C)}else{if((A=="uppercasestring")&&(!B.match(this.upperCaseStringPattern))){this.setValidateTypeError(C)}else{if((A=="zip")&&(!B.match(this.stringPattern))){this.setValidateTypeError(C)}}}}}}}}}}}}}}}function validateRegex(C){var A=$(C).attr(this.regexAttribute);if(A==null){A=C.getAttribute(this.regexAttribute)}var B=getValue(C);if((A)&&(!B.match(A))){this.setError(C,this.regexErrorAttribute,this.defaultRegexError)}}function validateMinLength(D){var A=$(D).attr(this.minLengthAttribute);var C=$(D).attr(this.numericMinLengthAttribute);if(A==null){A=D.getAttribute(this.minLengthAttribute)}if(C=null){C=D.getAttribute(this.numericMinLengthAttribute)}var B=getValue(D);if((0<A)&&(B.length<A)){this.setError(D,this.minLengthErrorAttribute,this.defaultMinLengthError)}else{if((0<C)&&(0<B.length)&&(B.replace(this.numericStripper,"").length<C)){this.setError(D,this.minLengthErrorAttribute,this.defaultMinLengthError)}}}function validateMaxLength(D){var B=$(D).attr(this.maxLengthAttribute);var A=$(D).attr(this.numericMaxLengthAttribute);if(B==null){B=D.getAttribute(this.maxLengthAttribute)}if(numericLength=null){numericLength=D.getAttribute(this.numericMaxLengthAttribute)}var C=getValue(D);if((0<B)&&(B<C.length)){this.setError(D,this.maxLengthErrorAttribute,this.defaultMaxLengthError)}else{if((0<numericLength)&&(0<C.length)&&(numericLength<C.replace(this.numericStripper,"").length)){this.setError(D,this.maxLengthErrorAttribute,this.defaultMaxLengthError)}}}function validateMinValue(C){var A=$(C).attr(this.minValueAttribute);if(A==null){A=C.getAttribute(this.minValueAttribute)}if((A!=null)&&(0<A.length)){var B=getValue(C);if((5<A.length)&&(A.substring(0,5)=="&gt;=")){if(B<parseFloat(A.substring(5,A.length))){this.setError(C,this.minValueErrorAttribute,this.defaultMinValueError)}}else{if((4<A.length)&&(A.substring(0,4)=="&gt;")){if(B<=parseFloat(A.substring(4,A.length))){this.setError(C,this.minValueErrorAttribute,this.defaultMinValueError)}}else{if(B<parseFloat(A)){this.setError(C,this.minValueErrorAttribute,this.defaultMinValueError)}}}}}function validateMaxValue(C){var A=$(C).attr(this.maxValueAttribute);if(A==null){A=C.getAttribute(this.maxValueAttribute)}if((A!=null)&&(0<A.length)){var B=getValue(C);if((5<A.length)&&(A.substring(0,5)=="&lt;=")){if(B>parseFloat(A.substring(5,A.length))){this.setError(C,this.maxValueErrorAttribute,this.defaultMaxValueError)}}else{if((4<A.length)&&(A.substring(0,4)=="&lt;")){if(B>=parseFloat(A.substring(4,A.length))){this.setError(C,this.maxValueErrorAttribute,this.defaultMaxValueError)}}else{if(parseFloat(B)>A){this.setError(C,this.maxValueErrorAttribute,this.defaultMaxValueError)}}}}}function validateEquals(C){var A=$(C).attr(this.equalsAttribute);if(A==null){A=C.getAttribute(this.equalsAttribute)}if((A!=null)&&(0<A.length)){var B=getValue(C);if((2<A.length)&&(A.substring(0,2)=="!=")){if(B==A.substring(2,A.length)){this.setError(C,this.equalsErrorAttribute,this.defaultEqualsError)}}else{if((2<A.length)&&(A.substring(0,2)=="==")){if(B!=A.substring(2,A.length)){this.setError(C,this.equalsErrorAttribute,this.defaultEqualsError)}}else{if(A.charAt(0)=="="){if(B!=A.substring(1,A.length)){this.setError(C,this.equalsErrorAttribute,this.defaultEqualsError)}}else{if(B!=A){this.setError(C,this.equalsErrorAttribute,this.defaultEqualsError)}}}}}}function setValidateTypeError(A){this.setError(A,this.validationTypeErrorAttribute,this.defaultValidationTypeError)}function setError(G,F,H){if(G.type=="radio"){var C=G.getAttribute("name");if(C.length>0){if(this.namedErrors[C]!=null){return}this.namedErrors[C]=C}}var B=$(G).attr(F);if(B==null){B=G.getAttribute(F)}if(!B){if($(G).attr(this.defaultErrorAttribute)){B=$(G).attr(this.defaultErrorAttribute)}else{if(H){B=H}else{B=this.defaultError}}}var E=B.match(/{\s*(\w+)\s*}/g);if(E){for(var D=0;D<E.length;D++){var A=E[D].replace(/{\s*(\w+)\s*}/,"$1");B=B.replace(/{\s*\w+\s*}/,this.cleanAttributeForErrorDisplay(G,A))}}$(G).addClass(this.defaultValidationErrorClass);$("label[for="+G.id+"]").eq(0).addClass(this.defaultValidationErrorLabelClass);this.errors+=B+"\n";this.checkFocus(G)}function cleanAttributeForErrorDisplay(C,A){A=A.toLowerCase();var B="";if(A=="label"){B=$("label[for="+C.id+"]").eq(0).text()}if(A=="description"){B=$("select[id="+C.id+"]").eq(0).attr("description")}if((B==null)||(B=="")){B=C.id}if(B==null){return A}if(A.match(/^(minvalue|maxvalue)$/i)){return B.replace(/[^\d.,]/g,"")}return B}function validateAmount(A){if((!A.match(this.amountPattern))||(A==0)){return false}return true}function validateDate(E,B,C){var D="";if(B){D=B.toLowerCase()}var A=new Date();if((D=="dateyear")&&((C<A.getYear())||(!C.match(this.dateYearPattern)))){return false}else{if((D=="datemonth")&&(!C.match(this.dateMonthPattern))){return false}else{if((D=="dateday")&&(!C.match(this.DateDayPattern))){return false}}}return true}function validateMod10(E){var D=/\D/;var B=E.replace(/ /g,"");if(!D.test(B)){var C;var A=0;while(B.length<16){B="0"+B}for(digitCounter=B.length-1;0<=digitCounter;digitCounter-=2){A+=parseInt(B.charAt(digitCounter));C=String((B.charAt(digitCounter-1)*2));for(var F=0;F<C.length;F++){A+=parseInt(C.charAt(F))}}return(A%10==0)}return false}function validateNumeric(A){A=A.replace(/\s/g,"");if(!A.match(this.numericPattern)){return false}return true}function validateBySelector(A){if(A!=null){var B=new Validate(null,"",errorsHeader,null);B.runBySelector(A);return B.outputErrors()}return true}function validate(C,A,B){if(document.getElementById&&document.createTextNode){if(C.getAttribute){C=C.getAttribute("id").replace(/_\w+$/,"")}var E=new Validate(document.SkySales,C+"_",errorsHeader,B);if(A){var D=A;if(!A.getAttribute){D=document.getElementById(C+"_"+A)}E.validateSingleElement(D);return E.outputErrors()}return E.run()}return true}var submitterClicked=false;function preventDoubleClick(){if(!submitterClicked){submitterClicked=true;return true}return false}var events=new Array();function register(A,B){if(window[events[A]]==null){events[A]=new Array()}events[A][events[A].length]=B}function raise(C,B){var D;if(events[C]!=D){for(var A=0;A<events[C].length;A++){if(window[events[C][A]](B)==false){return false}}}return true}function WindowLoadEventArgs(){}function WindowInitialize(){s2.Logger.debug("WindowInitialize");var A=window.onload;s2.Logger.debug("Fire WindowInitialize ready");raise("WindowLoad",new WindowLoadEventArgs());if(A){A();window.onload=function(){s2.Logger.debug("onload")}}}function displayPopUpConverter(){var A="CurrencyConverter.aspx";if(!window.converterWindow||converterWindow.closed){converterWindow=window.open(A,"converter","width=360,height=300,toolbar=0,status=0,location=0,menubar=0,scrollbars=1,resizable=1")}else{converterWindow.open(A,"converter","width=360,height=300,toolbar=0,status=0,location=0,menubar=0,scrollbars=1,resizable=1");converterWindow.focus()}}function hideShow(A,C){if(document.getElementById&&document.getElementById(A)){var D=A;var B=C;if(document.getElementById(B).checked==true){document.getElementById(D).style.display="inline"}else{document.getElementById(D).style.display="none"}}}var jsLoadedCommon=true;function changeDest(C,I,D){if(!I){s2.Logger.debug("There's no DropDownDest!");return}s2.tuifly.initialize.diff("ChangeDest0");var B=0;var A="";if(typeof s2=="undefined"&&parseInt(C.selectedIndex,10)>0){var E=I.options[0].text;var H=parseInt(C.selectedIndex,10);var F=C.options[H].value;I.length=1;I.options[0]=new Option(E);if(I.requiredempty){I.options[0].value=I.requiredempty}for(var G=0;G<SortedStations.length;G++){for(j=0;j<Stations[F].mkts.length;j++){var J=Stations[F].mkts[j];if(Stations[J]){if((SortedStations[G]==J)&&(Stations[J].validDest==true)){if(J==D){B=I.length}I.length+=1;if(showStationCodes){A=Stations[J].name+" ("+J+")"}else{A=Stations[J].name}I.options[I.length-1]=new Option(A);I.options[I.length-1].value=J;break}}}if(I.length-1==Stations[F].mkts.length){break}}I.selectedIndex=B}else{fillList(I,D)}}var lastListContent;function fillList(G,C){if(!G){s2.Logger.debug("There's no DropDownDest!");return}if((!location.pathname.match(/^\/Select\.aspx/,"i"))&&!location.pathname.match(/Change\.aspx/,"i")&&$(G).attr("id").match(/DropDownListMarketDestination/,"i")){C=""}if(G.options.length>1){$(G).val(C);return}var D=G.options[0]?G.options[0].text:"";if((C=="")&&(G.selectedIndex>-1)){C=G.options[G.selectedIndex].value}var B=0;G.length=1;var I=G.requiredempty?G.requiredempty:"";var K=['<option value="'+I+'">'+D+"</option>"];s2.tuifly.initialize.diff("Filllist0");var A="";for(var F=0;F<SortedStations.length;F++){var J=SortedStations[F];var H=Stations[J];if(!H){continue}if(H.validDest){var E=false;if(C==J){E=true}A=H.name+" ("+J+")";K.push('<option value="'+J+'"'+(E?" selected=selected":"")+">"+A+"</option>")}}s2.tuifly.initialize.diff("Filllist1");G.innerHTML="";$(G).html(K.join(""));s2.tuifly.initialize.diff("Filllist2")}var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(C){var A="";var J,H,F,I,G,E,D;var B=0;C=Base64._utf8_encode(C);while(B<C.length){J=C.charCodeAt(B++);H=C.charCodeAt(B++);F=C.charCodeAt(B++);I=J>>2;G=((J&3)<<4)|(H>>4);E=((H&15)<<2)|(F>>6);D=F&63;if(isNaN(H)){E=D=64}else{if(isNaN(F)){D=64}}A=A+this._keyStr.charAt(I)+this._keyStr.charAt(G)+this._keyStr.charAt(E)+this._keyStr.charAt(D)}return A},decode:function(C){var A="";var J,H,F;var I,G,E,D;var B=0;C=C.replace(/[^A-Za-z0-9\+\/\=]/g,"");while(B<C.length){I=this._keyStr.indexOf(C.charAt(B++));G=this._keyStr.indexOf(C.charAt(B++));E=this._keyStr.indexOf(C.charAt(B++));D=this._keyStr.indexOf(C.charAt(B++));J=(I<<2)|(G>>4);H=((G&15)<<4)|(E>>2);F=((E&3)<<6)|D;A=A+String.fromCharCode(J);if(E!=64){A=A+String.fromCharCode(H)}if(D!=64){A=A+String.fromCharCode(F)}}A=Base64._utf8_decode(A);return A},_utf8_encode:function(B){B=B.replace(/\r\n/g,"\n");var A="";for(var D=0;D<B.length;D++){var C=B.charCodeAt(D);if(C<128){A+=String.fromCharCode(C)}else{if((C>127)&&(C<2048)){A+=String.fromCharCode((C>>6)|192);A+=String.fromCharCode((C&63)|128)}else{A+=String.fromCharCode((C>>12)|224);A+=String.fromCharCode(((C>>6)&63)|128);A+=String.fromCharCode((C&63)|128)}}}return A},_utf8_decode:function(A){var B="";var C=0;var D=c1=c2=0;while(C<A.length){D=A.charCodeAt(C);if(D<128){B+=String.fromCharCode(D);C++}else{if((D>191)&&(D<224)){c2=A.charCodeAt(C+1);B+=String.fromCharCode(((D&31)<<6)|(c2&63));C+=2}else{c2=A.charCodeAt(C+1);c3=A.charCodeAt(C+2);B+=String.fromCharCode(((D&15)<<12)|((c2&63)<<6)|(c3&63));C+=3}}}return B}};function Cookie(){var A=new Date(2030,12,31);Cookie.prototype.work=function(){this.set("test","true");retVal=this.get("test")!=null;this.del("test");return retVal};Cookie.prototype.set=function(B,C){document.cookie=B+"="+C+"; path=/"};Cookie.prototype.setPersistent=function(B,C,D){if(!D){D=A}document.cookie=B+"="+C+"; expires="+D.toGMTString()+"; path=/"};Cookie.prototype.get=function(B){var C=document.cookie.indexOf(B+"=");if(-1!=C){var D=document.cookie.slice(C).indexOf(";");mValue=document.cookie.slice(C+B.length+1,(-1!=D)?D+C:document.cookie.length);return mValue}return null};Cookie.prototype.del=function(B){document.cookie=B+"=; expires="+((new Date((new Date()).getTime()+(-10000))).toGMTString())+"; path=/"}}cookie=new Cookie();var previousPromoCode="";function promoCodes_ValidatePromoCodeForSubmit(){if(document.getElementById(applicationJavaScriptHtmlId+"_TextBoxPromoCode")!=null&&promoCodes_ValidatePromoCode()==false){document.getElementById(applicationJavaScriptHtmlId+"_TextBoxPromoCode").value=""}return true}function promoCodes_ValidatePromoCodeForFlightChange(){promoCodes_ValidatePromoCode();return true}function promoCodes_ValidatePromoCode(){var B=document.getElementById(applicationJavaScriptHtmlId+"_TextBoxPromoCode");if(B!=null){var H=B.value}if(H!=undefined){previousPromoCode=H;if(H.length>=6){promoCode=H.toLowerCase();var F=GetSelectedValue(applicationJavaScriptHtmlId+"_DropDownListMarketOrigin1")+"-"+GetSelectedValue(applicationJavaScriptHtmlId+"_DropDownListMarketDestination1");var A=GetSelectedValue(applicationJavaScriptHtmlId+"_DropDownListMarketDestination1")+"-"+GetSelectedValue(applicationJavaScriptHtmlId+"_DropDownListMarketOrigin1");var G=GetSelectedValue(applicationJavaScriptHtmlId+"_DropDownListMarketMonth1")+"-"+GetSelectedValue(applicationJavaScriptHtmlId+"_DropDownListMarketDay1")+" 00:00:00";if(PromoCodes[promoCode]==undefined){txtInvalidPromoDisplay=txtInvalidPromo;togglePromoCodeIcon("invalid");return false}else{txtValidPromoDisplay=txtValidPromo;if(G>=PromoCodes[promoCode].travelDateRangeBegin&&(G<=PromoCodes[promoCode].travelDateRangeEnd||PromoCodes[promoCode].travelDateRangeEnd=="")){if(PromoCodes[promoCode].routes.length>0){var E=" ";for(var D in PromoCodes[promoCode].routes){var C=PromoCodes[promoCode].routes[D];if(C==F||C==A){togglePromoCodeIcon("valid");return true}(E!=" ")?E+=", "+C:E+=C}txtValidPromoButRouteDisplay=txtValidPromoButRoute;togglePromoCodeIcon("validButRoute");return true}togglePromoCodeIcon("valid");return true}txtValidPromoButDateDisplay=txtValidPromoButDate;togglePromoCodeIcon("validButDate");return true}}else{togglePromoCodeIcon("")}}return true}function togglePromoCodeIcon(A){if(A=="valid"){document.getElementById(applicationJavaScriptHtmlId+"_PromoCodeValid").style.display="inline";document.getElementById(applicationJavaScriptHtmlId+"_PromoCodeValidButDate").style.display="none";document.getElementById(applicationJavaScriptHtmlId+"_PromoCodeValidButRoute").style.display="none";document.getElementById(applicationJavaScriptHtmlId+"_PromoCodeInvalid").style.display="none"}else{if(A=="validButDate"){document.getElementById(applicationJavaScriptHtmlId+"_PromoCodeValid").style.display="none";document.getElementById(applicationJavaScriptHtmlId+"_PromoCodeValidButDate").style.display="inline";document.getElementById(applicationJavaScriptHtmlId+"_PromoCodeValidButRoute").style.display="none";document.getElementById(applicationJavaScriptHtmlId+"_PromoCodeInvalid").style.display="none"}else{if(A=="validButRoute"){document.getElementById(applicationJavaScriptHtmlId+"_PromoCodeValid").style.display="none";document.getElementById(applicationJavaScriptHtmlId+"_PromoCodeValidButDate").style.display="none";document.getElementById(applicationJavaScriptHtmlId+"_PromoCodeValidButRoute").style.display="inline";document.getElementById(applicationJavaScriptHtmlId+"_PromoCodeInvalid").style.display="none"}else{if(A=="invalid"){document.getElementById(applicationJavaScriptHtmlId+"_PromoCodeValid").style.display="none";document.getElementById(applicationJavaScriptHtmlId+"_PromoCodeValidButDate").style.display="none";document.getElementById(applicationJavaScriptHtmlId+"_PromoCodeValidButRoute").style.display="none";document.getElementById(applicationJavaScriptHtmlId+"_PromoCodeInvalid").style.display="inline"}else{document.getElementById(applicationJavaScriptHtmlId+"_PromoCodeValid").style.display="none";document.getElementById(applicationJavaScriptHtmlId+"_PromoCodeValidButDate").style.display="none";document.getElementById(applicationJavaScriptHtmlId+"_PromoCodeValidButRoute").style.display="none";document.getElementById(applicationJavaScriptHtmlId+"_PromoCodeInvalid").style.display="none"}}}}}function getElement(A){if(document.all){return document.all[A]}else{return document.getElementById(A)}}function toggleVisibility(B){var A=getElement(B);if(A){if(A.style.display=="none"){A.style.display="block"}else{A.style.display="none"}}}function setVisibility(C,A){var B=getElement(C);if(B){if(A){B.style.display="block"}else{B.style.display="none"}}}function showSSRsExtra(){if(document.getElementById("outerDivSSRs").style.display=="none"){document.getElementById("outerDivSSRs").style.display="block";document.getElementById("showSSRs").checked=true}else{document.getElementById("outerDivSSRs").style.display="none";document.getElementById("showSSRs").checked=false}}function showDetail(A,B){if(document.getElementById(A).style.display=="none"){document.getElementById(A).style.display="block";document.getElementById(B).src="/skyres/images/icon_minus.gif"}else{document.getElementById(A).style.display="none";document.getElementById(B).src="/skyres/images/icon_plus.gif"}}function switchLanguage(E){var D=location.pathname.split("/");var C=D[1];var B=E.split("/");var A=B[1];if(C=="de"&&A=="de"){if(B[2].indexOf("_at.")!=-1){document.cookie="userLang=at;"}else{document.cookie="userLang=de;"}}else{if(C=="en"&&A=="en"){if(B[2].indexOf("_ire.")!=-1){document.cookie="userLang=ire;"}else{document.cookie="userLang=en;"}}}document.location.href=E}function registerNewsletter(I,H,F,G,C,B,E,A){var J=new Image();var D="/cgi-bin/newsletter.pl?";D=D+"email="+encodeURI(I);D=D+"&sex="+encodeURI(H);D=D+"&firstname="+encodeURI(F);D=D+"&lastname="+encodeURI(G);D=D+"&country="+encodeURI(C);D=D+"&airport="+encodeURI(B);D=D+"&language="+encodeURI(E);D=D+"&source="+encodeURI(A);J.src=D}function gotoInterrent(){var A="http://www.interrent.de/innsbruck/hlx/Homepage.do";window.open(A,"blank")}function showFlugziel(A){if(flugziele[A]){top.location.href=flugziele[A]}else{alert(message.noDestPage)}}function showWeinziel(A){if(weinziele[A]){top.location.href=weinziele[A]}else{alert(message.noDestWinePage)}}function popup(url,name,param){var sizeX=0;var sizeY=0;var winX=screen.availWidth;var winY=screen.availHeight;var tmpArray=param.split(",");for(i=0;i<tmpArray.length;i++){if(tmpArray[i].indexOf("width")!=-1){tmpArray2=tmpArray[i].split("=");sizeX=tmpArray2[1]}if(tmpArray[i].indexOf("height")!=-1){tmpArray2=tmpArray[i].split("=");sizeY=tmpArray2[1]}}var centerX=eval(winX/2-sizeX/2);var centerY=eval(winY/2-sizeY/2);param+=",top="+centerY+",left="+centerX;var winChild=window.open(url,name,param+",dependent=yes");if(winChild!=null&&winChild.focus){winChild.focus()}}function switchFormToDynamic(A){return}function buildLink(E,F){var C=E;var B=document.location.href.match(/^(http[s]?):\/\/([^\/]*)(\/.*)$/i);if(B!=null){var G=B[1];var H=B[2];var I=B[3];var D=I.lastIndexOf("/");var A=I.substring(0,D+1);B=H.match(/^([^:]*):[0-9]*$/);if(B!=null){H=B[1]}B=C.match(/^(http[s]?):\/\/([^\/]*)(\/.*)$/i);if(B!=null){G=B[1];C=B[3]}if(C.charAt(0)!="/"){C=A+C}if(G=="https"){if(F){H=document.dynamic_server_ssl}else{H=document.static_server_ssl}}else{if(F){H=document.dynamic_server}else{H=document.static_server}}C=H+C}return C}function openAuto(B,A){if(B=="PMI"){top.location.href=url_auto+"?TUIMietwagen&Land=Spanien&Ort=Mallorca"}else{if(B=="TURBO"){top.location.href=url_auto+"?MCS="+A}else{top.location.href=url_auto+"?locale=DE&MCS=https://microsite.europcar.com/hapaglloydexpress&IATA=0677316&PROMO=41113594&FTPROG=false&CNTRY=DE&STATIONCO="+autoCodes[B]+"&ACRISS=C"}}}function openHotel(A){if(A=="BRI"){A="Apulien & Molise"}else{if(A=="TXL"){A="Berlin"}else{if(A=="BIO"){A="Baskenland / País Vasco"}else{if(A=="CVT"){A="England / West Midlands"}else{if(A=="DUB"){A="Osten / Leinster / Dublin & Umgebung"}else{if(A=="EDI"){A="Schottland"}else{if(A=="HAM"){A="Hamburg"}else{if(A=="HAJ"){A="Hannover & Umgebung"}else{if(A=="KLU"){A="Kärnten & Osttirol"}else{if(A=="CGN"){A="Köln"}else{if(A=="BGY"){A="Northern Italy / Milan & environs"}else{if(A=="PMI"){A="Balearen / Mallorca"}else{if(A=="MAN"){A="England / Nordwesten"}else{if(A=="MRS"){A="Provence-Alpes-Côte d'Azur"}else{if(A=="MUC"){A="Bayern / München & Umgebung"}else{if(A=="NAP"){A="Kampanien / Neapel & Umgebung"}else{if(A=="NCL"){A="England / Nordosten / Northumberland"}else{if(A=="OLB"){A="Sardinien (Norden)"}else{if(A=="PMO"){A="Sizilien / Palermo & Umgebung"}else{if(A=="PSA"){A="Toskana"}else{if(A=="CIA"){A="Latium / Rom & Umgebung"}else{if(A=="RJK"){A="Kvarner Bucht / Rijeka"}else{if(A=="SZG"){A="Salzburg Stadt"}else{if(A=="STR"){A="Stuttgart & Umgebung"}else{if(A=="ARN"){A="Stockholm & Umgebung"}else{if(A=="SNN"){A="Süden / Munster"}else{if(A=="VLC"){A="Valencia & Umgebung"}else{if(A=="VCE"){A="Venetien & Friaul-Julisch Venetien"}}}}}}}}}}}}}}}}}}}}}}}}}}}}A=escape(A);top.location.href=url_hotel+"?Hotelportal&Reiseziel="+A}function openHotelEn(A){if(A=="BRI"){A="Apulia"}else{if(A=="TXL"){A="Berlin"}else{if(A=="BIO"){A="Baskenland / País Vasco"}else{if(A=="CVT"){A="England / West Midlands"}else{if(A=="DUB"){A="East / Leinster"}else{if(A=="EDI"){A="Edinburgh"}else{if(A=="HAM"){A="Hamburg"}else{if(A=="HAJ"){A="Hanover"}else{if(A=="KLU"){A="Carinthia & Eastern Tyrol"}else{if(A=="CGN"){A="Cologne"}else{if(A=="BGY"){A="Northern Italy / Milan & environs"}else{if(A=="PMI"){A="Balearic Islands / Majorca"}else{if(A=="MAN"){A="England / North West"}else{if(A=="MRS"){A="Provence-Alpes-Côte d'Azur "}else{if(A=="MUC"){A="Munich & environment"}else{if(A=="NAP"){A="Naples & environs"}else{if(A=="NCL"){A="England / North East / Northumberland"}else{if(A=="OLB"){A="Sardinia (Northern parts)"}else{if(A=="PMO"){A="Sicily / Palermo & environs"}else{if(A=="PSA"){A="Tuscany"}else{if(A=="CIA"){A="Lazio / Rome"}else{if(A=="RJK"){A="Kvarn Bay / Rijeka"}else{if(A=="SZG"){A="Salzburg City"}else{if(A=="STR"){A="Stuttgart"}else{if(A=="ARN"){A="Stockholm"}else{if(A=="SNN"){A="South / Munster"}else{if(A=="VLC"){A="Valencia"}else{if(A=="VCE"){A="Venice & environs"}}}}}}}}}}}}}}}}}}}}}}}}}}}}A=escape(A);top.location.href=url_hotel+"?Hotelportal&Locale=en_GB&Reiseziel="+A}function openFlugHotel(A){top.location.href=url_flugHotel+"?cid=HLX.LOC.0001&_cmd=start.locomat.query&_destination="+A}function openFerienwohnung(A){if(interhome[A]){if(interhome[A].indexOf("countrycode")!=-1){top.location.href=url_ferienwohnungen+"?so=59&userlang=01&partnerid=590794&css_style=partner_css_590794_.css&ihnav=N"+interhome[A]}if(interhome[A].indexOf("dummya=50519")!=-1){top.location.href=url_ferienwohnungen+"?"+interhome[A]}}else{top.location.href=url_ferienwohnungen}}function submitForm_ferienwohnung(){formular=document.fewo;code=formular.destination[formular.destination.selectedIndex].value;if(interhome[code]){if(interhome[code].indexOf("countrycode")!=-1){this.location.href="http://www.interhome.de/buchung/main_miniprice.asp?userlang=01&so=59&partnerid=590794&css_style=partner_css_590794_.css&ihnav=N"+interhome[code]}if(interhome[code].indexOf("dummya=50519")!=-1){this.location.href="http://www.ferienhaus-allianz.de/cgi-bin/1_1_fh_angebotsselekt_grob?"+interhome[code]}}}function isValidDate(D){var A=D.substring(6,8);var E=D.substring(4,6);var C=D.substring(0,4);var B;B=new Date(C,E-1,A);return((A==B.getDate())&&(E==B.getMonth()+1)&&(C==B.getFullYear()))}function openTiefstpreisseite(A){if(A){top.location.href=url_tiefstpreisseite+"&destination="+A}else{top.location.href=url_tiefstpreisseite}}function addon(){var A=document.itinerary_info.contact_name.value.split("|");var C=unescape(A[1]);var B=unescape(A[0]);var H=document.itinerary_info.contact_address1.value;var E=document.itinerary_info.contact_address1.value;var F=H.lastIndexOf(" ");if(F!=-1){var K=H.length;var L=unescape(H.substring(0,F));++F;var M=unescape(E.substring(F,K))}else{L=H;M=""}var G=document.itinerary_info.contact_zip.value;var D=document.itinerary_info.contact_city.value;var I=document.itinerary_info.contact_phone.value;var J=document.itinerary_info.email.value;var N="/de/7392.html?vorname="+C+"&nachname="+B+"&str="+L+"&nr="+M+"&plz="+G+"&ort="+D+"&phone="+I+"&email="+J;popup(N,"popup","width=743,height=560,scrollbars=yes")}var plzArray=new Array(30159,30161,30163,30165,30167,30169,30171,30173,30175,30177,30179,30419,30449,30451,30453,30455,30457,30459,30519,30539,30559,30625,30627,30629,30655,30657,30659,30823,30826,30827,30851,30853,30855,30880,30890,30900,30916,30926,30938,30952,30966,30974,30982,30989,31275,31303,31311,31319,31515,31535,31832,31848,31157);function checkPlzArray(B){var A;for(A=0;A<plzArray.length;A++){if(plzArray[A]==B){return true}}return false}function addTimeToDate(time,diff){var futureDate="";var neuesDatum=new Date(Date.parse(time)+diff);futureDate+=neuesDatum.getFullYear();tempDate="0"+eval(neuesDatum.getMonth()+1);futureDate+=tempDate.substr(tempDate.length-2,2);tempDate="0"+neuesDatum.getDate();futureDate+=tempDate.substr(tempDate.length-2,2);tempDate="0"+neuesDatum.getHours();futureDate+=tempDate.substr(tempDate.length-2,2);tempDate="0"+neuesDatum.getMinutes();futureDate+=tempDate.substr(tempDate.length-2,2);return futureDate}function timeToStandardTime(F){var E=F.substring(0,4);var D=F.substring(4,6);var C=F.substring(6,8);var H=F.substring(8,10);var B=F.substring(10,12);var A=monthName[D];var G=C+" "+A+" "+E+" "+H+":"+B;return G}function mediaSubmit(){var A="";if(document.myForm.first_name.value==""||document.myForm.last_name.value==""||document.myForm.email.value==""){A=message.errorAddress;if(document.myForm.first_name.value==""){A+=message.errorSurname}if(document.myForm.last_name.value==""){A+=message.errorLastname}if(document.myForm.email.value==""){A+=message.errorMail}alert(A)}else{if(document.myForm.email.value.indexOf("@")==-1||document.myForm.email.value.indexOf(".")==-1){A+=message.errorMail2;alert(A)}else{document.myForm.submit()}}}function checkCookieStatus(){if(!document.cookie){alert(message.noCookiesEnabled);return false}else{return true}}function captureDates(){oDay=document.getElementById(applicationJavaScriptHtmlId+"_DropDownListMarketDay1").options[document.getElementById(applicationJavaScriptHtmlId+"_DropDownListMarketDay1").selectedIndex].value;oMonth=document.getElementById(applicationJavaScriptHtmlId+"_DropDownListMarketMonth1").options[document.getElementById(applicationJavaScriptHtmlId+"_DropDownListMarketMonth1").selectedIndex].value.substring(5,7);oYear=document.getElementById(applicationJavaScriptHtmlId+"_DropDownListMarketMonth1").options[document.getElementById(applicationJavaScriptHtmlId+"_DropDownListMarketMonth1").selectedIndex].value.substring(0,4);rDay=document.getElementById(applicationJavaScriptHtmlId+"_DropDownListMarketDay2").options[document.getElementById(applicationJavaScriptHtmlId+"_DropDownListMarketDay2").selectedIndex].value;rMonth=document.getElementById(applicationJavaScriptHtmlId+"_DropDownListMarketMonth2").options[document.getElementById(applicationJavaScriptHtmlId+"_DropDownListMarketMonth2").selectedIndex].value.substring(5,7);rYear=document.getElementById(applicationJavaScriptHtmlId+"_DropDownListMarketMonth2").options[document.getElementById(applicationJavaScriptHtmlId+"_DropDownListMarketMonth2").selectedIndex].value.substring(0,4)}function changeReturnDate(A){if(A==(applicationJavaScriptHtmlId+"_DropDownListMarketMonth1")||A==(applicationJavaScriptHtmlId+"_DropDownListMarketDay1")){captureDates();if(rDay!=0){if((rMonth<oMonth&&rYear==oYear)||rYear<oYear){document.getElementById(applicationJavaScriptHtmlId+"_DropDownListMarketMonth2").options.selectedIndex=document.getElementById(applicationJavaScriptHtmlId+"_DropDownListMarketMonth1").options.selectedIndex;document.getElementById(applicationJavaScriptHtmlId+"_DropDownListMarketDay2").options.selectedIndex=document.getElementById(applicationJavaScriptHtmlId+"_DropDownListMarketDay1").options.selectedIndex}else{if(rDay<oDay&&rMonth==oMonth&&rYear==oYear){document.getElementById(applicationJavaScriptHtmlId+"_DropDownListMarketDay2").options.selectedIndex=document.getElementById(applicationJavaScriptHtmlId+"_DropDownListMarketDay1").options.selectedIndex}}}}}function limitMonth(B){var D=11;var F=2009;var A=new Date();var E=A.getMonth();var C=A.getYear();if(C<999){C+=1900}if(C<F){D=D+(12*(F-C))}limit=D-E;if(B){if(limit<B.options.length){numDeleteItems=B.options.length-limit;for(i=0;i<numDeleteItems;i++){B.remove(B.options.length-1)}}}}function calendarFillPulldowns(D,G){var A=D.getDate()-1;var F=D.getMonth()+1;if(F<10){F="0"+F}var C=D.getFullYear()+"-"+F;var E=false;document.getElementById(applicationJavaScriptHtmlId+"_DropDownListMarketDay"+G).selectedIndex=A;for(var B=0;B<document.getElementById(applicationJavaScriptHtmlId+"_DropDownListMarketMonth"+G).length;B++){if(document.getElementById(applicationJavaScriptHtmlId+"_DropDownListMarketMonth"+G)[B].value==C){document.getElementById(applicationJavaScriptHtmlId+"_DropDownListMarketMonth"+G).selectedIndex=B;E=true}}if(E==false){alert(message.noFlightFound)}}var submitterClickedS2S=false;function preventDoubleClickS2S(){var B=document.SkySales;var A=B["CONTROLGROUPPAYMENT$PAYMENTINPUT$DropDownListPaymentMethodCode"];if(!A){return true}else{if(A.value!="ExternalAccount:AA"){if(!submitterClickedS2S){submitterClickedS2S=true;return true}return false}}}function write_control(A){document.write(A)}function showRabattLayer(A){if((self.location.href.indexOf("/de/")>=0)&&((referrerId.indexOf("Select.aspx")>=0)||(referrerId.indexOf("Contact.aspx")>=0)||(referrerId.indexOf("Payment.aspx")>=0))){}}function validateHAJCIAFCO(){var C=document.SkySales;var B=GetValue(C[applicationJavaScriptHtmlId+"_DropDownListMarketOrigin1"]);var F=GetValue(C[applicationJavaScriptHtmlId+"_DropDownListMarketDestination1"]);if(B!="HAJ"&&B!="CIA"&&B!="FCO"&&F!="HAJ"&&F!="CIA"&&F!="FCO"){return true}var E=new Array();for(var A=1;A<=numDatesToValidate;A++){if(MarketAction[A]=="Cancel"){continue}if(!validateElement("DropDownListMarketDay"+A)){continue}var G=C[applicationJavaScriptHtmlId+"_DropDownListMarketDay"+A].options[C[applicationJavaScriptHtmlId+"_DropDownListMarketDay"+A].selectedIndex].value;var D=C[applicationJavaScriptHtmlId+"_DropDownListMarketMonth"+A].options[C[applicationJavaScriptHtmlId+"_DropDownListMarketMonth"+A].selectedIndex].value.substring(5,7);var H=C[applicationJavaScriptHtmlId+"_DropDownListMarketMonth"+A].options[C[applicationJavaScriptHtmlId+"_DropDownListMarketMonth"+A].selectedIndex].value.substring(0,4);E[A]=""+H+D+G}if(numDatesToValidate==1){if(E[1]>"20071027"&&(B=="CIA"||F=="CIA")){alert(message.HanRomNoCIA);return false}else{if(E[1]<"20071030"&&(B=="FCO"||F=="FCO")){alert(message.HanRomNoFCO);return false}}}else{if(numDatesToValidate==2){if((E[1]>"20071027"&&E[2]>"20071027")&&(B=="CIA"||F=="CIA")){alert(message.HanRomNoCIA);return false}else{if((E[1]<"20071030"&&E[2]<"20071030")&&(B=="FCO"||F=="FCO")){alert(message.HanRomNoFCO);return false}else{if((E[1]<"20071030"&&E[2]>"20071027")&&(B=="CIA"||F=="CIA")){alert(message.HanRomNoCIA2);return false}else{if((E[1]<"20071030"&&E[2]>"20071027")&&(B=="FCO"||F=="FCO")){alert(message.HanRomNoFCO2);return false}}}}}}return true}function validateCTAReroutedPMO(){var C=document.SkySales;var B=GetValue(C[applicationJavaScriptHtmlId+"_DropDownListMarketOrigin1"]);var F=GetValue(C[applicationJavaScriptHtmlId+"_DropDownListMarketDestination1"]);if(B!="CTA"&&F!="CTA"){return true}var E=new Array();for(var A=1;A<=numDatesToValidate;A++){if(MarketAction[A]=="Cancel"){continue}if(!validateElement("DropDownListMarketDay"+A)){continue}var G=C[applicationJavaScriptHtmlId+"_DropDownListMarketDay"+A].options[C[applicationJavaScriptHtmlId+"_DropDownListMarketDay"+A].selectedIndex].value;var D=C[applicationJavaScriptHtmlId+"_DropDownListMarketMonth"+A].options[C[applicationJavaScriptHtmlId+"_DropDownListMarketMonth"+A].selectedIndex].value.substring(5,7);var H=C[applicationJavaScriptHtmlId+"_DropDownListMarketMonth"+A].options[C[applicationJavaScriptHtmlId+"_DropDownListMarketMonth"+A].selectedIndex].value.substring(0,4);E[A]=""+H+D+G}if(numDatesToValidate==1){if(E[1]=="20080514"&&(B=="CGN"||B=="HAJ"||F=="CGN"||F=="HAJ")){return handleCTAReroutedPMOChoice(B,F)}else{if(E[1]=="20080515"&&(B=="HAM"||B=="MUC"||F=="HAM"||F=="MUC")){return handleCTAReroutedPMOChoice(B,F)}}}else{if(numDatesToValidate==2){if((E[1]=="20080514"||E[2]=="20080514")&&(B=="CGN"||B=="HAJ"||F=="CGN"||F=="HAJ")){return handleCTAReroutedPMOChoice(B,F)}else{if((E[1]=="20080515"||E[2]=="20080515")&&(B=="HAM"||B=="MUC"||F=="HAM"||F=="MUC")){return handleCTAReroutedPMOChoice(B,F)}}}}return true}function handleCTAReroutedPMOChoice(C,E){var D=document.SkySales;if(confirm(message.CTAReroutedPMO)){if(C=="CTA"){var B=D[applicationJavaScriptHtmlId+"_DropDownListMarketOrigin1"];var G=D[applicationJavaScriptHtmlId+"_DropDownListMarketDestination1"];for(var A=0;A<B.length;A++){if(B[A].value=="PMO"){B.selectedIndex=A;for(var F=0;F<G.length;F++){if(G[F].value==E){G.selectedIndex=F;break}}break}}}else{if(E=="CTA"){var G=D[applicationJavaScriptHtmlId+"_DropDownListMarketDestination1"];for(var A=0;A<G.length;A++){if(G[A].value=="PMO"){G.selectedIndex=A;break}}}}return true}return false}function validateForAllYouCanFly(){var F=message.lateAllYouCanFly;var C=document.SkySales;var H=C[applicationJavaScriptHtmlId+"_DropDownListMarketMonth1"].value.substring(0,4)+C[applicationJavaScriptHtmlId+"_DropDownListMarketMonth1"].value.substring(5,7)+C[applicationJavaScriptHtmlId+"_DropDownListMarketDay1"].value;var A=new Date().getTime();A+=5*24*60*60*1000;A=new Date(A);var E=String(A.getDate());if(E.length==1){E="0"+E}var D=String(A.getMonth()+1);if(D.length==1){D="0"+D}var G=String(A.getFullYear());A=G+D+E;if(H>A){alert(F);A=new Date().getTime();A+=2*24*60*60*1000;A=new Date(A);E=String(A.getDate());if(E.length==1){E="0"+E}D=String(A.getMonth()+1);if(D.length==1){D="0"+D}G=String(A.getFullYear());C[applicationJavaScriptHtmlId+"_DropDownListMarketDay1"].value=E;C[applicationJavaScriptHtmlId+"_DropDownListMarketMonth1"].value=G+"-"+D;return false}var I=GetMarketStructure()!="OneWay";if(I){var B=C[applicationJavaScriptHtmlId+"_DropDownListMarketMonth2"].value.substring(0,4)+C[applicationJavaScriptHtmlId+"_DropDownListMarketMonth2"].value.substring(5,7)+C[applicationJavaScriptHtmlId+"_DropDownListMarketDay2"].value;if(B>A){alert(F);A=new Date().getTime();A+=5*24*60*60*1000;A=new Date(A);E=String(A.getDate());if(E.length==1){E="0"+E}D=String(A.getMonth()+1);if(D.length==1){D="0"+D}G=String(A.getFullYear());C[applicationJavaScriptHtmlId+"_DropDownListMarketDay2"].value=E;C[applicationJavaScriptHtmlId+"_DropDownListMarketMonth2"].value=G+"-"+D;return false}}return true}function checkAvailability(){if(!validateHAJCIAFCO()){return false}if(!validateCTAReroutedPMO()){return false}var F=message.fleugplaneinschraenkung_priorPrefix;var R=message.fleugplaneinschraenkung_priorInfixTo;var U=message.fleugplaneinschraenkung_priorInfixDate;var Q=message.fleugplaneinschraenkung_priorSuffix;var H=message.fleugplaneinschraenkung_laterPrefix;var O=message.fleugplaneinschraenkung_laterInfixTo;var V=message.fleugplaneinschraenkung_laterInfixDate;var T=message.fleugplaneinschraenkung_laterSuffix;var L=document.SkySales;var G=L[applicationJavaScriptHtmlId+"_DropDownListMarketMonth1"].options[L[applicationJavaScriptHtmlId+"_DropDownListMarketMonth1"].selectedIndex].value.substring(0,4)+L[applicationJavaScriptHtmlId+"_DropDownListMarketMonth1"].options[L[applicationJavaScriptHtmlId+"_DropDownListMarketMonth1"].selectedIndex].value.substring(5,7)+L[applicationJavaScriptHtmlId+"_DropDownListMarketDay1"].options[L[applicationJavaScriptHtmlId+"_DropDownListMarketDay1"].selectedIndex].value;var C=GetMarketStructure()!="OneWay";var I=L[applicationJavaScriptHtmlId+"_DropDownListMarketOrigin1"].options[L[applicationJavaScriptHtmlId+"_DropDownListMarketOrigin1"].selectedIndex].value;var A=L[applicationJavaScriptHtmlId+"_DropDownListMarketDestination1"].options[L[applicationJavaScriptHtmlId+"_DropDownListMarketDestination1"].selectedIndex].value;var W=L[applicationJavaScriptHtmlId+"_DropDownListMarketOrigin1"].options[L[applicationJavaScriptHtmlId+"_DropDownListMarketOrigin1"].selectedIndex].text;var M=L[applicationJavaScriptHtmlId+"_DropDownListMarketDestination1"].options[L[applicationJavaScriptHtmlId+"_DropDownListMarketDestination1"].selectedIndex].text;var S=true;var E=checkAvailabilityDate(I,A,G);if(E!=""){var D=E.slice(6,8)+"."+E.slice(4,6)+"."+E.slice(0,4);if(G<E){s2.tuifly.widget.dialog.alertNotice(F+W+R+M+U+D+Q)}else{s2.tuifly.widget.dialog.alertNotice(H+W+O+M+V+D+T)}S=false;var K=E.slice(6,8);var N=E.slice(0,4)+"-"+E.slice(4,6);var P;for(P=0;P<L[applicationJavaScriptHtmlId+"_DropDownListMarketMonth1"].options.length;P++){if(L[applicationJavaScriptHtmlId+"_DropDownListMarketMonth1"].options[P].value==N){L[applicationJavaScriptHtmlId+"_DropDownListMarketMonth1"].selectedIndex=P;$(L[applicationJavaScriptHtmlId+"_DropDownListMarketMonth1"]).change()}}for(P=0;P<L[applicationJavaScriptHtmlId+"_DropDownListMarketDay1"].options.length;P++){if(L[applicationJavaScriptHtmlId+"_DropDownListMarketDay1"].options[P].value==K){L[applicationJavaScriptHtmlId+"_DropDownListMarketDay1"].selectedIndex=P;$(L[applicationJavaScriptHtmlId+"_DropDownListMarketDay1"]).change()}}if(C){var J=L[applicationJavaScriptHtmlId+"_DropDownListMarketMonth2"].options[L[applicationJavaScriptHtmlId+"_DropDownListMarketMonth2"].selectedIndex].value.substring(0,4)+L[applicationJavaScriptHtmlId+"_DropDownListMarketMonth2"].options[L[applicationJavaScriptHtmlId+"_DropDownListMarketMonth2"].selectedIndex].value.substring(5,7)+L[applicationJavaScriptHtmlId+"_DropDownListMarketDay2"].options[L[applicationJavaScriptHtmlId+"_DropDownListMarketDay2"].selectedIndex].value;if(J<E){for(P=0;P<L[applicationJavaScriptHtmlId+"_DropDownListMarketMonth2"].options.length;P++){if(L[applicationJavaScriptHtmlId+"_DropDownListMarketMonth2"].options[P].value==N){L[applicationJavaScriptHtmlId+"_DropDownListMarketMonth2"].selectedIndex=P;$(L[applicationJavaScriptHtmlId+"_DropDownListMarketMonth2"]).change()}}for(P=0;P<L[applicationJavaScriptHtmlId+"_DropDownListMarketDay2"].options.length;P++){if(L[applicationJavaScriptHtmlId+"_DropDownListMarketDay2"].options[P].value==K){L[applicationJavaScriptHtmlId+"_DropDownListMarketDay2"].selectedIndex=P;$(L[applicationJavaScriptHtmlId+"_DropDownListMarketDay2"]).change()}}}}}else{var B=getAvailabilitySearchRange(I,A,G);for(element in L.elements){if(element.type=="hidden"&&element.name.indexof("_DropDownListMarketDateRange1")>-1){element.value=B;break}}}if(C){var J=L[applicationJavaScriptHtmlId+"_DropDownListMarketMonth2"].options[L[applicationJavaScriptHtmlId+"_DropDownListMarketMonth2"].selectedIndex].value.substring(0,4)+L[applicationJavaScriptHtmlId+"_DropDownListMarketMonth2"].options[L[applicationJavaScriptHtmlId+"_DropDownListMarketMonth2"].selectedIndex].value.substring(5,7)+L[applicationJavaScriptHtmlId+"_DropDownListMarketDay2"].options[L[applicationJavaScriptHtmlId+"_DropDownListMarketDay2"].selectedIndex].value;E=checkAvailabilityDate(A,I,J);if(E!=""){var D=E.slice(6,8)+"."+E.slice(4,6)+"."+E.slice(0,4);if(J<E){s2.tuifly.widget.dialog.alertNotice(F+M+R+W+U+D+Q)}else{s2.tuifly.widget.dialog.alertNotice(H+M+O+W+V+D+T)}S=false;var K=E.slice(6,8);var N=E.slice(0,4)+"-"+E.slice(4,6);var P;for(P=0;P<L[applicationJavaScriptHtmlId+"_DropDownListMarketMonth2"].options.length;P++){if(L[applicationJavaScriptHtmlId+"_DropDownListMarketMonth2"].options[P].value==N){L[applicationJavaScriptHtmlId+"_DropDownListMarketMonth2"].selectedIndex=P}}for(P=0;P<L[applicationJavaScriptHtmlId+"_DropDownListMarketDay2"].options.length;P++){if(L[applicationJavaScriptHtmlId+"_DropDownListMarketDay2"].options[P].value==K){L[applicationJavaScriptHtmlId+"_DropDownListMarketDay2"].selectedIndex=P}}}else{var B=getAvailabilitySearchRange(A,I,J);for(element in L.elements){if(element.type=="hidden"&&element.name.indexof("_DropDownListMarketDateRange2")>-1){element.value=B;break}}}}return S}function checkAvailabilityGroups(){var F=message.fleugplaneinschraenkung_priorPrefix;var R=message.fleugplaneinschraenkung_priorInfixTo;var U=message.fleugplaneinschraenkung_priorInfixDate;var Q=message.fleugplaneinschraenkung_priorSuffix;var H=message.fleugplaneinschraenkung_laterPrefix;var O=message.fleugplaneinschraenkung_laterInfixTo;var V=message.fleugplaneinschraenkung_laterInfixDate;var T=message.fleugplaneinschraenkung_laterSuffix;var L=document["groupbooking.presentation.requestForm"];var G=L.year_o.options[L.year_o.selectedIndex].value.substring(0,4)+L.year_o.options[L.year_o.selectedIndex].value.substring(4,6)+L.day_o.options[L.day_o.selectedIndex].value;var D="";if(document.getElementById("travel_type2").checked){D="OneWay"}else{D="RoundTrip"}var B=D!="OneWay";var I=L.sector1_o.options[L.sector1_o.selectedIndex].value;var A=L.sector1_d.options[L.sector1_d.selectedIndex].value;var W=L.sector1_o.options[L.sector1_o.selectedIndex].text;var M=L.sector1_d.options[L.sector1_d.selectedIndex].text;var S=true;var E=checkAvailabilityDate(I,A,G);if(E!=""){var C=E.slice(6,8)+"."+E.slice(4,6)+"."+E.slice(0,4);if(G<E){s2.tuifly.widget.dialog.alertNotice(F+W+R+M+U+C+Q)}else{s2.tuifly.widget.dialog.alertNotice(H+W+O+M+V+C+T)}S=false;var K=E.slice(6,8);var N=E.slice(0,4)+E.slice(4,6);var P;for(P=0;P<L.year_o.options.length;P++){if(L.year_o.options[P].value==N){L.year_o.selectedIndex=P}}for(P=0;P<L.day_o.options.length;P++){if(L.day_o.options[P].value==K){L.day_o.selectedIndex=P}}if(B){var J=L.year_d.options[L.year_d.selectedIndex].value.substring(0,4)+L.year_d.options[L.year_d.selectedIndex].value.substring(4,6)+L.day_d.options[L.day_d.selectedIndex].value;if(J<E){for(P=0;P<L.year_d.options.length;P++){if(L.year_d.options[P].value==N){L.year_d.selectedIndex=P}}for(P=0;P<L.day_d.options.length;P++){if(L.day_d.options[P].value==K){L.day_d.selectedIndex=P}}}}}if(B){var J=L.year_d.options[L.year_d.selectedIndex].value.substring(0,4)+L.year_d.options[L.year_d.selectedIndex].value.substring(4,6)+L.day_d.options[L.day_d.selectedIndex].value;if(J<G){alert(localizedTextEarlierDatePre)}E=checkAvailabilityDate(A,I,J);if(E!=""){var C=E.slice(6,8)+"."+E.slice(4,6)+"."+E.slice(0,4);if(J<E){s2.tuifly.widget.dialog.alertNotice(F+M+R+W+U+C+Q)}else{s2.tuifly.widget.dialog.alertNotice(H+M+O+W+V+C+T)}S=false;var K=E.slice(6,8);var N=E.slice(0,4)+E.slice(4,6);var P;for(P=0;P<L.year_d.options.length;P++){if(L.year_d.options[P].value==N){L.year_d.selectedIndex=P}}for(P=0;P<L.day_d.options.length;P++){if(L.day_d.options[P].value==K){L.day_d.selectedIndex=P}}}}return S}function africanRouteSelectedGroups(){var B=document.forms["groupbooking.presentation.requestForm"];var C=B.origin.value;var D=B.destination.value;if(africanRoutes){if(africanRoutes[C]){for(var A=0;A<africanRoutes[C].length;A++){if(africanRoutes[C][A]==D){return true}}}if(africanRoutes[D]){for(var A=0;A<africanRoutes[D].length;A++){if(africanRoutes[D][A]==C){return true}}}}return false}function validateAfricanAirportsGroups(){if(africanRouteSelectedGroups()){s2.tuifly.widget.dialog.alertNotice(message.africanAlert);if(!document.forms["groupbooking.presentation.requestForm"].elements.travel_type.checked){return false}}return true}function getAvailabilitySearchRange(M,L,N){var E=2;var A=2;if(!available){return""+E+"|"+A}if(!available[M+" "+L]){return""+E+"|"+A}var C=available[M+" "+L].slice(0,8);var G=available[M+" "+L].slice(9,17);var B=new Date();var J=B.getFullYear();var H=B.getMonth()+1;var K=B.getDate();var D=B.getFullYear().toString();if(H<10){D=D+"0"}D=D+H.toString();if(K<10){D=D+"0"}D=D+K.toString();if(C<D){C=D}var I=new Date();I.setFullYear(N.slice(0,4));I.setMonth(N.slice(4,6)-1);I.setDate(N.slice(6,8));I.setTime(I.getTime()-1000*60*60*24*E);var J=""+I.getFullYear();var H="0"+(I.getMonth()+1);if(H.length>2){H=H.slice(H.length-2,H.length)}var K="0"+I.getDate();if(K.length>2){K=K.slice(K.length-2,K.length)}var F=J+H+K;while((F<C)&&(E>0)){E--;I.setTime(I.getTime()+1000*60*60*24);J=""+I.getFullYear();H="0"+(I.getMonth()+1);if(H.length>2){H=H.slice(H.length-2,H.length)}K="0"+I.getDate();if(K.length>2){K=K.slice(K.length-2,K.length)}F=J+H+K}I=new Date();I.setFullYear(N.slice(0,4));I.setMonth(N.slice(4,6)-1);I.setDate(N.slice(6,8));I.setTime(I.getTime()+1000*60*60*24*A);J=""+I.getFullYear();H="0"+(I.getMonth()+1);if(H.length>2){H=H.slice(H.length-2,H.length)}K="0"+I.getDate();if(K.length>2){K=K.slice(K.length-2,K.length)}F=J+H+K;while((F>G)&&(A>0)){A--;I.setTime(I.getTime()-1000*60*60*24);J=""+I.getFullYear();H="0"+(I.getMonth()+1);if(H.length>2){H=H.slice(H.length-2,H.length)}K="0"+I.getDate();if(K.length>2){K=K.slice(K.length-2,K.length)}F=J+H+K}return""+E+"|"+A}function checkAvailabilityDate(I,H,J){if(!available){return""}if(!available[I+" "+H]){return""}var B=available[I+" "+H].slice(0,8);var D=available[I+" "+H].slice(9,17);var A=new Date();var F=A.getFullYear();var E=A.getMonth()+1;var G=A.getDate();var C=A.getFullYear().toString();if(E<10){C=C+"0"}C=C+E.toString();if(G<10){C=C+"0"}C=C+G.toString();if(B<C){B=C}if(J<B){return B}if(J>D){return D}return""}function openZusatzdatenMaske(){if(document.AirPlus&&document.AirPlus.action!=""){eingabeseite=window.open("","zusatzdaten","height=480, width=540, resizable=no, menubar=no, location=no, status=yes, toolbar=no, top=150, left=200");document.AirPlus.submit();eingabeseite.focus()}}function filterString(B,A){if(A.match(/&/g)||A.match(/</g)||A.match(/>/g)||A.match(/\|/g)||A.match(/%/g)){A=A.replace(/&/g,"");A=A.replace(/</g,"");A=A.replace(/>/g,"");A=A.replace(/\|/g,"");A=A.replace(/%/g,"");document.getElementById(B).value=A;alert(message.notAllowedChar)}return true}function erase(B,A){if(B.value==A){B.value=""}}function set(B,A){if(B.value==""){B.value=A}}function strtrim(){return this.replace(/^\s+/,"").replace(/\s+$/,"")}String.prototype.trim=strtrim;function formatName(A){var B;B=paxNames[A].first+" ";if(paxNames[A].middle.trim().length>0){B+=paxNames[A].middle.trim()+" "}B+=paxNames[A].last;return B}function displayPopUpConverter(){var A="CurrencyConverter.aspx";if(!window.converterWindow||converterWindow.closed){converterWindow=window.open(A,"converter","width=350,height=300,toolbar=0,status=0,location=0,menubar=0,scrollbars=0,resizable=0")}else{converterWindow.open(A,"converter","width=350,height=300,toolbar=0,status=0,location=0,menubar=0,scrollbars=0,resizable=0");converterWindow.focus()}}function displayPopUpFareRule(A,D,C){var B="/FareRules.aspx?fareRuleKeys="+D+"&amp;class="+A+"&amp;paxTypes="+C;if(!window.fareRuleWindow||fareRuleWindow.closed){fareRuleWindow=window.popup(B,"fareRules","width=451,height=400,scrollbars=yes,status=no")}else{fareRuleWindow.popup(B,"fareRule","width=451,height=400,scrollbars=yes,status=no");fareRuleWindow.focus()}}function isInArray(A,C){var B;for(B=0;B<A.length;B++){if(A[B]==C){return true}}return false}function print_r(A,G){var F="";if(!G){G=0}var E="";for(var B=0;B<G+1;B++){E+="    "}if(typeof(A)=="object"){for(var C in A){var D=A[C];if(typeof(D)=="object"){F+=E+"'"+C+"' ...\n";F+=dump(D,G+1)}else{F+=E+"'"+C+"' => \""+D+'"\n'}}}else{F="===>"+A+"<===("+typeof(A)+")"}alert(F)}function getFullServiceStatus(){if(typeof(isFullService)!="undefined"){return isFullService}return false}function getBluemilesNumberFromCookie(){var B=document.cookie;var E="bluemiles";var D=B.indexOf(E+"=");if(D<0){return null}var C=D+E.length+1;var A=B.indexOf(";",C);if(A<C){A=B.length}if(A==C){return null}return B.substring(C,A)}function fillBluemilesNumber(){var B=String(window.location);var F=document.forms[0].length;var A="bm_nr=";if(window.location.search.indexOf(A)!=-1){var C=B.split(A);for(var E=0;E<=F;E++){var D=document.forms[0].elements[E].id;ElementArray=D.split("_");if(ElementArray[1]=="TextBoxUserID"){document.forms[0].elements[E].value=decodeURIComponent(C[1])}}}}function removeOmittedRoutes(G){for(var C=0;C<G.length;C++){currentStation=Stations[G[C]];if(currentStation){var D=currentStation.code;var F=omittedRoutes[currentStation.code];if(F&&F.length>0){for(var B=0;B<currentStation.mkts.length;B++){currentStationMarket=currentStation.mkts[B];for(var A=0;A<F.length;A++){if(currentStationMarket==F[A]){currentStation.mkts.splice(B,1);B--;if(currentStation.mkts.length==0){G.splice(C,1);C--}break}}}}}}for(var C=0;C<G.length;C++){currentStation=Stations[G[C]];if(currentStation){for(var B=0;B<currentStation.mkts.length;B++){var E=Stations[currentStation.mkts[B]];if(E==null||!E.validDest){currentStation.mkts.splice(B,1);B--;if(currentStation.mkts.length==0){G.splice(C,1);C--}break}}}}return G}function getRouteIntersection(F){var D=false;for(var C=0;C<F.length;C++){currentStation=Stations[F[C]];if(currentStation&&allyoucanflyRoutes[currentStation.code]&&allyoucanflyRoutes[currentStation.code].length>0){for(var B=0;B<currentStation.mkts.length;B++){currentStationMarket=currentStation.mkts[B];D=false;for(var A=0;A<allyoucanflyRoutes[currentStation.code].length;A++){if(currentStationMarket==allyoucanflyRoutes[currentStation.code][A]){D=true;break}}if(!D){currentStation.mkts.splice(B,1);B--;if(currentStation.mkts.length==0){F.splice(C,1);C--}}}}else{F.splice(C,1);C--}}for(var C=0;C<F.length;C++){currentStation=Stations[F[C]];if(currentStation){for(var B=0;B<currentStation.mkts.length;B++){var E=Stations[currentStation.mkts[B]];if(E==null||!E.validDest){currentStation.mkts.splice(B,1);B--;if(currentStation.mkts.length==0){F.splice(C,1);C--}break}}}}return F}function removeAfricanRoutesGroups(){for(var C=0;C<destinationArray.length-1;C++){currentStation=destinationArray[C];connections=connectionArray[C];for(var B=0;B<connections.length;B++){currentStationMarket=connections[B];if(africanRoutes[currentStationMarket]){for(var A=0;A<africanRoutes[currentStationMarket].length;A++){if(africanRoutes[currentStationMarket][A]==currentStation){connections.splice(B,1);B--;break}}}}}}function removeOmittedRoutesGroups(){for(i=0;i<destinationArray.length-1;i++){currentStation=destinationArray[i];connections=connectionArray[i];if(omittedRoutes[currentStation]&&omittedRoutes[currentStation].length>0){for(k=0;k<connections.length;k++){currentStationMarket=connections[k];for(l=0;l<omittedRoutes[currentStation].length;l++){if(currentStationMarket==omittedRoutes[currentStation][l]){connections.splice(k,1);k--;break}}}}}removeAfricanRoutesGroups();var A=document["groupbooking.presentation.requestForm"].origin;for(i=0;i<destinationArray.length-1;i++){currentStation=destinationArray[i];connections=connectionArray[i];if(connections.length==1){for(k=0;k<A.options.length;k++){if(A.options[k].value==currentStation){A.options[k]=null;break}}}}}var RouteMaxDate=null;function removeOutdatedRoutes(H){if(available){var B=new Date().getTime();for(var G=0;G<H.length;++G){var I=Stations[H[G]];if(I){for(var E=0;E<I.mkts.length;++E){var C=I.mkts[E];var D=I.code+" "+C;var A=available[D];if(A){var F=new Date();F.setDate(A.substring(15,17));F.setMonth(A.substring(13,15)-1);F.setFullYear(A.substring(9,13));if(RouteMaxDate==null){RouteMaxDate=F}if(RouteMaxDate.getTime()<F.getTime()){RouteMaxDate=F}if(F.getTime()<B){I.mkts.splice(E,1);E--;if(I.mkts.length==0){H.splice(G,1);G--}}}}}}}return H}function restrictRoutes(F,D){for(i=0;i<F.length;i++){var C=Stations[F[i]];for(k=0;k<C.mkts.length;k++){var B=C.mkts[k];var E=false;var A=new Array();if(D[C.code]!=null){A=A.concat(D[C.code])}if(D[B]!=null){A=A.concat(D[B])}if(A.length>0){for(l=0;l<A.length;++l){if(A[l]==C.code||A[l]==B){E=true;break}}}if(!E){C.mkts.splice(k,1);k--;if(C.mkts.length==0){F.splice(i,1);i--}}}}return F}var ElementsState=new Array();var ExistingMarkets=new Array();function HideShowMarket(B,A){$("#marketCityPair_"+B).css("display",A);HideShowMarketDate(B,A)}function HideShowMarketDate(B,A){$("#marketDate_"+B).css("display",A)}function marketChangeCheckChanged(A,B){DisableEnableMarket(B,!A.checked)}function InitializeChange(A){DisableEnableMarket(1,true);DisableEnableMarket(2,true)}function DisableEnableMarket(B,C){$("#AVAILABILITYSEARCHINPUT_Market"+B+"Block").find("input").attr("disabled",C).end().find("select").attr("disabled",C).end();var A=$("#datePickerFlight_Market"+B);A.attr("disabled",C);if(C){A.addClass("disabled")}else{A.removeClass("disabled")}}function EnableMarkets(){$("#AVAILABILITYSEARCHINPUT_Market"+1+"Block").find("input").attr("disabled",false).removeClass("disabled").end().find("select").attr("disabled",false).end();$("#AVAILABILITYSEARCHINPUT_Market"+2+"Block").find("input").attr("disabled",false).removeClass("disabled").end().find("select").attr("disabled",false).end()}function SynchronizeHiddenFields(){var A=$("#"+applicationJavaScriptHtmlId+"_DropDownListNewPassengerType_ADT").val();$("#"+applicationJavaScriptHtmlId+"_DropDownListPassengerType_ADT").val(A)}function AvailabilitySearchValues_Validate(A){SynchronizeHiddenFields();if(AreDateCheckBoxesInValidState()&&CheckCities()&&CheckDates()&&CheckPassengers()&&CheckPaxCount()&&s2.tuifly.promo.kidsflyfree.validate()){return true}return false}function AreDateCheckBoxesInValidState(){var B=GetDateCheckBox("CheckBoxChangeMarket",1);var A=GetDateCheckBox("CheckBoxChangeMarket",2);if(!(B&&A)){return true}if((B.checked)||(A.checked)){return true}s2.tuifly.widget.dialog.alert(noDateSpecified);return false}function GetDateCheckBox(A,B){var C=document.SkySales[applicationJavaScriptHtmlId+"_"+A+"_"+B];return C}function ValidatePassengerCountValue(A){A=parseInt(A,10);if(!A){A=0}return A}function GetAdultCount(){return ValidatePassengerCountValue($("#"+applicationJavaScriptHtmlId+"_DropDownListNewPassengerType_ADT").val())}function GetChildCount(){return ValidatePassengerCountValue($("#"+applicationJavaScriptHtmlId+"_DropDownListPassengerType_CHD").val())}function GetChildDiscountCount(){return ValidatePassengerCountValue($("#"+applicationJavaScriptHtmlId+"_DropDownListPassengerType_CHDD").val())}function GetInfantCount(){return ValidatePassengerCountValue($("#"+applicationJavaScriptHtmlId+"_DropDownListPassengerType_INFANT").val())}function GetOriginValue(){var A=document.SkySales;return GetValue(A[applicationJavaScriptHtmlId+"_DropDownListMarketOrigin1"])}function GetDestinationValue(){var A=document.SkySales;return GetValue(A[applicationJavaScriptHtmlId+"_DropDownListMarketDestination1"])}function GetMonthYearDepart(){return GetMonthYear(1)}function GetMonthYearReturning(){return GetMonthYear(2)}function GetMonthDepart(){var A=GetMonthYearAsList(GetMonthYearDepart());return A[1]}function GetMonthReturning(){var A=GetMonthYearAsList(GetMonthYearReturning());return A[1]}function GetYearDepart(){var A=GetMonthYearAsList(GetMonthYearDepart());return A[0]}function GetYearReturning(){var A=GetMonthYearAsList(GetMonthYearReturning());return A[0]}function GetMonthYearAsList(A){return A.split("-")}function GetDayDepart(){return GetDay(1)}function GetDayReturning(){return GetDay(2)}function GetMonthYear(A){var B=document.SkySales;return GetValue(B[applicationJavaScriptHtmlId+"_DropDownListMarketMonth"+A])}function GetDay(A){var B=document.SkySales;return GetValue(B[applicationJavaScriptHtmlId+"_DropDownListMarketDay"+A])}function CheckPassengers(){var G=localizedTextTooManyInfants;var E=GetAdultCount();var B=GetInfantCount();var A=GetChildDiscountCount();var D=GetChildCount();if(B>E){s2.tuifly.widget.dialog.alertNotice(G);return false}var C=E>0;var F=(B>0||A>0||D>0);if(!C&&F){s2.tuifly.widget.dialog.alert(message.UAM);return false}return true}function UpdateCalendarDate(B){var D=document.SkySales;var A=applicationJavaScriptHtmlId+"_DropDownListMarketDay"+B.passedInfo;var F=applicationJavaScriptHtmlId+"_DropDownListMarketMonth"+B.passedInfo;var E=B.dateSelected.getMonth()+1;if(E<10){E="0"+E}var C=B.dateSelected.getDate();if(C<10){C="0"+C}D[F].value=B.dateSelected.getFullYear()+"-"+E;D[A].value=C}function findIndexByValue(C,B){var A=0;while(A<C.length){if(C[A].value==B){return A}A++}return -1}function addOption(C,D,B){var A=C.length;C[A]=new Option(D);C[A].value=B;C.selectedIndex=A;return A}function setDatesState(B,A){ElementsState["DropDownListMarketDay"+A]=B;ElementsState["DropDownListMarketMonth"+A]=B;ElementsState["DropDownListMarketDateRange"+A]=B;ElementsState["HyperLinkMarketCalendar"+A]=B}function setPaxsState(A){ElementsState.DropDownListPassengerType_ADT=A;ElementsState.DropDownListPassengerType_CHD=A;ElementsState.DropDownListPassengerType_CHDD=A;ElementsState.DropDownListPassengerType_INF=A;ElementsState.PassengersBlock=A}function setMarketState(B,A){ElementsState["Market"+A+"Block"]=B}function validateElement(A){if((document.SkySales[applicationJavaScriptHtmlId+"_"+A])&&(ElementsState[A]!="cancel")){return true}return false}function GetMarketStructure(){var A=$("#travelOptions input:checked").val();if(A=="OneWay"){numMarketsToValidate=1;numDatesToValidate=1}else{if(A=="RoundTrip"){numMarketsToValidate=1;numDatesToValidate=2}else{if(A=="OpenJaw"){numMarketsToValidate=2;numDatesToValidate=2}else{numMarketsToValidate=applicationNumberOfMarketsToOffer;numDatesToValidate=applicationNumberOfMarketsToOffer}}}return A}function CheckDates(){var C=document.SkySales;var E=applicationFormatedDate;var A=applicationFormatedDay;var L=applicationFormatedDateTime;for(var D=1;D<=numDatesToValidate;D++){if(MarketAction[D]=="Cancel"){continue}if(!validateElement("DropDownListMarketDay"+D)){continue}var H=C[applicationJavaScriptHtmlId+"_DropDownListMarketDay"+D].options[C[applicationJavaScriptHtmlId+"_DropDownListMarketDay"+D].selectedIndex].value;var G=C[applicationJavaScriptHtmlId+"_DropDownListMarketMonth"+D].options[C[applicationJavaScriptHtmlId+"_DropDownListMarketMonth"+D].selectedIndex].value.substring(5,7);var J=C[applicationJavaScriptHtmlId+"_DropDownListMarketMonth"+D].options[C[applicationJavaScriptHtmlId+"_DropDownListMarketMonth"+D].selectedIndex].value.substring(0,4);var K=C[applicationJavaScriptHtmlId+"_DropDownListMarketMonth"+D].options[C[applicationJavaScriptHtmlId+"_DropDownListMarketMonth"+D].selectedIndex].text;var I=0;var F=""+J+G+H;if(!CheckDaysOfMonth(H,G,J)){s2.tuifly.widget.dialog.alert(localizedTextInvalidDatePre+H+localizedTextInvalidDateMid+K+localizedTextInvalidDatePost);return false}if(MarketLiftStatus[D]==null){MarketLiftStatus[D]="Default"}if(F<E&&MarketLiftStatus[D]==applicationLiftStatus){if(D==1){var B=localizedTextPastDatePre;if(MarketAction[D]=="New"||MarketAction[D]=="Change"){B=B+localizedTextPastDatePost;s2.tuifly.widget.dialog.alert(B);C[applicationJavaScriptHtmlId+"_DropDownListMarketDay"+D].options.selectedIndex=A-1;C[applicationJavaScriptHtmlId+"_DropDownListMarketMonth"+D].options.selectedIndex=findIndexByValue(C[applicationJavaScriptHtmlId+"_DropDownListMarketMonth"+D],L);$(C[applicationJavaScriptHtmlId+"_DropDownListMarketDay"+D]).change()}else{s2.tuifly.widget.dialog.alert(B)}return false}else{var B=localizedTextEarlierDatePre;if(MarketAction[D]=="New"||MarketAction[D]=="Change"){B=B+localizedTextEarlierDatePost;s2.tuifly.widget.dialog.alert(B);C[applicationJavaScriptHtmlId+"_DropDownListMarketDay"+D].options.selectedIndex=parseInt(C[applicationJavaScriptHtmlId+"_DropDownListMarketDay"+(D-1)].options.selectedIndex,10)+I;C[applicationJavaScriptHtmlId+"_DropDownListMarketMonth"+D].options.selectedIndex=parseInt(C[applicationJavaScriptHtmlId+"_DropDownListMarketMonth"+(D-1)].options.selectedIndex,10)+I;$(C[applicationJavaScriptHtmlId+"_DropDownListMarketDay"+D]).change()}else{s2.tuifly.widget.dialog.alert(B)}return false}}E=F}E=applicationFormatedDate;for(var D=1;D<=numDatesToValidate;D++){if(MarketAction[D]=="Cancel"||MarketAction[D]=="Retain"){continue}if(!validateElement("DropDownListMarketDay"+D)){continue}var H=C[applicationJavaScriptHtmlId+"_DropDownListMarketDay"+D].options[C[applicationJavaScriptHtmlId+"_DropDownListMarketDay"+D].selectedIndex].value;var G=C[applicationJavaScriptHtmlId+"_DropDownListMarketMonth"+D].options[C[applicationJavaScriptHtmlId+"_DropDownListMarketMonth"+D].selectedIndex].value.substring(5,7);var J=C[applicationJavaScriptHtmlId+"_DropDownListMarketMonth"+D].options[C[applicationJavaScriptHtmlId+"_DropDownListMarketMonth"+D].selectedIndex].value.substring(0,4);var F=""+J+G+H;break}return true}var tempEventArgs;var retryCount=0;function ExistingMarket(E,D,B,C,A){this.orig=E;this.dest=D;this.day=B;this.monthYear=C;this.monthYearValue=A}function all(C){var A=applicationNumberOfMarketsToOffer;for(var B=1;B<=A;B++){if(GetCheckedValue(applicationHtmlId+"RadioGroupMarket"+B)!=C){return false}}return true}function exists(C){var A=applicationNumberOfMarketsToOffer;for(var B=1;B<=A;B++){if(GetCheckedValue(applicationHtmlId+"RadioGroupMarket"+B)==C){return true}}return false}function CheckPaxCount(){var F=applicationPassengerArrayValues.split(",");var D=document.SkySales;var A=false;if(document.getElementById&&document.createTextNode){var C=0;var H;for(var B=0;B<F.length;B++){if(D[F[B]]!=H){A=true;C=C+parseInt(D[F[B]].value)}}var E=s2.tuifly.util.Skin.get().toString();if(A&&C==0){s2.tuifly.widget.dialog.alert(localizedTextLessThanOnePassenger);return false}else{if(E!="HLXPepAgent"&&C>applicationBookingMaxPassengers){var G=localizedTextExceedsMaxPaxAllowed;G=G.replace(/({#})/g,applicationBookingMaxPassengers);s2.tuifly.widget.dialog.confirm(G,{dialogClass:"confirmBox confirmBoxExceedsMaxPaxAllowed",okButtonText:localizedTextExceedsMaxPaxAllowedOkButton,cancelButtonText:localizedTextExceedsMaxPaxAllowedCancelButton,okCallback:function(){location.href="/BookGroup.aspx"},cancelCallback:function(){s2.tuifly.widget.dialog.divLayerClose()}});return false}}}return true}function CheckCities(){var D=GetMarketStructure();var E=document.SkySales;var F=new Array();var C=-1;for(var B=1;B<=numMarketsToValidate;B++){if(MarketAction[B]=="Cancel"){continue}if(applicationUseDropDownForStations){if(validateElement("DropDownListMarketOrigin"+B)){C+=1;if(E[applicationJavaScriptHtmlId+"_DropDownListMarketOrigin"+B].selectedIndex==0){if(D=="TripPlanner"&&B>1){numMarketsToValidate=B-1;numDatesToValidate=B-1;break}else{s2.tuifly.widget.dialog.alert(localizedMissingOrigin);return false}}}else{if(D=="TripPlanner"&&B>1){numMarketsToValidate=B-1;numDatesToValidate=B-1;break}}if(validateElement("DropDownListMarketDestination"+B)){C+=1;if(E[applicationJavaScriptHtmlId+"_DropDownListMarketDestination"+B].selectedIndex==0){s2.tuifly.widget.dialog.alert(localizedMissingDest);return false}}}else{if(validateElement("TextBoxMarketOrigin"+B)){C+=1;F[C]=E[applicationJavaScriptHtmlId+"_TextBoxMarketOrigin"+B];if(IsEmpty(F[C],localizedTextTextBoxMarketOrigin)){if(D=="TripPlanner"&&B>1){numMarketsToValidate=B-1;numDatesToValidate=B-1;break}else{s2.tuifly.widget.dialog.alert(localizedMissingOrigin);return false}}}else{if(D=="TripPlanner"&&B>1){numMarketsToValidate=B-1;numDatesToValidate=B-1;break}}if(validateElement("TextBoxMarketDestination"+B)){C+=1;F[C]=E[applicationJavaScriptHtmlId+"_TextBoxMarketDestination"+B];if(IsEmpty(F[C],localizedTextTextBoxMarketDestination)){s2.tuifly.widget.dialog.alert(localizedMissingDest);return false}if(F[C].value.toUpperCase()==F[C-1].value.toUpperCase()){s2.tuifly.widget.dialog.alert(localizedSameOriginDestination);return false}}}}if(!applicationOpenJawEnabled){var A=true;if(F.length>2){for(var C=1;C<F.length-1;C+=2){if(F[C].value.toUpperCase()!=F[C+1].value.toUpperCase()){A=false;break}}}if(!A){s2.tuifly.widget.dialog.alert(localizedInvalidCityPairs);return false}}return true}function setStationsState(B,A){if(applicationUseDropDownForStations){ElementsState["DropDownListMarketOrigin"+A]=B;ElementsState["DropDownListMarketDestination"+A]=B}else{ElementsState["TextBoxMarketOrigin"+A]=B;ElementsState["TextBoxMarketDestination"+A]=B}}function OriginMac(D){var C=D.id.substring(D.id.length-1);if(C>0){var E=document.getElementById(applicationJavaScriptHtmlId+"_CheckBoxUseMacOrigin"+C);var A=document.getElementById(applicationJavaScriptHtmlId+"_LabelUseMacOrigin"+C);if(E&&A){setMac(D,E,A);var F=D.id;F=F.replace(/Origin/,"Destination");var B=document.getElementById(F);DestinationMac(B)}}}function DestinationMac(C){var B=C.id.substring(C.id.length-1);if(B>0){var D=document.getElementById(applicationJavaScriptHtmlId+"_CheckBoxUseMacDestination"+B);var A=document.getElementById(applicationJavaScriptHtmlId+"_LabelUseMacDestination"+B);if(D&&A){setMac(C,D,A)}}}function setMac(B,D,A){if(Stations&&B&&D&&A&&B.value&&Stations[B.value.toUpperCase()]!=null&&Stations[B.value.toUpperCase()].macCode.length>0){if(D){if((Stations[B.value.toUpperCase()]!=null)&&(B.value.toUpperCase()==Stations[B.value.toUpperCase()].macCode.toUpperCase())){D.style.display="none"}else{D.style.display="block"}}if(A){A.innerHTML=macSearchAllText+Stations[B.value.toUpperCase()].macCode+macCodeSeparator;A.style.display="block"}if(Stations[B.value.toUpperCase()]!=null){for(var C in MacsArray[Stations[B.value.toUpperCase()].macCode]){if(C>0){A.innerHTML+=macCitySeparator}A.innerHTML+=MacsArray[Stations[B.value.toUpperCase()].macCode][C]}}}else{if(D){D.checked=false;D.style.display="none"}if(A){A.innerHtml="";A.style.display="none"}}}function initMacs(){for(var C=1;C<=applicationNumberOfMarketsToOffer;C++){var E=document.getElementById(applicationJavaScriptHtmlId+"_TextBoxMarketOrigin"+C);var B=document.getElementById(applicationJavaScriptHtmlId+"_TextBoxMarketDestination"+C);var D=document.getElementById(applicationJavaScriptHtmlId+"_DropDownListMarketOrigin"+C);var A=document.getElementById(applicationJavaScriptHtmlId+"_DropDownListMarketDestination"+C);if(E){OriginMac(E)}if(B){DestinationMac(B)}if(D){OriginMac(D)}if(A){DestinationMac(A)}}}function highlightMoveDays(F,G){var B=F.id.charAt(F.id.length-1);try{var A=window["moveDepartureDays"+B]}catch(E){return}if(A!=null){var H=document.getElementById(applicationJavaScriptHtmlId+"_DropDownListMarketDay"+B);for(var I=0;I<H.options.length;I++){H.options[I].className=""}if(A[F.value]!=null){var C=A[F.value].split(",");for(var D=0;D<C.length;D++){H.options[C[D]-1].className=G}}}}function highlightMoveOriginCities(G,E){try{var A=window["moveDepartureCities"+G]}catch(F){return}if(A!=null){var D=document.getElementById(applicationJavaScriptHtmlId+"_DropDownListMarketOrigin"+G);for(var C=0;C<A.length;C++){for(var B=0;B<D.options.length;B++){if(A[C]==D.options[B].value){D.options[B].className=E;break}}}}}function highlightMoveDestinationCities(G,E){try{var A=window["moveArrivalCities"+G]}catch(F){return}if(A!=null){var D=document.getElementById(applicationJavaScriptHtmlId+"_DropDownListMarketDestination"+G);for(var C=0;C<A.length;C++){for(var B=0;B<D.options.length;B++){if(A[C]==D.options[B].value){D.options[B].className=E;break}}}}}AvailabilitySearchInput=new Object();function pad(B,A){var C=""+B;while(C.length<A){C="0"+C}return C}function ReturnDateDisplay(){if(document.getElementById("searchLanding")){AvailabilitySearchInput.ToggleMarketOptions("slow")}else{AvailabilitySearchInput.ToggleMarketOptions()}}AvailabilitySearchInput.ToggleMarketOptions=function(B){GetMarketStructure();var A=$("#travelOptions");var C=$(":checked",$(A));if(C.val()=="RoundTrip"){$("#marketCityPair_2").hide();$("#marketDate_2").show(B)}else{if(C.val()=="OpenJaw"){$("#marketCityPair_2").show();$("#marketDate_2").show(B)}else{$("input[value=OneWay]",A).select();$("#marketCityPair_2").hide();$("#marketDate_2").hide(B)}}};$(document).ready(function(){if(!document.getElementById("#availabilitySearchInput")||window.applicationNumberOfMarketsToOffer!=null){return}initMacs()});$(document).ready(function(){if(!document.getElementById("#availabilitySearchInput")){return}$("#aosAvailabilitySearchDivBody").hide();$("#aosAvailbilitySearchDivHeader").hide()});var mode="initial";AvailabilitySearchInput.ToggleAvailabilitySearchForm=function(){$("#searchDivHeader").toggle();$("#searchDivHeaderBody").toggle();$("#SearchDivHeaderFooter").toggle();$("#ssrSearchDivHeader").toggle();$("#ssrSearchDivBody").toggle();$("#ssrSearchDivFooter").toggle();$("#aosAvailabilitySearchDivBody").toggle();$("#aosAvailbilitySearchDivFooter").toggle();$("#aosAvailbilitySearchDivHeader").toggle()};$(document).ready(function(){if(!document.getElementById("#availabilitySearchInput")){return}AvailabilitySearchInput.ToggleMarketOptions();$("#travelOptions > input").click(function(){AvailabilitySearchInput.ToggleMarketOptions()})});var jsLoaded=true;function showFlightSearch(){}function africanRouteSelected(){var B=GetOriginValue();var C=GetDestinationValue();if(africanRoutes){if(africanRoutes[B]){for(var A=0;A<africanRoutes[B].length;A++){if(africanRoutes[B][A]==C){return true}}}if(africanRoutes[C]){for(var A=0;A<africanRoutes[C].length;A++){if(africanRoutes[C][A]==B){return true}}}}return false}var AFRICA_NOTE_DISPLAYED=false;function validateAfricanAirports(){if(africanRouteSelected()){var B=document.SkySales;var A=GetValue(B[applicationJavaScriptHtmlId+"_DropDownListMarketOrigin1"]);if(jQuery.inArray(A,notAllowedAfricanDeparture)!=-1){s2.tuifly.widget.dialog.alertNotice(message.africanAlert);return false}if(!AFRICA_NOTE_DISPLAYED){var C=function(){AFRICA_NOTE_DISPLAYED=true;s2.tuifly.widget.submittableForm.clickButton($("#flugsucheButton a"))};s2.tuifly.widget.dialog.alertNotice(message.africanAlert,{okCallback:C});return false}return true}return true}function removeAfricanRoutes(){if(SortedStations==null||SortedStations.length<=0){return}for(i=0;i<SortedStations.length;i++){currentStation=Stations[SortedStations[i]];if(currentStation&&currentStation.mkts){for(k=0;k<currentStation.mkts.length;k++){currentStationMarket=currentStation.mkts[k];if(africanRoutes[currentStationMarket]){for(l=0;l<africanRoutes[currentStationMarket].length;l++){if(africanRoutes[currentStationMarket][l]==currentStation.code){currentStation.mkts.splice(k,1);k--;break}}}}}}}var africanRoutes=new Array();africanRoutes.BRE=new Array("DJE","HRG","MIR","MUH","RMF","SSH","LXR");africanRoutes.BSL=new Array("DJE","HRG","MIR","MUH","RMF","SSH","LXR");africanRoutes.CGN=new Array("DJE","HRG","MIR","MUH","RMF","SSH","LXR");africanRoutes.DRS=new Array("DJE","HRG","MIR","MUH","RMF","SSH","LXR");africanRoutes.DTM=new Array("DJE","HRG","MIR","MUH","RMF","SSH","LXR");africanRoutes.DUS=new Array("DJE","HRG","MIR","MUH","RMF","SSH","LXR");africanRoutes.ERF=new Array("DJE","HRG","MIR","MUH","RMF","SSH","LXR");africanRoutes.FDH=new Array("DJE","HRG","MIR","MUH","RMF","SSH","LXR");africanRoutes.FKB=new Array("DJE","HRG","MIR","MUH","RMF","SSH","LXR");africanRoutes.FMO=new Array("DJE","HRG","MIR","MUH","RMF","SSH","LXR");africanRoutes.FRA=new Array("DJE","HRG","MIR","MUH","RMF","SSH","LXR");africanRoutes.HAJ=new Array("DJE","HRG","MIR","MUH","RMF","SSH","LXR");africanRoutes.HAM=new Array("DJE","HRG","MIR","MUH","RMF","SSH","LXR");africanRoutes.LEJ=new Array("DJE","HRG","MIR","MUH","RMF","SSH","LXR");africanRoutes.MLH=new Array("DJE","HRG","MIR","MUH","RMF","SSH","LXR");africanRoutes.MUC=new Array("DJE","HRG","LXR","MIR","MUH","RMF","SSH");africanRoutes.NUE=new Array("DJE","HRG","MIR","MUH","RMF","SSH","LXR");africanRoutes.PAD=new Array("DJE","HRG","MIR","MUH","RMF","SSH","LXR");africanRoutes.RLG=new Array("DJE","HRG","MIR","MUH","RMF","SSH","LXR");africanRoutes.SCN=new Array("DJE","HRG","MIR","MUH","RMF","SSH","LXR");africanRoutes.STR=new Array("DJE","HRG","MIR","MUH","RMF","SSH","LXR");africanRoutes.SXF=new Array("DJE","HRG","MIR","MUH","RMF","SSH","LXR");africanRoutes.TXL=new Array("DJE","HRG","MIR","MUH","RMF","SSH","LXR");var notAllowedAfricanDeparture=new Array("DJE","HRG","MIR","MUH","RMF","SSH","LXR");function getAfricanRouteException(){return notAllowedAfricanDeparture}var allyoucanflyRoutes=new Array();allyoucanflyRoutes.AGP=new Array("CGN","STR");allyoucanflyRoutes.ARN=new Array("HAJ","STR");allyoucanflyRoutes.BGY=new Array("HAJ");allyoucanflyRoutes.BIO=new Array("CGN");allyoucanflyRoutes.BOJ=new Array("CGN");allyoucanflyRoutes.BRI=new Array("BSL","CGN","MUC","STR");allyoucanflyRoutes.BSL=new Array("BRI");allyoucanflyRoutes.CAG=new Array("CGN","MUC","STR");allyoucanflyRoutes.CGN=new Array("AGP","BIO","BOJ","BRI","CAG","CTA","FMM","GRZ","GWT","HAM","INN","KLU","LNZ","MAN","NAP","OLB","PMO","PSA","RJK","RMI","SZG","TXL","VCE","VLC");allyoucanflyRoutes.CTA=new Array("CGN","DUS","FRA","HAJ","HAM","MUC","STR");allyoucanflyRoutes.DBV=new Array("HAJ","MUC","STR");allyoucanflyRoutes.DUS=new Array("CTA","NAP");allyoucanflyRoutes.FCO=new Array("FMM","HAJ");allyoucanflyRoutes.FMM=new Array("CGN","FCO","HAM","NAP","TXL","VCE");allyoucanflyRoutes.FMO=new Array("VCE");allyoucanflyRoutes.FRA=new Array("CTA","NAP","OLB");allyoucanflyRoutes.GRZ=new Array("CGN");allyoucanflyRoutes.GWT=new Array("CGN","STR");allyoucanflyRoutes.HAJ=new Array("ARN","BGY","CTA","DBV","FCO","KLU","MAN","NAP","NCL","OLB","ORY","PMO","PSA","RJK","RMI","STR","SZG","VCE","VLC");allyoucanflyRoutes.HAM=new Array("CGN","CTA","FMM","KLU","NAP","OLB","SZG","VCE");allyoucanflyRoutes.INN=new Array("CGN");allyoucanflyRoutes.KLU=new Array("CGN","HAJ","HAM","TXL");allyoucanflyRoutes.LNZ=new Array("CGN");allyoucanflyRoutes.MAN=new Array("CGN","HAJ","STR");allyoucanflyRoutes.MUC=new Array("BRI","CAG","CTA","DBV","NAP","OLB","PMO","RJK","RMI");allyoucanflyRoutes.NAP=new Array("CGN","DUS","FMM","FRA","HAJ","HAM","MUC","STR");allyoucanflyRoutes.NCL=new Array("HAJ");allyoucanflyRoutes.OLB=new Array("CGN","FRA","HAJ","HAM","MUC","STR");allyoucanflyRoutes.ORY=new Array("HAJ");allyoucanflyRoutes.PMO=new Array("CGN","HAJ","MUC","STR","TXL");allyoucanflyRoutes.PSA=new Array("CGN","HAJ","STR");allyoucanflyRoutes.RJK=new Array("CGN","HAJ","MUC","STR");allyoucanflyRoutes.RMI=new Array("CGN","HAJ","MUC","STR");allyoucanflyRoutes.STR=new Array("AGP","ARN","BRI","CAG","CTA","DBV","GWT","HAJ","MAN","NAP","OLB","PMO","PSA","RJK","RMI","TXL","VCE","VLC");allyoucanflyRoutes.SZG=new Array("CGN","HAJ","HAM","TXL");allyoucanflyRoutes.TXL=new Array("CGN","FMM","KLU","PMO","STR","SZG","VCE");allyoucanflyRoutes.VCE=new Array("CGN","FMM","FMO","HAJ","HAM","STR","TXL");allyoucanflyRoutes.VLC=new Array("CGN","HAJ","STR");var CurrentPage=0;var javaScriptHtmlId="";var TUICarsRequestHandled=false;var TUICarsAjaxTimeoutInSeconds=15;function TUICarsValidate(A){if(javaScriptHtmlId==""){return}if($("#"+javaScriptHtmlId+"_HtmlInputTextSelectedCarID").val()!=""){if(!document.getElementById(A+"_CheckBoxAcceptAGB").checked){s2.tuifly.widget.dialog.alertNotice(TUICarsAGBMessage,{okCallback:function(){s2.tuifly.helper.extrasAlerts.callbackTuiCarsBox()}});return false}}return true}function TUICarsReLoad(){var E=$("#fieldSetTuiCars input[id$='_HtmlInputTextPickUpDate']").val();var A=$("#fieldSetTuiCars select[id$='_HtmlInputTextPickUpTime']").val();var D=$("#fieldSetTuiCars input[id$='_HtmlInputTextDropOffDate']").val();var C=$("#fieldSetTuiCars select[id$='_HtmlInputTextDropOffTime']").val();var B=$("#fieldSetTuiCars input[id$='_HtmlInputTextSelectedCarID']").val();var F=$("input[name='"+javaScriptHtmlId+"_RadioButtonSortBy']:checked").val();TUICarsReQuery({showPage:CurrentPage,dateFrom:E,timeFrom:A,dateTo:D,timeTo:C,currSel:B,sortBy:F})}function TUICarsShowPage(B){if(B==-1){if(CurrentPage>0){CurrentPage=CurrentPage-1}else{return}}if(B==1){var A=parseInt(document.getElementById("TUICarsTotalAjaxPages").innerHTML);if(A>(CurrentPage+1)){CurrentPage=CurrentPage+1}else{return}}$("#TUICarsAjax").find("[id^='TUICarsInputAjaxView_CAR_']:checked").attr("checked",false).change();TUICarsReLoad()}function TUICarsReQuery(A){$("#CarDisplay").fadeOut("normal",function(){$("#CarWaitDisplay").fadeIn("normal",function(){TUICarsCallAJAX(A)})})}var TUICarsFirstLoad=true;function TUICarsCallAJAX(A){TUICarsRequestHandled=false;window.setTimeout("handleTUICarsRequest()",TUICarsAjaxTimeoutInSeconds*1000);$.get("/TUICarsAjax.aspx",A,handleTUICarsRequest)}function handleTUICarsRequest(A){if(TUICarsRequestHandled){return}TUICarsRequestHandled=true;callbackAjaxTUICarsSuccess(A)}function callbackAjaxTUICarsSuccess(A){$("#TUICarsAjax").html(A);$("#CarWaitDisplay").fadeOut("normal",function(){var B=0;$("#CarWaitDisplay").hide();if($("#tuiCarsWaitBox").hasClass("initialLoading")){if(!$("#TUICarsAjax").html()){$("#tuiCarsWaitBox .tuiCarsNoResult").html($("#TUICarsRequestError").html());$("#tuiCarsWaitBox .tuiCarsNoResult").fadeIn("normal");s_trackEvent("event25","event25","TUICars Timeout");$("#tuiCarsWaitBox .queryLoadingTUICars").fadeOut("normal")}else{if($("#TUICarsAjax .sliderItem").length>0){$("#tuiCarsWaitBox").hide();B=1}else{$("#tuiCarsWaitBox .queryLoadingTUICars").fadeOut("normal");$("#tuiCarsWaitBox .tuiCarsNoResult").html($("#TUICarsRequestError .errorMessage").html());$("#tuiCarsWaitBox .tuiCarsNoResult").fadeIn("normal")}}}else{if(!$("#TUICarsAjax").html()){$("#TUICarsAjax").html($("#TUICarsRequestError").html())}else{B=1}}if(B){$("#fieldSetTuiCars .sliderLeft span").show();$("#fieldSetTuiCars .sliderRight span").show();$("#fieldSetTuiCars").fadeIn("normal");TUICarsRegisterCheckBoxes();TUICarsTransferAjaxValueToContainer();$("#CarDisplay").fadeIn("normal");if(TUICarsFirstLoad){s2.tuifly.model.Booking.TUICarChangeEvent.trigger();s2.tuifly.model.Booking.SSRChangeEvent.trigger();TUICarsFirstLoad=false}s2.tuifly.widget.tooltip.initialize();if($("#fieldSetTuiCars .sliderItem").length<4||$("#TUICarsCurrentAjaxPage").html()==$("#TUICarsTotalAjaxPages").html()){$("#fieldSetTuiCars .sliderRight span").hide()}if($("#fieldSetTuiCars .sliderItem").length==0||$("#TUICarsCurrentAjaxPage").html()=="1"){$("#fieldSetTuiCars .sliderLeft span").hide()}}$("#tuiCarsWaitBox").removeClass("initialLoading");if(jQuery.browser.msie&&jQuery.browser.version.substr(0,1)=="6"){}})}function TUICarsRegisterCheckBoxes(){$("#TUICarsAjax input[type=checkbox]").click(TUICarsSelectCar)}function TUICarsTransferAjaxValueToContainer(){if(document.getElementById("TUICarsPagnitionInfo")){$("#TUICarsCurrentAjaxPage").html($("#TUICarsCurrentAjaxPageOutput").html());$("#TUICarsTotalAjaxPages").html($("#TUICarsTotalAjaxPagesOutput").html());if($("#TUICarsCurrentAjaxPage").html()==""&&$("#TUICarsTotalAjaxPages").html()==""){$("#TUICarsPageSlash").html("")}var A=parseInt(document.getElementById("TUICarsTotalAjaxPages").innerHTML);if(!(A>CurrentPage)){CurrentPage=0}}}function TUICarsSelectCar(){if(this.checked){$("#TUICarsAjax input[type=checkbox]").attr("checked",false);$("#"+javaScriptHtmlId+"_HtmlInputTextSelectedCarID").attr("value",this.id.substr(this.id.indexOf("CAR_")+4));this.checked=true}else{$("#"+javaScriptHtmlId+"_HtmlInputTextSelectedCarID").attr("value","")}s2.tuifly.model.Booking.TUICarChangeEvent.trigger();s2.tuifly.model.Booking.SSRChangeEvent.trigger()}$(document).ready(function(){if(document.getElementById("seatMapCOG")||document.getElementById("selectExtras")||document.getElementById("itinerary")||document.getElementById("itineraryChange")){$("head").append($('<link href="https://ww5.tui.com/cars/pics/cars_sec.css" type="text/css" rel="stylesheet"/>'))}if(window.javaScriptHtmlId&&$("#"+javaScriptHtmlId+"_HtmlInputTextPickUpDate").length!=0){$("#"+javaScriptHtmlId+"_HtmlInputTextPickUpDate").change(TUICarsReLoad);$("#"+javaScriptHtmlId+"_HtmlInputTextDropOffDate").change(TUICarsReLoad);$("#fieldSetTuiCars select[id$='_HtmlInputTextPickUpTime']").change(TUICarsReLoad);$("#fieldSetTuiCars select[id$='_HtmlInputTextDropOffTime']").change(TUICarsReLoad);$("input[name='"+javaScriptHtmlId+"_RadioButtonSortBy']").change(TUICarsReLoad);$("#"+javaScriptHtmlId+"_HtmlInputTextFilter").change(TUICarsReLoad);TUICarsReLoad()}});var CurrentPage=0;var HotelJavaScriptHtmlId="";var TUIHotelRequestHandled=false;var TUIHotelAjaxTimeoutInSeconds=15;function TUIHotelsValidate(A){if(HotelJavaScriptHtmlId==""){return}if($("#"+HotelJavaScriptHtmlId+"_SelectedOffer").val()!=""){if(!document.getElementById(HotelJavaScriptHtmlId+"_CheckBoxAcceptAGB").checked){s2.tuifly.widget.dialog.alertNotice(TUIHotelsAGBMessage,{okCallback:function(){s2.tuifly.helper.extrasAlerts.callbackTuiHotelsBox()}});return false}}return true}function TUIHotelsRoomsChanged(){var A=HotelJavaScriptHtmlId+"_ListBoxSingleRoom";var D=HotelJavaScriptHtmlId+"_ListBoxDoubleRoom";var C=parseInt($("#"+A).val());var B=parseInt($("#"+D).val());if(C+2*B>TUIHotelsNumPersons){if(this.id==A){$("#"+D).val(Math.floor((TUIHotelsNumPersons-C)/2))}else{if(this.id==D){$("#"+A).val(TUIHotelsNumPersons-2*B)}}C=parseInt($("#"+A).val());B=parseInt($("#"+D).val())}if(C>0||B>0){TUIHotelsReLoad()}}function TUIHotelsReLoad(){var C=1;var B=document.getElementById(HotelJavaScriptHtmlId+"_NightsDropDown");if(B){C=B.selectedIndex+1}var A={Nights:C};if(document.getElementById(HotelJavaScriptHtmlId+"_ListBoxSingleRoom")){A.RoomsSingle=$("#"+HotelJavaScriptHtmlId+"_ListBoxSingleRoom").val();A.RoomsDouble=$("#"+HotelJavaScriptHtmlId+"_ListBoxDoubleRoom").val()}TUIHotelsReQuery(A)}function TUIHotelsNoReLoad(){TUIHotelsReQuery({hotelsShowPage:CurrentPage})}function TUIHotelsShowPage(B){if(B==-1){if(CurrentPage>0){CurrentPage=CurrentPage-1}else{return}}if(B==1){var A=parseInt(document.getElementById("TUIHotelsTotalAjaxPages").innerHTML);if(A>(CurrentPage+1)){CurrentPage=CurrentPage+1}else{return}}TUIHotelsNoReLoad()}function TUIHotelsReQuery(A){$("#HotelDisplay").fadeOut("normal",function(){$("#HotelWaitDisplay").fadeIn("normal",function(){TUIHotelsCallAJAX(A)})})}function TUIHotelsCallAJAX(A){TUIHotelRequestHandled=false;window.setTimeout("handleTUIHotelRequest()",TUIHotelAjaxTimeoutInSeconds*1000);$.get("/TUIHotelsAjax.aspx",A,handleTUIHotelRequest)}function handleTUIHotelRequest(A){if(TUIHotelRequestHandled){return}TUIHotelRequestHandled=true;callbackAjaxTUIHotelSuccess(A)}function callbackAjaxTUIHotelSuccess(A){$("#TUIHotelsAjax").html(A);$("#HotelWaitDisplay").fadeOut("normal",function(){var B=0;$("#HotelWaitDisplay").hide();if($("#tuiHotelWaitBox").hasClass("initialLoading")){if(!$("#TUIHotelsAjax").html()){$("#tuiHotelWaitBox .tuiHotelNoResult").html($("#TUIHotelsRequestError").html());$("#tuiHotelWaitBox .tuiHotelNoResult").fadeIn("normal");s_trackEvent("event27","event27","TUIHotels Timeout");$("#tuiHotelWaitBox .queryLoadingTUIHotel").fadeOut("normal")}else{if($("#TUIHotelsAjax .sliderItem").length>0){$("#tuiHotelWaitBox").hide();B=1}else{$("#tuiHotelWaitBox .queryLoadingTUIHotel").fadeOut("normal");$("#tuiHotelWaitBox .tuiHotelNoResult").html($("#TUIHotelsRequestError .errorMessage").html());$("#tuiHotelWaitBox .tuiHotelNoResult").fadeIn("normal")}}}else{if(!$("#TUIHotelsAjax").html()){$("#TUIHotelsAjax").html($("#TUIHotelsRequestError").html())}else{B=1}}if(B){$("#fieldSetTuiHotel .sliderLeft span").show();$("#fieldSetTuiHotel .sliderRight span").show();$("#fieldSetTuiHotel").fadeIn("normal");TUIHotelsRegisterCheckBoxes();TUIHotelsTransferAjaxValueToContainer();$("#HotelDisplay").fadeIn("normal");$("#"+HotelJavaScriptHtmlId+"_SelectedOffer").val("");$("#"+HotelJavaScriptHtmlId+"_SelectedParentOffer").val("");s2.tuifly.model.Booking.TUIHotelChangeEvent.trigger();s2.tuifly.model.Booking.SSRChangeEvent.trigger();if($("#fieldSetTuiHotel .sliderItem").length<4||$("#TUIHotelsCurrentAjaxPage").html()==$("#TUIHotelsTotalAjaxPages").html()){$("#fieldSetTuiHotel .sliderRight span").hide()}if($("#fieldSetTuiHotel .sliderItem").length==0||$("#TUIHotelsCurrentAjaxPage").html()=="1"){$("#fieldSetTuiHotel .sliderLeft span").hide()}}$("#tuiHotelWaitBox").removeClass("initialLoading");if(jQuery.browser.msie&&jQuery.browser.version.substr(0,1)=="6"){}})}function TUIHotelsRegisterCheckBoxes(){$("#TUIHotelsAjax input:checkbox").click(TUIHotelsSelectHotel)}function TUIHotelsTransferAjaxValueToContainer(){$("#TUIHotelsCurrentAjaxPage").html($("#TUIHotelsCurrentAjaxPageOutput").html());$("#TUIHotelsTotalAjaxPages").html($("#TUIHotelsTotalAjaxPagesOutput").html());if($("#TUIHotelsCurrentAjaxPage").html()==""&&$("#TUIHotelsTotalAjaxPages").html()==""){$("#TUIHotelPageSlash").html("")}var A=parseInt(document.getElementById("TUIHotelsTotalAjaxPages").innerHTML);if(!(A>CurrentPage)){CurrentPage=0}}function TUIHotelsSelectHotel(){if(this.checked){$("#TUIHotelsAjax input[type=checkbox]").attr("checked",false);$("#"+HotelJavaScriptHtmlId+"_SelectedOffer").val(this.value);$("#"+HotelJavaScriptHtmlId+"_SelectedParentOffer").val(this.value);this.checked=true}else{$("#"+HotelJavaScriptHtmlId+"_SelectedOffer").val("");$("#"+HotelJavaScriptHtmlId+"_SelectedParentOffer").val("")}s2.tuifly.model.Booking.TUIHotelChangeEvent.trigger();s2.tuifly.model.Booking.SSRChangeEvent.trigger()}function HotelVariationSelected(B,A){$("#tuiHotelsBox").find("input[id$='_SelectedOffer']").val(A);$("#tuiHotelsBox").find("input[id$='_SelectedParentOfferID']").val(B);$("#hotelOffer"+B+"Description").html($("#hotelOffer"+A+"Description").html());$("#hotelOffer"+B+"Price").html($("#hotelOffer"+A+"Price").html());$("#hotelOffer"+B+"AveragePrice").html($("#hotelOffer"+A+"AveragePrice").val());$("#hotelOffer"+B+"Checkbox").val(A);var C=$("#hotelOffer"+B+"Checkbox").get(0);C.checked=true;$(C).change();s2.tuifly.widget.dialog.ajaxLayerClose()}var TUIHotelsNumPersons=0;$(document).ready(function(){if(window.HotelJavaScriptHtmlId){$("#HtmlInputTextHotelNameFilter").change(TUIHotelsNoReLoad);$("#HtmlInputTextHotelLocationFilter").change(TUIHotelsNoReLoad);TUIHotelsNumPersons=parseInt($("#TUIHotelsNumPersons").html());$("#"+HotelJavaScriptHtmlId+"_ListBoxSingleRoom").change(TUIHotelsRoomsChanged);$("#"+HotelJavaScriptHtmlId+"_ListBoxDoubleRoom").change(TUIHotelsRoomsChanged);$("#"+HotelJavaScriptHtmlId+"_NightsDropDown").change(TUIHotelsReLoad);TUIHotelsReLoad()}});function BookingRetrieveValues_Validate(){var B=$("#SkySales");var M=$("input,select",B);var A=0;var E=false;var H=true;var L=applicationSections.split(",");for(var F=0;F<L.length;F++){var N=L[F].split("|");var J=F+1;var I=0;for(var C=0;C<N.length;C++){var G=applicationBookingRetrieveJavaScriptHtmlId+"$"+N[C]+J;var D=M.filter("[name="+G+"]");var K=false;if(N[C]=="DEPARTMONTH"||N[C]=="DEPARTDAY"||N[C]=="DEPARTYEAR"||N[C]=="CARDTYPE"){K=D.val()!=D.attr("requiredempty")}else{if(N[C]=="ORIGINCITY"||N[C]=="DESTINATIONCITY"){K=D.val()!="---"}else{K=(D.val()||(0))}}if(K){I++;H=false}}E=E||((I<N.length)&&(I>0));if(I>0){A++}}if(A>1){s2.tuifly.widget.dialog.alert(localizedenteredInfoInMoreThanOneSection);return false}if(E||H){s2.tuifly.widget.dialog.alert(localizedMissingInformation);return false}return true}function populatePassenger(B,A){if(contactData&&$("#passengerInputBox").is(":visible")){var E=A-1;var D=$("div#PassengerCounter"+A);var C=[{name:"DropDownListTitle",value:contactData.title},{name:"TextBoxFirstName",value:contactData.firstName},{name:"TextBoxMiddleName",value:contactData.middleName},{name:"TextBoxLastName",value:contactData.lastName},{name:"TextBoxCustomerNumber",value:contactData.ff},{name:"DropDownListBirthDateDay",value:contactData.bdayDay},{name:"DropDownListBirthDateMonth",value:contactData.bdayMonth},{name:"DropDownListBirthDateYear",value:contactData.bdayYear},{name:"DropDownListGender",value:contactData.gender},{name:"DropDownListNationality",value:contactData.nationality},{name:"DropDownListResidentCountry",value:contactData.countryOfResidence}];if($("#"+B.id+":checked").val()==null){}else{$.map(C,function(G){if(G){var F=$(":input[id*="+G.name+"]",D);var H=F.val();if(H==""||H=="???"||H==null||isSimilar(H,G.value)){F.val(G.value);if($(":input[id*="+G.name+"]:visible").length==0){F.show();F.next(".inlineLabel").hide()}}}})}}}function allowedToReplacePassenger(B){if(contactData==false){return false}if(passengerEmpty(B)){return true}var D=$("div#PassengerCounter"+B);var C=$(":input[id*=TextBoxFirstName]",D).val();var A=$(":input[id*=TextBoxLastName]",D).val();if(isSimilar(contactData.firstName,C)&&isSimilar(contactData.lastName,A)){return true}return false}function passengerEmpty(A){var B=$("div#PassengerCounter"+A);if($(":input[id*=TextBoxFirstName]",B).val()==""&&$(":input[id*=TextBoxLastName]",B).val()==""){return true}return false}function isSimilar(B,A){if($.trim(B.toLowerCase())==$.trim(A.toLowerCase())){return true}return false}function arePassengersUnique(){var A=1;var C=new Array();var B=$("div#PassengerCounter1");while(B.length>0){var D=$(":input[id*=DropDownListTitle]",B).val();var E=D=="???"?"":D+$(":input[id*=TextBoxFirstName]",B).val()+$(":input[id*=TextBoxLastName]",B).val();if(E==""||typeof C[E]=="undefined"){C[E]=1}else{return A}A++;B=$("div#PassengerCounter"+A)}return true}(function(){var A=function(){};window.s2=new A();window.s2.namespace=function(C,F){var G=C.split(".");var E=window;for(var D=0;D<G.length;D++){var B=G[D];if(E[B]==null){E[B]=new A()}E=E[B]}F.call(E,E)}})();s2.namespace("s2.tuifly",function(){Class("s2.tuifly.LazyMetaClass",{isa:Joose.Class,override:{initializeFromProps:function(D){var B=this;var E=this.SUPER;var A=false;var C=function(){if(!A){A=true;joose.top.CHAOTIC_TRAVERSION_ORDER=true;if(D.isa&&D.isa.finishBuild){D.isa.finishBuild()}E.call(B,D)}};this.addClassMethod("finishBuild",C);this.addClassMethod("create",function(){C();return this.create.apply(this,arguments)});this.c.getInstance=function(){C();return this.getInstance.apply(this,arguments)}}}})});s2.namespace("s2.tuifly",function(){var D=false;var I;var B;var H="";var E=0;var C=2;var K=4;var G=C;var A=function(){I.html(H)};var J=false;$(document).ready(function(){J=true});var F="";this.Logger={init:function(){if(new String(location.hash).indexOf("debug")>-1){G=K}},log:function(N){if(window.console&&!document.all){var L="";if(arguments.callee&&arguments.callee.caller&&arguments.callee.caller.name){L=arguments.callee.caller.name+": "}console.log(L+N)}else{if(J){if(F){N=F+"\n"+N;F=null}if(!D){D=true;var M=$(document.body);M.append("<div id='s2Log' style='position: absolute; top: 10px; left: 10px; width: 500px; height: 400px; padding: 5px; overflow: auto; text-align: left; background-color: white; z-index: 9999; display: block'></div>");I=$("#s2Log");I.dblclick(function(){I.hide()});this.log(N)}else{N=N.replace(/\n/g,"<br />\n");H=N+"<br />\n"+H;if(O){clearTimeout(O)}var O=setTimeout(A,1000)}}else{F+=N}}},debug:function(L){if(G<K){return}this.log(L)}};this.Logger.init();s2.Logger=this.Logger});s2.namespace("s2.tuifly.monkeyPatch",function(){var A=[];this.patch=function(B,C){A.push([B,C])};$(document).ready(function(){jQuery.each(A,function(){var B=this[0];var C=this[1];window[B]=C})});this.wrap=function(D,E,B){var C=B;if(C==null){C=window}var F=C[D];C[D]=function(){var G=F.apply(this,arguments);E.apply(this,arguments);return G}};this.around=function(D,E,B){var C=B;if(C==null){C=window}var F=C[D];C[D]=function(){var G=[F].concat(Array.prototype.slice.call(arguments,0));return E.apply(this,G)}};this.getDotNetNamespacedThing=function(D){var B=new RegExp(D+"$");var C;Joose.O.each(window,function(F,E){if(E.match(B)){C=F;return false}});if(C==null){throw new Error("Cant find object with suffix "+D)}return C}});s2.namespace("s2.tuifly",function(){var A=200;var B=0;this.Event=function(C){this.eventName="s2:"+C;this.lazyTimeout=[]};this.Event.prototype={trigger:function(){var C=[];for(var D=0;D<arguments.length;D++){C[D]=arguments[D]}$(document).trigger(this.eventName,[C])},observe:function(D){var C=this;$(document).bind(this.eventName,function E(G,F){D.apply(C,F)})},observeOnce:function(E){var C=this;this.observe(function D(G,F){if(F){E.apply(C,F)}else{E.call(C)}$(document).unbind(C.eventName,E)})},observeLazy:function(G,D){var C=this;var F=B;var H=D||A;this.observe(function E(){if(C.lazyTimeout[F]){clearTimeout(C.lazyTimeout[F])}var J=arguments;C.lazyTimeout[F]=setTimeout(function I(){G.apply(C,J)},H)});B++},toString:function(){return this.eventName}}});s2.namespace("s2.tuifly.events",function(){this.AjaxStartEvent=new s2.tuifly.Event("AjaxStartEvent");this.AjaxEndEvent=new s2.tuifly.Event("AjaxEndEvent");this.DocResize=new s2.tuifly.Event("DocResize");this.AvailibilityCookieDataSet=new s2.tuifly.Event("AvailibilityCookieDataSet")});s2.namespace("s2.tuifly.util",function(A){var B=this;Class("s2.tuifly.util.CurrencyValue",{has:{value:{isa:TYPE.Num,is:"rw",required:true},symbol:{isa:TYPE.Str,is:"rw",required:true},format:{is:"rw",init:"%.2f"},symbolAfterValue:{is:"rw",init:true}},override:{getSymbol:function(){var C=this.SUPER();C=C.replace(/\s+/g,"");C=C.replace(/[\r\n]/g,"");C=C.replace(/\&nbsp;/g,"");return C}},methods:{getCode:function(){var C=this.getSymbol();if(C=="€"){return"EUR"}else{if(C=="£"){return"GBP"}else{if(C=="$"){return"USD"}else{if(C=="Kc"){return"CZK"}else{if(C=="kr"){return"SEK"}else{return""}}}}}},stringify:function(){var C=JooseX.Culture.Factory.get();var D=""+C.formatNumber(this.getValue(),this.format);if(this.getSymbolAfterValue()){return""+D+" "+this.getSymbol()}else{return""+this.getSymbol()+" "+D}},greaterZero:function(){return this.getValue()>0},add:function(D){var E=this.checkPara(D);var C=D.getValue()+this.getValue();var F=this.meta.instantiate({value:C,symbol:E});F.setSymbolAfterValue(this.getSymbolAfterValue()&&D.getSymbolAfterValue());return F},substract:function(D){var E=this.checkPara(D);var C=this.getValue()-D.getValue();var F=this.meta.instantiate({value:C,symbol:E});F.setSymbolAfterValue(this.getSymbolAfterValue()&&D.getSymbolAfterValue());return F},mul:function(D){var C=this.meta.instantiate({value:D*this.getValue(),symbol:this.getSymbol()});C.setSymbolAfterValue(this.getSymbolAfterValue());return C},checkPara:function(C){if(!C||!C instanceof B.CurrencyValue){throw new Error("invalid currency object "+C)}if(C.getSymbol()!=this.getSymbol()){if(C.getValue()==0){return this.getSymbol()}if(this.getValue()==0){return C.getSymbol()}s2.tuifly.Logger.debug("Trying to add different currencies: '"+C.getSymbol()+"' vs. '"+this.getSymbol()+"'")}return this.getSymbol()}},classMethods:{getDefaultCurrencySymbol:function(){return this.defaultCurrencySymbol},setDefaultCurrencySymbol:function(C){this.defaultCurrencySymbol=C},zero:function(D){var C=D||this.getDefaultCurrencySymbol();return this.meta.instantiate({value:0,symbol:C})}}});Type("S2Currency",{uses:TYPE.Obj,where:function(C){return C instanceof B.CurrencyValue},coerce:[{from:TYPE.Str,via:function(I){var F=JooseX.Culture.Factory.get();var G;I=I.replace("&nbsp;"," ","g");if(G=I.match(/(\D*)\s*(-*\d+[.,]*\d*[.,]*\d*)\s*(\D*)/)){var I=F.parseNumber(G[2]);var E=G[1];var J=G[3];var C=typeof J=="string"&&J.length>0?true:false;var D=C?J:E;D=D.replace(/\s/g,"");var H=new B.CurrencyValue({value:I,symbol:D});H.setSymbolAfterValue(C);return H}return null}}]})});s2.namespace("s2.tuifly.util",function(){var A;this.Query=function(B){this.queryString=B?B:window.location.search;this.query=this.parse()};this.Query.prototype={asHash:function(){return this.query},normalize:function(B){if(B==null){B=""}B=""+B;return B.toLowerCase()},param:function(B,C){if(C!=null&&B!=""&&B!=null){this.query[this.normalize(B)]=C}return this.query[this.normalize(B)]},parse:function(){if(A){return A}var C=this.queryString;C=C.substr(1);if(C==null){C=""}parts=C.split("&");var D={};for(var B=0;B<parts.length;B++){var E=parts[B].split("=");if(E[0]!=""){D[this.normalize(unescape(E[0]))]=unescape(E[1])}}A=D;return D},toString:function(){var D=[];for(var C in this.query){var B=C;if(B!=null&&B!=""){B=this.normalize(B);D.push(encodeURIComponent(B)+"="+encodeURIComponent(this.query[C]))}}return D.join("&")}}});s2.namespace("s2.tuifly.util",function(){this.Text=function(A){if(typeof(A)=="undefined"){A=""}this.sourceObject=A};this.Text.prototype={get:function(A,B){var C=this._get(A);if(B){Joose.O.each(B,function(F,D){var E=new RegExp("{"+D+"}");C=C.replace(E,F)})}return C},_get:function(A){var B=this.sourceObject;if(B&&B.find){return B.find("> param[name="+A+"]").val()}return B[A]}};this.removeHtmlTags=function(B){var A=document.createElement("DIV");A.innerHTML=B;return A.textContent||A.innerText}});s2.namespace("s2.tuifly.util",function(){this.Skin=function(){this.id=this.fetch()};var A;this.Skin.get=function(){if(A){return A}A=new this();return A};this.Skin.prototype={fetch:function(){var C=jQuery("body").attr("class");var B=C.match(/Skin(\w+)/);if(B){return B[1]}return""},toString:function(){return this.id},identifier:function(){return this.id},isConsumer:function(){return this.toString().match(/^hlxconsumer$/i)?true:false},isMember:function(){return this.toString().match(/^hlxmember$/i)?true:false},isAgent:function(){return this.toString().match(/^hlxagencymaster$/i)?true:false},isPep:function(){return this.toString().match(/^hlxpepagent$/i)?true:false},isInterline:function(){return this.toString().match(/^hlxinterline$/i)?true:false},isCorporate:function(){return this.toString().match(/^hlxcorporatemaster$/i)?true:false}}});s2.namespace("s2.tuifly.util",function(){var B="produktion";var A="prod";var D="devel";this.Environment=function(){this.env=this.getEnv()};var C;this.Environment.get=function(){if(C){return C}C=new this();return C};this.Environment.prototype={getEnv:function(){if(this.isProd()){return B}else{if(this.isStage()){return A}else{return D}}},isProd:function(){return location.host.match(/tuifly\.com$/)?true:false},isStage:function(){if(location.host.match(/stage.tuifly.sinnerschrader.de/)||location.host.match(/236$/)){return true}return false},isDev:function(){if(location.host.match(/devel.tuifly.sinnerschrader.de/)||location.host.match(/10080$/)){return true}return false},secureUrl:function(H){var E=JooseX.Culture.Factory.get().identifier();var I=this.isProd()||this.isStage()?"https://":"http://";var F=location.protocol+"//";var G=location.hostname;if(location.port!="80"&&location.port!="443"&&location.port!=""){G+=":"+location.port}return I+G+H},OmnitureAccount:function(){var G=JooseX.Culture.Factory.get().majorIdentifier();var E=this.env;var F;if(G&&E){F="tuifly-"+E+"-"+G}return F}}});s2.namespace("s2.tuifly.util.passenger",function(){this.countOf=function(A){if(typeof(A)=="undefined"||A==""){return}var B=$("#s2data div[node^=PassengerInfoXML] div[node=PAXTYPES] div[node=PAXTYPE][type="+A+"]").attr("count");if(typeof(B)=="undefined"||B==""){B=0}return parseInt(B)}});s2.namespace("s2.tuifly.util.booking",function(){this.isChangeProcess=function(){var A=$("#s2data div[node^=BookingInfoXML] div[node=booking]").attr("ischangeprocess");if(typeof(A)=="undefined"){return false}return A.match(/true/i)?true:false};this.journeyFromClass=function(A){var C=A.attr("class");var B=C.match(/journey(\d+)/);if(B){return parseInt(B[1],10)}throw"Cant find journey in "+C}});s2.namespace("s2.tuifly.util",function(){this.TextMetrics=function(C,B){this.text=""+B;this.jQueryObject=$(C).eq(0);var A={"font-family":this.jQueryObject.css("font-family"),"font-size":this.jQueryObject.css("font-size"),"font-weight":this.jQueryObject.css("font-weight"),"font-style":this.jQueryObject.css("font-style"),"text-transform":this.jQueryObject.css("text-transform"),"text-decoration":this.jQueryObject.css("text-decoration"),"letter-spacing":this.jQueryObject.css("letter-spacing"),"word-spacing":this.jQueryObject.css("word-spacing"),direction:this.jQueryObject.css("direction"),position:"absolute",visibility:"hidden",height:"auto",width:"auto","z-index":"-1"};this.textNode=jQuery("<pre>"+B+"</pre>").css(A);this.doc=$("body")};this.TextMetrics.prototype={width:function(){this.doc.append(this.textNode);var A=this.textNode.width();this.textNode.remove();return A},elementWidth:function(){var A=this.jQueryObject.width();if(A==0){A=this.jQueryObject.css("width");if(A.match(/^\d+px$/)){A=parseInt(A.substring(A,A.length-2))}else{A=0}}return A},getIndexAtX:function(A){A=parseInt(A);if((this.text.length==0)||isNaN(A)){return -1}if(A<=0){return 0}this.doc.append(this.textNode);var E=this.textNode.width();if(E<=A){this.textNode.remove();return this.text.length}var B=Math.round(this.text.length*A/E);var F=this.textNode.text(this.text.substr(0,B)).width();var D=this.textNode.text(this.text.substr(0,B+1)).width();var C=10;while((!(F<=A)||!(A<D))&&(C>0)){if(D<A){B++}else{B--}F=this.textNode.text(this.text.substr(0,B)).width();D=this.textNode.text(this.text.substr(0,B+1)).width();C--}this.textNode.remove();return B}}});s2.namespace("s2.tuifly.util",function(){var B;var A={CGN:["FMM","TXL"],FMM:["CGN","HAM","TXL"],HAM:["FMM"],TXL:["CGN","FMM"]};window.streckenliste={};this.routes=function(C){this.load(C)};this.routes.get=function(C){if(B){C(B);return B}B=new this(C);return B};this.routes.airberlinFormerTuifly=function(){return A};this.routes.isInAirberlinFormerTuifly=function(C){return A[C]!=null};this.routes.prototype={load:function(E){var C=this;var D="/pregenerated/strecken.csv";$.get(D,function(G){G=G.replace(/^csv=/,"");var O=G.split("\r\n");var F={};for(var H in O){var M=O[H];var J=M.split(";");if(J.length>2){var K=J[0].toLowerCase();var L=J[1].toLowerCase();var I=J[2].toLowerCase();var N=s2.tuifly.util.generateRouteKey(K,L,I);F[N]=true}}C.obj=F;E(C)})},check:function(F,E,D){F=F.toLowerCase();E=E.toLowerCase();var C=s2.tuifly.util.generateRouteKey(F,E,D);return this.obj[C]?true:false},isX3:function(D,C){return this.check(D,C,"x3")||this.check(D,C,"hf")}};this.generateRouteKey=function(E,D,C){E=E.toLowerCase();D=D.toLowerCase();C=C.toLowerCase();return E+"-"+D+"-"+C}});s2.namespace("s2.tuifly.validation",function(){var C=this;this.monkeyPatch=function(){s2.tuifly.monkeyPatch.patch("Validate",C.Validate);s2.tuifly.monkeyPatch.patch("validate",C.validate);s2.tuifly.monkeyPatch.patch("setError",C.setError);s2.tuifly.monkeyPatch.patch("outputErrors",C.outputErrors);s2.tuifly.monkeyPatch.patch("raise",A)};var B="Please correct the following.\n\n";this.Validate=function(H,G,D,I){this.form=H;this.namespace=G;this.errors=[];this.setfocus=null;this.errorsHeader=D;this.namedErrors=new Array();if(I){this.regexElementIdFilter=I}this.requiredAttribute="required";this.requiredEmptyAttribute="requiredempty";this.validationTypeAttribute="validationtype";this.regexAttribute="regex";this.minLengthAttribute="minlength";this.numericMinLengthAttribute="numericminlength";this.maxLengthAttribute="maxlength";this.numericMaxLengthAttribute="numericmaxlength";this.minValueAttribute="minvalue";this.maxValueAttribute="maxvalue";this.equalsAttribute="equals";this.validateIfCheckedOnlyAttribute="validateIfCheckedOnly";this.validateIfNotCheckedOnlyAttribute="validateIfNotCheckedOnly";this.defaultErrorAttribute="error";this.requiredErrorAttribute="requirederror";this.validationTypeErrorAttribute="validationtypeerror";this.regexErrorAttribute="regexerror";this.minLengthErrorAttribute="minlengtherror";this.maxLengthErrorAttribute="maxlengtherror";this.minValueErrorAttribute="minvalueerror";this.maxValueErrorAttribute="maxvalueerror";this.equalsErrorAttribute="equalserror";this.defaultError="{label} is invalid.";this.defaultRequiredError="{label} is required.";this.defaultValidationTypeError="{label} is invalid.";this.defaultRegexError="{label} is invalid.";this.defaultMinLengthError="{label} is too short in length.";this.defaultMaxLengthError="{label} is too long in length.";this.defaultMinValueError="{label} must be greater than {minValue}.";this.defaultMaxValueError="{label} must be less than {maxValue}.";this.defaultEqualsError="{label} is not equal to {equals}";this.defaultNotEqualsError="{label} cannot equal {equals}";this.defaultValidationErrorClass="validationError";this.defaultValidationErrorLabelClass="validationErrorLabel";this.requiredErrorOccured=false;this.run=run;this.runBySelector=runBySelector;this.validateSingleElement=validateSingleElement;this.outputErrors=outputErrors;this.checkFocus=checkFocus;this.setError=setError;this.cleanAttributeForErrorDisplay=cleanAttributeForErrorDisplay;this.validateRequired=validateRequired;this.validateType=validateType;this.validateRegex=validateRegex;this.validateMinLength=validateMinLength;this.validateMaxLength=validateMaxLength;this.validateMinValue=validateMinValue;this.validateMaxValue=validateMaxValue;this.validateEquals=validateEquals;this.isExemptFromValidation=isExemptFromValidation;this.setValidateTypeError=setValidateTypeError;this.validateAmount=validateAmount;this.validateDate=validateDate;this.validateMod10=validateMod10;this.validateNumeric=validateNumeric;this.stringPattern="^.+$";this.upperCaseStringPattern="^[A-Z]([A-Z)|s)*$";this.numericPattern="^\\d+$";this.numericStripper=/\D/g;this.alphaNumericPattern="^\\w+$";var E="(\\.|,)";this.amountPattern="^(\\d+("+E+"\\d+)*)$";this.dateYearPattern="^\\d{4}$";this.dateMonthPattern="^\\d{2}$";this.dateDayPattern="^\\d{2}$";var F="[^:,;#$%&()+=/]+";this.emailPattern="^"+F+"(\\."+F+")?@"+F+"(\\."+F+")+$"};this.setError=function(J,I,K){if(J.type=="radio"){var F=J.getAttribute("name");if(F.length>0){if(this.namedErrors[F]!=null){return}this.namedErrors[F]=F}}var E=J.errorAttribute;if(E==null){E=J.getAttribute(I)}if(!E){if(J[this.defaultErrorAttribute]){E=J[this.defaultErrorAttribute]}else{if(K){E=K}else{E=this.defaultError}}}E=E.replace(/^{\s*\w+\s*}\:\s+/,"");var H=E.match(/{\s*(\w+)\s*}/g);if(H){for(var G=0;G<H.length;G++){var D=H[G].replace(/{\s*(\w+)\s*}/,"$1");E=E.replace(/{\s*\w+\s*}/,this.cleanAttributeForErrorDisplay(J,D))}}this.errors.push(new s2.tuifly.validation.Error(J,E));this.checkFocus(J)};this.outputErrors=function(){if(this.errors.length>0){s2.tuifly.widget.collapsiblePanel.openIfError();if(this.setfocus){var G=$(this.setfocus);try{if(G.get(0).showStub){G.get(0).showStub()}G.focus()}catch(I){s2.Logger.debug(I)}var H=G.offset().top-100;if(H<0){H=0}window.scrollTo(0,H);if(this.requiredErrorOccured){alert(requiredErrorMessage)}for(var F=0,D=this.errors.length;F<D;F++){var E=this.errors[F];if(!E.isRequiredError){if(document.getElementById("paymentInputContent")){alert(requiredErrorMessage)}else{E.errorLabel.addClass("formRowErrorMessage");E.errorLabel.removeClass("hidden")}}}}return false}return true};this.validate=function(F,D,E){if(document.getElementById&&document.createTextNode){s2.tuifly.validation.Error.clearAll();if(F.getAttribute){F=F.getAttribute("id").replace(/_\w+$/,"")}var H=new C.Validate(document.SkySales,F+"_",B,E);if(D){var G=D;if(!D.getAttribute){G=document.getElementById(F+"_"+D)}H.validateSingleElement(G);return H.outputErrors()}return H.run()}return true};function A(G,F){var I;var E=events[G];if(E!=I){for(var D=0;D<E.length;D++){var H=E[D];if(H&&window[H]){if(window[H](F)==false){return false}}else{s2.Logger.debug("Cant find event "+G+" func "+H)}}}return true}this.checkBeforeSkySalesValidation=function(){return s2.tuifly.helper.SeatMap.Validate()};this.scrollToElement=function(D){s2.tuifly.helper.scrollToElement.start(D)};this.monkeyPatch()});s2.namespace("s2.tuifly.validation",function(){var A=[];this.Error=function(C,D){this.element=$(C);this.formRow=$(C).parent();this.message=D;this.label=$("label[for="+C.id+"]");this.isRequiredError=false;var B=this.element.closest("#paymentMethodSelection");if(B.length>0){this.element=B;this.formRow=B.parent()}this.formRow.prepend("<span class='hidden'>"+this.message+"</span>");this.errorLabel=this.formRow.find("span:first-child");A.push(this);this.draw()};this.Error.clearAll=function(){jQuery.each(A,function(){this.clear()});A=[]};this.Error.prototype={draw:function(){this.element.closest(".toggleBox").removeClass("closed");this.element.closest(".editBlock").removeClass("hidden").next(".displayBlock").addClass("hidden");if(this.element.closest(".toggleBox").find(".contactinput").length>0){s2.tuifly.helper.contactEditToggle.fadeAndSetHiddenField()}this.element.addClass("error");this.label.addClass("error");var B=this.element.parent();if(this.element.is("select")&&jQuery.browser.msie&&(jQuery.browser.msie6||(jQuery.browser.version.substr(0,1)=="7"))){this.element.before('<div class="errorOutline" style="width: '+this.element.outerWidth()+"px; height: "+this.element.outerHeight()+'px; "/>')}if(B.hasClass("formRow")&&!B.hasClass("formRowError")){B.addClass("formRowError")}},clear:function(){this.element.removeClass("error");this.label.removeClass("error");this.errorLabel.remove();if(this.element.is("select")&&this.element.prev().hasClass("errorOutline")&&jQuery.browser.msie&&(jQuery.browser.msie6||(jQuery.browser.version.substr(0,1)=="7"))){this.element.prev().remove()}var B=this.element.parent();if(B.hasClass("formRowError")&&B.find(".error").length==0){B.removeClass("formRowError")}}}});s2.namespace("s2.tuifly.validation.inputValidation",function(){var A=this;A.initialize=function(){$(".qValidateName").change(function(){A.nameValidation(this)})};A.nameValidation=function(B){input=$(this);value=input.val();id=input.attr("id");if(value.match(/&/g)||value.match(/</g)||value.match(/>/g)||value.match(/\|/g)||value.match(/%/g)||value.match(/[0-9]/g)){value=value.replace(/&/g,"");value=value.replace(/</g,"");value=value.replace(/>/g,"");value=value.replace(/\|/g,"");value=value.replace(/%/g,"");value=value.replace(/[0-9]/g,"");document.getElementById(id).value=value;alert(message.notAllowedCharName)}}});s2.namespace("s2.tuifly.widget.focusManager",function(A){var B;this.FocusChangeEvent=new s2.tuifly.Event("FocusChangeEvent");this.initialize=function(){var D=parseInt(jQuery.browser.version,10);var C=function(F){if(F&&F.target){var G=F.target==document?null:F.target;A.FocusChangeEvent.trigger(B,G);B=G}};if(document.addEventListener){document.addEventListener("focus",C,true)}else{if(jQuery.browser.msie){var E;setInterval(function(){if(document.activeElement&&document.activeElement!==E){E=document.activeElement;C({target:E})}},300)}}};this.getFocused=function(){if(!B){return document}return B}});s2.namespace("s2.tuifly.widget.navigation",function(){this.initialize=function(){var A=false;$("#navigation").mouseover(function(){if(A){return}A=true;if(window.tuiLogin.loggedIn()){$("#navigation li.loggedOut").remove()}else{$("#navigation li.loggedIn").remove()}var B=$("#navigation > li.mainLevel");B.find("ul.subLevel li:last").addClass("last");$("#navigation > li.mainLevel:last a:first").append($("<span></span>"));B.hover(function(){$(this).addClass("hover");if(jQuery.browser.msie6){var C=$("div.flightInfoHeader select, div#PassengerCounter1 select, select#AirportListDestination, select#MonthToQuery, select[id$=_DropDownListTitle], select[id$=_DropDownListCountry]");C.css("visibility","hidden")}},function(){$(this).removeClass("hover");if(jQuery.browser.msie6){var C=$("div.flightInfoHeader select, div#PassengerCounter1 select, select#AirportListDestination, select#MonthToQuery, select[id$=_DropDownListTitle], select[id$=_DropDownListCountry]");C.css("visibility","")}});$(this).mouseover()})}});s2.namespace("s2.tuifly.widget.metaNavigation",function(){this.initialize=function(){if(jQuery.browser.msie&&jQuery.browser.version.substr(0,1)=="6"){var A=false;$("#metaArea").mouseover(function(){if(A){return}A=true;$("#metaArea > li.metaLanguage").hover(function(){$(this).addClass("hover")},function(){$(this).removeClass("hover")})})}}});s2.namespace("s2.tuifly.widget.datepickerForSelect",function(){var C=function(G){var E=$(this);var F=Date.parse(G);F=F.add(7);if(A(F)){var H=JooseX.Culture.Factory.get().formatDate(F);E.val(H);E.change();s2.Logger.debug("Picked date "+H)}};this.updateSelectBasic=C;var B={numberOfMonths:[1,3],stepMonths:3,prevText:"&#160;",nextText:"&#160;",closeText:"&#160;",currentText:"",changeMonth:false,changeYear:false,changeFirstDay:false,showOtherMonths:true,showOn:"focus",minDate:"+0",showAnim:"show",duration:"",showButtonPanel:true,onSelect:C};var A=function(E){return E!=null&&E!=NaN};this.dateOK=A;this.datePickers;this.initialize=function(){var F=JooseX.Culture.Factory.get();$.datepicker.setDefaults($.datepicker.regional[F.subIdentifier().toLowerCase()]);var G;if(document.getElementById("flugsuche")||document.getElementById("availabilitySearchInput")||document.getElementById("hotelSearch")||document.getElementById("carSearch")||document.getElementById("holidaySearch")){G=$("input.datepickerForSelect");G.each(function(){var I=$(this);if(jQuery.browser.msie&&(jQuery.browser.version.substr(0,1)=="7")){I.data("flightMonthIE",I.parent().find("select").eq(1).val())}window.setTimeout(function(){D(I)},10)});var E=$(G.get(0));var H=$(G.get(1));if(E.length>0&&H.length>0){E.change(function(){var I=Date.parse(E.val());if(A(I)){var J=Date.parse(H.val());if(H.val()==""||!A(J)||I.getTime()>J.getTime()){H.val(F.formatDate(I));H.change()}}})}}if(!G){G=$("input.simpleDatePicker")}G.datepicker(B);this.datePickers=G};this.getFlight=function(){return $("#datePickerFlight")};this.getReturnFlight=function(){return $("#datePickerReturn")};var D=function(H){var G=JooseX.Culture.Factory.get();var P=H.parent();var N=P.find("select");var O=$(N.get(1));var E=$(N.get(0));if((O.val()==null)&&H.data("flightMonthIE")){O.val(H.data("flightMonthIE"))}var I=function(){var U=Date.parseExact(O.val()+"-"+E.val(),"yyyy-MM-dd");var V=false;if(A(U)){var S=Date.today();if(U.compareTo(S)<0){U=S;V=true}H.val(G.formatDate(U));H.change()}else{V=true}if(document.getElementById("searchChange")&&V){var T=O.attr("id");if(T){T=T.substr(T.length-1,T.length)}$("#availabilitySearchInput .departure-flight-already-done").show();$("#searchChange #availabilitySearchInput .datemarket"+T).hide();if(MarketAction){MarketAction[T]="Cancel"}}};var F=function(V){var T=$(this);var U=Date.parse(V);if(A(U)){var W=U.toString("yyyy-MM");var S=U.toString("dd");O.val(W);E.val(S);T.change();s2.Logger.debug("Picked date "+O.val()+"-"+E.val())}};I();F(H.val());E.change(function(){s2.Logger.debug("Day select changed");I()});O.change(function(){s2.Logger.debug("Month select changed");I()});var M=function(){F(this.value)};H.change(M);H.typingEnded(M);H.datepicker(jQuery.extend(B,{onSelect:F}));var L=new s2.tuifly.util.Query();var R=L.param("startDate");var K=L.param("returnDate");var J=$("input.datepickerForSelect").get(0);var Q=$("input.datepickerForSelect").get(1);if(J&&R){$(J).val(R)}if(Q&&K){$(Q).val(K)}s2.tuifly.events.AvailibilityCookieDataSet.observe(I);s2.Logger.debug("Applied datepicker")}});s2.namespace("s2.tuifly.widget.collapsiblePanel",function(){var A=this;$("h3.toggleHeadline").live("click",function(C){var B=$(this);B.parent().toggleClass("closed");C.preventDefault();return false});this.initialize=function(){if(document.getElementById("notepad")&&!document.getElementById("flugsuche")){$("#notepad h3.toggleHeadline span.toggleHeadlineForm").click(function(C){var B=$(this);B.parent().toggleClass("editing");if(B.parent().find("input").length>0){B.parent().find("input")[0].focus();B.parent().find("input")[0].select()}C.stopPropagation()});$("#notepad h3.toggleHeadline span.toggleHeadlineForm fieldset").click(function(B){B.stopPropagation()})}};this.gotoAndOpen=function(D){var C=$(D).attr("href");var B=C.match(/#(toggleBox_\d+)/);var E="";if(B&&B.length>0){E=B[1]}location.href="#"+E;this.open($("#"+E))};this.open=function(B){B.removeClass("closed")};this.openIfError=function(){$.cachedFind("div.toggleBox").each(function(){var B=$(this);if(B.find("div.error, span.error").length>0){A.open(B)}})}});s2.namespace("s2.tuifly.widget.collapsibleContainer",function(){$("a.toggleContainerLink").live("click",function(C){var B=$(this);var A=B.parents("div.toggleContainer");A.children("div.toggleContainerContent").toggleClass("hidden");C.preventDefault();return false});this.initialize=function(){};this.toggleCSSClass=function(D,C,A){var B=$(D);if(B.hasClass(C)){B.removeClass(C);B.addClass(A)}else{if(B.hasClass(A)){B.removeClass(A);B.addClass(C)}}}});s2.namespace("s2.tuifly.widget.collapsibleNavigation",function(){$("h2.toggleNavigationHeadline").live("click",function(D){var B=$(this);var C=B.parent();if(C.hasClass("closed")){C.parent().find(".accordion").each(function(){var E=$(this);s2.Logger.debug("Check accordion "+this.id+E.hasClass("closed"));E.addClass("closed");if(jQuery.browser.msie6&&E.hasClass("tab")){E.addClass("tabClosed")}});s2.Logger.debug("Closing acc");C.removeClass("closed");if(jQuery.browser.msie6&&C.hasClass("tab")){C.removeClass("tabClosed")}}var A=$(".accordion.toggleContainer");if(A.filter(".tab").length>0){if((A.get(0)===C.get(0))&&!C.hasClass("tab")){C.addClass("tab")}if(A.filter(".tab").length==A.filter(".tab.closed").length){A.eq(0).removeClass("tab");if(jQuery.browser.msie6){A.eq(0).removeClass("tabClosed")}}}D.preventDefault();return false});this.initialize=function(){if(!document.getElementById("flugsuche")||document.getElementById("select")){return}if(JooseX.Culture.Factory.get().identifier()!="de-DE"){return}var H=$(".accordion.tab");var A=H.find("fieldset").append($('<div class="tabGroup"></div>'));for(var D=0,I=H.length;D<I;D++){for(var C=0,F=H.length;C<F;C++){if(D!=C){var B=H.eq(C).find("h2");var G=$('<a href="#">'+B.text()+"</a>");var E=function(J){return function(K){J.trigger("click");K.preventDefault()}};G.click(E(B));A.eq(D).find(".tabGroup").append(G)}}A.eq(D).find(".tabGroup a:last").addClass("last")}};this.openIfClosed=function(A){if(A.parent().hasClass("closed")){A.click()}}});s2.namespace("s2.tuifly.widget.inlineLabeledInput",function(){this.initialize=function(){s2.Logger.debug("Init inline labels");$("input.inlineLabel").each(function(){var A=$(this);var B=A.attr("inlineLabel");if(B==null){B=""}var E=A.attr("class").replace(/query\w+/,"").replace(/q\w+/,"");var D=A.attr("tabindex")?"tabindex='"+A.attr("tabindex")+"'":"";var F=A.after("<input type=text "+D+" class='"+E+" hidden' value='"+B+"'/>").next();setTimeout(function(){if(A.val()==""){A.hide();F.show()}},0);var G=0;var C=function H(){F.hide();A.show();A.focus();A.click();G++};F.focus(C);A.get(0).showStub=function(){F.focus()};A.change(function(){if(this.value!=""&&G==0){A.show();F.hide()}});A.get(0).showInput=function(){A.show();F.hide()};A.blur(function(){window.setTimeout(function(){if(!A.val()){F.show();A.hide()}G--},100)})})}});s2.namespace("s2.tuifly.widget.overlay",function(){var B=this;this.initialize=function(){};var C;var A;var D;this.init=function(F){var E;F.each(function(I){var G=this;if(G.initDone){return}var H=$(this);G.initDone=true;G.showOverlay=function(M,L){if(!C){C=$("div.overlay")}C.hide();if(jQuery.browser.msie&&((jQuery.browser.version.substr(0,1)=="7")||jQuery.browser.msie6)){if(!A){A=C.closest(".ssrWrapper")}if(A.length>0){A.css("position","static")}}if(jQuery.browser.msie6){if(!D){D=$(".formRow label")}if(D.length>0){D.css("position","static")}}var K=$(this);if(this.onShow){this.onShow()}if(jQuery.browser.msie&&((jQuery.browser.version.substr(0,1)=="7")||jQuery.browser.msie6)){var J=K.closest(".ssrWrapper");if(J.length>0){J.css("position","relative")}}if(!K.hasClass("overInit")){K.addClass("overInit");K.find("div.close,a.close").click(function(){K.hide();if(jQuery.browser.msie6){var N=$("select:visible");N.removeClass("invisible");if(D.length>0){D.css("position","relative")}}})}window.setTimeout(function(){B.adjustOrientation(M,K,null,L)},0);if(jQuery.browser.msie&&((jQuery.browser.version.substr(0,1)=="7")||(jQuery.browser.version.substr(0,1)=="8"))){window.setTimeout(function(){K.find(".selectNumber div").css("position","absolute")},0)}E=K.get(0)};H.click(function(J){J.stopPropagation()})});$(document).click(function(H){if(E){if(H.target!==E){$(E).hide();E=null;if(jQuery.browser.msie6){var G=$("select:visible");G.removeClass("invisible");if(D.length>0){D.css("position","relative")}}}}})};this.adjustOrientation=function(K,H,R,Q){if(!H.hasClass("adjusted")){H.show();var L=$(window).width();var P=H.offset().left+H.outerWidth();if(P>L||Q){H.addClass("leftOverlay");var E;if(R){E=R;H.width(E)}else{if(jQuery.browser.msie&&(jQuery.browser.version.substr(0,1)=="7")){E=H.attr("clientWidth")}else{E=H.outerWidth()}}var G=H.offset().left;s2.Logger.debug("curLeft "+G);var J=$(K.target);var I=J.offset().left-20;if(jQuery.browser.msie6){I=I-20}if(J.is("a.enterNumber")){I=J.offset().left}if(J.is("a.enterNumber > span.value")){I=J.parent().offset().left}s2.Logger.debug("targetLeft "+I);var M=parseInt(I-E,10);s2.Logger.debug("newLeft "+M);var O=G-M;s2.Logger.debug("delta "+O);var N=parseInt(H.css("left"),10);if(N+""=="NaN"||N==null){N=0}s2.Logger.debug("cur "+N);var F=N-O;s2.Logger.debug("left "+F);F=Math.round(F);H.css("left",F+"px");H.addClass("adjusted")}else{H.addClass("adjusted")}}H.show()}});s2.namespace("s2.tuifly.widget.ssrCountSelector",function(){var A=5;this.initialize=function(){if(!document.getElementById("mealOrderInputBox")){return}var G=false;var E=$("#SkySales").attr("action");if(E&&E.indexOf("Change")!=-1){G=true}if(G){$("#mealOrderInputBox input").each(function(){$(this).attr("initial",this.value)})}var C=function(H){var J=0;if(G){var I=parseInt($(H).attr("initial"));if(I>0){J=I}}return J};var D=false;var B=function(){if(D){return}D=true;var H=new s2.tuifly.util.Text($("#errorMealLimit"));$("#mealOrderInputBox div.ssrCountSelector").each(function(O){var M=$(this);var K=s2.tuifly.util.booking.journeyFromClass(M);s2.tuifly.widget.overlay.init(M);var J=parseInt($("#mealAvailability"+K+" > param[name=mealAvailability]").val(),10)-1;if(J<0){J=0}var L=function(){var R=0;M.parent().find(".ssrCountSelector input.number").each(function(){var S=$(this).val();if(!S||S==NaN){S=0}R+=parseInt(S,10)});return R};var N=function(){var R=0;$("#mealOrderInputBox div.ssrCountSelector.journey"+K+" input.number").each(function(){var S=$(this).val();if(!S||S==NaN){S=0}R+=parseInt(S,10)});return R};var P=function(){var S=L();var R=M.parent().find(".ssrCount");R.find(".value").text(S);R.find("input").val(S)};var Q=function(R,U,T){if(U<R){U=R}if(J==0){var S=H.get("noMenus");alert(S);U=0}if(T>J&&J>0){var S=H.get("all",{count:J});alert(S);U=J-(T-U)}if(U>A){var S=H.get("perPerson");alert(S);U=A}return U};var I=function(R){return function(W){W.preventDefault();var S=$(this).parent().find(".number");var V=S.val();if(V==null||V==""){V=0}V=parseInt(V,10)+R;var T=C(S);var U=N()+R;V=Q(T,V,U);S.val(V);P();s2.tuifly.model.Booking.SSRChangeEvent.trigger();return false}};M.find("input").typingEnded(function(){var S=parseInt(this.value,10);if(""+S=="NaN"){S=0}var R=C(this);this.value=Q(R,S,N());P();s2.tuifly.model.Booking.SSRChangeEvent.trigger()});M.find("a.plus").click(I(1));M.find("a.minus").click(I(-1))})};var F=1;$("#mealOrderInputBox a.ssrCount").each(function(){var H=$(this);var J=H.find("input").attr("disabled");if(J){H.click(function(K){K.preventDefault()});return}else{H.click(function I(N){B();var K=$(this);var L=K.parent().find(".ssrCountSelector");L.closest("div.menuItem").css("z-index",++F);var M=0;if($(L).find("span.forceLeftOrientation").length>0){M=1}L.get(0).showOverlay(N,M);N.preventDefault();return false})}})}});s2.namespace("s2.tuifly.widget.ssrLuggageCheckSelector",function(){this.initialize=function(){if(!document.getElementById("ssrLuggageBox")){return}var D=$("#CheckTable01");var C=$("#CheckTable02");var B;var E=false;var A=function(){if(E){return}E=true;$("#ssrLuggageBox div.ssrLuggageCheckSelector").each(function(L){var I=$(this);s2.tuifly.widget.overlay.init(I);var K=I.find("input:checkbox");var J=I.find("object.queryData > param[name=ssrNest]").val();var H=$("#ssrnestAvailability > param[name="+J+"]").val();var G=function(){s2.Logger.debug("Disable");if(H!=null){s2.Logger.debug("Availability "+H);var R=$("#ssrLuggageBox input:checkbox:checked[ssrNest="+J+"]").length;s2.Logger.debug("Count checked "+R);if(R==H){$("#ssrLuggageBox input:checkbox:not(:checked)[ssrNest="+J+"]").attr("disabled",true);var Q=$("#ssrLuggageBox a.ssrLuggageCheck[ssrNest="+J+"]");$.each(Q,function(){var S=$(this);if(S.parent().parent().find(".ssrLuggageCheckSelector input:checkbox:checked").length==0){S.addClass("disabled");S.parent().parent().find(".queryTooltip.deactivated").addClass("temp-activated");S.parent().parent().find(".queryTooltip.deactivated").removeClass("deactivated")}})}else{$("#ssrLuggageBox input:checkbox:not(:checked)[ssrNest="+J+"]").attr("disabled",false);$("#ssrLuggageBox a.ssrLuggageCheck[ssrNest="+J+"]").removeClass("disabled");$("#ssrLuggageBox a.ssrLuggageCheck[ssrNest="+J+"]").parent().parent().find(".queryTooltip.temp-activated").addClass("deactivated");$("#ssrLuggageBox a.ssrLuggageCheck[ssrNest="+J+"]").parent().parent().find(".queryTooltip.temp-activated").removeClass("temp-activated")}}};G();var O=function P(){var T=$(this);var U=T.attr("checkboxGroup");var S=T.attr("quota");var V=T.attr("quotamaxpass");var R=T.attr("quotamaxflight");if(this.checked){var Q=$("#ssrLuggageBox").find("input:checkbox:checked[checkboxGroup="+U+"][quota="+S+"]");Q.each(function(){var W=$(this);if(W.attr("disabled")&&W.attr("id")!=T.attr("id")){T.attr("disabled",true);W.attr("disabled",false)}});Q.attr("checked",false);this.checked=true}G();D.cachedFind(".select").each(function(Y){var X=$(this).find("input:checkbox:checked").length;var W=$(this).find(".ssrLuggageCheck");W.find(".value").text(X);W.find("input").val(X)});C.cachedFind(".select").each(function(Y){var X=$(this).find("input:checkbox:checked").length;var W=$(this).find(".ssrLuggageCheck");W.find(".value").text(X);W.find("input").val(X)});s2.tuifly.model.Booking.SSRChangeEvent.trigger()};var N;var M=function(){if(N){clearTimeout(N)}var R=this;var S=Array.prototype.slice(arguments);var Q=function(){O.apply(R,S)};N=setTimeout(Q,10)};K.change(M);K.click(M)})};var F=$("#ssrLuggageBox a.ssrLuggageCheck");F.each(function(){var G=$(this);var H=G.parent().next("div.ssrLuggageCheckSelector").find("input").length;if(H==0){G.click(function(I){I.preventDefault()})}else{G.click(function(K){if($.browser.msie&&$.browser.version.substr(0,1)=="6"){var J=$("select:visible");J.addClass("invisible")}if($(this).hasClass("disabled")){return}A();var I=$(this).parent().parent().find(".ssrLuggageCheckSelector");var L=false;if($(this).parent().parent().find(".journey0").length>0){L=true}I.get(0).showOverlay(K,L);K.preventDefault();return false})}});A()};this.activateDisabledInputs=function(){if($("#outerDivSSRs").length>0){$("#outerDivSSRs [id*='CheckBoxPassengerSsr']").removeAttr("disabled")}}});s2.namespace("s2.tuifly.widget.ssrBagSelector",function(){var C=5;var D=false;var B=false;var A=function(){if(B){return}B=true;$("#bagInputBox div.bagSelector").each(function(G){var F=$(this);s2.tuifly.widget.overlay.init(F);var E=function(K){var M=0;if(D){var L=parseInt($(K).attr("initial"));if(L>0){M=L}}return M};var H=function(K,L){if(L<K){L=K}if(L>C){L=C}return L};var J=function(L){var K=F.parent().find(".ssrCount");K.find(".value").text(L);K.find("input").val(L)};var I=function(K){return function(O){O.preventDefault();var L=$(this).parent().find(".number");var N=L.val();if(N==null||N==""){N=0}N=parseInt(N,10)+K;var M=E(L);N=H(M,N);L.val(N);J(N);s2.tuifly.model.Booking.SSRChangeEvent.trigger();return false}};F.find("input").typingEnded(function(){var L=parseInt(this.value,10);if(""+L=="NaN"){L=0}var K=E(this);L=H(K,L);this.value=L;J(L);s2.tuifly.model.Booking.SSRChangeEvent.trigger()});F.find("a.plus").click(I(1));F.find("a.minus").click(I(-1))})};this.initialize=function(){var E=$("#SkySales").attr("action");if(E&&E.indexOf("Change")!=-1){D=true}if(D){$("#bagInputBox input").each(function(){$(this).attr("initial",this.value)})}$("#bagInputBox a.ssrCount").each(function(){var F=$(this);var G=F.find("input").attr("disabled");if(G){F.click(function(H){H.preventDefault()});return}else{F.click(function(J){var H=$(this);if(H.hasClass("disabled")){return}A();var I=H.parent().parent().find(".overlay");var K=false;if(H.parent().parent().find(".journey0").length>0){K=true}I.get(0).showOverlay(J,K);J.preventDefault();return false})}})}});s2.namespace("s2.tuifly.widget.passengerInfo",function(){this.initialize=function(){if(!document.getElementById("passengerInputBox")){return}$("select.passengerSex").change(function(){s2.tuifly.model.Booking.PassengerChangeEvent.trigger()});$("input.queryFirstName, input.queryLastName").typingEnded(function(){s2.tuifly.model.Booking.PassengerChangeEvent.trigger()}).change(function(){s2.tuifly.model.Booking.PassengerChangeEvent.trigger()})}});s2.namespace("s2.tuifly.widget.cityAutocomplete",function(){var B=this;var A={matchContains:true,minChars:0,scrollHeight:271,delay:0,scroll:true,handleResult:function(C,F,D,E){if(C.showAllOnFullMatch&&F.length==1){return D}},width:"191px"};B.getSelect=function(C){return C.parent().find("select")};B.initialize=function(){var E=["ControlGroupSearchView_AvailabilitySearchInputAffiliateView_WindowLoad","ControlGroupCompactSearchSSIView_AvailabilitySearchInputAffiliateCompactSearchSSIView_WindowLoad","ControlGroupAvailabilitySearchSelectView_AvailabilitySearchInputAffiliateSelectView_WindowLoad","ControlGroupGroupbookingView_AvailabilitySearchInputGroupbookingView_WindowLoad","ControlGroupSearchView_AvailabilitySearchInputAffiliateSearchView_WindowLoad","ControlGroupCharterView_AvailabilitySearchInputCharterbookingView_WindowLoad","ControlGroupHomeView_AvailabilitySearchInputAffiliateHomeView_WindowLoad"];for(var D=0;D<E.length;D++){var C=E[D];if(!window[C]){continue}this.origInput=$("#availabilitySearchInputOriginInput");this.destInput=$("#availabilitySearchInputDestinationInput");this.inputs=$([this.origInput,this.destInput]);s2.tuifly.monkeyPatch.wrap(C,function(){B.initialBind();B.rebind();B.inputs.each(function(){var H=$(this);var F=B.getSelect(H);var K=F.get(0);if(K.selectedIndex>0){var I=$(K.options[K.selectedIndex]);var J=I.text();var G=I.val();H.val(J);if(G&&G.length==3){if(H.hasClass("destination")){s2.tuifly.controller.FlightSearch.getInstance().setDestCode(G)}else{s2.tuifly.controller.FlightSearch.getInstance().setOrigCode(G);s2.tuifly.model.flightSearch.InitializedEvent.observeOnce(function(){s2.tuifly.model.flightSearch.OrigChangeEvent.trigger(G)})}}}})})}};B.initialBind=function(){var E;var C;var D=s2.tuifly.model.flightSearch.StationManager.getInstance();this.inputs.each(function(){var G=$(this);var I=[];G.autocomplete(I,A);var H=false;var K=function(N){var V=B.getSelect(G);var S=0;var M;var Q="";var T=false;var P=$("<pre>"+N+"</pre>");var X=P.find(".zugZumFlug");if(X.size()>0){T=true}N=P.text();var O=P.find("span[value]").attr("value");if(O){N=O}inputVal=N;if(G.attr("abbreviate")){var R="...";var U=new s2.tuifly.util.TextMetrics(G,inputVal);var L=G.width();if((0<L)&&(L<U.width())){inputVal=inputVal.substr(0,U.getIndexAtX(L-(new s2.tuifly.util.TextMetrics(G,R).width())))+R}G.data("completeValue",N)}else{G.removeData("completeValue")}G.val(inputVal);var W=D.findStation(N);if(W){Q=W.getIataCode();V.val(Q);if(!H&&jQuery.inArray(Q,notAllowedAfricanDeparture)>=0){return}if(V.val()!=Q){V.append('<option value="'+Q+'">'+W.toString()+"</option>");V.val(Q)}if(Q==N.toUpperCase()){G.val(W.toString())}if(H){s2.tuifly.model.flightSearch.DestChangeEvent.trigger(Q,T)}else{s2.tuifly.model.flightSearch.OrigChangeEvent.trigger(Q,T)}s2.Logger.debug("Picked "+V.val())}};G.result(function F(L,M,N){K(N)});G.change(function(){K(this.value)});if(G.hasClass("origin")){E=G}else{if(G.hasClass("destination")){C=G;H=true}else{throw"missing queryCity class"}}var J;G.click(function(N){var M=$(this);if(J==null){J=G.offset()}var L=M.width()-15+J.left;if(N.pageX>L){s2.Logger.debug("Click in range");M.trigger("s2:closeIfOpen")}else{s2.Logger.debug("Click out of range")}});G.focus(function(M){var O=M.target;if(O.setSelectionRange){try{M.target.setSelectionRange(0,O.value.length)}catch(N){s2.Logger.debug("SetSelectionError "+N)}}else{if(O.createTextRange){try{var L=O.createTextRange();L.collapse(true);L.moveEnd("character",0);L.moveStart("character",O.value.length);L.select()}catch(N){s2.Logger.debug("SetRangeError "+N)}}}})});s2.tuifly.controller.FlightSearch.getInstance().navitairReady()};B.getValues=function(C){var E=[];var D=0;C.parent().find("option").each(function(){if(D++==0){return}E.push($(this).text())});return E};B.rebind=function(){s2.Logger.debug("Rebind orig/dest")}});s2.namespace("s2.tuifly.widget.submittableForm",function(){var module=this;var eleIndex=0;this.clickButton=function(button){try{button.triggerHandler("click")}catch(e){s2.Logger.debug(e)}};this.evalHref=function(button){try{var href=button.attr("href");if(href.indexOf("javascript:")==0){eval(href.replace("javascript:",""))}}catch(e){s2.Logger.debug(e)}};this.initialize=function(){$("#SkySales").each(function(){var form=$(this);form.append("<input type=submit style='display:none' /><input type=image width=0 height=0 value='' src='/skyres/images/trans.gif' />");form.submit(function onSubmit(e){e.preventDefault();var currentFocus=s2.tuifly.widget.focusManager.getFocused();if(currentFocus){var source=$(currentFocus);while(source.length>0){var found=false;Joose.A.each(["a.bookingButton","a.returnButton"],function(selector){var button=source.find(selector);if(button.length==1&&source.find(".queryPseudoForm "+selector).length==0){module.clickButton(button);found=true;return false}});if(found){return false}source=source.parent()}}return false})})}});s2.namespace("s2.tuifly.widget.formRowHighlighter",function(){var C=null;var A=this;var B;this.initialize=function(){s2.tuifly.widget.focusManager.FocusChangeEvent.observe(function(E,D){D=$(D);if(D.is(":input")||D.is("a.enterNumber")){if(B){A.toggleParent($(B),"focused")}A.toggleParent(D,"focused");B=D}})};this.toggleParent=function(E,D){var F=E;if(!D){D="focused"}while(F.length>0){if(F.hasClass("formRow")||F.is("tr.queryformRow")){F.toggleClass(D)}F=F.parent()}}});s2.namespace("s2.tuifly.widget.requiredFormFields",function(){this.initialize=function(){var A=$.cachedFind("label.requiredField");A.append("<span> *</span>")}});s2.namespace("s2.tuifly.widget.sizedIFrame",function(){this.initialize=function(){var A=this;if(A.resize()){s2.tuifly.events.DocResize.observeLazy(function(){A.resize()})}$(window).load(function(){A.resize()})};this.resize=function(C){try{var B=window.name;if(window!==parent&&parent.frames&&parent.frames[B]){var A=$("body div.myTuiFly").height();var D=parent.jQuery("#"+B+".autoSize");D.height(A);if(!C){top.scrollTo(0,0)}return true}return false}catch(E){s2.Logger.debug(E)}}});s2.namespace("s2.tuifly.widget.loadingButton",function(){var buttonsSelector="a.bookingButton:not(.noClickEvent)";this.cancelSpinAllButtons=function(){var self=this;var buttons=$(buttonsSelector);buttons.each(function(){self.unSpinButton($(this))})};this.unSpinButton=function(button){if(button.hasClass("loading")){button.removeClass("loading");button.find(".loadingImage").remove()}};this.initialize=function(){var self=this;var spinButton=function(button){if(!button.hasClass("loading")){button.children("span").prepend("<span class='loadingImage'></span>");button.addClass("loading")}};var unSpinButton=function(button){self.unSpinButton(button)};var cancelSpin=function(){self.cancelSpinAllButtons()};s2.tuifly.events.AjaxEndEvent.observe(cancelSpin);var buttons=$(buttonsSelector);buttons.each(function(){var button=$(this);var curClick=this.onclick;this.onclick=function(){};button.click(function(e){var self=$(this);spinButton(self);e.preventDefault();var result;if(!s2.tuifly.validation.checkBeforeSkySalesValidation()){return false}if(typeof curClick=="function"){result=curClick.call(this,e)}if(result!==false){s2.tuifly.widget.ssrLuggageCheckSelector.activateDisabledInputs();s2.tuifly.helper.zugZumFlug.activateDisabledInputs();var href=self.attr("href");if(href&&href.indexOf("javascript:")==0){window.setTimeout(function(){eval(href.replace("javascript:",""))},10)}else{if(href&&href.length>0){if(self.attr("target")=="_top"){window.top.location.href=href}else{if(self.attr("target")=="_parent"){window.parent.location.href=href}else{if(self.attr("target")=="_blank"){window.open(href)}else{location.href=href}}}}}}else{unSpinButton(button)}return result})})}});s2.namespace("s2.tuifly.widget.tooltip",function(){var B=this;var A=0;this.initialize=function(){};var C={};$("div.queryTooltip,span.queryTooltip").live("mouseover",function(){var D=$(this);var E=D.attr("id");if(!E||!C[E]){B.init(D);D.mouseover()}});this.init=function(E){var D=this;E.each(function(){var K;var L=function(){if(K){K.remove();K=null}};var M=$(this);var H=M.attr("id");if(H==null||H==""){M.attr("id","anonTooltip"+(++A))}C[H]=true;var J,I,N;var O=$(this);var F=O.attr("id");var G=$("select:visible");M.mouseover(function(S){try{if($.browser.msie&&$.browser.version.substr(0,1)=="6"&&!M.hasClass("deactivated")){G.addClass("invisible")}L();var R=$(this).find(".queryTooltipContent");if(!R.closest(".queryTooltip").hasClass("deactivated")){K=R.clone();D.createTooltip(K,S)}}catch(S){s2.Logger.debug("Error: "+S);return}try{J=J!=null?J:O.offset();I=I!=null?I:O.outerWidth();N=N!=null?N:O.outerHeight();$(window).bind("resize",function(){J=null;I=null;N=null});var P=5;var Q=function(T){try{s2.Logger.debug("offset[left:top] ["+J.left+":"+J.top+"]");s2.Logger.debug("width ["+I+"], height ["+N+"]");s2.Logger.debug("mouse[x:y] ["+T.pageX+":"+T.pageY+"]");if(T.pageX<J.left-P||T.pageX>J.left+I+P||T.pageY<J.top-P||T.pageY>J.top+N+P){s2.Logger.debug("Simulate mouseout ");L();$(document).unbind("mousemove",Q);$(O).trigger("mouseout")}}catch(T){s2.Logger.debug("MouseMove error: "+T)}};if(I>0&&N>0){}else{s2.Logger.debug("we have no width and height, so we do not listen to the mousemove event ["+F+"]")}}catch(S){s2.Logger.debug("MouseoverError: "+S)}});M.mouseout(function(){if($.browser.msie&&$.browser.version.substr(0,1)=="6"&&!M.hasClass("deactivated")){G.removeClass("invisible")}L()})})},this.createTooltip=function(D,E){if(D.hasClass("initTooltip")){D.show();return}D.addClass("initTooltip");D.hide();D=this.calculatePosition(D,E);D.css("position","absolute");D.css("z-Index",999999999);$("body").append(D);window.setTimeout(function(){s2.tuifly.widget.overlay.adjustOrientation(E,D,330);D.show()},0)},this.calculatePosition=function(D,G){if(D.hasClass("calculated")){return D}D.addClass("calculated");var I=D.attr("posX")||0;var H=D.attr("posY")||0;var F=$(G.target);var E=F.offset();I=Math.round(E.left+F.width()+parseInt(I));H=Math.round(E.top);D.css("left",I+"px");D.css("top",H+"px");return D}});s2.namespace("s2.tuifly.widget.dialog",function(){var A={closeOnEscape:true,modal:true,bgiframe:true,draggable:true,resizable:false,zIndex:9999,height:"auto",width:"450px",innerWidthIE:"375px",autoOpen:false,autoResize:false,overlay:{backgroundColor:"black",opacity:0.3}};this.initialize=function(){window.origAlert=window.alert;window.alert=function(F,E){s2.tuifly.widget.dialog.alert(F,E)}};this.copyOptions=function(){var F={};for(var E in A){F[E]=A[E]}return F};this.getTitle=function(E){if(E&&E.title){return E.title}var H;var G=JooseX.Culture.Factory.get().majorIdentifier();var F={de:"Achtung",en:"Attention",it:"Considerazione",es:"Considerar"};return F[G]};this.getTitleNotice=function(E){if(E&&E.title){return E.title}var H;var G=JooseX.Culture.Factory.get().majorIdentifier();var F={de:"Hinweis",en:"Hint",it:"Indicazione",es:"Nota"};return F[G]};var D=function(J,G){var F=J;var H="";if(G){F=J+""+G;H=G}var I=$("#"+F);if(I.length>0){I.empty();B=I;return B}var E=$("body");B=E.append('<div id="'+F+'" class="'+H+'"></div>').find("#"+F);return B};var C=false;this.confirm=function(F,E){if(E){E.confirm=1}s2.tuifly.widget.dialog.alert(F,E)};this.alertNotice=function(F,E){if(!E){E={}}E.view="note";E.title=this.getTitleNotice(E);s2.tuifly.widget.dialog.alert(F,E)};this.replaceLinebreak=function(E){E=E.replace(/\n/,"<br />");return E};this.alert=function(G,F){if(C){return}if(!F){F={}}if(!F.forceIframeAlert&&window!=parent){try{if(parent.s2){return parent.s2.tuifly.widget.dialog.alert(G,F)}else{return parent.alert(G)}}catch(I){return origAlert(G)}}if(typeof(G)=="undefined"){G="undefined"}else{if(typeof(G)!="string"){G=G.toString()}}G=this.replaceLinebreak(G);var Q=this.copyOptions();if(!F){F={}}jQuery.extend(Q,F);F=Q;C=true;var E=D("s2AlertBox");E.html(G);var L=function(){C=false};var P=function(R){var S=function(){E.dialog("close");L();if(typeof R=="function"){R()}};window.setTimeout(S,10)};var K;var H=F.okCallback;if(typeof(H)=="function"){K=function(){P(H)}}else{K=P}var O;var N=F.cancelCallback;if(typeof(N)=="function"){O=function(){P(N)}}else{O=P}if(Q.confirm){var J={};J[Q.okButtonText]=K;J[Q.cancelButtonText]=O;var F={};F.buttons=J;F.dialogClass=Q.dialogClass;if(!F.dialogClass){F.dialogClass="confirmBox"}jQuery.extend(Q,F)}else{if(!Q.noButtons){jQuery.extend(Q,{buttons:{OK:K},dialogClass:""})}}if(!Q.title){var M=this.getTitle(Q);Q.title=M}E.dialog(Q);E.bind("dialogclose",L);if($.browser.msie&&$.browser.version.substr(0,1)=="6"){$(E).css("width",Q.innerWidthIE)}$(E).css("height","");if(Q.confirm){$("#s2AlertBox").parent().parent().find("button").each(function(R){if(R==0){$(this).addClass("buttonOK")}if(R==1){$(this).addClass("buttonCancel")}$(this).wrapInner(document.createElement("span"))})}E.dialog("open");if(Q.view=="note"){if(!Q.confirm){$(".ui-dialog-buttonpane").addClass("hint")}$(".ui-dialog-container").addClass("hint")}if(Q.fixTop){$(".ui-dialog").css("top",Q.fixTop+"px")}};var B;this.ajaxLayer=function(F,E,G,H,J){if(C){return}this.prepare(E,G);if(F.match(/\?/)){F+="&"}else{F+="?"}F+="noCache="+Math.random().toString();var I=$.get;if(J&&(J.toUpperCase()=="POST")){I=$.post}I(F,H,function(K){s2.Logger.debug("Data arrived");B.find(".waitMessage").addClass("hidden");B.html(K);B.dialog("open");var L=G.callback;if(L&&typeof(L)=="function"){L(K)}})};this.divLayer=function(G,E,F){if(C){return}this.prepare(E,F);B.html(G.html());B.dialog("open")};this.prepare=function(F,G){var E=this.copyOptions();F=F?F:"s2AlertBox";E=jQuery.extend(E,{width:"700px"});if(G){E=jQuery.extend(E,G)}B=D(F,"ajaxLayer");B.dialog(jQuery.extend(E,{draggable:false}));if(G.message){$(B).html('<div class="waitMessage">'+G.message+"</div>")}C=true};this.myTUIflyLayer=function(E){var F={width:"825px",height:"517px",dialogClass:"myTUIflyLayer",callback:s2.tuifly.helper.mytuiflyLoginBox.prepare};this.ajaxLayer(E,"myTUIfly",F)};this.bordshopLayer=function(E){var F={width:"625px",height:"410px",dialogClass:"myTUIflyLayer"};this.ajaxLayer(E,"myTUIfly",F)};this.darkSiteLayer=function(E){var F={width:"805px",height:"482px",dialogClass:"darkSiteLayer"};this.ajaxLayer(E,"darkSite-",F)};this.tuiHotelDetailLayer=function(E,G){var F={width:"905px",height:"503px",dialogClass:"tuiHotelDetailLayer",message:G};this.ajaxLayer(E,"tuiHotelDetail-",F)};this.tuiHotelVariationsLayer=function(E,G){var F={width:"481px",height:"416px",dialogClass:"tuiHotelVariationsAjaxLayer",message:G};this.ajaxLayer(E,"TUIHotelVariationBox-",F)};this.notepadLayer=function(){var E={width:"420px",height:"auto",dialogClass:"notepadLayer"};this.divLayer($("#notepadLayer"),"notepad-",E)};this.priceAlarmConfirmLayer=function(){var E={width:"372px",height:"380px",dialogClass:"priceAlarmConfirmLayer"};this.divLayer($("#priceAlarmConfirmLayer"),"priceAlarmConfirm-",E)};this.priceAlarmStoreLayer=function(){var E={width:"372px",height:"380px",dialogClass:"priceAlarmStoreLayer"};this.divLayer($("#priceAlarmStoreLayer"),"priceAlarmStore-",E)};this.notepadPreviewLayer=function(E,H,G){var I=function(J){var K=$("#notepadPreview-ajaxLayer");K.prepend('<div id="opacityDiv"></div>');$(".notepadPreviewLayer .ui-dialog-titlebar").prepend(G)};var F={width:"710px",height:"665px",dialogClass:"notepadPreviewLayer",callback:I};this.ajaxLayer(E,"notepadPreview-",F,H,"POST")};this.christmasLayer=function(E){var F={width:"790px",height:"700px",dialogClass:"christmasLayer"};this.ajaxLayer(E,"christmas-",F)};this.selectViewLayer=function(F,G){var E={width:"790px",height:G,dialogClass:"selectViewLayer"};this.divLayer(F,"selectView-",E);F.find(".layerContent").html("")};this.updateBrowser=function(){var E={width:"420px",height:"auto",dialogClass:"updateBrowserLayer"};this.divLayer($("#updateBrowser"),"updateBrowser-",E)};this.emailMissingLayer=function(E){var F={width:"420px",height:"auto",dialogClass:"standardLayer"};this.ajaxLayer(E,"standard-",F)};this.standardLayer=function(F,E){if(!E){E={}}if(typeof(F)=="string"){content=$.get(F,function(G){var I=$("h1",G).html();E.title=I;var H=$(".contentDialog",G).html();alert(H,E);if(E.noDefaultButton){$(".ui-dialog button").addClass("hidden");$(".ui-dialog button").after("<br /><br />")}})}else{if(typeof(F)=="object"){alert($(".content",F).html(),E);if(E.noDefaultButton){$(".ui-dialog button").addClass("hidden");$(".ui-dialog button").after("<br /><br />")}}}if(E.view=="note"){$(".ui-dialog-container, .ui-dialog-buttonpane").addClass("hint")}};this.ajaxLayerClose=function(){if(B){C=false;B.dialog("close")}};this.divLayerClose=function(){this.ajaxLayerClose()}});s2.namespace("s2.tuifly.widget.fader",function(){this.crossfade=function(A,B){$(A).fadeOut("fast",function(){$(B).fadeIn("fast")})}});s2.namespace("s2.tuifly.widget.hintMessage",function(){this.initialize=function(){if(!document.getElementById("hintMessageBox")){return}var A=$("input[hintMessage]");A.focus(function(){$(this).closest(".formRow").addClass("noFocused");$("#hintMessageBox").html($(this).attr("hintMessage"));$("#hintMessageBox").fadeIn("fast")});A.blur(function(){$("#hintMessageBox").html("");$("#hintMessageBox").css("display","")})}});s2.namespace("s2.tuifly.widget.toggleCheckbox",function(){var A=$("div.toggleCheckbox > input[type='checkbox']");this.initialize=function(){A.live("click",function(){var B=$(this).parents("div.toggleDisplay");B.toggleClass("disabled")})}});s2.namespace("s2.tuifly.widget.customSelect",function(){var A={hoverClass:"over"};this.initialize=function(){};this.convert=function(B){if(!B){B=""}$(""+B+" div.queryCustomSelects").each(function(){var F=$(this);if(F.hasClass("init")){return}F.addClass("init");var E=jQuery.extend({},A);var D=F.attr("maxlength");if(D){E.maxlength=D}var C=F.attr("abbreviate");if(C){E.abbreviate=true}F.find("select").selectbox(E)})}});s2.namespace("s2.tuifly.widget.date",function(){this.createYearPulldown=function(C,F){if($(C).length>0){var A=new Date();var H=A.getFullYear();var G=A.getMonth()+1;var J=this.buildPartnerBannerValue;var D=this.buildPartnerBannerString;if(F=="partnerBanner"){J=this.buildPartnerBannerValue;D=this.buildPartnerBannerString}else{if(F=="csLanding"){J=this.buildCSLandingValue;D=this.buildCSLandingString}}$(C).empty();for(var E=0;E<13;E++){var I=J.apply(this,[G,H]);var K=D.apply(this,[G,H]);var B=$("<option>");B.attr("value",I);B.html(K);$(C).append(B);if(G==12){G=1;H+=1}else{G++}}}};this.createPartnerBannerYearPulldown=function(A){this.createYearPulldown("#"+A,"partnerBanner")};this.createCompactSearchLandingYearPulldown=function(A){this.createYearPulldown(A,"csLanding")};this.buildPartnerBannerValue=function(B,A){B=this.formatMonth(B);return A.toString()+B};this.buildPartnerBannerString=function(D,C){var A=D-1;var B=this.getMonthList();return B[A]+" "+C.toString()};this.buildCSLandingValue=function(B,A){B=this.formatMonth(B);return A.toString()+"-"+B};this.buildCSLandingString=function(E,D){var B=E-1;var C=this.getMonthList();var A=C[B];return A+" "+D.toString()};this.formatMonth=function(A){if(A<10){A="0"+A.toString()}return A};this.getMonthList=function(){var A=JooseX.Culture.Factory.get().majorIdentifier();if(A=="en"){A=""}return $.datepicker.regional[A].monthNames}});s2.namespace("s2.tuifly.widget.footer",function(){this.initialize=function(){if($("textarea#quicktown").length==0){return}var D=new s2.tuifly.util.Query(location.hash);if(D.param("culture")){JooseX.Culture.setCurrentCulture(D.param("culture"))}$("a#destFooterLink_"+JooseX.Culture.Factory.get().identifier()).addClass("current");var E=JooseX.Culture.Factory.get().majorIdentifier();var A=JooseX.Culture.Factory.get().identifier();var C=s2.tuifly.util.Skin.get().identifier();var B="";$.getJSON("/pregenerated/"+E+"/farefinder/"+C+"/orig-dest-pairs.json",function(F){if(typeof F.countryAirports=="object"){$.each(F.countryAirports,function(H,J){var I=F.countryName[J.countryCode];if(B!=""){B+=" &bull; "}B+='<b><a href="/farefinder/bestoffers?destination='+J.countryCode+((A=="de-DE")?(""):("&culture="+A))+'">'+I+":</a></b> ";var G="";$.each(J.airports,function(K,M){var L=F.iataCodes[M];if(G!=""){G+=" &bull; "}G+='<a href="/farefinder/bestoffers?destination='+M+((A=="de-DE")?(""):("&culture="+A))+'">'+L+"</a>"});B+=G});$("textarea#quicktown").text(B)}})}});s2.namespace("s2.tuifly.widget.skysalesError",function(){this.initialize=function(){if(document.getElementById("skysalesErrorMessageBox")){var A=$("#skysalesErrorMessageBox h1").html();s2.tuifly.widget.dialog.standardLayer($("#skysalesErrorMessageBox"),{title:A})}else{if(document.getElementById("skysalesNoticeMessageBox")){var A=$("#skysalesNoticeMessageBox h1").html();s2.tuifly.widget.dialog.standardLayer($("#skysalesNoticeMessageBox"),{title:A,view:"note"})}}}});s2.namespace("s2.tuifly.widget.tuiBanner",function(){var A=this;this.load=function(){if(this.required()){$("#tuiBanner").click(A.track);$("#tuiBanner").show()}};this.required=function(){if(!document.getElementById("select")){return false}if(!document.getElementById("tuiBanner")){return false}if($("#travelOptions input:checked").val()=="OneWay"){return false}if(JooseX.Culture.Factory.get().identifier()!="de-DE"){return false}return true};this.track=function(){var B=this;if(s){s.linkTrackVars="events,eVar1";s.linkTrackEvents="event7";s.eVar1="TUIPauschalreisen_BU_705_P_K4709V1";s.events="event7";s.tl(B,"o","Teaserclick_Pauschalreisen")}}});s2.namespace("s2.tuifly.widget.lturBanner",function(){var B=this;var C=4;this.load=function(){if(this.required()){$("#lturBanner").show();var I={day:$("#ControlGroupAvailabilitySearchSelectView_AvailabilitySearchInputSelectView_DropDownListMarketDay1").val(),month_year:$("#ControlGroupAvailabilitySearchSelectView_AvailabilitySearchInputSelectView_DropDownListMarketMonth1").val()};var E={day:$("#ControlGroupAvailabilitySearchSelectView_AvailabilitySearchInputSelectView_DropDownListMarketDay2").val(),month_year:$("#ControlGroupAvailabilitySearchSelectView_AvailabilitySearchInputSelectView_DropDownListMarketMonth2").val()};var H=Date.parse(I.month_year+"-"+I.day+"T00:00:00");var G=Date.parse(E.month_year+"-"+E.day+"T00:00:00");var F=(G-H)/1000/3600/24;var D={foah:$("#ControlGroupAvailabilitySearchSelectView_AvailabilitySearchInputSelectView_DropDownListMarketOrigin1").val(),zo:"zo"+$("#ControlGroupAvailabilitySearchSelectView_AvailabilitySearchInputSelectView_DropDownListMarketDestination1").val(),start_datum:H.toString("dd.MM.yyyy"),end_datum:G.toString("dd.MM.yyyy"),rd_min:F,SEA_adults:$("#ControlGroupAvailabilitySearchSelectView_AvailabilitySearchInputSelectView_DropDownListNewPassengerType_ADT").val(),group:"kat",num_results:C};jQuery.getJSON("http://www.ltur.com/de/ajax_search.ltml?callback=?",D,function(J){B.loadingFinished(J)})}};this.loadingFinished=function(D){if(!D||(D.length==0)||(D.length==1&&D[0].routingExists=="0")){$("#lturBanner").hide();return}var H=this.getCheapestOffers(C,D);for(var E=0;E<H.length;E++){var G=H[E];if(G){var F=this.createOffer(E+1,G);F.paint()}}$("#lturBanner .q-Loading").hide();$("#lturBanner .q-LturOffer").fadeIn("1000")};this.getCheapestOffersPerCategory=function(E,D){var H={};var J=[];for(var G=0;G<E.length;G++){var F=E[G];H[F]=false}for(var G=0;G<D.length;G++){var I=D[G];if(!H.E&&I.HotelCategory=="E"){J.push(I);H.E=true}if(!H.M&&I.HotelCategory=="M"){J.push(I);H.M=true}if(!H.G&&I.HotelCategory=="G"){J.push(I);H.G=true}if(!H.L&&I.HotelCategory=="L"){J.push(I);H.L=true}}return J};this.getCheapestOffers=function(F,D){var G=[];var E=0;while(E++<F){G.push(D[E-1])}return G};this.createOffer=function(H,G){var D=$("#lturOfferTemplate").html();var F=new A(H,G);var E=$(D);E.attr("id","lturOffer"+H);F.element=E;return F};this.required=function(){if(!document.getElementById("select")){return false}if(!document.getElementById("lturBanner")){return false}if($("#travelOptions input:checked").val()=="OneWay"){return false}if(JooseX.Culture.Factory.get().identifier()!="de-DE"){return false}return true};var A=function(F,E){var D=this;this.id=F;this.data=E;this.paint=function(){$("#lturBanner .q-Content").append(this.element);var J=this.element;var M=this.data;if(M){var L=location.protocol+"//asn.advolution.de/000034f35000000b4/url="+location.protocol+"//www.ltur.com"+M.ListLink;this.url=L+"&CID=700.2.1";var G=M.Picture;G=G.replace("http:",location.protocol);var I=$("<a/>");$(I).attr("href",this.lturLink());$(I).attr("target","_blank");var H=$("<img width='145' />");$(H).attr("src",G);$(H).addClass("hotelImage");$(I).html($(H));J.find(".q-Image").html($(I));J.find(".hotelName").html(M.Hotel.replace("&amp;","&"));this.insertStars();J.find(".hotelLocation").html(M.HotelOrt.replace("&amp;","&"));var K=M.PriceAdultF;K=K.replace("&amp;","&");J.find(".q-PriceValue").html(K);J.find(".q-Price a").attr("href",this.lturLink())}};this.insertStars=function(){var H=this.getStars();var G=this.element;if(typeof H=="number"){$(G).find(".category").addClass("stars"+H)}};this.getStars=function(){var H={E:2,M:3,G:4,L:5};var G=0;if(this.data){G=H[this.data.HotelCategory]}return G};this.lturLink=function(){var G="LTURPauschalreisen_BU_705_P_K4909V1";var H=Base64.encode(this.url);return"/specials/partnerframe/index.php?lang=DEU&sub=tui&scte="+G+"&suburl="+H}}});s2.namespace("s2.tuifly.widget.pauschalreiseBanner",function(){var A=this;var B={TUI:"tui",LTUR:"ltur"};this.initialize=function(){if(document.getElementById("select")){setTimeout("s2.tuifly.widget.pauschalreiseBanner.start()")}};this.start=function(){var C=$("#ControlGroupAvailabilitySearchSelectView_AvailabilitySearchInputSelectView_DropDownListMarketDestination1").val();var D=this.providerMap[C];if(D==B.TUI){s2.tuifly.widget.tuiBanner.load()}else{if(D==B.LTUR){$(window).load(function(){s2.tuifly.widget.lturBanner.load()})}else{$(window).load(function(){s2.tuifly.widget.lturBanner.load()})}}};this.providerMap={ACE:"tui",ADB:"tui",AGA:"tui",AGP:"ltur",ALC:"ltur",ALG:"ltur",AYT:"tui",BCN:"ltur",BDS:"ltur",BKK:"tui",BOJ:"tui",BRE:"ltur",BRI:"ltur",BSL:"ltur",BVC:"tui",CAG:"ltur",CAI:"ltur",CFU:"tui",CGN:"tui",CLY:"ltur",CPT:"ltur",CTA:"ltur",CUN:"tui",DBV:"ltur",DLM:"tui",DRS:"ltur",DTM:"ltur",DUS:"ltur",ERF:"ltur",FAO:"tui",FCO:"ltur",FDH:"ltur",FKB:"ltur",FMM:"ltur",FMO:"ltur",FNC:"tui",FRA:"ltur",FUE:"tui",GPA:"tui",GRZ:"ltur",HAJ:"tui",HAM:"tui",HER:"tui",HKT:"tui",HRG:"tui",IBZ:"tui",INN:"ltur",JFK:"tui",KGS:"tui",KLU:"ltur",KLX:"tui",LEJ:"ltur",LPA:"tui",LXR:"tui",MAH:"tui",MBA:"tui",MBJ:"tui",MIA:"tui",MLE:"tui",MLH:"ltur",MUC:"ltur",MXP:"ltur",NAP:"ltur",NDR:"ltur",NRN:"ltur",NUE:"ltur",OLB:"ltur",OPO:"ltur",PAD:"ltur",PMI:"tui",PMO:"ltur",POP:"tui",PSA:"ltur",PUJ:"tui",RHO:"tui",RJK:"ltur",RMF:"tui",RMI:"ltur",RSW:"tui",SCN:"ltur",SID:"tui",SKG:"tui",SSH:"tui",STR:"ltur",SZG:"ltur",TFS:"tui",TLV:"tui",TNG:"ltur",TUN:"ltur",TXL:"ltur",VAR:"tui",VCE:"ltur",VLC:"ltur",VRA:"tui",WDH:"tui",XRY:"tui",ZQW:"ltur"}});s2.namespace("s2.tuifly.widget.IEUpdateBanner",function(){this.initialize=function(){if($.browser.msie6&&location.href.match(/index\.html/)){var E='<div id="updateIE"><div class="floatRight"><a href="#" onclick="$(\'#updateIE\').hide();"><img src="/skyres/images/buttons/tuiHotelLayerClose.gif" /></a></div><div class="updateBrowser">';var D=JooseX.Culture.Factory.get().majorIdentifier();var C="";if(D=="de"){C='<A href="http://www.mozilla-europe.org/de/" target=_blank><IMG src="/images/elements/ie_update_ff.png"></A><A href="http://www.google.com/chrome" target=_blank><IMG src="/images/elements/ie_update_chrome.png"></A> <A href="http://www.microsoft.com/germany/windows/internet-explorer/" target=_blank><IMG src="/images/elements/ie_update_ie.png"></A></div><p><STRONG>Hinweis:</STRONG> Sie verwenden eine veraltete Version Ihres Webbrowsers. Die Darstellung und Funktionalit&auml;t dieser Seite wird dadurch evtl. eingeschr&auml;nkt. <STRONG>Besser, schneller und sicherer im Web mit einem modernen Browser.</STRONG></p>'}else{if(D=="en"){C='<A href="http://www.mozilla-europe.org/en/" target=_blank><IMG src="/images/elements/ie_update_ff.png"></A> <A href="http://www.google.com/chrome?hl=en" target=_blank><IMG src="/images/elements/ie_update_chrome.png"></A> <A href="http://www.microsoft.com/windows/internet-explorer/" target=_blank><IMG src="/images/elements/ie_update_ie.png"></A></div><p><STRONG>Note:</STRONG> You are using an outdated version of your Web browser. This may limit the display options and functionality of this page and site. <STRONG>For a better, faster Web experience, please update to a more advanced browser.</STRONG></p>'}else{if(D=="it"){C='<A href="http://www.mozilla-europe.org/it/" target=_blank><IMG src="/images/elements/ie_update_ff.png"></A> <A href="http://www.google.com/chrome?hl=it" target=_blank><IMG src="/images/elements/ie_update_chrome.png"></A> <A href="http://windows.microsoft.com/it-IT/windows/downloads" target=_blank><IMG src="/images/elements/ie_update_ie.png"></A> </div><p><STRONG>Nota:</STRONG> state usando la versione vecchia del vostro Browser. Visualizzazione e funzionalit&agrave; di questa pagina potrebbero perci&ograve; essere limitate. <STRONG>Navigate meglio e pi&ugrave; rapidamente con un Browser aggiornato.</STRONG></p>'}else{if(D=="es"){C='<A href="http://www.mozilla-europe.org/es/" target=_blank><IMG src="/images/elements/ie_update_ff.png"></A> <A href="http://www.google.com/chrome?hl=es" target=_blank><IMG src="/images/elements/ie_update_chrome.png"></A> <A href="http://windows.microsoft.com/es-ES/windows/downloads" target=_blank><IMG src="/images/elements/ie_update_ie.png"></A></div><p><STRONG>Nota:</STRONG> est&aacute; utilizando una versi&oacute;n antigua de su navegador. Es posible que, debido a ello, quede limitada la presentaci&oacute;n y funcionalidad de esta p&aacute;gina. <STRONG>Con un navegador moderno podr&aacute; moverse mejor y m&aacute;s r&aacute;pido en Internet.</STRONG></p>'}}}}var B="</div>";var A=E+C+B;$("body").prepend(A)}}});s2.namespace("s2.tuifly.flash.airportMap",function(){var E=this;var A="flashMap";var F,D;E.initialize=function(){var G=E.flashMovie(A);if(G){s2.Logger.debug("Have a flash map "+G.id)}};var C;E.sortedStations=function(){if(C){return C}var J=s2.tuifly.model.flightSearch.StationManager.getInstance();var K=J.stationByIataCode;var I={};var H=[];Joose.O.each(K,function(L,M){H.push(L)});C=J.sortStations(H);var G=new s2.tuifly.model.flightSearch.Station({iataCode:"ZRH",longName:"Zürich",validDest:true,dests:["CGN"],country:"AT"});return C};E.getStations=function(){s2.Logger.debug("Flash: getStations");var G=E.sortedStations();var H={};Joose.A.each(G,function(J){H[J.getIataCode()]=J.asNavitairStation()});var I=[];for(i in H){I.push(H[i])}return I};E.getAirportCountryMapping=function(){s2.Logger.debug("Flash: getAirportCountryMapping");var H=[];var G=E.sortedStations();Joose.A.each(G,function(I){H.push({airportCode:I.getIataCode(),countryCode:I.getCountry()})});return H};E.getCurrentStations=function(){s2.Logger.debug("Flash: getCurrentStations");var G=s2.tuifly.controller.FlightSearch.getInstance();return[G.getOrigCode(),G.getDestCode()]};E.fireOriginChanged=function(H){s2.Logger.debug("notify flash origin");D=H;var G=E.flashMovie(A);if(G&&G.eventOriginChanged){G.eventOriginChanged(H)}$("input[name=scorigin]").val("CS-Home");return true};E.fireDestChanged=function(H){s2.Logger.debug("notify flash dest");F=H;var G=E.flashMovie(A);if(G&&G.eventDestChanged){G.eventDestChanged(H)}$("input[name=scorigin]").val("CS-Home");return true};E.clearStations=function(){s2.tuifly.controller.FlightSearch.getInstance().clear()};E.eventOriginChanged=function(I,J){s2.Logger.debug("Flash fires origin changed "+I);if(I!=null&&I!=""){var H=$("#availabilitySearchInputOriginInput");var G=s2.tuifly.controller.FlightSearch.getInstance();var K=G.getOrigCode();if(K!=I){G.closeAutocomplete();H.val(I);H.change()}if(J){$("input[name=scorigin]").val("FLASH_MAP")}}return true};E.eventDestChanged=function(I,L,J){s2.Logger.debug("Flash fires dest changed "+I);if(I!=null&&I!=""){var H=$("#availabilitySearchInputDestinationInput");var G=s2.tuifly.controller.FlightSearch.getInstance();var K=G.getDestCode();if(K!=I){G.closeAutocomplete();H.val(I);H.change();s2.tuifly.model.flightSearch.DestChangeEvent.trigger(I,L)}if(J){$("input[name=scorigin]").val("FLASH_MAP")}}return true};E.eventPOIChanged=function(G){G=G.toUpperCase();$("div.selectDestination h1").hide();$("div.shortInfoFlugziele").hide();if($("#detail"+G).length){$("#detail"+G).show();$("#detail"+G+" h1").show()}else{$("#detailDefault").show();$("#detailDefault h1").show()}};E.flashMovie=function(G){if(window[G]){return window[G]}if(document[G]){return document[G]}s2.Logger.debug("Cant find flash movie");return null};E.embedAlternativeDestinations=function(N,G){var M="9.0.28";var H="191";var O="105";var L="";if(jQuery.browser.msie6){L="?rand="+Math.random()}var I={};I.configFile="/de/map_config.xml";I.destination=N;I.alternatives=G;var J={};J.allowscriptaccess="always";J.allownetworking="all";J.wmode="transparent";var K={};K.id="altDest";K.name="altDest";if(swfobject.hasFlashPlayerVersion(M)){$(".flashContainer").removeClass("hidden");swfobject.embedSWF("/skyres/flash/map/alt_dest_map.swf"+L,"altDestMap",H,O,"9.0.28","/skyres/flash/expressInstall.swf",I,J,K)}else{$("#altDestImage").removeClass("hidden")}};var B=function(){$("#flashMap .noFlash").show()};E.embed=function(J,I,G,H){s2.tuifly.model.flightSearch.InitializedEvent.observeOnce(function(){var N={};if(!H){H={}}var M=(new s2.tuifly.util.Query()).param("country");if(M&&M.length>0){N.countryZoom=M}var L=JooseX.Culture.Factory.get().majorIdentifier();var S=s2.tuifly.util.Skin.get().identifier();var U="/"+L;var Q=H.version?"?v="+H.version:"";if(jQuery.browser.msie6){Q="?r="+(Math.random()+"").substr(2,7)}var K=U+"/map_"+S+"_"+L+"_data.xml"+Q;s2.Logger.debug("LanguageFile for Flash: "+K);N.configFile="/de/map_config.xml"+Q;N.airportLinksFile="/"+L+"/flashmap_config.xml"+Q;N.languageFile=K;N.mode=J;N.trackingAccount=s2.tuifly.util.Environment.get().OmnitureAccount();N.agentId=new s2.tuifly.util.Cookie().get("user");N.deepLingking=(new s2.tuifly.util.Query()).param("deepLinking");N.countryZoom=(new s2.tuifly.util.Query()).param("countryZoom");N.continentZoom=(new s2.tuifly.util.Query()).param("continentZoom");s2.Logger.debug("trackingAccount for Flash: "+N.trackingAccount);var O={};O.allowscriptaccess="always";O.allownetworking="all";O.wmode="transparent";var T=736;if(J=="basic"){T=711}I=I||T;G=G||406;var P={};P.id=A;P.name=A;var R="9.0.28";if($("#flashMap")&&$("#flashMap").html().match(/\.swf/)){return}if(swfobject.hasFlashPlayerVersion(R)){swfobject.embedSWF("/skyres/flash/map/map.swf"+Q,"flashMap",I,G,"9.0.28","/skyres/flash/expressInstall.swf",N,O,P)}else{B()}});s2.tuifly.model.flightSearch.Station.initializeFromAjax()};E.showMap=function(){var G="mapVisible";var H=JooseX.Culture.Factory.get().majorIdentifier();G=G+"-"+H;$("body").addClass(G);s2.tuifly.widget.collapsibleNavigation.openIfClosed($("#flugsuche h2.toggleNavigationHeadline"))};E.hideMap=function(){var G="mapVisible";var H=JooseX.Culture.Factory.get().majorIdentifier();G=G+"-"+H;$("body").removeClass(G)};E.setDestination=function(){var G=new s2.tuifly.util.Query();return G.param("destination")};E.setDeparture=function(){var G=new s2.tuifly.util.Query();var H=G.param("departure");return H?H:departureFromCookie};window.setDeepLinkingDestination=function(){var G=new s2.tuifly.util.Query();return G.param("destination")};window.setDeepLinkingDeparture=function(){var G=new s2.tuifly.util.Query();return G.param("departure")};jQuery.each(["getStations","eventOriginChanged","eventDestChanged","getCurrentStations","eventPOIChanged","clearStations","showMap","hideMap"],function(){var G=this;window["s2Flash_"+G]=E[G]});window.setDeparture=E.setDeparture;window.setDestination=E.setDestination;window.getStations=E.getStations;window.getAirportCountryMapping=E.getAirportCountryMapping});s2.namespace("s2.tuifly.flash.priceView",function(){var A=this;A.embed=function(F){var E={};if(F.date=="DateFromFlightSelection"){dataCollection=A.getDateFromFlightSelection()}else{if(F.date=="DateFromQuery"){dataCollection=A.getDateFromQuery(F.view)}}for(var D in F){if(F[D]=="-1"){delete F[D]}}var B={languageXML:"/farefinderflash/languageinformation",pricesXML:"/farefinderflash/farefinderdata",flashUrl:"/farefinder/flash/flashmovie/Main.swf",instUrl:"/farefinder/flash/swfobject/expressInstall.swf",countPersons:1,countKidsUnder2:1,countKidsUnder7:1,countKidsUnder12:1,origin:"CGN",destination:"PMI",startDay:dataCollection.startDay,endDay:dataCollection.endDay,startMonth:dataCollection.month,endMonth:dataCollection.endMonth,startYear:dataCollection.year,endYear:dataCollection.endYear,culture:JooseX.Culture.Factory.get().identifier(),skin:s2.tuifly.util.Skin.get().identifier(),trackingAccount:s2.tuifly.util.Environment.get().OmnitureAccount()};B=jQuery.extend(B,F);var G={};G.allowscriptaccess="always";G.allownetworking="all";G.wmode="transparent";var C={};C.id="content";window.FlashOrigin=B.origin;window.FlashDestination=B.destination;swfobject.embedSWF(B.flashUrl,"content","770","407","9.0.28",B.instUrl,B,G,C)};A.getDateFromQuery=function(M){var J=new s2.tuifly.util.Query();var B=parseInt(J.param("MonthToQuery"),10);var C;if(B>0){var I=B+"01";C=Date.parseExact(I,"yyyyMMdd");var K=Date.today();if(C.compareTo(K)<0){C=K}}else{C=Date.today()}var D=1;if(M=="priceTrend6Months"){D=5}var G=C.getMonth()+1;var H=C.getFullYear();var E=C.addMonths(D);var F=E.getMonth()+1;var N=E.getFullYear();var L={};L.month=G;L.year=H;L.endMonth=F;L.endYear=N;return L};A.getDateFromFlightSelection=function(){var H=$("input[name='ControlGroupSelectView$AvailabilityInputSelectView$market1']:checked").val();var C=$("input[name='ControlGroupSelectView$AvailabilityInputSelectView$market2']:checked").val();var G=H.match(/\d+\/\d+\/\d+/);var F;var B;var I;if(C){var D=C.match(/\d+\/\d+\/\d+/);F=D[0].substr(3,2);B=D[0].substr(0,2);I=D[0].substr(6,4)}else{F=-1;B=G[0].substr(0,2);I=G[0].substr(6,4)}var E={};E.startDay=G[0].substr(3,2);E.month=G[0].substr(0,2);E.year=G[0].substr(6,4);E.endDay=F;E.endMonth=B;E.endYear=I;return E}});s2.namespace("s2.tuifly.flash.myTUIfly",function(){var B=this;var A="flashMovie";B.initialize=function(){var C=B.flashMovie(A);if(C){s2.Logger.debug("Have a flash movie "+C.id)}};B.flashMovie=function(C){if(window[C]){return window[C]}if(document[C]){return document[C]}s2.Logger.debug("Cant find flash movie");return null};B.embed=function(I,C,J){var E={};var D=JooseX.Culture.Factory.get().majorIdentifier();var K="/"+D;E.configFile=K+"/mytuifly_config.xml";E.mode=I;var F={};F.allowscriptaccess="always";F.allownetworking="all";F.wmode="transparent";C=C||940;J=J||355;var G={};G.id=A;G.name=A;var H="9.0.28";if($("#flashMovie")&&$("#flashMovie").html().match(/\.swf/)){return}if(swfobject.hasFlashPlayerVersion(H)){swfobject.embedSWF("/skyres/flash/mytuifly/movie.swf",A,C,J,"9.0.28","/skyres/flash/expressInstall.swf",E,F,G)}else{$("#"+A+" .noFlash").show()}}});s2.namespace("s2.tuifly.flash.win",function(){var B=this;var A="gewinnspiel";B.initialize=function(){var C=B.flashMovie(A);if(C){s2.Logger.debug("Have a flash movie "+C.id)}this.embed()};B.flashMovie=function(C){if(window[C]){return window[C]}if(document[C]){return document[C]}s2.Logger.debug("Cant find flash movie");return null};B.embed=function(I,F,C){var D={};D.configFile="/php/viral/config_xml.php"+location.search;D.mode=I;D.languageIdentifier=JooseX.Culture.Factory.get().majorIdentifier();var H={};H.allowscriptaccess="always";H.allownetworking="all";H.wmode="transparent";F=F||940;C=C||355;var E={};E.id=A;E.name=A;var G="9.0.28";if(swfobject.hasFlashPlayerVersion(G)){swfobject.embedSWF("/skyres/flash/win/country.swf",A,F,C,"9.0.28","/skyres/flash/expressInstall.swf",D,H,E)}else{$("#"+A+" .noFlash").show()}}});s2.namespace("s2.tuifly.flash.historyView",function(){this.initialize=function(){};this.embedFlash=function(C,A,D,B){var E;var H;var F=new s2.tuifly.util.Query();if(F.param("MonthToQuery")>0){E="priceTrend1Month";H=$("#button1Monat")}else{E="priceTrend6Months";H=$("#button6Monate")}if(B){E=B}s2.tuifly.flash.priceView.embed({origin:C,destination:A,date:D,view:E});try{H.trigger("click")}catch(G){s2.Logger.debug(G)}}});s2.namespace("s2.tuifly.flash.calendarView",function(){this.initialize=function(){};this.embedFlash=function(C,A,D,B){s2.tuifly.flash.priceView.embed({origin:C,destination:A,date:D,view:B})}});s2.namespace("s2.tuifly.helper.scrollToElement",function(){this.initialize=function(){var B=new String(window.location.hash).split("#")[1];var A;if(B){var C="#"+B;A=$(C)}if(A&&A.length>0){this.start(A)}};this.start=function(B){var A;if(B.hasClass("toggleBox")){A=B.parent()}else{A=B}if(B.get(0).showStub){B.get(0).showStub()}B.focus();var C=B.offset().top;if(jQuery.browser.msie){C-=315}window.scrollTo(0,C);B.removeClass("closed");A.closest(".toggleBox").removeClass("closed")}});s2.namespace("s2.tuifly.helper.contact",function(){this.initialize=function(){this.hideSelectBox()};this.showMemberLoginInputArea=function(){$("#memberLogin").removeClass("hidden");void (0)};this.hideMemberLoginInputArea=function(){$("#memberLogin").addClass("hidden");void (0)};this.toggleMemberLoginInputArea=function(){if($("#memberLogin").is(":visible")){this.hideMemberLoginInputArea()}else{this.showMemberLoginInputArea()}};this.hideSelectBox=function(){if(jQuery.browser.msie&&jQuery.browser.version.substr(0,1)=="6"){if(document.getElementById("MLMain")){$("#MLMain a.helpIcon").mouseover(function(){$("#passengerInputBox select").css("visibility","hidden");$("fieldset.contactinput select").css("visibility","hidden")});$("#MLMain a.helpIcon").mouseout(function(){$("#passengerInputBox select").css("visibility","");$("fieldset.contactinput select").css("visibility","")})}}}});s2.namespace("s2.tuifly.helper.search",function(){this.initialize=function(){this.GroupBookingSelection();var A=function(){var B=new s2.tuifly.util.Query();var C=B.param("adults");if(C){$("#flugsuche select.selectAdult").val(C);$("#flugsuche select.selectAdult").trigger("change")}};setTimeout(A,0)};this.GroupBookingSelection=function(){if(document.getElementById("flugsuche")){$("#flugsuche select.selectAdult").change(function(){var C=$(this)[0].value;if(C=="+10"){var A=JooseX.Culture.Factory.get();var B="/BookGroup.aspx?culture="+A.identifier();location.href=B}})}};this.updateChildPulldowns=function(){var A=["INFANT","CHDD","CHD"];if(document.getElementById("flugsuche")){$.each(A,function(){var H=this;var G="#flugsuche select[id$='_DropDownListPassengerType_"+H+"']";var B=$(G)[0];if(B){var E=B.options.length;var F;if($.browser.msie){F=$("object.queryDataChild > param").val()}else{F=$("object.queryDataChild > param[name=groupBookingText]").val()}var D=new Option(F,"+10");var C=E;B.options[C]=D}})}};this.changeOrigin=function(A){if(typeof(s)!="undefined"){s.linkTrackVars="prop25,eVar25";s.prop25=s.eVar25="Alt-Start";var C=$("#alternativeFlights").get(0);s.tl(C,"o","LoginErfolg")}var B=$("#availabilitySearchInputOriginInput");B.val(A);B.change();setTimeout("s2.tuifly.helper.search.submitSearch()",100)};this.changeDestination=function(A){if(typeof(s)!="undefined"){s.linkTrackVars="prop25,eVar25";s.prop25=s.eVar25="Alt-Ziel";var C=$("#searchFlightDestinations").get(0);s.tl(C,"o","LoginErfolg")}var B=$("#availabilitySearchInputDestinationInput");B.val(A);B.change();setTimeout("s2.tuifly.helper.search.submitSearch()",100)};this.submitSearch=function(){s2.tuifly.widget.submittableForm.clickButton($("#flugsucheButton a"))};this.adjustDate=function(F,D){var A=F==1?s2.tuifly.widget.datepickerForSelect.getFlight():s2.tuifly.widget.datepickerForSelect.getReturnFlight();var E=Date.parse(A.val());if(s2.tuifly.widget.datepickerForSelect.dateOK(E)){var C=JooseX.Culture.Factory.get();E.addDays(D);var B=Date.today();if(E.getTime()>=B.getTime()){A.val(C.formatDate(E));A.change();AFRICA_NOTE_DISPLAYED=true;this.submitSearch()}}};this.checkAirberlinRedirection=function(){var E=document.SkySales;var C=$(".flightSelection :radio:checked");var F=C.eq(0).val().match(/\d\d\/\d\d\/\d\d\d\d/g)[0];var B=(C.length==2)?(C.eq(1).val().match(/\d\d\/\d\d\/\d\d\d\d/g)[0]):(null);var D=E[applicationJavaScriptHtmlId+"_DropDownListMarketOrigin1"].value;var A=E[applicationJavaScriptHtmlId+"_DropDownListMarketDestination1"].value;return !airberlinAvailable[D+A]||!redirectToAirberlin("http://www.airberlin.com/site/abvakanz_c.php",affiliateConfirmMessages.AB,new Date(F.substring(6),F.substring(0,2)-1,F.substring(3,5)),(B!=null)?(new Date(B.substring(6),B.substring(0,2)-1,B.substring(3,5))):(null),D,A,parseInt(E[applicationJavaScriptHtmlId+"_DropDownListPassengerType_ADT"].value)+parseInt(E[applicationJavaScriptHtmlId+"_DropDownListPassengerType_CHD"].value)+parseInt(E[applicationJavaScriptHtmlId+"_DropDownListPassengerType_CHDD"].value)+parseInt(E[applicationJavaScriptHtmlId+"_DropDownListPassengerType_INFANT"].value))}});s2.namespace("s2.tuifly.helper.payment",function(){this.initialize=function(){if(document.getElementById("voucherInput")){var D=$("#voucherInput :text");if((D.length>0)&&(D.eq(0).val().length>0)){$("#VoucherMain :checkbox").click()}}if(!document.getElementById("paymentAjaxSection")){return}var H=$("form#SkySales");var C=$("#paymentAjaxSection");var I=$("#paymentAjaxLoading");var F=$("div#paymentMethodSelection div.paymentMethod");var B=window.location.pathname.replace(/(.aspx)/,"Ajax$1");var G=(window.ClientID)?(ClientID+"_Validate"):(undefined);var E=true;F.bind("click",function(L){var K=$(this).find(":radio");K.focus().attr("checked","checked");H.find("input#__EVENTTARGET").val(K.attr("name"));C.hide();I.show();function J(){jQuery.post(B,H.serializeArray(),function(M){if(K.attr("checked")){C.empty();C.append(M);I.hide();C.show();if(!E){$("html,body").animate({scrollTop:C.offset().top+C.outerHeight()-$(window).height()},1000)}E=false;if(G&&window.payment_validateTK_Ident&&events&&events.Validate&&(events.Validate.length>0)&&(events.Validate[0]==payment_validateTK_Ident)&&(K.val()!="ExternalAccount:TK")){events.Validate[0]=G}}})}J()});F.find(":radio:checked").click()};this.showVoucherInputArea=function(){$("#voucherInput").removeClass("hidden");void (0)};this.hideVoucherInputArea=function(){$("#voucherInput").addClass("hidden");void (0)};this.toggleVoucherInputArea=function(){if($("#voucherInput").is(":visible")){this.hideVoucherInputArea()}else{this.showVoucherInputArea()}};this.toggleCustomerCreditInputArea=function(){$("#CustomerCreditInput").toggle()};var A;this.setCustomerCreditTextBoxID=function(D,C){var B=this;A=D;$("#"+D).keyup(function(){B.updateCustomerCreditAmount(C)});this.updateCustomerCreditAmount(C)};this.updateCustomerCreditAmount=function(B){var D=parseInt($("#"+A).val(),10);if(isNaN(D)){if(D){D=D.replace(/[^[0-9]]/,"")}else{D="0"}$("#"+A).val(D);return}B=B.replace(".","");B=parseInt(B,10);if(D>B){D=B}$("#"+A).val(D);var C=D/100;$("#CustomerCreditAmount").text(C.toFixed(2).replace(".",","))}});s2.namespace("s2.tuifly.helper.bluemiles",function(){this.gotoPartner=function(A){s2.tuifly.helper.kubi.gotoPartner(A)}});s2.namespace("s2.tuifly.helper.kubi",function(){this.gotoPartner=function(B){var A=window.tuiLogin.getCustomerNumber();B=B+A;window.open(B)}});s2.namespace("s2.tuifly.helper.kubiBackoffice",function(){this.initialize=function(){$("#searchResults").load("/CustomerProgramBackofficeAjax.aspx",null,this.afterLoad)};this.afterLoad=function(){$("#searchWait").hide();$("#searchResults").show()};this.storno=function(B,C){var A=$(B);A.children("span").prepend("<span class='loadingImage'></span>");$.get("/CustomerProgramBackofficeCancelAjax.aspx",{transactionID:C},function(D,E){A.find(".loadingImage").remove();if(E!="success"){alert("�bertragungsfehler!");return}if(D!="Success"){alert("Es ist ein Fehler aufgetreten: "+D);return}A.after("Storniert");A.remove()})}});s2.namespace("s2.tuifly.helper.print",function(){this.print=function(){window.print()}});s2.namespace("s2.tuifly.helper.hotelSearch",function(){var A;this.initialize=function(){if(!document.getElementById("hotelSearch")){return}var F=JooseX.Culture.Factory.get();var J=new Date();var D=new Date().setDate(J.getDate()+7);var G=$("#datePickerHotelCheckIn");this.initDatepicker(G);var H=$("#datePickerHotelCheckOut");this.initDatepicker(H);G.val(F.formatDate(Date.today()));H.val(F.formatDate(Date.today().add(7).days()));G.bind("change",function(L){if(F.parseDate(H.val())<F.parseDate(G.val())){H.val(G.val())}});var C=window.location.protocol+"//"+window.location.host+"/skyres/data/hotels.json";var E=$("#hotelSearch .queryCustomSelects");jQuery.getJSON(C,function(g){var T="hotelSearchDest";var b=g[T];var U=jQuery("<select id='"+T+"Select' name='ziel'/>");for(var c in b){U.append(jQuery("<option value='"+b[c]+"'>"+c+"</option>"))}U.children(":first").attr("selected","selected");$("#"+T).append(U);var T="hotelSearchRegion";var X=g[T];var W=jQuery("<select id='"+T+"Select' name='region'/>");var a=jQuery("<option value='-1'>"+X["-1"]+"</option>");var R={};var e=[];var V=0;delete X["-1"];function N(n,m){for(var h=n;h<V;h++){if(m.text.toUpperCase()<e[h].text.toUpperCase()){return h}}return h>0?h:0}for(var Z in X){var f=X[Z];var Q="";for(var Y in f){Q=Q+"<option value='"+f[Y]+"'>"+Y+"</option>"}var M=jQuery(Q);R[Z]=a.add(M);var S=-1;for(var d=0,O=M.length;d<O;d++,V++){S=N(S+1,M.get(d));e.splice(S,0,M.get(d))}}R["-1"]=a.add(jQuery(e));W.children(":first").attr("selected","selected");W.append(R["-1"]);$("#"+T).append(W);W.bind("change",function(h){var m=W.val().match(/[^|]+$/);if(m!="-1"){U.children("[value="+m+"]").attr("selected","selected");U.data("update")()}});U.bind("change",function(h){var m=W.val();W.empty();W.append(R[U.val()]);if((m!="-1")&&(W.children("[value="+m+"]").length>0)){W.children("[value="+m+"]").attr("selected","selected")}else{W.children(":first").attr("selected","selected")}W.parent().removeClass("init");W.parent().find("input, div").remove();s2.tuifly.widget.customSelect.convert("#hotelSearch");W.parent().find("input").val(W.children(":selected").text())});s2.tuifly.widget.customSelect.convert("#hotelSearch");for(var P=E.find("input"),L=E.find("select"),d=P.length-1;d>=0;d--){P.eq(d).val(L.eq(d).children(":selected").text())}});var K=$(".childsel");var I=$("#hotelSearchChildrenDetails");$("#hotelSearchChildren").bind("change",function(N){var M=$("#hotelSearchChildren").val();A=M;var L=$(".childsel").prevAll("input");L.hide();L.filter(":lt("+M+")").show();L.next().find("li:first").click();if(M>0){I.show()}else{I.hide()}})};this.initDatepicker=function(D){var C={numberOfMonths:[1,3],stepMonths:3,prevText:"&#160;",nextText:"&#160;",closeText:"&#160;",currentText:"",changeMonth:false,changeYear:false,changeFirstDay:false,showOtherMonths:true,showOn:"focus",minDate:"+0",showAnim:"show",duration:"",showButtonPanel:true};D.datepicker(C)};var B=function(){if(A>0){var C=true;var D=$("#hotelSearchChildrenDetails select").filter(":lt("+A+")");for(i=0;i<D.length;i++){if(D[i].options[D[i].selectedIndex].value==-1){C=false;break}}return C}else{return true}};this.submit=function(){message=$("#errorMessage");var D="CSHotels_HP_220_P_K4709V1";var C=$("#datePickerHotelCheckIn");var H=$("#datePickerHotelCheckOut");var F=JooseX.Culture.Factory.get();C.after('<input type="hidden" name="termin" value="'+(F.parseDate(C.val()).getTime()/1000)+'" />');H.after('<input type="hidden" name="ruecktermin" value="'+(F.parseDate(H.val()).getTime()/1000)+'" />');if(($("#hotelSearchRegionSelect").val()!="-1")&&($("#hotelSearchDestSelect").val()=="-1")){$("#hotelSearchRegionSelect").change()}var E="http://ww2.tui.com/index.php?"+$("#hotelSearch input, #hotelSearch select").serialize();var G=$("#hotelSearch .bookingButton");if(G.hasClass("loading")){G.removeClass("loading");G.find(".loadingImage").remove()}if(B()){$("#hotelSearch a").attr("target","_blank");$("#hotelSearch a").attr("href","http://"+window.location.host+"/specials/partnerframe/index.php?scte="+D+"&lang=DEU&sub=tuihotels&suburl="+Base64.encode(E))}else{alert(window.selectAgesForChildrenError);return false}}});s2.namespace("s2.tuifly.helper.holidaySearch",function(){var A;this.initialize=function(){if(!document.getElementById("holidaySearch")){return}var E=JooseX.Culture.Factory.get();var K=new Date();var C=new Date().setDate(K.getDate()+7);var F=$("#datePickerHolidayCheckIn");this.initDatepicker(F);var I=$("#datePickerHolidayCheckOut");this.initDatepicker(I);F.val(E.formatDate(Date.today()));I.val(E.formatDate(Date.today().add(7).days()));F.bind("change",function(M){if(E.parseDate(I.val())<E.parseDate(F.val())){I.val(F.val())}});var L="790006";var D="654";var H="https://images.traveltainment.de/booking/cache/"+L+"/"+D+"/";var G=H+"cachefiles_"+D+"_js.php?getCacheFiles=1";$.getScript(G,function(){for(var M=0;M<window["cacheFiles_"+D].length;++M){var N=window["cacheFiles_"+D][M];if(N.search(/regionen.*/)!=-1){$.getScript(H+N,function(){var P=[];if(typeof(window["TTREGS_"+D])!="undefined"){P=window["TTREGS_"+D]}var V=jQuery("<select id='holidaySearchDestSelect' name='ziel'/>");V.append(jQuery("<option value='-1'>"+window.allDestinationsOption+"</option>"));for(var S=0;S<P.length;++S){var U=P[S].split("|");if(U[1]>=10000){V.append(jQuery("<option value='"+U[1]+"'>"+U[0]+"</option>"))}}V.children(":first").attr("selected","selected");$("#holidaySearchDest").append(V);var T=jQuery("<select id='holidaySearchRegionSelect' name='region'/>");T.append(jQuery("<option value='-1'>"+window.allRegionsOption+"</option>"));for(var S=0;S<P.length;++S){var U=P[S].split("|");if(U[1]<10000){T.append(jQuery("<option value='"+U[1]+"|"+U[2]+"'>"+U[0]+"</option>"))}}T.children(":first").attr("selected","selected");$("#holidaySearchRegion").append(T);T.bind("change",function(W){var X=T.val().match(/[^|]+$/);if(X!="-1"){V.children("[value="+X+"]").attr("selected","selected");V.data("update")()}});V.bind("change",function(W){var a=T.val();var X=V.val();T.empty();T.append(jQuery("<option value='-1'>"+window.allRegionsOption+"</option>"));for(var Y=0;Y<P.length;++Y){var Z=P[Y].split("|");if(Z[1]<10000&&(Z[2]==X||X==-1)){T.append(jQuery("<option value='"+Z[1]+"|"+Z[2]+"'>"+Z[0]+"</option>"))}}if((a!="-1")&&(T.children("[value="+a+"]").length>0)){T.children("[value="+a+"]").attr("selected","selected")}else{T.children(":first").attr("selected","selected")}T.parent().removeClass("init");T.parent().find("input, div").remove();s2.tuifly.widget.customSelect.convert("#holidaySearch");T.data("update")()});s2.tuifly.widget.customSelect.convert("#holidaySearch");if(jQuery.browser.msie){var Q=$("#holidaySearch .queryCustomSelects");for(var O=Q.find("select"),R=O.length-1;R>=0;R--){O.eq(R).data("update")()}}});break}}});var J=$("#holidaySearchChildrenDetails");$("#holidaySearchChildren").bind("change",function(O){var N=$("#holidaySearchChildren").val();A=N;var M=$(".childsel",J).prevAll("input");M.hide();M.filter(":lt("+N+")").show();M.next().find("li:first").click();if(N>0){J.show()}else{J.hide()}})};this.initDatepicker=function(D){var C={numberOfMonths:[1,3],stepMonths:3,prevText:"&#160;",nextText:"&#160;",closeText:"&#160;",currentText:"",changeMonth:false,changeYear:false,changeFirstDay:false,showOtherMonths:true,showOn:"focus",minDate:"+0",showAnim:"show",duration:"",showButtonPanel:true};D.datepicker(C)};var B=function(){if(A>0){var C=true;var D=$("#holidaySearchChildrenDetails select").filter(":lt("+A+")");for(i=0;i<D.length;i++){if(D[i].options[D[i].selectedIndex].value==-1){C=false;break}}return C}else{return true}};this.submit=function(){message=$("#errorMessage");var G=$("#holidaySearch .bookingButton");var I="CSPauschalreisen_HP_220_P_K5009V1";var C=$("#datePickerHolidayCheckIn");var K=$("#datePickerHolidayCheckOut");if(!C.val()){if(G.hasClass("loading")){G.removeClass("loading");G.find(".loadingImage").remove()}alert(window.holidayCheckInDateError);return false}else{if(!K.val()){if(G.hasClass("loading")){G.removeClass("loading");G.find(".loadingImage").remove()}alert(window.holidayCheckOutDateError);return false}}var D=JooseX.Culture.Factory.get();$("#holidaySearch input[name=termin]").remove();C.after('<input type="hidden" name="termin" value="'+(D.parseDate(C.val()).getTime()/1000)+'" />');$("#holidaySearch input[name=ruecktermin]").remove();K.after('<input type="hidden" name="ruecktermin" value="'+(D.parseDate(K.val()).getTime()/1000)+'" />');var J=$("#holidaySearchAdults").val();var F=$("#holidaySearchChildren").val();for(var E=1;E<=F;++E){var L=$("#holidaySearchChild"+E).val();J+=";"+L}$("#holidaySearch input[name=personen]").remove();$("#holidaySearchAdults").after('<input type="hidden" name="personen" value="'+J+'" />');if(($("#holidaySearchRegionSelect").val()!="-1")&&($("#holidaySearchDestSelect").val()=="-1")){$("#holidaySearchRegionSelect").change()}$("#holidaySearch input[name=flugdauer]").remove();$("#holidaySearchDest").after('<input type="hidden" name="flugdauer" value="'+$("#holidaySearchDestSelect").val()+'" />');$("#holidaySearch input[name=dauer]").remove();$("#holidaySearchDuration").after('<input type="hidden" name="dauer" value="'+$("#holidaySearchDuration").val().replace(/X/,"_")+'" />');var H="http://ww2.tui.com/index.php?"+$("#holidaySearch input, #holidaySearch select").serialize();if(G.hasClass("loading")){G.removeClass("loading");G.find(".loadingImage").remove()}if(B()){$("#holidaySearch a").attr("target","_blank");$("#holidaySearch a").attr("href","http://"+window.location.host+"/specials/partnerframe/index.php?scte="+I+"&lang=DEU&sub=tui&suburl="+Base64.encode(H))}else{alert(window.selectAgesForChildrenError);return false}}});s2.namespace("s2.tuifly.helper.carSearch",function(){this.initialize=function(){if(!document.getElementById("carSearch")){return}var D=JooseX.Culture.Factory.get();var G=new Date();var F=$("#datePickerCarLeasing");this.initDatepicker(F);var H=$("#carSearchLeasingTime");var B=$("#datePickerCarReturn");this.initDatepicker(B);var E=$("#carSearchReturnTime");F.val(D.formatDate(Date.today().add(14).days()));B.val(D.formatDate(Date.today().add(21).days()));F.bind("change",function(M){if(D.parseDate(B.val())<D.parseDate(F.val())){B.val(D.formatDate(D.parseDate(F.val()).add(1).days()))}if(D.parseDate(B.val()+" "+E.val())<D.parseDate(F.val()+" "+H.val())){E.val(H.val());E.data("update")()}});H.bind("change",function(M){if(D.parseDate(B.val()+" "+E.val())<D.parseDate(F.val()+" "+H.val())){E.val(H.val());E.data("update")()}});var C=$("#carSearch .queryCustomSelects");var J="carSearchCountry";var A=jQuery("<select id='"+J+"Select' name='lb_Land'/>");A.data("dataUrl","https://ww5.tui.com/cars/ibe/services/suche_lb_country_tf_"+D.majorIdentifier()+".php");A.data("notSelectedOption",window.carSearchCountryNotSelected);$("#"+J).append(A);J="carSearchRegion";var L=jQuery("<select id='"+J+"Select' name='lb_region'/>");L.data("dataUrl","https://ww5.tui.com/cars/ibe/services/suche_lb_region_tf_"+D.majorIdentifier()+".php");L.data("notSelectedOption",window.carSearchRegionNotSelected);L.data("parameter",{landid:A});A.data("successor",L);$("#"+J).append(L);J="carSearchCity";var I=jQuery("<select id='"+J+"Select' name='lb_city'/>");I.data("dataUrl","https://ww5.tui.com/cars/ibe/services/suche_lb_city_tf_"+D.majorIdentifier()+".php");I.data("notSelectedOption",window.carSearchCityNotSelected);I.data("parameter",{landid:A,regionid:L});L.data("successor",I);$("#"+J).append(I);J="carSearchStation";var K=jQuery("<select id='"+J+"Select' name='lb_station'/>");K.data("dataUrl","https://ww5.tui.com/cars/ibe/services/suche_lb_station_tf_"+D.majorIdentifier()+".php");K.data("notSelectedOption",window.carSearchStationNotSelected);K.data("parameter",{cityid:I});I.data("successor",K);$("#"+J).append(K);$("#carSearchCountry select, #carSearchLocation select").bind("customSelect_changedAndClosed",function(N){var M=$(this);var P=M.data("successor");if(P!=undefined){var R=P.data("parameter");var Q="";for(var O in R){Q+=O+"="+R[O].val()+"&"}Q+="callback=?";P.empty();P.append(P.data("notSelectedOption"));if(!R.cityid||(R.cityid.val().length>0)){jQuery.get(P.data("dataUrl")+"?"+Q,null,function(U){for(var T=0,S=U.length;T<S;T++){P.append(jQuery("<option value='"+U[T][0]+"'>"+U[T][1]+"</option>"))}P.data("updateList")();P.data("update")();P.trigger("customSelect_changedAndClosed")},"jsonp")}else{P.data("updateList")();P.data("update")();P.trigger("customSelect_changedAndClosed")}}else{s2.tuifly.widget.customSelect.convert("#carSearch")}});jQuery.getJSON(A.data("dataUrl")+"?callback=?",function(P){H.val("10:00");E.val("10:00");A.append(window.carSearchCountryNotSelected);for(var O=0,N=P.length;O<N;O++){A.append(jQuery("<option value='"+P[O][0]+"'>"+P[O][1]+"</option>"))}A.bind("change",function(Q){$("#carSearchLocation").show()});s2.tuifly.widget.customSelect.convert("#carSearch");if(jQuery.browser.msie){for(var M=C.find("select"),O=M.length-1;O>=0;O--){M.eq(O).data("update")()}}})};this.initDatepicker=function(B){var A={numberOfMonths:[1,3],stepMonths:3,prevText:"&#160;",nextText:"&#160;",closeText:"&#160;",currentText:"",changeMonth:false,changeYear:false,changeFirstDay:false,showOtherMonths:true,showOn:"focus",minDate:"+14",showAnim:"show",duration:"",showButtonPanel:true};B.datepicker(A)};this.submit=function(){var E=$("#errorMessage");var D=$("#carSearch .bookingButton");if(D.hasClass("loading")){D.removeClass("loading");D.find(".loadingImage").remove()}if(($("#carSearchCountrySelect").val()=="")||($("#carSearchCitySelect").val()=="")||($("#carSearchStationSelect").val()=="")){alert(window.carSearchLocationError);return false}var A="CSCars_HP_220_P_K4708V1";var C=JooseX.Culture.Factory.get();var F=C.majorIdentifier();var B="https://ww5.tui.com/cars/ibe/cars_list.php?agk=052123&oh=1&lg_c="+F+"&lg_s="+F+"&"+$("#carSearch input, #carSearch select").serialize();var G="";switch(C.identifier()){case"de-DE":G="DEU";break;case"en-GB":G="ENG";break;case"it-IT":G="ITA";break;case"es-ES":G="ESP";break}$("#carSearch a").attr("target","_blank");$("#carSearch a").attr("href","http://"+window.location.host+"/specials/partnerframe/index.php?scte="+A+"&lang="+G+"&sub=tuicars&suburl="+Base64.encode(B));return true}});s2.namespace("s2.tuifly.helper.webCheckIn",function(){this.submit=function(){message=$("#errorMessage");var C=document.getElementById("checkinBid").value;var B=document.getElementById("checkinLastname").value;var D=JooseX.Culture.Factory.get().majorIdentifier();s2.tuifly.events.AjaxStartEvent.trigger("webCheckin");var A=s2.tuifly.util.Environment.get().secureUrl("/php/webcheckin.php");jQuery.ajax({type:"GET",url:A,data:{name:B,bid:C,form1:"true",language:D},success:function(E){if(E[2]!=""){top.location.href=E[2]}message.html(E[1]);message.fadeIn("3000");s2.tuifly.events.AjaxEndEvent.trigger("webCheckin")},dataType:"jsonp"})}});s2.namespace("s2.tuifly.helper.giftCertificate",function(){var A=this;this.selectedMood;this.selectedAmount;this.initialize=function(){if(document.getElementById("giftCertificate")){this.MotivSelection();$(".queryGiftCerts input").click(this.MotivSelection)}},this.MotivSelection=function(){$("#"+A.selectedMood+"_"+A.selectedAmount).hide();$("input[name=SellGiftCertificateView$RadioButtonGroupLayout]").each(function(){if($(this).attr("checked")){A.selectedMood=$(this).attr("id")}});$("input[name=SellGiftCertificateView$RadioButtonAmounts]").each(function(){if($(this).attr("checked")){A.selectedAmount=$(this).attr("id")}});$("#"+A.selectedMood+"_"+A.selectedAmount).show()}});s2.namespace("s2.tuifly.helper.contactEditToggle",function(){this.initialize=function(){if(document.getElementById("payment")){if($("fieldset.contactdisplay").length>0){$("fieldset.contactinput").each(function(){$(this).hide()});$("fieldset.contactdisplay").each(function(){$(this).show()})}if($("fieldset.contactinput").length>0){$("fieldset.contactdisplay > #LinkButtonEdit").show();$("fieldset.contactinput").insertAfter($("fieldset.contactdisplay"))}}};this.fadeAndSetHiddenField=function(){s2.tuifly.widget.fader.crossfade("fieldset.contactdisplay","fieldset.contactinput");$("[id$=_HiddenFieldSaveMeOnLoadFlag]").val("True")}});s2.namespace("s2.tuifly.helper.keepAlive",function(){var B=5*60*1000;var A=function(){var C="/KeepAlive.aspx?rand="+Math.random();jQuery.get(C,function(E,D){s2.Logger.debug("Send keep alive: "+D)})};this.loop=function(){setInterval(A,B);var C=""+location.href;if(C.indexOf(".aspx")==-1){setTimeout(A,60*1000)}}});s2.namespace("s2.tuifly.helper.simpleSubmit",function(){var A=function(C){C.preventDefault();form=$(this);var D=$("#successMessage").text();if(D==null||D==""){D="Vielen Dank"}var B=form.ajaxSubmit({success:function(){s2.tuifly.widget.dialog.alert(D)}})};this.bind=function(B){$(document).ready(function(){var C=$(B);C.submit(A)})}});s2.namespace("s2.tuifly.helper.farefinder",function(){this.initialize=function(){this.updateHeadImage();$("#selector select").change(this.enableIcon);$("#selector .qList").click(function(){s2.tuifly.controller.FarefinderSearch.getInstance().submit("/farefinder/bestoffers",false)});$("#selector .qCalendar").click(function(){s2.tuifly.controller.FarefinderSearch.getInstance().submit("/farefinder/pricecalendar",true)});$("#selector .qHistory").click(function(){s2.tuifly.controller.FarefinderSearch.getInstance().submit("/farefinder/pricehistory",true)})};this.loadToggleBox=function(M,L,K,I){if(I){if(window!=top){return}}if(!I&&!$("#"+M+" > div.notLoadedYet").length==1){return}var O=["sortfield","sortorder","sort","beginMonth","endMonth","currency","monthtoquery","skin","culture"];var G="/farefinder/offers";var J=new s2.tuifly.util.Query();var H=J.param("carrier")||"";var N={origin:L,destination:K,carrier:H};var J=new s2.tuifly.util.Query();Joose.A.each(O,function(P){var Q=J.param(P);if(Q!=null&Q!=""){N[P]=Q}});jQuery.get(G,N,function(P){if(P.indexOf("<html")==-1){$(document).ready(function(){var Q=$("#"+M);Q.html(P)})}},"html")};this.updateHeadImage=function(){var K=new s2.tuifly.util.Query();var I=K.asHash();var M="HLXConsumer";if(I.skin){M=I.skin}var H="de-DE";if(I.culture){H=I.culture}var N="/skyres/images/farefinder/"+M+"/"+H+"/bg.jpg";if(location.href.match(/farefinder/i)){var O=location.search;var P=O.match(/[\?|\&]airportListDestination=(\w\w\w)/i);var K=new s2.tuifly.util.Query();var J=K.param("airportListDestination");if(J==""||J==null){J=K.param("destination")}if(J==""||J==null||J.length!=3||J!=J.toUpperCase()){J="Default-"+M+"-"+H+" fareDefault"}$("#backgroundImageAirport").addClass("fareSearchBG_"+J);$("#imageFareFinder").addClass("hidden");$("#spacerFareFinder").css("margin-top","204px");if(AirportDestinationText==null){var G=$("#AirportListDestination").val();if(G&&G.length==3){var L=$("#AirportListDestination").find("option[value="+G+"]").text();AirportDestinationText=L}}if(typeof(AirportDestinationText)!="undefined"&&AirportDestinationText.length>0&&!AirportDestinationText.match(/\-\>\/farefinder/i)){$("#destinationHeadline").html(AirportDestinationTextPrefix+" - "+AirportDestinationText).parent().show()}else{$("#destinationHeadline").parent().hide()}}else{if(location.href.match(/farefinder\//i)){if(document.getElementById("imageFareFinder")){$("#imageFareFinder img").attr("src",N)}}}};this.submitPulldowns=function(G){var H=new s2.tuifly.util.Query();H.param("AirportListOrigin",document.getElementById("AirportListOrigin").value);H.param("AirportListDestination",document.getElementById("AirportListDestination").value);H.param("MonthToQuery",document.getElementById("MonthToQuery").value);location.href=location.pathname+"?"+H;$(G).find("select").attr("disabled",true)};var E={"/farefinder/pricecalendar":{AirportListOrigin:"CGN",AirportListDestination:"PMI"},"/farefinder/pricehistory":{AirportListOrigin:"CGN",AirportListDestination:"PMI"},"/farefinder/bestoffers":{}};this.changeView=function(G){var H=new s2.tuifly.util.Query();Joose.A.each(["AirportListOrigin","AirportListDestination","MonthToQuery"],function(J){var L=$("#"+J).val();if(L==-1){L=""}if(L!=""){H.param(J,L)}else{var K=H.param(J);if(K==""||K==null){var I=E[G][J];if(I){H.param(J,I)}}}});var G=G+"?"+H;location.href=G;return false};this.gotoOffer=function(J,H,G,I,K){this.gotoSelect({origin:J,destination:H,startDate:G,returnDate:I,scorigin:K,type:"RoundTrip"})};window.goOffer=function(){s2.tuifly.helper.farefinder.gotoOffer.apply(s2.tuifly.helper.farefinder,arguments)};var B,A;this.gotoSelect=function(V){var S=V.origin||window.FlashOrigin;var Q=V.destination||window.FlashDestination;var P="RoundTrip";var H,K;if(!A||!B){P="OneWay"}if(V.type){P=V.type}var O={day:"",yearmonth:""};var L=A||V.startDate;var N=B||V.returnDate;H=L?this.splitDate(L):O;K=N?this.splitDate(N):O;var I=1;var U=0;var M=0;var R=0;if(V.view=="select"){I=$("#ControlGroupAvailabilitySearchSelectView_AvailabilitySearchInputSelectView_DropDownListNewPassengerType_ADT").val();U=$("#ControlGroupAvailabilitySearchSelectView_AvailabilitySearchInputSelectView_DropDownListPassengerType_CHD").val();R=$("#ControlGroupAvailabilitySearchSelectView_AvailabilitySearchInputSelectView_DropDownListPassengerType_INFANT").val()}var J=JooseX.Culture.Factory.get().identifier();var G="/Search.aspx?FID=offerspage&cf=TPS&ControlGroupSearchView$AvailabilitySearchInputSearchView$RadioButtonMarketStructure="+P+"&ControlGroupSearchView$AvailabilitySearchInputSearchView$DropDownListMarketOrigin1="+S+"&ControlGroupSearchView$AvailabilitySearchInputSearchView$DropDownListMarketDestination1="+Q+"&ControlGroupSearchView$AvailabilitySearchInputSearchView$DropDownListMarketOrigin2="+Q+"&ControlGroupSearchView$AvailabilitySearchInputSearchView$DropDownListMarketDestination2="+S+"&ControlGroupSearchView$AvailabilitySearchInputSearchView$DropDownListMarketMonth1="+H.yearmonth+"&ControlGroupSearchView$AvailabilitySearchInputSearchView$DropDownListMarketDay1="+H.day+"&ControlGroupSearchView$AvailabilitySearchInputSearchView$DropDownListMarketMonth2="+K.yearmonth+"&ControlGroupSearchView$AvailabilitySearchInputSearchView$DropDownListMarketDay2="+K.day+"&ControlGroupSearchView$AvailabilitySearchInputSearchView$DropDownListPassengerType_ADT="+I+"&ControlGroupSearchView$AvailabilitySearchInputSearchView$DropDownListPassengerType_CHD="+U+"&ControlGroupSearchView$AvailabilitySearchInputSearchView$DropDownListPassengerType_CHDD="+M+"&ControlGroupSearchView$AvailabilitySearchInputSearchView$DropDownListPassengerType_INFANT="+R+"&ControlGroupSearchView$AvailabilitySearchInputSearchView$DropDownListMarketDateRange1=2|2&ControlGroupSearchView$AvailabilitySearchInputSearchView$DropDownListMarketDateRange2=2|2&__EVENTTARGET=ControlGroupSearchView$AvailabilitySearchInputSearchView$LinkButtonNewSearch&expanded=1&culture="+J+"&AD=TPS1&ATT=HP_Teaser&scorigin="+V.scorigin;s2.Logger.debug(G);if(V.scorigin&&(typeof(s)!="undefined")){var T=new s2.tuifly.util.Cookie();if(V.scorigin=="Angebote-Preisverlauf"){T.set("s_eVar26","Diagramm")}else{if(V.scorigin=="Angebote-Sparkalender"){T.set("s_eVar26","Kalender")}}}location.href=G};this.splitDate=function(K){var I=K.split("-");var H=I[0];if(I[1]&&I[1].length==1){var J=parseInt(I[1]);if(J<10){J="0"+J}}else{J=I[1]}var G=I[2];return{yearmonth:H+"-"+J,day:G}};this.updateSortingAndSubmit=function(G,H){var I=new s2.tuifly.util.Query();I.param("sortfield",G);I.param("sortorder",H);I.param("currentpage",1);location.href="/farefinder/bestoffers?"+I};this.submitNewSearch=function(G){s2.tuifly.controller.FarefinderSearch.getInstance().submit("",true)};this.updateCalendarPrices=function(){if(D&&F){var G="--";if(D.getSymbol()==F.getSymbol()){G=D.add(F)}$("#priceTotal").html(G.toString())}};var D=null;var F=null;var C={EUR:"&euro;",USD:"$",GBP:"&pound;"};this.enableIcon=function(){var H=$(".qCalendar");var G=$(".qHistory");if(s2.tuifly.controller.FarefinderSearch.getInstance().check()){H.addClass("enable");G.addClass("enable")}else{H.removeClass("enable");G.removeClass("enable")}};window.setStartDateFlash=function(I,L,H,J,G){A=I+"-"+L+"-"+H;var M=JooseX.Culture.Factory.get();var K=M.formatDate(new Date(parseFloat(I),parseFloat(L)-1,parseFloat(H)));$("#startDate").html(K);if(C[G]){G=C[G]}J=new s2.tuifly.util.CurrencyValue({value:parseFloat(J,10),symbol:G});D=J;$("#priceStart").html(J.toString());s2.tuifly.helper.farefinder.updateCalendarPrices()};window.setEndDateFlash=function(J,L,H,K,G){B=J+"-"+L+"-"+H;var M=JooseX.Culture.Factory.get();var I=M.formatDate(new Date(parseFloat(J),parseFloat(L)-1,parseFloat(H)));$("#dateTo").removeClass("hidden");$("#endDate").html(I);if(C[G]){G=C[G]}K=new s2.tuifly.util.CurrencyValue({value:parseFloat(K,10),symbol:G});F=K;$("#priceReturn").html(K.toString());s2.tuifly.helper.farefinder.updateCalendarPrices()}});s2.namespace("s2.tuifly.helper.farefinderPromoIcons",function(){this.initialize=function(){if(typeof(promoDataHash)!="undefined"){$.each(promoDataHash,function(C){var B=promoDataHash[C]["headline"];var D=promoDataHash[C]["text"];if(B&&D){var A;if(typeof(promoQueries)!="undefined"){promoQueries[C].live("mouseover",function(E){A=$(this).parent().find(".queryTooltipContent").clone();A.find("h4.queryTooltipInfo").html(B);A.find("p.queryTooltipInfo").html(D);A.removeClass("calculated");s2.tuifly.widget.tooltip.calculatePosition(A,E);s2.tuifly.widget.tooltip.createTooltip(A,E);A.show()}).live("mouseout",function(){if(A){A.remove()}})}}})}}});s2.namespace("s2.tuifly.helper.farefinderCarrierIcons",function(){this.initialize=function(){if(typeof(carrierDataHash)!="undefined"){$.each(carrierDataHash,function(C){var B=carrierDataHash[C]["headline"];var D=carrierDataHash[C]["text"];if(B&&D){var A;if(typeof(carrierQueries)!="undefined"){carrierQueries[C].live("mouseover",function(E){A=$(this).parent().find(".queryTooltipContent").clone();A.find("h4.queryTooltipInfo").html(B);A.find("p.queryTooltipInfo").html(D);A.removeClass("calculated");s2.tuifly.widget.tooltip.calculatePosition(A,E);s2.tuifly.widget.tooltip.createTooltip(A,E);A.show()}).live("mouseout",function(){if(A){A.remove()}})}}})}}});s2.namespace("s2.tuifly.helper.farefinderVerlaufSelector",function(){var A=this;this.initialize=function(){$("#button1Monat").live("click",function(){$(this).removeClass("buttonNotActive");$(this).addClass("buttonActive");$("#button6Monate").addClass("buttonNotActive");$("#button6Monate").removeClass("buttonActive");A.flashRef("content").setView("priceTrend1Month")});$("#button6Monate").live("click",function(){$(this).removeClass("buttonNotActive");$(this).addClass("buttonActive");$("#button1Monat").addClass("buttonNotActive");$("#button1Monat").removeClass("buttonActive");A.flashRef("content").setView("priceTrend6Months")})};A.flashRef=function(B){if(navigator.appName.indexOf("Microsoft")!=-1){return window[B]}else{return document[B]}};A.trace=function(B){document.getElementById("output").innerHTML+=str+"<br />"}});s2.namespace("s2.tuifly.helper.hideASPErrorMessage",function(){this.initialize=function(){if(document.getElementById("error")){$("body#error>h2:first a[href*=ErrorMessage.aspx]").parents("h2").hide()}}});s2.namespace("s2.tuifly.helper.forceNewRendering",function(){this.initialize=function(){this.RightAlignedIconsIE6()},this.render=function(A){this.renderIE6(A)},this.renderIE6=function(A){$(A).attr("zoom",1)},this.RightAlignedIconsIE6=function(){}});s2.namespace("s2.tuifly.helper.partner",function(){$(document).ready(function(){if(window.longPartnerList){var A=new s2.tuifly.util.Query();var B=A.param("partner");if(B){window.partnerList=window.longPartnerList;s2.tuifly.widget.dialog.myTUIflyLayer("/de/_includes/partner/"+B+".html");return}}if(window.shortPartnerList){var A=new s2.tuifly.util.Query();var B=A.param("partner");if(B){window.partnerList=window.shortPartnerList;s2.tuifly.widget.dialog.myTUIflyLayer("/de/_includes/partner/"+B+".html");return}}});this.go=function(G,I){var H=window.partnerList;var D=[];var C;var F=0;Joose.O.eachSafe(H,function(J,K){if(K==""){return}D.push(J);if(I==K){C=F}F++});var E=C+G+F;var B=E%F;var A=D[B];s2.tuifly.widget.dialog.ajaxLayerClose();s2.tuifly.widget.dialog.myTUIflyLayer(A)};this.login=function(){setTimeout("s_trackEvent('event3',this,'login');",100);window.tuiLogin.submitGlobalLoginRemoteNewValues("user","password","PartnerReturnURL")};this.callPartnerLink=function(D){var C=new s2.tuifly.util.Cookie();var A=C.get("customerNumber");var B=$(D).attr("href");B+=A;$(D).attr("href",B)}});s2.namespace("s2.tuifly.helper.notepad",function(){var A=this;this.initialize=function(){this.synchronizeCounter();this.changeMeinTUIflyNavigationBehaviour();$("#AddAlarmAddAlarmView_TextBoxLoginPassword").live("keyup",function(B){if(B&&B.keyCode==s2KeyCode.ENTER){A.login()}})};this.showAlarmConfirmLayer=function(){var C=this.getFlightParams();var B="AddAlarm.aspx";var D="";jQuery.each(C,function(E,F){if(D==""){D+="?"}else{D+="&"}D+=E+"="+F});B+=D;s2.tuifly.widget.dialog.priceAlarmConfirmLayer();jQuery.get(B,function(E){$("#priceAlarmConfirm-ajaxLayer").html(E)})};this.storeWithAlarm=function(){var C=this.getFlightParams();C.alarm=1;var D=new s2.tuifly.util.Cookie;C.email=D.get("customerEMailEncrypted");C.customerNumber=D.get("customerNumber");C.culture=JooseX.Culture.Factory.get().identifier();s2.tuifly.widget.dialog.divLayerClose();s2.tuifly.widget.dialog.priceAlarmStoreLayer();var B=this;$(document).ajaxError(function(G,F,E){if(E.url.match(/notepad\/store/)){B.prepareForResult($("#priceAlarmStore-ajaxLayer"));B.displayError($("#priceAlarmStore-ajaxLayer"))}});this.setTrackingParams("Merkzettel","Preisalarm");$.getJSON("/notepad/StoreWithAlarm",C,function(E){B.prepareForResult($("#priceAlarmStore-ajaxLayer"));var F=false;if(E&&E.success){F=E.success}if(F){s2.tuifly.helper.notepad.writeCounter(E)}else{B.displayError($("#priceAlarmStore-ajaxLayer"))}})};this.storeWithOutAlarm=function(){var C=this.getFlightParams();C.alarm=0;s2.tuifly.widget.dialog.notepadLayer();var B=this;$(document).ajaxError(function(F,E,D){if(D.url.match(/notepad\/store/)){B.prepareForResult($("#notepad-ajaxLayer"));B.displayError($("#notepad-ajaxLayer"))}});this.setTrackingParams("Merkzettel");$.getJSON("/notepad/store",C,function(D){B.prepareForResult($("#notepad-ajaxLayer"));var E=0;if(D&&D.success&&D.count>0){E=1}if(E){s2.tuifly.helper.notepad.writeCounter(D)}else{B.displayError($("#notepad-ajaxLayer"))}})};this.setTrackingParams=function(D,B){if(typeof(s)!="undefined"){s.linkTrackVars="events,eVar24";if(B){s.linkTrackVars+=",eVar40"}s.linkTrackEvents="event1,event8";s.eVar24=D;if(B){s.eVar40="Preisalarm"}s.events="event1,event8";var C=$("a#notepad").get(0);s.tl(C,"o","LoginErfolg")}};this.trackBookingClick=function(){if(typeof(s)!="undefined"){s.linkTrackVars="eVar24";s.eVar24="Merkzettel";setTimeout("s.tl('', 'o','LoginErfolg')",100)}};this.continueBooking=function(){s2.tuifly.widget.dialog.divLayerClose();var B=$("#ControlGroupSelectView_LinkButtonSubmit");var C=B.offset().top-400;window.scrollTo(0,C);B.trigger("click")};this.prepareForResult=function(B){var C=$(B);C.find(".contentBox").removeClass("hidden");C.find(".wait").addClass("hidden")};this.displayError=function(B){var C=$(B);C.find(".error").removeClass("hidden");C.find(".success").addClass("hidden")};this.getFlightParams=function(){var B={OPriceAdult:$("table.flightSelection input:checked:first").parent().find("a .qPriceAdult").html(),IPriceAdult:$("table.flightSelection input:checked:eq(1)").parent().find("a .qPriceAdult").html(),OPrice:$("#taxAndFeeTotalPrice .journey1 .journeyTotal").attr("grossprice"),IPrice:$("#taxAndFeeTotalPrice .journey2 .journeyTotal").attr("grossprice"),Currency:TYPE.S2Currency.coerce($("#taxAndFeeInclusiveTotalPrice span").html()).getCode(),ADT:s2.tuifly.util.passenger.countOf("ADT"),CHD:s2.tuifly.util.passenger.countOf("CHD"),CHDD:s2.tuifly.util.passenger.countOf("CHDD"),INF:s2.tuifly.util.passenger.countOf("INFANT"),ODM:$("table.flightSelection input:checked:first").parents("tr").attr("departure"),OAM:$("table.flightSelection input:checked:first").parents("tr").attr("arrival"),IDM:$("table.flightSelection input:checked:eq(1)").parents("tr").attr("departure"),IAM:$("table.flightSelection input:checked:eq(1)").parents("tr").attr("arrival"),OAIATA:$("#TeaserDepartureStation").text(),DAIATA:$("#TeaserDestination").text(),OKey:$("table.flightSelection input:checked:first").val(),IKey:$("table.flightSelection input:checked:eq(1)").val(),noCache:Math.random()};return B};this.writeCounterFromCookie=function(){var B=this.getCountFromCookie();if(B!=null){this.writeCounter({count:B})}};this.writeCounterFromRequest=function(){$.getJSON("/notepad/count",{noCache:Math.random()},function(B){var C=0;if(B&&B.success&&B.count>0){C=1}if(C){s2.tuifly.helper.notepad.writeCounter(B)}})};this.getCountFromCookie=function(){var D=new s2.tuifly.util.Cookie();var C=D.get("notepadCount");if(C!=null&&C!=""){return C}var B=D.get("notepadHashes");if(B!=null&&B!=""){B=B.replace(/,$/,"");C=B.split(",").length;return C}return 0};this.writeCounter=function(B){if($("#notepadCounter").length>0){if(B.count<1){$("#notepadCounter").get(0).innerHTML=""}else{$("#notepadCounter").get(0).innerHTML="("+B.count+")"}}if(document.getElementById("notepad-ajaxLayer")){$("#notepad-ajaxLayer").find(".error").addClass("hidden");$("#notepad-ajaxLayer").find(".success").removeClass("hidden")}};this.synchronizeCounter=function(){var B=new s2.tuifly.util.Cookie();var C=B.get("loginEvent");if(C==1){this.writeCounterFromRequest();B.set("loginEvent",0)}else{this.writeCounterFromCookie()}};this.encodeNotepadComment=function(){var B=encodeURI(s2.tuifly.util.removeHtmlTags($("#notepadCommentUnencoded").val()));$("#notepadComment").val(B)};this.areEmailsValid=function(){var B=$("form[name=sendNotepad]");var D=B.find("input[name=notepadEmailList]").val().replace(";",",");var C=true;Joose.A.each(D.split(","),function(E){if(E!=""&&$.trim(E).match(/^[a-zA-Z0-9_\.\-]+\@[a-zA-Z0-9\-]+\.[a-zA-Z0-9]{2,4}$/)==null){C=false}});return D.length>0&&C};this.submitMailForm=function(){var C=$("form[name=sendNotepad]");var B="";if(!this.areEmailsValid()){B+=C.find("div.errorMsgEmail").html()}else{this.encodeNotepadComment();C.submit();return}s2.tuifly.widget.loadingButton.cancelSpinAllButtons();alert(B)};this.deactivateNotepad=function(B,C){jQuery.getJSON("/notepad/DeactivatePriceAlarm?hash="+B,function(D){if(D.success){s2.tuifly.widget.dialog.alertNotice(C);var E=$(".qNotepad-"+B);E.find(".qActiveText").hide();E.find(".qNotActiveText").show();E.find(".priceAlarmIcon").removeClass("priceAlarmActive");E.find(".priceAlarmIcon").addClass("priceAlarmNotActive");E.find(".qActivateLink").show();E.find(".qDeactivateLink").hide();E.find(".priceAlarmIconLink").removeClass("priceAlarmNotActive");E.find(".priceAlarmIconLink").addClass("priceAlarmActive")}else{alert("error: "+D.error)}})};this.activateNotepad=function(B,C){jQuery.getJSON("/notepad/ActivatePriceAlarm?hash="+B,function(D){if(D.success){s2.tuifly.widget.dialog.alertNotice(C);var E=$(".qNotepad-"+B);E.find(".qActiveText").show();E.find(".qNotActiveText").hide();E.find(".priceAlarmIcon").removeClass("priceAlarmNotActive");E.find(".priceAlarmIcon").addClass("priceAlarmActive");E.find(".qActivateLink").hide();E.find(".qDeactivateLink").show();E.find(".priceAlarmIconLink").removeClass("priceAlarmActive");E.find(".priceAlarmIconLink").addClass("priceAlarmNotActive")}else{alert("error: "+D.error)}})};this.login=function(){var D=$("#AddAlarmAddAlarmView_TextBoxLoginId").val();var C=$("#AddAlarmAddAlarmView_TextBoxLoginPassword").val();var B={"AddAlarmAddAlarmView$TextBoxLoginId":D,"AddAlarmAddAlarmView$TextBoxLoginPassword":C};$("#priceAlarmLayer .qLoginForm").hide();$("#priceAlarmLayer .qButtons").hide();$("#priceAlarmLayer .wait").show();jQuery.post("/AddAlarm.aspx",B,function(F){var E=$(F).html();$("#priceAlarmLayer").html(E)})};this.changeMeinTUIflyNavigationBehaviour=function(){var B=function(){var E=$(this);var D=E.attr("href");if(D.match(/mein-TUIfly\/merkzettel\.html$/i)){var C=$(".navNotepad a").attr("href");E.attr("href",C)}};$(".contentNavigation li a").mousedown(B);$(".subLevel li a").mousedown(B)}});s2.namespace("s2.tuifly.helper.zugZumFlug",function(){this.initialize=function(){};this.activateDisabledInputs=function(){var A=$("#zugZumFlugBox");if(A.length>0){$("input",A).removeAttr("disabled")}}});s2.namespace("s2.tuifly.helper.bagInput",function(){var A=this;A.overrideBagInputValidation=false;this.validate=function(){if(A.overrideBagInputValidation){return true}if(!document.getElementById("bagInputBox")){return true}var C=false;$("#bagInputBox input[id*='TextBoxPassengerBag']").each(function(){if($(this).val()!=0){C=true}});if(C){return true}var B="Möchten Sie wirklich kein Gepäck mitnehmen? Bitte beachten Sie, dass sich bei Germanwings-Flügen der Gepäckzuschlag bei Nachzahlung am Flughafenschalter auf 20 € pro Gepäckstück (zzgl. 19% Mehrwertsteuer bei innerdeutschen Flügen) erhöht.";var D="Weiter ohne Gepäck";var E="Gepäck hinzufügen";if(JooseX.Culture.Factory.get().identifier()=="en-GB"){B="Do you really not want to take any luggage with you?\n\n Please note that, for Germanwings flights, the surcharge payable for baggage registered at check-in (as opposed to online) has increased to € 20 per item (plus 19 % V.A.T. on domestic German flights).";D="Continue without luggage";E="Add Luggage"}if(JooseX.Culture.Factory.get().identifier()=="es-ES"){B="¿De verdad que no quiere llevar ningún equipaje?\n\nPor favor, tenga en cuenta que para los vuelos de Germanwings el recargo por equipaje en caso de pago en el mostrador del aeropuerto es de 20 € por pieza (I.V.A no incluído).";D="Seguir sin equipaje";E="Añadir equipaje"}if(JooseX.Culture.Factory.get().identifier()=="it-IT"){B="Non si vuole davvero portare con sé bagagli?\n\n Si ricorda che per i voli Germanwings il supplemento bagaglio in caso di pagamento successivo allo sportello dell'aeroporto corrisponde a 20 € per singolo bagaglio (più IVA del 19% per i voli interni alla Germania).";D="Proseguire senza bagaglio";E="Aggiungere bagaglio"}s2.tuifly.widget.dialog.confirm(B,{okButtonText:D,cancelButtonText:E,dialogClass:"confirmBoxElvia",okCallback:function(){A.overrideBagInputValidation=true;s2.tuifly.widget.submittableForm.clickButton($("#contentArea a.bookingButton"))},cancelCallback:function(){s2.tuifly.helper.extrasAlerts.callbackBagInputBox()}});return false};return true});s2.namespace("s2.tuifly.helper.popup",function(){this.open=function(url,width,height,popupname){if(!width){width=630}if(!height){height=430}var winX=screen.availWidth;var winY=screen.availHeight;var centerX=eval(winX/2-width/2);var centerY=eval(winY/2-height/2);var param="width="+width+",height="+height+",top="+centerY+",left="+centerX;var name;if(popupname){name=popupname}else{name="popup"+Math.random(1);name=name.replace(/\./,"")}var winChild=window.open(url,name,param+",scrollbars=yes,status=no,dependent=yes");if(winChild!=null&&winChild.focus){winChild.focus()}}});s2.namespace("s2.tuifly.helper.mytuiflyLoginBox",function(){this.initialize=function(){this.prepare()};this.prepare=function(){if(document.getElementById("loginForm")){$("#loginForm input#user , #loginForm input#email").click(function(){if(!$(this).hasClass("changed")){$(this).val("");$(this).addClass("changed")}$(this).select()});$("#loginForm input#password[type=text]").focus(function(){var C=$(this);var B=$("<input/>");B.attr("type","password");B.attr("class",C.attr("class"));B.attr("name",C.attr("name"));B.attr("id",C.attr("id"));if(C.attr("tabindex")){B.attr("tabindex",C.attr("tabindex"))}C.replaceWith(B);B.focus();B.focus(function(){$(this).select()})});var A=$("#loginForm.queryLoginBox").outerHeight();$("#loginBoxOpacity").css("height",A+"px");$("#loginForm #login input#password").live("keyup",function(C){if(C.which==s2KeyCode.ENTER){$("#loginForm .loginButton .showButton").trigger("click");var B=$("#loginForm .loginButton .showButton").attr("href");location.href=B}})}$("#loginForm.partnerDetailsButtons input#password").live("keyup",function(B){if(B.which==s2KeyCode.ENTER){s2.tuifly.helper.partner.login()}})}});s2.namespace("s2.tuifly.helper.errorMessage",function(){this.setTrackingParams=function(){var B=location.pathname;B=B.replace(/^\//,"");var A=location.search;A=A.replace(/^\?\w*=\//,"");window.PAGENAME=B+"_"+A};this.setTimestamp=function(){var B=new Date();var A=(B.getHours()+":"+B.getMinutes()+":"+B.getSeconds()+" "+B.getDate()+"."+B.getMonth()+"."+B.getFullYear());$(".toggleContent p").after("<p>"+A+"</p>")}});s2.namespace("s2.tuifly.helper.tracking",function(){var C=this;this.initialize=function(){};this.pageName="";this.click=function(){try{var F=s_gi("rsid");F.linkTrackVars="prop1,prop2,events";F.linkTrackEvents="event1";F.prop1="";F.events="event8";F.eVar24="Merkzettel";F.tl(this,"o","Link Name")}catch(G){s2.Logger.debug("Error "+G)}};this.OmniturePageName=function(F){if(typeof(F)=="string"){this.pageName=F}return this.pageName};try{var D=new s2.tuifly.util.Query();var A=D.param("zanpid");if(A!=null&&A!=""){var B=new Image();B.src="/ZanoxTrackingImage.aspx?"+D.toString()}}catch(E){throw E;s2.Logger.debug("Zanox-Error "+E)}});s2.namespace("s2.tuifly.helper.teaserTracking",function(){this.open=function(E,C,F){if(C||F){try{var B=s2.tuifly.util.Environment.get();var A=s_gi(B.OmnitureAccount());A.linkTrackVars="events,prop8,eVar1";A.linkTrackEvents="event7";if(F){A.prop8=F}if(C){A.eVar1=C}A.events="event7";setTimeout("s.tl('', 'o','Teaserklick')",100)}catch(D){s2.Logger.debug("Error "+D)}}}});s2.namespace("s2.tuifly.helper.SeatMap",function(){var A="Bitte wählen Sie mindestens so viele Sitzplätze wie zum Zeitpunkt der Buchung.";this.setNotEnoughSeatsMessage=function(B){A=B};this.Validate=function(){var G=s2.tuifly.model.SSRSeat.create();if(G==null||G.length==0){return true}var I=G[0].getJourneyCount();for(var C=0;C<I;C++){var E=$("#RequiredSeatsPerJourney_"+C+" param");if(E.length==0){continue}var B=parseInt(E.attr("required"));var H=parseInt(E.attr("available"));s2.Logger.debug("Required seats for Journey "+C+": "+B+" Available: "+H);var D=0;for(var F=0;F<G.length;F++){if(G[F].journey==C){D+=G[F].getBookedCount()}}s2.Logger.debug("Selected Seats in Journey "+C+": "+D);if(D<B&&H>=B){alert(A);return false}}return true}});s2.namespace("s2.tuifly.helper.itinerary",function(){this.initialize=function(){if(document.getElementById("itinerary")){this.loadBanner();this.calcSubtotalExtras();this.checkExtrasPositions();this.checkPartnerPositions()}};this.loadBanner=function(){var A=JooseX.Culture.Factory.get().majorIdentifier();if((s2.tuifly.util.Skin.get().isConsumer()||s2.tuifly.util.Skin.get().isMember())&&A!="it"){var B="/"+A+"/_includes/banner.json";jQuery.getJSON(B,function(C){jQuery.each(C,function(D){if(typeof(destinationAirportCode)!="undefined"&&D.toUpperCase()==destinationAirportCode.toUpperCase()){$("#itineraryBanner").html(C[D])}})})}};this.calcSubtotalExtras=function(){var A=s2.tuifly.util.CurrencyValue.zero();$("#itinerary .flightPriceDisplay .extrasItem .price").each(function(){var C=$(this).text();if(C!=""){var B=TYPE.S2Currency.coerce(C);A=A.add(B)}});$("#subTotalExtras").html(A.toString())};this.checkExtrasPositions=function(){if($("#itinerary .flightPriceDisplay .extrasItem").length==0){$("#itinerary .extrasBlock").addClass("hidden");$("#itinerary .extrasBlock").addClass("noPrint")}};this.checkPartnerPositions=function(){if($("#itinerary .flightPriceDisplay .partnerItem").length==0){$("#itinerary .partnerBlock").addClass("hidden");$("#itinerary .partnerBlock").addClass("noPrint")}}});s2.namespace("s2.tuifly.helper.select",function(){this.requestAlternativeOffers=function(G,D,F,A,B,E){if($(".bookingNumber").text().length>0){return}var C="origin="+G+"&destination="+D+"&start="+F+"&end="+A+"&culture="+B+"&skin="+E;jQuery.get("/farefinder/alternative-origins?"+C,function(H){if(H.indexOf("success")!=-1){$(function(){var I=$("#alternativeOrigins");I.html(H);I.show()})}});jQuery.get("/farefinder/alternative-destinations-select?"+C,function(H){if(H.indexOf("success")!=-1){$(function(){var I=$("#alternativeDestinations");I.html(H);I.show()})}});jQuery.get("/farefinder/alternative-destinations?"+C,function(H){if(H.indexOf("success")!=-1){$(function(){var I=$("#searchFlightDestinations");I.html(H);I.parent().show()})}})}});s2.namespace("s2.tuifly.helper.frameBuster",function(){var A=this;this.bustIfNotInIFrame=function(B){if(window==top){$(function(){var C=JooseX.Culture.Factory.get().identifier();var D=B[C];if(D){location.href=D}})}};this.bust=function(){if(window!=top){$("body").addClass("hidden");var B="?";if(location.href.indexOf("?")>-1){B="&"}top.location.href=location.href+B+"returnURL="+top.location.pathname+top.location.search}};$(function(){if($("body").hasClass("bust")){A.bust()}})});s2.namespace("s2.tuifly.helper.flashTicker",function(){this.initialize=function(){var A=this;if(document.getElementById("flashTickerControl")){var B=A.tickerName();$("#flashTickerControl").mouseover(function(){A.flashMovie(B).tickerStop()});$("#flashTickerControl").mouseout(function(){A.flashMovie(B).tickerResume()})}};this.embed=function(D,F,E,G,B){var A={};A.bgColor=D;A.geschwindigkeit="1";A.news=F;var H={};H.allowscriptaccess="always";H.allownetworking="all";H.wmode="transparent";var C={};C.id=this.tickerName();swfobject.embedSWF(E,this.tickerName(),G,"30","9.0.28",B,A,H,C)};this.flashMovie=function(A){if(navigator.appName.indexOf("Microsoft")!=-1){return window[A]}else{return document[A]}};this.tickerName=function(){return"ticker"}});s2.namespace("s2.tuifly.helper.extrasAlerts",function(){this.callbackTuiCarsBox=function(){var A=$("#tuiCarsBox");s2.tuifly.helper.scrollToElement.start(A)};this.callbackTuiHotelsBox=function(){var A=$("#tuiHotelsBox");s2.tuifly.helper.scrollToElement.start(A)};this.callbackElviaBox=function(){var A=$("#elviaBox");s2.tuifly.helper.scrollToElement.start(A)};this.callbackZZFBox=function(){var A=$("#zugZumFlugBox");s2.tuifly.helper.scrollToElement.start(A)};this.callbackBagInputBox=function(){var A=$("#bagInputBox");s2.tuifly.helper.scrollToElement.start(A)}});s2.namespace("s2.tuifly.helper.htmlErrorToAlert",function(){var A=[30006];this.initialize=function(){this.convert(A)};this.convert=function(G){if(!document.getElementById("error")){return}var D=$("#error");var C=D.find("#errorSectionMainContent div.formRow");var F=D.find("#errorSectionContentDetails01 div.formRow");var E=D.find("#errorSectionContentDetails02 div.formRow");var B=0;F.each(function(H){var L=$(this).find("strong").eq(0).text();var J=L.substring(1,L.indexOf(":"));var K=C.eq(H).text();for(var I=G.length-1;I>=0;I--){if(J==G[I]){C.eq(H).hide();F.eq(H).hide();E.eq(H).hide();B=B+1;if(B==F.length){D.parent().remove()}alert(K)}}return true})}});s2.namespace("s2.tuifly.helper.iframe",function(){this.initialize=function(){this.stopLoadingAnimation()};this.stopLoadingAnimation=function(){var A=window.parent;if(A===window){return}var B;try{loadingDIV=A.document.getElementById("iframeLoading")}catch(C){return}if(!loadingDIV){return}$(loadingDIV).addClass("hidden")}});s2.namespace("s2.tuifly.helper.topbonus",function(){this.initializeTransferForm=function(){$("#TopbonusTransferFields input").appendTo($("#TopbonusTransferForm"))};var C="Bitte stimmen Sie den Bedingungen zu!";this.setTransferErrorMessage=function(D){C=D};var A;var B;this.setSignatures=function(D,E){A=E;B=D};this.submitTransferForm=function(){if(!$("#topbonusTransferAgree").get(0).checked){alert(C);s2.tuifly.widget.loadingButton.unSpinButton($("#topbonusTransferButton"));return false}if($("#topbonusBestandskunde").get(0).checked){$("#TopbonusRegisterField").val("false");$("#TopbonusSignatureField").val(A)}else{$("#TopbonusRegisterField").val("true");$("#TopbonusSignatureField").val(B)}$("#TopbonusTransferForm").get(0).submit();return true}});s2.namespace("s2.tuifly.helper.bookExtras",function(){this.initialize=function(){this.prepare()};this.prepare=function(){if(document.getElementById("bookExtras")){$(".toggleBox").addClass("closed");$(".toggleBox:first").removeClass("closed");function B(D){D=D.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var C="[\\?&]"+D+"=([^&#]*)";var F=new RegExp(C);var E=F.exec(window.location.href);if(E==null){return""}else{return E[1]}}var A=B("toggleBox");if(A){$("#toggleBox_1945").addClass("closed");$("#"+A+"").removeClass("closed");$(document).scrollTo("#"+A+"")}}}});s2.namespace("s2.tuifly.helper.noFormReset",function(){this.initialize=function(){if($.browser.msie){$(document).keydown(function(){if((window.event.keyCode==27)&&(window.lastKey==27)){return false}window.lastKey=window.event.keyCode})}}});s2.namespace("s2.tuifly.helper.emailMissing",function(){this.initialize=function(){this.checkIfEmailIsMissing()};this.checkIfEmailIsMissing=function(){var A=new s2.tuifly.util.Cookie();var B=A.get("missingEmail");if(location.pathname.match(/CustomerProgramAcceptance\.aspx/)){return}if(B=="true"){A.set("missingEmail","false");var C=JooseX.Culture.Factory.get().majorIdentifier();s2.tuifly.widget.dialog.standardLayer("/"+C+"/_includes/emailMissing.html",{noDefaultButton:true})}}});s2.namespace("s2.tuifly.helper.offerTicker",function(){var A;this.initialize=function(){var B=this;$(".myTuiFlyOffers li").click(function(){window.clearInterval(A);B.activateOffer(this)});$(".myTuiFlyOffers li").mouseover(function(){var C=$(this);window.clearInterval(A);B.selectNavi(this)});A=window.setInterval("s2.tuifly.helper.offerTicker.switchOffer()",5000);$(".myTuiFlyOffersDetail").mousedown(function(){var E=$(this).find("a").attr("href");var F=new s2.tuifly.util.Cookie();var H=F.get("customerNumber");var C=E.match(/suburl=(.*)$/i);if(C&&C[1]){var D=C[1];var G=Base64.decode(D);if(!G.match(/&tuiflycid/i)){G+="&tuiflycid="+H}D=Base64.encode(G);E=E.replace(/suburl=(.*)$/,"suburl="+D);$(this).find("a").attr("href",E)}})};this.activateOffer=function(C){var B=$(C);if(B){var D=$(B).attr("id");D=D.replace("teaserOffer_","");$(".myTuiFlyOffersDetail").hide();$("div#detailOffer_"+D).fadeIn(2000)}};this.selectNavi=function(C){var B=$(C);$(".myTuiFlyOffers li").removeClass("offerActive");B.addClass("offerActive")};this.switchOffer=function(){var D=this;var F=$(".myTuiFlyOffers li.offerActive");var B=1;if($(F).length>0){var G=$(F).attr("id");G=G.replace("teaserOffer_","");B=parseInt(G)+1;var E=$(".myTuiFlyOffers li").length;if(B>E){B=1}var C=$("#teaserOffer_"+B);D.selectNavi(C);D.activateOffer(C)}}});s2.namespace("s2.tuifly.helper.customerProgrammAcceptance",function(){this.check=function(){if($(".formCheckbox input").not(":checked").length>0){alert("Bitte best&auml;tigen Sie die AGB.");return false}return true}});s2.namespace("s2.tuifly.helper.orgaAgreement",function(){this.initialize=function(){if(document.getElementById("orgaAgreementLayer")){s2.tuifly.widget.dialog.standardLayer($("#orgaAgreementLayer"),{noDefaultButton:true})}};this.continueAndAgree=function(){s2.tuifly.widget.dialog.divLayerClose();$.post("/OrganizationAgreementDone.aspx",{status:"OK"})}});s2.namespace("s2.tuifly.helper.selectView",function(){this.initialize=function(){if($(".itineraryNumber").length>0){$(".views").hide()}};this.getContent=function(D,E){if(jQuery.browser.msie6){s2.tuifly.widget.dialog.updateBrowser()}else{var F=$(".q-priceCalendar");var A=$(".q-priceHistory");F.hide();A.hide();var B=JooseX.Culture.Factory.get().identifier();var C=D+"?culture="+B;jQuery.get(C,function(J){var I=$(E,J);$("#selectView .layerContent").html(I);$(".selectButton").removeClass("hidden");$(".q-farefinderButton").addClass("hidden");var H=$("#ControlGroupAvailabilitySearchSelectView_AvailabilitySearchInputSelectView_DropDownListMarketOrigin1").val();var G=$("#ControlGroupAvailabilitySearchSelectView_AvailabilitySearchInputSelectView_DropDownListMarketDestination1").val();var K;if(D=="/farefinder/pricecalendar"){K="628px";F.show()}else{K="700px";A.show()}s2.tuifly.widget.dialog.selectViewLayer($("#selectView"),K);if(D=="/farefinder/pricecalendar"){s2.tuifly.flash.calendarView.embedFlash(H,G,"DateFromFlightSelection","calendar")}if(D=="/farefinder/pricehistory"){s2.tuifly.flash.historyView.embedFlash(H,G,"DateFromFlightSelection","priceTrend1Month")}})}}});s2.namespace("s2.tuifly.helper.openChristmas",function(){this.initialize=function(){var A=this.get_url_param("advent");if(A==1){s2.tuifly.widget.dialog.christmasLayer("/skyres/static/christmasLayer.html")}};this.get_url_param=function(A){A=A.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var B=window.location.href.match("[\\?&]"+A+"=([^&#]*)");if(B==null){return""}else{return B[1]}}});s2.namespace("s2.tuifly.helper.abTesting",function(){var B=this;var A=false;this.initialize=function(){if(!A){return}};this.addABTest=function(I,H,E,D,F,G){if(typeof(D)!="object"){return}if(D&&(new Date().getTime()<D.getTime())){return}if(F&&(D.clone().addDays(F).getTime()<new Date().getTime())){return}var K=new s2.tuifly.util.Cookie();var C=I+"_"+D.getTime();var J=$("."+I);if(K.get(C)==""){if(Math.random()<=H){K.set(C,"A")}else{K.set(C,"B")}}if(K.get(C)=="A"){if(G&&jQuery.isFunction(G)){G(J)}else{J.css("display","block")}}if(E&&jQuery.isFunction(E)){E(J,K.get(C))}}});s2.namespace("s2.tuifly.helper.facebook",function(){var A=this;A.airports;A.friends;A.myAirport;A.api;A.showPermissionDialog=false;A.loggedInUserID;A.nearestAirportStore={};A.IATACodeToAirportStore={};A.suffix="";A.hasPublishStreamPermission;A.applicationProfileID="";this.initialize=function(){if(document.getElementById("facebookapp")){A.initSearchBoxFriends()}};this.getIATACodeToAirportStore=function(){return A.IATACodeToAirportStore};this.getAirportFromIATAcode=function(B){return A.IATACodeToAirportStore[B]};this.initFriendsFilter=function(){for(var C in A.friendLists){var D=$(".qFriendsFilterOff");var B=$(".qFriendsFilterOn");D.removeClass("hidden");D.click(function(){var E=$(this);$(E).addClass("hidden");B.removeClass("hidden")});B.click(function(){var E=$(this);$(E).addClass("hidden");D.removeClass("hidden")});B.find("li").click(function(){var F=$(this).find("a").html();D.html(F);var E=A.friendLists[F];if(E&&E.length>0){$(".qFriend").addClass("listFilterActive");jQuery.each(E,function(){var G=this;$("#friend"+G).removeClass("listFilterActive")})}else{$(".qFriend").removeClass("listFilterActive")}});break}};this.initSearchBoxFriends=function(){var B=$(".qSearchFriends");B.keydown(function(D){if(D.keyCode==s2KeyCode.ENTER){D.preventDefault()}if(D.keyCode==s2KeyCode.ESC){setTimeout("s2.tuifly.helper.facebook.resetSearchfieldFriends()",0);D.preventDefault()}if(D.keyCode==s2KeyCode.BACKSPACE){var C=this.defaultValue.substring(0,this.defaultValue.length-1);var E=$(this).val();if(E.indexOf(C)>=0){$(this).val("")}}});B.keyup(function(D){if(D.keyCode==s2KeyCode.ESC){return}var E=$(this).val();if(E==this.defaultValue){return}if(E.indexOf(this.defaultValue)>=0){E=E.substring(this.defaultValue.length);$(this).val(E)}if(E=="yourockmyworld"){window.open("http://www.youtube.com/watch?v=fQccK0F1_iY");$(this).val("")}$("#resetSearchIconFriends").removeClass("hidden");var C=$(".qFriend");if(!E){C.removeClass("friendFilterActive");return}C.addClass("friendFilterActive");$(".qFriendName").each(function(){var F=$(this).html();var J=$(this);var I=new RegExp("^"+E,"i");var G=new RegExp(" "+E,"i");if(F.match(I)||F.match(G)){var H=J.closest(".qFriend");$(H).removeClass("friendFilterActive")}})});B.val("Freunde suchen")};this.initFacebookApi=function(B){if(!FB){return}FB.init(B,"facebook/xd_receiver.html");FB.ensureInit(function(){FB.CanvasClient.startTimerToSizeToContent();setInterval("FB.CanvasClient.setSizeToContent()",2000);A.api=FB.Facebook.apiClient;var C=FB.Facebook.apiClient.get_session();A.loggedInUserID=C.uid;if(A.showPermissionDialog){A.showPublishStreamPermissionDialog()}})};this.showPublishStreamPermissionDialog=function(B){FB.Connect.showPermissionDialog("publish_stream",function(C){if(C){A.showPublishInstallMessage();A.setPublishStreamPermission(true);if(typeof B=="function"){B()}}else{jQuery.getJSON("/facebook/SaveUserDeniedPublishStream",{userID:A.loggedInUserID})}})};this.showPublishInstallMessage=function(){if(!FB){return}var D={name:"TUIfly SkyFriends beta App",href:"http://apps.facebook.com/"+A.suffix+"/",description:"Einfach mal deine Freunde besuchen! Mit der TUIfly SkyFriends beta App die besten Flugangebote zum gegenseitigen besuchen und gemeinsam verreisen finden.",media:[{type:"image",src:"http://www.tuifly.com/skyres/images/facebook/attachment.png",href:"http://apps.facebook.com/"+A.suffix+"/"}]};var B=[{text:"zu SkyFriends beta",href:"http://apps.facebook.com/"+A.suffix+"/"}];var C="hat die TUIfly SkyFriends beta App installiert.";FB.Connect.streamPublish(C,D,B)};this.publishOnApplicationPage=function(E,D,C){var B={attachmentName:D.name,attachmentLink:D.href,attachmentDescription:D.description,attachmentImageSrc:D.media[0].src,attachmentImageLink:D.media[0].href,actionLinkText:C[0].text,actionLinkLink:C[0].href,message:E};jQuery.get("/facebook/PublishOnApplicationPage",B,function(){})};this.setSuffix=function(B){A.suffix=B};this.getSuffix=function(){return A.suffix};this.setApplicationProfileID=function(B){A.applicationProfileID=B};this.setFriends=function(B){A.friends=B};this.getFriends=function(){return A.friends};this.getFriendByID=function(E){var C=A.getFriends();for(var B in C){var D=C[B];if(D.FriendID==E){return D}}};this.setFriendLists=function(B){this.friendLists=B;A.initFriendsFilter()};this.getFriendLists=function(){return A.friendLists};this.setAirportList=function(B){this.airports=B};this.getAirportList=function(){return A.airports};this.getAirportByIATAcode=function(D){var C=A.airports;for(var B in C){var E=C[B];if(E.IATAcode==D){return E}}};this.setOrigin=function(B,C){if(!B){if(navigator.geolocation){navigator.geolocation.getCurrentPosition(function(E){var F={lat:E.coords.latitude,lng:E.coords.longitude};var D=A.nearestAirport(F);A.myAirport=D;if(typeof C=="function"){C()}},function(){A.setOrigin("Hannover",C)});return}else{B="Hannover"}}A.getLatLng(B,function(E){if(E){var D=A.nearestAirport(E);A.myAirport=D}if(typeof C=="function"){C()}})};this.nearestAirport=function(F){var E=F.lat+":"+F.lng;if(A.nearestAirportStore[E]){return A.nearestAirportStore[E]}var D=new GLatLng(F.lat,F.lng);var G;var B;var C=this.airports;jQuery.each(C,function(H){var K=C[H];var I=new GLatLng(K.Lat,K.Lng);var J=D.distanceFrom(I);if(typeof G=="undefined"||J<G){B=K;G=J}if(!A.IATACodeToAirportStore[K.IATAcode]){A.IATACodeToAirportStore[K.IATAcode]=K}});B.distance=G;A.nearestAirportStore[E]=B;return B};this.getLatLng=function(C,G){if(!C){return}var D=C.split(",");var F=D[0];var E=D[1];if(!F){F=""}if(!E){E=""}E=E.replace(/^\s+/,"");var B=function(I){if(I){if(!I.success){var H=new GClientGeocoder();H.getLatLng(C,function(J){if(J){var K={lat:J.lat(),lng:J.lng(),success:1};G(K)}else{}})}else{G(I)}}else{}};jQuery.getJSON("/facebook/GeoLocation/",{city:F,country:E},B)};this.sendPrivateMessage=function(D,E,F){E=encodeURI(E);F=encodeURI(F);var C="http://www.facebook.com/inbox/?compose&id="+D+"&subject="+E+"&message="+F;var B=parent;if(!B){B=window}B.location.href=C};this.showShareDialog=function(){if(!FB){return}FB.Connect.showShareDialog("http://apps.facebook.com/"+A.suffix+"/",function(){})};this.showBookmarkDialog=function(){if(!FB){return}FB.Connect.showBookmarkDialog(function(){})};this.createProfileInfoURL=function(C){var B=$(C).attr("href");if(B.match(/\?/i)){B+="&v=info"}else{B+="?v=info"}$(C).attr("href",B)};this.setPublishStreamPermission=function(B){A.hasPublishStreamPermission=B};this.updateAirportSelect=function(B){if(B=="-1"){return}if(!B){B=A.myAirport.IATAcode}$("#airportSelect").val(B);$("#airportSelect").trigger("change")};this.askForHometown=function(C,F,B){var D="Ich will Dich sehen";var E="Hey "+F+",\n\nDu musst unbedingt Deine Heimatstadt im Profil eintragen!\n\nDann können wir die neue TUIfly SkyFriends App zusammen benutzen. Die ist wirklich cool!\nDamit kann man die besten Flugangebote zum zusammen verreisen und gegenseitig besuchen finden.\n\nLG, "+B;A.sendPrivateMessage(C,D,E)};this.getOfferURL=function(I,C,J,B){if(!I){I=""}if(!C){C=""}if(!J){J=""}var F,E;if(s2.tuifly.helper.facebook.page.flytogether.selectedDate.value>0){var G=s2.tuifly.helper.facebook.page.flytogether.selectedDate.value;var K=G.substring(0,4);var H=G.substring(4);F="01."+H+"."+K;E="14."+H+"."+K}else{F=Date.today().toString("dd.MM.yyyy");E=Date.today().add(7).days().toString("dd.MM.yyyy")}var D=location.protocol+"//www.tuifly.com/route/"+I+"/"+C;if(F){D+="/"+F}if(E){D+="/"+E}if(J){D+="/"+J}if(B){D+="/"+B}return D};this.showInviteDialog=function(){$("#inviteDialog").removeClass("hidden")};this.resetSearchfieldFriends=function(){var B=$(".qSearchFriends");$(B).val("");$(B).trigger("keyup");$(B).val("Freunde suchen");$("#resetSearchIconFriends").addClass("hidden")};this.publishOnFriendStream=function(C,E,D,B){if(!FB){return}FB.Connect.streamPublish(E,D,B,C)}});s2.namespace("s2.tuifly.helper.facebook.page.visit",function(){var A=this;A.friendToAddressStore={};A.friendToAirportStore={};A.mapAirportLayerSetsCount={};A.amountOfFriendPerRow=5;A.mapLoaded=false;this.initialize=function(){if(document.getElementById("facebookapp")){if(document.getElementById("facebookVisit")){A.initDirectionHandling();A.initAirportSelectBox();A.initMapMessageLayer();A.initMapNameLayer();$(".sliderContent").live("mouseout",function(B){if(B.originalTarget&&B.originalTarget.nodeName=="IMG"){return}if(B.fromElement&&B.fromElement.nodeName=="IMG"){return}$(".qNameLayer").addClass("hidden")})}}};this.initMapMessageLayer=function(){$(".sliderContent .qMessage").live("mouseover",function(){var B=$(".qNameLayer");var C=$(this).attr("message");$(B).find(".qName").html(C);var F=$(this).offset();var E=F.top-5;var D=F.left+20;$(B).css("top",E+"px");$(B).css("left",D+"px");$(B).removeClass("hidden")})};this.initMapNameLayer=function(){$(".sliderContent img").live("mouseover",function(){var C=$(".qNameLayer");var B=$(this).attr("name");$(C).find(".qName").html(B);var F=$(this).offset();var E=F.top+10;var D=F.left+38;$(C).css("top",E+"px");$(C).css("left",D+"px");$(C).removeClass("hidden")})};this.initAirportSelectBox=function(){$("#airportSelect").change(function(){var B=$(this);var C=B.val();s2.tuifly.helper.facebook.myAirport=s2.tuifly.helper.facebook.getAirportFromIATAcode(C);A.loadFriendList()})};this.init=function(){s2.tuifly.helper.facebook.updateAirportSelect()};this.initDirectionHandling=function(){$(".qDirection").click(function(){A.loadFriendList()});$(".qDirection:first").attr("checked","checked")};this.getPrice=function(C,B,D){jQuery.getJSON("/farefinder/bestoffer",{origin:C,destination:B},function(E){D(E.price);A.checkProcessAndLoadMap()})};this.loadFriendList=function(){var C=s2.tuifly.helper.facebook.getFriends();var D=$(".qDirection:checked").val()=="visit"?false:true;$(".qFriend").addClass("deactivateModul");$(".qOfferDetails").addClass("hidden");$(".qRoute").addClass("hidden");$(".qFriend").addClass("qLoading");$(".qFriend").removeClass("noPriceAvailable");A.deactivateMap();A.friendToAddressStore={};A.friendToAirportStore={};for(var B in C){(function(){var F=C[B];if(F.FriendID==s2.tuifly.helper.facebook.loggedInUserID){return}var E=F.Location;if(E){if(A.friendToAddressStore[E]){A.friendToAddressStore[E].push(F.FriendID)}else{A.friendToAddressStore[E]=[F.FriendID];s2.tuifly.helper.facebook.getLatLng(E,function(K){if(K){var I=s2.tuifly.helper.facebook.nearestAirport(K);var M=A.friendToAddressStore[E];if(I.IATAcode!=s2.tuifly.helper.facebook.myAirport.IATAcode){if(I.distance<=200*1000){var J;var L;if(D){L=I;J=s2.tuifly.helper.facebook.myAirport}else{L=s2.tuifly.helper.facebook.myAirport;J=I}A.getPrice(L.IATAcode,J.IATAcode,function(N){jQuery.each(M,function(Q){var T=M[Q];var R=$("#friend"+T);if(N){var P=s2.tuifly.helper.facebook.getOfferURL(L.IATAcode,J.IATAcode,"ZuFreunden");$(R).find(".qOfferLink").attr("href",P);$(R).find(".qOrigin").html(L.Name);$(R).find(".qDestination").html(J.Name);$(R).find(".qPrice").html(N);$(R).find(".qOfferDetails").removeClass("hidden");var O=L.Name+" > "+J.Name;$(R).find(".qOfferLink").attr("title",O+" ab "+N+" bei TUIfly.com");$(R).find(".qRoute").removeClass("hidden");$(R).find(".qSameAirport").addClass("hidden");$(R).find(".qLinkFlyTogether").addClass("hidden");$(R).find(".qMessage").removeClass("hidden");$(R).removeClass("qLoading");$(R).removeClass("deactivateModul");if(A.friendToAirportStore[I.IATAcode]){var S=A.friendToAirportStore[I.IATAcode];if(jQuery.inArray(T,S)==-1){A.friendToAirportStore[I.IATAcode].push(T)}}else{A.friendToAirportStore[I.IATAcode]=[T]}}else{$(R).removeClass("qLoading");$(R).addClass("noPriceAvailable")}})})}else{jQuery.each(M,function(N){var P=M[N];var O=$("#friend"+P);$(O).removeClass("qLoading");$(O).addClass("tooFarAway")})}}else{jQuery.each(M,function(N){var P=M[N];var O=$("#friend"+P);$(O).find(".qSameAirport").html("zu Fu&szlig; besuchen oder<br />");$(O).find(".qMessage").addClass("hidden");$(O).find(".qSameAirport").removeClass("hidden");$(O).find(".qLinkFlyTogether").removeClass("hidden");$(O).removeClass("qLoading");$(O).removeClass("deactivateModul")})}A.checkProcessAndLoadMap()}})}}else{var H=F.FriendID;var G=$("#friend"+H);if(D){orig="???";dest=s2.tuifly.helper.facebook.myAirport.Name}else{orig=s2.tuifly.helper.facebook.myAirport.Name;dest="???"}$(G).find(".qRoute").removeClass("hidden");$(G).find(".qOrigin").html(orig);$(G).find(".qDestination").html(dest);$(G).find(".qAskForHometown").removeClass("hidden");$(G).removeClass("qLoading");$(G).removeClass("deactivateModul")}})()}};this.composeMessageTo=function(K,H,B){var L="";var I=$("#friend"+K+" .qOrigin").text();var F=$("#friend"+K+" .qDestination").text();var J=I+" > "+F;var C=$("#friend"+K+" .qPrice").text();var G=$("#friend"+K+" .qOfferLink").attr("href");var E=$(".qDirection:checked").val();var D="Überraschung :-)";if(E=="visit"){L="Hey "+H+",\n\nwas hälst Du davon, wenn ich Dich spontan besuchen komme?\n\nDurch die TUIfly SkyFriends beta App habe ich dieses tolle Angebot gefunden, um Dich zu besuchen:\n\n"+J+"\nab "+C+"\n\nWann passt es dir am besten?\n\n"+G+"\n\nLG, "+B}else{L="Hey "+H+",\n\nwas hälst Du davon mich demnächst zu besuchen?\n\nDurch die TUIfly SkyFriends beta App habe ich dieses tolle Angebot gefunden:\n\n"+J+"\nab "+C+"\n\nBis bald bei mir.\n\n"+G+"\n\nLG, "+B}s2.tuifly.helper.facebook.sendPrivateMessage(K,D,L)};this.sendOfferToFriend=function(B){var F=function(){s2.tuifly.helper.facebook.page.visit.sendPublicOfferMessage(B)};var D=function(){s2.tuifly.helper.facebook.page.visit.sendPrivateOfferMessage(B)};var C={forceIframeAlert:true,title:"Einen Besuch vorschlagen",okButtonText:"Pinnwand",cancelButtonText:"private Nachricht",okCallback:F,cancelCallback:D,view:"note",fixTop:350};var E="Magst Du den Besuch über eine private Nachricht vorschlagen?\nOder einfach auf die Pinnwand posten?";s2.tuifly.widget.dialog.confirm(E,C)};this.setupMap=function(){if(GBrowserIsCompatible()){var B=document.getElementById("map");if(!B){return}$(B).removeClass("hidden");A.map=new GMap2(B);GEvent.addListener(A.map,"load",function(){$("#mapLoading").removeClass("invisible")});A.map.setUIToDefault();A.map.setCenter(new GLatLng(49.95122,10.283203),4);A.markerManager=new MarkerManager(A.map)}};this.checkProcessAndLoadMap=function(){if(!A.mapLoaded&&$(".qLoading").length==0){A.loadMarkers();A.activateMap()}};this.deactivateMap=function(){$("#mapLoading").addClass("deactivateMapLoading");$("#mapDeactivate").addClass("deactivateMap");A.mapLoaded=false;A.markerManager.clearMarkers();A.map.clearOverlays()};this.activateMap=function(){$("#mapLoading").removeClass("deactivateMapLoading");$("#mapDeactivate").removeClass("deactivateMap");A.mapLoaded=true};this.loadMarkers=function(){if(!A.markerManager){return}A.markerManager.clearMarkers();A.map.clearOverlays();var H=[];var E=s2.tuifly.helper.facebook.getIATACodeToAirportStore();var D=E[s2.tuifly.helper.facebook.myAirport.IATAcode];var J=new GLatLng(D.Lat,D.Lng);var L={geodesic:true};A.map.panTo(J,4);var K=[];K.push(J);var B=A.createMarker(J,[],s2.tuifly.helper.facebook.myAirport);if(B){H.push(B)}else{A.activateMap();A.map.setCenter(new GLatLng(49.95122,10.283203),4);return}jQuery.each(E,function(O,R){var Q=A.friendToAirportStore[O];if(Q&&Q.length>0){var M=new GLatLng(R.Lat,R.Lng);if(M){var N=A.createMarker(M,Q,R);H.push(N);var P=new GPolyline([J,M],"#ff0000",1,1,L);A.map.addOverlay(P);K.push(M)}}});var C=0;A.markerManager.addMarkers(H,C);A.markerManager.refresh();if(K.length>1){var G=new GLatLngBounds();for(var I=0;I<K.length;I++){G.extend(K[I])}var F=A.map.getBoundsZoomLevel(G);A.map.setCenter(G.getCenter(),F)}};this.createMarker=function(L,K,G){if(L.lat()==0&&L.lng()==0){return}var O=new GIcon(G_DEFAULT_ICON);var D=K.length;var J="/skyres/images/facebook/";var P=true;var R=false;var B="";if(D>=10){O.image=J+"marker_large.png";O.iconSize=new GSize(24,25);O.iconAnchor=new GPoint(10,10)}else{if(D>=5){O.image=J+"marker_medium.png";O.iconSize=new GSize(18,22);O.iconAnchor=new GPoint(6,10)}else{if(D>=1){O.image=J+"marker_small.png";O.iconSize=new GSize(12,22);O.iconAnchor=new GPoint(4,10)}else{O.image=J+"myAirportMarker.png";O.iconSize=new GSize(17,16);O.iconAnchor=new GPoint(4,10);R=true}}}O.shadowSize=new GSize(0,0);O.iconWindowAnchor=new GPoint(5,1);var C=G?G.Name:"";if(R){P=false;B="Mein Flughafen: "+C}else{var Q=D>1?"e":"";B="Jetzt klicken: "+C+" ("+D+" Freund"+Q+")"}markerOptions={icon:O,clickable:P,title:B};var F=new GMarker(L,markerOptions);var N;var T;var M;var E=0;var H=0;var I=G?G.IATAcode:"";var C=G?G.Name:"";var S=$("#maptemplate>.friendLayer").clone();jQuery.each(K,function(d){if((E%A.amountOfFriendPerRow)==0){H++}E++;var Y=K[d];var c=$("#friend"+Y);var V=$(c).find(".qPicture").attr("src");if(typeof N=="undefined"){N=$(c).find(".qPrice").html()}if(typeof T=="undefined"){T=$(c).find(".qOrigin").html()}if(typeof M=="undefined"){M=$(c).find(".qDestination").html()}var a=$(c).find(".qFriendLink").attr("title");var f=$(c).find(".qFriendLink").attr("href");var g=$(c).find(".qOfferLink").attr("href");var h=$(c).find(".qOfferLink").attr("title");var b=$(c).find(".qMessage").attr("href");var X=$(c).find(".qMessage").attr("title");var W="unit size1of5 q"+I+"Set"+H+" q"+I+"Sets";if(E==A.amountOfFriendPerRow){W+=" lastUnit"}var U="<div class='"+W+"' id='mapFriend"+Y+"'>";var Z='<a href="'+f+"\" target='_parent'><img src='"+V+"' name=\""+a+'" /></a>';var e='<a href="'+b+"\" class='message qMessage' message='"+X+"'></a>";U=U+Z+e+"</div>";$(S).find(".sliderContent").append(U);$(S).find(".qOrigin").html(T);$(S).find(".qDestination").html(M);$(S).find(".qPrice").html(N);$(S).find(".qAirportName").html(C);$(S).find(".qOfferLink").attr("href",g);$(S).find(".qOfferLink").attr("title",h);$(S).find(".qSliderRight").addClass("qSliderRight"+I);$(S).find(".qSliderLeft").addClass("qSliderLeft"+I);$(S).find(".qSliderRight").attr("href","javascript:s2.tuifly.helper.facebook.page.visit.scrollRight(1, '"+I+"')");$(S).find(".qSliderLeft").attr("href","javascript:s2.tuifly.helper.facebook.page.visit.scrollLeft(1, '"+I+"')")});if(E>0){if(E<A.amountOfFriendPerRow){$(S).find(".pager").hide()}else{$(S).find(".qFriendsShown").html(A.amountOfFriendPerRow);$(S).find(".qFriendsAvailable").html(E)}A.mapAirportLayerSetsCount[I]=H;GEvent.addListener(F,"click",function(){F.openInfoWindow($(S).get(0))})}return F};this.scrollLeft=function(F,C){if(F<=1){return}var E=$(".qSliderLeft"+C);var D=$(".qSliderRight"+C);var B=F-1;if(B==1){$(E).addClass("sliderLeftInactive")}else{if(B<A.mapAirportLayerSetsCount[C]){$(D).removeClass("sliderRightInactive")}}A.updateFriendSetsInLayer(C,B)};this.scrollRight=function(F,C){var E=$(".qSliderLeft"+C);var D=$(".qSliderRight"+C);if(F==A.mapAirportLayerSetsCount[C]){$(".qSliderRight").addClass("sliderRightInactive");return}var B=F+1;if(B>=A.mapAirportLayerSetsCount[C]){$(D).addClass("sliderRightInactive")}else{if(B>=2){$(E).removeClass("sliderLeftInactive")}}A.updateFriendSetsInLayer(C,B)};this.updateFriendSetsInLayer=function(C,B){var E=$(".qSliderLeft"+C);var D=$(".qSliderRight"+C);$(".q"+C+"Sets").addClass("hidden");$(".q"+C+"Set"+B).removeClass("hidden");$(E).attr("href","javascript:s2.tuifly.helper.facebook.page.visit.scrollLeft("+B+", '"+C+"')");$(D).attr("href","javascript:s2.tuifly.helper.facebook.page.visit.scrollRight("+B+", '"+C+"')")};this.sendPrivateOfferMessage=function(B){var D=s2.tuifly.helper.facebook.getFriendByID(B);var C=s2.tuifly.helper.facebook.getFriendByID(s2.tuifly.helper.facebook.loggedInUserID);if(D){A.composeMessageTo(B,D.FirstName,C.FirstName)}};this.sendPublicOfferMessage=function(D){var E=$("#friend"+D);var C=$(E).find(".qOfferDetails .qOfferLink").attr("href");var H="";var F=$(".qDirection:checked").val();if(F=="visit"){H="was hälst Du davon, wenn ich Dich spontan besuchen komme?"}else{H="was hälst Du davon mich demnächst zu besuchen?"}var G={name:"Zum Angebot",href:C,description:"Einfach mal deine Freunde besuchen! Mit der TUIfly SkyFriends beta App die besten Flugangebote zum gegenseitigen besuchen und gemeinsam verreisen finden.",media:[{type:"image",src:"http://www.tuifly.com/skyres/images/facebook/attachment.png",href:"http://apps.facebook.com/"+s2.tuifly.helper.facebook.suffix+"/"}]};var B=[{text:"zu SkyFriends",href:"http://apps.facebook.com/"+s2.tuifly.helper.facebook.suffix+"/"}];s2.tuifly.helper.facebook.publishOnFriendStream(D,H,G,B)};this.flyTogether=function(B){location.href="/facebook/default/flytogether/?f="+B+"&a="+s2.tuifly.helper.facebook.myAirport.Name}});s2.namespace("s2.tuifly.helper.facebook.page.flytogether",function(){var A=this;A.friendToAddressStore={};A.selectedAirport={};A.selectedDestination={};A.selectedDate={};A.offerListWithPrices={};A.routes;A.selectedFriendId;A.selectedAlternativeDestinationIATAcode="";this.initialize=function(){if(document.getElementById("facebookapp")){if(document.getElementById("facebookFlyTogether")){A.initAirportSelectBox();A.initFriendsSelectionBehaviour();A.initOfferSelectionBehaviour();A.initDateSelect();A.initSearchBoxDestinations()}}};this.setSelectedFriendId=function(B){A.selectedFriendId=B;A.addFriend(B)};this.initDateSelect=function(){var B=$("#dateSelect");$(B).val("0");A.updateSelectedDate();B.change(function(){A.selectedDestination={};A.updateSelectedDate();A.removeOffers();A.loadOffers();A.updateRouteInfo()})};this.alternativeOriginsSelect=function(D){var B=$(D);var C=B.val();A.selectedAlternativeDestinationIATAcode=B.closest(".qOfferSmall").attr("iatacode");A.resetSearchfieldDestination();s2.tuifly.helper.facebook.updateAirportSelect(C)};this.initFriendsSelectionBehaviour=function(){$(".qFriend").live("click",function(){var B=$(this).attr("id");B=B.replace(/friend/,"");if(!$(this).hasClass("activeModul")){A.addFriend(B)}else{A.removeFriend(B)}});$(".qFriend").live("mouseover",function(){$(this).addClass("hoverModul");A.updateFriendTitleTag(this)});$(".qFriend").live("mouseout",function(){$(this).removeClass("hoverModul");A.updateFriendTitleTag(this)})};this.updateSelectedDate=function(){var B=$("#dateSelect");A.selectedDate.value=$(B).val();if(A.selectedDate.value!="0"){A.selectedDate.text=$(B).find("option:selected").text().trim()}else{A.selectedDate.text=""}};this.updateFriendTitleTag=function(C){var B=$(C).attr("firstName");if($(C).hasClass("activeModul")){$(C).attr("title","Vielleicht doch nicht mit "+B+" verreisen?")}else{$(C).attr("title","Mit "+B+" verreisen")}};this.updateOfferTitleTag=function(B){if($(B).hasClass("activeModul")){$(B).find("img").attr("title","Oder doch lieber woanders hin?")}else{$(B).find("img").attr("title","Sieht doch super aus hier!")}};this.initOfferSelectionBehaviour=function(){$(".qOffer").live("click",function(){if($(this).hasClass("activeModul")){$(".qOffer").removeClass("activeModul");A.selectedDestination={}}else{$(".qOffer").removeClass("activeModul");$(this).addClass("activeModul");A.selectedDestination.IATAcode=$(this).attr("IATAcode");A.selectedDestination.price=$(this).find(".qPrice").html();A.selectedDestination.name=$(this).find(".qDestination").html()}A.updateRouteInfo()});$(".qOffer").live("mouseover",function(){$(this).addClass("hoverModul");A.updateOfferTitleTag(this)});$(".qOffer").live("mouseout",function(){$(this).removeClass("hoverModul");A.updateOfferTitleTag(this)})};this.updateRouteInfo=function(){var D=$("#summary");D.find(".qOrigin").html(A.selectedAirport.Name);if(A.selectedDestination.IATAcode){var B=A.selectedDestination.name;var E=A.selectedDestination.price;E=E.replace(/\s/,"&nbsp;");D.find(".qDestination").html(B);D.find(".qPrice span").html(E);D.find(".qPrice").removeClass("hidden");if(A.selectedDate.value!="0"){D.find(".qDate").removeClass("hidden");var C=A.selectedDate.text;C=C.replace(/\s/,"&nbsp;");D.find(".qDate span").html(C)}else{D.find(".qDate").addClass("hidden")}}else{D.find(".qDestination").html("???");D.find(".qPrice").addClass("hidden");D.find(".qDate").addClass("hidden")}};this.addFriend=function(D){if(!D){return}$("#friend"+D).addClass("activeModul");$("#summary .qFriendList div").addClass("hidden");var B=$("#friend"+D).find(".qFriendName").html();var C="<li title='Freunde entfernen' alt='Freunde entfernen' onclick='s2.tuifly.helper.facebook.page.flytogether.removeFriend("+D+")'  class='qSelectedFriend"+D+"'>"+B+"</li>";$("#summary .qFriendList").append(C)};this.removeFriend=function(B){$("#friend"+B).removeClass("activeModul");$("#summary .qSelectedFriend"+B).remove();if($("#summary .qFriendList li").length==0){$("#summary .qFriendList div").removeClass("hidden")}};this.removeAllSelectedFriends=function(){$(".qFriend").removeClass("activeModul");$("#summary .qFriendList>li").remove();$("#summary .qFriendList>div").removeClass("hidden")};this.removeOffers=function(){var B=$("#offers");var C=$(B).find(".qList");$(C).empty();$(C).removeClass("hidden");$(B).addClass("loading")};this.initAirportSelectBox=function(){$("#airportSelect").change(function(){$("#summary .qRoute").addClass("hidden");A.removeOffers();var B=$(this);var C=B.val();A.selectedAirport=s2.tuifly.helper.facebook.getAirportFromIATAcode(C);A.selectedDestination={};setTimeout("s2.tuifly.helper.facebook.page.flytogether.loadFriendList(); s2.tuifly.helper.facebook.page.flytogether.loadOffers(); s2.tuifly.helper.facebook.page.flytogether.updateRouteInfo();",0)})};this.init=function(){s2.tuifly.helper.facebook.updateAirportSelect();A.updateRouteInfo()};this.loadOffers=function(){var B=A.selectedDate.value;if(B=="0"){B=""}jQuery.getJSON("/farefinder/BestOffersAsJson",{orig:A.selectedAirport.IATAcode,monthToQuery:B},function(H){var E=0;var D=$("<div/>");A.offerListWithPrices={};jQuery.each(H,function(L,K){E++;A.offerListWithPrices[L]=true;var J=$("#destinationTemplate>.moduleDest").clone();var I=s2.tuifly.helper.facebook.getOfferURL(A.selectedAirport.IATAcode,L,"MitFreunden");$(J).attr("IATAcode",L);$(J).find(".qImage").attr("src","/images/farefinder/"+L.toLowerCase()+"_rdax_298x99.jpg");$(J).find(".qPrice").html(K.Price);$(J).find(".qDestination").html(K.AirportName);$(J).find(".qOfferLink").attr("href",I);$(J).find(".qOfferLink").attr("title","zum Angebot");$(D).append($(J))});if(E==0){$(D).append('<div class="noDestinations qNoDestinations">Es konnten keine Flugziele gefunden werden.<br />Bitte versuche es mit einem anderen Flugziel und/oder einem anderen Flugdatum.</div>')}$("#offers").removeClass("loading");$("#offers .qList").append($(D));if(A.routes){A.updateAlternativeDestinations()}else{jQuery.getJSON("/pregenerated/de/farefinder/HLXConsumer/orig-dest-pairs.json",{},function(I){if(I){A.routes=I.dests;A.updateAlternativeDestinations()}})}if(A.selectedAlternativeDestinationIATAcode){var C=A.selectedAlternativeDestinationIATAcode;var F=$(".qList [iatacode="+C+"]");var G=$(F).clone();$(F).remove();$(".qList").prepend(F);$(F).trigger("click")}$(".qSearchDestination").trigger("keyup")})};this.updateAlternativeDestinations=function(){if(!s2.tuifly.helper.facebook.airports.length){return}var B=$("<div/>");$(B).addClass("alternativeDests");$(B).append("<div class='spacer'></div>");$(B).append($("#zzfHinweis>div").clone());jQuery.each(s2.tuifly.helper.facebook.airports,function(){var E=this;if(A.offerListWithPrices[E.IATAcode]){return}if(E.IATAcode==A.selectedAirport.IATAcode){return}var D=$("#destinationTemplateSmall>.moduleDestSmall").clone();$(D).attr("IATAcode",E.IATAcode);$(D).find(".qImage").attr("src","/flash/"+E.IATAcode.toLowerCase()+".jpg");$(D).find(".qDestination").html(E.Name);var C=['<option value="-1">Bitte wählen</option>'];if(A.routes){jQuery.each(A.routes[E.IATAcode],function(){var F=s2.tuifly.helper.facebook.getAirportFromIATAcode(this);var G="<option value='"+F.IATAcode+"'>"+F.Name+"</option>";C.push(G)});if(C.length>1){$(D).find(".qAlternatives").html(C.join(""));$(B).append($(D))}}});$("#offers .qList").append($(B))};this.loadFriendList=function(){var C=s2.tuifly.helper.facebook.getFriends();A.friendToAddressStore={};$(".qFriend").addClass("qLoading");for(var B in C){(function(){var E=C[B];if(E.FriendID==s2.tuifly.helper.facebook.loggedInUserID){return}var D=E.Location;if(D){if(A.friendToAddressStore[D]){A.friendToAddressStore[D].push(E.FriendID)}else{A.friendToAddressStore[D]=[E.FriendID];s2.tuifly.helper.facebook.getLatLng(D,function(L){if(L){var H=s2.tuifly.helper.facebook.nearestAirport(L);var O=A.friendToAddressStore[D];if(H.IATAcode!=A.selectedAirport.IATAcode){var N=A.selectedAirport;var K=new GLatLng(N.Lat,N.Lng);var I=new GLatLng(L.lat,L.lng);var M=I.distanceFrom(K);var J=D.replace(/, Germany.*/,"");if(M<=200*1000){jQuery.each(O,function(P){var R=O[P];var Q=$("#friend"+R);$(Q).find(".qStatus").html("wohnt in "+J+"<br />kann den Zug zum Flug nehmen");$(Q).removeClass("qLoading");$(Q).removeClass("deactivateModul")})}else{jQuery.each(O,function(P){var R=O[P];var Q=$("#friend"+R);$(Q).find(".qStatus").html("wohnt in "+J);$(Q).removeClass("qLoading");$(Q).removeClass("deactivateModul")})}}else{jQuery.each(O,function(P){var R=O[P];var Q=$("#friend"+R);$(Q).find(".qStatus").html("fliegt mit Dir ab "+A.selectedAirport.Name);$(Q).attr("iataCode",A.selectedAirport.IATAcode);$(Q).removeClass("qLoading");$(Q).removeClass("deactivateModul")})}A.checkProcess()}else{jQuery.each(O,function(P){var R=O[P];var Q=$("#friend"+R);$(Q).removeClass("qLoading");$(Q).removeClass("deactivateModul")})}})}}else{var G=E.FriendID;var F=$("#friend"+G);$(F).removeClass("qLoading");$(F).removeClass("deactivateModul")}})()}};this.sendTripProposal=function(){var D=$(".qFriend.activeModul");if(!(A.selectedAirport.IATAcode&&A.selectedDestination.IATAcode&&$(D).length>0)){s2.tuifly.widget.dialog.alert("Bitte prüfe noch einmal, ob Du Freunde und ein Flugziel ausgewählt hast.",{forceIframeAlert:true,title:"Fehler"});return}if(!s2.tuifly.helper.facebook.hasPublishStreamPermission){s2.tuifly.helper.facebook.showPublishStreamPermissionDialog(s2.tuifly.helper.facebook.page.flytogether.sendTripProposal);return}var C=[];jQuery.each(D,function(){var K=$(this).attr("id");K=K.replace(/friend/,"");C.push(K)});var G=A.selectedDestination.name;var I=A.selectedAirport.Name;var E=A.selectedDestination.price;var F=C.join(",");var B=$(".qFriendList li").length;var H=s2.tuifly.helper.facebook.getOfferURL(A.selectedAirport.IATAcode,A.selectedDestination.IATAcode,"MitFreunden",B);var J={friendsList:F,origin:I,destination:G,price:E,date:A.selectedDate.text,url:H};s2.tuifly.widget.dialog.alert("Reisevorschläge werden versendet...",{view:"note",forceIframeAlert:true,noButtons:true,title:"Hinweis"});jQuery.getJSON("/facebook/PublishStream",J,function(M){var L="";var K="";if(M.success=="1"){L="Deine Reisevorschläge wurden versendet.";K="note"}else{L="Es trat ein Fehler auf und es konnten nicht alle Reisevorschläge versendet werden."}s2.tuifly.widget.dialog.divLayerClose();s2.tuifly.widget.dialog.alert(L,{view:K,forceIframeAlert:true,title:"Hinweis"})})};this.orderFriendList=function(){var E=$(".qFriend");var F=[];var D=[];var C=[];jQuery.each(E,function(){var G=$(this);if(G.attr("friendId")==A.selectedFriendId){A.selectedFriendId="";C.push($(G).get(0))}else{if(G.attr("iataCode")==A.selectedAirport.IATAcode){F.push($(G).get(0))}else{D.push($(G).get(0))}}});$("#friends").empty();var B=$("<span/>");jQuery.each(C,function(){$(B).append(this)});jQuery.each(F,function(){$(B).append(this)});jQuery.each(D,function(){$(B).append(this)});$("#friends").append(B)};this.checkProcess=function(){if($(".qLoading").length==0){A.orderFriendList()}};this.resetSearchfieldDestination=function(){var B=$(".qSearchDestination");$(B).val("");$(B).trigger("keyup");$(B).val("Ziele suchen");$("#resetSearchIconFriends").addClass("hidden")};this.initSearchBoxDestinations=function(){var B=$(".qSearchDestination");B.keydown(function(D){if(D.keyCode==s2KeyCode.ENTER){D.preventDefault()}if(D.keyCode==s2KeyCode.ESC){setTimeout("s2.tuifly.helper.facebook.page.flytogether.resetSearchfieldDestination()",0);D.preventDefault()}if(D.keyCode==s2KeyCode.BACKSPACE){var C=this.defaultValue.substring(0,this.defaultValue.length-1);var E=$(this).val();if(E.indexOf(C)>=0){$(this).val("")}}});B.keyup(function(D){if(D.keyCode==s2KeyCode.ESC){return}var E=$(this).val();if(E==this.defaultValue){return}if(E.indexOf(this.defaultValue)>=0){E=E.substring(this.defaultValue.length);$(this).val(E)}$("#resetSearchIconDestination").removeClass("hidden");var C=$(".qList .qOfferSearchable");if(!E){C.removeClass("offerFilterActive");return}C.addClass("offerFilterActive");C.each(function(){var F=$(this).find(".qDestination").html();var J=$(this);var I=new RegExp("^"+E,"i");var G=new RegExp(" "+E,"i");if(F.match(I)||F.match(G)){var H=J.closest(".qOfferSearchable");$(H).removeClass("offerFilterActive")}})});B.val("Ziele suchen")}});s2.namespace("s2.tuifly.helper.mytuiflyBestOffers",function(){this.initialize=function(){if($(".noLogged").length>0){var A=$("#loginBoxOpacity");var C=$("#loginForm");var B=$(".myTuiFlyOffers .dontClickLayer");A.hide();C.hide();B.click(function(){B.addClass("dontClickTrans");C.show();A.show()})}}});s2.namespace("s2.tuifly.model",function(){Role("s2.tuifly.model.BoundModel",{metaRoles:[JooseX.DOMBinding.JQueryMetaRole],methods:{draw:function(){},notify:function(B,C,A){}}});Class("s2.tuifly.model.Model",{isAbstract:true,meta:s2.tuifly.LazyMetaClass,has:{$:{is:"rw"},context$:{is:"rw"}},classMethods:{select:function(A){throw"subclass responsibility"},selectContext:function(A){return jQuery(document)},create:function(B,C){var A=this;var E=this.selectContext(B);var D=[];s2.Logger.debug("Creating class "+A.meta.className()+" -> "+E.length);E.each(function(){var G=$(this);var F=A.select(G);F.each(function(){var H=A.meta.instantiate(jQuery.extend({$:jQuery(this),context$:G},C));D.push(H);s2.tuifly.initialize.diff(A.meta.className())})});return D}}})});s2.namespace("s2.tuifly.model",function(A){Class("s2.tuifly.model.Booking",{isa:A.Model});A.Booking.ChangeEvent=new s2.tuifly.Event("BookingModelChangeEvent");A.Booking.PassengerChangeEvent=new s2.tuifly.Event("BookingModelPassengerChangeEvent");A.Booking.SSRChangeEvent=new s2.tuifly.Event("BookingModelSSRChangeEvent");A.Booking.TUICarChangeEvent=new s2.tuifly.Event("TUICarChangeEvent");A.Booking.TUIHotelChangeEvent=new s2.tuifly.Event("TUIHotelChangeEvent");A.Booking.ChangeEvent.observe(function C(){s2.Logger.debug("Fired ChangeEvent")});A.Booking.PassengerChangeEvent.observe(function B(){s2.Logger.debug("Fired PassengerChangeEvent")})});s2.namespace("s2.tuifly.model",function(){var A;Class("s2.tuifly.model.Addon",{isa:s2.tuifly.model.Model,isAbstract:true,has:{bookedCount:{isa:TYPE.Int,is:"rw",coerce:true},price:{isa:TYPE.S2Currency,is:"rw",coerce:true},desc:{isa:TYPE.Str,is:"rw",coerce:true},journey:{isa:TYPE.Int,is:"rw"}},after:{initialize:function(){if(!this.isAttachedToJourney()){return}var B=this;var E=null;var D=this.getJourneyCount();for(var C=0;C<D;C++){if(B.$.hasClass("journey"+C)){E=C}}if(E==null){throw"missing journey class "+this.$.attr("class")+":"+this.meta.className()}B.setJourney(E)}},methods:{getJourneyCount:function(){if(A){return A}A=$("#queryFlightPriceTables > table").length;return A},extraInfo:function(){return""},clearHTML:function(B){return $("<span>"+B+"</span>").text()},isAttachedToJourney:function(){return true},bookedDesc:function(){var B=this.getBookedCount();return parseInt(B,10)},totalPrice:function(){return this.getPrice().mul(this.getBookedCount())}}})});s2.namespace("s2.tuifly.model",function(){var A=0;Class("s2.tuifly.model.Passenger",{isa:s2.tuifly.model.Model,has:{index:{isa:TYPE.Int,is:"rw",init:function(){return A++}},addons:{is:"rw",init:function(){return[]}},firstName:{isa:TYPE.Str,is:"rw",init:""},lastName:{isa:TYPE.Str,is:"rw",init:""},description:{isa:TYPE.Str,is:"rw",init:""}},after:{initialize:function(){var B=this;this.update();B.setDescription(B.$.find("label").text());s2.tuifly.model.PassengerManager.getInstance().register(this);s2.tuifly.model.Booking.PassengerChangeEvent.observeLazy(function(){B.update()});s2.tuifly.model.Booking.PassengerChangeEvent.trigger()}},methods:{update:function(){var C=this.$.cachedFind("input.queryFirstName").val();var B=this.$.cachedFind("input.queryLastName").val();if(C!=this.getFirstName()||B!=this.getLastName()){this.setFirstName(C);this.setLastName(B);s2.Logger.debug("Change");$(".dynamicPassengerName"+this.getIndex()).text(this.getName())}},isNamed:function(){return this.getLastName().length>0},getName:function(){var B;if(this.isNamed()){B=this.getFirstName()+" "+this.getLastName()}else{B=this.getDescription()}return B},passengerId:function(){return"passenger"+this.getIndex()},addAddon:function(B){this.getAddons().push(B)}},classMethods:{select:function(){return jQuery("#passengerInputBox div.queryPassengerInput")}}})});s2.namespace("s2.tuifly.model",function(){Class("s2.tuifly.model.PassengerManager",{does:[JooseX.Singleton],has:{passengers:{is:"rw",init:function(){return{}}}},methods:{getPassenger:function(A){if(!A.match(/^passenger/)){throw new Error("Illegal passenger id "+A)}var B=this.getPassengers()[A];if(!B){throw new Error("Unknown passenger "+A)}return B},getPassengersArray:function(){var A=[];Joose.O.each(this.getPassengers(),function(B){A.push(B)});return A},getCount:function(){return this.getPassengersArray().length},register:function(A){this.getPassengers()[A.passengerId()]=A}}})});s2.namespace("s2.tuifly.model",function(){Role("s2.tuifly.model.PassengerBoundModel",{methods:{passengerId:function(){return"passenger"+this.__paxIndex},passengerIndex:function(){return this.__paxIndex},myPassenger:function(){return s2.tuifly.model.PassengerManager.getInstance().getPassenger(this.passengerId())},bindToPassenger:function(){var A=this.myPassenger();A.addAddon(this)}},after:{initialize:function(){var B=this.meta.c.__paxIndex;if(!B){B=0}var C=s2.tuifly.model.PassengerManager.getInstance().getPassengersArray().length;B=B%C;this.__paxIndex=B;this.meta.c.__paxIndex=B+1;var D=this.$.attr("class")||"";var A;if(A=D.match(/paxId(\d+)/)){this.__paxIndex=parseInt(A[1],10)}this.bindToPassenger()}}})});s2.namespace("s2.tuifly.model",function(){Class("s2.tuifly.model.SSRLuggage",{isa:s2.tuifly.model.Addon,does:[s2.tuifly.model.BoundModel,s2.tuifly.model.PassengerBoundModel],methods:{getBookedCount:function(){return this.getBooked()?1:0},getBooked:function(){return this.$.cachedFind("input:checkbox").checkboxChecked()}},after:{initialize:function(){this.setPrice(this.context$.cachedFind("object.queryData > param[name=price]").val());this.setDesc(this.context$.cachedFind("object.queryData > param[name=desc]").val())}},classMethods:{select:function(A){return A.find("div.queryLuggageSelection")},selectContext:function(){return $.cachedFind("#ssrLuggageBox").cachedFind("div.ssrLuggageCheckSelector")}}})});s2.namespace("s2.tuifly.model",function(){Class("s2.tuifly.model.SSRBags",{isa:s2.tuifly.model.Addon,does:[s2.tuifly.model.BoundModel,s2.tuifly.model.PassengerBoundModel],methods:{getBookedCount:function(){return this.$.cachedFind("input").val()}},after:{initialize:function(){this.setPrice(this.context$.cachedFind("object.queryData > param[name=price]").val());this.setDesc(this.context$.cachedFind("object.queryData > param[name=desc]").val())}},classMethods:{select:function(A){return A.find("div.queryBagSelection")},selectContext:function(){return $.cachedFind("#bagInputBox").cachedFind("div.bagSelector")}}})});s2.namespace("s2.tuifly.model",function(){Class("s2.tuifly.model.SSRMenu",{isa:s2.tuifly.model.Addon,does:[s2.tuifly.model.BoundModel,s2.tuifly.model.PassengerBoundModel],after:{initialize:function(){this.setPrice(this.context$.cachedFind("object.queryData > param[name=price]").val());this.setDesc(this.clearHTML(this.context$.cachedFind("object.queryData > param[name=desc]").val()))}},methods:{getBookedCount:function(){return this.$.cachedFind("input").val()}},classMethods:{select:function(A){return A.find("div.queryMenuItemSelection")},selectContext:function(){return $.cachedFind("#mealOrderInputBox div.menuItem")}}})});s2.namespace("s2.tuifly.model",function(){Class("s2.tuifly.model.SSRSeat",{isa:s2.tuifly.model.Addon,does:[s2.tuifly.model.BoundModel,s2.tuifly.model.PassengerBoundModel],has:{seat:{is:"rw"}},after:{initialize:function(){this.setDesc(this.context$.cachedFind("object.queryData > param[name=desc]").val())}},before:{getPrice:function(){this.setPrice(this.$.find("span.seatPrice").text()||"9 €")}},bind:{seat:{selector:"input.seatInput"}},methods:{extraInfo:function(){return this.getSeat()},getBookedCount:function(){return this.getSeat()?1:0},bookedDesc:function(){return this.getSeat()}},classMethods:{select:function(A){return A.find("span.querySeat")},selectContext:function(){return $.cachedFind("#seatMapCOGInputBox div.SeatMapCOGInput")}}})});s2.namespace("s2.tuifly.model",function(){Class("s2.tuifly.model.SSRSimple",{isa:s2.tuifly.model.Addon,does:[s2.tuifly.model.BoundModel],has:{pricePerPerson:{is:"rw",init:false}},after:{initialize:function(){this.setDesc(this.context$.cachedFind("object.queryData > param[name=desc]").val());this.updatePrice();this.checkboxOrRadio().change(function(){s2.tuifly.model.Booking.SSRChangeEvent.trigger()})}},override:{getPrice:function(){var A=this.SUPER();if(this.getPricePerPerson()){return A.mul(s2.tuifly.model.PassengerManager.getInstance().getCount())}else{return A}}},methods:{updatePrice:function(){this.setPrice(this.context$.cachedFind("object.queryData > param[name=price]").val())},isChecked:function(){return this.checkboxOrRadio().checkboxChecked()},checkboxOrRadio:function(){return this.$.cachedFind("span.querySimpleSSRDecision > input")},getBookedCount:function(){return this.isChecked()?1:0},isAttachedToJourney:function(){return false}},classMethods:{select:function(A){return A},selectContext:function(A){return A}}})});s2.namespace("s2.tuifly.model",function(){Class("s2.tuifly.model.SSRCO2",{isa:s2.tuifly.model.SSRSimple,after:{initialize:function(){this.priceInput().change(function(){that=this;var A=that.value;if(!A.match(/^[0-9]+[\,\.][0-9]{1,2}$/)&&!A.match(/^[0-9]+$/)){that.value=0}s2.tuifly.model.Booking.SSRChangeEvent.trigger()})}},before:{getPrice:function(){this.updatePrice()}},methods:{priceInput:function(){return $("#myClimateBox div.co2Amount > input[name*=MyClimateAmount]")},getCurrencySymbol:function(){return $("#co2CurrencySymbol").text()},updatePrice:function(){this.setPrice(this.priceInput().val()+this.getCurrencySymbol())},getBookedCount:function(){return this.isChecked()?1:0}},classMethods:{selectContext:function(){return $("#myClimateBox")},select:function(){return $("#myClimateBox")}}})});s2.namespace("s2.tuifly.model",function(){Class("s2.tuifly.model.SSRZugZumFlug",{isa:s2.tuifly.model.Addon,does:[s2.tuifly.model.BoundModel,s2.tuifly.model.PassengerBoundModel],has:{priceClass1journey0:{isa:TYPE.S2Currency,coerce:true,is:"rw"},priceClass2journey0:{isa:TYPE.S2Currency,coerce:true,is:"rw"},priceClass1journey1:{isa:TYPE.S2Currency,coerce:true,is:"rw"},priceClass2journey1:{isa:TYPE.S2Currency,coerce:true,is:"rw"},desc1:{is:"rw"},desc2:{is:"rw"}},after:{initialize:function(){this.setDesc1(this.context$.cachedFind("object.queryData > param[name=desc1]").val());this.setDesc2(this.context$.cachedFind("object.queryData > param[name=desc2]").val());this.setPriceClass1journey0(this.context$.cachedFind("object.queryData > param[name=priceClass1journey0]").val());this.setPriceClass2journey0(this.context$.cachedFind("object.queryData > param[name=priceClass2journey0]").val());if(this.context$.cachedFind("object.queryData > param[name=priceClass1journey1]").length>0&&this.context$.cachedFind("object.queryData > param[name=priceClass1journey1]").val()){this.setPriceClass1journey1(this.context$.cachedFind("object.queryData > param[name=priceClass1journey1]").val())}if(this.context$.cachedFind("object.queryData > param[name=priceClass2journey1]").length>0&&this.context$.cachedFind("object.queryData > param[name=priceClass2journey1]").val()){this.setPriceClass2journey1(this.context$.cachedFind("object.queryData > param[name=priceClass2journey1]").val())}this.$.cachedFind("input:checkbox").change(function(){s2.tuifly.model.Booking.SSRChangeEvent.trigger()});this.context$.cachedFind("input:radio").click(function(){s2.tuifly.model.SSRZugZumFlug.updatePrices();s2.tuifly.model.Booking.SSRChangeEvent.trigger()})}},methods:{getDesc:function(){if(s2.tuifly.model.SSRZugZumFlug.selectedClass()=="2"){return this.getDesc2()}else{return this.getDesc1()}},getBookedCount:function(){return this.$.cachedFind("input:checkbox").checkboxChecked()?1:0},getPrice:function(){if(s2.tuifly.model.SSRZugZumFlug.selectedClass()=="2"){return this.journey==1?this.getPriceClass2journey1():this.getPriceClass2journey0()}else{return this.journey==1?this.getPriceClass1journey1():this.getPriceClass1journey0()}}},classMethods:{select:function(A){return A.find("div.zzfSelect.journey0,div.zzfSelect.journey1")},selectContext:function(){return $.cachedFind("#zugZumFlugBox")},selectedClass:function(){var A="2";this.selectContext().cachedFind(":radio").each(function(){if(this.value.indexOf("ZZF1")!=-1&&this.checked){A="1"}});return A},updatePrices:function(){var A=this.selectContext();var D=this.selectedClass();var C=A.cachedFind("object.queryData > param[name=priceClass"+D+"journey0]").val();var B=A.cachedFind("object.queryData > param[name=priceClass"+D+"journey1]").val();A.cachedFind("#zzfPriceJourney0").text(B);A.cachedFind("#zzfPriceJourney1").text(C)}}})});s2.namespace("s2.tuifly.model",function(){Class("s2.tuifly.model.SSRTUICars",{isa:s2.tuifly.model.Addon,has:{bookedCar:{is:"rw"},baseDesc:{is:"rw"}},after:{initialize:function(){var A=this;this.setBaseDesc(this.context$.find("object.queryData > param[name=desc]").val());s2.tuifly.model.Booking.TUICarChangeEvent.observe(function(){A.findBookedCar()})}},methods:{getBookedCount:function(){return this.getBookedCar()?1:0},isAttachedToJourney:function(){return false},findBookedCar:function(){var A=this;var B=false;A.$.find("div.sliderItem").each(function(){var C=$(this);if(C.find("input:checkbox:checked").length>0){B=true;A.setPrice(A.getRate(C));A.setDesc(C.find("div.carType h4").text())}});A.setBookedCar(B)},getRate:function(B){var A=B.find("span.newRate").text();A=A.replace("EUR","€");return A}},classMethods:{select:function(A){return A.find("#TUICarsAjax")},selectContext:function(){return $("#tuiCarsBox")}}})});s2.namespace("s2.tuifly.model",function(){Class("s2.tuifly.model.SSRTUIHotels",{isa:s2.tuifly.model.Addon,has:{bookedHotel:{is:"rw"},baseDesc:{is:"rw"}},after:{initialize:function(){var A=this;this.setBaseDesc("Hotel");s2.tuifly.model.Booking.TUIHotelChangeEvent.observe(function(){A.findBookedHotel()})}},methods:{getBookedCount:function(){return this.getBookedHotel()?1:0},isAttachedToJourney:function(){return false},findBookedHotel:function(){var A=this;var B=false;A.$.find("div.sliderItem").each(function(){var C=$(this);if(C.find("input:checkbox:checked").length>0){B=true;A.setPrice(A.getRate(C));A.setDesc(C.find("div.carType h4").text())}});A.setBookedHotel(B)},getRate:function(B){var A=B.find("span.newRate").text();return A}},classMethods:{select:function(A){return A.find("#TUIHotelsAjax")},selectContext:function(){return $("#tuiHotelsBox")}}})});s2.namespace("s2.tuifly.model.flightSearch",function(){var D=this;var A=false;Class("s2.tuifly.model.flightSearch.StationManager",{does:JooseX.Singleton,has:{stationByIataCode:{init:function(){return{}}},destToOrig:{init:function(){return{}}},iataToCountryCode:{},regionToIataCodes:{},countryCodeToCountry:{init:function(){return{}}}},methods:{findStation:function(F){var E=this;F=F.toUpperCase();var G;if(G=E.getStation(F)){return G}Joose.O.each(E.stationByIataCode,function(H){if(H.toString().toUpperCase()==F){G=H}});return G},addStation:function(E){this.stationByIataCode[E.getIataCode()]=E},getStation:function(E){return this.stationByIataCode[E]},getStations:function(F){var G=this;var E=[];Joose.A.each(F,function(H){var I=G.getStation(H);if(I){E.push(I)}else{s2.Logger.debug("Missing station "+H)}});return E},manualSortedIataCodes:function(){var E=[];Joose.O.each(this.stationByIataCode,function(G,F){E.push(F)});return E},addDestToOrigMapping:function(E,G){var F=this.destToOrig;if(F[E]==null){F[E]={}}F[E][G]=true},initDestToOrigMapping:function(){if(A){return}A=true;Joose.A.each(this.allStations(),function(E){Joose.A.each(E.getDests(),function(F){C.addDestToOrigMapping(F,E.iataCode)})})},getOrigs:function(F){this.initDestToOrigMapping();var H=this.destToOrig[F]||{};var E=[];for(var G in H){E.push(G)}return this.getStations(E)},validOrigs:function(){var F=this.getSortedStations();var E=[];jQuery.each(F,function(H){var G=F[H];if(jQuery.inArray(G,notAllowedAfricanDeparture)==-1){E.push(G)}});return this.getStations(E)},allStations:function(){return this.getStations(this.getSortedStations())},getSortedStations:function(){if(typeof(SortedStations)=="undefined"){var H=this.stationByIataCode;var G={};var E=[];Joose.O.each(H,function(I,J){E.push(I)});var F=C.sortStations(E);return F}else{return SortedStations}},validDests:function(){var F=this;var E=[];Joose.A.each(F.allStations(),function(G){if(G.isValidDest()){E.push(G)}});return E},sortStations:function(E,G,I){var H=this;var L=function(N,M){if(!G){if(N.isInGermany()&&!M.isInGermany()){return -1}if(!N.isInGermany()&&M.isInGermany()){return 1}}if(N.getLongName()>M.getLongName()){return 1}else{return -1}};if(typeof(SortedStations)=="undefined"){E.sort(L);return E}var K={};Joose.A.each(E,function(M){K[M.getIataCode()]=true});var F=[];Joose.A.each(H.allStations(),function(M){if(K[M.getIataCode()]!=null){F.push(M)}});if((location.pathname.match(/BookGroup\.aspx/i)||location.pathname.match(/BookCharter\.aspx/i))&&(G&&I)){var J=[];jQuery.each(F,function(){var M=this;if(!s2.tuifly.util.routes.isInAirberlinFormerTuifly(M.getIataCode())){J.push(M)}});F=J}if(G){return F.sort(L)}return F},getAirportsInRegion:function(G){var E=[];var F=this.regionToIataCodes;Joose.O.each(F,function(H,I){if(I.indexOf(G)>-1){E=E.concat(H)}});return E}}});var C=s2.tuifly.model.flightSearch.StationManager.getInstance();var B=false;Class("s2.tuifly.model.flightSearch.Country",{has:{iataCode:{is:"rw"},longName:{is:"rw"}},methods:{initialize:function(E){if(E){for(var F in E){this[F]=E[F]}}}}});Class("s2.tuifly.model.flightSearch.Station",{has:{iataCode:{is:"rw"},longName:{is:"rw"},validOrig:{is:"rw"},validDest:{is:"rw"},country:{is:"rw"},dests:{is:"rw"},text:{}},methods:{initialize:function(E){if(E){for(var F in E){this[F]=E[F]}}},origStations:function(){return C.getOrigs(this.iataCode)},destStations:function(){return C.getStations(this.getDests())},isInGermany:function(){return this.getCountry()==="DE"},isValidDest:function(){return this.validOrig},isValidOrig:function(){return this.validDest},stringify:function(){var E=this.longName;if(!E){E=""}if(this.iataCode.match("-")){return E}return this.longName+" ("+this.iataCode+")"},asNavitairStation:function(){return{code:this.iataCode,name:this.longName,validOrig:this.validOrig,validDest:this.validDest,mkts:this.dests}}},classMethods:{newFromNavitairStation:function(H,K){var G=s2.tuifly.model.flightSearch.StationManager.getInstance();var E=H.name;var J=[];var L=H.mkts;if(!location.pathname.match(/BookGroup\.aspx/i)&&!location.pathname.match(/BookCharter\.aspx/i)){J=[].concat(L||[])}else{for(var F in L){if(this.routes.isX3(H.code,L[F])){J.push(L[F])}}}var I=new s2.tuifly.model.flightSearch.Station({iataCode:H.code,longName:E,validOrig:H.validOrig,validDest:H.validDest,dests:J,country:K});G.addStation(I)},newFromParams:function(G){var E=s2.tuifly.model.flightSearch.StationManager.getInstance();var F=new this({iataCode:G.iataCode,longName:G.name});E.addStation(F)},initialize:function(){var E=this;s2.tuifly.util.routes.get(function(N){E.routes=N;E.text=new s2.tuifly.util.Text(window.LocalText);var J=window.NavitairGlobal_airportCountryMap;var L=Stations;var G=SortedStations;for(var M=0;M<G.length;++M){var F=G[M];var H=L[F];if(typeof H=="object"&&H.name!==true){var I=J[H.code];if(I){s2.tuifly.model.flightSearch.Station.newFromNavitairStation(H,I)}else{s2.Logger.debug("missing country "+H.code)}}}var K={iataCode:"C-B",name:E.text.get("moreStations")};s2.tuifly.model.flightSearch.Station.newFromParams(K);C.iataToCountryCode=J;B=true;D.InitializedEvent.trigger()})},initializeFromAjax:function(F){F="/pregenerated/"+JooseX.Culture.Factory.get().majorIdentifier()+"/farefinder/"+s2.tuifly.util.Skin.get().identifier()+"/orig-dest-pairs.json";var E=this;if(B){window.setTimeout(function(){D.InitializedEvent.trigger()});return}if(typeof Stations!="undefined"){return this.initialize()}jQuery.getJSON(F,function(H){var G=s2.tuifly.model.flightSearch.StationManager.getInstance();Joose.O.each(H.iataCodes,function(J,I){var L=H.dests[I]||[];var K=E.meta.instantiate({iataCode:I,longName:J,validDest:L.length>0?true:false,dests:L,country:H.countries[I]});Joose.A.each(K.getDests(),function(M){G.addDestToOrigMapping(M,I)});G.iataToCountryCode=H.countries;G.addStation(K);G.regionToIataCodes=H.regions});Joose.O.each(H.countryName,function(J,I){G.countryCodeToCountry[I]=new s2.tuifly.model.flightSearch.Country({longName:J,iataCode:I})});B=true;D.InitializedEvent.trigger()})}}});this.DestChangeEvent=new s2.tuifly.Event("DestinationChangeEvent");this.OrigChangeEvent=new s2.tuifly.Event("OriginChangeEvent");this.InitializedEvent=new s2.tuifly.Event("Stations")});s2.namespace("s2.tuifly.controller",function(){var A=this;window.S2Controllers={};Class("s2.tuifly.controller.PageControllerMetaClass",{isa:s2.tuifly.LazyMetaClass,override:{initializeFromProps:function(D){var C=D.invokeDestinationSelector||"body";var B=D.invokeClassName;delete D.invokeDestinationSelector;delete D.invokeClassName;this.addClassMethod("register",function(){var E=this;$(document).ready(function(){if(B){if(!$(C).hasClass(B)){return}}E.finishBuild();var F=E.getInstance();F.ready();var G=F.meta.className();window.S2Controllers[G]=F;s2.tuifly.initialize.diff(G)})});this.SUPER(D)}}});Class("s2.tuifly.controller.PageController",{meta:A.PageControllerMetaClass,does:[JooseX.Singleton],isAbstract:true,invokeClassName:null})});s2.namespace("s2.tuifly.controller",function(){var B;var A=false;Class("s2.tuifly.controller.FlightCart",{isa:s2.tuifly.controller.PageController,invokeClassName:"controllerFlightCart",has:{passengers:{is:"rw"},meals:{is:"rw"},luggage:{is:"rw"},bags:{is:"rw"},seats:{is:"rw"},zugZumFlug:{is:"rw"},partner:{is:"rw"},seats:{is:"rw"},extras:{is:"rw"}},methods:{ready:function(){var C=this;$(window).load(function(){C.init()})},init:function(){var C=this;if($("#flightCart").length==0){return}this.setPassengers(s2.tuifly.model.Passenger.create());this.setMeals(s2.tuifly.model.SSRMenu.create());this.setLuggage(s2.tuifly.model.SSRLuggage.create());this.setBags(s2.tuifly.model.SSRBags.create());this.setSeats(s2.tuifly.model.SSRSeat.create());this.setZugZumFlug(s2.tuifly.model.SSRZugZumFlug.create());this.setPartner(s2.tuifly.model.SSRSimple.create($("#elviaBox div.querySimpleSSR"),{pricePerPerson:true}).concat(s2.tuifly.model.SSRSimple.create($("#ingDibaBox div.querySimpleSSR"))).concat(s2.tuifly.model.SSRTUICars.create()).concat(s2.tuifly.model.SSRTUIHotels.create()));this.setExtras(s2.tuifly.model.SSRCO2.create());$("#ControlGroupExtras_ElviaInputExtrasView_RadioButtonNoInsurance").change(function(){s2.tuifly.model.Booking.SSRChangeEvent.trigger()});var E=400;s2.tuifly.model.Booking.SSRChangeEvent.observeLazy(function(){s2.Logger.debug("SSRChangeEvent");C.draw()},E);C.bookingChange();var D=function(){if(A&&B){C.draw()}};$(document).keydown(D);$(document).bind("scroll",D);if(document.getElementById("changeUpdateLater")){$("#changeUpdateLater").show()}},draw:function(){var C=this;A=true;if(B){clearTimeout(B);B=null}B=setTimeout(function(){C.bookingChange();A=false},400)},bookingChange:function(){this.drawSSRs();this.drawSum()},filterByJourney:function(E,D){var C=[];Joose.A.each(E,function(F){var G=F.getJourney();if(G==null||G==D){C.push(F)}});return C},drawSSRs:function(){this.drawJourneyRelatedSSR("cartlabelMeals",this.getMeals());this.drawJourneyRelatedSSR("cartlabelBaggages",this.getLuggage());this.drawJourneyRelatedSSR("cartlabelBags",this.getBags());this.drawJourneyRelatedSSR("cartlabelZzfs",this.getZugZumFlug());this.drawJourneyRelatedSSR("cartlabelSeats",this.getSeats());this.drawJourneyRelatedSSR("cartlabelExtras",this.getExtras());this.drawPartnerSSR("cartlabelPartners",this.getPartner())},fetchSum:function(C){var D=s2.tuifly.util.CurrencyValue.zero();$(C).each(function(){var F=$(this).text();if(F!=""){var E=TYPE.S2Currency.coerce(F);if(E){D=D.add(E)}else{s2.Logger.debug("Invalid currency value "+F)}}});return D},drawSum:function(C){var C=this.fetchSum("#flightCart td.interSum");var D=this.fetchSum("#cartlabelPartners td.interSum");var F=C.substract(D);$("#cartFlightSum").text(F.toString());var E=$("#cartPartnerSum");E.text(D.toString());if(D.greaterZero()){E.parent().show()}else{E.parent().hide()}$("#cartTotalSum").text(C.toString())},drawPartnerSSR:function(E,H){var D=this;if(H.length==0){return}var G=$.cachedFind("#"+E+" > div.cartItemTables");var C=new s2.tuifly.view.FlightCartPartnerTables({target:G});var F=C.draw(H);D.showHideGroup(E,F)},drawJourneyRelatedSSR:function(F,H){var D=this;if(H.length==0){return}var E=0;var G=0;var C="#"+F+" > div > table > tbody";$.cachedFind(C).each(function(){var K=$(this);var I=new s2.tuifly.view.FlightCartTable({tbody:K,table:K.parent()});var J=D.filterByJourney(H,E);G=G+I.draw(J);E++});D.showHideGroup(F,G)},showHideGroup:function(C,D){if(D>0){$("#"+C).show()}else{$("#"+C).hide()}}}})});s2.namespace("s2.tuifly.controller",function(){var B;var A=false;Class("s2.tuifly.controller.FlightCartSumCalculator",{isa:s2.tuifly.controller.FlightCart,invokeClassName:"controllerFlightCartSumCalc",methods:{ready:function(){}},before:{drawSum:function(){var C=s2.tuifly.util.CurrencyValue.zero();$("#cartlabelPayments > div > table td.cartSumComponent").each(function(){var E=$(this).text();var D=TYPE.S2Currency.coerce(E);if(D!=null){C=C.add(D)}});$("#cartPaymentSum").text(C.toString())}}})});s2.namespace("s2.tuifly.controller",function(){var B=s2.tuifly.model.flightSearch.StationManager.getInstance();this.AirportInfoShowEvent=new s2.tuifly.Event("AirportInfoShowEvent");this.AirportInfoHideEvent=new s2.tuifly.Event("AirportInfoHideEvent");this.AutoCompleteShowEvent=new s2.tuifly.Event("AutoCompleteShowEvent");var C=false;var A=false;Class("s2.tuifly.controller.FlightSearch",{isa:s2.tuifly.controller.PageController,invokeClassName:"controllerFlightSearch",has:{origInput:{is:"rw"},destInput:{is:"rw"},currentSelectTarget:{is:"rw"},destCode:{is:"rw"},origCode:{is:"rw"},text:{}},methods:{repairSession:function(){if($("#flugsuche select[id*=DropDownListPassengerType_INFANT]").length==0){s2.Logger.debug("Session broke. Repairing session. (Or was the select renamed?)");var D=function(){};if(!location.pathname.match(/\.aspx/)){D=function(){var E=new JooseX.Culture.Factory.get();location.href="/Search.aspx?culture="+E.identifier()}}jQuery.get("/DeleteCookies.aspx",D)}},navitairReady:function(){if(document.getElementById("flugsuche")){var E=this;E.repairSession();this.text=new s2.tuifly.util.Text(window.LocalText);s2.tuifly.model.flightSearch.InitializedEvent.observeOnce(function(){E.setOptions(E.getOrigInput(),E.sortStations(B.validOrigs()),"orig");E.setOptions(E.getDestInput(),E.sortDests(B.validDests(),true),"dest")});E.setOrigInput(s2.tuifly.widget.cityAutocomplete.origInput);E.setDestInput(s2.tuifly.widget.cityAutocomplete.destInput);s2.tuifly.model.flightSearch.DestChangeEvent.observe(function(G,H){E.setDestCode(G);E.destChanged(G,H)});s2.tuifly.model.flightSearch.OrigChangeEvent.observe(function(G,H){E.setOrigCode(G);E.origChanged(G,H)});s2.tuifly.model.flightSearch.Station.initialize();var D=JooseX.Culture.Factory.get();if((D.identifier()=="de-DE")||(D.identifier()=="en-GB")){$("body > div.ac_results").find("li.ac_element").live("mouseover",function F(H){H.preventDefault();var G=$(H.target);C=false;s2.tuifly.controller.AirportInfoShowEvent.trigger(G)})}s2.tuifly.controller.AirportInfoHideEvent.observeLazy(function(){$("#destinationInfo").hide();$(".dontClickLayer").hide();C=true});s2.tuifly.controller.AutoCompleteShowEvent.observe(function(){C=false});s2.tuifly.initialize.diff("FlightSearchNavitairReady");if(typeof RouteMaxDate!="undefined"){s2.tuifly.widget.datepickerForSelect.datePickers.each(function(){var G=$(this);G.data("datepicker").settings.maxDate=RouteMaxDate})}s2.tuifly.controller.AirportInfoShowEvent.observeLazy(function(M){var J=false;var O=M.parent();if(M.find("span.dest").length>0){J=true}if(!J&&(!O.is("ul")&&O.find("span.dest").length>0)){M=O;J=true}s2.Logger.debug("event");var P=M.text();var H,K;var L=P.match(/\((\w+)\)$/);if(L){H=L[1];s2.Logger.debug("over "+H);K=$("<span>"+M.html()+"</span>").find(".zugZumFlug").length>0?E.text.get("zzfText"):""}else{return}var I=JooseX.Culture.Factory.get();var G="/"+I.majorIdentifier()+"/_includes/"+H.toLowerCase()+".html";var N=function(V,U){if(C){return}if(JooseX.Culture.Factory.get().identifier()=="it-IT"){return}s2.Logger.debug("Status "+U);if(U=="error"){return;V='<h3 class="infoIconRed">Hinweis</h3><div class="formRow""><strong>'+H+" fehlt</strong>"}var X=$("<div class='dontClickLayer'/></div>");destinationInfo=$("#destinationInfo");if(destinationInfo.length==0){X.appendTo($(document.body));destinationInfo=$("<div style='z-index: 9999; display:none' id=destinationInfo />").appendTo($(document.body))}if(K){var a,b;if(J){a=E.getOrigInput().val();b=P}else{a=P;b=E.getDestInput().val()}V=E.text.get("zzfDirection",{orig:a,dest:b});E.setCurrentSelectTarget(M)}else{if(J){var Y=E.getOrigCode();var W=H;if(Y&&W){var a=B.getStation(Y);var b=B.getStation(W);if(a&&b&&!a.isInGermany()&&b.isInGermany()){V+="<br/><br/><p>"+E.text.get("zzfToGermany")+"</p>"}}}}destinationInfo.html(V+K);var R=$("#marketCityPair_1 input:visible");var S=R.offset().left;var Q=R.outerWidth();var S=S+Q;s2.Logger.debug("Left: "+S);var T=M.closest("ul").offset();var Z=Math.round(T.top)-1;if(Z>0){destinationInfo.css("top",Z+"px");destinationInfo.css("left",S+"px");s2.Logger.debug("Pos "+Z+"-"+S);$(".dontClickLayer").show();destinationInfo.show()}};$.ajax({url:G,dataType:"html",error:N,success:N})})}},ready:function(){},clear:function(){this.getDestInput().val("");this.getOrigInput().val("")},closeAutocomplete:function(){this.getDestInput().trigger("s2:closeIfOpen");this.getOrigInput().trigger("s2:closeIfOpen")},showDirectConnections:function(E){var D=this;var F=D.getCurrentSelectTarget();if(F){F.click();D.setCurrentSelectTarget(null)}},setOrigsForDest:function(E){var D=this;var F=this.getOrigInput();this.setOptions(F,E.origStations(),"orig");s2.tuifly.model.flightSearch.OrigChangeEvent.observeOnce(function(G){D.setOptions(F,B.validOrigs(),"orig")})},destChanged:function(D,I){var E=this;s2.Logger.debug("destChanged");var G=this.getOrigInput();var F=B.getStation(D);A=false;if(G.val()===""){E.setOrigsForDest(F)}else{if(I){A=true;E.setOrigsForDest(F);G.val("");this.clickInput(G)}}try{s2.tuifly.flash.airportMap.fireDestChanged(D)}catch(H){s2.Logger.debug("Flash Error: "+H)}},origChanged:function(E){s2.Logger.debug("origChanged");var H=this;var K=B.getStation(E);if(typeof(K)=="undefined"){return}var I=this.sortDests(K.destStations(),s2.tuifly.util.routes.isInAirberlinFormerTuifly(K.getIataCode()));var G=this.getDestInput();var F=false;if(!Joose.A.exists(I,G.val())){F=true;G.val("")}jQuery.each(I,function(){var M=this;var L=M.iataCode;if(L=="CGN"){I.push("<span value='C-B'>"+H.text.get("moreStations")+"</span>")}});if(K.isInGermany()&&document.URL.indexOf("BookGroup")==-1){I=[].concat(I);I.push("--------------------------------");var D=B.validDests();Joose.A.each(D,function(L){if(!L.isInGermany()&&!Joose.A.exists(I,L)){I.push('<span class="zugZumFlug">'+L.toString()+"</span>")}})}if(F){if(window.triggerClickCompactSearchAllowed){this.clickInput(G)}}this.setOptions(G,I,"dest");s2.tuifly.flash.airportMap.fireOriginChanged(E);var J=$("input[name=scorigin]");if(J.length>0&&J.val().substr(0,7)=="CS-Home"){if(A){s2.Logger.debug("Setting ZZF Alt-Start Tracking");J.val("CS-Home-Alt-Start")}else{J.val("CS-Home")}}A=false},clickInput:function(D){window.setTimeout(function(){if(!$("#flugsuche").hasClass("closed")){if(D.get(0).showInput){D.get(0).showInput()}try{D.focus()}catch(E){}D.click()}},50)},setOptions:function(E,F,H){var D=true;var G=0;var J=0;var I=jQuery.map(F,function(M){var K=H;if(M.meta&&D&&!M.isInGermany()&&M.getCountry()!=null){D=false;J=G}var L=""+M;if(L.match(/class=\"/)){L=L.replace(/class=\"/,'class="'+K+" ")}else{L='<span class="'+K+'">'+L+"</span>"}++G;return L});if(J>0){I.splice(J,0,"<span>--------------------------------</span>")}E.flushCache();E.setOptions({data:I})},sortDests:function(D,E){return s2.tuifly.model.flightSearch.StationManager.getInstance().sortStations(D,true,E)},sortStations:function(D){return s2.tuifly.model.flightSearch.StationManager.getInstance().sortStations(D,false)}}})});s2.namespace("s2.tuifly.controller",function(){var B=s2.tuifly.model.flightSearch.StationManager.getInstance();var A=function(C){C.isSet=function(){var D=$(this).val();if(D==null||D==""||D=="-1"){return false}return true};C.isSetToAirport=function(){if(!this.isSet()){return false}return this.val().length==3};return C};Class("s2.tuifly.controller.FarefinderSearch",{isa:s2.tuifly.controller.PageController,invokeClassName:"controllerFarefinderSearch",invokeDestinationSelector:"#fareFinderSearch",has:{origInput:{is:"rw"},destInput:{is:"rw"},form:{is:"rw"},allStations:{is:"rw"},text:{}},methods:{ready:function(){var C=this;s2.tuifly.model.flightSearch.InitializedEvent.observeOnce(function(){var E=C.getOrigInput();var D=C.getDestInput();var G=B.getStations(B.manualSortedIataCodes());C.setAllStations(G);E.change(function(){C.origChanged($(this).val())});var F=E.find("option[value='disabled']");F.attr("disabled",true);F.attr("class","disabled");D.change(function(){C.destChanged($(this).val())});if(E.isSet()){E.change()}else{C.setOptions(D,C.prepareOptions(C.getUniqueDests(G)),"dest")}C.afterInit()});s2.tuifly.model.flightSearch.Station.initializeFromAjax();this.setOrigInput(A($("#AirportListOrigin")));this.setDestInput(A($("#AirportListDestination")));this.setForm($("#fareFinderSearch"));this.text=new s2.tuifly.util.Text($("#farefinderText"))},afterInit:function(){},submit:function(C,F){var D=this.getForm();var E;if(!C){C=D.attr("action");var G=C.indexOf("?");if(G!="-1"){C=C.slice(0,G)}}if(C!="/farefinder/bestoffers"){if(!this.check(F)){return false}}if(C){D.attr("action",C)}D.submit()},check:function(C){if(C){if(!this.getOrigInput().isSetToAirport()&&!this.getDestInput().isSetToAirport()){s2.tuifly.widget.dialog.alert(this.text.get("errorOriginDestination"),{view:"note"});s2.tuifly.events.AjaxEndEvent.trigger();return false}if(!this.getOrigInput().isSetToAirport()){s2.tuifly.widget.dialog.alert(this.text.get("errorOrigin"),{view:"note"});s2.tuifly.events.AjaxEndEvent.trigger();return false}if(!this.getDestInput().isSetToAirport()){s2.tuifly.widget.dialog.alert(this.text.get("errorDestination"),{view:"note"});s2.tuifly.events.AjaxEndEvent.trigger();return false}}else{if(!this.getOrigInput().isSetToAirport()&&!this.getDestInput().isSetToAirport()||!this.getOrigInput().isSetToAirport()||!this.getDestInput().isSetToAirport()){return false}}return true},destChanged:function(C){},origChanged:function(C){var K;var D,I;if(C.length==3){D=C}else{if(C.length==1){I=C}}var H=this.getOrigInput();var E=0;if(H.hasClass("queryNoCountry")){E=1}if(D){var J=B.getStation(D);K=this.prepareOptions(J.destStations(),E)}else{if(I){var F=B.getAirportsInRegion(I);K=this.prepareOptions(this.getUniqueDests(B.getStationsSorted(F),E))}else{K=this.prepareOptions(this.getUniqueDests(this.getAllStations()),E)}}var G=this.getDestInput();this.setOptions(G,K,"dest")},getUniqueDests:function(E){var D={};var C=[];Joose.A.each(E,function(F){Joose.A.each(F.destStations(),function(G){D[G.iataCode]=true})});Joose.O.each(D,function(G,F){C.push(F)});return B.getStations(C)},prepareOptions:function(H,G){H=B.sortStations(H,true);var D=[];var F={};var C=[];if(!G){Joose.A.each(H,function(I){F[I.country]=true});Joose.O.each(F,function(J,I){C.push(I)});D=['<option value="" disabled class="disabled">'+this.text.get("country")+"</option>"];var E=[];Joose.A.each(C,function(I){E.push(B.countryCodeToCountry[I])});E=E.sort(function(J,I){return J.getLongName()>I.getLongName()});D=D.concat(E);D.push('<option value="" disabled class="disabled">'+this.text.get("airport")+"</option>")}D=D.concat(H);return D},setOptions:function(C,D,H){var F='<option value="-1">'+this.text.get(H=="dest"?"destination":"origin")+"</option>";Joose.A.each(D,function(K){if(typeof K=="string"){F+=K}else{var L=K.getIataCode();var I=K.getLongName();var J="";if(L.match(/^[A-Z]{3}$/)){J=(K.isInGermany())?"queryGermany":"queryNotGermany"}F+='<option value="'+L+'" class="'+J+'">'+I+"</option>"}});var G=C.html();if(G!=F){var E=C.isSet()?C.val():null;C.html(F);if(E){C.val(E)}}}}})});s2.namespace("s2.tuifly.controller",function(){var A=s2.tuifly.model.flightSearch.StationManager.getInstance();Class("s2.tuifly.controller.PartnerBannerController",{isa:s2.tuifly.controller.FarefinderSearch,invokeClassName:"controllerPartnerBanner",invokeDestinationSelector:"#partnerBanner",methods:{afterInit:function(){var C=this;var D=C.getOrigInput();$(D).addClass("queryNoCountry");var B=C.getDestInput();var E=$("#MonthToQuery");var F=C.getAllStations();C.setOptions(D,C.prepareOptions(F,"noCountry"),"orig");C.setOptions(B,C.prepareOptions(F,"noCountry"),"dest");C.evaluateQuery()},evaluateQuery:function(){var B=this;partnerBannerOriginInput=B.getOrigInput();partnerBannerDestinationInput=B.getDestInput();var D=$("#MonthToQuery");var C=new s2.tuifly.util.Query();partnerBannerSelectedOrigin=C.param("origin");partnerBannerSelectedDestination=C.param("destination");partnerBannerSelectedMonth=C.param("month");if(partnerBannerSelectedOrigin){B.origChanged(partnerBannerSelectedOrigin);setTimeout("partnerBannerOriginInput.val(partnerBannerSelectedOrigin)",0)}if(partnerBannerSelectedDestination){B.destChanged(partnerBannerSelectedDestination);setTimeout("partnerBannerDestinationInput.val(partnerBannerSelectedDestination)",0)}if(partnerBannerSelectedMonth){D.val(partnerBannerSelectedMonth)}}},before:{ready:function(){var B=new s2.tuifly.util.Query();var C=B.param("size");$("body").addClass(C);$("#AD").val(B.param("size"));$("#ATT").val(B.param("campaign"))}},override:{destChanged:function(B){var F;if(B<0){F=this.getUniqueDests(this.getAllStations())}else{var D=A.getStation(B);F=D.origStations()}var C=this.prepareOptions(F,"noCountry");var E=this.getOrigInput();this.setOptions(E,C,"orig")}}})});var partnerBannerOriginInput;var partnerBannerDestinationInput;var partnerBannerSelectedOrigin;var partnerBannerSelectedDestination;var partnerBannerSelectedMonth;s2.namespace("s2.tuifly.view",function(){var A;Class("s2.tuifly.view.FlightCartTable",{has:{tbody:{},table:{}},methods:{draw:function(I){var J=this;var C=s2.tuifly.model.PassengerManager.getInstance();var D=[];var B={};Joose.A.each(I,function(K){var L=parseInt(K.getBookedCount(),10);if(L>0){var M;if(K.passengerId){M=K.passengerId()}else{M="notBound"}if(!Joose.A.exists(D,M)){D.push(M)}if(!B[M]){B[M]=[]}B[M].push(K)}});var E="";var F=0;var G=s2.tuifly.util.CurrencyValue.zero();var H=0;Joose.A.each(D,function(M){var L=M!="notBound"?C.getPassenger(M):null;if(!J.hasInlineName()&&!J.hasNoPaxName()){E+="<tr"+(H>0?" class=notFirst":"")+'><td colspan=2 class="name dynamicPassengerName'+L.getIndex()+'">'+L.getName()+"</td></tr>\n"}var K=B[M];Joose.A.each(K,function(O){var N="";if(J.hasCount()){N=O.getBookedCount()+" "}var Q=O.totalPrice();G=G.add(Q);var R=N+O.getDesc();var P="";if(J.hasInlineName()){R='<span class="name dynamicPassengerName'+L.getIndex()+'">'+L.getName()+"</span>"}if(J.hasExtraInfo()){P="<td>"+O.extraInfo()+"</td>"}E+="<tr><td>"+R+"</td>"+P+'<td class="cartData cartSumComponent">'+Q+"</td></tr>";F++});H++});this.drawHTML(E);this.drawSum(G);this.showHide(F);return F},drawPartner:function(){},drawSum:function(B){this.table.find("tfoot td.interSum").text(B.toString())},hasInlineName:function(){return this.table.hasClass("hasInlineName")},hasNoPaxName:function(){return this.table.hasClass("hasNoPaxName")},hasCount:function(){return this.table.hasClass("hasCount")},hasExtraInfo:function(){return this.table.hasClass("hasExtraInfo")},showHide:function(B){if(B>0){this.table.show()}else{this.table.hide()}},drawHTML:function(B){this.tbody.html(B)}}})});s2.namespace("s2.tuifly.view",function(){Class("s2.tuifly.view.FlightCartPartnerTables",{has:{target:{}},methods:{draw:function(D){var A=this;var B="";var C=0;Joose.A.each(D,function(F){if(F.getBookedCount()>0){var G=F.meta.can("getBaseDesc")?F.getBaseDesc():F.getDesc();var E=F.totalPrice().toString();B+='<table class="rowTwoPiece" cellspacing="0">\n<tr>\n<th colspan="2">'+G+"</th>\n</tr>\n<tr>\n<td>"+F.getDesc()+'</td>\n<td class="cartData cartSumComponent">'+E+'</td>\n</tr>\n<tr class="summary">\n<td colspan="1"></td>\n<td class="cartData interSum">'+E+"</td>\n</tr>\n</table>\n";C++}});A.target.html(B);return C}}})});s2.namespace("s2.tuifly.util",function(){this.Cookie=function(){this.doc=document};this.Cookie.prototype={get:function(C){var B=this.doc.cookie;B=B.replace("+","%20");var F=C+"=";var D=B.indexOf("; "+F);if(D==-1){D=B.indexOf(F);if(D!=0){return""}}else{D+=2}var A=B.indexOf(";",D);if(A==-1){A=B.length}var E=unescape(B.substring(D+F.length,A));if(E==";"){return""}return E},set:function(B,E,A,F){var C=B+"="+escape(E)+((A)?"; expires="+A.toGMTString():"")+"; path=/"+((F)?"; secure":"");this.doc.cookie=C;var D=this.get(B);if(D!=E){XSSdebug("Failed Setting cookie "+B+" "+E+"->"+D)}}}});s2.namespace("s2.tuifly.initialize",function(){var A=function(){return(new Date()).getTime()};var B=A();var C=function(D){s2.Logger.debug("Time "+D+" "+(A()-B));B=A()};this.diff=C;jQuery.browser.msie6=jQuery.browser.msie&&jQuery.browser.version.substr(0,1)=="6";$(document).ready(function(){s2.Logger.debug("Starting init");var H=A();B=A();var D=jQuery("meta[name=culture]").attr("content");if(D){JooseX.Culture.setCurrentCulture(D)}else{s2.Logger.debug("missing culture tag")}var G=jQuery("meta[name=defaultCurrency]").attr("content");if(D){s2.tuifly.util.CurrencyValue.setDefaultCurrencySymbol(G)}else{s2.Logger.debug("missing default currency symbol")}var E=new s2.tuifly.util.Cookie().get("hasBluemiles");if(E=="0"){jQuery(".contentNavigation li a:contains('topbonus')").parent().remove();jQuery(".subLevel li a:contains('topbonus')").parent().remove();if(D=="de-DE"){jQuery("#collectingBlueMiles_2082").remove();jQuery("#collectingBlueMiles_3533").remove()}else{if(D=="en-GB"){jQuery("#collectingBlueMiles_2079").remove();jQuery("#collectingBlueMiles_2078").remove();jQuery("#collectingBlueMiles_2081").remove()}else{if(D=="it-IT"){jQuery("#collectingBlueMiles_2079").remove();jQuery("#collectingBlueMiles_2078").remove()}else{if(D=="es-ES"){jQuery("#collectingBlueMiles_2079").remove();jQuery("#collectingBlueMiles_2078").remove()}}}}}s2.tuifly.controller.FarefinderSearch.register();C("FarefinderSearch");s2.tuifly.widget.IEUpdateBanner.initialize();C("IEUpdateBanner");s2.tuifly.widget.dialog.initialize();C("Dialog");s2.tuifly.google.search.initialize();C("GoogleSearch");s2.tuifly.widget.focusManager.initialize();C("focusManager");s2.tuifly.widget.navigation.initialize();C("navigation");s2.tuifly.widget.metaNavigation.initialize();C("metaNavigation");s2.tuifly.widget.datepickerForSelect.initialize();C("datepicker");s2.tuifly.widget.collapsiblePanel.initialize();C("panels");s2.tuifly.widget.collapsibleContainer.initialize();C("collapsibleContainer");s2.tuifly.widget.collapsibleNavigation.initialize();C("collapsibleNavigation");s2.tuifly.widget.overlay.initialize();C("overlay");s2.tuifly.widget.submittableForm.initialize();C("submitForm");s2.tuifly.widget.formRowHighlighter.initialize();C("formrowHighlight");s2.tuifly.widget.requiredFormFields.initialize();C("requiredFormFields");s2.tuifly.widget.loadingButton.initialize();C("loadingButton");s2.tuifly.widget.tooltip.initialize();C("tooltip");s2.tuifly.widget.hintMessage.initialize();C("hintMessage");s2.tuifly.widget.toggleCheckbox.initialize();C("toggleCheckbox");s2.tuifly.widget.customSelect.initialize();C("customSelect");s2.tuifly.widget.footer.initialize();C("footer");s2.tuifly.helper.mytuiflyLoginBox.initialize();C("mytuiflyLoginBox");s2.tuifly.helper.farefinder.initialize();C("farefinder");s2.tuifly.helper.zugZumFlug.initialize();C("zugZumFlug");s2.tuifly.helper.itinerary.initialize();C("helper:itinerary");s2.tuifly.helper.flashTicker.initialize();C("flashTicker");s2.tuifly.helper.iframe.initialize();C("iframe");s2.tuifly.helper.offerTicker.initialize();C("offerTicker");s2.tuifly.helper.farefinderVerlaufSelector.initialize();C("farefinderVerlaufSelector");s2.tuifly.widget.skysalesError.initialize();C("skysalesError");s2.tuifly.widget.pauschalreiseBanner.initialize();C("pauschalreiseBanner");s2.tuifly.widget.cityAutocomplete.initialize();C("cityAuto");s2.tuifly.widget.ssrCountSelector.initialize();C("ssrCountSelector");s2.tuifly.widget.ssrLuggageCheckSelector.initialize();C("ssrLuggageSelector");s2.tuifly.widget.ssrBagSelector.initialize();C("ssrBagSelector");s2.tuifly.widget.passengerInfo.initialize();C("passengerInfo");s2.tuifly.widget.sizedIFrame.initialize();C("iframes");s2.tuifly.flash.airportMap.initialize();C("flash");s2.tuifly.flash.win.initialize();C("win flash");s2.tuifly.widget.inlineLabeledInput.initialize();s2.tuifly.initialize.diff("InlineLabels");s2.tuifly.controller.FlightSearch.register();C("FlightSearch");s2.tuifly.controller.FlightCart.register();C("FlighCart");s2.tuifly.controller.FlightCartSumCalculator.register();C("FlighCartSumCalc");s2.tuifly.controller.PartnerBannerController.register();C("PartnerBanner");s2.tuifly.helper.contact.initialize();C("helper:contact");s2.tuifly.helper.search.initialize();C("helper:search");s2.tuifly.helper.giftCertificate.initialize();C("helper:giftCertificate");s2.tuifly.helper.farefinderPromoIcons.initialize();C("helper:farefinderPromoIcons");s2.tuifly.helper.farefinderCarrierIcons.initialize();C("helper:farefinderCarrierIcons");s2.tuifly.helper.hideASPErrorMessage.initialize();C("hideASPErrorMessage");s2.tuifly.helper.forceNewRendering.initialize();C("forceNewRendering");s2.tuifly.helper.notepad.initialize();C("notepad");s2.tuifly.helper.payment.initialize();C("helper:payment");s2.tuifly.helper.zugZumFlug.initialize();C("zugZumFlug");s2.tuifly.helper.bookExtras.initialize();C("bookExtras");s2.tuifly.helper.itinerary.initialize();C("helper:itinerary");s2.tuifly.helper.htmlErrorToAlert.initialize();C("helper:htmlErrorToAlert");s2.tuifly.helper.hotelSearch.initialize();C("helper:hotelSearch");s2.tuifly.helper.holidaySearch.initialize();C("helper:holidaySearch");s2.tuifly.helper.carSearch.initialize();C("helper:carSearch");s2.tuifly.helper.tracking.initialize();C("helper:tracking");s2.tuifly.helper.noFormReset.initialize();C("helper:noFormReset");s2.tuifly.helper.emailMissing.initialize();C("helper:emailMissing");s2.tuifly.helper.orgaAgreement.initialize();C("helper:orgaAgreement");s2.tuifly.helper.openChristmas.initialize();C("openChristmas");s2.tuifly.helper.abTesting.initialize();C("abTesting");s2.tuifly.helper.scrollToElement.initialize();C("scrollToElement");s2.tuifly.helper.contactEditToggle.initialize();C("contactEditToggle");s2.tuifly.helper.selectView.initialize();C("selectView");s2.tuifly.helper.mytuiflyBestOffers.initialize();C("mytuiflyBestOffers");s2.tuifly.validation.inputValidation.initialize();C("inputValidation");s2.tuifly.helper.facebook.initialize();C("facebook");s2.tuifly.helper.facebook.page.visit.initialize();C("facebookVisit");s2.tuifly.helper.facebook.page.flytogether.initialize();C("facebookFlyTogether");s2.tuifly.validation.inputValidation.initialize();C("inputValidation");window.loadingImageCache=new Image();window.loadingImageCache.src="/images/buttons/loading_red.gif";s2.tuifly.helper.keepAlive.loop();var F=A()-H;$(window).load(function(){s2.tuifly.initialize.diff("OnLoad")});s2.Logger.debug("Total init time: "+F)})});s2.namespace("s2.tuifly",function(){var D="loginStatus";var C="userName";var E="bluemiles";var B="customerNumber";var A="customerFriendchips";this.Login=function(){};this.Login.prototype={getBluemilesId:function(){return new s2.tuifly.util.Cookie().get(E)},getCustomerNumber:function(){return new s2.tuifly.util.Cookie().get(B)},getLoginCookie:function(){return new s2.tuifly.util.Cookie().get(D)},getNameCookie:function(){return new s2.tuifly.util.Cookie().get(C)},getFriendchipsCookie:function(){return new s2.tuifly.util.Cookie().get(A)},loggedIn:function(){var F=this.getLoginCookie();if(F&&F.length>0){return true}return false},draw:function(){var F=this.loggedIn();var I=F?"block":"none";var G=F?"none":"block";var H="<style type='text/css'>.loggedIn { display: "+I+" } \n.loggedOut { display: "+G+" }</style>";document.write(H)},showLoginbox:function(){$("#loginBox").attr("style","display:block;");$("#loginName").focus()},hideLoginbox:function(){$("#loginBox").attr("style","display:none;")},showSalutation:function(){$("#headerSalutation").text(this.getNameCookie().replace("+"," "));var F="";var G=JooseX.Culture.Factory.get().majorIdentifier();if(this.getFriendchipsCookie()==0){F="/mein-TUIfly/so_einfach.html"}else{F="/mein-TUIfly/friendchips_konto.html"}$("#friendChipsCounter").html(this.getFriendchipsCookie());$("#friendChipsRef").attr("href","/"+G+F)},submitGlobalLoginRemoteNewValues:function(H,J,I){var F=$("#"+H).val();var G=$("#"+J).val();$("#loginName").val(F);$("#loginPassword").val(G);if(I){$("#returnURL").val($("#"+I).val())}$("#topbonusWait").removeClass("hidden");$("#topbonuslogin").removeClass("loggedOut");$("#topbonuslogin").addClass("hidden");$("#globalLoginForm").submit()}};$(document).ready(function(){var K=new s2.tuifly.util.Query(location.hash);var J=JooseX.Culture.Factory.get().identifier();var L=JooseX.Culture.Factory.get().majorIdentifier();var R=s2.tuifly.util.Environment.get().isProd()||s2.tuifly.util.Environment.get().isStage()?"https://":"http://";var I=location.protocol+"//";var M=location.hostname;if(location.port!="80"&&location.port!="443"&&location.port!=""){M+=":"+location.port}var F=R+M+location.pathname+location.search;var H=R+M+"/GlobalLogin.aspx";var N=R+M+"/GlobalLogin.aspx?globalLogout=true&culture="+J;var Q=R+M+"/FindPassword.aspx?returnURL="+F+"&culture="+J;var O=R+M+"/Register.aspx?culture="+J;var P=R+M+"/"+L+"/mein-TUIfly/index.html";$("#globalLoginForm").append('<input type="hidden" name="culture" value="'+J+'">');$("#returnURL").val(F);if(location.pathname=="/Register.aspx"){$("#returnURL").val(P)}var G=$("#globalLoginForm");G.attr("action",H);$("#globalLogoutAction").attr("href",N);$("#globalLoginFindPasswordAction").attr("href",Q);G.submit(function(U){var S=$("#loginName");var T=$("#loginPassword");if(S.val()==""){U.preventDefault();S.focus();return}if(T.val()==""){U.preventDefault();T.focus();return}});if(K.param("open")=="login"){window.tuiLogin.showLoginbox()}else{window.tuiLogin.showSalutation()}if((K.param("passwordIncorrect")=="1")&&(K.param("loginEvent")!="1")){window.setTimeout(function(){alert(window.passwordIncorrectErrorMessage.replace(/&lt;/g,"<").replace(/&gt;/g,">"));window.tuiLogin.showLoginbox()},0)}});window.tuiLogin=new this.Login();window.tuiLogin.draw()});s2.namespace("s2.tuifly.google.maps",function(){this.map=null;this.load_map=function(C){if(typeof(GBrowserIsCompatible)!="undefined"&&GBrowserIsCompatible()){var B;if(document.location.host=="217.110.104.233"){B="http://www.tuifly.com"+C.icon_url}else{B=C.icon_url}if(C.map_type=="hybrid"){C.map_type=G_HYBRID_MAP}else{if(C.map_type=="satellite"){C.map_type=G_SATELLITE_MAP}else{C.map_type=G_NORMAL_MAP}}if(!C.map_id){C.map_id="map"}if(!C.startZoom){C.startZoom=8}if($("#"+C.map_id)){this.map=new GMap2(document.getElementById(C.map_id));if(typeof(this.map)!="undefined"){this.map.addControl(new GSmallMapControl());this.map.setCenter(new GLatLng(C.Lng,C.Lat),C.startZoom);this.map.setMapType(C.map_type);var D=new GIcon();D.image=B;D.iconSize=new GSize(20,24);D.shadowSize=new GSize(22,20);D.iconAnchor=new GPoint(1,12);D.infoWindowAnchor=new GPoint(5,1);var A=new GLatLng(C.Lng,C.Lat);this.map.addOverlay(new GMarker(A,D))}}}};this.get_api_key=function(){var A="";if(self.location.href.indexOf("tuifly.com")>=0){A="ABQIAAAA46T_OVRrnx4cblvTRMon_hT0ctzIeJ6Zps-c1ujYRD0t0BJZHRRhs8PtEgXQfIj5mGS0LHaokT3otg"}else{if(self.location.href.indexOf("217.110.104.233")>=0){A="ABQIAAAA46T_OVRrnx4cblvTRMon_hTIVhBRjscOwCWRAr-Jt4kMoOMNFBQKVi1jtl9CaLGF9iQ6ylAJKVPDMg"}else{if(self.location.href.indexOf("hase")>=0){A="ABQIAAAA46T_OVRrnx4cblvTRMon_hSFjFfmzTGBQ3kEKKooZB90kFnNuxTeAoPvCu9LrqiRvD4jHZk8rnJBuA"}else{if(self.location.href.indexOf("217.110.104.236:13080")>=0){A="ABQIAAAA46T_OVRrnx4cblvTRMon_hToi96h0hcW8fW7RH7xHVTNhR_MbxSaGii_ILWA7T3Z2gPO5P9U9ocYqw"}else{if(self.location.href.indexOf("217.110.104.236:10080")>=0){A="ABQIAAAA46T_OVRrnx4cblvTRMon_hTNX0lYVFj-VpvE5Oy_WffWrSgPYRQtEHfEWTCYWTUbgmpKPJ0aenv81A"}else{if(self.location.href.indexOf("devel.tuifly.sinnerschrader.de:10080")>=0){A="ABQIAAAA46T_OVRrnx4cblvTRMon_hSiShUXJjhkPPEJzWHgihTDcOc36hRmlQz-oJoWpiunW-AiwDEhtLZ-ZA"}else{if(self.location.href.indexOf("devel.tuifly.sinnerschrader.de")>=0){A="ABQIAAAA46T_OVRrnx4cblvTRMon_hQPmbLerFLVZTI_n9I7YVd5IBWRqBR0afuFmU3_YVPX8jrOWjHMoqCzuA"}else{if(self.location.href.indexOf("217.110.104.236")>=0){A="ABQIAAAA46T_OVRrnx4cblvTRMon_hR8Q1gUAst0ivHKq1GoL4AJ3DhgfRQ3MvYj6XLZmuhVfJrHatW_Jwe-kg"}else{if(self.location.href.indexOf("stage.tuifly.sinnerschrader.de")>=0){A="ABQIAAAA46T_OVRrnx4cblvTRMon_hSmzMK9z3xPuJ3OVBduG4ZLyo_rPBTFnUXY-biMwBN6bq0Css76_1BiAA"}else{if(self.location.href.indexOf("tuifly")>=0){A="ABQIAAAA46T_OVRrnx4cblvTRMon_hRldNTBUwXjV8zvMjIg28hwTQgeGBTLjd9TtBOzrJ0HhREtkuuGcJO4gQ"}else{if(self.location.href.indexOf("win")>=0){A="ABQIAAAA46T_OVRrnx4cblvTRMon_hTYSRVBf8Y6Q-G3SJmrvrpKD6vVohR4kLZZMKyaED7i8tzZO_65DXqQLw"}else{if(self.location.href.indexOf("tui")>=0){A="ABQIAAAA46T_OVRrnx4cblvTRMon_hR3k4WTjS7OrpVtkbvqxRIRkzTscxSE8duqNB0aW8-U0-OvDV8XZ9vmSw"}else{if(self.location.href.indexOf("localhost")>=0){A="ABQIAAAA46T_OVRrnx4cblvTRMon_hT2yXp_ZAY8_ufC3CFXhHIE1NvwkxSydD_cy8QzGmSrhecgpKYqkq0S6A"}else{if(self.location.href.indexOf("127.0.0.1")>=0){A="ABQIAAAA46T_OVRrnx4cblvTRMon_hRi_j0U6kJrkFvY4-OX2XYmEAa76BTCwtr-dBxjDr0tQ8H2Zg-WmIwY5w"}}}}}}}}}}}}}}return A}});s2.namespace("s2.tuifly.google.search",function(){var D=this;var H;var C;var A;var G;var F;var B;var E="/service";this.initialize=function(){var I=this;C=document.getElementById("search");if(C&&$("form[id=search]").length>0){A=$(C).find("[name=searchService]").get(0);F=new s2.tuifly.util.Query();B=F.param("search");if(B!=null&&B!=""){G=$("#contentArea > .contentBlock > .content");G.html("");window.setTimeout(function(){I.loadAPI()},10);$(A).val(B);A.onclick=function(){$(this).focus()};$(A).addClass("readyForSearch")}else{A.onclick=function(){if(!$(this).hasClass("readyForSearch")){$(this).select()}$(this).addClass("readyForSearch")}}$(C).submit(function(L){L.preventDefault();var K=A.value;if(!$(A).hasClass("readyForSearch")||K==""){var M=$(A).attr("errorText");if(M){alert(M);return}}if(I.checkSpecialSearchBehaviour(K)){return}if(K!=""){var J=location.pathname+"?search="+escape(K);location.href=J}})}};this.checkSpecialSearchBehaviour=function(I){var J=I;if(J.match(/Reiserücktrittversicherung/i)||J.match(/reiserücktrittsversicherung/i)||J.match(/Reiserücktrittsversucherung/i)){window.open("http://www.tuifly.com/specials/partnerframe/index.php?url=rund-um-ihren-flug&sub=elvia");return true}else{if(J.match(/übergewicht/i)||J.match(/gespäckabgabe/i)||J.match(/gepäckabgabe/i)||J.match(/übergepäck/i)||J.match(/sportgepäck/i)){$("#toggleBox_147").removeClass("closed");location.href="/de/service/index.html#toggleBox_147";return true}else{if(J.match(/Tiertransport/i)||J.match(/hundetransport/i)||J.match(/tiere/i)||J.match(/hunde/i)){$("#toggleBox_674").removeClass("closed");location.href="/de/service/faqs_zusatzleistungen.html#toggleBox_674";return true}else{if(J.match(/Hotline/i)||J.match(/Telefonkontakt/i)){$("#toggleBox_142").removeClass("closed");location.href="/de/service/servicecenter.html#toggleBox_142";return true}else{if(J.match(/Flotte/i)||J.match(/flugzeugtyp/i)){$("#toggleBox_151").removeClass("closed");location.href="/de/unternehmen.html#toggleBox_151";return true}}}}}return false};this.apiLoaded=function(){var I=this;s2.Logger.debug("API loader loaded");var J=function(){try{s2.Logger.debug("Search API loaded");H=new google.search.SearchControl();var M=JooseX.Culture.Factory.get();var P=M.majorIdentifier();var L="http://www.tuifly.com/"+P;s2.Logger.debug("Site "+L);var K=new google.search.WebSearch();K.setSiteRestriction(L);var N=new google.search.SearcherOptions();N.setExpandMode(google.search.SearchControl.EXPAND_MODE_OPEN);H.addSearcher(K,N);K.setResultSetSize(google.search.Search.LARGE_RESULTSET);s2.Logger.debug("Search API init complete");if(B!=null&&B!=""){I.execute(B)}}catch(O){s2.Logger.debug(O)}};if(window.google){s2.Logger.debug("Loading Search API");google.load("search","1.0",{callback:J})}else{s2.Logger.debug("Error google object not here!")}};this.execute=function(J){G.html("");var I=new google.search.DrawOptions();I.setDrawMode(google.search.SearchControl.DRAW_MODE_LINEAR);H.draw(G.get(0),I);H.execute(J);H.setSearchCompleteCallback(this,this.draw)};this.draw=function(J,I){s2.Logger.debug("Search successful");this.setTrackingParams();if(I.results.length==0){$("div.gsc-resultsbox-visible").html("Leider wurden keine Ergebnisse für Ihre Suchanfrage gefunden.")}};this.setTrackingParams=function(){if(typeof(s)!="undefined"){var J=new s2.tuifly.util.Query();var I=J.param("search");s.linkTrackVars="prop6,prop7,eVar6,events";s.linkTrackEvents="event1,event6";s.prop6=I;s.eVar6=I;s.events=s.events+",event6";if($(".gsc-webResult.gsc-result").length>0){s.prop7="successful"}else{s.prop7="non successful"}var K=$("input[name=searchService]").get(0);s.tl(K,"o","LoginErfolg")}};this.loadAPI=function(){s2.Logger.debug("Loading API Loader");var J=this.getAPIKey();var I=document.getElementsByTagName("body")[0];var K=document.createElement("script");K.src="https://www.google.com/jsapi?key="+J;I.appendChild(K);var L=document.createElement("script");L.text="var googleTimer = window.setInterval(function () {if(window.google) { clearInterval(googleTimer); s2.tuifly.google.search.apiLoaded() } },10)";I.appendChild(L)};this.getAPIKey=function(){var I="";if(self.location.href.indexOf("http://www.tuifly.com")>=0){I="ABQIAAAAsNWi573VizRmhc31Vy4WmhSKzymgyrQvEmiHiQueYZMhWrFichTjsSBmVe5BA3xFRDseYqruoWKS0g"}else{if(self.location.href.indexOf("https://www.tuifly.com")>=0){I="ABQIAAAAsNWi573VizRmhc31Vy4WmhR1uKFfwpDfCq9ZINdnBf-yMPliLRTO3hyQbMN8ZEL6ZygRzjWfMTuX8A"}else{if(self.location.href.indexOf("http://beta.tuifly.com")>=0){I="ABQIAAAA46T_OVRrnx4cblvTRMon_hQQNiZPOWGTRHVx3qogpWlCtWx28BT5KrOiTqKaNbPKV34-5GVQ5zujrg"}else{if(self.location.href.indexOf("https://beta.tuifly.com")>=0){I="ABQIAAAA46T_OVRrnx4cblvTRMon_hRECQ92DKM0ugxp7to892GYd94X2BSYVW7B3zFDxj3LG4USNufXszc7ww"}else{if(self.location.href.indexOf("hase")>=0){I="ABQIAAAAsNWi573VizRmhc31Vy4WmhSFjFfmzTGBQ3kEKKooZB90kFnNuxRa5WNKAl6ok1xQ8-wkxob_6J4mYA"}else{if(self.location.href.indexOf("217.110.104.236:13080")>=0){I="ABQIAAAAsNWi573VizRmhc31Vy4WmhToi96h0hcW8fW7RH7xHVTNhR_MbxQEQtyXAbZooPfJsPB7WZLuFjtN2A"}else{if(self.location.href.indexOf("devel.tuifly.sinnerschrader.de:10080")>=0){I="ABQIAAAA46T_OVRrnx4cblvTRMon_hSiShUXJjhkPPEJzWHgihTDcOc36hRmlQz-oJoWpiunW-AiwDEhtLZ-ZA"}else{if(self.location.href.indexOf("devel.tuifly.sinnerschrader.de")>=0){I="ABQIAAAA46T_OVRrnx4cblvTRMon_hQPmbLerFLVZTI_n9I7YVd5IBWRqBR0afuFmU3_YVPX8jrOWjHMoqCzuA"}else{if(self.location.href.indexOf("217.110.104.236:10080")>=0){I="ABQIAAAA46T_OVRrnx4cblvTRMon_hTNX0lYVFj-VpvE5Oy_WffWrSgPYRQtEHfEWTCYWTUbgmpKPJ0aenv81A"}else{if(self.location.href.indexOf("217.110.104.236")>=0){I="ABQIAAAA46T_OVRrnx4cblvTRMon_hR8Q1gUAst0ivHKq1GoL4AJ3DhgfRQ3MvYj6XLZmuhVfJrHatW_Jwe-kg"}else{if(self.location.href.indexOf("stage.tuifly.sinnerschrader.de")>=0){I="ABQIAAAA46T_OVRrnx4cblvTRMon_hSmzMK9z3xPuJ3OVBduG4ZLyo_rPBTFnUXY-biMwBN6bq0Css76_1BiAA"}else{if(self.location.href.indexOf("win")>=0){I="ABQIAAAAsNWi573VizRmhc31Vy4WmhTYSRVBf8Y6Q-G3SJmrvrpKD6vVohSiDOp8uu_T0xbpmfCg99lF4EbpxA"}else{if(self.location.href.indexOf("tuifly")>=0){I="ABQIAAAA46T_OVRrnx4cblvTRMon_hRldNTBUwXjV8zvMjIg28hwTQgeGBTLjd9TtBOzrJ0HhREtkuuGcJO4gQ"}else{if(self.location.href.indexOf("tui")>=0){I="ABQIAAAA46T_OVRrnx4cblvTRMon_hR3k4WTjS7OrpVtkbvqxRIRkzTscxSE8duqNB0aW8-U0-OvDV8XZ9vmSw"}else{if(self.location.href.indexOf("localhost")>=0){I="ABQIAAAA46T_OVRrnx4cblvTRMon_hT2yXp_ZAY8_ufC3CFXhHIE1NvwkxSydD_cy8QzGmSrhecgpKYqkq0S6A"}else{if(self.location.href.indexOf("127.0.0.1")>=0){I="ABQIAAAA46T_OVRrnx4cblvTRMon_hRi_j0U6kJrkFvY4-OX2XYmEAa76BTCwtr-dBxjDr0tQ8H2Zg-WmIwY5w"}}}}}}}}}}}}}}}}return I}});s2.namespace("s2.tuifly.promo.kidsflyfree",function(){this.validate=function(){if(!PromoCodes){return true}if(!PromoCodes.kff){return true}if(!PromoCodes.kff.isCurrentlyOnSale){return true}var S=GetOriginValue();var H=GetDestinationValue();var R=S+"-"+H;var O=PromoCodes.kff.routes;if(jQuery.inArray(R,O)==-1){return true}var E={};var L={};E.year=GetYearDepart();L.year=GetYearReturning();E.month=GetMonthDepart();L.month=GetMonthReturning();E.day=GetDayDepart();L.day=GetDayReturning();var N=new Date(E.year,E.month-1,E.day);var P=new Date(L.year,L.month-1,L.day);var Q=PromoCodes.kff.travelDateRangeBegin;Q=Q.replace(/\s/,"T");var D=PromoCodes.kff.travelDateRangeEnd;D=D.replace(/\s/,"T");var C=Date.parse(Q.replace(/\./g,":"));var J=Date.parse(D.replace(/\./g,":"));var B=false;if(N.compareTo(C)>-1&&N.compareTo(J)<1||P.compareTo(C)>-1&&P.compareTo(J)<1){B=true}if(!B){return true}if(C.compareTo(N)==1||J.compareTo(P)==-1){return true}var A=GetAdultCount();var M=GetChildCount();var K=GetChildDiscountCount();var G=GetInfantCount();var F=A*3;var I=M+K;if(I>F){s2.tuifly.widget.dialog.alert(msgKidsFlyFreeLimitReached);return false}return true}});