/* 2010-06-01T10:21:13+02:00
	contains stripped files:
	------------------------
	jquery.js
	interface.js
	json.js
	core.js
	banner.js
	jquery_includer_null.js
	jquery.dimensions.js
	form_validator.js
	upload.js
	autocomplete.js
	swfobject.js
	usergroups.js
	friends.js
	map.js
	overlay.js
	jquery.rotate.1-1.js
	addTip.js
	top_destinations.js
	destination_selector.js
	ui.core.js
	ui.draggable.js
	ui.droppable.js
	infowin.js
	widget.js
	jquery.scrollTo.js
	boxes.js
	jquery.autogrow.js
*/



/**** AssetPackerHelper::process()  jquery.js  ****/


(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 I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);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(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,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 I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.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 I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].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(K){if(K===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 I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F<J;F++){var G=M[F];if(G.selected){K=o(G).val();if(H){return K}L.push(K)}}return L}return(E.value||"").replace(/\r/g,"")}return g}if(typeof K==="number"){K+=""}return this.each(function(){if(this.nodeType!=1){return}if(o.isArray(K)&&/radio|checkbox/.test(this.type)){this.checked=(o.inArray(this.value,K)>=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},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(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G<E;G++){L.call(K(this[G],H),this.length>1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};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 J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H<I;H++){if((G=arguments[H])!=null){for(var F in G){var K=J[F],L=G[F];if(J===L){continue}if(E&&L&&typeof L==="object"&&!L.nodeType){J[F]=o.extend(E,K||(L.length!=null?[]:{}),L)}else{if(L!==g){J[F]=L}}}}}return J};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,K,F){var E,H=0,I=G.length;if(F){if(I===g){for(E in G){if(K.apply(G[E],F)===false){break}}}else{for(;H<I;){if(K.apply(G[H++],F)===false){break}}}}else{if(I===g){for(E in G){if(K.call(G[E],E,G[E])===false){break}}}else{for(var J=G[0];H<I&&K.call(J,H,J)!==false;J=G[++H]){}}}return G},prop:function(H,I,G,F,E){if(o.isFunction(I)){I=I.call(H,F)}return typeof I==="number"&&G=="curCSS"&&!b.test(E)?I+"px":I},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,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+"></"+T+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!O.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!O.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!O.indexOf("<td")||!O.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!O.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!o.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/<tbody/i.test(S),N=!O.indexOf("<table")&&!R?L.firstChild&&L.firstChild.childNodes:Q[1]=="<table>"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[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,I=H.length;if(!o.support.getAll){while((G=E[F++])!=null){if(G.nodeType!=8){H[I++]=G}}}else{while((G=E[F++])!=null){H[I++]=G}}return H},unique:function(K){var F=[],E={};try{for(var G=0,H=K.length;G<H;G++){var J=o.data(K[G]);if(!E[J]){E[J]=true;F.push(K[G])}}}catch(I){F=K}return F},grep:function(F,J,E){var G=[];for(var H=0,I=F.length;H<I;H++){if(!E!=!J(F[H],H)){G.push(F[H])}}return G},map:function(E,J){var F=[];for(var G=0,H=E.length;G<H;G++){var I=J(E[G],G);if(I!=null){F[F.length]=I}}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 J=[],L=o(G);for(var K=0,H=L.length;K<H;K++){var I=(K>0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,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(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},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 R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa<ab.length;aa++){if(ab[aa]===ab[aa-1]){ab.splice(aa--,1)}}}}}return ab};F.matches=function(T,U){return F(T,null,null,U)};F.find=function(aa,T,ab){var Z,X;if(!aa){return[]}for(var W=0,V=I.order.length;W<V;W++){var Y=I.order[W],X;if((X=I.match[Y].exec(aa))){var U=RegExp.leftContext;if(U.substr(U.length-1)!=="\\"){X[1]=(X[1]||"").replace(/\\/g,"");Z=I.find[Y](X,T,ab);if(Z!=null){aa=aa.replace(I.match[Y],"");break}}}}if(!Z){Z=T.getElementsByTagName("*")}return{set:Z,expr:aa}};F.filter=function(ad,ac,ag,W){var V=ad,ai=[],aa=ac,Y,T,Z=ac&&ac[0]&&Q(ac[0]);while(ad&&ac.length){for(var ab in I.filter){if((Y=I.match[ab].exec(ad))!=null){var U=I.filter[ab],ah,af;T=false;if(aa==ai){ai=[]}if(I.preFilter[ab]){Y=I.preFilter[ab](Y,aa,ag,ai,W,Z);if(!Y){T=ah=true}else{if(Y===true){continue}}}if(Y){for(var X=0;(af=aa[X])!=null;X++){if(af){ah=U(af,Y,X,aa);var ae=W^!!ah;if(ag&&ah!=null){if(ae){T=true}else{aa[X]=false}}else{if(ae){ai.push(af);T=true}}}}}if(ah!==g){if(!ag){aa=ai}ad=ad.replace(I.match[ab],"");if(!T){return[]}break}}}if(ad==V){if(T==null){throw"Syntax error, unrecognized expression: "+ad}else{break}}V=ad}return aa};var I=F.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(T){return T.getAttribute("href")}},relative:{"+":function(aa,T,Z){var X=typeof T==="string",ab=X&&!/\W/.test(T),Y=X&&!ab;if(ab&&!Z){T=T.toUpperCase()}for(var W=0,V=aa.length,U;W<V;W++){if((U=aa[W])){while((U=U.previousSibling)&&U.nodeType!==1){}aa[W]=Y||U&&U.nodeName===T?U||false:U===T}}if(Y){F.filter(T,aa,true)}},">":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){var W=Y.parentNode;Z[V]=W.nodeName===U?W:false}}}else{for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){Z[V]=X?Y.parentNode:Y.parentNode===U}}if(X){F.filter(U,Z,true)}}},"":function(W,U,Y){var V=L++,T=S;if(!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("parentNode",U,V,W,X,Y)},"~":function(W,U,Y){var V=L++,T=S;if(typeof U==="string"&&!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("previousSibling",U,V,W,X,Y)}},find:{ID:function(U,V,W){if(typeof V.getElementById!=="undefined"&&!W){var T=V.getElementById(U[1]);return T?[T]:[]}},NAME:function(V,Y,Z){if(typeof Y.getElementsByName!=="undefined"){var U=[],X=Y.getElementsByName(V[1]);for(var W=0,T=X.length;W<T;W++){if(X[W].getAttribute("name")===V[1]){U.push(X[W])}}return U.length===0?null:U}},TAG:function(T,U){return U.getElementsByTagName(T[1])}},preFilter:{CLASS:function(W,U,V,T,Z,aa){W=" "+W[1].replace(/\\/g,"")+" ";if(aa){return W}for(var X=0,Y;(Y=U[X])!=null;X++){if(Y){if(Z^(Y.className&&(" "+Y.className+" ").indexOf(W)>=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return!!T.firstChild},empty:function(T){return!T.firstChild},has:function(V,U,T){return!!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return U<T[3]-0},gt:function(V,U,T){return U>T[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W<T;W++){if(Y[W]===Z){return false}}return true}}}},CHILD:function(T,W){var Z=W[1],U=T;switch(Z){case"only":case"first":while(U=U.previousSibling){if(U.nodeType===1){return false}}if(Z=="first"){return true}U=T;case"last":while(U=U.nextSibling){if(U.nodeType===1){return false}}return true;case"nth":var V=W[2],ac=W[3];if(V==1&&ac==0){return true}var Y=W[0],ab=T.parentNode;if(ab&&(ab.sizcache!==Y||!T.nodeIndex)){var X=0;for(U=ab.firstChild;U;U=U.nextSibling){if(U.nodeType===1){U.nodeIndex=++X}}ab.sizcache=Y}var aa=T.nodeIndex-ac;if(V==0){return aa==0}else{return(aa%V==0&&aa/V>=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V<T;V++){U.push(X[V])}}else{for(var V=0;X[V];V++){U.push(X[V])}}}return U}}var G;if(document.documentElement.compareDocumentPosition){G=function(U,T){var V=U.compareDocumentPosition(T)&4?-1:U===T?0:1;if(V===0){hasDuplicate=true}return V}}else{if("sourceIndex"in document.documentElement){G=function(U,T){var V=U.sourceIndex-T.sourceIndex;if(V===0){hasDuplicate=true}return V}}else{if(document.createRange){G=function(W,U){var V=W.ownerDocument.createRange(),T=U.ownerDocument.createRange();V.selectNode(W);V.collapse(true);T.selectNode(U);T.collapse(true);var X=V.compareBoundaryPoints(Range.START_TO_END,T);if(X===0){hasDuplicate=true}return X}}}}(function(){var U=document.createElement("form"),V="script"+(new Date).getTime();U.innerHTML="<input name='"+V+"'/>";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="<a href='#'></a>";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="<p class='TEST'></p>";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="<div class='test e'></div><div class='test'></div>";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1&&!ac){T.sizcache=Y;T.sizset=W}if(T.nodeName===Z){X=T;break}T=T[U]}ad[W]=X}}}function S(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1){if(!ac){T.sizcache=Y;T.sizset=W}if(typeof Z!=="string"){if(T===Z){X=true;break}}else{if(F.filter(Z,[T]).length>0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z<U;Z++){F(T,V[Z],W)}return F.filter(X,W)};o.find=F;o.filter=F.filter;o.expr=F.selectors;o.expr[":"]=o.expr.filters;F.selectors.filters.hidden=function(T){return T.offsetWidth===0||T.offsetHeight===0};F.selectors.filters.visible=function(T){return T.offsetWidth>0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.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,J;G;){J=this.props[--G];H[J]=F[J]}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 I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.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 E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.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(I){o(this).unbind(I,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(I,J){if(E.test(J.type)){var K=o(H.target).closest(J.data)[0];if(K){F.push({elem:K,fn:J})}}});F.sort(function(J,I){return o.data(J.elem,"closest")-o.data(I.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 F=document.documentElement,G=document.createElement("script"),K=document.createElement("div"),J="script"+(new Date).getTime();K.style.display="none";K.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 H=K.getElementsByTagName("*"),E=K.getElementsByTagName("a")[0];if(!H||!H.length||!E){return}o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefNormalized:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"))}catch(I){}F.insertBefore(G,F.firstChild);if(l[J]){o.support.scriptEval=true;delete l[J]}F.removeChild(G);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function(){o.support.noCloneEvent=false;K.detachEvent("onclick",arguments.callee)});K.cloneNode(true).fireEvent("onclick")}o(function(){var L=document.createElement("div");L.style.width=L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L).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,J,K){if(typeof G!=="string"){return this._load(G)}var I=G.indexOf(" ");if(I>=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("<div/>").append(M.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});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(I,H){return{name:F.name,value:I}}):{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(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return!F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}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(J,L){if(J){return this.animate(t("show",3),J,L)}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,K;if(m[G]){K=m[G]}else{var I=o("<"+G+" />").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H<F;H++){this[H].style.display=o.data(this[H],"olddisplay")||""}return this}},hide:function(H,I){if(H){return this.animate(t("hide",3),H,I)}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(I,F,H,G){var E=o.speed(F,H,G);return this[E.queue===false?"each":"queue"](function(){var K=o.extend({},E),M,L=this.nodeType==1&&o(this).is(":hidden"),J=this;for(M in I){if(I[M]=="hide"&&L||I[M]=="show"&&!L){return K.complete.call(this)}if((M=="height"||M=="width")&&this.style){K.display=o.css(this,"display");K.overflow=this.style.overflow}}if(K.overflow!=null){this.style.overflow="hidden"}K.curAnim=o.extend({},I);o.each(I,function(O,S){var R=new o.fx(J,K,O);if(/toggle|show|hide/.test(S)){R[S=="toggle"?L?"show":"hide":S](I)}else{var Q=S.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),T=R.cur(true)||0;if(Q){var N=parseFloat(Q[2]),P=Q[3]||"px";if(P!="px"){J.style[O]=(N||1)+P;T=((N||1)/R.cur(true))*T;J.style[O]=T+P}if(Q[1]){N=((Q[1]=="-="?-1:1)*N)+T}R.custom(T,N,P)}else{R.custom(T,S,"")}}});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(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J<K.length;J++){if(!K[J]()){K.splice(J--,1)}}if(!K.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 I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,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(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,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 J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='<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>';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.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 I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.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(I,G){var E=I?"Left":"Top",H=I?"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(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){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]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})();


/**** AssetPackerHelper::process()  interface.js  ****/


jQuery.extend({easing:{linear:function(p,n,firstNum,delta,duration){return((-Math.cos(p*Math.PI)/2)+0.5)*delta+firstNum;},easein:function(p,n,firstNum,delta,duration){return delta*(n/=duration)*n*n+firstNum;},easeout:function(p,n,firstNum,delta,duration){return-delta*((n=n/duration-1)*n*n*n-1)+firstNum;},easeboth:function(p,n,firstNum,delta,duration){if((n/=duration/2)<1)
return delta/2*n*n*n*n+firstNum;return-delta/2*((n-=2)*n*n*n-2)+firstNum;},bounceout:function(p,n,firstNum,delta,duration){if((n/=duration)<(1/2.75)){return delta*(7.5625*n*n)+firstNum;}else if(n<(2/2.75)){return delta*(7.5625*(n-=(1.5/2.75))*n+.75)+firstNum;}else if(n<(2.5/2.75)){return delta*(7.5625*(n-=(2.25/2.75))*n+.9375)+firstNum;}else{return delta*(7.5625*(n-=(2.625/2.75))*n+.984375)+firstNum;}},bouncein:function(p,n,firstNum,delta,duration){if(jQuery.easing.bounceout)
return delta-jQuery.easing.bounceout(p,duration-n,0,delta,duration)+firstNum;return firstNum+delta;},bounceboth:function(p,n,firstNum,delta,duration){if(jQuery.easing.bouncein&&jQuery.easing.bounceout)
if(n<duration/2)
return jQuery.easing.bouncein(p,n*2,0,delta,duration)*.5+firstNum;return jQuery.easing.bounceout(p,n*2-duration,0,delta,duration)*.5+delta*.5+firstNum;return firstNum+delta;},elasticin:function(p,n,firstNum,delta,duration){var a,s;if(n==0)
return firstNum;if((n/=duration)==1)
return firstNum+delta;a=delta*0.3;p=duration*.3;if(a<Math.abs(delta)){a=delta;s=p/4;}else{s=p/(2*Math.PI)*Math.asin(delta/a);}
return-(a*Math.pow(2,10*(n-=1))*Math.sin((n*duration-s)*(2*Math.PI)/p))+firstNum;},elasticout:function(p,n,firstNum,delta,duration){var a,s;if(n==0)
return firstNum;if((n/=duration/2)==2)
return firstNum+delta;a=delta*0.3;p=duration*.3;if(a<Math.abs(delta)){a=delta;s=p/4;}else{s=p/(2*Math.PI)*Math.asin(delta/a);}
return a*Math.pow(2,-10*n)*Math.sin((n*duration-s)*(2*Math.PI)/p)+delta+firstNum;},elasticboth:function(p,n,firstNum,delta,duration){var a,s;if(n==0)
return firstNum;if((n/=duration/2)==2)
return firstNum+delta;a=delta*0.3;p=duration*.3;if(a<Math.abs(delta)){a=delta;s=p/4;}else{s=p/(2*Math.PI)*Math.asin(delta/a);}
if(n<1){return-.5*(a*Math.pow(2,10*(n-=1))*Math.sin((n*duration-s)*(2*Math.PI)/p))+firstNum;}
return a*Math.pow(2,-10*(n-=1))*Math.sin((n*duration-s)*(2*Math.PI)/p)*.5+delta+firstNum;}}});jQuery.iDrag={helper:null,dragged:null,destroy:function()
{return this.each(function()
{if(this.isDraggable){this.dragCfg.dhe.unbind('mousedown',jQuery.iDrag.draginit);this.dragCfg=null;this.isDraggable=false;if(jQuery.browser.msie){this.unselectable="off";}else{this.style.MozUserSelect='';this.style.KhtmlUserSelect='';this.style.userSelect='';}}});},draginit:function(e)
{if(jQuery.iDrag.dragged!=null){jQuery.iDrag.dragstop(e);return false;}
var elm=this.dragElem;jQuery(document).bind('mousemove',jQuery.iDrag.dragmove).bind('mouseup',jQuery.iDrag.dragstop);elm.dragCfg.pointer=jQuery.iUtil.getPointer(e);elm.dragCfg.currentPointer=elm.dragCfg.pointer;elm.dragCfg.init=false;elm.dragCfg.fromHandler=this!=this.dragElem;jQuery.iDrag.dragged=elm;if(elm.dragCfg.si&&this!=this.dragElem){parentPos=jQuery.iUtil.getPosition(elm.parentNode);sliderSize=jQuery.iUtil.getSize(elm);sliderPos={x:parseInt(jQuery.css(elm,'left'))||0,y:parseInt(jQuery.css(elm,'top'))||0};dx=elm.dragCfg.currentPointer.x-parentPos.x-sliderSize.wb/2-sliderPos.x;dy=elm.dragCfg.currentPointer.y-parentPos.y-sliderSize.hb/2-sliderPos.y;jQuery.iSlider.dragmoveBy(elm,[dx,dy]);}
return jQuery.selectKeyHelper||false;},dragstart:function(e)
{var elm=jQuery.iDrag.dragged;elm.dragCfg.init=true;var dEs=elm.style;elm.dragCfg.oD=jQuery.css(elm,'display');elm.dragCfg.oP=jQuery.css(elm,'position');if(!elm.dragCfg.initialPosition)
elm.dragCfg.initialPosition=elm.dragCfg.oP;elm.dragCfg.oR={x:parseInt(jQuery.css(elm,'left'))||0,y:parseInt(jQuery.css(elm,'top'))||0};elm.dragCfg.diffX=0;elm.dragCfg.diffY=0;if(jQuery.browser.msie){var oldBorder=jQuery.iUtil.getBorder(elm,true);elm.dragCfg.diffX=oldBorder.l||0;elm.dragCfg.diffY=oldBorder.t||0;}
elm.dragCfg.oC=jQuery.extend(jQuery.iUtil.getPosition(elm),jQuery.iUtil.getSize(elm));if(elm.dragCfg.oP!='relative'&&elm.dragCfg.oP!='absolute'){dEs.position='relative';}
jQuery.iDrag.helper.empty();var clonedEl=elm.cloneNode(true);jQuery(clonedEl).css({display:'block',left:'0px',top:'0px'});clonedEl.style.marginTop='0';clonedEl.style.marginRight='0';clonedEl.style.marginBottom='0';clonedEl.style.marginLeft='0';jQuery.iDrag.helper.append(clonedEl);var dhs=jQuery.iDrag.helper.get(0).style;if(elm.dragCfg.autoSize){dhs.width='auto';dhs.height='auto';}else{dhs.height=elm.dragCfg.oC.hb+'px';dhs.width=elm.dragCfg.oC.wb+'px';}
dhs.display='block';dhs.marginTop='0px';dhs.marginRight='0px';dhs.marginBottom='0px';dhs.marginLeft='0px';jQuery.extend(elm.dragCfg.oC,jQuery.iUtil.getSize(clonedEl));if(elm.dragCfg.cursorAt){if(elm.dragCfg.cursorAt.left){elm.dragCfg.oR.x+=elm.dragCfg.pointer.x-elm.dragCfg.oC.x-elm.dragCfg.cursorAt.left;elm.dragCfg.oC.x=elm.dragCfg.pointer.x-elm.dragCfg.cursorAt.left;}
if(elm.dragCfg.cursorAt.top){elm.dragCfg.oR.y+=elm.dragCfg.pointer.y-elm.dragCfg.oC.y-elm.dragCfg.cursorAt.top;elm.dragCfg.oC.y=elm.dragCfg.pointer.y-elm.dragCfg.cursorAt.top;}
if(elm.dragCfg.cursorAt.right){elm.dragCfg.oR.x+=elm.dragCfg.pointer.x-elm.dragCfg.oC.x-elm.dragCfg.oC.hb+elm.dragCfg.cursorAt.right;elm.dragCfg.oC.x=elm.dragCfg.pointer.x-elm.dragCfg.oC.wb+elm.dragCfg.cursorAt.right;}
if(elm.dragCfg.cursorAt.bottom){elm.dragCfg.oR.y+=elm.dragCfg.pointer.y-elm.dragCfg.oC.y-elm.dragCfg.oC.hb+elm.dragCfg.cursorAt.bottom;elm.dragCfg.oC.y=elm.dragCfg.pointer.y-elm.dragCfg.oC.hb+elm.dragCfg.cursorAt.bottom;}}
elm.dragCfg.nx=elm.dragCfg.oR.x;elm.dragCfg.ny=elm.dragCfg.oR.y;if(elm.dragCfg.insideParent||elm.dragCfg.containment=='parent'){parentBorders=jQuery.iUtil.getBorder(elm.parentNode,true);elm.dragCfg.oC.x=elm.offsetLeft+(jQuery.browser.msie?0:jQuery.browser.opera?-parentBorders.l:parentBorders.l);elm.dragCfg.oC.y=elm.offsetTop+(jQuery.browser.msie?0:jQuery.browser.opera?-parentBorders.t:parentBorders.t);jQuery(elm.parentNode).append(jQuery.iDrag.helper.get(0));}
if(elm.dragCfg.containment){jQuery.iDrag.getContainment(elm);elm.dragCfg.onDragModifier.containment=jQuery.iDrag.fitToContainer;}
if(elm.dragCfg.si){jQuery.iSlider.modifyContainer(elm);}
dhs.left=elm.dragCfg.oC.x-elm.dragCfg.diffX+'px';dhs.top=elm.dragCfg.oC.y-elm.dragCfg.diffY+'px';dhs.width=elm.dragCfg.oC.wb+'px';dhs.height=elm.dragCfg.oC.hb+'px';jQuery.iDrag.dragged.dragCfg.prot=false;if(elm.dragCfg.gx){elm.dragCfg.onDragModifier.grid=jQuery.iDrag.snapToGrid;}
if(elm.dragCfg.zIndex!=false){jQuery.iDrag.helper.css('zIndex',elm.dragCfg.zIndex);}
if(elm.dragCfg.opacity){jQuery.iDrag.helper.css('opacity',elm.dragCfg.opacity);if(window.ActiveXObject){jQuery.iDrag.helper.css('filter','alpha(opacity='+elm.dragCfg.opacity*100+')');}}
if(elm.dragCfg.frameClass){jQuery.iDrag.helper.addClass(elm.dragCfg.frameClass);jQuery.iDrag.helper.get(0).firstChild.style.display='none';}
if(elm.dragCfg.onStart)
elm.dragCfg.onStart.apply(elm,[clonedEl,elm.dragCfg.oR.x,elm.dragCfg.oR.y]);if(jQuery.iDrop&&jQuery.iDrop.count>0){jQuery.iDrop.highlight(elm);}
if(elm.dragCfg.ghosting==false){dEs.display='none';}
return false;},getContainment:function(elm)
{if(elm.dragCfg.containment.constructor==String){if(elm.dragCfg.containment=='parent'){elm.dragCfg.cont=jQuery.extend({x:0,y:0},jQuery.iUtil.getSize(elm.parentNode));var contBorders=jQuery.iUtil.getBorder(elm.parentNode,true);elm.dragCfg.cont.w=elm.dragCfg.cont.wb-contBorders.l-contBorders.r;elm.dragCfg.cont.h=elm.dragCfg.cont.hb-contBorders.t-contBorders.b;}else if(elm.dragCfg.containment=='document'){var clnt=jQuery.iUtil.getClient();elm.dragCfg.cont={x:0,y:0,w:clnt.w,h:clnt.h};}}else if(elm.dragCfg.containment.constructor==Array){elm.dragCfg.cont={x:parseInt(elm.dragCfg.containment[0])||0,y:parseInt(elm.dragCfg.containment[1])||0,w:parseInt(elm.dragCfg.containment[2])||0,h:parseInt(elm.dragCfg.containment[3])||0};}
elm.dragCfg.cont.dx=elm.dragCfg.cont.x-elm.dragCfg.oC.x;elm.dragCfg.cont.dy=elm.dragCfg.cont.y-elm.dragCfg.oC.y;},hidehelper:function(dragged)
{if(dragged.dragCfg.insideParent||dragged.dragCfg.containment=='parent'){jQuery('body',document).append(jQuery.iDrag.helper.get(0));}
jQuery.iDrag.helper.empty().hide().css('opacity',1);if(window.ActiveXObject){jQuery.iDrag.helper.css('filter','alpha(opacity=100)');}},dragstop:function(e)
{jQuery(document).unbind('mousemove',jQuery.iDrag.dragmove).unbind('mouseup',jQuery.iDrag.dragstop);if(jQuery.iDrag.dragged==null){return;}
var dragged=jQuery.iDrag.dragged;jQuery.iDrag.dragged=null;if(dragged.dragCfg.init==false){return false;}
if(dragged.dragCfg.so==true){jQuery(dragged).css('position',dragged.dragCfg.oP);}
var dEs=dragged.style;if(dragged.si){jQuery.iDrag.helper.css('cursor','move');}
if(dragged.dragCfg.frameClass){jQuery.iDrag.helper.removeClass(dragged.dragCfg.frameClass);}
if(dragged.dragCfg.revert==false){if(dragged.dragCfg.fx>0){if(!dragged.dragCfg.axis||dragged.dragCfg.axis=='horizontally'){var x=new jQuery.fx(dragged,{duration:dragged.dragCfg.fx},'left');x.custom(dragged.dragCfg.oR.x,dragged.dragCfg.nRx);}
if(!dragged.dragCfg.axis||dragged.dragCfg.axis=='vertically'){var y=new jQuery.fx(dragged,{duration:dragged.dragCfg.fx},'top');y.custom(dragged.dragCfg.oR.y,dragged.dragCfg.nRy);}}else{if(!dragged.dragCfg.axis||dragged.dragCfg.axis=='horizontally')
dragged.style.left=dragged.dragCfg.nRx+'px';if(!dragged.dragCfg.axis||dragged.dragCfg.axis=='vertically')
dragged.style.top=dragged.dragCfg.nRy+'px';}
jQuery.iDrag.hidehelper(dragged);if(dragged.dragCfg.ghosting==false){jQuery(dragged).css('display',dragged.dragCfg.oD);}}else if(dragged.dragCfg.fx>0){dragged.dragCfg.prot=true;var dh=false;if(jQuery.iDrop&&jQuery.iSort&&dragged.dragCfg.so){dh=jQuery.iUtil.getPosition(jQuery.iSort.helper.get(0));}
jQuery.iDrag.helper.animate({left:dh?dh.x:dragged.dragCfg.oC.x,top:dh?dh.y:dragged.dragCfg.oC.y},dragged.dragCfg.fx,function()
{dragged.dragCfg.prot=false;if(dragged.dragCfg.ghosting==false){dragged.style.display=dragged.dragCfg.oD;}
jQuery.iDrag.hidehelper(dragged);});}else{jQuery.iDrag.hidehelper(dragged);if(dragged.dragCfg.ghosting==false){jQuery(dragged).css('display',dragged.dragCfg.oD);}}
if(jQuery.iDrop&&jQuery.iDrop.count>0){jQuery.iDrop.checkdrop(dragged);}
if(jQuery.iSort&&dragged.dragCfg.so){jQuery.iSort.check(dragged);}
if(dragged.dragCfg.onChange&&(dragged.dragCfg.nRx!=dragged.dragCfg.oR.x||dragged.dragCfg.nRy!=dragged.dragCfg.oR.y)){dragged.dragCfg.onChange.apply(dragged,dragged.dragCfg.lastSi||[0,0,dragged.dragCfg.nRx,dragged.dragCfg.nRy]);}
if(dragged.dragCfg.onStop)
dragged.dragCfg.onStop.apply(dragged);return false;},snapToGrid:function(x,y,dx,dy)
{if(dx!=0)
dx=parseInt((dx+(this.dragCfg.gx*dx/Math.abs(dx))/2)/this.dragCfg.gx)*this.dragCfg.gx;if(dy!=0)
dy=parseInt((dy+(this.dragCfg.gy*dy/Math.abs(dy))/2)/this.dragCfg.gy)*this.dragCfg.gy;return{dx:dx,dy:dy,x:0,y:0};},fitToContainer:function(x,y,dx,dy)
{dx=Math.min(Math.max(dx,this.dragCfg.cont.dx),this.dragCfg.cont.w+this.dragCfg.cont.dx-this.dragCfg.oC.wb);dy=Math.min(Math.max(dy,this.dragCfg.cont.dy),this.dragCfg.cont.h+this.dragCfg.cont.dy-this.dragCfg.oC.hb);return{dx:dx,dy:dy,x:0,y:0}},dragmove:function(e)
{if(jQuery.iDrag.dragged==null||jQuery.iDrag.dragged.dragCfg.prot==true){return;}
var dragged=jQuery.iDrag.dragged;dragged.dragCfg.currentPointer=jQuery.iUtil.getPointer(e);if(dragged.dragCfg.init==false){distance=Math.sqrt(Math.pow(dragged.dragCfg.pointer.x-dragged.dragCfg.currentPointer.x,2)+Math.pow(dragged.dragCfg.pointer.y-dragged.dragCfg.currentPointer.y,2));if(distance<dragged.dragCfg.snapDistance){return;}else{jQuery.iDrag.dragstart(e);}}
var dx=dragged.dragCfg.currentPointer.x-dragged.dragCfg.pointer.x;var dy=dragged.dragCfg.currentPointer.y-dragged.dragCfg.pointer.y;for(var i in dragged.dragCfg.onDragModifier){var newCoords=dragged.dragCfg.onDragModifier[i].apply(dragged,[dragged.dragCfg.oR.x+dx,dragged.dragCfg.oR.y+dy,dx,dy]);if(newCoords&&newCoords.constructor==Object){dx=i!='user'?newCoords.dx:(newCoords.x-dragged.dragCfg.oR.x);dy=i!='user'?newCoords.dy:(newCoords.y-dragged.dragCfg.oR.y);}}
dragged.dragCfg.nx=dragged.dragCfg.oC.x+dx-dragged.dragCfg.diffX;dragged.dragCfg.ny=dragged.dragCfg.oC.y+dy-dragged.dragCfg.diffY;if(dragged.dragCfg.si&&(dragged.dragCfg.onSlide||dragged.dragCfg.onChange)){jQuery.iSlider.onSlide(dragged,dragged.dragCfg.nx,dragged.dragCfg.ny);}
if(dragged.dragCfg.onDrag)
dragged.dragCfg.onDrag.apply(dragged,[dragged.dragCfg.oR.x+dx,dragged.dragCfg.oR.y+dy]);if(!dragged.dragCfg.axis||dragged.dragCfg.axis=='horizontally'){dragged.dragCfg.nRx=dragged.dragCfg.oR.x+dx;jQuery.iDrag.helper.get(0).style.left=dragged.dragCfg.nx+'px';}
if(!dragged.dragCfg.axis||dragged.dragCfg.axis=='vertically'){dragged.dragCfg.nRy=dragged.dragCfg.oR.y+dy;jQuery.iDrag.helper.get(0).style.top=dragged.dragCfg.ny+'px';}
if(jQuery.iDrop&&jQuery.iDrop.count>0){jQuery.iDrop.checkhover(dragged);}
return false;},build:function(o)
{if(!jQuery.iDrag.helper){jQuery('body',document).append('<div id="dragHelper"></div>');jQuery.iDrag.helper=jQuery('#dragHelper');var el=jQuery.iDrag.helper.get(0);var els=el.style;els.position='absolute';els.display='none';els.cursor='move';els.listStyle='none';els.overflow='hidden';if(window.ActiveXObject){el.unselectable="on";}else{els.mozUserSelect='none';els.userSelect='none';els.KhtmlUserSelect='none';}}
if(!o){o={};}
return this.each(function()
{if(this.isDraggable||!jQuery.iUtil)
return;if(window.ActiveXObject){this.onselectstart=function(){return false;};this.ondragstart=function(){return false;};}
var el=this;var dhe=o.handle?jQuery(this).find(o.handle):jQuery(this);if(jQuery.browser.msie){dhe.each(function()
{this.unselectable="on";});}else{dhe.css('-moz-user-select','none');dhe.css('user-select','none');dhe.css('-khtml-user-select','none');}
this.dragCfg={dhe:dhe,revert:o.revert?true:false,ghosting:o.ghosting?true:false,so:o.so?o.so:false,si:o.si?o.si:false,insideParent:o.insideParent?o.insideParent:false,zIndex:o.zIndex?parseInt(o.zIndex)||0:false,opacity:o.opacity?parseFloat(o.opacity):false,fx:parseInt(o.fx)||null,hpc:o.hpc?o.hpc:false,onDragModifier:{},pointer:{},onStart:o.onStart&&o.onStart.constructor==Function?o.onStart:false,onStop:o.onStop&&o.onStop.constructor==Function?o.onStop:false,onChange:o.onChange&&o.onChange.constructor==Function?o.onChange:false,axis:/vertically|horizontally/.test(o.axis)?o.axis:false,snapDistance:o.snapDistance?parseInt(o.snapDistance)||0:0,cursorAt:o.cursorAt?o.cursorAt:false,autoSize:o.autoSize?true:false,frameClass:o.frameClass||false};if(o.onDragModifier&&o.onDragModifier.constructor==Function)
this.dragCfg.onDragModifier.user=o.onDragModifier;if(o.onDrag&&o.onDrag.constructor==Function)
this.dragCfg.onDrag=o.onDrag;if(o.containment&&((o.containment.constructor==String&&(o.containment=='parent'||o.containment=='document'))||(o.containment.constructor==Array&&o.containment.length==4))){this.dragCfg.containment=o.containment;}
if(o.fractions){this.dragCfg.fractions=o.fractions;}
if(o.grid){if(typeof o.grid=='number'){this.dragCfg.gx=parseInt(o.grid)||1;this.dragCfg.gy=parseInt(o.grid)||1;}else if(o.grid.length==2){this.dragCfg.gx=parseInt(o.grid[0])||1;this.dragCfg.gy=parseInt(o.grid[1])||1;}}
if(o.onSlide&&o.onSlide.constructor==Function){this.dragCfg.onSlide=o.onSlide;}
this.isDraggable=true;dhe.each(function(){this.dragElem=el;});dhe.bind('mousedown',jQuery.iDrag.draginit);})}};jQuery.fn.extend({DraggableDestroy:jQuery.iDrag.destroy,Draggable:jQuery.iDrag.build});jQuery.iDrop={fit:function(zonex,zoney,zonew,zoneh)
{return zonex<=jQuery.iDrag.dragged.dragCfg.nx&&(zonex+zonew)>=(jQuery.iDrag.dragged.dragCfg.nx+jQuery.iDrag.dragged.dragCfg.oC.w)&&zoney<=jQuery.iDrag.dragged.dragCfg.ny&&(zoney+zoneh)>=(jQuery.iDrag.dragged.dragCfg.ny+jQuery.iDrag.dragged.dragCfg.oC.h)?true:false;},intersect:function(zonex,zoney,zonew,zoneh)
{return!(zonex>(jQuery.iDrag.dragged.dragCfg.nx+jQuery.iDrag.dragged.dragCfg.oC.w)||(zonex+zonew)<jQuery.iDrag.dragged.dragCfg.nx||zoney>(jQuery.iDrag.dragged.dragCfg.ny+jQuery.iDrag.dragged.dragCfg.oC.h)||(zoney+zoneh)<jQuery.iDrag.dragged.dragCfg.ny)?true:false;},pointer:function(zonex,zoney,zonew,zoneh)
{return zonex<jQuery.iDrag.dragged.dragCfg.currentPointer.x&&(zonex+zonew)>jQuery.iDrag.dragged.dragCfg.currentPointer.x&&zoney<jQuery.iDrag.dragged.dragCfg.currentPointer.y&&(zoney+zoneh)>jQuery.iDrag.dragged.dragCfg.currentPointer.y?true:false;},overzone:false,highlighted:{},count:0,zones:{},highlight:function(elm)
{if(jQuery.iDrag.dragged==null){return;}
var i;jQuery.iDrop.highlighted={};var oneIsSortable=false;for(i in jQuery.iDrop.zones){if(jQuery.iDrop.zones[i]!=null){var iEL=jQuery.iDrop.zones[i].get(0);if(jQuery(jQuery.iDrag.dragged).is('.'+iEL.dropCfg.a)){if(iEL.dropCfg.m==false){iEL.dropCfg.p=jQuery.extend(jQuery.iUtil.getPositionLite(iEL),jQuery.iUtil.getSizeLite(iEL));iEL.dropCfg.m=true;}
if(iEL.dropCfg.ac){jQuery.iDrop.zones[i].addClass(iEL.dropCfg.ac);}
jQuery.iDrop.highlighted[i]=jQuery.iDrop.zones[i];if(jQuery.iSort&&iEL.dropCfg.s&&jQuery.iDrag.dragged.dragCfg.so){iEL.dropCfg.el=jQuery('.'+iEL.dropCfg.a,iEL);elm.style.display='none';jQuery.iSort.measure(iEL);iEL.dropCfg.os=jQuery.iSort.serialize(jQuery.attr(iEL,'id')).hash;elm.style.display=elm.dragCfg.oD;oneIsSortable=true;}
if(iEL.dropCfg.onActivate){iEL.dropCfg.onActivate.apply(jQuery.iDrop.zones[i].get(0),[jQuery.iDrag.dragged]);}}}}
if(oneIsSortable){jQuery.iSort.start();}},remeasure:function()
{jQuery.iDrop.highlighted={};for(i in jQuery.iDrop.zones){if(jQuery.iDrop.zones[i]!=null){var iEL=jQuery.iDrop.zones[i].get(0);if(jQuery(jQuery.iDrag.dragged).is('.'+iEL.dropCfg.a)){iEL.dropCfg.p=jQuery.extend(jQuery.iUtil.getPositionLite(iEL),jQuery.iUtil.getSizeLite(iEL));if(iEL.dropCfg.ac){jQuery.iDrop.zones[i].addClass(iEL.dropCfg.ac);}
jQuery.iDrop.highlighted[i]=jQuery.iDrop.zones[i];if(jQuery.iSort&&iEL.dropCfg.s&&jQuery.iDrag.dragged.dragCfg.so){iEL.dropCfg.el=jQuery('.'+iEL.dropCfg.a,iEL);elm.style.display='none';jQuery.iSort.measure(iEL);elm.style.display=elm.dragCfg.oD;}}}}},checkhover:function(e)
{if(jQuery.iDrag.dragged==null){return;}
jQuery.iDrop.overzone=false;var i;var applyOnHover=false;var hlt=0;for(i in jQuery.iDrop.highlighted)
{var iEL=jQuery.iDrop.highlighted[i].get(0);if(jQuery.iDrop.overzone==false&&jQuery.iDrop[iEL.dropCfg.t](iEL.dropCfg.p.x,iEL.dropCfg.p.y,iEL.dropCfg.p.wb,iEL.dropCfg.p.hb)){if(iEL.dropCfg.hc&&iEL.dropCfg.h==false){jQuery.iDrop.highlighted[i].addClass(iEL.dropCfg.hc);}
if(iEL.dropCfg.h==false&&iEL.dropCfg.onHover){applyOnHover=true;}
iEL.dropCfg.h=true;jQuery.iDrop.overzone=iEL;if(jQuery.iSort&&iEL.dropCfg.s&&jQuery.iDrag.dragged.dragCfg.so){jQuery.iSort.helper.get(0).className=iEL.dropCfg.shc;jQuery.iSort.checkhover(iEL);}
hlt++;}else if(iEL.dropCfg.h==true){if(iEL.dropCfg.onOut){iEL.dropCfg.onOut.apply(iEL,[e,jQuery.iDrag.helper.get(0).firstChild,iEL.dropCfg.fx]);}
if(iEL.dropCfg.hc){jQuery.iDrop.highlighted[i].removeClass(iEL.dropCfg.hc);}
iEL.dropCfg.h=false;}}
if(jQuery.iSort&&!jQuery.iDrop.overzone&&jQuery.iDrag.dragged.so){jQuery.iSort.helper.get(0).style.display='none';}
if(applyOnHover){jQuery.iDrop.overzone.dropCfg.onHover.apply(jQuery.iDrop.overzone,[e,jQuery.iDrag.helper.get(0).firstChild]);}},checkdrop:function(e)
{var i;for(i in jQuery.iDrop.highlighted){var iEL=jQuery.iDrop.highlighted[i].get(0);if(iEL.dropCfg.ac){jQuery.iDrop.highlighted[i].removeClass(iEL.dropCfg.ac);}
if(iEL.dropCfg.hc){jQuery.iDrop.highlighted[i].removeClass(iEL.dropCfg.hc);}
if(iEL.dropCfg.s){jQuery.iSort.changed[jQuery.iSort.changed.length]=i;}
if(iEL.dropCfg.onDrop&&iEL.dropCfg.h==true){iEL.dropCfg.h=false;iEL.dropCfg.onDrop.apply(iEL,[e,iEL.dropCfg.fx]);}
iEL.dropCfg.m=false;iEL.dropCfg.h=false;}
jQuery.iDrop.highlighted={};},destroy:function()
{return this.each(function()
{if(this.isDroppable){if(this.dropCfg.s){id=jQuery.attr(this,'id');jQuery.iSort.collected[id]=null;jQuery('.'+this.dropCfg.a,this).DraggableDestroy();}
jQuery.iDrop.zones['d'+this.idsa]=null;this.isDroppable=false;this.f=null;}});},build:function(o)
{return this.each(function()
{if(this.isDroppable==true||!o.accept||!jQuery.iUtil||!jQuery.iDrag){return;}
this.dropCfg={a:o.accept,ac:o.activeclass||false,hc:o.hoverclass||false,shc:o.helperclass||false,onDrop:o.ondrop||o.onDrop||false,onHover:o.onHover||o.onhover||false,onOut:o.onOut||o.onout||false,onActivate:o.onActivate||false,t:o.tolerance&&(o.tolerance=='fit'||o.tolerance=='intersect')?o.tolerance:'pointer',fx:o.fx?o.fx:false,m:false,h:false};if(o.sortable==true&&jQuery.iSort){id=jQuery.attr(this,'id');jQuery.iSort.collected[id]=this.dropCfg.a;this.dropCfg.s=true;if(o.onChange){this.dropCfg.onChange=o.onChange;this.dropCfg.os=jQuery.iSort.serialize(id).hash;}}
this.isDroppable=true;this.idsa=parseInt(Math.random()*10000);jQuery.iDrop.zones['d'+this.idsa]=jQuery(this);jQuery.iDrop.count++;});}};jQuery.fn.extend({DroppableDestroy:jQuery.iDrop.destroy,Droppable:jQuery.iDrop.build});jQuery.recallDroppables=jQuery.iDrop.remeasure;jQuery.iSlider={tabindex:1,set:function(values)
{var values=values;return this.each(function()
{this.slideCfg.sliders.each(function(key)
{jQuery.iSlider.dragmoveBy(this,values[key]);});});},get:function()
{var values=[];this.each(function(slider)
{if(this.isSlider){values[slider]=[];var elm=this;var sizes=jQuery.iUtil.getSize(this);this.slideCfg.sliders.each(function(key)
{var x=this.offsetLeft;var y=this.offsetTop;xproc=parseInt(x*100/(sizes.w-this.offsetWidth));yproc=parseInt(y*100/(sizes.h-this.offsetHeight));values[slider][key]=[xproc||0,yproc||0,x||0,y||0];});}});return values;},modifyContainer:function(elm)
{elm.dragCfg.containerMaxx=elm.dragCfg.cont.w-elm.dragCfg.oC.wb;elm.dragCfg.containerMaxy=elm.dragCfg.cont.h-elm.dragCfg.oC.hb;if(elm.SliderContainer.slideCfg.restricted){next=elm.SliderContainer.slideCfg.sliders.get(elm.SliderIteration+1);if(next){elm.dragCfg.cont.w=(parseInt(jQuery(next).css('left'))||0)+elm.dragCfg.oC.wb;elm.dragCfg.cont.h=(parseInt(jQuery(next).css('top'))||0)+elm.dragCfg.oC.hb;}
prev=elm.SliderContainer.slideCfg.sliders.get(elm.SliderIteration-1);if(prev){var prevLeft=parseInt(jQuery(prev).css('left'))||0;var prevTop=parseInt(jQuery(prev).css('left'))||0;elm.dragCfg.cont.x+=prevLeft;elm.dragCfg.cont.y+=prevTop;elm.dragCfg.cont.w-=prevLeft;elm.dragCfg.cont.h-=prevTop;}}
elm.dragCfg.maxx=elm.dragCfg.cont.w-elm.dragCfg.oC.wb;elm.dragCfg.maxy=elm.dragCfg.cont.h-elm.dragCfg.oC.hb;if(elm.dragCfg.fractions){elm.dragCfg.gx=((elm.dragCfg.cont.w-elm.dragCfg.oC.wb)/elm.dragCfg.fractions)||1;elm.dragCfg.gy=((elm.dragCfg.cont.h-elm.dragCfg.oC.hb)/elm.dragCfg.fractions)||1;elm.dragCfg.fracW=elm.dragCfg.maxx/elm.dragCfg.fractions;elm.dragCfg.fracH=elm.dragCfg.maxy/elm.dragCfg.fractions;}
elm.dragCfg.cont.dx=elm.dragCfg.cont.x-elm.dragCfg.oR.x;elm.dragCfg.cont.dy=elm.dragCfg.cont.y-elm.dragCfg.oR.y;jQuery.iDrag.helper.css('cursor','default');},onSlide:function(elm,x,y)
{if(elm.dragCfg.fractions){xfrac=parseInt(x/elm.dragCfg.fracW);xproc=xfrac*100/elm.dragCfg.fractions;yfrac=parseInt(y/elm.dragCfg.fracH);yproc=yfrac*100/elm.dragCfg.fractions;}else{xproc=parseInt(x*100/elm.dragCfg.containerMaxx);yproc=parseInt(y*100/elm.dragCfg.containerMaxy);}
elm.dragCfg.lastSi=[xproc||0,yproc||0,x||0,y||0];if(elm.dragCfg.onSlide)
elm.dragCfg.onSlide.apply(elm,elm.dragCfg.lastSi);},dragmoveByKey:function(event)
{pressedKey=event.charCode||event.keyCode||-1;switch(pressedKey)
{case 35:jQuery.iSlider.dragmoveBy(this.dragElem,[2000,2000]);break;case 36:jQuery.iSlider.dragmoveBy(this.dragElem,[-2000,-2000]);break;case 37:jQuery.iSlider.dragmoveBy(this.dragElem,[-this.dragElem.dragCfg.gx||-1,0]);break;case 38:jQuery.iSlider.dragmoveBy(this.dragElem,[0,-this.dragElem.dragCfg.gy||-1]);break;case 39:jQuery.iSlider.dragmoveBy(this.dragElem,[this.dragElem.dragCfg.gx||1,0]);break;case 40:jQuery.iDrag.dragmoveBy(this.dragElem,[0,this.dragElem.dragCfg.gy||1]);break;}},dragmoveBy:function(elm,position)
{if(!elm.dragCfg){return;}
elm.dragCfg.oC=jQuery.extend(jQuery.iUtil.getPosition(elm),jQuery.iUtil.getSize(elm));elm.dragCfg.oR={x:parseInt(jQuery.css(elm,'left'))||0,y:parseInt(jQuery.css(elm,'top'))||0};elm.dragCfg.oP=jQuery.css(elm,'position');if(elm.dragCfg.oP!='relative'&&elm.dragCfg.oP!='absolute'){elm.style.position='relative';}
jQuery.iDrag.getContainment(elm);jQuery.iSlider.modifyContainer(elm);dx=parseInt(position[0])||0;dy=parseInt(position[1])||0;nx=elm.dragCfg.oR.x+dx;ny=elm.dragCfg.oR.y+dy;if(elm.dragCfg.fractions){newCoords=jQuery.iDrag.snapToGrid.apply(elm,[nx,ny,dx,dy]);if(newCoords.constructor==Object){dx=newCoords.dx;dy=newCoords.dy;}
nx=elm.dragCfg.oR.x+dx;ny=elm.dragCfg.oR.y+dy;}
newCoords=jQuery.iDrag.fitToContainer.apply(elm,[nx,ny,dx,dy]);if(newCoords&&newCoords.constructor==Object){dx=newCoords.dx;dy=newCoords.dy;}
nx=elm.dragCfg.oR.x+dx;ny=elm.dragCfg.oR.y+dy;if(elm.dragCfg.si&&(elm.dragCfg.onSlide||elm.dragCfg.onChange)){jQuery.iSlider.onSlide(elm,nx,ny);}
nx=!elm.dragCfg.axis||elm.dragCfg.axis=='horizontally'?nx:elm.dragCfg.oR.x||0;ny=!elm.dragCfg.axis||elm.dragCfg.axis=='vertically'?ny:elm.dragCfg.oR.y||0;elm.style.left=nx+'px';elm.style.top=ny+'px';},build:function(o){return this.each(function()
{if(this.isSlider==true||!o.accept||!jQuery.iUtil||!jQuery.iDrag||!jQuery.iDrop){return;}
toDrag=jQuery(o.accept,this);if(toDrag.size()==0){return;}
var params={containment:'parent',si:true,onSlide:o.onSlide&&o.onSlide.constructor==Function?o.onSlide:null,onChange:o.onChange&&o.onChange.constructor==Function?o.onChange:null,handle:this,opacity:o.opacity||false};if(o.fractions&&parseInt(o.fractions)){params.fractions=parseInt(o.fractions)||1;params.fractions=params.fractions>0?params.fractions:1;}
if(toDrag.size()==1)
toDrag.Draggable(params);else{jQuery(toDrag.get(0)).Draggable(params);params.handle=null;toDrag.Draggable(params);}
toDrag.keydown(jQuery.iSlider.dragmoveByKey);toDrag.attr('tabindex',jQuery.iSlider.tabindex++);this.isSlider=true;this.slideCfg={};this.slideCfg.onslide=params.onslide;this.slideCfg.fractions=params.fractions;this.slideCfg.sliders=toDrag;this.slideCfg.restricted=o.restricted?true:false;sliderEl=this;sliderEl.slideCfg.sliders.each(function(nr)
{this.SliderIteration=nr;this.SliderContainer=sliderEl;});if(o.values&&o.values.constructor==Array){for(i=o.values.length-1;i>=0;i--){if(o.values[i].constructor==Array&&o.values[i].length==2){el=this.slideCfg.sliders.get(i);if(el.tagName){jQuery.iSlider.dragmoveBy(el,o.values[i]);}}}}});}};jQuery.fn.extend({Slider:jQuery.iSlider.build,SliderSetValues:jQuery.iSlider.set,SliderGetValues:jQuery.iSlider.get});jQuery.iTooltip={current:null,focused:false,oldTitle:null,focus:function(e)
{jQuery.iTooltip.focused=true;jQuery.iTooltip.show(e,this,true);},hidefocused:function(e)
{if(jQuery.iTooltip.current!=this)
return;jQuery.iTooltip.focused=false;jQuery.iTooltip.hide(e,this);},show:function(e,el,focused)
{if(jQuery.iTooltip.current!=null)
return;if(!el){el=this;}
jQuery.iTooltip.current=el;pos=jQuery.extend(jQuery.iUtil.getPosition(el),jQuery.iUtil.getSize(el));jEl=jQuery(el);title=jEl.attr('title');href=jEl.attr('href');if(title){jQuery.iTooltip.oldTitle=title;jEl.attr('title','');jQuery('#tooltipTitle').html(title);if(href)
jQuery('#tooltipURL').html(href.replace('http://',''));else
jQuery('#tooltipURL').html('');helper=jQuery('#tooltipHelper');if(el.tooltipCFG.className){helper.get(0).className=el.tooltipCFG.className;}else{helper.get(0).className='';}
helperSize=jQuery.iUtil.getSize(helper.get(0));filteredPosition=focused&&el.tooltipCFG.position=='mouse'?'bottom':el.tooltipCFG.position;switch(filteredPosition){case'top':ny=pos.y-helperSize.hb;nx=pos.x;break;case'left':ny=pos.y;nx=pos.x-helperSize.wb;break;case'right':ny=pos.y;nx=pos.x+pos.wb;break;case'mouse':jQuery('body').bind('mousemove',jQuery.iTooltip.mousemove);pointer=jQuery.iUtil.getPointer(e);ny=pointer.y+15;nx=pointer.x+15;break;default:ny=pos.y+pos.hb;nx=pos.x;break;}
helper.css({top:ny+'px',left:nx+'px'});if(el.tooltipCFG.delay==false){helper.show();}else{helper.fadeIn(el.tooltipCFG.delay);}
if(el.tooltipCFG.onShow)
el.tooltipCFG.onShow.apply(el);jEl.bind('mouseout',jQuery.iTooltip.hide).bind('blur',jQuery.iTooltip.hidefocused);}},mousemove:function(e)
{if(jQuery.iTooltip.current==null){jQuery('body').unbind('mousemove',jQuery.iTooltip.mousemove);return;}
pointer=jQuery.iUtil.getPointer(e);jQuery('#tooltipHelper').css({top:pointer.y+15+'px',left:pointer.x+15+'px'});},hide:function(e,el)
{if(!el){el=this;}
if(jQuery.iTooltip.focused!=true&&jQuery.iTooltip.current==el){jQuery.iTooltip.current=null;jQuery('#tooltipHelper').fadeOut(1);jQuery(el).attr('title',jQuery.iTooltip.oldTitle).unbind('mouseout',jQuery.iTooltip.hide).unbind('blur',jQuery.iTooltip.hidefocused);if(el.tooltipCFG.onHide)
el.tooltipCFG.onHide.apply(el);jQuery.iTooltip.oldTitle=null;}},build:function(options)
{if(!jQuery.iTooltip.helper)
{jQuery('body').append('<div id="tooltipHelper"><div id="tooltipTitle"></div><div id="tooltipURL"></div></div>');jQuery('#tooltipHelper').css({position:'absolute',zIndex:3000,display:'none'});jQuery.iTooltip.helper=true;}
return this.each(function(){if(jQuery.attr(this,'title')){this.tooltipCFG={position:/top|bottom|left|right|mouse/.test(options.position)?options.position:'bottom',className:options.className?options.className:false,delay:options.delay?options.delay:false,onShow:options.onShow&&options.onShow.constructor==Function?options.onShow:false,onHide:options.onHide&&options.onHide.constructor==Function?options.onHide:false};var el=jQuery(this);el.bind('mouseover',jQuery.iTooltip.show);el.bind('focus',jQuery.iTooltip.focus);}});}};jQuery.fn.ToolTip=jQuery.iTooltip.build;jQuery.iSlider={tabindex:1,set:function(values)
{var values=values;return this.each(function()
{this.slideCfg.sliders.each(function(key)
{jQuery.iSlider.dragmoveBy(this,values[key]);});});},get:function()
{var values=[];this.each(function(slider)
{if(this.isSlider){values[slider]=[];var elm=this;var sizes=jQuery.iUtil.getSize(this);this.slideCfg.sliders.each(function(key)
{var x=this.offsetLeft;var y=this.offsetTop;xproc=parseInt(x*100/(sizes.w-this.offsetWidth));yproc=parseInt(y*100/(sizes.h-this.offsetHeight));values[slider][key]=[xproc||0,yproc||0,x||0,y||0];});}});return values;},modifyContainer:function(elm)
{elm.dragCfg.containerMaxx=elm.dragCfg.cont.w-elm.dragCfg.oC.wb;elm.dragCfg.containerMaxy=elm.dragCfg.cont.h-elm.dragCfg.oC.hb;if(elm.SliderContainer.slideCfg.restricted){next=elm.SliderContainer.slideCfg.sliders.get(elm.SliderIteration+1);if(next){elm.dragCfg.cont.w=(parseInt(jQuery(next).css('left'))||0)+elm.dragCfg.oC.wb;elm.dragCfg.cont.h=(parseInt(jQuery(next).css('top'))||0)+elm.dragCfg.oC.hb;}
prev=elm.SliderContainer.slideCfg.sliders.get(elm.SliderIteration-1);if(prev){var prevLeft=parseInt(jQuery(prev).css('left'))||0;var prevTop=parseInt(jQuery(prev).css('left'))||0;elm.dragCfg.cont.x+=prevLeft;elm.dragCfg.cont.y+=prevTop;elm.dragCfg.cont.w-=prevLeft;elm.dragCfg.cont.h-=prevTop;}}
elm.dragCfg.maxx=elm.dragCfg.cont.w-elm.dragCfg.oC.wb;elm.dragCfg.maxy=elm.dragCfg.cont.h-elm.dragCfg.oC.hb;if(elm.dragCfg.fractions){elm.dragCfg.gx=((elm.dragCfg.cont.w-elm.dragCfg.oC.wb)/elm.dragCfg.fractions)||1;elm.dragCfg.gy=((elm.dragCfg.cont.h-elm.dragCfg.oC.hb)/elm.dragCfg.fractions)||1;elm.dragCfg.fracW=elm.dragCfg.maxx/elm.dragCfg.fractions;elm.dragCfg.fracH=elm.dragCfg.maxy/elm.dragCfg.fractions;}
elm.dragCfg.cont.dx=elm.dragCfg.cont.x-elm.dragCfg.oR.x;elm.dragCfg.cont.dy=elm.dragCfg.cont.y-elm.dragCfg.oR.y;jQuery.iDrag.helper.css('cursor','default');},onSlide:function(elm,x,y)
{if(elm.dragCfg.fractions){xfrac=parseInt(x/elm.dragCfg.fracW);xproc=xfrac*100/elm.dragCfg.fractions;yfrac=parseInt(y/elm.dragCfg.fracH);yproc=yfrac*100/elm.dragCfg.fractions;}else{xproc=parseInt(x*100/elm.dragCfg.containerMaxx);yproc=parseInt(y*100/elm.dragCfg.containerMaxy);}
elm.dragCfg.lastSi=[xproc||0,yproc||0,x||0,y||0];if(elm.dragCfg.onSlide)
elm.dragCfg.onSlide.apply(elm,elm.dragCfg.lastSi);},dragmoveByKey:function(event)
{pressedKey=event.charCode||event.keyCode||-1;switch(pressedKey)
{case 35:jQuery.iSlider.dragmoveBy(this.dragElem,[2000,2000]);break;case 36:jQuery.iSlider.dragmoveBy(this.dragElem,[-2000,-2000]);break;case 37:jQuery.iSlider.dragmoveBy(this.dragElem,[-this.dragElem.dragCfg.gx||-1,0]);break;case 38:jQuery.iSlider.dragmoveBy(this.dragElem,[0,-this.dragElem.dragCfg.gy||-1]);break;case 39:jQuery.iSlider.dragmoveBy(this.dragElem,[this.dragElem.dragCfg.gx||1,0]);break;case 40:jQuery.iDrag.dragmoveBy(this.dragElem,[0,this.dragElem.dragCfg.gy||1]);break;}},dragmoveBy:function(elm,position)
{if(!elm.dragCfg){return;}
elm.dragCfg.oC=jQuery.extend(jQuery.iUtil.getPosition(elm),jQuery.iUtil.getSize(elm));elm.dragCfg.oR={x:parseInt(jQuery.css(elm,'left'))||0,y:parseInt(jQuery.css(elm,'top'))||0};elm.dragCfg.oP=jQuery.css(elm,'position');if(elm.dragCfg.oP!='relative'&&elm.dragCfg.oP!='absolute'){elm.style.position='relative';}
jQuery.iDrag.getContainment(elm);jQuery.iSlider.modifyContainer(elm);dx=parseInt(position[0])||0;dy=parseInt(position[1])||0;nx=elm.dragCfg.oR.x+dx;ny=elm.dragCfg.oR.y+dy;if(elm.dragCfg.fractions){newCoords=jQuery.iDrag.snapToGrid.apply(elm,[nx,ny,dx,dy]);if(newCoords.constructor==Object){dx=newCoords.dx;dy=newCoords.dy;}
nx=elm.dragCfg.oR.x+dx;ny=elm.dragCfg.oR.y+dy;}
newCoords=jQuery.iDrag.fitToContainer.apply(elm,[nx,ny,dx,dy]);if(newCoords&&newCoords.constructor==Object){dx=newCoords.dx;dy=newCoords.dy;}
nx=elm.dragCfg.oR.x+dx;ny=elm.dragCfg.oR.y+dy;if(elm.dragCfg.si&&(elm.dragCfg.onSlide||elm.dragCfg.onChange)){jQuery.iSlider.onSlide(elm,nx,ny);}
nx=!elm.dragCfg.axis||elm.dragCfg.axis=='horizontally'?nx:elm.dragCfg.oR.x||0;ny=!elm.dragCfg.axis||elm.dragCfg.axis=='vertically'?ny:elm.dragCfg.oR.y||0;elm.style.left=nx+'px';elm.style.top=ny+'px';},build:function(o){return this.each(function()
{if(this.isSlider==true||!o.accept||!jQuery.iUtil||!jQuery.iDrag||!jQuery.iDrop){return;}
toDrag=jQuery(o.accept,this);if(toDrag.size()==0){return;}
var params={containment:'parent',si:true,onSlide:o.onSlide&&o.onSlide.constructor==Function?o.onSlide:null,onChange:o.onChange&&o.onChange.constructor==Function?o.onChange:null,handle:this,opacity:o.opacity||false};if(o.fractions&&parseInt(o.fractions)){params.fractions=parseInt(o.fractions)||1;params.fractions=params.fractions>0?params.fractions:1;}
if(toDrag.size()==1)
toDrag.Draggable(params);else{jQuery(toDrag.get(0)).Draggable(params);params.handle=null;toDrag.Draggable(params);}
toDrag.keydown(jQuery.iSlider.dragmoveByKey);toDrag.attr('tabindex',jQuery.iSlider.tabindex++);this.isSlider=true;this.slideCfg={};this.slideCfg.onslide=params.onslide;this.slideCfg.fractions=params.fractions;this.slideCfg.sliders=toDrag;this.slideCfg.restricted=o.restricted?true:false;sliderEl=this;sliderEl.slideCfg.sliders.each(function(nr)
{this.SliderIteration=nr;this.SliderContainer=sliderEl;});if(o.values&&o.values.constructor==Array){for(i=o.values.length-1;i>=0;i--){if(o.values[i].constructor==Array&&o.values[i].length==2){el=this.slideCfg.sliders.get(i);if(el.tagName){jQuery.iSlider.dragmoveBy(el,o.values[i]);}}}}});}};jQuery.fn.extend({Slider:jQuery.iSlider.build,SliderSetValues:jQuery.iSlider.set,SliderGetValues:jQuery.iSlider.get});jQuery.fxCheckTag=function(e)
{if(/^tr$|^td$|^tbody$|^caption$|^thead$|^tfoot$|^col$|^colgroup$|^th$|^body$|^header$|^script$|^frame$|^frameset$|^option$|^optgroup$|^meta$/i.test(e.nodeName))
return false;else
return true;};jQuery.fx.destroyWrapper=function(e,old)
{var c=e.firstChild;var cs=c.style;cs.position=old.position;cs.marginTop=old.margins.t;cs.marginLeft=old.margins.l;cs.marginBottom=old.margins.b;cs.marginRight=old.margins.r;cs.top=old.top+'px';cs.left=old.left+'px';e.parentNode.insertBefore(c,e);e.parentNode.removeChild(e);};jQuery.fx.buildWrapper=function(e)
{if(!jQuery.fxCheckTag(e))
return false;var t=jQuery(e);var es=e.style;var restoreStyle=false;if(t.css('display')=='none'){oldVisibility=t.css('visibility');t.css('visibility','hidden').show();restoreStyle=true;}
var oldStyle={};oldStyle.position=t.css('position');oldStyle.sizes=jQuery.iUtil.getSize(e);oldStyle.margins=jQuery.iUtil.getMargins(e);var oldFloat=e.currentStyle?e.currentStyle.styleFloat:t.css('float');oldStyle.top=parseInt(t.css('top'))||0;oldStyle.left=parseInt(t.css('left'))||0;var wid='w_'+parseInt(Math.random()*10000);var wr=document.createElement(/^img$|^br$|^input$|^hr$|^select$|^textarea$|^object$|^iframe$|^button$|^form$|^table$|^ul$|^dl$|^ol$/i.test(e.nodeName)?'div':e.nodeName);jQuery.attr(wr,'id',wid);var wrapEl=jQuery(wr).addClass('fxWrapper');var wrs=wr.style;var top=0;var left=0;if(oldStyle.position=='relative'||oldStyle.position=='absolute'){top=oldStyle.top;left=oldStyle.left;}
wrs.top=top+'px';wrs.left=left+'px';wrs.position=oldStyle.position!='relative'&&oldStyle.position!='absolute'?'relative':oldStyle.position;wrs.height=oldStyle.sizes.hb+'px';wrs.width=oldStyle.sizes.wb+'px';wrs.marginTop=oldStyle.margins.t;wrs.marginRight=oldStyle.margins.r;wrs.marginBottom=oldStyle.margins.b;wrs.marginLeft=oldStyle.margins.l;wrs.overflow='hidden';if(jQuery.browser.msie){wrs.styleFloat=oldFloat;}else{wrs.cssFloat=oldFloat;}
if(jQuery.browser=="msie"){es.filter="alpha(opacity="+0.999*100+")";}
es.opacity=0.999;e.parentNode.insertBefore(wr,e);wr.appendChild(e);es.marginTop='0px';es.marginRight='0px';es.marginBottom='0px';es.marginLeft='0px';es.position='absolute';es.listStyle='none';es.top='0px';es.left='0px';if(restoreStyle){t.hide();es.visibility=oldVisibility;}
return{oldStyle:oldStyle,wrapper:jQuery(wr)};};jQuery.fx.namedColors={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]};jQuery.fx.parseColor=function(color,notColor)
{if(jQuery.fx.namedColors[color])
return{r:jQuery.fx.namedColors[color][0],g:jQuery.fx.namedColors[color][1],b:jQuery.fx.namedColors[color][2]};else if(result=/^rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)$/.exec(color))
return{r:parseInt(result[1]),g:parseInt(result[2]),b:parseInt(result[3])};else if(result=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)$/.exec(color))
return{r:parseFloat(result[1])*2.55,g:parseFloat(result[2])*2.55,b:parseFloat(result[3])*2.55};else if(result=/^#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])$/.exec(color))
return{r:parseInt("0x"+result[1]+result[1]),g:parseInt("0x"+result[2]+result[2]),b:parseInt("0x"+result[3]+result[3])};else if(result=/^#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})$/.exec(color))
return{r:parseInt("0x"+result[1]),g:parseInt("0x"+result[2]),b:parseInt("0x"+result[3])};else
return notColor==true?false:{r:255,g:255,b:255};};jQuery.fx.cssProps={borderBottomWidth:1,borderLeftWidth:1,borderRightWidth:1,borderTopWidth:1,bottom:1,fontSize:1,height:1,left:1,letterSpacing:1,lineHeight:1,marginBottom:1,marginLeft:1,marginRight:1,marginTop:1,maxHeight:1,maxWidth:1,minHeight:1,minWidth:1,opacity:1,outlineOffset:1,outlineWidth:1,paddingBottom:1,paddingLeft:1,paddingRight:1,paddingTop:1,right:1,textIndent:1,top:1,width:1,zIndex:1};jQuery.fx.colorCssProps={backgroundColor:1,borderBottomColor:1,borderLeftColor:1,borderRightColor:1,borderTopColor:1,color:1,outlineColor:1};jQuery.fx.cssSides=['Top','Right','Bottom','Left'];jQuery.fx.cssSidesEnd={'borderWidth':['border','Width'],'borderColor':['border','Color'],'margin':['margin',''],'padding':['padding','']};jQuery.fn.extend({animate:function(prop,speed,easing,callback){return this.queue(function(){var opt=jQuery.speed(speed,easing,callback);var e=new jQuery.fxe(this,opt,prop);});},pause:function(speed,callback){return this.queue(function(){var opt=jQuery.speed(speed,callback);var e=new jQuery.pause(this,opt);});},stop:function(step){return this.each(function(){if(this.animationHandler)
jQuery.stopAnim(this,step);});},stopAll:function(step){return this.each(function(){if(this.animationHandler)
jQuery.stopAnim(this,step);if(this.queue&&this.queue['fx'])
this.queue.fx=[];});}});jQuery.extend({pause:function(elem,options)
{var z=this,values;z.step=function()
{if(jQuery.isFunction(options.complete))
options.complete.apply(elem);};z.timer=setInterval(function(){z.step();},options.duration);elem.animationHandler=z;},easing:{linear:function(p,n,firstNum,delta,duration){return((-Math.cos(p*Math.PI)/2)+0.5)*delta+firstNum;}},fxe:function(elem,options,prop){var z=this,values;var y=elem.style;var oldOverflow=jQuery.css(elem,"overflow");var oldDisplay=jQuery.css(elem,"display");var props={};z.startTime=(new Date()).getTime();options.easing=options.easing&&jQuery.easing[options.easing]?options.easing:'linear';z.getValues=function(tp,vp)
{if(jQuery.fx.cssProps[tp]){if(vp=='show'||vp=='hide'||vp=='toggle'){if(!elem.orig)elem.orig={};var r=parseFloat(jQuery.curCSS(elem,tp));elem.orig[tp]=r&&r>-10000?r:(parseFloat(jQuery.css(elem,tp))||0);vp=vp=='toggle'?(oldDisplay=='none'?'show':'hide'):vp;options[vp]=true;props[tp]=vp=='show'?[0,elem.orig[tp]]:[elem.orig[tp],0];if(tp!='opacity')
y[tp]=props[tp][0]+(tp!='zIndex'&&tp!='fontWeight'?'px':'');else
jQuery.attr(y,"opacity",props[tp][0]);}else{props[tp]=[parseFloat(jQuery.curCSS(elem,tp)),parseFloat(vp)||0];}}else if(jQuery.fx.colorCssProps[tp])
props[tp]=[jQuery.fx.parseColor(jQuery.curCSS(elem,tp)),jQuery.fx.parseColor(vp)];else if(/^margin$|padding$|border$|borderColor$|borderWidth$/i.test(tp)){var m=vp.replace(/\s+/g,' ').replace(/rgb\s*\(\s*/g,'rgb(').replace(/\s*,\s*/g,',').replace(/\s*\)/g,')').match(/([^\s]+)/g);switch(tp){case'margin':case'padding':case'borderWidth':case'borderColor':m[3]=m[3]||m[1]||m[0];m[2]=m[2]||m[0];m[1]=m[1]||m[0];for(var i=0;i<jQuery.fx.cssSides.length;i++){var nmp=jQuery.fx.cssSidesEnd[tp][0]+jQuery.fx.cssSides[i]+jQuery.fx.cssSidesEnd[tp][1];props[nmp]=tp=='borderColor'?[jQuery.fx.parseColor(jQuery.curCSS(elem,nmp)),jQuery.fx.parseColor(m[i])]:[parseFloat(jQuery.curCSS(elem,nmp)),parseFloat(m[i])];}
break;case'border':for(var i=0;i<m.length;i++){var floatVal=parseFloat(m[i]);var sideEnd=!isNaN(floatVal)?'Width':(!/transparent|none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset/i.test(m[i])?'Color':false);if(sideEnd){for(var j=0;j<jQuery.fx.cssSides.length;j++){nmp='border'+jQuery.fx.cssSides[j]+sideEnd;props[nmp]=sideEnd=='Color'?[jQuery.fx.parseColor(jQuery.curCSS(elem,nmp)),jQuery.fx.parseColor(m[i])]:[parseFloat(jQuery.curCSS(elem,nmp)),floatVal];}}else{y['borderStyle']=m[i];}}
break;}}else{y[tp]=vp;}
return false;};for(p in prop){if(p=='style'){var newStyles=jQuery.parseStyle(prop[p]);for(np in newStyles){this.getValues(np,newStyles[np]);}}else if(p=='className'){if(document.styleSheets)
for(var i=0;i<document.styleSheets.length;i++){var cssRules=document.styleSheets[i].cssRules||document.styleSheets[i].rules||null;if(cssRules){for(var j=0;j<cssRules.length;j++){if(cssRules[j].selectorText=='.'+prop[p]){var rule=new RegExp('\.'+prop[p]+' {');var styles=cssRules[j].style.cssText;var newStyles=jQuery.parseStyle(styles.replace(rule,'').replace(/}/g,''));for(np in newStyles){this.getValues(np,newStyles[np]);}}}}}}else{this.getValues(p,prop[p]);}}
y.display=oldDisplay=='none'?'block':oldDisplay;y.overflow='hidden';z.step=function(){var t=(new Date()).getTime();if(t>options.duration+z.startTime){clearInterval(z.timer);z.timer=null;for(p in props){if(p=="opacity")
jQuery.attr(y,"opacity",props[p][1]);else if(typeof props[p][1]=='object')
y[p]='rgb('+props[p][1].r+','+props[p][1].g+','+props[p][1].b+')';else
y[p]=props[p][1]+(p!='zIndex'&&p!='fontWeight'?'px':'');}
if(options.hide||options.show)
for(var p in elem.orig)
if(p=="opacity")
jQuery.attr(y,p,elem.orig[p]);else
y[p]="";y.display=options.hide?'none':(oldDisplay!='none'?oldDisplay:'block');y.overflow=oldOverflow;elem.animationHandler=null;if(jQuery.isFunction(options.complete))
options.complete.apply(elem);}else{var n=t-this.startTime;var pr=n/options.duration;for(p in props){if(typeof props[p][1]=='object'){y[p]='rgb('
+parseInt(jQuery.easing[options.easing](pr,n,props[p][0].r,(props[p][1].r-props[p][0].r),options.duration))
+','
+parseInt(jQuery.easing[options.easing](pr,n,props[p][0].g,(props[p][1].g-props[p][0].g),options.duration))
+','
+parseInt(jQuery.easing[options.easing](pr,n,props[p][0].b,(props[p][1].b-props[p][0].b),options.duration))
+')';}else{var pValue=jQuery.easing[options.easing](pr,n,props[p][0],(props[p][1]-props[p][0]),options.duration);if(p=="opacity")
jQuery.attr(y,"opacity",pValue);else
y[p]=pValue+(p!='zIndex'&&p!='fontWeight'?'px':'');}}}};z.timer=setInterval(function(){z.step();},13);elem.animationHandler=z;},stopAnim:function(elem,step)
{if(step)
elem.animationHandler.startTime-=100000000;else{window.clearInterval(elem.animationHandler.timer);elem.animationHandler=null;jQuery.dequeue(elem,"fx");}}});jQuery.parseStyle=function(styles){var newStyles={};if(typeof styles=='string'){styles=styles.toLowerCase().split(';');for(var i=0;i<styles.length;i++){rule=styles[i].split(':');if(rule.length==2){newStyles[jQuery.trim(rule[0].replace(/\-(\w)/g,function(m,c){return c.toUpperCase();}))]=jQuery.trim(rule[1]);}}}
return newStyles;};jQuery.fn.Highlight=function(speed,color,callback,easing){return this.queue('interfaceColorFX',function()
{this.oldStyleAttr=jQuery(this).attr("style")||'';easing=typeof callback=='string'?callback:easing||null;callback=typeof callback=='function'?callback:null;var oldColor=jQuery(this).css('backgroundColor');var parentEl=this.parentNode;while(oldColor=='transparent'&&parentEl){oldColor=jQuery(parentEl).css('backgroundColor');parentEl=parentEl.parentNode;}
jQuery(this).css('backgroundColor',color);if(typeof this.oldStyleAttr=='object')this.oldStyleAttr=this.oldStyleAttr["cssText"];jQuery(this).animate({'backgroundColor':oldColor},speed,easing,function(){jQuery.dequeue(this,'interfaceColorFX');if(typeof jQuery(this).attr("style")=='object'){jQuery(this).attr("style")["cssText"]="";jQuery(this).attr("style")["cssText"]=this.oldStyleAttr;}else{jQuery(this).attr("style",this.oldStyleAttr);}
if(callback)
callback.apply(this);});});};jQuery.fn.extend({SlideInUp:function(speed,callback,easing)
{return this.queue('interfaceFX',function(){new jQuery.fx.slide(this,speed,callback,'up','in',easing);});},SlideOutUp:function(speed,callback,easing)
{return this.queue('interfaceFX',function(){new jQuery.fx.slide(this,speed,callback,'up','out',easing);});},SlideToggleUp:function(speed,callback,easing)
{return this.queue('interfaceFX',function(){new jQuery.fx.slide(this,speed,callback,'up','toggle',easing);});},SlideInDown:function(speed,callback,easing)
{return this.queue('interfaceFX',function(){new jQuery.fx.slide(this,speed,callback,'down','in',easing);});},SlideOutDown:function(speed,callback,easing)
{return this.queue('interfaceFX',function(){new jQuery.fx.slide(this,speed,callback,'down','out',easing);});},SlideToggleDown:function(speed,callback,easing)
{return this.queue('interfaceFX',function(){new jQuery.fx.slide(this,speed,callback,'down','toggle',easing);});},SlideInLeft:function(speed,callback,easing)
{return this.queue('interfaceFX',function(){new jQuery.fx.slide(this,speed,callback,'left','in',easing);});},SlideOutLeft:function(speed,callback,easing)
{return this.queue('interfaceFX',function(){new jQuery.fx.slide(this,speed,callback,'left','out',easing);});},SlideToggleLeft:function(speed,callback,easing)
{return this.queue('interfaceFX',function(){new jQuery.fx.slide(this,speed,callback,'left','toggle',easing);});},SlideInRight:function(speed,callback,easing)
{return this.queue('interfaceFX',function(){new jQuery.fx.slide(this,speed,callback,'right','in',easing);});},SlideOutRight:function(speed,callback,easing)
{return this.queue('interfaceFX',function(){new jQuery.fx.slide(this,speed,callback,'right','out',easing);});},SlideToggleRight:function(speed,callback,easing)
{return this.queue('interfaceFX',function(){new jQuery.fx.slide(this,speed,callback,'right','toggle',easing);});}});jQuery.fx.slide=function(e,speed,callback,direction,type,easing)
{if(!jQuery.fxCheckTag(e)){jQuery.dequeue(e,'interfaceFX');return false;}
var z=this;z.el=jQuery(e);z.easing=typeof callback=='string'?callback:easing||null;z.callback=typeof callback=='function'?callback:null;if(type=='toggle'){type=z.el.css('display')=='none'?'in':'out';}
if(!e.ifxFirstDisplay)
e.ifxFirstDisplay=z.el.css('display');z.el.show();z.speed=speed;z.fx=jQuery.fx.buildWrapper(e);z.type=type;z.direction=direction;z.complete=function()
{if(z.type=='out')
z.el.css('visibility','hidden');jQuery.fx.destroyWrapper(z.fx.wrapper.get(0),z.fx.oldStyle);if(z.type=='in'){z.el.css('display',z.el.get(0).ifxFirstDisplay=='none'?'block':z.el.get(0).ifxFirstDisplay);}else{z.el.css('display','none');z.el.css('visibility','visible');}
if(z.callback&&z.callback.constructor==Function){z.callback.apply(z.el.get(0));}
jQuery.dequeue(z.el.get(0),'interfaceFX');};switch(z.direction){case'up':z.ef=new jQuery.fx(z.el.get(0),jQuery.speed(z.speed,z.easing,z.complete),'top');z.efx=new jQuery.fx(z.fx.wrapper.get(0),jQuery.speed(z.speed,z.easing),'height');if(z.type=='in'){z.ef.custom(-z.fx.oldStyle.sizes.hb,0);z.efx.custom(0,z.fx.oldStyle.sizes.hb);}else{z.ef.custom(0,-z.fx.oldStyle.sizes.hb);z.efx.custom(z.fx.oldStyle.sizes.hb,0);}
break;case'down':z.ef=new jQuery.fx(z.el.get(0),jQuery.speed(z.speed,z.easing,z.complete),'top');if(z.type=='in'){z.ef.custom(z.fx.oldStyle.sizes.hb,0);}else{z.ef.custom(0,z.fx.oldStyle.sizes.hb);}
break;case'left':z.ef=new jQuery.fx(z.el.get(0),jQuery.speed(z.speed,z.easing,z.complete),'left');z.efx=new jQuery.fx(z.fx.wrapper.get(0),jQuery.speed(z.speed,z.easing),'width');if(z.type=='in'){z.ef.custom(-z.fx.oldStyle.sizes.wb,0);z.efx.custom(0,z.fx.oldStyle.sizes.wb);}else{z.ef.custom(0,-z.fx.oldStyle.sizes.wb);z.efx.custom(z.fx.oldStyle.sizes.wb,0);}
break;case'right':z.ef=new jQuery.fx(z.el.get(0),jQuery.speed(z.speed,z.easing,z.complete),'left');if(z.type=='in'){z.ef.custom(z.fx.oldStyle.sizes.wb,0);}else{z.ef.custom(0,z.fx.oldStyle.sizes.wb);}
break;}};jQuery.transferHelper=null;jQuery.fn.TransferTo=function(o)
{return this.queue('interfaceFX',function(){new jQuery.fx.itransferTo(this,o);});};jQuery.fx.itransferTo=function(e,o)
{if(jQuery.transferHelper==null)
{jQuery('body',document).append('<div id="transferHelper"></div>');jQuery.transferHelper=jQuery('#transferHelper');}
jQuery.transferHelper.css('display','block').css('position','absolute');var z=this;z.el=jQuery(e);if(!o||!o.to){return;}
if(o.to.constructor==String&&document.getElementById(o.to)){o.to=document.getElementById(o.to);}else if(!o.to.childNodes){return;}
if(!o.duration){o.duration=500;}
z.duration=o.duration;z.to=o.to;z.classname=o.className;z.complete=o.complete;if(z.classname){jQuery.transferHelper.addClass(z.classname);}
z.diffWidth=0;z.diffHeight=0;if(jQuery.boxModel){z.diffWidth=(parseInt(jQuery.transferHelper.css('borderLeftWidth'))||0)
+(parseInt(jQuery.transferHelper.css('borderRightWidth'))||0)
+(parseInt(jQuery.transferHelper.css('paddingLeft'))||0)
+(parseInt(jQuery.transferHelper.css('paddingRight'))||0);z.diffHeight=(parseInt(jQuery.transferHelper.css('borderTopWidth'))||0)
+(parseInt(jQuery.transferHelper.css('borderBottomWidth'))||0)
+(parseInt(jQuery.transferHelper.css('paddingTop'))||0)
+(parseInt(jQuery.transferHelper.css('paddingBottom'))||0);}
z.start=jQuery.extend(jQuery.iUtil.getPosition(z.el.get(0)),jQuery.iUtil.getSize(z.el.get(0)));z.end=jQuery.extend(jQuery.iUtil.getPosition(z.to),jQuery.iUtil.getSize(z.to));z.start.wb-=z.diffWidth;z.start.hb-=z.diffHeight;z.end.wb-=z.diffWidth;z.end.hb-=z.diffHeight;z.callback=o.complete;jQuery.transferHelper.css('width',z.start.wb+'px').css('height',z.start.hb+'px').css('top',z.start.y+'px').css('left',z.start.x+'px').animate({top:z.end.y,left:z.end.x,width:z.end.wb,height:z.end.hb},z.duration,function()
{if(z.classname)
jQuery.transferHelper.removeClass(z.classname);jQuery.transferHelper.css('display','none');if(z.complete&&z.complete.constructor==Function){z.complete.apply(z.el.get(0),[z.to]);}
jQuery.dequeue(z.el.get(0),'interfaceFX');});};jQuery.iExpander={helper:null,expand:function()
{text=this.value;if(!text)
return;style={fontFamily:jQuery(this).css('fontFamily')||'',fontSize:jQuery(this).css('fontSize')||'',fontWeight:jQuery(this).css('fontWeight')||'',fontStyle:jQuery(this).css('fontStyle')||'',fontStretch:jQuery(this).css('fontStretch')||'',fontVariant:jQuery(this).css('fontVariant')||'',letterSpacing:jQuery(this).css('letterSpacing')||'',wordSpacing:jQuery(this).css('wordSpacing')||''};jQuery.iExpander.helper.css(style);html=jQuery.iExpander.htmlEntities(text);html=html.replace(new RegExp("\\n","g"),"<br />");jQuery.iExpander.helper.html('pW');spacer=jQuery.iExpander.helper.get(0).offsetWidth;jQuery.iExpander.helper.html(html);width=jQuery.iExpander.helper.get(0).offsetWidth+spacer;if(this.Expander.limit&&width>this.Expander.limit[0]){width=this.Expander.limit[0];}
this.style.width=width+'px';if(this.tagName=='TEXTAREA'){height=jQuery.iExpander.helper.get(0).offsetHeight+spacer;if(this.Expander.limit&&height>this.Expander.limit[1]){height=this.Expander.limit[1];}
this.style.height=height+'px';}},htmlEntities:function(text)
{entities={'&':'&amp;','<':'&lt;','>':'&gt;','"':'&quot;'};for(i in entities){text=text.replace(new RegExp(i,'g'),entities[i]);}
return text;},build:function(limit)
{if(jQuery.iExpander.helper==null){jQuery('body',document).append('<div id="expanderHelper" style="position: absolute; top: 0; left: 0; visibility: hidden;"></div>');jQuery.iExpander.helper=jQuery('#expanderHelper');}
return this.each(function()
{if(/TEXTAREA|INPUT/.test(this.tagName)){if(this.tagName=='INPUT'){elType=this.getAttribute('type');if(!/text|password/.test(elType)){return;}}
if(limit&&(limit.constructor==Number||(limit.constructor==Array&&limit.length==2))){if(limit.constructor==Number)
limit=[limit,limit];else{limit[0]=parseInt(limit[0])||400;limit[1]=parseInt(limit[1])||400;}
this.Expander={limit:limit};}
jQuery(this).blur(jQuery.iExpander.expand).keyup(jQuery.iExpander.expand).keypress(jQuery.iExpander.expand);jQuery.iExpander.expand.apply(this);}});}};jQuery.fn.Autoexpand=jQuery.iExpander.build;


/**** AssetPackerHelper::process()  json.js  ****/


(function($){var m={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},s={'array':function(x){var a=['['],b,f,i,l=x.length,v;for(i=0;i<l;i+=1){v=x[i];f=s[typeof v];if(f){v=f(v);if(typeof v=='string'){if(b){a[a.length]=',';}
a[a.length]=v;b=true;}}}
a[a.length]=']';return a.join('');},'boolean':function(x){return String(x);},'null':function(x){return"null";},'number':function(x){return isFinite(x)?String(x):'null';},'object':function(x){if(x){if(x instanceof Array){return s.array(x);}
var a=['{'],b,f,i,v;for(i in x){v=x[i];f=s[typeof v];if(f){v=f(v);if(typeof v=='string'){if(b){a[a.length]=',';}
a.push(s.string(i),':',v);b=true;}}}
a[a.length]='}';return a.join('');}
return'null';},'string':function(x){if(/["\\\x00-\x1f]/.test(x)){x=x.replace(/([\x00-\x1f\\"])/g,function(a,b){var c=m[b];if(c){return c;}
c=b.charCodeAt();return'\\u00'+
Math.floor(c/16).toString(16)+
(c%16).toString(16);});}
return'"'+x+'"';}};$.toJSON=function(v){if(window.JSON&&window.JSON.stringify)return JSON.stringify(v);var f=isNaN(v)?s[typeof v]:s['number'];if(f)return f(v);};$.parseJSON=function(v,safe){if(window.JSON&&window.JSON.parse)return JSON.parse(v);if(safe===undefined)safe=$.parseJSON.safe;if(safe&&!/^("(\\.|[^"\\\n\r])*?"|[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t])+?$/.test(v))
return undefined;return eval('('+v+')');};$.parseJSON.safe=false;})(jQuery);


/**** AssetPackerHelper::process()  core.js  ****/


if(!window.tbt){tbt=window.tbt={};}
tbt.emailRegex=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;tbt.userNameRegex=/^([a-zA-Z0-9 -]{3,20})+$/;jQuery.browser.msie6=(jQuery.browser.msie&&jQuery.browser.version.substr(0,1)=='6');var setTextAreaHeightTimeout=null;function dump(arr,level){var dumped_text="";if(!level)level=0;var level_padding="";for(var j=0;j<level+1;j++)level_padding+="    ";if(typeof(arr)=='object'){for(var item in arr){var value=arr[item];if(typeof(value)=='object'){dumped_text+=level_padding+"'"+item+"' ...\n";dumped_text+=dump(value,level+1);}else{dumped_text+=level_padding+"'"+item+"' => \""+value+"\"\n";}}}else{dumped_text="===>"+arr+"<===("+typeof(arr)+")";}
return dumped_text;}
function isLoggedIn(){var loggedin=($('#loggedin').val()=='1')?1:0;return loggedin;}
function loadContentsToDiv(layername,url,params,loadIndicatorLayerName){if($('#'+layername)){$.post(url,params,function(result){if(!isEmpty(result)){$('#'+layername).html(result);if(loadIndicatorLayerName){$('#'+loadIndicatorLayerName).fadeOut();}}});}else{}}
function userConfirm(url,message){$.post('/ajax/pages/confirm/',{url:url,message:message},function(html){showOverlay(html);$('#overlay-body').html(content);});}
function escape_utf8(data){if(data==''||data==null)return'';data=data.toString();var buffer='';var chars='0123456789ABCDEF';for(var i=0;i<data.length;i++){var c=data.charCodeAt(i);var bs=new Array();if(c>0x10000){bs[0]=0xF0|((c&0x1C0000)>>>18);bs[1]=0x80|((c&0x3F000)>>>12);bs[2]=0x80|((c&0xFC0)>>>6);bs[3]=0x80|(c&0x3F);}else if(c>0x800){bs[0]=0xE0|((c&0xF000)>>>12);bs[1]=0x80|((c&0xFC0)>>>6);bs[2]=0x80|(c&0x3F);}else if(c>0x80){bs[0]=0xC0|((c&0x7C0)>>>6);bs[1]=0x80|(c&0x3f);}else{bs[0]=c;}
if(bs.length>1){for(var j=0;j<bs.length;j++){var b=bs[j];var hex=chars.charAt((b&0xF0)>>>4)+chars.charAt(b&0x0F);buffer+='%'+hex;}}else{buffer+=data.charAt(i);}}
return buffer;}
function createNewFormValidator(formId,params){doNotSubmitForm=false;var validatorName='validator'+formId;window[validatorName]=$('#'+formId).observing_validator({call_on_failure:function(input){$(input).parent().parent().addClass('form-error');$(input).parent().find('.error-message').show();},call_on_success:function(input){$(input).parent().parent().removeClass('form-error');$(input).parent().find('.error-message').hide();},on_errors:function(errors,inputs){$('#form-error-total-'+formId).show();},on_success:function(){$('#form-error-total-'+formId).hide();}},params);$('#'+formId).submit(function(){if(doNotSubmitForm){return false;}
return window[validatorName].check_fields(params);});return window[validatorName];}
function isEmpty(string){if(string=='')return true;if(string==undefined)return true;if(typeof(string)=='number')return(string!==0);return string.match(/^$/,string);}
function setPermanetLoginCookie(value){$.cookie('ruhrundercover',value,{expires:365,path:'/',domain:'ruhrundercover.de',secure:true});}
function getPermanetLoginCookie(){$.cookie('ruhrundercover');}
function delPermanetLoginCookie(){$.cookie('ruhrundercover','',{expires:-1});}
function doLogin(referer){if(referer=='//')
referer='/';var user_name=$('#username').val();var user_password=$('#userpassword').val();var permanent_login=1;$.ajax({type:"POST",url:"/users/login/",dataType:'html',data:"data[User][name]="+user_name+"&data[User][pw]="+user_password+"&data[axj]=1&data[User][permanentlogin]="+permanent_login,success:function(response){window.location.href=referer;},error:function(response){alert('Fehler beim Login');}});}
function doLoginOverlay(_referer,_from){$('#login-error-wrapper').css('color','#63432a');$('#login-error-wrapper h2').css('color','#63432a');$('#login-error-wrapper').css('background-color','#DAF4FA');$('#login-error-wrapper .login-do div a').css('color','#4B92DB');$('#login-error-msg:visible').animate({opacity:'toggle',height:'toggle'},'slow');sendReceiveAction('send','login-do');var postData='';var showFlashBox='';if(_referer=='//')
_referer='/';var user_name=$('#username-ov').val();var user_password=$('#userpassword-ov').val();var permanent_login=$('#permanent-login-ov').val();switch(_from){case'likeit':var messageText='Dein Tipp wurde gespeichert.';showFlashBox="&data[showFlashBox][text]="+messageText+"&data[showFlashBox][type]=OK";break;case'addtrip':var messageText='Dein Trip wurde gespeichert.';showFlashBox="&data[showFlashBox][text]="+messageText+"&data[showFlashBox][type]=OK";break;case'usertarget':var messageText='Deine Angaben wurden gespeichert.';showFlashBox="&data[showFlashBox][text]="+messageText+"&data[showFlashBox][type]=OK";break;case'comment':var messageText='Dein Kommentar wurde gespeichert.';showFlashBox="&data[showFlashBox][text]="+messageText+"&data[showFlashBox][type]=OK";break;case'answer':var messageText='Deine Antwort wurde gespeichert.';showFlashBox="&data[showFlashBox][text]="+messageText+"&data[showFlashBox][type]=OK";break;case'question':var messageText='Deine Frage wurde gespeichert.';showFlashBox="&data[showFlashBox][text]="+messageText+"&data[showFlashBox][type]=OK";break;}
postData+="data[User][name]="+user_name;postData+="&data[User][pw]="+user_password;postData+="&data[User][permanentlogin]="+permanent_login;postData+=showFlashBox;$.ajax({type:"POST",url:"/registrieren/loginPlain/",dataType:'json',contentType:'application/x-www-form-urlencoded; charset=utf-8',data:postData,success:function(json){if(json.status==0){if(_from=='registration'){_referer='/'+json.data.name+'/';}
if(_from=='pdf'){_referer='/files/reisefuehrer/Berlin-Reisefuehrer.pdf';}
$.hideOverlay();window.location.href=_referer;if(_from=='pdf'){setTimeout("window.location='/"+json.data.name+"/'",2000);}}else{sendReceiveAction('receive','login-do');$('#login-error-wrapper').css('color','white');$('#login-error-wrapper h2').css('color','white');$('#login-error-wrapper .login-do div a').css('color','white');$('#login-error-wrapper').css('background-color','red');$('#login-error-msg').html('Benutzername und Passwort sind nicht korrket.');$('#login-error-msg').animate({opacity:'toggle',height:'toggle'},'slow');}},error:function(json){sendReceiveAction('receive','login-do');$('#login-error-wrapper').css('color','white');$('#login-error-wrapper h2').css('color','white');$('#login-error-wrapper .login-do div a').css('color','white');$('#login-error-wrapper').css('background-color','red');$('#login-error-msg').html('Benutzername und Passwort sind nicht korrket.');$('#login-error-msg').animate({opacity:'toggle',height:'toggle'},'slow');}});}
function doSendPassword(){$('#login-error-wrapper').css('color','#63432a');$('#login-error-wrapper h2').css('color','#63432a');$('#login-error-wrapper').css('background-color','#DAF4FA');$('#login-error-msg:visible').animate({opacity:'toggle',height:'toggle'},'slow');sendReceiveAction('send');var postData=''
var user_email=$('#mailadress-ov').val();postData+="data[User][email]="+user_email;$.ajax({type:"POST",url:"/registrieren/sendPasswordMail/",dataType:'json',contentType:'application/x-www-form-urlencoded; charset=utf-8',data:postData,success:function(json){if(json.status==0){showOverlayWithUrl('/like_it/overlaySave/pwdforgot',null,'login',390);}else{sendReceiveAction('receive');$('#login-error-wrapper h2').css('color','white');$('#login-error-wrapper').css('color','white');$('#login-error-wrapper').css('background-color','red');$('#login-error-msg').animate({opacity:'toggle',height:'toggle'},'slow');}},error:function(json){sendReceiveAction('receive');$('#login-error-wrapper').css('color','white');$('#login-error-wrapper h2').css('color','white');$('#login-error-wrapper').css('background-color','red');$('#login-error-msg').animate({opacity:'toggle',height:'toggle'},'slow');}});}
function findToggleLinks(){$('#content-main').find('.toggle-link').each(function(){var link=$(this).attr('id');var box=$('#'+link.replace(/toggle-/g,''));$(this).bind('click',function(){var current_link_text=$(this).text();var new_link_text=$(this).attr('rev');$(this).attr('rev',current_link_text);$(this).text(new_link_text);if(box.css('display')!='block'){box.show();$(this).addClass('toggle-link-hide');}else{box.hide();$(this).removeClass('toggle-link-hide');}
return false;});});}
function setPrice(){var data=$('#booking-partner').val();var partner=data.split('%%');$('#price-book-link').attr('href',partner[0]);}
function openWin(url,winname,w,h){winname="popup"
centerX=Math.ceil((screen.availWidth-w)/2);centerY=Math.ceil((screen.availHeight-h)/2);more='width='+w+',height='+h;more+=',left='+centerX+',top='+centerY;more+=',screenX='+centerX+',screenY='+centerY;more+=',menubar=no,toolbar=no,status=yes,resizeable=no,scrollbars=yes';win=window.open(url,winname,more);win.focus();if(win)return false;else return true;}
function select_action(li){if(li.extra){window.location.href='http://'+window.location.hostname+'/'+li.extra[0];}}
function construct_row(row){return'<a href="'+row[1]+'">'+row[0]+'</a> <span>'+row[2]+'</span>';}
function set_hidden_city(li){if(li.extra){$('#input-city').addClass('ac-selected');$('#hidden-city').val(li.extra[2]);$('#city-box').removeClass('form-error');$('#city-info').hide();$('#new-city-link').hide();}}
function set_rating(o,animate){animate=false;var percent=$(o).find('span').text();var bar=$(o).find("b");var old_pos=-100;var new_pos=(100-percent)*-1;var delay=10;if(animate){var t=window.setInterval(function(){if(old_pos<new_pos){old_pos=old_pos+3;bar.css('backgroundPosition',old_pos+'px 0px');}else{bar.css('backgroundPosition',new_pos+'px 0px');window.clearInterval(t);}},delay);}else{bar.css('backgroundPosition',new_pos+'px 0px');}}
function initTargetActions(link){var target_root_id=$('#target_root_id').val();$('#target-links').find('a').each(function(){$(this,target_root_id).click(function(){toggleTarget($(this),target_root_id);return false;});});}
function toggleTarget(a,id){var action_suffix=a.attr('id');var action=(a.attr('class')=='target-selected')?'remove_'+action_suffix:'set_'+action_suffix;var loggedin=($('#loggedin').val()=='1')?1:0;if(loggedin){$.getJSON('/ajax/user_targets_ajax/'+action+'/'+id,null,function(json){a.toggleClass('target-selected');$('#target-response').show();$('#target-response/p').html(json.response).bind('click',function(){$(this).hide();});});}else{var response_text='Verrate anderen Reisebegeisterten, wo du schon warst. Dazu einfach <a href="/login">einloggen.</a> Neu hier? <a href="/registrieren/">Kostenlos registrieren</a>';$('#target-response').show();$('#target-response/p').html(response_text).bind('click',function(){$(this).hide();});}}
function reloadTargetLinks(){var target_root_id=$('#target_root_id').val();$('#target-links').load('/ajax/user_targets_ajax/reload_box/'+target_root_id,function(){initTargetActions();});}
function changeCountry(continentCode,selectId){clearCity();var select=document.getElementById(selectId);select.innerHTML=null;document.getElementById('input-region').innerHTML=null;$.getJSON('/ajax/destinations/get_countries_by_continent/'+continentCode,function(json){for(var i=0;i<json.length;i++){var option=document.createElement('option');option.value=json[i].value;option.innerHTML=json[i].name;$(select).append(option);}});}
function changeRegion(countryCode,selectId){var select=document.getElementById(selectId);select.innerHTML=null;$('#region-box').show();$.getJSON('/ajax/destinations/get_regions_by_country/'+countryCode,function(json){for(var i=0;i<json.length;i++){var option=document.createElement('option');option.value=json[i].value;option.innerHTML=json[i].name;$(select).append(option);}});}
function beforeCityRequest(options){$('#hidden-city').val('');$('#input-city').unbind('blur').removeClass('ac-selected');$('#input-city').bind('blur',function(){if($('#hidden-city').val()==''){$('#city-box').addClass('form-error');}});var countryCode=$('#input-country').val();var regionId=$('#input-region').val()||0;options=options||{};options.extraParams={country:countryCode,region:regionId}}
function beforeCityResults(options,data){$('#city-info').show();$('#new-city-link').show();}
function clearCity(){$('#input-city').removeClass('ac-selected').val('');$('#hidden-city').val('');}
function setNewCity(){$('#hidden-city').val(-1);$('#city-box').removeClass('form-error');$('#input-city').addClass('ac-selected');$('#results').hide();$('#new-city-link').hide();$('#city-info').hide();}
function showCityBox(){$('#hotel-box').show();$('#restaurant-box').show();$('#city-box').show();clearCity();}
function beforeHotelRequest(options){if(isEmpty($('#input-hotelname').val())){$('#hidden-hotel').val('');}else{$('#hidden-hotel').val(-1);}
$('#input-hotelname').removeClass('ac-selected');var countryCode=$('#input-country').val();var desinationRootId=$('#hidden-city').val();options=options||{};options.extraParams={country:countryCode,desination_root_id:desinationRootId}}
function beforeHotelResults(options,data){if(!isEmpty($('#input-hotelname').val())){$('#new-hotel-link').show();$('#city-info').hide();}}
function set_hidden_hotel(li){if(li.extra){$('#input-hotelname').addClass('ac-selected');$('#hidden-hotel').val(li.extra[0]);$('#hotel-box').removeClass('form-error');$('#new-hotel-link').hide();}}
function showNewHotel(){$('#hidden-hotel').val(-1);$('#hotel-box').removeClass('form-error');$('#hotel-box').addClass('new-hotel');$('#input-hotelname').addClass('ac-selected');$('#new-hotel-data').show().addClass('new-hotel');$('#hotel-results').hide();$('#new-hotel-link').hide();}
function setHiddenRestaurant(li){if(li.extra){$('#input-restaurantname').addClass('ac-selected');$('#hidden-restaurant').val(li.extra[0]);$('#restaurant-box').removeClass('form-error');$('#new-restaurant-link').hide();}}
function beforeRestaurantRequest(options){if($('#input-restaurantname').val()==''){$('#hidden-restaurant').val('');}else{$('#hidden-restaurant').val(-1);}
$('#input-restaurantname').removeClass('ac-selected');var countryCode=$('#input-country').val();var desinationRootId=$('#hidden-city').val();options=options||{};options.extraParams={country:countryCode,desination_root_id:desinationRootId}}
function beforeRestaurantResults(options,data){if(!isEmpty($('#input-restaurantname').val())){$('#new-restaurant-link').show();$('#city-info').hide();}}
function showNewRestaurant(){$('#hidden-restaurant').val(-1);$('#restaurant-box').removeClass('form-error').addClass('new-restaurant');$('#input-restaurantname').addClass('ac-selected');$('#new-restaurant-data').addClass('new-restaurant').show();$('#restaurant-results').hide();$('#new-restaurant-link').hide();}
function toggleBlogPostBoxes(user_name){if(typeof $('#blogPostCategoryBox').val()=='undefined'){requestUrl='/ajax/blogPostCategories/showCategoriesAfterLogin/';params={userNick:user_name};$.post(requestUrl,params,function(result){$('#lastCategory').prepend(result)})
$('#blogPostCategoryBox').show('slow');$('#blogPostStatusBox').show('slow');}}
function toggleCheckboxes(containerId,calledByCheckbox,linkCaption){linkCaption=linkCaption||['Alle markieren','Keine markieren'];$('#'+containerId+' input[type=\'checkbox\']').each(function(){if(!($(this).attr('id')=='checkAllCheckboxes'&&calledByCheckbox)){if($('#toggleAllCheckboxes').html()==linkCaption[0]){$(this).attr('checked','checked');}else{$(this).removeAttr('checked');}}});var newCaption=linkCaption[0];if($('#toggleAllCheckboxes').html()==linkCaption[0]){newCaption=linkCaption[1];}
$('#toggleAllCheckboxes').html(newCaption);}
function markedStatusCheck(containerId,linkCaption){countCheckboxes=-1;countCheckedCheckboxes=0;linkCaption=linkCaption||['Alle markieren','Keine markieren'];$('#'+containerId+' input[type=\'checkbox\']').each(function(){countCheckboxes++;if(this.checked&&!($(this).attr('id')=='checkAllCheckboxes')){countCheckedCheckboxes++;}});if(countCheckedCheckboxes==0){$('#toggleAllCheckboxes').html(linkCaption[0]);$('#checkAllCheckboxes').removeAttr('checked');}
if(countCheckedCheckboxes==countCheckboxes){$('#toggleAllCheckboxes').html(linkCaption[1]);$('#checkAllCheckboxes').attr('checked','checked');}}
function checkFieldsAndSubmitForm(formId,validator,params){if(validator.check_fields(params)){document.getElementById(formId).submit();}}
function goNetscape(){var u=window.location;var t=document.title;var c='';if(window.getSelection){c=window.getSelection();}else if(document.getSelection){c=document.getSelection();}else if(document.selection){c=document.selection.createRange().text;}
window.location='http://www.netscape.com/submit/?U='+encodeURIComponent(u)+'&T='+encodeURIComponent(t)+'&C='+encodeURIComponent(c);}
function str_replace(search,replace,subject){return subject.split(search).join(replace);}
function addTagsToImages(defaultTags){if($('#ImageTagsForAllImages').val()==$('#ImageDefaultTags').val()){return;}
if($('#ImageTagsForAllImages').val()!=''){$('#imagesBox').find('.image-tags').each(function(){if($(this).val()==''){$(this).val($('#ImageTagsForAllImages').val());}else{imageTags=jQuery.trim($(this).val());if(imageTags.substr(imageTags.length-1,1)==','){imageTags=imageTags.substr(0,imageTags.length-1);}
$(this).val(imageTags+', '+$('#ImageTagsForAllImages').val());}});$('#ImageTagsForAllImages').val('');}}
function saveImages(actionTarget,backToStartPageLink,buttonWrapper){sendReceiveAction('send',buttonWrapper);document.getElementById('imageUploadFormStep2').action=actionTarget+'/0';document.getElementById('imageUploadFormStep2').submit();document.location.href=backToStartPageLink;sendReceiveAction('receive',buttonWrapper);}
function imageEditFormSend(actionTarget){sendReceiveAction('send','imageEditShow-button');document.getElementById('imageUploadFormStep2').action=actionTarget+'/0';document.getElementById('imageUploadFormStep2').submit();sendReceiveAction('receive','imageEditShow-button');}
function showSpendDrinkLayer(recipientRootId,spenderRootId,username,bSendEmial){var loggedin=($('#loggedin').val()=='1')?1:0;var sAdditionalMessage=(bSendEmial)?$('#user-toast').val():'';if(loggedin){requestUrl='/drink-ausgeben/';params={recipientRootId:recipientRootId,spenderRootId:spenderRootId,toastText:sAdditionalMessage,sendEmail:bSendEmial};$.post(requestUrl,params,function(result){if(bSendEmial){$('#user-message').html(result);layer=window.setTimeout("hideProfileMessageBox('drink-info-layer')",4000);}else{showProfileMessageBox('drink-info-layer',result);}});}}
function tbtAjaxCall(url,data,callbacks){return jQuery.ajax({url:url,type:callbacks.method||'POST',contentType:'application/x-www-form-urlencoded; charset=utf-8',data:data,dataType:'json',success:function(data,textStatus){try{if(callbacks.onEnd)
callbacks.onEnd(data);if(data.status==0){console.log('data',data);callbacks.onOk(data);}else{console.error(data);callbacks.onError(data);}}catch(e){if(console&&console.log){console.log({'exception':e.toString()});}else{alert(e.toString());}}},error:function(XMLHttpRequest,textStatus,errorThrown){data={status:9,msg:'Fatal Error, see error log',jquery:{XMLHttpRequest:XMLHttpRequest,textStatus:textStatus,errorThrown:errorThrown}};data.message=data.msg;if(callbacks.onEnd)
callbacks.onEnd(data);callbacks.onError(data);if(window.console&&console.error){console.error(data);}else{alert(data.msg+' '+textStatus+' '+errorThrown);}}});}
function tbtAhahCall(url,data,callbacks,htmlId){jQuery.ajax({url:url,type:'POST',contentType:'application/x-www-form-urlencoded; charset=utf-8',data:data,dataType:'html',success:function(data,textStatus){try{if(callbacks.onOk)
callbacks.onOk(data);document.getElementById(htmlId).innerHTML=data;if(callbacks.onAfterRender)
callbacks.onAfterRender(data);}catch(e){if(console&&console.log){console.log({'exception':e.toString()});}else{alert(e.toString());}}},error:function(XMLHttpRequest,textStatus,errorThrown){data={status:9,message:'Fatal Error',jquery:{XMLHttpRequest:XMLHttpRequest,textStatus:textStatus,errorThrown:errorThrown}};if(callbacks.onError)
callbacks.onError(data);if(console&&console.error){console.error(data);}else{alert(data.msg+' '+textStatus+' '+errorThrown);}}});}
function showAddFriendLayer(userUid){showOverlayWithUrl('/friends/overlayFriendsRequest/'+userUid+'/',null,null,456);}
function clearFriendship(myUid,friendUid,friendName){if(confirm('Willst du '+friendName+' wirklich die Freundschaft kündigen?')){$('#ajax_loader_'+friendUid).show();url='/friends/ajaxClearFriendship/'+myUid+'/'+friendUid;tbtAjaxCall(url,null,{onOk:function(data){deleteTableRow(friendUid,'profile-friends','friends-row',data.message);},onError:function(data){$('#ajax_loader_'+friendUid).hide();alert('Fehler: '+data.msg);}});}}
function deleteTableRow(elementId,containerId,rowId,messageHtml){$('#ajax_loader_'+elementId).hide();window.scrollTo(0,0);$('.error-message-box').remove();$('#'+rowId+'-'+elementId).animate({opacity:'toggle',height:'toggle'},'slow',function(){i=0;$('.profil-table-row').removeClass('bg-light-blue');$('#'+containerId).find('.profil-table-row').each(function(){if($(this).css('display')=='block'){i++;if(i%2==0){$(this).addClass('bg-light-blue');}}});$('#containerForMessage').html(messageHtml);$('#error-message-box').animate({opacity:'toggle',height:'toggle'},'slow',function(){});});}
function deleteMessage(myUrlName,messageId,lockedForDeleting,subject,deleteWithAjax,ownerType){if(lockedForDeleting){$('#flashMessageBox').hide();$('#messages-row-'+messageId).removeClass('bg-light-blue');$('#messages-row-'+messageId).addClass('error-bg');$('#error-message-'+messageId).show();$('#error-message-box').animate({opacity:'toggle',height:'toggle'},'slow',function(){});return false;}
if(confirm('Willst du die Nachricht "'+subject+'" wirklich löschen?')){if(deleteWithAjax==1){url='/'+myUrlName+'/profil/ajaxMessageDelete/';var data={messageId:messageId};$('#ajax_loader_'+messageId).show();tbtAjaxCall(url,data,{onOk:function(data){$('#flashMessageBox').hide();deleteTableRow(messageId,'profile-messages','messages-row',data.message);},onError:function(data){$('#ajax_loader_'+messageId).hide();alert('Fehler: '+data.message);}});}else{url='/'+myUrlName+'/profil/nachrichten/loeschen/'+ownerType+'/'+messageId;document.location.href=url;}}
return true;}
function deleteSelectedMessages(myUrlName,ownerType){messageIds=[];$('#profile-messages input[type=\'checkbox\']').each(function(){if($(this).attr('id')!='checkAllCheckboxes'){if(this.checked){checkedMessageId=$(this).attr('id').split('-');messageIds.push(checkedMessageId[1]);}}});if(messageIds.length==0){window.scrollTo(0,0);$('#error-message-box').hide();$('#error-message-box .content span').html('Zum Löschen musst du erst Nachrichten markieren.');$('#error-message-box').animate({opacity:'toggle',height:'toggle'},'slow',function(){});return;}
if(confirm('Willst du die markierten Nachrichten wirklich löschen?')){url='/'+myUrlName+'/profil/nachrichten/loeschen/'+ownerType+'/'+messageIds.join('/');document.location.href=url;}}
try{if((typeof window.loadFirebugConsole)=='function'&&!window['get console']){window.loadFirebugConsole();}
if(!window.console){if(!window.tbt||!window.tbt.DEBUG||window.tbt.DEBUG==0){window.console=console={};window.console.log=window.console.debug=window.console.error=window.console.info=window.console.warn=function(){};}
else{window.console=console={log:function(){if(window.DEBUG_LEVEL&&window.DEBUG_LEVEL>0){alert('LOG: '+dump.apply(window,arguments));}},debug:function(){if(window.DEBUG_LEVEL&&window.DEBUG_LEVEL>0){alert('DEBUG: '+dump.apply(window,arguments));}},warn:function(){alert('ERROR: '+dump.apply(window,arguments));},error:function(){alert('ERROR: '+dump.apply(window,arguments));}}}}}catch(e){}
function animateLoginBox(){$('#header-stuff-box').animate({opacity:'toggle'},'slow',function(){$('#header-login-box').animate({opacity:'toggle'},'slow')});}
function resetInputField(formField,defaultValue){if(formField.value==''){jQuery(formField).css('color','#999');jQuery(formField).css('font-style','italic');formField.value=unescape(decodeURI(defaultValue)).replace(/\+/g,' ');}}
if(!tbt.form)tbt.form={};tbt.form.debugTeaserText='TODO: teaserText';tbt.form.initTeaserText=function(input,teaserText){input=$(input);if(input.attr('tbtteaser')&&input.val()==input.attr('tbtteaser')){input.val('');}
if(teaserText!=undefined){input.attr('tbtteaser',teaserText);}else{if(input.attr('tbtteaser')){teaserText=input.attr('tbtteaser');}
if(!teaserText){teaserText=tbt.DEBUG?tbt.form.debugTeaserText:'';input.attr('tbtteaser',teaserText);}}
if(!input.val()){input.empty().val(teaserText).css('color','#999');input.get(0).value=teaserText;}
if(!input.attr('onfocus')){if($.browser.safari||$.browser.msie){input.focus(tbt.form._hideTeaser);input.blur(tbt.form._showTeaser);}
input.attr('onfocus','tbt.form._hideTeaser.call(this)').attr('onblur','tbt.form._showTeaser.call(this)');}};tbt.form._showTeaser=function(){input=this;if(input.value==''){var e=$(input);e.css('color','#999').val(input.value=e.attr('tbtteaser'));}};tbt.form._hideTeaser=function(){var e=$(this);e.css('color','');if(e.val()==e.attr('tbtteaser')){e.val('');}};function showFeaturedGeoObjectsBox(){var loading=false;if($('#featuredGeoObjectsContainer').html()==''){loading=true;$.post('/ajaxElements/featuredGeoObjectsBox',null,function(result){$('#featuredGeoObjectsContainer').html(result);$('#featuredGeoObjectsContainer').show();document.onkeydown=function(e){if(e==null){var keycode=event.keyCode;}
else{var keycode=e.which;}
if(keycode==27){hideFeaturedGeoObjectsBox();}}});}
$('#featuredGeoObjectsCaption').animate({opacity:'toggle'},loading?'slow':'fast',function(){if(!loading){$('#featuredGeoObjectsWrapper').show();}
tbt.hideElementsForOverlay();});}
function hideFeaturedGeoObjectsBox(){$('#featuredGeoObjectsWrapper').hide();$('#featuredGeoObjectsCaption').show().css('opacity','');tbt.showElementsForOverlay();}
function imageUploadFormSubmit(){var allOk=true;var imageFilesExistent=false;sendReceiveAction('send','imageAdd-button');$('#imageUploadForm').find('.image-file').each(function(i){$('#imageUploadFormFieldWrapper'+i).removeClass('imageUploadFormFieldError');$('#imageUploadErrorMessage'+i).html('').hide();});$('#imageUploadForm').find('.fakeInput').each(function(i){var filename=$(this).val();if(filename!=''&&filename!='filename'){imageFilesExistent=true;if(filename.substr(filename.length-3,3).toLowerCase()=='jpg'||filename.substr(filename.length-4,4).toLowerCase()=='jpeg'){}else{$('#imageUploadFormFieldWrapper'+i).addClass('imageUploadFormFieldError');$('#imageUploadErrorMessage'+i).html('Bild '+i+' hat kein JPG Format').show();$('#Photo_'+i).focus();allOk=false;}}});if(!imageFilesExistent){$('#imageUploadFormFieldWrapper1').addClass('imageUploadFormFieldError');$('#imageUploadErrorMessage1').html('Bitte wähle eine Datei aus.').show();$('#Photo_1').focus();allOk=false;}
if(!allOk){sendReceiveAction('receive','imageAdd-button');return;}
$('#imageUploadForm').submit();}
function hideImageActionIcons(imageUid){$('#imageActionIconContainer-'+imageUid).hide();}
function showImageActionIcons(imageUid){$('.imageActionIconContainer').hide();$('#imageActionIconContainer-'+imageUid).show();}
function deleteImage(imageUid){if(confirm('Willst du dein Bild wirklich löschen?')){tbtAjaxCall('/bilder/loeschen/'+imageUid,null,{onOk:function(data){deleteImageOnOk(imageUid);},onError:function(data){alert('Fehler: '+data.message);}});}}
function deleteImageOnOk(imageUid){$('#imageActionWrapper-'+imageUid).animate({opacity:'toggle',height:'toggle',width:'toggle'},'slow',function(){});}
function sendReceiveAction(_action,_class){if(_action=='send'){$('.'+_class+' .doButtonNoFunc:hidden').removeClass('none');$('.'+_class+' .doButton:visible').addClass('none');$('.'+_class+' .ajaxLoader').removeClass('none');}
if(_action=='receive'){$('.'+_class+' .doButtonNoFunc:visible').addClass('none');$('.'+_class+' .doButton:hidden').removeClass('none');$('.'+_class+' .ajaxLoader:visible').addClass('none');}}
function setTextAreaHeight(_id,_defaultHeight,_rowAmount){var text=$('#'+_id).val();var splitx=text.split('\n');var widthpx=$('#'+_id).css('width');var width=widthpx.slice(0,(widthpx.length-2));var rowCharacters=(width/7);var counter=0;var heightx=0;for(i=0;i<splitx.length;i++){counter=counter+Math.ceil((splitx[i].length)/rowCharacters);}
heightx=(Math.ceil(counter/_rowAmount)*(_defaultHeight*0.87));if(heightx<_defaultHeight)heightx=Math.ceil(_defaultHeight);$('#'+_id).css('height',heightx);}
function emptyInputField(formField,defaultValue){jQuery(formField).css('color','#333');jQuery(formField).css('font-style','normal');if(formField.value.replace(/\+/g,' ')==unescape(decodeURI(defaultValue)).replace(/\+/g,' ')){formField.value='';}}
function showMore(_what){var footerLinkText=new Array();footerLinkText['plus']=new Object();footerLinkText['minus']=new Object();footerLinkText['plus']['drinks']='Letzte Gönner anzeigen';footerLinkText['minus']['drinks']='Letzte Gönner ausblenden';footerLinkText['plus']['visitors']='Letzte Besucher anzeigen';footerLinkText['minus']['visitors']='Letzte Besucher ausblenden';footerLinkText['plus']['writers']='Mehr Mitglieder anzeigen';footerLinkText['minus']['writers']='Weniger Mitglieder anzeigen';$('#more-'+_what).animate({opacity:'toggle',height:'toggle'},'slow',function(){if($('#'+_what+'-box .more div a.more-link').html()!=footerLinkText['plus'][_what]){$('#'+_what+'-box .more div a.more-link').html(footerLinkText['plus'][_what]);$('#'+_what+'-box .more span').removeClass('minus');$('#'+_what+'-box .more span').addClass('plus');}else{$('#'+_what+'-box .more div a.more-link').html(footerLinkText['minus'][_what]);$('#'+_what+'-box .more span').removeClass('plus');$('#'+_what+'-box .more span').addClass('minus');}});}
function violationReportSend(){$('#overlayRedMessageWrapper').hide();$('#email-wrapper').removeClass('error');$('#text-wrapper').removeClass('error');$('#email-wrapper span.message').hide();$('#text-wrapper span.message').hide();$('#email-wrapper .left').removeClass('b');var errorCount=0;if($('#ViolationReportEmail').val()!=null){if($('#ViolationReportEmail').val()==''){$('#email-wrapper').addClass('error');$('#email-wrapper span.message').show();$('#email-wrapper .left').addClass('b');errorCount++;}
if(!tbt.emailRegex.test($('#ViolationReportEmail').val())){$('#email-wrapper').addClass('error');$('#email-wrapper .left').addClass('b');$('#email-wrapper span.message').show();errorCount++;}}
if($('#ViolationReportText').val()==$('#defaultText').val()||$('#ViolationReportText').val().length<10){$('#text-wrapper').addClass('error');$('#text-wrapper span.message').show();errorCount++;}
if(errorCount>0){$('#overlayRedMessageWrapper').animate({opacity:'toggle',height:'toggle'},'slow');return;}
var url='/violation_report/ajaxSend/';var data={object_uid:$('#ViolationReportObjectUid').val(),email:$('#ViolationReportEmail').val(),text:$('#ViolationReportText').val()};sendReceiveAction('send','violation-report-do');tbtAjaxCall(url,data,{onOk:function(data){var redirectUrl=$('#ViolationReportRedirectUrl').val();if(redirectUrl==''){window.location.reload();}else{window.location.href=redirectUrl;}
sendReceiveAction('receive','violation-report-do');},onError:function(data){alert('Fehler '+data.message);sendReceiveAction('receive','violation-report-do');}});}
function imagePreload(){document.Vorladen=new Array();if(document.images)
{for(var i=0;i<imagePreload.arguments.length;i++)
{document.Vorladen[i]=new Image();document.Vorladen[i].src=imagePreload.arguments[i];console.log('image preload'+imagePreload.arguments[i]);}}}
tbt.getCoordinatesForObject=function(o){var r={top:0,left:0,width:0,height:0};if(!o)return r;else if(typeof o=='string')o=document.getElementById(o);if(typeof o!='object')return r;if(typeof o.offsetTop!='undefined'){r.height=o.offsetHeight;r.width=o.offsetWidth;r.left=r.top=0;while(o&&o.tagName!='BODY'){r.top+=parseInt(o.offsetTop);r.left+=parseInt(o.offsetLeft);o=o.offsetParent;}}
return r;}
function getMouseXY(e){var tempX;var tempY;var IE=document.all?true:false;if(!IE)document.captureEvents(Event.MOUSEMOVE)
if(IE){tempX=event.clientX+document.body.scrollLeft;tempY=event.clientY+document.body.scrollTop;}
else{tempX=e.pageX;tempY=e.pageY;}
if(tempX<0){tempX=0;}
if(tempY<0){tempY=0;}
tbt.mouseposition={x:tempX,y:tempY};return true;}
function closeOverlayWithButtonOnly(){$('#__dimScreen').unbind('click');document.onkeydown=null;}
function toggleCategories(typeId){toggleCheckboxGroup(toggleCategories,'categories'+typeId);}
function toggleCheckboxGroup(objekt,htmlId){if(!objekt.sLastShownId||(objekt.sLastShownId==htmlId)){$('#'+htmlId).animate({opacity:'toggle',height:'toggle'},'fast');if(objekt.sLastShownId==htmlId){objekt.sLastShownId=null;}else{objekt.sLastShownId=htmlId;}}else{$('#'+objekt.sLastShownId).animate({opacity:'toggle',height:'toggle'},'fast',function(){$('#'+htmlId).animate({opacity:'toggle',height:'toggle'},'fast',function(){objekt.sLastShownId=htmlId;});});}}
tbt.addPlaceToTrips=function(place_uid){$('#newTripWrapper').removeClass('error');$('#newTripWrapper span.message').hide();$('#overlayRedMessageWrapper').hide();$('#existingTripsMessage').hide();$('.checkboxWrapper').removeClass('error');if($('#NewTrip').attr('checked')&&($('#TripName').val()==$('#TripNameDefault').val()||$('#TripName').val().length<3)){$('#newTripWrapper').addClass('error');$('#newTripWrapper span.message').html('Bitte gebe mindestens 3 Zeichen an.');$('#newTripWrapper span.message').show();$('#overlayRedMessageWrapper').animate({opacity:'show',height:'show'},'slow');return false;}
var data={place_uid:place_uid};var existingTripUids=[];var checkedTripUid;$('#existingTrips input[type=\'checkbox\']').each(function(){if(this.checked){checkedTripUid=$(this).attr('id').split('-');existingTripUids.push(checkedTripUid[1]);}});if(typeof($('#TripTextDefault'))!='undefined'&&$('#TripText').val()==$('#TripTextDefault').val()){$('#TripText').val('');}
if(!$('#NewTrip').attr('checked')&&existingTripUids.length==0){$('#overlayRedMessageWrapper').animate({opacity:'show',height:'show'},'slow');$('#existingTripsMessage').show();$('.checkboxWrapper').addClass('error');return false;}
if(existingTripUids.length>0){data.trip_uids=existingTripUids.join(',');}
if($('#NewTrip').attr('checked')){data.trip_name=$('#TripName').val();data.trip_text=$('#TripText').val();}
var url='/trips'+'/ajaxAddPlaceToTrips/';sendReceiveAction('send','add-trip-do');tbtAjaxCall(url,data,{onOk:function(data){if(data.showLoginLayer){showOverlayWithUrl('/like_it/overlaySave/addtrip',null,'login',390);}else{if(data.tripNameExisted){$('#overlayRedMessageWrapper').animate({opacity:'show',height:'show'},'slow');$('#newTripWrapper').addClass('error');$('#newTripWrapper span.message').html('Dieser Trip existiert bereits. Wähle bitte einen anderen Namen.');$('#newTripWrapper span.message').show();sendReceiveAction('receive','add-trip-do');}else{showOverlayWithUrl('/weitersagen/'+'addPlaceToTripsSuccess/'+place_uid,null,'weitersagenFriendsBox',740,null,461);}}},onError:function(data){alert('Fehler '+data.message);}});}
tbt.deletePlaceFromTrip=function(place_uid,trip_uid){if(confirm('Möchtest du diesen Tipp wirklich aus deinem Trip löschen?')){var url='/trips'+'/ajaxDeletePlaceFromTrip/';var data={place_uid:place_uid,trip_uid:trip_uid};tbtAjaxCall(url,data,{onOk:function(data){$('#list-entry-'+place_uid).animate({opacity:'toggle',height:'toggle'},'slow');},onError:function(data){alert('Fehler '+data.message);}});}}
tbt.deleteTrip=function(trip_uid){if(confirm('Möchtest du diesen Trip wirklich löschen?')){var url='/trips'+'/ajaxDelete/';var data={trip_uid:trip_uid};tbtAjaxCall(url,data,{onOk:function(data){document.location.href=data.urlToRedirect;},onError:function(data){alert('Fehler '+data.message);}});}}
tbt.saveUserStatusText=function(){var url='/profil'+'/ajaxSaveUserStatusText/';var data={text_status:$('#UserTextStatus').val(),text_status_default:$('#UserTextStatusDefault').val()};tbtAjaxCall(url,data,{onOk:function(data){$('#outputUserTextStatus').html(data.newStatusText);document.getElementById('UserTextStatus').blur();},onError:function(data){alert('Fehler '+data.message);}});}
tbt.saveUserCurrentLocation=function(){if(typeof doCurrentDestinationChange=='undefined')return false;var url='/profil'+'/ajaxSaveUserCurrentLocation/';var data={current_destination_uid:$('#input-current-destination-uid').val(),current_region_uid:$('#input-current-region-uid').val(),current_country_uid:$('#input-current-country-uid').val(),current_continent_uid:$('#input-current-continent-uid').val()};tbtAjaxCall(url,data,{onOk:function(data){window.setTimeout('window.location.reload()',1500);},onError:function(data){alert('Fehler '+data.message);}});}
tbt.changeTrip=function(trip_uid){$('#tripWrapper').removeClass('error');$('#tripWrapper span.message').hide();$('#overlayRedMessageWrapper').hide();if($('#TripName').val()==$('#TripNameDefault').val()||$('#TripName').val().length<3){$('#tripWrapper').addClass('error');$('#tripWrapper span.message').html('Bitte gebe mindestens 3 Zeichen an.');$('#tripWrapper span.message').show();$('#overlayRedMessageWrapper').animate({opacity:'show',height:'show'},'slow');return false;}
if(typeof($('#TripTextDefault'))!='undefined'&&$('#TripText').val()==$('#TripTextDefault').val()){$('#TripText').val('');}
var url='/trips'+'/ajaxChange/';var data={trip_uid:trip_uid,trip_name:$('#TripName').val(),trip_text:$('#TripText').val()};sendReceiveAction('send','edit-trip-do');tbtAjaxCall(url,data,{onOk:function(data){if(data.tripNameExisted){$('#overlayRedMessageWrapper').animate({opacity:'show',height:'show'},'slow');$('#tripWrapper').addClass('error');$('#tripWrapper span.message').html('Dieser Trip existiert bereits. Wähle bitte einen anderen Namen.');$('#tripWrapper span.message').show();sendReceiveAction('receive','edit-trip-do');}else{document.location.href=data.urlToRedirect;hideOverlay();}},onError:function(data){alert('Fehler '+data.message);}});}
tbt.changeComment=function(comment_uid){$('#overlayRedMessageWrapper').hide();var minCommentTextChars=$('#CommentMinCommentTextChars').val();if($('#CommentText').val().length<=minCommentTextChars){$('#overlayRedMessageWrapper').animate({opacity:'show',height:'show'},'slow');return false;}
var url='/comments'+'/ajaxChange/';var data={comment_uid:comment_uid,comment_text:$('#CommentText').val()};sendReceiveAction('send','edit-comment-do');tbtAjaxCall(url,data,{onOk:function(data){window.location.reload();},onError:function(data){alert('Fehler '+data.message);$.hideOverlay();}});}
tbt.changePlaceText=function(place_uid){$('#overlayRedMessageWrapper').hide();var minPlaceTextChars=$('#PlaceMinCommentTextChars').val();if($('#PlaceText').val().length<=minPlaceTextChars){$('#overlayRedMessageWrapper').animate({opacity:'show',height:'show'},'slow');return false;}
var url='/place_text'+'/ajaxChangeText/';var data={place_uid:place_uid,place_text:$('#PlaceText').val()};sendReceiveAction('send','edit-comment-do');tbtAjaxCall(url,data,{onOk:function(data){window.location.reload();},onError:function(data){alert(data.msg);$.hideOverlay();}});}
tbt.changeWiki=function(wiki_uid){$('#wikiWrapper').removeClass('error');$('#wikiWrapper span.message').html('Formatierung: [b]fett[/b]');$('#wikiWrapper span.message').hide();$('#overlayRedMessageWrapper').hide();if($('#WikiText').val()==$('#WikiTextDefault').val()){$('#WikiText').val('');}
if($('#WikiText').val()==$('#WikiTextOld').val()&&$('#WikiText').val()!=''){$('#wikiWrapper').addClass('error');$('#wikiWrapper span.message').html('Du musst den Text vor dem Speichern ändern.');$('#wikiWrapper span.message').show();$('#overlayRedMessageWrapper').show();return false;}
var minLength=30;if($('#WikiWikiType').val()=='heading')minLength=10;if($('#WikiText').val().length<minLength){$('#wikiWrapper').addClass('error');$('#wikiWrapper span.message').html('Bitte mehr als '+minLength+' Zeichen angeben.');$('#wikiWrapper span.message').show();$('#overlayRedMessageWrapper').show();return false;}
var url='/reiseinformationen'+'/ajaxChange/';var data={geo_uid:$('#GeoUid').val(),geo_type:$('#GeoType').val(),wiki_text:$('#WikiText').val(),wiki_wiki_type:$('#WikiWikiType').val()};sendReceiveAction('send','edit-wiki-do');tbtAjaxCall(url,data,{onOk:function(data){window.location.reload();},onError:function(data){alert('Fehler '+data.message);}});}
tbt.saveAnswer=function(){var minTextLength=2;var text=$('#overlay_answer_add_text').val();if(text.length<minTextLength){$('#overlayNormalMessageWrapper:visible').animate({opacity:'toggle',height:'toggle'},'slow',function(){$('#overlayRedMessageWrapper .error-message-box .content span').html('Bitte gib mindestens 2 Zeichen ein.');$('#overlayRedMessageWrapper:hidden').animate({opacity:'toggle',height:'toggle'},'slow');});$('#overlayRedMessageWrapper:hidden').animate({opacity:'toggle',height:'toggle'},'slow');$('#overlayRedMessageWrapper .error-message-box .content span').html('Bitte gib mindestens 2 Zeichen ein.');return false;}
sendReceiveAction('send','add-answer-do');var params={object_uid:$('#overlay_answer_add_object_uid').val(),text:text};tbtAjaxCall('/reiseforum'+'/ajaxSaveAnswer',params,{onOk:function(data){if(data.loggedin){window.location.reload();}else{showOverlayWithUrl('/like_it/'+'overlaySave'+'/answer',null,'login',390);}},onError:function(data){alert('Fehler '+data.message);}});}
tbt.hideElementsForOverlay=function(){if(document.all){$('select').addClass('invisible');$('.booking-iframe').addClass('invisible');}
$('.flash-element').addClass('invisible');$('#bigsizebanner').addClass('invisible');}
tbt.showElementsForOverlay=function(){if(document.all){$('select').removeClass('invisible');$('.booking-iframe').removeClass('invisible');}
$('.flash-element').removeClass('invisible');$('#bigsizebanner').removeClass('invisible');}
tbt.hideOverlayRegistrationTeaser=function(){$('#overlayStyle626:visible').animate({height:'toggle'},'slow');tbt.showElementsForOverlay();}
tbt.initOverlayRegistrationTeaser=function(){tbt.showElementsForOverlay();$('#overlayStyle626').hover(function(){$('body').unbind('click');},function(){$('body').bind('click',function(){tbt.hideOverlayRegistrationTeaser();});});$('#overlayStyle626').animate({height:'toggle'},'slow');}
tbt.setCursorAtEnd=function(sTextboxID){var oTextbox=document.getElementById(sTextboxID);if(oTextbox.createTextRange){var r=(oTextbox.createTextRange());r.moveStart('character',(oTextbox.value.length));r.collapse();r.select();}}
tbt.addGeoLikeIt=function(geoUid,counter){counter++;$('.leftBox .like-it-small').append('<div class="haekchen"><img alt="" class="like-it-haekchen" src="'+tbt.mediaServer+'img/icon/haekchen.gif"/></div>');$('.leftBox .like-it-small .statistic').html(counter+' x <span>Mag ich</span>');$('.leftBox .like-it-small-bg').css('height','23px');$('.leftBox .like-it-small-img').css('height','23px');var url='/like_it'+'/ajaxAdd'+'LikeIt/'+geoUid;tbtAjaxCall(url,null,{onOk:function(data){},onError:function(data){alert('Fehler '+data.message);}});}
tbt.limitTextarea=function(field,countfield,maxlimit){if(field.value.length>maxlimit){field.value=field.value.substring(0,maxlimit);}else{var charsLeft=maxlimit-field.value.length;countfield.html('Noch '+charsLeft+' Zeichen');}}
function fbs_click(){u=location.href;t=document.title;window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');return false;}
function onTypeCheckboxChange(typeId){if(onTypeCheckboxChange.__thread){clearTimeout(onTypeCheckboxChange.__thread);}
onTypeCheckboxChange.__thread=window.setTimeout('window._onTypeCheckboxChange('+typeId+')',100);}
onTypeCheckboxChange.__thread=null;function _onTypeCheckboxChange(typeId){var counterHtmlId='type_counter_'+typeId;var checkBoxContainerId='categories'+typeId;var n=$('#'+checkBoxContainerId).find('input:checked').length;$('#'+counterHtmlId).html('&nbsp;(<b>'+n+'</b>)');}
tbt.in_array=function(needle,haystack){for(var i=0;i<haystack.length;i++){if(needle===haystack[i]){return true;}}
return false;};Function.prototype.inheritsFrom=function(parentClassOrObject){if(parentClassOrObject.constructor==Function)
{this.prototype=new parentClassOrObject();this.prototype.constructor=this;this.prototype.parent=parentClassOrObject.prototype;}else{this.prototype=parentClassOrObject;this.prototype.constructor=this;this.prototype.parent=parentClassOrObject;}
return this;}
Function.prototype.decorateWith=function(sourceClassOrObject){var o=sourceClassOrObject;if(sourceClassOrObject.constructor==Function){o=new sourceClassOrObject;}
for(var method in o){this.prototype[method]=o[method];}}
tbt.loadGMapsApi=function(){google.load("maps","2",{"callback":tbt.mapsLoaded,"language":"de","nocss":true});}
tbt.loadGSearchApi=function(){google.load("search","1",{"callback":tbt.searchLoaded,"language":"de","nocss":true});}
tbt.loadDestinbationSelectorCss=function(){if(tbt.loadDestinbationSelectorCss._loaded)return;var e=document.createElement("link");e.type="text/css";e.rel="stylesheet";e.href=window.tbt.mediaServer+"css/destination_selector.css";document.getElementsByTagName("head")[0].appendChild(e);tbt.loadDestinbationSelectorCss._loaded=true;}
tbt.loadDestinbationSelectorCss._loaded=false;tbt.loadDestinbationSelectorJs=function(){if(window.tbt&&window.tbt.DestinationSelector){return;}
var a=document.createElement('script');a.setAttribute('type','text/javascript');a.setAttribute('src',window.tbt.mediaServer+'js/destination_selector.js');document.getElementsByTagName('head')[0].appendChild(a);}
tbt.loadTopDestinationsJs=function(){if(window.tbt&&window.tbt.topDestinationsCache){return;}
var a=document.createElement('script');a.setAttribute('type','text/javascript');a.setAttribute('src',window.tbt.mediaServer+'js/top_destinations.js');document.getElementsByTagName('head')[0].appendChild(a);}
tbt.loadDestinbationSelector=function(){tbt.loadDestinbationSelectorJs();tbt.loadDestinbationSelectorCss();tbt.loadTopDestinationsJs();}
tbt.mapsLoaded=function(){}
tbt.searchLoaded=function(){}
tbt.callNewTipOverlay=function(_destinationUid){tbt.loadGMapsApi();tbt.loadGSearchApi();tbt.loadDestinbationSelector();showOverlayWithUrl('/addTip/addTipStepOne/1/'+_destinationUid+'/',null,'addTipStepOne',740);}
tbt.toggleE2Entries=function(clickedElement,className){return true;var toggleImg=$(clickedElement).find('img');var newImg;if(toggleImg.attr('src').search('minus.gif')==-1){newImg='img/icon/minus.gif';}else{newImg='img/icon/plus.gif';}
$(clickedElement).find('img').attr('src',tbt.mediaServer+newImg);$('.e2 '+'.'+className).toggle();}
tbt.linkTracking=function(_siteTopic,_siteType,_site,_referer){try{postData="data[site_topic]="+_siteTopic;postData+="&data[site_type]="+_siteType;postData+="&data[site]="+_site;postData+="&data[referer]="+_referer;$.ajax({type:"POST",url:"/tracking/ajaxLinkTracking/",dataType:'json',contentType:'application/x-www-form-urlencoded; charset=utf-8',data:postData,success:function(json){window.location.href=json.data.site;},error:function(json){window.location.href=json.data.site;}});}catch(e){console.error(e);}}
tbt.fb_logout=function(){FB.init(window.tbt.fbapikey,"/xd_receiver.htm");FB.ensureInit(function(){FB.Connect.ifUserConnected(FB.Connect.logout(),null);});}
tbt.fb_showFeedDialog=function(_bundleid,_datatoken,_objectName,_value){FB.init(window.tbt.fbapikey,"/xd_receiver.htm");FB.ensureInit(function(){var result=FB.Connect.showFeedDialog(_bundleid,_datatoken,null,null,null,'FB.RequireConnect.doNotRequire',function(){},'Du magst '+_objectName+'?',{'value':_value});});}
tbt.dcyt=function(_url,_target){url=_url.replace(/\|\|\|/g,'.');url=url.replace(/\|\|/g,'//');url=url.replace(/\|/g,'/');url=url.replace(/\#/g,'');if(_target=='_blank'){window.open(url,_target);}else{window.location=url;}}


/**** AssetPackerHelper::process()  banner.js  ****/


if(!window.tbt)tbt={};if(!tbt.banner)tbt.banner={};tbt.banner.IframeBanner=function(params){this.id=params.id;this.w=params.w;this.h=params.h;this.src=params.src;}
tbt.banner.IframeBanner.prototype={show:function(uniqueString){uniqueString=uniqueString?('?'+uniqueString):'';var container=document.getElementById(this.id);if(!container)return;var server=tbt.mediaServer||'/';container.innerHTML='<iframe src="'+server+this.src+uniqueString+'" width="'+this.w+'" height="'+this.h+'" marginwidth="0" marginheight="0" frameborder="0" scrolling="no"></iframe>';},getContainer:function(){return document.getElementById(this.id);},onHockeystick:null}
tbt.banner.IframeManager=function(){if(tbt.banner.IframeManager.__instance)throw new Error("tbt.banner.IframeManager is a Singleton! only 1 instance allowed! use tbt.banner.IframeManager.instance()");this.banners=[];this.delay=1000;this.ord=null;this.isHockeystick=false;}
tbt.banner.IframeManager.__instance=null;tbt.banner.IframeManager.instance=function(){if(!tbt.banner.IframeManager.__instance){tbt.banner.IframeManager.__instance=new tbt.banner.IframeManager();}
return tbt.banner.IframeManager.__instance;}
tbt.banner.IframeManager.prototype={setDelay:function(msec){this.delay=msec;},setOrd:function(ord){this.ord=ord;},setIsHockeystick:function(bool){this.isHockeystick=bool;},run:function(){if(window.jQuery){var delay=this.delay
$(document).ready(function(){tbt.banner.IframeManager.instance().hockeystickLayout();window.setTimeout(function(){me=tbt.banner.IframeManager.instance();var append='';if(me.ord){append='ord='+me.ord;}else{append=window.tbt.updateTimeStamp||(new Date()).getTime();}
for(var i=0;i<me.banners.length;i++){me.banners[i].show(append);}},delay);});}
else{tbt.banner.IframeManager.instance().hockeystickLayout();window.setTimeout(function(){var now=(new Date()).getTime();self=tbt.banner.IframeManager.instance();for(var i=0;i<self.banners.length;i++){self.banners[i].show(now);}},this.delay);}},add:function(banner){this.banners.push(banner);},hockeystickLayout:function(){if(!this.isHockeystick)return;for(var i in this.banners){var b=this.banners[i];if(b.onHockeystick)b.onHockeystick();}}};tbt.banner.IframeManager.createDefault=function(zone){var bannerManager=tbt.banner.IframeManager.instance();var IframeBanner=tbt.banner.IframeBanner;var b=null;bannerManager.add(b=new IframeBanner({id:'bigsize-banner',w:728,h:90,src:'files/banner/bigsize_'+zone+'.html'}));b.onHockeystick=function(){var c=this.getContainer();if(true){c.style.marginRight='150px';c.style.textAlign='right';}else{c.style.marginRight='-10px';c.style.textAlign='right';}};bannerManager.add(b=new IframeBanner({id:'skyscraper-banner',w:160,h:600,src:'files/banner/skyscraper_'+zone+'.html'}));b.onHockeystick=function(){var c=this.getContainer();if(true){c.style.left='1010px';c.style.top='0';}else{c.style.left='1010px';c.style.top='90px';}};bannerManager.add(new IframeBanner({id:'contentadd-banner',w:336,h:280,src:'files/banner/contentadd_'+zone+'.html'}));return bannerManager;};


/**** AssetPackerHelper::process()  jquery_includer_null.js  ****/


jQuery.includeScript=function(sFileName){};jQuery.includeScriptOnce=function(sFileName){};


/**** AssetPackerHelper::process()  jquery.dimensions.js  ****/


(function($){$.dimensions={version:'1.2'};$.each(['Height','Width'],function(i,name){$.fn['inner'+name]=function(){if(!this[0])return;var torl=name=='Height'?'Top':'Left',borr=name=='Height'?'Bottom':'Right';return this.is(':visible')?this[0]['client'+name]:num(this,name.toLowerCase())+num(this,'padding'+torl)+num(this,'padding'+borr);};$.fn['outer'+name]=function(options){if(!this[0])return;var torl=name=='Height'?'Top':'Left',borr=name=='Height'?'Bottom':'Right';options=$.extend({margin:false},options||{});var val=this.is(':visible')?this[0]['offset'+name]:num(this,name.toLowerCase())
+num(this,'border'+torl+'Width')+num(this,'border'+borr+'Width')
+num(this,'padding'+torl)+num(this,'padding'+borr);return val+(options.margin?(num(this,'margin'+torl)+num(this,'margin'+borr)):0);};});$.each(['Left','Top'],function(i,name){$.fn['scroll'+name]=function(val){if(!this[0])return;return val!=undefined?this.each(function(){this==window||this==document?window.scrollTo(name=='Left'?val:$(window)['scrollLeft'](),name=='Top'?val:$(window)['scrollTop']()):this['scroll'+name]=val;}):this[0]==window||this[0]==document?self[(name=='Left'?'pageXOffset':'pageYOffset')]||$.boxModel&&document.documentElement['scroll'+name]||document.body['scroll'+name]:this[0]['scroll'+name];};});$.fn.extend({position:function(){var left=0,top=0,elem=this[0],offset,parentOffset,offsetParent,results;if(elem){offsetParent=this.offsetParent();offset=this.offset();parentOffset=offsetParent.offset();offset.top-=num(elem,'marginTop');offset.left-=num(elem,'marginLeft');parentOffset.top+=num(offsetParent,'borderTopWidth');parentOffset.left+=num(offsetParent,'borderLeftWidth');results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left};}
return results;},offsetParent:function(){var offsetParent=this[0].offsetParent;while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&$.css(offsetParent,'position')=='static'))
offsetParent=offsetParent.offsetParent;return $(offsetParent);}});function num(el,prop){return parseInt($.curCSS(el.jquery?el[0]:el,prop,true))||0;};})(jQuery);


/**** AssetPackerHelper::process()  form_validator.js  ****/


if(!($.is_null instanceof Function))
$.is_null=function(o){return o==undefined||o==null;};if(!($.to_array instanceof Function))
$.to_array=function(a){if(a instanceof Array)return a;if(a instanceof String)return[a];if(!$.is_null(a.length)){var aa=[];for(var i=0;i<a.length;i++)aa.push(a[i]);return aa;}return[a];};if(!($.merge_hashes instanceof Function))
$.merge_hashes=function(hash_left,hash_right,overwrite_left_params){if($.is_null(overwrite_left_params))overwrite_left_params=false;for(key in hash_right){if(hash_left[key]==undefined||overwrite_left_params)
hash_left[key]=hash_right[key];}
return hash_left;};if(!$.remove_from_array)
$.remove_from_array=function(arr,idx){var n=[];for(var i=0;i<arr.length;i++)if(i!=idx)n.push(arr[i]);return n;}
if(!$.remove_object_from_array)
$.remove_object_from_array=function(arr,obj){var n=[];for(var i=0;i<arr.length;i++)if(arr[i]!=obj)n.push(arr[i]);return n;}
if(!$.index_of_object)
$.index_of_object=function(arr,obj){for(var i=0;i<arr.length;i++)if(arr[i]==obj)return i}
if(!Function.prototype.ref){Function.prototype.ref=function(){var f=this,a=$.to_array(arguments),o=a.shift();return function(){var aa=a.concat($.to_array(arguments));return f.apply(o,aa);};};Function.prototype.delayed=function(){var f=this,a=$.to_array(arguments),t=a.shift();return setTimeout(f.ref.apply(f,a),t);};Function.prototype.delayed_ref=function(){var f=this,a=$.to_array(arguments),t=a.shift(),o=a.shift();return function(){var aa=a.concat($.to_array(arguments));f.delayed.apply(f,[t,o].concat(aa));};};}
jQuery.fn.validate=function(params){return new jQuery.FormValidator(this,params);};jQuery.fn.observing_validator=function(options,params){var validator=new jQuery.FormValidator(this,options);validator.observe(params);return validator;};$.merge_hashes(jQuery.fn.validate,{REGEX:{numeric:/^\d+$/,alphabetic:/^[a-z]+$/i,alphabetic_lower:/^[a-z]+$/,alphabetic_upper:/^[A-Z]+$/,alphanumeric:/^[a-zA-Z\d]+$/,not_empty:/.+/,standard:/^\w+$/i,phone:/^\+?(?:\d\d[\/\s]?)+$/,email:/^[a-z\d]+(?:[-._]?[a-z\d]+)+@[a-z\d]+(?:[-.]?[a-z\d]+)+\.([a-z]{2,4})$/i,username:/^[-\w_]+$/,password:/^[-\w_\$\!&%]+$/,date_short_pre:/^(?:0?[1-9]|[12][0-9]|3[01])([-\/\.])(?:0?[1-9]|1[0-2])\1\d\d$/,date_short_suf:/^\d\d([-\/\.])(?:0?[1-9]|1[0-2])\2(?:0?[1-9]|[12][0-9]|3[01])$/,date_long_pre:/^(?:0?[1-9]|[12][0-9]|3[01])([-\/\.])(?:0?[1-9]|1[0-2])\1(19|20)\d\d$/,date_long_suf:/^(19|20)\d\d([-\/\.])(?:0?[1-9]|1[0-2])\2(?:0?[1-9]|[12][0-9]|3[01])$/}});jQuery.FormValidator=function(formular,params){this._params=$.merge_hashes({trim_whitespaces:true,min_length:null,max_length:null,empty_ok:false,call_on_success:function(inp){$(inp).removeClass('error');},call_on_failure:function(inp){$(inp).addClass('error')},on_errors:function(errors,inputs){},on_success:function(){},mode:'normal',delay:null},params||{},true);this._last_check={};this._all_errors=[];this._all_error_inputs=[];this._formular=$(formular);};jQuery.FormValidator.prototype={_trim_whitespaces:function(value){value=value.replace(/^\s*/,'');value=value.replace(/\s*$/,'');return value;},_get_value:function(input){var value=$(input).val();if(this._params.trim_whitespaces)
value=this._trim_whitespaces(value);return value;},_get_all_checkers_for_type:function(type,obj_element){if(!(obj_element instanceof Array))
obj_element=[obj_element];var res=[];var obj_element_new=[];for(var i=0;i<obj_element.length;i++){var el=obj_element[i];if(el instanceof String){obj_element_new=obj_element_new.concat($(el).get());}else if(!$.is_null(el.field)){var els=$(el.field).get();for(var j=0;j<els.length;j++){var el_new=$.merge_hashes({},el);el_new.element=els[j];obj_element_new.push(el_new);}}else if(!$.is_null(el.element)){obj_element_new.push(el);}}
ALL_ELEMENTS:for(var i=0;i<obj_element_new.length;i++){var e=obj_element_new[i];var type=e.type;if($.is_null(type)&&$.is_null(e.regex))
continue ALL_ELEMENTS;if(!$.is_null(type)&&!$.is_null(jQuery.fn.validate.REGEX[type]))
e.regex=[jQuery.fn.validate.REGEX[type]];else if(type=='date')
e.regex=[jQuery.fn.validate.REGEX.date_long_pre,jQuery.fn.validate.REGEX.date_long_suf,jQuery.fn.validate.REGEX.date_short_pre,jQuery.fn.validate.REGEX.date_short_suf];else if(type=='date_long')
e.regex=[jQuery.fn.validate.REGEX.date_long_pre,jQuery.fn.validate.REGEX.date_long_suf];else if(type=='date_short')
e.regex=[jQuery.fn.validate.REGEX.date_short_pre,jQuery.fn.validate.REGEX.date_short_suf];else if(!$.is_null(e.regex)&&e.regex instanceof Array)
e.regex=e.regex;else if(!$.is_null(e.regex)||!(e.regex instanceof RegExp)){if(e.regex instanceof Function&&e.regex.match(/^regex:(.*)$/))
e.regex=RegExp.$1;e.regex=[e.regex];}else
continue ALL_ELEMENTS;var self=this;var checker=function(self){var e=this;var v=self._get_value(e.element);var ok=true;var options=$.merge_hashes(e,self._params,false);var check_modifier=options.check_modifier;if(e.element.type=='checkbox')
ok=e.element.checked;else{if(!$.is_null(e.default_value)&&v==e.default_value)
v='';if(!(options.empty_ok&&v=='')){try{if(options.min_length&&v.length<options.min_length)
throw new'';if(options.max_length&&v.length>options.max_length)
throw new'';ok=e.regex.length==0;for(var i=0;i<e.regex.length&&!ok;i++)
ok=v.match(e.regex[i])!=null;}catch(e){ok=false}}}
if(check_modifier&&check_modifier instanceof Function)
ok=check_modifier(ok,v,e.element);if(!ok&&e.failure instanceof Function)
e.failure(e.element,self,e.message);else if(ok&&e.success instanceof Function)
e.success(e.element,self);if(ok)
self._params.call_on_success($(e.element).get(0),self);else
self._params.call_on_failure($(e.element).get(0),self,e.message);if(self._all_errors instanceof Array){if(e._error_index){var idx=$.index_of_object(self._all_error_inputs,e.element);while(idx!=null){self._all_errors=$.remove_from_array(self._all_errors,idx);self._all_error_inputs=$.remove_from_array(self._all_error_inputs,idx);idx=$.index_of_object(self._all_error_inputs);}
e._error_index=false;}
if(!ok){e._error_index=true;self._all_errors.push(e.message);self._all_error_inputs.push(e.element);}
if(self.has_errors()){if(self._params.on_errors instanceof Function)
self._params.on_errors(self._all_errors,self._all_error_inputs,self);}else{if(self._params.on_success instanceof Function)
self._params.on_success(self);}}
return ok;}.ref(e,self);res.push([e.element,checker]);}
return res;},_delete_check_field:function(field){var tmpCheckParamArray=new Array();for(i in validator._last_check.check){var currentParam=validator._last_check.check[i];if(currentParam.field!=field){tmpCheckParamArray.push(currentParam);}}
validator._last_check.check=tmpCheckParamArray;},_add_check_field:function(field){validator._last_check.check.push(field);},_get_all_checker:function(params){var checkers=[];for(type in params){checkers=checkers.concat(this._get_all_checkers_for_type(type,params[type]));}
return checkers;},observe:function(params){if($.is_null(params))
params=this._last_check;var element_checkers=this._get_all_checker(params);for(var i=0;i<element_checkers.length;i++){var element=element_checkers[i][0];var checker=element_checkers[i][1];var node=$(element).get(0);if(node.nodeName=='TEXTAREA'||(node.nodeName=='INPUT'&&node.type!='checkbox'&&node.type!='radio')){var call='blur';if(this._params.mode=='instant')
call='keyup';if(this._params.mode=='delayed'&&!$.is_null(this._params.delay)&&this._params.delay>0)
$(element)[call](function(delay){if(this.__delayed_check)
clearTimeout(this.__delayed_check);this.__delayed_check=checker.delayed(delay,this);}.ref(element,this._params.delay));else
$(element)[call](checker);}else if(node.nodeName=='SELECT'||(node.nodeName=='INPUT'&&(node.type=='checkbox'||element.type=='radio'))){if(this._params.mode=='delayed'&&!$.is_null(this._params.delay)&&this._params.delay>0){$(element).change(function(delay){if(this.__delayed_check)
clearTimeout(this.__delayed_check);this.__delayed_check=checker.delayed(delay,this);}.ref(element,this._params.delay));}else
$(element).change(checker);}}
this._last_check=params;return this;},check_fields:function(params,at_least_one_ok){if($.is_null(params))
params=this._last_check;if($.is_null(at_least_one_ok))at_least_one_ok=false;var all_ok=true,i=0;this._all_errors=[];this._all_error_inputs=[];var element_checkers=this._get_all_checker(params);for(i=0;i<element_checkers.length;i++){if(!element_checkers[i][1](this))
all_ok=false;}
if(this._all_errors.length>0){if(this._params.on_errors instanceof Function)
this._params.on_errors(this._all_errors,this._all_error_inputs,this);}
else if(this._params.on_success instanceof Function){this._params.on_success(this);}
this._last_check=params;return all_ok||(i>0&&i<element_checkers.length-1&&at_least_one_ok);},get_error_messages:function(){return this._all_errors;},get_error_inputs:function(){return this._all_error_inputs;},has_errors:function(){return this._all_errors.length>0;}};


/**** AssetPackerHelper::process()  upload.js  ****/


var lastErrorKey=0;function createNewUploader(root_id){var timestamp=(Date.parse(new Date()))/1000;var input='<input type="file" class="file-input" name="filedata" id="file'+timestamp+'"/>';var iframe='<iframe class="iframe" name="file'+timestamp+'iframe" id="file'+timestamp+'iframe"></iframe>';var root_id=root_id;$('#nirvana').prepend(iframe);$('#input-file-box').prepend(input).find(".file-input").change(function(){var t=$(this).attr('id')+'iframe';var url='/ajax/fotos/get_file/'+timestamp+'/'+root_id;$(this).parent().attr('action',url);$(this).parent().attr('target',t);$(this).parent().submit();$(this).remove();$('#new-files').prepend('<div id="new'+timestamp+'"><span class="loader"><b>Bild wird übertragen &hellip;</b></span></div>');getData(timestamp);createNewUploader(root_id);});}
function createNewUserUploader(){$('#select-file').bind('click',function(){$('#user-img-input').mousedown();});$('#tbt_user_userimage_filename').val('');$('#user-img-input').change(function(){$('#form-file-box').submit();$('#form-file-box').addClass('loading-animation');getData('user');});}
function getData(timestamp){var io=$('#file'+timestamp+'iframe').get(0);if($.browser.msie){io.onreadystatechange=function(){if(io.readyState=="complete"){var json=$(io.contentWindow.document).text();showResponse(eval('('+json+')'));io.onreadystatechange=null;}}}else{io.onload=function(){var json=$(io.contentDocument).text();showResponse(eval('('+json+')'));io.onload=null;}}}
function showResponse(data){data.error_msg='Das Bildformat war falsch, bitte verwende .jpg.';if(data.key){$('#new'+data.key+' .loader').fadeOut('slow',function(){$(this).remove();if(lastErrorKey!=0){$('#new'+lastErrorKey).remove();}
if(data.file){lastErrorKey=0;createNewImageBox(data);}else{lastErrorKey=data.key;createErrorBox(data);}
$('#output'+data.key).show();});}else{$('#new-user-image').attr('src',data.file);$('#tbt_user_userimage_filename').val(data.file);$('#form-file-box').removeClass('loading-animation');}}
function createNewImageBox(imgObj){var output='\n\n';output+='<fieldset style="display: none;" id="output'+imgObj.key+'">';output+='<div class="form-box">';output+='<div class="split-left">';output+='<label for="">';output+='<span class="upload-foto"><img src="'+imgObj.file+'" /></span>';output+='<span class="upload-delete"><a href="#" onclick="deleteUploadedImage('+imgObj.key+'); return false;">Löschen</a></span>';output+='</label>';output+='</div>';output+='\n';output+='<div class="split-right">';output+='<label for=""><span>Titel:</span><input name="data[Photo]['+imgObj.img_root_id+'][title]" class="input-long" id="f_title'+imgObj.key+'" type="text" value="" /><em class="error-message">Bitte gib einen Titel zum Bild an.</em></label>';output+='<label for=""><span>Tags:</span><input name="data[Photo]['+imgObj.img_root_id+'][tags]" class="input-long" id="f_tags'+imgObj.key+'" type="text" value="" /><em class="error-message">Bitte gib Schlagwörter zum Bild an.</em></label>';output+='<label for=""><span>Beschreibung:</span><textarea name="data[Photo]['+imgObj.img_root_id+'][text]" class="textarea-tiny" id="f_text'+imgObj.key+'"></textarea></label>';output+='</div>';output+='</div>';output+='</fieldset>';output+='\n\n';$('#new'+imgObj.key).prepend(output);$('#foto-submit').show();}
function createErrorBox(imgObj){var output='<div class="message" style="display: none;" id="output'+imgObj.key+'">'+imgObj.error_msg+'</div>';$('#new'+imgObj.key).prepend(output);}
function deleteUploadedImage(key){$('#new'+key).fadeOut('slow',function(){$(this).remove();});}
function observe(key){window.params={check:[{field:'#f_title'+key,type:'not_empty',min_length:5},{field:'#f_tags'+key,type:'not_empty',min_length:5}]};window.validator=null;window.validator=$('#new-files').observing_validator({call_on_failure:function(input){$(input).parent().addClass('form-error-upload');},call_on_success:function(input){$(input).parent().removeClass('form-error-upload');},on_errors:function(errors,inputs){},on_success:function(){}},params);}


/**** AssetPackerHelper::process()  autocomplete.js  ****/


$.autocomplete=function(input,options){var me=this;var $input=$(input).attr("autocomplete","off");if(options.inputClass)$input.addClass(options.inputClass);var results=document.createElement("div");results.id=options.resultsId;var $results=$(results);var pos=findPos(input);$results.hide().addClass(options.resultsClass);if(options.resultsRelativePos!=true){$results.css({position:"absolute",top:(pos.y+input.offsetHeight)+"px",left:pos.x+"px"});$("body").append(results);}else{$(input).after(results);}
input.autocompleter=me;input.lastSelected=$input.val();var timeout=null;var prev="";var active=-1;var keyb=false;$input.keydown(function(e){switch(e.keyCode){case 38:e.preventDefault();moveSelect(-1);break;case 40:e.preventDefault();moveSelect(1);break;case 13:if(selectCurrent()){e.preventDefault();}
break;default:active=-1;if(timeout)clearTimeout(timeout);timeout=setTimeout(onChange,options.delay);break;}}).blur(function(){hideResults();});if(options.manualSubmit){$(options.manualSubmit).click(function(){requestData($input.val());return false;});}
hideResultsNow();function onChange(){var v=$input.val();if(v==prev)return;prev=v;if(v.length>=options.minChars&&!isEmpty(v)){$('#search-loader').show();requestData(v);}else{$('#search-loader').hide();$results.hide();}};function moveSelect(step){var lis=$("li",results);if(!lis)return;active+=step;if(active<0){active=0;}else if(active>=lis.size()){active=lis.size()-1;}
lis.removeClass("over");$(lis[active]).addClass("over");};function selectCurrent(){var li=$("li.over",results)[0];if(!li){var $li=$("li",results);if(options.selectOnly){if($li.length==1)li=$li[0];}else if(options.selectFirst){li=$li[0];}}
if(li){selectItem(li);return true;}else{return false;}};function selectItem(li){if(!li){li=document.createElement("li");li.extra=[];li.selectValue="";}
var v=$.trim(li.selectValue?li.selectValue:li.innerHTML);input.lastSelected=v;prev=v;$results.html("");$input.val(v);hideResultsNow();if(options.onItemSelect)setTimeout(function(){options.onItemSelect(li)},1);};function hideResults(){if(timeout)clearTimeout(timeout);timeout=setTimeout(hideResultsNow,400);};function hideResultsNow(){if(timeout)clearTimeout(timeout);$('#search-loader').hide();if($results.is(":visible")){$results.hide();}
if(options.mustMatch){var v=$input.val();if(v!=input.lastSelected){selectItem(null);}}};function receiveData(q,data){if(options.beforeResultsFunc){options.beforeResultsFunc(options,data);}
if(data){$('#search-loader').hide();results.innerHTML="";results.appendChild(dataToDom(data));$results.show();}else{hideResultsNow();}};function dataToDom(data){var ul=document.createElement("ul");var num=data.length;if(num==0){$(ul).html("<li>"+options.noResultsMessage+"</li>");}
for(var i=0;i<num;i++){var row=data[i];if(!row)continue;var li=document.createElement("li");if(options.formatItem){li.innerHTML=options.formatItem(row,i,num);li.selectValue=row[0];}else{li.innerHTML=row[0];}
var extra=null;if(row.length>1){extra=[];for(var j=1;j<row.length;j++){extra[extra.length]=row[j];}}
li.extra=extra;ul.appendChild(li);$(li).hover(function(){$("li",ul).removeClass("over");$(this).addClass("over");},function(){$(this).removeClass("over");}).click(function(e){e.preventDefault();e.stopPropagation();selectItem(this)});}
return ul;};function requestData(q){if(options.beforeRequestFunc){options.beforeRequestFunc(options);}
$.ajaxTimeout(9000);$(me).ajaxError(function(request,settings){$('#search-loader').hide();if(options.beforeResultsFunc){options.beforeResultsFunc(options,[]);}});$.getJSON(makeUrl(escape_utf8(q)),function(data){receiveData(q,data);});};function makeUrl(q){var url=options.url+q;for(var i in options.extraParams){url+="/"+options.extraParams[i];}
return url;};this.setExtraParams=function(p){options.extraParams=p;};function findPos(obj){var curleft=obj.offsetLeft||0;var curtop=obj.offsetTop||0;while(obj=obj.offsetParent){curleft+=obj.offsetLeft
curtop+=obj.offsetTop}
return{x:curleft,y:curtop};}}
$.fn.autocomplete=function(url,options){options=options||{};options.url=url;options.inputClass=options.inputClass||"ac_input";options.resultsClass=options.resultsClass||"ac_results";options.resultsRelativePos=options.resultsRelativePos||false;options.minChars=options.minChars||4;options.delay=options.delay||600;options.mustMatch=options.mustMatch||0;options.extraParams=options.extraParams||{};options.loadingClass=options.loadingClass||"ac_loading";options.selectFirst=options.selectFirst||false;options.selectOnly=options.selectOnly||1;options.manualSubmit=options.manualSubmit||false;options.beforeRequestFunc=options.beforeRequestFunc||false;options.beforeResultsFunc=options.beforeResultsFunc||false;options.resultsId=options.resultsId||"results";options.noResultsMessage=options.noResultsMessage||"Keine Ergebnisse";this.each(function(){var input=this;new $.autocomplete(input,options);});return this;}


/**** AssetPackerHelper::process()  swfobject.js  ****/


if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return"";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;


/**** AssetPackerHelper::process()  usergroups.js  ****/


var userActionBoxTimeOut=null;function editGroupDescription(groupRootId){$('#groupDescription').removeClass('editable');loadContentsToDiv('groupDescription','/ajax/UserGroups/editDescription/'+groupRootId);}
function saveGroupDescription(groupRootId){$('#groupDescriptionLoadindicator').fadeIn();$.post('/ajax/UserGroups/editDescription/'+groupRootId+'/','data[tbt_user_groups_description]='+$('#input-text-usergroupdescription').val(),function(result){if(!isEmpty(result)){$('#groupDescription').html(result);$('#groupDescription').addClass('editable');}});}
function loadNewestThreads(groupRootId){url='/ajax/UserGroups/newestThreadsBox/';if(!isEmpty(groupRootId))url+=groupRootId+'/';$('#newestThreadsLoader').fadeIn();loadContentsToDiv('newestThreadsBox',url,null,'newestThreadsLoader');}
function loadMostActiveUsers(groupRootId){url='/ajax/UserGroups/mostActiveUsersBox/';$('#mostactiveUsersLoader').fadeIn();if(!isEmpty(groupRootId))url+=groupRootId+'/';loadContentsToDiv('mostActiveUsersBox',url,null,'mostactiveUsersLoader');}
function updateNewestUserBox(groupRootId){$('#newestUsersLoader').fadeIn();loadContentsToDiv('newestMembersBox','/ajax/UserGroups/newestMembersBox/'+groupRootId+'/',null,'newestUsersLoader');}
function updateMembershipStatusBox(groupRootId){$('#mostactiveUsersLoader').fadeIn();loadContentsToDiv('membershipStatusBox','/ajax/UserGroups/membershipStatusBox/'+groupRootId+'/');}
function showNewThreadForm(groupRootId){loadContentsToDiv('newThread','/ajax/UserGroups/newThreadForm/'+groupRootId+'/');}
function showThreadReplyForm(threadId){loadContentsToDiv('userGroupReply','/ajax/UserGroups/replyForm/'+threadId+'/');}
function requestGroupMembership(groupRootId,groupName,threadId){if(isEmpty(groupName)){var groupName=$('#groupName').html();}
if(isLoggedIn()){$('#groupMembershipStatusLoader').fadeIn();$.getJSON('/ajax/UserGroups/requestMembership/'+groupRootId+'/',null,function(result){if($('#newThread')&&(result.errorCode==3||result.errorCode==0)){if(threadId>0){showThreadReplyForm(threadId);}else{showNewThreadForm(groupRootId);}}else{showUserActionBox(result.errorMessage);}
if(result.errorCode==0){updateNewestUserBox(groupRootId);updateMembershipStatusBox(groupRootId);}
$('#groupMembershipStatusLoader').fadeOut();});}else{var text='Du möchtest Mitglied der Gruppe<br />"'+groupName+'" werden? ';text+='Dazu einfach <a href="/login/">einloggen</a>.<br />Neu hier? <a href="/registrieren/">registrieren</a>';showUserActionBox(text);}}
function deleteGroupMembership(groupRootId){if(isLoggedIn()){$('#groupMembershipStatusLoader').fadeIn();$.getJSON('/ajax/UserGroups/deleteMembership/'+groupRootId+'/',null,function(result){if(result.errorCode>0){showUserActionBox(result);}else{updateMembershipStatusBox(groupRootId);updateNewestUserBox(groupRootId);}});}}
function showUserActionBox(text){if(userActionBoxTimeOut!==null){window.clearTimeout(userActionBoxTimeOut);}
messageLayerId='#userActionBoxMessage';if($(messageLayerId+'/p').html()!=text){$(messageLayerId+'/p').html(text);if($(messageLayerId).css('display')=='none'){$(messageLayerId).slideDown();}
$(messageLayerId).bind('click',function(){hideUserActionBoxMessage();});userActionBoxTimeOut=window.setTimeout("hideUserActionBoxMessage()",10000);}}
function hideUserActionBoxMessage(){window.clearTimeout(userActionBoxTimeOut);userActionBoxTimeOut=null;$('#userActionBoxMessage').slideUp();}


/**** AssetPackerHelper::process()  friends.js  ****/


var userActionBoxTimeOut=null;function approveFriendShip(friendRootId){showOverlayWithUrl('/freunde/bestaetigen/'+friendRootId+'/');}
function rejectFriendShip(friendRootId){showOverlayWithUrl('/freunde/ablehnen/'+friendRootId+'/');}
function deleteFriendShip(friendRootId){showOverlayWithUrl('/freunde/loeschen/'+friendRootId+'/');}
function requestFriendShip(friendRootId,username){var loggedin=($('#loggedin').val()=='1')?1:0;if(loggedin){showOverlayWithUrl('/freunde/hinzufuegen/'+friendRootId+'/');}else{showUserActionBoxMessage('friendLogin',username);}}
function toggleOptionalComment(checkbox){if(checkbox.checked){$('#input-comment-box').slideDown('normal');}else{$('#input-comment-box').slideUp('normal');}}
function refreshUserList(friendRootId){containerName='#friend'+friendRootId;if($(containerName).html()){document.location.reload();}}
function rebuildUserActionBox(action,rootId,username){dellink='<a href="javascript:void(0);" onclick="deleteFriendShip('+rootId+')">Als Freund l&ouml;schen</a>';addlink='<a href="javascript:void(0);" class="button" onclick="requestFriendShip('+rootId+')"><b>Als Freund hinzuf&uuml;gen</b></a>&nbsp;';switch(action){case'request':var html='Du hast '+username+' als Freund hinzugef&uuml;gt<br />';html+=username+' muss die Freundschaft noch best&auml;tigen<br />';html+=dellink;$('#content-user-box-link-left/a').fadeOut();break;case'reject':case'delete':var html='';$('#content-user-box-link-left').html(addlink);$('#content-user-box-link-left/a').fadeIn();break;case'approve':var html=username+' geh&ouml;rt zu Deinen Freunden.<br />'+dellink;break;default:return;break;}
showUserActionBoxMessage(action,username);$('#content-user-box-text').animate({opacity:1},'normal',null,function(){$(this).html(html).fadeIn('normal');});}
function showUserActionBoxMessage(action,username){if(userActionBoxTimeOut!==null){window.clearTimeout(userActionBoxTimeOut);}
var messageLayerId='#userActionBoxMessage';var registerLink='<a href="/registrieren/" title="Kostenlos registrieren">Kostenlos registrieren</a>';var loginLink='<a href="/login/" title="Jetzt einloggen">einloggen</a>';switch(action){case'login':case'messageLogin':var text='Du m&ouml;chtest '+username+' eine Nachricht schicken?<br />Dazu einfach '+loginLink+'. Neu hier? '+registerLink+'.';break;case'friendLogin':var text='Du m&ouml;chtest '+username+' als Freund hinzuf&uuml;gen?<br /> Dazu einfach '+loginLink+'. Neu hier? '+registerLink+'.';break;case'reject':var text='Du hast die Freundschaft abgelehnt.';break;case'delete':var text='Du hast die Freundschaft gel&ouml;scht.';break;default:return;break;}
if($(messageLayerId+'/p').html()!=text){$(messageLayerId+'/p').html(text);if($(messageLayerId).css('display')=='none'){$(messageLayerId).slideDown();}
$(messageLayerId).bind('click',function(){hideUserActionBoxMessage();});userActionBoxTimeOut=window.setTimeout("hideUserActionBoxMessage()",5000);}}
function hideUserActionBoxMessage(){window.clearTimeout(userActionBoxTimeOut);userActionBoxTimeOut=null;$('#userActionBoxMessage').slideUp();}
function sendFriendRequest(action,friendRootId,friendName){if(action.length<1)return;if(friendRootId.length<1)return;requestUrl='/ajax/friends/'+action+'/'+friendRootId;params={sendmessage:($('#input-sendmessage').length!=0)?$('#input-sendmessage').get(0).checked:false,message:$('#input-comment').val(),friendRootId:friendRootId};$.post(requestUrl,params,function(result){if(result&&result.length>0){$('#message').html(result);$('#message').show();}else{hideOverlay();if($('#approveFriendShipInMessage').html())$('#approveFriendShipInMessage').slideUp();refreshUserList(friendRootId);rebuildUserActionBox(action,friendRootId,friendName);}});}


/**** AssetPackerHelper::process()  map.js  ****/


function initRegionEditor(){console.debug('hier');bagOrangeIcon=new GIcon();bagOrangeIcon.image=tbt.mediaServer+'img/icon/kof_orange.png';bagOrangeIcon.shadow=tbt.mediaServer+'img/icon/kof_schatten.png';bagOrangeIcon.iconSize=new GSize(13,14);bagOrangeIcon.shadowSize=new GSize(25,14);bagOrangeIcon.iconAnchor=new GPoint(13,14);bagOrangeIcon.infoWindowAnchor=new GPoint(11,16);bagYellowIcon=new GIcon();bagYellowIcon.image=tbt.mediaServer+'img/icon/kof_gelb.png';bagYellowIcon.shadow=tbt.mediaServer+'img/icon/kof_schatten.png';bagYellowIcon.iconSize=new GSize(13,14);bagYellowIcon.shadowSize=new GSize(25,14);bagYellowIcon.iconAnchor=new GPoint(13,14);bagYellowIcon.infoWindowAnchor=new GPoint(11,16);markerBagOrange={icon:bagOrangeIcon};markerBagYellow={icon:bagYellowIcon};if(GBrowserIsCompatible()){map=new GMap2(document.getElementById('locationPickMap'));map.addControl(new GLargeMapControl());map.setCenter(new GLatLng(38.4937034786013,27.4366226196289),3);map.addMapType(G_PHYSICAL_MAP);map.addControl(new GMenuMapTypeControl());}
initializeMapClick();var polygonFormValidator=createNewFormValidator('polygonForm',{check:[{field:'#GeoShapeName',regex:/^(.|\s){3,}/}]});$('#map-icon-save').click(function(){var polygonData=getPolygonData();if(!polygonData){alert('In der Karte ist keine Region vorhanden.');}
var countries=[];$('#polygonForm input[type=\'checkbox\']').each(function(){if(this.checked){countries.push($(this).attr('id')-0);}});if(polygonFormValidator.check_fields()||!polygonData){saveGeoShape(window.geoShapeUid,polygonData.points,countries,$('#GeoShapeName').val(),$('#GeoShapeAlternativeNames').val(),polygonData.area);}});sTypeAction='hand';$('#map-icon-hand').click(function(){setHand();});$('#map-icon-point').click(function(){setPoint();});$('#map-icon-polyline').click(function(){setPolyline();});$('#map-icon-polygon').click(function(){setPolygon();});$('#map-icon-clear').click(function(){deleteAllDrawings();});if(!window.geoShapeUid){$('#map-icon-show-places').attr('disabled','disabled');$('#map-icon-show-destinations').attr('disabled','disabled');}
sStrokeColor='#FFA200';iStrokeWeight=5;fStrokeOpacity=0.6;sFillColor='#FFA200';fFillOpacity='0.4';}
function setActive(_type){$('#map-icon-hand').css('opacity',0.3);$('#map-icon-point').css('opacity',0.3);$('#map-icon-polyline').css('opacity',0.3);$('#map-icon-polygon').css('opacity',0.3);$('#'+_type).css('opacity','');}
function setHand(){sTypeAction='hand';setActive('map-icon-hand');}
function setPoint(){sTypeAction='point';setActive('map-icon-point');}
function setPolyline(){sTypeAction='polyline';setActive('map-icon-polyline');}
function setPolygon(){sTypeAction='polygon';setActive('map-icon-polygon');}
function initializeMapClick(){console.debug('initializeMapClick',map);polygon='';aMapPoints=new Array();polyline=new Array();markerPoly=new Array();iCounter=0;var point=new Array();var points=new Array();GEvent.addListener(map,'click',function(marker,point){console.debug('click',sTypeAction);if(sTypeAction=='hand'){return false;}
if(marker){changeMarkerOrder(marker);return false;}
switch(sTypeAction){case'point':if(iCounter==0){setMarker(point,bagOrangeIcon);GEvent.addListener(markerPoly[iCounter],'dragend',function(){drawPoint();});iCounter++;}
drawPoint();break;case'polyline':setMarker(point,bagOrangeIcon);GEvent.addListener(markerPoly[iCounter],'dragend',function(){drawPolyline();});drawPolyline();iCounter++;break;case'polygon':setMarker(point,bagOrangeIcon);GEvent.addListener(markerPoly[iCounter],'dragend',function(){var points=getPolygonPointsFromMap();drawPolygon(points);});var points=getPolygonPointsFromMap();drawPolygon(points);iCounter++;break;}});}
function deleteAllDrawings(){for(var i=0;i<markerPoly.length;i++){map.removeOverlay(markerPoly[i]);}
if(polygon){map.removeOverlay(polygon);}
markerPoly=new Array;iCounter=0;}
function changeMarkerOrder(marker){var changeLastTo='';if(marker.fill!=true){for(i=0;i<markerPoly.length;i++){if(markerPoly[i].getPoint()==marker.getPoint()){changeLastTo=i;}}}
if(changeLastTo!=''){var iNumber=iCounter-1;var icon=bagOrangeIcon;changeMarker(iNumber,icon);iNumber=0;changeMarker(iNumber,icon);var markerPolyTmp=markerPoly;markerPoly=new Array;for(i=(changeLastTo+1),j=0;i<markerPolyTmp.length;i++,j++){markerPoly[j]=markerPolyTmp[i];}
for(i=0,j=j;i<changeLastTo+1;i++,j++){markerPoly[j]=markerPolyTmp[i];}
var points=getPolygonPointsFromMap();var iNumber=iCounter-1;var icon=bagYellowIcon;changeMarker(iNumber,icon);iNumber=0;changeMarker(iNumber,icon);drawPolygon(points);}}
function changeMarker(_iNumber,_oIcon){map.removeOverlay(markerPoly[_iNumber]);markerPoly[_iNumber]=new GMarker(aMapPoints[_iNumber]['point'],{icon:_oIcon,draggable:true});map.addOverlay(markerPoly[_iNumber]);markerPoly[_iNumber].enableDragging();GEvent.addListener(markerPoly[_iNumber],'dragend',function(){var points=getPolygonPointsFromMap();drawPolygon(points);});}
function setMarker(point){if(iCounter!=0&&iCounter!=1){var iNumber=iCounter-1;var icon=bagOrangeIcon;changeMarker(iNumber,icon);}
aMapPoints[iCounter]=new Object();aMapPoints[iCounter]['point']=point;markerPoly[iCounter]=new GMarker(point,{icon:bagYellowIcon,draggable:true});map.addOverlay(markerPoly[iCounter]);markerPoly[iCounter].enableDragging();}
function drawPoint(){if(polygon){map.removeOverlay(polygon);}
if(polyline){map.removeOverlay(polyline);}
for(var i=1;i<markerPoly.length;i++){map.removeOverlay(markerPoly[i]);}}
function drawPolygon(points){setPolygon();polygon=new GPolygon(points,sStrokeColor,iStrokeWeight,fStrokeOpacity,sFillColor,fFillOpacity);map.addOverlay(polygon);}
function zoomToPolygonBounds(){if(!window.polygon){return;}
var bounds=polygon.getBounds();map.setCenter(bounds.getCenter(),map.getBoundsZoomLevel(bounds));}
function getPolygonPointsFromMap(){aMapPoints[0]['point']=markerPoly[0].getPoint();points=new Array();points.push(markerPoly[0].getPoint());if(polygon){map.removeOverlay(polygon);}
for(var i=1;i<markerPoly.length;i++){points.push(markerPoly[i].getPoint());aMapPoints[i]['point']=markerPoly[i].getPoint();}
points.push(markerPoly[0].getPoint());return points;}
function drawPolyline(){aMapPoints[0]['point']=markerPoly[0].getPoint();if(polygon){map.removeOverlay(polygon);}
var points=new Array();for(var i=0;i<markerPoly.length;i++){if(polyline){map.removeOverlay(polyline);}
points.push(markerPoly[i].getPoint());aMapPoints[i]['point']=markerPoly[i].getPoint();polyline=new GPolyline(points,sStrokeColor,iStrokeWeight,fStrokeOpacity);map.addOverlay(polyline);}}
function getPointList(){switch(sTypeAction){case'hand':return false;break;case'point':var boundingbox=new GLatLngBounds(new GLatLng((markerPoly[0].getPoint()).lat(),(markerPoly[0].getPoint()).lng()),new GLatLng((markerPoly[0].getPoint()).lat(),(markerPoly[0].getPoint()).lng()));var pointList=markerPoly[0].getPoint();break;case'polyline':var length=window.polyline.getLength();console.log('length',length);var vertices=getVertices(window.polyline);var boundingbox=window['polygon'].getBounds();break;}}
function getPolygonData(){if(window.polygon==''){return false;}
var vertices=getVertices(window.polygon);var area=window['polygon'].getArea();return{points:vertices,area:area};}
function saveGeoShape(uid,vertices,countries,name,alternative_names,area,length){area=area||0;length=length||0;name=name||'';alternative_names=alternative_names||'';var boundingbox=window['polygon'].getBounds();var boundingBoxCenter=boundingbox.getCenter();var centerCoordinates={x:boundingBoxCenter.lng(),y:boundingBoxCenter.lat()};var data={top:(boundingbox.getNorthEast()).lat(),right:(boundingbox.getNorthEast()).lng(),bottom:(boundingbox.getSouthWest()).lat(),left:(boundingbox.getSouthWest()).lng(),center:$.toJSON(centerCoordinates),path:$.toJSON(vertices),type:sTypeAction,name:name,alternative_names:alternative_names,zoom_level:map.getZoom(),countries:$.toJSON(countries)};if(area>0){data.area=area;}
if(length>0){data.length=length;}
console.log('data',data);tbtAjaxCall('/administrator/admin_geo_shape/save/'+(uid||''),data,{onOk:function(data){$('#save-loader-icon').hide();console.debug(data);var timestamp=new Date().getTime();document.location.href='/administrator/admin_geo_shape/?'+timestamp;},onError:function(data){$('#save-loader-icon').hide();alert('ERROR: '+data.message);}});$('#save-loader-icon').show();return true;}
function getVertices(object){var vertices=[];for(var i=0;i<object.getVertexCount();i++){var vertex=object.getVertex(i);vertices.push({x:vertex.x,y:vertex.y});}
return vertices;}
function drawMarker(objectPath){for(var i=0;i<objectPath.length-1;i++){var point=new GLatLng(objectPath[i].y,objectPath[i].x)
iCounter=i;var bagIcon=bagOrangeIcon;if(i==objectPath.length-1){bagIcon=bagYellowIcon;}
setMarker(point,bagIcon);GEvent.addListener(markerPoly[i],'dragend',function(){var points=getPolygonPointsFromMap();drawPolygon(points);});}
iCounter++;return true;}
function getPolygonMapZoomLevel(object){return map.getBoundsZoomLevel(object.getBounds());}
function getPointsFromDb(objectPath){var points=[];for(var i=0;i<objectPath.length;i++){var point=new GLatLng(objectPath[i].y,objectPath[i].x)
points.push(point);}
return points;}
function showObjects(objectType){tbtAjaxCall('/administrator/admin_geo_shape/getObjects/'+geoShapeUid+'/'+objectType,null,{onOk:findObjectsOk,onError:function(data){$('#map-places-count').html('ERROR: '+data.message);}});$('#map-places-count').html('<img src="'+tbt.mediaServer+'img/ajax_loader_blue_white.gif" /> '+objectType+' werden geladen...');}
function findObjects(objectType){var polygonData=getPolygonData();if(!polygonData){alert('In der Karte ist keine Region vorhanden.');}
var boundingbox=window['polygon'].getBounds();var data={top:(boundingbox.getNorthEast()).lat(),right:(boundingbox.getNorthEast()).lng(),bottom:(boundingbox.getSouthWest()).lat(),left:(boundingbox.getSouthWest()).lng(),path:$.toJSON(polygonData.points)};console.debug('data: ',data);tbtAjaxCall('/administrator/admin_geo_shape/find/'+objectType,data,{onOk:findObjectsOk,onError:function(data){$('#map-places-count').html('ERROR: '+data.message);}});$('#map-places-count').html('<img src="'+tbt.mediaServer+'img/ajax_loader_blue_white.gif" /> '+objectType+' werden gesucht...');}
function findObjectsOk(response){if(!response.data||!response.data.objects){alert('ERROR: Keine Object-Liste im Suchergebnis');return;}
var objects=response.data.objects;$('#map-places-count').html('Objekte gefunden: '+objects.length);if(window.mapObjectMarkers){for(var i=mapObjectMarkers.length-1;i>-1;i--){map.removeOverlay(mapObjectMarkers[i]);}}
mapObjectMarkers=[];var icon=new GIcon();icon.image=tbt.mediaServer+'img/icon/kof_gruen.gif';icon.shadow=tbt.mediaServer+'img/icon/kof_schatten.png';icon.iconSize=new GSize(13,14);icon.shadowSize=new GSize(25,14);icon.iconAnchor=new GPoint(13,14);icon.infoWindowAnchor=new GPoint(11,16);var n=Math.min(objects.length-1,2000);for(var i=n;i>-1;i--){var o=objects[i];var point=new GLatLng(o.lat,o.lng);var marker=new GMarker(point,{icon:icon,title:o.name+'; uid: '+o.uid+'; '+o.lat+','+o.lng});mapObjectMarkers.push(marker);map.addOverlay(marker);}
if(n!=objects.length-1){$('#map-places-count').html($('#map-places-count').html()+'  angezeigt: '+(n));}}
if(!window.tbt){tbt=window.tbt={};}
tbt.PlaceMap=function(){this.__ID=tbt.PlaceMap.__ID__++;tbt.PlaceMap.__instances__[this.__ID]=this;this.imgPath="/img/icon/";this.zoomLevel=14;try{this.center=new GLatLng();this.data=null;this.ajaxService='/experten/place/savePosition';this.marker=null;}catch(e){console.error(e);throw e;}}
tbt.PlaceMap.__instances__=[];tbt.PlaceMap.__ID__=0;tbt.PlaceMap.call=function(id,method,data){return tbt.PlaceMap.__instances__[id][method](data);}
tbt.PlaceMap.prototype.renderInfoWindowContent=function(data){return"TODO overwrite ";}
tbt.PlaceMap.prototype.getUid=function(){alert("tbt.PlaceMap.getUid() is abstract!");return-1;}
tbt.PlaceMap.prototype.show=function(htmlElement){try{var _this=this;var icon=new GIcon();icon.image=this.imgPath+'kof_gelb.png';icon.shadow=this.imgPath+'kof_schatten.png';icon.iconSize=new GSize(13,14);icon.shadowSize=new GSize(25,14);icon.iconAnchor=new GPoint(13,14);icon.infoWindowAnchor=new GPoint(11,16);var markerOpts={icon:icon,draggable:true};this.marker=new GMarker(this.center,markerOpts);GEvent.addListener(this.marker,'dragstart',function(){_this.map.closeInfoWindow();});GEvent.addListener(this.marker,'dragend',function(){var position=_this.marker.getLatLng();_this.map.panTo(position);var listener=null;var onMoveEnd=function(){GEvent.removeListener(listener);_this.invalidate(position);_this.map.savePosition();}
listener=GEvent.addListener(_this.map,'moveend',onMoveEnd);});this.map=new GMap2(htmlElement);this.map.addControl(new GLargeMapControl());this.map.addMapType(G_PHYSICAL_MAP);this.map.addControl(new GMenuMapTypeControl());this.map.setCenter(this.center,this.zoomLevel);this.map.addOverlay(this.marker);if(this.data){var details=this.renderInfoWindowContent(this.data);this.marker.bindInfoWindowHtml(details);this.marker.openInfoWindow(details);}}catch(e){console.error(e);htmlElement.innerHTML='<p>Sorry, die Karte funktioniert z.Zt. nicht.</p><p>Usere Programmierer arbeiten dran.</p>'}}
tbt.PlaceMap.prototype.invalidate=function(point){console.log('invalidate('+point.lat()+','+point.lng()+')');this.marker.openInfoWindowHtml(['<div id="PlaceMap_save_',this.__ID,'">','<a href="javascript:void(false)" onclick="tbt.PlaceMap.call(',this.__ID,', \'savePosition\')">Position speichern...</a>','<img id="PlaceMap_save_loader_',this.__ID,'" src="/img/ajax_loader_blue_white.gif" style="visibility:hidden;" />','</div>'].join(''));}
tbt.PlaceMap.prototype.savePosition=function(){var position=this.marker.getLatLng();console.log('savePosition()',position.lat()+','+position.lng());$('#PlaceMap_save_loader_'+this.__ID).css('visibility','visible');var _this=this;tbtAjaxCall(this.ajaxService,{uid:_this.getUid(this.data),lat:position.lat(),lng:position.lng()},{onOk:function(result){_this.onOk(result)},onError:function(result){_this.onError(result)},onEnd:function(result){$('#PlaceMap_save_loader_'+_this.__ID).css('visibility','hidden')}});}
tbt.PlaceMap.prototype.onOk=function(result){console.log(['onOk()',result]);$('#PlaceMap_save_'+this.__ID).html('Ok.<br />Position wurde gespeichert.');}
tbt.PlaceMap.prototype.onError=function(result){console.log(['onError()',result])
$('#PlaceMap_save_'+this.__ID).html('FEHLER.<br />Die Position konnte nicht gespeichert werden!');}
tbt.GeoCoderMap=function(htmlElement){this.__ID=tbt.GeoCoderMap.__ID__++;tbt.GeoCoderMap.__instances__[this.__ID]=this;this.map=null;this.geocoder=null;this.container=htmlElement;this.ADDRESS_ZOOM=16;this.CITY_ZOOM=5;this.zoomLevel=this.CITY_ZOOM;this.imgPath=window.tbt.mediaServer+"img/icon/";}
tbt.GeoCoderMap.__instances__=[];tbt.GeoCoderMap.__ID__=0;tbt.GeoCoderMap.call=function(id,method,data){return tbt.GeoCoderMap.__instances__[id][method](data);}
tbt.GeoCoderMap.prototype.gLargeMap=function(){this.map.addControl(new GLargeMapControl());};tbt.GeoCoderMap.prototype.gTypeMap=function(){this.map.addControl(new GMapTypeControl());};tbt.GeoCoderMap.prototype.gMenuTypeMap=function(){this.map.addMapType(G_PHYSICAL_MAP);this.map.addControl(new GMenuMapTypeControl());};tbt.GeoCoderMap.prototype.gScaleMap=function(){this.map.addControl(new GScaleControl());};tbt.GeoCoderMap.prototype.gOverviewMap=function(){this.map.addControl(new GOverviewMapControl())};tbt.GeoCoderMap.prototype.gHierarchicalTypeMap=function(){this.map.addControl(new GHierarchicalMapTypeControl());};tbt.GeoCoderMap.prototype.gSetMapType=function(type){this.map.setMapType(type);};tbt.GeoCoderMap.prototype.findAddress=function(queryString){this.zoomLevel=this.ADDRESS_ZOOM;this._find(queryString);}
tbt.GeoCoderMap.prototype.findCity=function(queryString){this.zoomLevel=this.CITY_ZOOM;this._find(queryString);}
tbt.GeoCoderMap.prototype._find=function(queryString){this._initMap();if(!this.geocoder){console.error('tbt.GeoCoderMap._find() gecoder not initialized');return;}
this.address=queryString;var _this=this;this.geocoder.getLatLng(queryString,function(point){_this._onResult(point)});}
tbt.GeoCoderMap.prototype._onResult=function(point){if(point){console.log(['tbt.GeoCoderMap._onResult() '+this.address,point]);if($('#goole-poi-position')){$('#goole-poi-position').html('lat=<b>'+point.y+'</b> lng=<b>'+point.x+'</b>  (google)    <a href="javascript:void(0)" onclick="saveGoogleGeoPosition(\''+point.y+'\',\''+point.x+'\')">übernehmen</a>');}
this.onSuccess(point);}else{console.error(this.address+' nicht gefunden!');this.onFailure();}}
tbt.GeoCoderMap.prototype.onSuccess=function(point){this.showLocation(point);}
tbt.GeoCoderMap.prototype.onFailure=function(point){}
tbt.GeoCoderMap.prototype._initMap=function(){if(this.map){return;}
this.map=new GMap2(this.container);this.geocoder=new GClientGeocoder();}
tbt.GeoCoderMap.prototype.addListenerReloadBoundingBoxPlaces=function(placeUidToExclude){doNotReloadBoundingBoxPlaces=false;_this=this;var map=this.map;GEvent.addListener(map,'infowindowopen',function(){doNotReloadBoundingBoxPlaces=true;});GEvent.addListener(map,'moveend',function(){if(doNotReloadBoundingBoxPlaces){doNotReloadBoundingBoxPlaces=false;return false;}
var zoomLevel=this.getZoom();if(zoomLevel<12)return false;$('#overlay-map').css('opacity',0.5);$('#googleMapOverlayHeadAjaxLoader').show();this.disableDragging();this.disableScrollWheelZoom();var bounds=this.getBounds();var southWest=bounds.getSouthWest();var northEast=bounds.getNorthEast();var url='/googleMap/'+'ajaxGetBoundingBoxPlaces/';var data={bounds:{left:southWest.lng(),right:northEast.lng(),bottom:southWest.lat(),top:northEast.lat()},placeUidToExclude:placeUidToExclude};tbtAjaxCall(url,{data:$.toJSON(data)},{onOk:function(json){if(initialPlaces){_this.addObjects(initialPlaces,initialZoomOnBoundingBox);}
if(json.places.length>0){_this.addObjects(json.places,false);}},onError:function(json){alert('Fehler');},onEnd:function(json){_this.clearMap();$('#overlay-map').css('opacity',1);$('#googleMapOverlayHeadAjaxLoader').hide();_this.map.enableDragging();_this.map.enableScrollWheelZoom();}});});}
tbt.GeoCoderMap.prototype.findLocation=function(queryString){this.zoomLevel=this.CITY_ZOOM;this._findLocation(queryString);}
tbt.GeoCoderMap.prototype._findLocation=function(queryString){this._initMap();if(!this.geocoder){console.error('tbt.GeoCoderMap._findLocation() gecoder not initialized');return;}
this.address=queryString;var _this=this;this.geocoder.getLocations(queryString,function(result){_this._onResultLocation(result);});}
tbt.GeoCoderMap.prototype._setResult=function(result){alert('_setResult result '+result);}
tbt.GeoCoderMap.prototype._onResultLocation=function(result){if(result.Status.code==200){this.onSuccessLocation(result);}else{console.error(this.address+' location nicht gefunden! status.code: '+result.Status.code);this.onFailureLocation();}}
tbt.GeoCoderMap.prototype.onSuccessLocation=function(result){}
tbt.GeoCoderMap.prototype.onFailureLocation=function(result){}
tbt.GeoCoderMap.prototype.clearMap=function(result){this.map.clearOverlays();}
tbt.GeoCoderMap.prototype.panLocation=function(point,infoData){this.map.panTo(point);this.map.clearOverlays();if(this.tbtBagIcon){var marker=new GMarker(point,{icon:this.tbtBagIcon});}else{var marker=new GMarker(point);}
this.map.addOverlay(marker);if(infoData&&infoData!=''){marker.openInfoWindowHtml(this.renderInfoHtml(infoData));}}
tbt.GeoCoderMap.prototype.setCenter=function(point,zoom){zoom=zoom||this.zoomLevel;this._initMap();this.map.setCenter(point,zoom);}
tbt.GeoCoderMap.prototype.buildPlacesBubble=function(place){var typeString='';if(place.type&&place.type!=''){var typeString=' ('+place.type+')';}
var infoText='<a class="txt-14" href="'+place.encodedUrl+'" '+place.target+'><b>'+place.name+'</b></a> '+typeString;if(place.text!=''){infoText+='<br /><br />'+place.text;infoText+=' <a href="'+place.encodedUrl+'" '+place.target+'><b>mehr</b></a>';}
if(place.likeit==1){infoText+='<br /><br />1 Mitglied mag diesen Tipp.';}
if(place.likeit>1){infoText+='<br /><br />'+place.likeit+' Mitglieder mögen diesen Tipp.';}
return infoText;}
tbt.GeoCoderMap.prototype.buildDestinationsBubble=function(destination){var infoText='<a class="txt-14" href="'+destination.encodedUrl+'" '+destination.target+'><b>Hidden Places '+destination.name+'</b></a>';if(destination.likeit==1){infoText+='<br /><br />1 Mitglied mag '+destination.name+'.';}
if(destination.likeit>1){infoText+='<br /><br />'+destination.likeit+' Mitglieder mögen '+destination.name+'.';}
return infoText;}
tbt.GeoCoderMap.prototype.addObjects=function(objects,zoomOnBoundingBox){this._initMap();var bbox;for(var i=0;i<objects.length;i++){this.setTbtIconStandardOrange();if(objects[i].bagIcon){var setIconMethod='set'+objects[i].bagIcon;eval('this.'+setIconMethod+'()');}
if(objects[i].hideOnMap&&objects[i].hideOnMap==1)continue;if(objects[i].urltarget){objects[i].target='target="'+objects[i].urltarget+'"';}else{objects[i].target='';}
var point=new GLatLng(objects[i].lat,objects[i].lng);var typeString='';var nameString='';if(this.tbtBagIcon){var titleString=objects[i].name;if(objects[i].type&&objects[i].type!=''){var typeString=' ('+objects[i].type+')';}
if(objects[i].username&&objects[i].username!=''){var nameString=', '+objects[i].username;}
var marker=new GMarker(point,{icon:this.tbtBagIcon,title:titleString+typeString+nameString});}
else{var marker=new GMarker(point);}
switch(objects[i].objectType){case'destinations':var bubbleString=this.buildDestinationsBubble(objects[i]);break;case'places':var bubbleString=this.buildPlacesBubble(objects[i]);break;}
if(objects[i].encodedUrl){marker.bubbleString=bubbleString;GEvent.addListener(marker,'click',function(event){this.openInfoWindowHtml(this.bubbleString,{maxWidth:275});});}
this.map.addOverlay(marker);if(bbox==null){bbox=new GLatLngBounds(point);}else{bbox.extend(point);}}
if(zoomOnBoundingBox){this.centerAndZoomOnBounds(bbox);}}
tbt.GeoCoderMap.prototype.showLocation=function(point,infoData,zoom){zoom=zoom||this.zoomLevel;this._initMap();if(!(point instanceof GLatLng)){point=new GLatLng(point.lat,point.lng);}
this.map.setCenter(point,zoom);this.map.clearOverlays();if(this.tbtBagIcon){var marker=new GMarker(point,{icon:this.tbtBagIcon});}else{var marker=new GMarker(point);}
this.map.addOverlay(marker);if(infoData&&infoData!=''){marker.openInfoWindowHtml(this.renderInfoHtml(infoData));}};tbt.GeoCoderMap.prototype.centerAndZoomOnBounds=function(bounds){this.map.setCenter(bounds.getCenter(),this.map.getBoundsZoomLevel(bounds));};tbt.GeoCoderMap.prototype.setTbtIcon=function(style){this.tbtBagIcon=new GIcon();this.tbtBagIcon.image=this.imgPath+'kof_'+style+'.png';this.tbtBagIcon.shadow=this.imgPath+'kof_schatten.png';this.tbtBagIcon.iconSize=new GSize(13,14);this.tbtBagIcon.shadowSize=new GSize(25,14);this.tbtBagIcon.iconAnchor=new GPoint(13,14);this.tbtBagIcon.infoWindowAnchor=new GPoint(11,16);};tbt.GeoCoderMap.prototype.setTbtIconBigRed=function(){this.tbtBagIcon=new GIcon();this.tbtBagIcon.image=this.imgPath+'kof_red_big.png';this.tbtBagIcon.iconSize=new GSize(70,41);this.tbtBagIcon.iconAnchor=new GPoint(35,41);this.tbtBagIcon.infoWindowAnchor=new GPoint(35,41);};tbt.GeoCoderMap.prototype.setTbtIconStandardRed=function(){this.tbtBagIcon=new GIcon();this.tbtBagIcon.image=this.imgPath+'kof_small_red.png';this.tbtBagIcon.shadow=this.imgPath+'kof_small_schatten.png';this.tbtBagIcon.iconSize=new GSize(17,20);this.tbtBagIcon.shadowSize=new GSize(33,20);this.tbtBagIcon.iconAnchor=new GPoint(17,20);this.tbtBagIcon.infoWindowAnchor=new GPoint(17,20);};tbt.GeoCoderMap.prototype.setTbtIconStandardYellow=function(){this.tbtBagIcon=new GIcon();this.tbtBagIcon.image=this.imgPath+'kof_small_yellow.png';this.tbtBagIcon.shadow=this.imgPath+'kof_small_schatten.png';this.tbtBagIcon.iconSize=new GSize(17,20);this.tbtBagIcon.shadowSize=new GSize(33,20);this.tbtBagIcon.iconAnchor=new GPoint(17,20);this.tbtBagIcon.infoWindowAnchor=new GPoint(17,20);};tbt.GeoCoderMap.prototype.setTbtIconStandardOrange=function(){this.tbtBagIcon=new GIcon();this.tbtBagIcon.image=this.imgPath+'kof_small_orange.png';this.tbtBagIcon.shadow=this.imgPath+'kof_small_schatten.png';this.tbtBagIcon.iconSize=new GSize(17,20);this.tbtBagIcon.shadowSize=new GSize(33,20);this.tbtBagIcon.iconAnchor=new GPoint(17,20);this.tbtBagIcon.infoWindowAnchor=new GPoint(17,20);};tbt.GeoCoderMap.prototype.showMultipleLocation=function(point,infoData){if(!(point instanceof GLatLng)){point=new GLatLng(point.lat,point.lng);}
this.setTbtIcon('blau');var marker=new GMarker(point,{icon:this.tbtBagIcon});this.map.addOverlay(marker);var _this=this;if(infoData){GEvent.addListener(marker,'click',function(){marker.openInfoWindowHtml(infoData);_this.map.setCenter(point);});}};tbt.GeoCoderMap.prototype.renderInfoHtml=function(infoData){if(!infoData){return'kein Daten';}
return infoData.split(/,/).join('<br />');};tbt.GeoCoderMap.prototype.initializeGSearch=function(){this.GSearch=new google.search.SearchControl();options=new google.search.SearcherOptions();options.setExpandMode(google.search.SearchControl.EXPAND_MODE_OPEN);this.GSearch.addSearcher(new google.search.LocalSearch(),options);this.GSearch.setOnKeepCallback(this,this.customerResultMethod,"view on map");this.GSearch.draw(document.getElementById("searchcontrol"));this.GSearch.execute("freischwimmer+berlin");};tbt.GeoCoderMap.prototype.customerResultMethod=function(result){console.log([result]);};tbt.map=function(_htmlElement,_uid){this.map=null;this.container=document.getElementById(_htmlElement);this.zoomLevel=15;this.imgPath=window.tbt.mediaServer+"img/icon/";this.uid=_uid;this.marker=new Array();bagOrangeIcon=new GIcon();bagOrangeIcon.image=this.imgPath+'kof_orange.png';bagOrangeIcon.shadow=this.imgPath+'kof_schatten.png';bagOrangeIcon.iconSize=new GSize(13,14);bagOrangeIcon.shadowSize=new GSize(25,14);bagOrangeIcon.iconAnchor=new GPoint(13,14);bagOrangeIcon.infoWindowAnchor=new GPoint(11,16);this.markerBagOrange={icon:bagOrangeIcon};bagGreenIcon=new GIcon();bagGreenIcon.image=this.imgPath+'kof_gruen.png';bagGreenIcon.shadow=this.imgPath+'kof_schatten.png';bagGreenIcon.iconSize=new GSize(13,14);bagGreenIcon.shadowSize=new GSize(25,14);bagGreenIcon.iconAnchor=new GPoint(13,14);bagGreenIcon.infoWindowAnchor=new GPoint(11,16);this.markerBagGreen={icon:bagGreenIcon};};tbt.map.prototype._initMap=function(){if(this.map){return;}
this.initializeMap();}
tbt.map.prototype.initializeMap=function(){this.map=new GMap2(this.container);this.map.enableScrollWheelZoom();};tbt.map.prototype.gLargeMap=function(){this.map.addControl(new GLargeMapControl());};tbt.map.prototype.gTypeMap=function(){this.map.addControl(new GMapTypeControl());};tbt.map.prototype.gMenuTypeMap=function(){this.map.addMapType(G_PHYSICAL_MAP);this.map.addControl(new GMenuMapTypeControl());};tbt.map.prototype.gScaleMap=function(){this.map.addControl(new GScaleControl());};tbt.map.prototype.gOverviewMap=function(){this.map.addControl(new GOverviewMapControl())};tbt.map.prototype.gHierarchicalTypeMap=function(){this.map.addControl(new GHierarchicalMapTypeControl());};tbt.map.prototype.gSetPoint=function(_lat,_long){var point=new GLatLng(_lat,_long);return point;};tbt.map.prototype.gSetCenter=function(_point,_factor){_factor=1.0*_factor;this.map.setCenter(_point,_factor);};tbt.map.prototype.gGMarker=function(_point){var marker=new GMarker(_point,this.tbtBagIcon);this.map.addOverlay(marker);};tbt.map.prototype.setTbtIconStandardRed=function(){this.tbtBagIcon=new GIcon();this.tbtBagIcon.image=this.imgPath+'kof_red_standard.png';this.tbtBagIcon.iconSize=new GSize(32,23);this.tbtBagIcon.iconAnchor=new GPoint(16,12);this.tbtBagIcon.infoWindowAnchor=new GPoint(16,12);};


/**** AssetPackerHelper::process()  overlay.js  ****/


(function($){$.fn.extend({_height:$.fn.height,_width:$.fn.width,height:function(val){if(this[0]==window)return self.innerHeight||$.boxModel&&document.documentElement.clientHeight||document.body.clientHeight;if(this[0]==document)return Math.max(document.body.scrollHeight,document.body.offsetHeight);return this._height(val);},width:function(val){if(this[0]==window)return self.innerWidth||$.boxModel&&document.documentElement.clientWidth||document.body.clientWidth;if(this[0]==document)return Math.max(document.body.scrollWidth,document.body.offsetWidth);return this._width(val);},innerHeight:function(){return this[0]==window||this[0]==document?this.height():this.is(':visible')?this[0].offsetHeight-num(this,'borderTopWidth')-num(this,'borderBottomWidth'):this.height()+num(this,'paddingTop')+num(this,'paddingBottom');},innerWidth:function(){return this[0]==window||this[0]==document?this.width():this.is(':visible')?this[0].offsetWidth-num(this,'borderLeftWidth')-num(this,'borderRightWidth'):this.width()+num(this,'paddingLeft')+num(this,'paddingRight');},outerHeight:function(){return this[0]==window||this[0]==document?this.height():this.is(':visible')?this[0].offsetHeight:this.height()+num(this,'borderTopWidth')+num(this,'borderBottomWidth')+num(this,'paddingTop')+num(this,'paddingBottom');},outerWidth:function(){return this[0]==window||this[0]==document?this.width():this.is(':visible')?this[0].offsetWidth:this.width()+num(this,'borderLeftWidth')+num(this,'borderRightWidth')+num(this,'paddingLeft')+num(this,'paddingRight');},scrollLeft:function(val){if(val!=undefined)return this.each(function(){if(this==window||this==document)window.scrollTo(val,$(window).scrollTop());else
this.scrollLeft=val;});if(this[0]==window||this[0]==document)return self.pageXOffset||$.boxModel&&document.documentElement.scrollLeft||document.body.scrollLeft;return this[0].scrollLeft;},scrollTop:function(val){if(val!=undefined)return this.each(function(){if(this==window||this==document)window.scrollTo($(window).scrollLeft(),val);else
this.scrollTop=val;});if(this[0]==window||this[0]==document)return self.pageYOffset||$.boxModel&&document.documentElement.scrollTop||document.body.scrollTop;return this[0].scrollTop;},offset:function(options,returnObject){var x=0,y=0,sl=0,st=0,elem=this[0],parent=this[0],op,parPos,elemPos=$.css(elem,'position'),mo=$.browser.mozilla,ie=$.browser.msie,sf=$.browser.safari,oa=$.browser.opera,absparent=false,relparent=false,options=$.extend({margin:true,border:true,padding:false,scroll:true,lite:false},options||{});if(options.lite)return this.offsetLite(options,returnObject);if(elem.tagName.toLowerCase()=='body'){x=elem.offsetLeft;y=elem.offsetTop;if(mo){x+=num(elem,'marginLeft')+(num(elem,'borderLeftWidth')*2);y+=num(elem,'marginTop')+(num(elem,'borderTopWidth')*2);}else
if(oa){x+=num(elem,'marginLeft');y+=num(elem,'marginTop');}else
if(ie&&jQuery.boxModel){x+=num(elem,'borderLeftWidth');y+=num(elem,'borderTopWidth');}}else{do{parPos=$.css(parent,'position');x+=parent.offsetLeft;y+=parent.offsetTop;if(mo||ie){x+=num(parent,'borderLeftWidth');y+=num(parent,'borderTopWidth');if(mo&&parPos=='absolute')absparent=true;if(ie&&parPos=='relative')relparent=true;}op=parent.offsetParent;do{if(options.scroll){sl+=parent.scrollLeft;st+=parent.scrollTop;}if(mo&&parent!=elem&&$.css(parent,'overflow')!='visible'){x+=num(parent,'borderLeftWidth');y+=num(parent,'borderTopWidth');}parent=parent.parentNode;}while(parent!=op);parent=op;if(parent.tagName.toLowerCase()=='body'||parent.tagName.toLowerCase()=='html'){if((sf||(ie&&$.boxModel))&&elemPos!='absolute'&&elemPos!='fixed'){x+=num(parent,'marginLeft');y+=num(parent,'marginTop');}if((mo&&!absparent&&elemPos!='fixed')||(ie&&elemPos=='static'&&!relparent)){x+=num(parent,'borderLeftWidth');y+=num(parent,'borderTopWidth');}break;}}while(parent);}var returnValue=handleOffsetReturn(elem,options,x,y,sl,st);if(returnObject){$.extend(returnObject,returnValue);return this;}else{return returnValue;}},offsetLite:function(options,returnObject){var x=0,y=0,sl=0,st=0,parent=this[0],op,options=$.extend({margin:true,border:true,padding:false,scroll:true},options||{});do{x+=parent.offsetLeft;y+=parent.offsetTop;op=parent.offsetParent;if(options.scroll){do{sl+=parent.scrollLeft;st+=parent.scrollTop;parent=parent.parentNode;}while(parent!=op);}parent=op;}while(parent&&parent.tagName.toLowerCase()!='body'&&parent.tagName.toLowerCase()!='html');var returnValue=handleOffsetReturn(this[0],options,x,y,sl,st);if(returnObject){$.extend(returnObject,returnValue);return this;}else{return returnValue;}}});var num=function(el,prop){return parseInt($.css(el.jquery?el[0]:el,prop))||0;};var handleOffsetReturn=function(elem,options,x,y,sl,st){if(!options.margin){x-=num(elem,'marginLeft');y-=num(elem,'marginTop');}if(options.border&&($.browser.safari||$.browser.opera)){x+=num(elem,'borderLeftWidth');y+=num(elem,'borderTopWidth');}else if(!options.border&&!($.browser.safari||$.browser.opera)){x-=num(elem,'borderLeftWidth');y-=num(elem,'borderTopWidth');}if(options.padding){x+=num(elem,'paddingLeft');y+=num(elem,'paddingTop');}if($.browser.opera&&options.scroll&&$.css(elem,'display')=='inline'){sl-=elem.scrollLeft;st-=elem.scrollTop;}return options.scroll?{top:y-st,left:x-sl,scrollTop:st,scrollLeft:sl}:{top:y,left:x};};})(jQuery);function findEnlargeableImages(singleImg){window.imgs=new Array();$('.enlarge').each(function(){if($(this).parent().attr('href')){if($(this).parent().attr('href').length<=1){var rootidstr=$(this).attr('id');var rootid=rootidstr.slice(7);imgs.push(rootid);$(this).bind('click',function(){showImage(rootid);})}}});if(singleImg){var rootids=$('#allFotoRootIds').val();if(rootids.length){imgs=rootids.split(',');}}}
function showImage(rootid){createOverlay();showOverlayWithUrl('/bild-layer/'+rootid+'.html',{root_ids:imgs.join(',')});}
function createOverlay(_width){if($('#overlay-box').size()==0){if(_width==undefined){_width=$('#overlay-box').width();}
$(document.body).append('<div id="overlay-box"></div>');$('#overlay-box').css('left',($(document.html).width()/2)-(_width/2)+'px');$('#overlay-box').css('text-align','center');$('#overlay-box').css('width',_width);$('#overlay-box').html('<div id="overlay-box-loading">wird geladen ...</a>');$.showOverlay(100,0.9).bind('click',function(){$.hideOverlay();});document.onkeydown=function(e){if(e==null){var keycode=event.keyCode;}else{var keycode=e.which;}
if(keycode==27){$.hideOverlay();}}}}
function showOverlayWithUrl(url,params,javascriptFile,_width,positionY,positionLeft){createOverlay(_width);var positionY=positionY||0;var positionLeft=positionLeft||0;tbt.positionYFactor=Math.round(positionY*0.3,0);$.post(url,params,function(html){showOverlay(html);if(!isEmpty(javascriptFile)){var javascriptURL=(window.tbt&&window.tbt.mediaServer)?window.tbt.mediaServer:'/';javascriptURL+='js/'+javascriptFile+'.js';if(window.tbt&&window.tbt.updateTimeStamp){javascriptURL+='?updated='+window.tbt.updateTimeStamp;}
jQuery.getScript(javascriptURL);}
if(positionLeft>0){$('#overlay-box').css('left',positionLeft+'px');}});if(window.tbt.positionYFactor){window.scrollTo(0,tbt.positionYFactor);}else{window.scroll(0,0);}}
function showOverlay(content){createOverlay();$('#overlay-box').css('text-align','left');if(tbt.positionYFactor>0){$('#overlay-box').css('margin-top',tbt.positionYFactor+'px');}
$('#overlay-box').html(content);if(window.onOverlay){window.onOverlay(true);}}
function hideOverlay(){$.hideOverlay();}
jQuery.extend({showOverlay:function(speed,opacity,callback){tbt.hideElementsForOverlay();if(jQuery('#__dimScreen').size()>0)return;if(typeof speed=='function'){callback=speed;speed=null;}
if(typeof opacity=='function'){callback=opacity;opacity=null;}
if(speed<1){var placeholder=opacity;opacity=speed;speed=placeholder;}
if(opacity>=1){var placeholder=speed;speed=opacity;opacity=placeholder;}
speed=(speed>0)?speed:500;opacity=(opacity>0)?opacity:0.5;$(window).bind('resize',function(){var leftPos=($(document.html).width()/2)-($('#overlay-box').width()/2)
$('#overlay-box').css('left',leftPos+'px');$('#__dimScreen').width($(document.html).width()+'px');});return jQuery('<div></div>').attr({id:'__dimScreen',fade_opacity:opacity,speed:speed}).css({background:'#000',height:$('html').get(0).scrollHeight+'px',left:'0px',opacity:0,position:'absolute',top:'0px',width:$(document).width()+'px',zIndex:999}).appendTo(document.body).fadeTo(speed,0.7,callback);},hideOverlay:function(callback){var x=jQuery('#__dimScreen');var opacity=x.attr('fade_opacity');var speed=x.attr('speed');x.fadeOut(speed,function(){x.remove();$(window).unbind('resize');tbt.showElementsForOverlay();$('#overlay-box').remove();if(window.onOverlay){window.onOverlay(false);}
if(typeof callback=='function')callback();});}});function showOverlayList(_listName,_icon,_typeId){if(_icon=='more'){$('#'+_listName+'-list'+_typeId).animate({opacity:'toggle',height:'toggle'},'slow',function(){changeButtonWithText(_listName,_icon,_typeId);$('#'+_listName+'-list-hidden'+_typeId).animate({opacity:'toggle',height:'toggle'},'slow',function(){});});}else{$('#'+_listName+'-list-hidden'+_typeId).animate({opacity:'toggle',height:'toggle'},'slow',function(){changeButtonWithText(_listName,_icon,_typeId);$('#'+_listName+'-list'+_typeId).animate({opacity:'toggle',height:'toggle'},'slow',function(){});});}}
var less;var more;function changeButtonWithText(_listName,_icon,_typeId){less='<div class="fl" style="width:20px;" onclick="javascript:showOverlayList(\''+_listName+'\',\'more\',\''+_typeId+'\')" ><img src="/img/icon/plus.gif" class="pointer" title="Mehr" alt="Mehr" /></div> <div class="fl overlay-li-more" onclick="javascript:showOverlayList(\''+_listName+'\',\'more\',\''+_typeId+'\')" >Mehr</div>';more='<div class="fl" style="width:20px;" onclick="javascript:showOverlayList(\''+_listName+'\',\'less\',\''+_typeId+'\')"><img src="/img/icon/minus.gif" class="pointer" title="Weniger" alt="Weniger" /></div> <div class="fl overlay-li-more" onclick="javascript:showOverlayList(\''+_listName+'\',\'less\',\''+_typeId+'\')" >Weniger</div>';$('#plus-'+_listName+'-wrapper'+_typeId).animate({opacity:0.3},function(){$('#plus-'+_listName+'-wrapper'+_typeId).html(window[_icon]);$('#plus-'+_listName+'-wrapper'+_typeId).animate({opacity:1});});}
function showCategoryType(_typeId){$('#PCategory-list-wrapper-'+_typeId).animate({opacity:'toggle',height:'toggle'},'slow',function(){});$('#more-type-'+_typeId).hide('slow');}
function hideCategoryType(_typeId){$('#PCategory-list-wrapper-'+_typeId).animate({opacity:'toggle',height:'toggle'},'slow',function(){$('#PCategory-list-wrapper-'+_typeId+' input').removeAttr('checked','');$('#PCategory-list-wrapper-'+_typeId+'-counter').hide();$('#PCategory-list-'+_typeId+'-counter').html('0');$('#PCategory-list-hidden-'+_typeId).hide();$('#PCategory-list-'+_typeId).show();changeButtonWithText('PCategory','less',_typeId);});$('#more-type-'+_typeId).animate({opacity:'toggle',left:'toggle'},'slow');}
function changeCategoryCounter(_catId,_typeId,_hidden){$('#overlayRedMessageWrapper:visible').animate({opacity:'toggle',height:'toggle'},'slow');var counter=$('#PCategory-list-'+_typeId+'-counter').html();if($('#'+_hidden+'PCategory'+_catId).attr('checked')==true){counter=(Math.abs(counter)+1);if(_hidden!=''){$('#PCategory'+_catId).attr('checked','checked');}else{$('#hiddenPCategory'+_catId).attr('checked','checked');}}else{counter=(Math.abs(counter)-1);if(_hidden!=''){$('#PCategory'+_catId).removeAttr('checked');}else{$('#hiddenPCategory'+_catId).removeAttr('checked');}}
if(counter>0){$('#PCategory-list-wrapper-'+_typeId+'-counter').show();}else{counter=0;$('#PCategory-list-wrapper-'+_typeId+'-counter').hide();}
$('#PCategory-list-'+_typeId+'-counter').html(counter)}
function changeStyles(_catId,_hidden){if($('#'+_hidden+'PStyle'+_catId).attr('checked')==true){if(_hidden!=''){$('#PStyle'+_catId).attr('checked','checked');}else{$('#hiddenPStyle'+_catId).attr('checked','checked');}}else{if(_hidden!=''){$('#PStyle'+_catId).removeAttr('checked');}else{$('#hiddenPStyle'+_catId).removeAttr('checked');}}}
function validateCategoryEntries(_id,_objectUid,_loggedin,_referer){var isChecked=false;$('#categories-li-wrapper').find('input').each(function(i){if(this.checked==true){isChecked=true;}});if(isChecked)saveCategories(_id,_objectUid,_loggedin,_referer);if(!isChecked){$('#overlayNormalMessageWrapper:visible').animate({opacity:'toggle',height:'toggle'},'slow');$('#overlayRedMessageWrapper:hidden').animate({opacity:'toggle',height:'toggle'},'slow');}}
function openWindowForAgb(_ref){var _width=720;var _height=600;var _left=100;var _top=200;agb=window.open(_ref,'AGB','width='+_width+',height='+_height+',left='+_left+',top='+_top+',scrollbars=yes');agb.focus();}
function toggleOverlayCategories(_typeId){$('.type-id-'+_typeId).animate({opacity:'toggle',height:'toggle'},'slow');}
var commentAjaxRequestReady=false;var userTargetsAjaxRequestReady=false;function saveComment(_site){var minTextLength=20;var text=$('#input_txt'+_site).val();if($('#tip_object_type').val()=='places'&&text.length<minTextLength){$('#overlayNormalMessageWrapper:visible').animate({opacity:'toggle',height:'toggle'},'slow',function(){$('#overlayRedMessageWrapper .error-message-box .content span').html('Bitte gib mindestens 20 Zeichen ein.');$('#overlayRedMessageWrapper:hidden').animate({opacity:'toggle',height:'toggle'},'slow');});$('#overlayRedMessageWrapper:hidden').animate({opacity:'toggle',height:'toggle'},'slow');$('#overlayRedMessageWrapper .error-message-box .content span').html('Bitte gib mindestens 20 Zeichen ein.');return false;}
sendReceiveAction('send','likeit-do');var params={object_uid:$('#tip_object_uid').val(),text:$('#input_txt'+_site).val()};if(($('#tip_object_type').val()=='places'&&text.length>=minTextLength)||$('#tip_object_type').val()!='places'&&text.length>0){$.ajax({type:"POST",url:"/likeIt/saveComment",dataType:'json',contentType:'application/x-www-form-urlencoded; charset=utf-8',data:params,success:function(json){if(json.status==0){saveCommentNext(json.data.uid,json.loggedin,json.urlToRedirect)}else{sendReceiveAction('receive','likeit-do');$('#overlayNormalMessageWrapper:visible').animate({opacity:'toggle',height:'toggle'},'slow');$('#overlayRedMessageWrapper:hidden').animate({opacity:'toggle',height:'toggle'},'slow');$('#overlayRedMessageWrapper .error-message-box .content span').html('Kommentar nicht gespeichert.');}},error:function(json){sendReceiveAction('receive','likeit-do');$('#overlayNormalMessageWrapper:visible').animate({opacity:'toggle',height:'toggle'},'slow');$('#overlayRedMessageWrapper:hidden').animate({opacity:'toggle',height:'toggle'},'slow');$('#overlayRedMessageWrapper .error-message-box .content span').html('Kommentar nicht gespeichert.');}});}else{commentAjaxRequestReady=true;}
if($('#tip_object_type').val()!='places'){var userTargetsData='data[foo]=0';if($('#wasthere').attr('checked'))userTargetsData+="&data[types][wasthere]="+$('#wasthere').attr('checked');if($('#likedit').attr('checked'))userTargetsData+="&data[types][likedit]="+$('#likedit').attr('checked');if($('#willgo').attr('checked'))userTargetsData+="&data[types][willgo]="+$('#willgo').attr('checked');if($('#isexpert').attr('checked'))userTargetsData+="&data[types][isexpert]="+$('#isexpert').attr('checked');userTargetsData+="&data[UserTarget][object_uid]="+$('#tip_object_uid').val();userTargetsData+="&data[UserTarget][object_type]="+$('#tip_object_type').val();tbtAjaxCall('/users/ajaxSaveUserTargets',userTargetsData,{onOk:function(data){userTargetsAjaxRequestReady=true;if(commentAjaxRequestReady){if(data.loggedin){document.location.href=data.urlToRedirect;}else{showOverlayWithUrl('/like_it/overlaySave/usertarget',null,'login',390);}}},onError:function(data){alert('Fehler '+data.message);}});}else{userTargetsAjaxRequestReady=true;}}
function saveCommentNext(_uid,_loggedin,_urlToRedirect){if($('#tip_object_type').val()=='places'){showOverlayWithUrl('/like_it/overlayCat/'+$('#tip_object_uid').val()+'/'+_uid);$('#overlay-box:visible  #ovl-like-it').animate({opacity:1},'slow');}else{commentAjaxRequestReady=true;if(userTargetsAjaxRequestReady){if(_loggedin){window.location.href=_urlToRedirect;}else{showOverlayWithUrl('/like_it/overlaySave/comment',null,'login',390);}}}}
function saveCategories(_id,_objectUid,_loggedin,_referer){sendReceiveAction('send','li-cat-do');params="data[PComment][uid]="+$('#uid').val();if($('#li-tags').val()!='zum Beispiel: Hafen, Altstadt, Hotspot, zentral, angenehm'){params+="&data[PComment][tags]="+$('#li-tags').val();}else{params+="&data[PComment][tags]=";}
var categories='';$('#categories-li-wrapper').find('input').each(function(i){if(this.checked==true){categories+='&data[PComment][categories][]='+$(this).val();}});params+=categories;var styles='';$('#styles-li-wrapper').find('input').each(function(i){if(this.checked==true){styles+='&data[PComment][styles][]='+$(this).val();}});params+=styles;$.ajax({type:"POST",url:"/likeIt/saveCategoriesStylesTags/"+_objectUid+'/'+$('#uid').val(),dataType:'json',contentType:'application/x-www-form-urlencoded; charset=utf-8',data:params,success:function(json){if(json.status==0){if(_loggedin=='true'){var width=740;var url='/weitersagen/likeItSuccess/'+_objectUid+'/'+$('#uid').val();var params=null;var javascriptFile='weitersagenFriendsBox';$.post(url,params,function(html){showOverlay(html);if(!isEmpty(javascriptFile)){javascriptURL='/js/'+javascriptFile+'.js';jQuery.getScript(javascriptURL);}
$('#overlay-box').css('left',($(document.html).width()/2)-(width/2)+'px');});}else{showOverlayWithUrl('/like_it/overlaySave/likeit',null,'login',390);sendReceiveAction('receive','li-cat-do');}}else{sendReceiveAction('receive','li-cat-do');$('#overlayNormalMessageWrapper:visible').animate({opacity:'toggle',height:'toggle'},'slow');$('#overlayRedMessageWrapper:hidden').animate({opacity:'toggle',height:'toggle'},'slow');$('#overlayRedMessageWrapper .error-message-box .content span').html('Kategorien nicht gespeichert.');}},error:function(json){sendReceiveAction('receive','li-cat-do');$('#overlayNormalMessageWrapper:visible').animate({opacity:'toggle',height:'toggle'},'slow');$('#overlayRedMessageWrapper:hidden').animate({opacity:'toggle',height:'toggle'},'slow');$('#overlayRedMessageWrapper .error-message-box .content span').html('Kategorien nicht gespeichert.');}});}
function sendDrink(){sendReceiveAction('send','drink-do');$('#overlayRedMessageWrapper span').html('Es ist ein Fehler aufgetreten');$('#overlayRedMessageWrapper:visible').animate({opacity:'toggle',height:'toggle'},'slow');$('#overlayGreenMessageWrapper:visible').animate({opacity:'toggle',height:'toggle'},'slow');params="data[Drink][spender_uid]="+$('#spender_uid').val();params+="&data[Drink][recipient_uid]="+$('#recipient_uid').val();params+="&data[Drink][text]="+$('#input_txt').val();$.ajax({type:"POST",url:"/drinks/ajaxSendingDrink/",dataType:'json',contentType:'application/x-www-form-urlencoded; charset=utf-8',data:params,success:function(json){if(json.status==0){$('#overlayGreenMessageWrapper').animate({opacity:'toggle',height:'toggle'},'slow',function(){var closeTimeout=setTimeout('$.hideOverlay()',2000);});}else{if(json.msg=='second'){$('#overlayRedMessageWrapper .error-message-box .content span').html('Nur ein Drink pro Tag pro Freund');$('#overlayRedMessageWrapper').animate({opacity:'toggle',height:'toggle'},'slow');var closeTimeout=setTimeout('$.hideOverlay()',2000);}else{sendReceiveAction('receive','drink-do');$('#overlayRedMessageWrapper').animate({opacity:'toggle',height:'toggle'},'slow');}}},error:function(json){sendReceiveAction('receive','drink-do');$('#overlayRedMessageWrapper').animate({opacity:'toggle',height:'toggle'},'slow');}});}
function sorrowSend(){sendReceiveAction('send','sorrow-report-do');var showError=false;$('#textarea-sorrow-report-overlay').css('border','1px solid #ddd');$('#text-wrapper span.message').hide();$('#report-type .message').hide();$('#report-type').css('color','#333');$('#report-type').removeClass('error');$('#overlayRedMessageWrapper span').html('Es ist ein Fehler aufgetreten');$('#overlayRedMessageWrapper:visible').animate({opacity:'toggle',height:'toggle'},'slow');$('#overlayGreenMessageWrapper:visible').animate({opacity:'toggle',height:'toggle'},'slow');if($('#defaultText').val()==$('#textarea-sorrow-report-overlay').val()||$('#textarea-sorrow-report-overlay').val().length<30){$('#textarea-sorrow-report-overlay').css('border','1px solid #c00');$('#text-wrapper span.message').show();sendReceiveAction('receive','sorrow-report-do');showError=true;}
if($('#Type0').attr('checked')==undefined&&$('#Type1').attr('checked')==undefined&&$('#Type2').attr('checked')==undefined){$('#report-type').addClass('error');$('#report-type').css('color','#c00');$('#report-type .message').show();showError=true;sendReceiveAction('receive','sorrow-report-do');}
if(showError){$('#overlayRedMessageWrapper').animate({opacity:'toggle',height:'toggle'},'slow');return false;}
params="data[Message][referer]="+$('#referer').val();params+="&data[Message][text]="+$('#textarea-sorrow-report-overlay').val();params+="&data[Message][name]="+$('#name-input').val();params+="&data[Message][email]="+$('#email-input').val();if($('#Type0').attr('checked')==true){params+="&data[Message][type]=Fehler";}
if($('#Type1').attr('checked')==true){params+="&data[Message][type]=Verbesserungsvorschlag";}
if($('#Type2').attr('checked')==true){params+="&data[Message][type]=Hilfe";}
$.ajax({type:"POST",url:"/kummerkasten/ajaxSendMessage/",dataType:'json',contentType:'application/x-www-form-urlencoded; charset=utf-8',data:params,success:function(json){if(json.status==0){$('#overlayGreenMessageWrapper').animate({opacity:'toggle',height:'toggle'},'slow',function(){var closeTimeout=setTimeout('$.hideOverlay()',2000);});}else{sendReceiveAction('receive','sorrow-report-do');$('#overlayRedMessageWrapper').animate({opacity:'toggle',height:'toggle'},'slow');}},error:function(json){sendReceiveAction('receive','sorrow-report-do');$('#overlayRedMessageWrapper').animate({opacity:'toggle',height:'toggle'},'slow');}});}
function sendFriendsRequest(){sendReceiveAction('send','friends-request-do');$('#overlayRedMessageWrapper span').html('Es ist ein Fehler aufgetreten');$('#overlayRedMessageWrapper:visible').animate({opacity:'toggle',height:'toggle'},'slow');$('#overlayGreenMessageWrapper:visible').animate({opacity:'toggle',height:'toggle'},'slow');params="data[Friend][user_a_uid]="+$('#user_a_uid').val();params+="&data[Friend][user_b_uid]="+$('#user_b_uid').val();if($('#input_txt').val()=='Schreib '+$('#user_b_name').val()+' und sag hallo...'){params+="&data[Friend][additional_text]=";}else{params+="&data[Friend][additional_text]="+$('#input_txt').val();}
$.ajax({type:"POST",url:"/friends/sendingFriendsRequest/",dataType:'json',contentType:'application/x-www-form-urlencoded; charset=utf-8',data:params,success:function(json){if(json.status==0){$('#overlayGreenMessageWrapper').animate({opacity:'toggle',height:'toggle'},'slow',function(){var closeTimeout=setTimeout('$.hideOverlay()',2000);});}else{if(json.msg=='second'){$('#overlayRedMessageWrapper .error-message-box .content span').html(json.data.txt);$('#overlayRedMessageWrapper').animate({opacity:'toggle',height:'toggle'},'slow');var closeTimeout=setTimeout('$.hideOverlay()',2000);}else if(json.msg=='pending'){$('#overlayRedMessageWrapper .error-message-box .content span').html(json.data.txt);$('#overlayRedMessageWrapper').animate({opacity:'toggle',height:'toggle'},'slow');var closeTimeout=setTimeout('$.hideOverlay()',2000);}else{sendReceiveAction('receive','friends-request-do');$('#overlayRedMessageWrapper').animate({opacity:'toggle',height:'toggle'},'slow');}}},error:function(json){sendReceiveAction('receive','friends-request-do');$('#overlayRedMessageWrapper').animate({opacity:'toggle',height:'toggle'},'slow');}});}
function sendFriendshipAnswer(_referer,_type){sendReceiveAction('send','friends-request-do');$('#overlayRedMessageWrapper span').html('Es ist ein Fehler aufgetreten');$('#overlayRedMessageWrapper:visible').animate({opacity:'toggle',height:'toggle'},'slow');$('#overlayGreenMessageWrapper:visible').animate({opacity:'toggle',height:'toggle'},'slow');params="data[Friend][recipient_uid]="+$('#answerer_uid').val();params+="&data[Friend][spender_uid]="+$('#questioner_uid').val();if($('#input_txt').val()=='Schreib '+$('#questioner_name').val()+' eine kleine Nachricht dazu...'){params+="&data[Friend][additional_text]=";}else{params+="&data[Friend][additional_text]="+$('#input_txt').val();}
$.ajax({type:"POST",url:"/friends/ajaxFriendshipAnswer/"+_type,dataType:'json',contentType:'application/x-www-form-urlencoded; charset=utf-8',data:params,success:function(json){if(json.status==0){$('#overlayGreenMessageWrapper').animate({opacity:'toggle',height:'toggle'},'slow',function(){var closeTimeout=setTimeout('$.hideOverlay()',2000);var referer="document.location.href = '"+_referer+"'";var closeTimeout=setTimeout(referer,2500);});}else{if(json.msg=='answerd'){$('#overlayRedMessageWrapper .error-message-box .content span').html(json.data.txt);$('#overlayRedMessageWrapper').animate({opacity:'toggle',height:'toggle'},'slow');var closeTimeout=setTimeout('$.hideOverlay()',2000);}else{sendReceiveAction('receive','friends-request-do');$('#overlayRedMessageWrapper').animate({opacity:'toggle',height:'toggle'},'slow');}}},error:function(json){sendReceiveAction('receive','friends-request-do');$('#overlayRedMessageWrapper').animate({opacity:'toggle',height:'toggle'},'slow');}});}


/**** AssetPackerHelper::process()  jquery.rotate.1-1.js  ****/


jQuery.fn.rotate=function(angle,whence){var p=this.get(0);if(!whence){p.angle=((p.angle==undefined?0:p.angle)+angle)%360;}else{p.angle=angle;}
if(p.angle>=0){var rotation=Math.PI*p.angle/180;}else{var rotation=Math.PI*(360+p.angle)/180;}
var costheta=Math.cos(rotation);var sintheta=Math.sin(rotation);if(document.all&&!window.opera){var canvas=document.createElement('img');canvas.src=p.src;canvas.height=p.height;canvas.width=p.width;canvas.alt=p.alt;canvas.style.filter="progid:DXImageTransform.Microsoft.Matrix(M11="+costheta+",M12="+(-sintheta)+",M21="+sintheta+",M22="+costheta+",SizingMethod='auto expand')";}else{var canvas=document.createElement('canvas');if(!p.oImage){canvas.oImage=new Image();canvas.oImage.src=p.src;}else{canvas.oImage=p.oImage;}
canvas.oImage.onload=function(){canvas.style.width=canvas.width=Math.abs(costheta*canvas.oImage.width)+Math.abs(sintheta*canvas.oImage.height);canvas.style.height=canvas.height=Math.abs(costheta*canvas.oImage.height)+Math.abs(sintheta*canvas.oImage.width);var context=canvas.getContext('2d');context.save();if(rotation<=Math.PI/2){context.translate(sintheta*canvas.oImage.height,0);}else if(rotation<=Math.PI){context.translate(canvas.width,-costheta*canvas.oImage.height);}else if(rotation<=1.5*Math.PI){context.translate(-costheta*canvas.oImage.width,canvas.height);}else{context.translate(0,-sintheta*canvas.oImage.width);}
context.rotate(rotation);context.drawImage(canvas.oImage,0,0,canvas.oImage.width,canvas.oImage.height);context.restore();}}
canvas.id=p.id;canvas.angle=p.angle;canvas.alt=p.alt;p.parentNode.replaceChild(canvas,p);}
jQuery.fn.rotateRight=function(angle){this.rotate(angle==undefined?90:angle);}
jQuery.fn.rotateLeft=function(angle){this.rotate(angle==undefined?-90:-angle);}


/**** AssetPackerHelper::process()  addTip.js  ****/


var addTipSelectedIndex=-1;var lastMarker=0;function addTipSaveByStepFourWithAddress(_type){if(!_type)_type='tbt';if(addTipSelectedIndex==-1){$('.searchContainerWrapper').addClass('error');sendReceiveAction('receive','add-tip-step-four-save');return false;}
var address=newTipAddresses[addTipSelectedIndex];var street=$('#addResult'+addTipSelectedIndex+' .left-wrapper .street').html();var zip=$('#addResult'+addTipSelectedIndex+' .left-wrapper .zip').html();var place={street:street,zip:zip,lng:address.Point.coordinates[0],lat:address.Point.coordinates[1]};addTipCreateNewPlace(place,_type);}
function addTipSaveByStepThree(_type){var _type=_type||'tbt';sendReceiveAction('send','add-tip-step-three-save');var place=newtip.places[addTipSelectedIndex].Place;if(place.uid==0){addTipCreateNewPlace(place,_type);}else{addTipUseExistingPlace(place.uid,_type);}}
function addTipCreateNewPlace(place,_type){var place=place||{};var _type=_type||{};tbtAjaxCall('/addTip/ajaxSavePlaceAndComment/',place,{onOk:function(data){if(_type=='gedankenreise'){location.href=window.tbt.server+'/gedankenreise/iframe_start/individual_step4/'+data.placeUid+'/'+data.commentUid;}else{if(data.showLoginLayer){showOverlayWithUrl('/like_it/overlaySave/likeit',null,'login',390);$('#overlay-box').css('left','520px');}else{showOverlayWithUrl('/weitersagen/addTipSuccess/'+data.placeUid+'/'+data.commentUid,null,'weitersagenFriendsBox',740);}}},onError:function(data){alert('Fehler '+data.message);sendReceiveAction('receive','add-tip-step-three-save');}});}
function addTipUseExistingPlace(_placeUid,_type){var data={objectUid:_placeUid};addCommentForObjcet(data,_type);}
function addGeoComment(_objectUid,_type){var data={objectUid:_objectUid,text:($('#PlaceText')?$('#PlaceText').val():'')};addCommentForObjcet(data,_type);}
function addCommentForObjcet(_data,_type){tbtAjaxCall('/AddTip/ajaxSaveCommentByObjectUid/',_data,{onOk:function(data){if(_type=='gr_come_along'){if(data.showLoginLayer){location.href=window.tbt.server+"/gedankenreise/iframe_start/register/come_along/";}else{location.href=window.tbt.server+"/gedankenreise/and_now/come_along";}}else if(_type=='gedankenreise'){location.href=window.tbt.server+"/gedankenreise/iframe_start/individual_step4/"+_data.objectUid+"/"+data.commentUid;}else{if(data.showLoginLayer){showOverlayWithUrl('/like_it/overlaySave/likeit',null,'login',390);$('#overlay-box').css('left','520px');}else{showOverlayWithUrl('/weitersagen/addTipSuccess/'+_data.objectUid+'/'+data.commentUid,null,'weitersagenFriendsBox',740);}}},onError:function(data){alert('Fehler '+data.message);}});}
function submitBackToAddTipStepOne(destinationUid){var data=prepareAddTipStepTwoData(false);if(data===false){return false;}
sendReceiveAction('send','add-tip-step-two-do-back');tbtAjaxCall('/AddTip/ajaxAddTipStepTwoSave/',data,{onOk:function(data){showOverlayWithUrl('/addTip/addTipStepOne/0/'+destinationUid,null,'addTipStepOne',740);sendReceiveAction('receive','add-tip-step-two-do-back');},onError:function(data){alert('Fehler '+data.message);sendReceiveAction('receive','add-tip-step-two-do-back');}});return true;}
function submitForwardToAddTipStepThree(destinationUid){var data=prepareAddTipStepTwoData(true);if(data===false){return false;}
sendReceiveAction('send','add-tip-step-two-do-forward');tbtAjaxCall('/addTip/ajaxAddTipStepTwoSave/',data,{onOk:function(data){showOverlayWithUrl('/addTip/addTipStepThree/'+destinationUid,null,'addTipStepThree',740);},onError:function(data){alert('Fehler '+data.message);}});return true;}
function prepareAddTipStepTwoData(validate){if(validate){var categorieChecked=false;$('#add-tip-2 .toggle-link').removeClass('error');$('#category-error-msg').hide();$('#categories-headline').show();$('.new-categories').find('input').each(function(i){if($(this)[0].checked){categorieChecked=true;}});if(!categorieChecked){$('#add-tip-2 .toggle-link').addClass('error');$('#categories-headline').hide();if(document.all){$('#category-error-msg').show();}else{$('#category-error-msg').animate({opacity:'toggle',height:'toggle'},'slow');}
return false;}}
var tags=[];if($('.tags-input').val()!=$('#defaultPCommentTags').val()){tags=$('.tags-input').val();}else{tags='';}
var categories=[];$('#new-category-box').find('input').each(function(i){if(this.checked==true){categories.push($(this).val());}});var styles=[];$('#new-style-box').find('input').each(function(i){if(this.checked==true&&!tbt.in_array($(this).val(),styles)){styles.push($(this).val());}});var data={tags:tags,categories:categories.join(','),styles:styles.join(',')};return data;}
function submitForwardToAddTipStepTwo(_type){if(!_type)_type='tbt';$('#ovl-add-tip-step-one .wrapper').removeClass('error');$('#ovl-add-tip-step-one .wrapper span.message').hide();var errorCount=0;if($('#input-destination-uid').val()==''){$('#destination-uid-wrapper').addClass('error');$('#destination-uid-wrapper span.message').show();errorCount++;};if($('#PlaceName').val()!=$('#defaultPlaceName').val()&&$('#PlaceName').val().length<3){$('#name-wrapper').addClass('error');$('#name-wrapper span.message').show();errorCount++;}
if($('#PlaceText').val()!=$('#defaultPlaceText').val()&&$('#PlaceText').val().length<20){$('.text-wrapper-place').addClass('error');$('.text-wrapper-place span.message').show();errorCount++;}
if($('#PlaceText').val()==$('#defaultPlaceText').val()){$('#PlaceText').val('');}
if($('#PCommentText').val()!=$('#defaultPCommentText').val()&&$('#PCommentText').val().length<20){$('.text-wrapper-comment').addClass('error');$('.text-wrapper-comment span.message').show();errorCount++;}
if($('#PCommentText').val()==$('#defaultPCommentText').val()){$('#PCommentText').val('');}
if(errorCount>0)return false;var url='/addTip/ajaxAddTipStepOneSave/';var data={PlaceDestinationUid:$('#input-destination-uid').val(),PlaceRegionUid:$('#input-region-uid').val(),PlaceCountryUid:$('#input-country-uid').val(),PlaceContinentUid:$('#input-continent-uid').val(),PlaceName:$('#PlaceName').val(),PlaceText:$('#PlaceText').val(),PCommentText:$('#PCommentText').val()};sendReceiveAction('send','add-tip-step-one-do');tbtAjaxCall(url,data,{onOk:function(data){if(_type=='gedankenreise'){location.href=window.tbt.server+"/gedankenreise/iframe_start/individual_step2";}else{showOverlayWithUrl('/addTip/addTipStepTwo/',null,'addTipStepTwo',740);}},onError:function(data){alert('Fehler '+data.message);}});return true;}
function addTipMarkTip(i){$('#selectedResultContainer').html($('#addResult'+i+' .left-wrapper').html());addTipMarkResult(i);}
function addTipMarkAddress(i){$('#selectedResultContainer').html('<b>'+$('#PlaceName').val()+'</b><br />'+
$('#addResult'+i+' .left-wrapper span').html());addTipMarkResult(i);}
function addTipMarkResult(i){addTipSelectedIndex=i;$('.resultrow').removeClass('marked-result');$('#addResult'+i).addClass('marked-result');$('#addResultLoupe'+lastMarker).show();$('#addResultMarker'+lastMarker).hide();$('#addResultLoupe'+i).hide();$('#addResultMarker'+i).show();lastMarker=i;$('#selectedResultWrapper').hide();$('#selectedResultWrapper').animate({opacity:'toggle'},'slow');}


/**** AssetPackerHelper::process()  top_destinations.js  ****/


if(!window.tbt){tbt=window.tbt={};}
tbt.topDestinationsCache=[];


/**** AssetPackerHelper::process()  destination_selector.js  ****/


if(!window.tbt){tbt=window.tbt={};}
tbt.JsonDestinationRepository=function(data){this.data=data;var i=0;this.destinationUid=i++;this.destinationName=i++;this.destinationLat=i++;this.destinationLng=i++;this.regionUid=i++;this.regionName=i++;this.countryUid=i++;this.countryName=i++;this.countryGoogleKnowsRegions=i++;this.countinentUid=i++;this.collumns=i;}
tbt.JsonDestinationRepository.prototype.getSize=function(){return this.data.length/this.collumns;}
tbt.JsonDestinationRepository.prototype.findByDestinationName=function(name,countryUid){var field=this.destinationName;var countryField=this.countryUid;var data=this.data;var cols=this.collumns;var size=this.getSize();var pattern;var found=[];try{name=name.replace(/\./g,'\\.').replace(/\//g,'\\/').replace(/\+/g,'');eval('pattern = /\\b'+name+'/i;');}catch(e){if(console.warn)
console.warn(e);return found;}
for(var i=size-1;i>-1;i--){var pos=i*cols;if(pattern.test(data[pos+field])){if(countryUid&&countryUid!=data[pos+countryField]){continue;}
found.push({Destination:{uid:data[pos+this.destinationUid],name:data[pos+this.destinationName],lat:data[pos+this.destinationLat],lng:data[pos+this.destinationLng]},Region:{uid:data[pos+this.regionUid],name:data[pos+this.regionName]},Country:{uid:data[pos+this.countryUid],name:data[pos+this.countryName],googleKnowsRegion:data[pos+this.countryGoogleKnowsRegions]},Continent:{uid:data[pos+this.countinentUid],name:''}});}}
return found;}
tbt.JsonDestinationRepository.prototype.addDestination=function(destination){if(console.debug)
console.debug({'called':'JsonDestinationRepository.addDestination()',destination:destination});try{var d=destination;this.data.push(d.Destination.uid,d.Destination.name,d.Region.uid,d.Region.name,d.Country.uid,d.Country.name,d.Country.googleKnowsRegion,d.Continent.uid);}catch(e){if(console.error)
console.error(e);}}
tbt.CompositeDestinationRepository=function(){this.repos=[];}
tbt.CompositeDestinationRepository.prototype.addRepository=function(rep){if(console.log)
if(!(rep.findByDestinationName instanceof Function)){if(console.warn)
console.warn('CompositeDestinationRepository.addRepository() parameter is no DestinationRepository cause it lacks method findByDestinationName(String)');}
this.repos.push(rep);}
tbt.CompositeDestinationRepository.prototype.findByDestinationName=function(name,countryUid){var repos=this.repos;var found=[];for(var i=0;i<repos.length;i++){found=found.concat(repos[i].findByDestinationName(name,countryUid));}
var cleaned=[];var doubletten={};for(var i=found.length-1;i>-1;i--){var destination=found[i];if(doubletten[destination.Destination.uid]){continue;}
doubletten[destination.Destination.uid]=true;cleaned.push(destination);}
return cleaned;}
tbt.CompositeDestinationRepository.prototype.getSize=function(){var size=0;for(var i=0;i<this.repos.length;i++){size+=this.repos[i].getSize();}
return size;}
tbt.CompositeDestinationRepository.prototype.addDestination=function(destination){if(this.repos.length==0)
return;this.repos[0].addDestination(destination);}
tbt.NullDestinationRepository=function(){}
tbt.NullDestinationRepository.prototype.findByDestinationName=function(){return[];}
tbt.NullDestinationRepository.prototype.addDestination=function(destination){}
tbt.NullDestinationRepository.prototype.getSize=function(){return 0;}
tbt.CountryRepository=function(data){if(!data){if(tbt.countries){data=tbt.countries;}else{console.error('tbt.CountryRepository() tbt.countries not defined - country-filtering will not work! fix: inlcude countries.js');}}
if(!data){data=[];}
this.data=data;var i=0;this.uid=i++;this.name=i++;this.code=i++;this.iso3=i++;this.collumns=i;this.simplifyRegexp=/[,\. \-\'\"]/g;var n=data.length/this.collumns;var names=new Array(n);var k=0;for(i=this.name;i<data.length;i+=this.collumns){names[k++]=data[i].toLowerCase().replace(this.simplifyRegexp,'');}
this.names=names;}
tbt.CountryRepository.prototype.find=function(str){if(!str||str.length<2||!this.data)return[];var ret=[];var foundUids={};if(str.length==2){var code=str.toUpperCase();var d=this.data;for(var i=this.code;i<d.length;i+=this.collumns){if(d[i]==code){var o={uid:d[i-(this.code-this.uid)],name:d[i-(this.code-this.name)]}
foundUids[o.uid.toString()]=true;ret.push(o);}}}
if(str.length==3){var iso3=str.toUpperCase();var d=this.data;for(var i=this.iso3;i<d.length;i+=this.collumns){if(d[i]==iso3){var o={uid:d[i-(this.iso3-this.uid)],name:d[i-(this.iso3-this.name)]}
if(!foundUids[o.uid.toString()]){foundUids[o.uid.toString()]=true;ret.push(o);}}}}
var name=str.toLowerCase().replace(this.simplifyRegexp,'');var nameReg=new RegExp('^'+name);var names=this.names;for(var i=0;i<names.length;i++){if(names[i]==name||nameReg.test(names[i])){var o={uid:this.data[i*this.collumns+this.uid],name:this.data[i*this.collumns+this.name]};if(!foundUids[o.uid.toString()]){ret.push(o);}}}
return ret;}
tbt.DestinationSelector=function(containerId){this.__ID=tbt.DestinationSelector.__ID__++;tbt.DestinationSelector.__instances__[this.__ID]=this;if(console.debug)
console.debug(['DestinationSelector() neu instanz __ID: ',this.__ID]);this.idPrefix='tbt_DestinationSelector_'+this.__ID+'_';this.containerId=containerId;this.dataCache=new tbt.NullDestinationRepository();this.destination=null;this.countryUid=null;this.countryFilter=null;this.currentListData=[];this.currentListDataIndex={};this.inputTeaserText=null;this.widgetClass="destination-selector";this.mediaServer=window.tbt.mediaServer||'/';this.ajaxLoaderImage='img/ajax_loader_blue_white.gif';this.STATUS_NONE='none';this.STATUS_OK='ok';this.STATUS_ERROR='error';this.SOURCE_LOCAL='local';this.SOURCE_DB='db';this.status=this.STATUS_NONE;this._searching=false;this.listener=[];}
tbt.DestinationSelector.__instances__=[];tbt.DestinationSelector.__ID__=0;tbt.DestinationSelector.call=function(id,method,data){var _this=tbt.DestinationSelector.__instances__[id];if(!_this){if(console.error)
console.error(new Exception('instance has been deleted! id: '+id));return;}
return _this[method](data);}
tbt.DestinationSelector.apply=function(id,method,params){var _this=tbt.DestinationSelector.__instances__[id];if(!_this){if(console.error)
console.error(new Exception('instance has been deleted! id: '+id));return;}
return _this[method].apply(_this,params);}
tbt.DestinationSelector.createDefault=function(containerId){var ds=new tbt.DestinationSelector(containerId);try{if(window.tbt.topDestinationsCache){ds.setDataCache(new tbt.JsonDestinationRepository(window.tbt.topDestinationsCache));}else{if(console.warn)
console.warn('window.tbt.topDestinationsCache not defined. destination selector will be slow.');}}catch(e){if(console.error)
console.error(e);}
return ds;}
tbt.DestinationSelector.createWithMap=function(slectorContainerId,mapContainerId){var map=new tbt.widget.Map(document.getElementById(mapContainerId));var ds=tbt.DestinationSelector.createDefault(slectorContainerId);map.onReady=function(){try{var markerFactory=new tbt.widget.DefaultMarkerFactory();markerFactory.getPoint=function(d){return new google.maps.LatLng(d.Destination.lat,d.Destination.lng);}
markerFactory.getId=function(d){if(d.Destination.lat==d.Destination.lng)return null;return(typeof d.Destination.uid=='string')?d.Destination.uid:d.Destination.uid.toString()}
ds.addListener(function(name,data){switch(name){case'hover':map.highlightMarker(data);break;case'change':map.clear();var d=this.destination;if(d.Destination.lat!=d.Destination.lng){map.add([d],markerFactory);}
break;case'showList':map.clear();map.add(this.currentListData,markerFactory);break;case'hideList':var d=this.destination;map.clear();if(d&&d.Destination.lat!=d.Destination.lng){map.add([d],markerFactory);}
break;}});ds.onOver=function(source,uid){var listBody=jQuery(this.$('list_container')).find('.list-body:first');var row=listBody.find('a:eq('+this.uid2index(uid)+')');if(!row)return;row.css('background-color','#fff');listBody.scrollTo(row,100);}
ds.onOut=function(source,uid){jQuery(this.$('list_container')).find('.list-body a:eq('+this.uid2index(uid)+')').css('background-color','');}
ds.onOverMulti=function(source,list){}
ds.onOutMulti=function(source,list){}
ds.onZoomBounds=function(source,event,uid){}
ds.onZoomIn=function(source,event,uid){}
ds.onClick=function(source,event,uid){}
ds.onDblClick=function(source,event,uid){if(this.currentListData)
this._onSelectDestination(this.uid2index(uid));}
map.addHoverListener(ds);}catch(e){if(console.error)
console.error(e);}}
map.show();return{ds:ds,map:map};}
tbt.DestinationSelector.prototype.addListener=function(listener){this.listener.push(listener);}
tbt.DestinationSelector.prototype.fire=function(name,data){if(console.debug)console.debug('fire: '+name+'  data: '+data);for(var i=0;i<this.listener.length;i++){this.listener[i].call(this,name,data);}}
tbt.DestinationSelector.prototype.dispose=function(){if(console.debug)
console.debug(['tbt.DestinationSelector.dispose() _ID: ',this.__ID]);var input=this.$('name_input');if(input&&input._autosearchThread)
window.clearTimeout(input._autosearchThread);if(this.containerId){jQuery('#'+this.containerId).blur();jQuery('#'+this.containerId).html('');}
tbt.DestinationSelector.__instances__[this.__ID]=null;}
tbt.DestinationSelector.prototype.uid2index=function(uid){var i=this.currentListDataIndex[uid];if(i==undefined)throw new Error('uid not found: '+uid);return i;}
tbt.DestinationSelector.prototype.onDestinationChange=null;tbt.DestinationSelector.prototype.onEdit=null;tbt.DestinationSelector.prototype.onCloseEdit=null;tbt.DestinationSelector.prototype.onShowList=null;tbt.DestinationSelector.prototype.onHideList=null;tbt.DestinationSelector.prototype.setDataCache=function(dataCache){if(console.log)
if(!(dataCache.findByDestinationName instanceof Function)){if(console.warn)
console.warn('DestinationSelector.setDataCache() dataCache has no "findByDestinationName()" method!');}
this.dataCache=dataCache;}
tbt.DestinationSelector.prototype.setTeaserText=function(s){this.inputTeaserText=s;}
tbt.DestinationSelector.prototype.getStatus=function(){return this.status;}
tbt.DestinationSelector.prototype.isCompleted=function(){return this.status==this.STATUS_OK;}
tbt.DestinationSelector.prototype._onDestinationChange=function(additionalHTML){this._searching=false;if(window.console.debug)
window.console.debug({'this.destination':this.destination});this.$('name').style.display='none';this.$('path').style.display='block';var buf=[];var path=this.getPath();if(!path)
path='<i>Fehler: Ort Name ist leer</i>';buf.push('<span>',path,'</span>');buf.push('<button class="change" onclick="tbt.DestinationSelector.call(',this.__ID,', \'_onEdit\')" type="button" title="Ändern"></button>');buf.push('<div class="sc"></div>');if(additionalHTML){buf.push(additionalHTML);}
if(console.debug)
console.debug({pathHtml:buf.join('')});this.$('path').innerHTML=buf.join('');if(this.onDestinationChange){try{this.onDestinationChange();}catch(e){if(console.error)
console.error(e);}}
this.fire('change',this.destination);}
tbt.DestinationSelector.prototype.setSearchString=function(str){this.$('name_input').value=str;}
tbt.DestinationSelector.prototype.getSearchString=function(str){return this.$('name_input').value;}
tbt.DestinationSelector.prototype._onEdit=function(){this.$('name').style.display='block';if(this.destination){this.$('edit_closer').style.display='block';}
this.$('path').style.display='none';try{this.$('name_input').focus();}catch(e){}
if(this.onEdit){try{this.onEdit();}catch(e){if(console.error)
console.error(e);}}
this.fire('edit');}
tbt.DestinationSelector.prototype.openEdit=function(){this._onEdit();}
tbt.DestinationSelector.prototype.closeEdit=function(){if(!this.destination){if(console.warn)
console.warn('tbt.DestinationSelector.closeEdit() no destination! path label will be empty!');}
this.hideList();this.$('create_container').style.display='none';this.$('name_input').blur();this.$('name').style.display='none';this.$('path').style.display='block';if(this.onCloseEdit){try{this.onCloseEdit();}catch(e){if(console.error)
console.error(e);}}
this.fire('closeEdit');}
tbt.DestinationSelector.prototype.getDestination=function(){return this.destination;}
tbt.DestinationSelector.prototype.getPath=function(destination){if(!destination){destination=this.destination;if(!destination){if(console.info)
console.info('tried to use this.destination .. but it is NULL!');return'Fehler';}}
var path=[];if(destination.Destination&&destination.Destination.name)
path.push(destination.Destination.name);if(destination.Region&&destination.Region.name)
path.push(destination.Region.name);if(destination.Country&&destination.Country.name)
path.push(destination.Country.name);if(destination.Continent&&destination.Continent.name)
path.push(destination.Continent.name);return path.join(', ');}
tbt.DestinationSelector.prototype.setDestination=function(d){this.destination=d;this._onDestinationChange();if(!d){this._onEdit();}}
tbt.DestinationSelector.prototype.show=function(){var buf=[];var inputTeaserHtml='';if(this.inputTeaserText&&window.resetInputField&&window.emptyInputField){inputTeaserHtml=' value= "'+this.inputTeaserText+'"'
+' onblur="resetInputField(this, \''+this.inputTeaserText+'\')" '
+' onfocus="emptyInputField(this, \''+this.inputTeaserText+'\')" '
+' style="color: #999" ';}
var inputVar='';buf.push('<div class="',this.widgetClass,'">','<div class="search-loader" id="',this.idPrefix,'name_loader"></div>','<div class="path" id="',this.idPrefix,'path" style="display:none"></div>','<div class="name" id="',this.idPrefix,'name">','<input type="text" id="',this.idPrefix,'name_input" ',inputTeaserHtml,' />','<a id="',this.idPrefix,'edit_closer" href="javascript:tbt.DestinationSelector.call(',this.__ID,', \'closeEdit\')" class="edit-closer" title="Suche abbrechen"></a>','<button id="',this.idPrefix,'name_submit" onclick="tbt.DestinationSelector.call(',this.__ID,', \'search\')" class="confirm" type="button" title="Bestätigen"></button>','</div>','<div class="list_positioner">','<div class="list" id="',this.idPrefix,'list_container" style="display:none;"></div>','</div>','<div class="create-part" id="',this.idPrefix,'create_container" style="display:none">','<p>Bist du sicher?</p>','<p>Willst du den Ort wirklich für das Ruhrgebiet anelegen?</p>','<div class="create-buttons">','<button class="cancel" onclick="tbt.DestinationSelector.call(',this.__ID,', \'cancelSave\')" type="button" title="Abbrechen"></button>','<button class="save" id="',this.idPrefix,'save_button" onclick="tbt.DestinationSelector.call(',this.__ID,', \'save\')" type="button" title="Speichern"></button>','<div class="sc"></div>','</div>','<div id="',this.idPrefix,'create_loader" class="create-loader"><!-- save loader comes here --></div>','<div class="sc"></div>','</div>','<div class="sc"></div>','</div>');var container=document.getElementById(this.containerId);container.innerHTML=buf.join('');var _this=this;var input=this.$('name_input');input._autosearchThread=null;input._autosearch='tbt.DestinationSelector.call('+this.__ID+', \'search\')';jQuery(input).keypress(function(e){switch(e.keyCode){case 27:if(_this.destination){window.setTimeout(function(){_this.closeEdit()},1);}
break;case 13:window.setTimeout(function(){_this.search()},1);break;default:if(input._autosearchThread)
window.clearTimeout(input._autosearchThread);input._autosearchThread=window.setTimeout(input._autosearch,1000);}});jQuery(this.$('name_submit')).keypress(function(e){switch(e.keyCode){case 27:if(_this.destination){window.setTimeout(function(){_this.closeEdit()},1);}
break;}});this.fire('show',{container:container});}
tbt.DestinationSelector.prototype.setVisible=function(bol){document.getElementById(this.containerId).style.display=bol?'block':'none';}
tbt.DestinationSelector.prototype.isVisible=function(){return document.getElementById(this.containerId).style.display=='block';}
tbt.DestinationSelector.prototype.setCountryUid=function(uid){this.countryUid=uid;}
tbt.DestinationSelector.prototype.setCountryFilter=function(filter){this.countryFilter=filter;}
tbt.DestinationSelector.prototype.search=function(ignoreCache){if(this._searching){if(console.warn)
console.warn('tbt.DestinationSelector.search() still searching!');return;}
this.abortSearch();this._searching=true;this.$('create_container').style.display='none';var searchString=this.$('name_input').value;searchString=searchString.replace(/^\s+/,'').replace(/\s+$/,'');if(!searchString){this.$('list_container').innerHTML='Bitte gib zuerst einen Ort an und klicke dann auf "Bestätigen".';this.$('list_container').style.display='block';var _this=this;window.clearTimeout(this.listClosingThread);this.listClosingThread=window.setTimeout(function(){jQuery(_this.$('list_container')).slideUp('slow');},1700);this._searching=false;window.setTimeout(function(){var field=_this.$('name_input');field.value='';field.focus();},2);return;}
var parts=searchString.split(/\s*,(\s*,?)*/);if(parts.length>1){var countryName=parts.pop();if(this.countryFilter){var countries=this.countryFilter.find(countryName);if(countries.length){this.countryUid=countries[0].uid;}else{this.countryUid=0;}}
searchString=parts.join(' ');}else if(this.countryFilter){this.countryUid=0;}
console.log(['searchString',searchString,'countries',countries]);if(!ignoreCache){var destinations=this.dataCache.findByDestinationName(searchString,this.countryUid);if(destinations.length==1){this.destination=destinations[0];this._onDestinationChange('<a href="javascript:void(false)"'
+' onmousedown="tbt.DestinationSelector.call('+this.__ID+', \'search\', true)" title="Gründlich suchen">'
+'anderes '+searchString.replace(/(<|>)/g,'')+'?'
+'</a>');this.hideList();this._searching=false;return;}else if(destinations.length>1){destinations.sort(function(a,b){if(a.Destination.name==b.Destination.name)
return 0;return a.Destination.name>b.Destination.name?1:-1;});this.showList(destinations,this.SOURCE_LOCAL);return;}}
this._searching=false;this.showLoader('name_loader');var _this=this;this._currentXHR=tbtAjaxCall('/destinations/findCitiesForDestinationSelector',{cityName:searchString,countryUid:this.countryUid},{onOk:function(response){_this.searchOk(response.data)},onError:function(response){_this.searchError(response)}})}
tbt.DestinationSelector.prototype.abortSearch=function(){if(!this._currentXHR)
return;this._currentXHR.abort();if(console.info)
console.info('tbt.DestinationSelector.search() XHR aborted');this.hideLoader('name_loader');this._currentXHR=null;}
tbt.DestinationSelector.prototype.searchOk=function(destinations){this._currentXHR=null;this.hideLoader('name_loader');if(destinations.length==0){this.showList([],this.SOURCE_DB);}else if(destinations.length==1){this.destination=destinations[0];this._onDestinationChange('<a href="javascript:void(false)"'
+' onmousedown="tbt.DestinationSelector.call('+this.__ID+', \'showCreateForm\')" title="neues Objekt anlegen">'
+'neuen Ort "'+this.destination.Destination.name+'" vorschlagen?'
+'</a>');this.hideList();this._searching=false;return;}
this.showList(destinations,this.SOURCE_DB);}
tbt.DestinationSelector.prototype.searchError=function(response){this._currentXHR=null;this.hideLoader('name_loader');this.status=this.STATUS_ERROR;if(console.error)
console.error('DestinationSelector.searchError()',response);var _this=this;window.setTimeout(function(){_this._searching=false;},5000);}
tbt.DestinationSelector.prototype.closeOtherLists=function(){var instances=tbt.DestinationSelector.__instances__;for(var i=0;i<instances.length;i++){var instance=instances[i];if(instance==this||!instance)
continue;instance.hideList();instance.cancelSave();}}
tbt.DestinationSelector.prototype.showList=function(destinations,dataSource){this.closeOtherLists();this.currentListData=destinations;this.currentListDataIndex={};window.clearTimeout(this.listClosingThread);this.listClosingThread=null;var searchString=this.$('name_input').value;var buf=[];buf.push('<a class="close" href="javascript:void(false)" title="Liste schliessen"',' onclick="tbt.DestinationSelector.call(',this.__ID,', \'hideList\')">','x','</a>');if(destinations.length>0){buf.push('<p>Wir haben ',(destinations.length==1?'einen Ort':'mehrere Orte'),' mit dem Name "',searchString,'" gefunden.</p>','<label>Bitte wähle Deinen Ort aus:</label>');}else{buf.push('<p>Wir haben keinen Ort gefunden.</p>','<pErneut suchen.</p>');}
buf.push('<div class="list-body">');var cssClazz=' first';var length=destinations.length;var last=length-2;for(var i=0;i<length;i++){var d=destinations[i];this.currentListDataIndex[d.Destination.uid+'']=i;buf.push('<a class="dest',cssClazz,'" id="destsel_',this.__ID,'_',d.Destination.uid,'" href="javascript:void(false)"',' onclick="tbt.DestinationSelector.call(',this.__ID,', \'_onSelectDestination\', ',i,')" ');buf.push(' onmouseover="tbt.DestinationSelector.apply(',this.__ID,', \'fire\', [\'hover\', \'',d.Destination.uid,'\'])" ');buf.push('>',this.getPath(d),'</a>\n');cssClazz='';}
buf.push('</div>','<div class="footer">');if(destinations.length>0)
if(dataSource==this.SOURCE_DB){}else{buf.push('<a href="javascript:void(false)"',' onclick="tbt.DestinationSelector.call(',this.__ID,', \'search\', true)">','Gründlich suchen','</a>')}
buf.push('<div class="sc"></div>','</div>');this.$('list_container').innerHTML=buf.join('');var listContainer=this.$('list_container');if(listContainer.style.display=='block'){this._searching=false;}else{var _this=this;jQuery('#'+this.idPrefix+'list_container').slideDown('fast',function(){window.setTimeout(function(){_this._searching=false;},600);});}
if(this.onShowList){try{this.onShowList();}catch(e){if(console.error)
console.error(e);}}
this.fire('showList');}
tbt.DestinationSelector.prototype._onSelectDestination=function(listIndex){var destination=this.currentListData[listIndex];if(!destination){if(console.error)
console.error('no destination for index '+listIndex);return;}
this.destination=destination;this.status=this.STATUS_OK;this._onDestinationChange();this.hideList();}
tbt.DestinationSelector.prototype.hideList=function(){var _this=this;if(_this.$('list_container')){_this.$('list_container').style.display='none';_this.$('list_container').innerHTML='';_this.currentListData=null;}
if(this.onHideList){try{this.onHideList();}catch(e){if(console.error)
console.error(e);}}
this.fire('hideList');}
tbt.DestinationSelector.prototype.showCreateForm=function(){var _this=this;tbtAjaxCall('/destinations/getCountries',null,{onOk:function(response){_this.loadCountriesOk(response.data)},onError:function(response){_this.loadCountriesError(response)}});this.hideList();this.closeOtherLists();this._setSaveButtonEnabled(true);jQuery('#'+this.idPrefix+'create_container').slideDown('fast');}
tbt.DestinationSelector.prototype.loadCountriesOk=function(countries){if(console.debug)
console.debug({countries:countries});this.countries=countries;this.regionUid=0;var buf=[];buf.push('<label>Land:</label>','<select onchange="tbt.DestinationSelector.call(',this.__ID,', \'_onCountrySelected\', this)">','<option value="0">Wähle ein Land aus</option>');for(var i=0;i<countries.length;i++){var country=countries[i].Country;buf.push('<option value="',country.uid,'">',country.name,'</option>');}
buf.push('</select>','<div class="sc"></div>');this.$('create_country').innerHTML=buf.join('');}
tbt.DestinationSelector.prototype.loadCountriesError=function(){this.$('create_country').innerHTML='<em class="error">Fehler: Keine Länder gefunden.</em>';}
tbt.DestinationSelector.prototype._onCountrySelected=function(selectBox){this.countryUid=selectBox.value;if(this.countryUid==0){this.$('create_region').innerHTML='';this._setSaveButtonEnabled(false);return;}
this._setSaveButtonEnabled(true);if(console.debug)
console.debug({countryUid:this.countryUid});this.showLoader('create_region');var _this=this;tbtAjaxCall('/destinations/getRegions/'+this.countryUid,null,{onOk:function(response){_this._loadRegionsOk(response.data)},onError:function(response){_this._loadRegionsError(response)}});}
tbt.DestinationSelector.prototype._setSaveButtonEnabled=function(enabled){var b=this.$('save_button');b.disabled=enabled?'':'disabled';b.title=enabled?'Speichern':'Bitte wähle erst ein Land aus.';}
tbt.DestinationSelector.prototype._loadRegionsOk=function(regions){this.regions=regions;if(console.debug)
console.debug({regions:regions});var buf=[];buf.push('<label>Region:</label>');if(regions.length){buf.push('<select onchange="tbt.DestinationSelector.call(',this.__ID,', \'_onRegionSelected\', this)">','<option value="0">Wähle eine Region aus (optional)</option>');for(var i=0;i<regions.length;i++){var region=regions[i];buf.push('<option value="',region.uid,'">',region.name,'</option>');}
buf.push('</select>');}else{buf.push('<i>Dieses Land hat keine Regionen</i>');}
buf.push('<div class="sc"></div>');this.$('create_region').innerHTML=buf.join('');}
tbt.DestinationSelector.prototype._loadRegionsError=function(){this.$('create_region').innerHTML='<em class="error">Fehler: Keine Regionen gefunden.</em>';}
tbt.DestinationSelector.prototype._onRegionSelected=function(selectBox){this.regionUid=selectBox.value;}
tbt.DestinationSelector.prototype.save=function(){this.hideList();this.$('create_container').style.display='block';this._setSaveButtonEnabled(false);this.showLoader('create_loader');var destinationName=jQuery('#'+this.idPrefix+'name_input').val();this.regionUid=6274070;this.countryUid=6277710;console.log('country_uid: '+this.countryUid);console.log('region_uid: '+this.regionUid);var _this=this;tbtAjaxCall('/destinations/createDestination',{name:destinationName,country_uid:this.countryUid,region_uid:this.regionUid},{onOk:function(response){_this.saveOk(response.data)},onError:function(response){_this.saveError(response)}});}
tbt.DestinationSelector.prototype.cancelSave=function(){var createContainer=this.$('create_container');if(createContainer.style.display=='block'){jQuery(createContainer).slideUp('fast');}
this.$('create_country').innerHTML='';this.$('create_region').innerHTML='';}
tbt.DestinationSelector.prototype.saveOk=function(destination){this.destination=destination;if(console.debug)
console.debug(destination);this.hideLoader('create_loader');jQuery('#'+this.idPrefix+'create_container').slideUp();this.destination=destination;this.dataCache.addDestination(destination);this.status=this.STATUS_OK;this._onDestinationChange();}
tbt.DestinationSelector.prototype.saveError=function(){this.hideLoader('create_loader');this.status=this.STATUS_ERROR;this.$('create_loader').innerHTML='<em class="error">Dein Ort konnte nicht angelegt werden!</em>';this._setSaveButtonEnabled(true);}
tbt.DestinationSelector.prototype.showLoader=function(container){if(!(container instanceof Object)){container=this.$(container);}
if(!container){if(console.warn)
console.warn('element not found: '+container);return;}
container.innerHTML='<img src="'+this.mediaServer+this.ajaxLoaderImage+'" class="ajax-loader" />';}
tbt.DestinationSelector.prototype.hideLoader=function(container){if(!(container instanceof Object)){container=this.$(container);}
if(!container){if(console.warn)
console.warn('element not found: '+container);return;}
container.innerHTML='';}
tbt.DestinationSelector.prototype.$=function(id){return document.getElementById(this.idPrefix+id);}
if(!tbt.control)tbt.control={};tbt.control.RegionSelector=function(container){this.__ID=tbt.control.RegionSelector.__ID__++;tbt.control.RegionSelector.__instances__[this.__ID]=this;this.includeGeoShapes=false;this.showRegionDetails=false;this.countryUid=0;this.regionUid=0;this.regionType=null;this.countryName='';this.regionName='';this.container=typeof(container)=='string'?document.getElementById(container):container;this.countryContainer=null;this.regionContainer=null;}
tbt.control.RegionSelector.__ID__=0;tbt.control.RegionSelector.__instances__=[];tbt.control.RegionSelector.call=function(id,method,data){var _this=tbt.control.RegionSelector.__instances__[id];if(!_this){if(console.error)
console.error(new Exception('instance has been deleted! id: '+id));return;}
return _this[method](data);}
tbt.control.RegionSelector.prototype={show:function(){if(!this.countryContainer){this.countryContainer=document.createElement('div');this.countryContainer.setAttribute('class','country-container');this.countryContainer.className='country-container';var label=document.createElement('label');label.appendChild(document.createTextNode('Land'));this.countryContainer.appendChild(label);this.regionContainer=document.createElement('div');this.regionContainer.setAttribute('class','region-container');this.regionContainer.className='region-container';this.regionContainer.style.display='none';label=document.createElement('label');label.appendChild(document.createTextNode('Region'));this.regionContainer.appendChild(label);this.container.appendChild(this.countryContainer);this.container.appendChild(this.regionContainer);}
this.location=null;this.reset();this.loadCountries();},setVisible:function(bol){this.container.style.display=bol?'block':'none';},isVisible:function(){return this.container.style.display=='block';},setIncludeGeoShapes:function(bol){this.includeGeoShapes=bol;},setShowDetails:function(bol){this.showRegionDetails=bol;},getCountryName:function(){if(this.countryUid>0){return this.countryName;}else{return'';}},getRegionName:function(){if(this.regionUid>0){return this.regionName;}else{return'';}},getPath:function(){var path='';if(this.getRegionName()!=''){path=this.getRegionName()+', ';}
path+=this.getCountryName();return path;},set:function(data){if(!data){this.location=null;return}
var prevCountryUid=this.location?this.location.Country.uid:0;this.location={Country:{name:data.Country.name,uid:data.Country.uid},Region:{name:data.Region?data.Region.name:'',uid:data.Region?data.Region.uid:0}};if(!this.countries&&!this.ajaxCall){loadCountries();}else{if(prevCountryUid!=this.location.Country.uid){jQuery(this.countryContainer).find('option[value='+data.Country.uid+']').attr('selected','selected');jQuery(this.countryContainer).find('select').trigger('change');}}},reset:function(){this.countryUid=0;this.regionUid=0;this.countryName='';this.regionName='';},loadCountries:function(){var _this=this;this.ajaxCall=tbtAjaxCall('/destinations/getCountries',null,{onOk:function(response){_this.loadCountriesOk(response.data)},onError:function(response){_this.loadCountriesError(response)}});},loadCountriesOk:function(countries){if(console.debug)
console.debug({countries:countries});this.countries=countries;var buf=[];buf.push('<label>Land:</label>','<select onchange="tbt.control.RegionSelector.call(',this.__ID,', \'_onCountrySelected\', this)">','<option value="0">Wähle ein Land aus</option>');var locationUid=this.location?this.location.Country.uid:-1;for(var i=0;i<countries.length;i++){var country=countries[i].Country;buf.push('<option value="',country.uid,'"');if(locationUid==country.uid){buf.push(' selected="selected"');this.countryUid=this.location.Country.uid;this.countryName=this.location.Country.name;}
buf.push('>',country.name,'</option>');}
buf.push('</select>','<div class="sc"></div>');this.countryContainer.innerHTML=buf.join('');if(this.onShow){this.onShow();this.onShow=null;}
this.ajaxCall=null;if(this.location){this.loadRegions();}},loadCountriesError:function(){this.countryContainer.innerHTML='<em class="error">Fehler: Keine Länder gefunden.</em>';this.countryUid=0;this.regionUid=0;this.regionType=null;this.regionName='';this.countryName='';this.onChange();this.ajaxCall=null;},_onCountrySelected:function(selectBox){this.countryUid=selectBox.value;this.countryName=selectBox.options[selectBox.selectedIndex].text;this.regionUid=0;this.regionType=null;this.regionName='';this.location=null;this.loadRegions()},loadRegions:function(){if(this.countryUid==0){this.regionContainer.innerHTML='';this.onChange();return;}
this.onChange();if(console.debug)
console.debug({countryUid:this.countryUid});this.showLoader('create_region');var _this=this;this.ajaxCall=tbtAjaxCall(this.includeGeoShapes?'/destinations/getRegionsAndGeoShapes/'+this.countryUid:'/destinations/getRegions/'+this.countryUid,null,{onOk:function(response){_this._loadRegionsOk(response.data)},onError:function(response){_this._loadRegionsError(response)}});},_loadRegionsOk:function(regions){this.regions=regions;if(console.debug)
console.debug({regions:regions});var buf=[];var typeLabels={geo_shapes:'Touristische Region',regions:'Region'}
buf.push('<label>Region:</label>');if(regions&&regions.length){buf.push('<select onchange="tbt.control.RegionSelector.call(',this.__ID,', \'_onRegionSelected\', this)">','<option value="0">Wähle eine Region aus (optional)</option>');var locationUid=this.location&&this.location.Region?this.location.Region.uid:-1;for(var i=0;i<regions.length;i++){regions[i]._name=regions[i].name.toLowerCase().replace(/[äáàâæãå]/g,'a').replace(/ç/g,'c').replace(/[ëéèê]/g,'e').replace(/[ïîíì]/g,'i').replace(/ñ/g,'n').replace(/[öóòôõø]/g,'o').replace(/ß/g,'s').replace(/[üúùû]/g,'u');}
regions.sort(function(a,b){return a._name==b._name?0:(a._name>b._name?1:-1);});for(var i=0;i<regions.length;i++){var region=regions[i];if(!region.type){region.type='regions';}
buf.push('<option value="',region.type,':',region.uid,'"');if(locationUid==region.uid){buf.push(' selected="selected"');this.regionUid=this.location.Region.uid;this.regionName=this.location.Region.name;this.regionType=region.type;}
buf.push('>',region.name);if(this.showRegionDetails){buf.push('&nbsp;&nbsp;&nbsp;{');buf.push(typeLabels[region.type]);if(region.population!=undefined)
buf.push(', Einwohner:',region.population);if(region.places_count!=undefined)
buf.push(', Places:',region.places_count);buf.push('}');}
buf.push('</option>');}
buf.push('</select>');}else{buf.push('<i>Dieses Land hat keine Regionen</i>');}
buf.push('<div class="sc"></div>');this.regionContainer.innerHTML=buf.join('');this.regionContainer.style.display='';this.ajaxCall=null;},_loadRegionsError:function(){this.regionContainer.innerHTML='<em class="error">Fehler: Keine Regionen gefunden.</em>';this.onChange();this.ajaxCall=null;},_onRegionSelected:function(selectBox){if(/^\w+:\d+$/.test(selectBox.value)){var parts=selectBox.value.split(':');this.regionType=parts[0];this.regionUid=parts[1];}else{this.regionUid=selectBox.value;this.regionType=null;}
this.regionName=selectBox.options[selectBox.selectedIndex].text;this.location=null;this.onChange();},$:function(id){return document.getElementById(id);},showLoader:function(container){},hideLoader:function(container){},onChange:function(){},dispose:function(){if(this.ajaxCall){this.ajaxCall.abort();}}};


/**** AssetPackerHelper::process()  ui.core.js  ****/

;jQuery.ui||(function($){var _remove=$.fn.remove,isFF2=$.browser.mozilla&&(parseFloat($.browser.version)<1.9);$.ui={version:"1.7",plugin:{add:function(module,option,set){var proto=$.ui[module].prototype;for(var i in set){proto.plugins[i]=proto.plugins[i]||[];proto.plugins[i].push([option,set[i]]);}},call:function(instance,name,args){var set=instance.plugins[name];if(!set||!instance.element[0].parentNode){return;}
for(var i=0;i<set.length;i++){if(instance.options[set[i][0]]){set[i][1].apply(instance.element,args);}}}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b);},hasScroll:function(el,a){if($(el).css('overflow')=='hidden'){return false;}
var scroll=(a&&a=='left')?'scrollLeft':'scrollTop',has=false;if(el[scroll]>0){return true;}
el[scroll]=1;has=(el[scroll]>0);el[scroll]=0;return has;},isOverAxis:function(x,reference,size){return(x>reference)&&(x<(reference+size));},isOver:function(y,x,top,left,height,width){return $.ui.isOverAxis(y,top,height)&&$.ui.isOverAxis(x,left,width);},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};if(isFF2){var attr=$.attr,removeAttr=$.fn.removeAttr,ariaNS="http://www.w3.org/2005/07/aaa",ariaState=/^aria-/,ariaRole=/^wairole:/;$.attr=function(elem,name,value){var set=value!==undefined;return(name=='role'?(set?attr.call(this,elem,name,"wairole:"+value):(attr.apply(this,arguments)||"").replace(ariaRole,"")):(ariaState.test(name)?(set?elem.setAttributeNS(ariaNS,name.replace(ariaState,"aaa:"),value):attr.call(this,elem,name.replace(ariaState,"aaa:"))):attr.apply(this,arguments)));};$.fn.removeAttr=function(name){return(ariaState.test(name)?this.each(function(){this.removeAttributeNS(ariaNS,name.replace(ariaState,""));}):removeAttr.call(this,name));};}
$.fn.extend({remove:function(){$("*",this).add(this).each(function(){$(this).triggerHandler("remove");});return _remove.apply(this,arguments);},enableSelection:function(){return this.attr('unselectable','off').css('MozUserSelect','').unbind('selectstart.ui');},disableSelection:function(){return this.attr('unselectable','on').css('MozUserSelect','none').bind('selectstart.ui',function(){return false;});},scrollParent:function(){var scrollParent;if(($.browser.msie&&(/(static|relative)/).test(this.css('position')))||(/absolute/).test(this.css('position'))){scrollParent=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test($.curCSS(this,'position',1))&&(/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));}).eq(0);}else{scrollParent=this.parents().filter(function(){return(/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));}).eq(0);}
return(/fixed/).test(this.css('position'))||!scrollParent.length?$(document):scrollParent;}});$.extend($.expr[':'],{data:function(elem,i,match){return!!$.data(elem,match[3]);},focusable:function(element){var nodeName=element.nodeName.toLowerCase(),tabIndex=$.attr(element,'tabindex');return(/input|select|textarea|button|object/.test(nodeName)?!element.disabled:'a'==nodeName||'area'==nodeName?element.href||!isNaN(tabIndex):!isNaN(tabIndex))&&!$(element)['area'==nodeName?'parents':'closest'](':hidden').length;},tabbable:function(element){var tabIndex=$.attr(element,'tabindex');return(isNaN(tabIndex)||tabIndex>=0)&&$(element).is(':focusable');}});function getter(namespace,plugin,method,args){function getMethods(type){var methods=$[namespace][plugin][type]||[];return(typeof methods=='string'?methods.split(/,?\s+/):methods);}
var methods=getMethods('getter');if(args.length==1&&typeof args[0]=='string'){methods=methods.concat(getMethods('getterSetter'));}
return($.inArray(method,methods)!=-1);}
$.widget=function(name,prototype){var namespace=name.split(".")[0];name=name.split(".")[1];$.fn[name]=function(options){var isMethodCall=(typeof options=='string'),args=Array.prototype.slice.call(arguments,1);if(isMethodCall&&options.substring(0,1)=='_'){return this;}
if(isMethodCall&&getter(namespace,name,options,args)){var instance=$.data(this[0],name);return(instance?instance[options].apply(instance,args):undefined);}
return this.each(function(){var instance=$.data(this,name);(!instance&&!isMethodCall&&$.data(this,name,new $[namespace][name](this,options))._init());(instance&&isMethodCall&&$.isFunction(instance[options])&&instance[options].apply(instance,args));});};$[namespace]=$[namespace]||{};$[namespace][name]=function(element,options){var self=this;this.namespace=namespace;this.widgetName=name;this.widgetEventPrefix=$[namespace][name].eventPrefix||name;this.widgetBaseClass=namespace+'-'+name;this.options=$.extend({},$.widget.defaults,$[namespace][name].defaults,$.metadata&&$.metadata.get(element)[name],options);this.element=$(element).bind('setData.'+name,function(event,key,value){if(event.target==element){return self._setData(key,value);}}).bind('getData.'+name,function(event,key){if(event.target==element){return self._getData(key);}}).bind('remove',function(){return self.destroy();});};$[namespace][name].prototype=$.extend({},$.widget.prototype,prototype);$[namespace][name].getterSetter='option';};$.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+'-disabled'+' '+this.namespace+'-state-disabled').removeAttr('aria-disabled');},option:function(key,value){var options=key,self=this;if(typeof key=="string"){if(value===undefined){return this._getData(key);}
options={};options[key]=value;}
$.each(options,function(key,value){self._setData(key,value);});},_getData:function(key){return this.options[key];},_setData:function(key,value){this.options[key]=value;if(key=='disabled'){this.element
[value?'addClass':'removeClass'](this.widgetBaseClass+'-disabled'+' '+
this.namespace+'-state-disabled').attr("aria-disabled",value);}},enable:function(){this._setData('disabled',false);},disable:function(){this._setData('disabled',true);},_trigger:function(type,event,data){var callback=this.options[type],eventName=(type==this.widgetEventPrefix?type:this.widgetEventPrefix+type);event=$.Event(event);event.type=eventName;if(event.originalEvent){for(var i=$.event.props.length,prop;i;){prop=$.event.props[--i];event[prop]=event.originalEvent[prop];}}
this.element.trigger(event,data);return!($.isFunction(callback)&&callback.call(this.element[0],event,data)===false||event.isDefaultPrevented());}};$.widget.defaults={disabled:false};$.ui.mouse={_mouseInit:function(){var self=this;this.element.bind('mousedown.'+this.widgetName,function(event){return self._mouseDown(event);}).bind('click.'+this.widgetName,function(event){if(self._preventClickEvent){self._preventClickEvent=false;event.stopImmediatePropagation();return false;}});if($.browser.msie){this._mouseUnselectable=this.element.attr('unselectable');this.element.attr('unselectable','on');}
this.started=false;},_mouseDestroy:function(){this.element.unbind('.'+this.widgetName);($.browser.msie&&this.element.attr('unselectable',this._mouseUnselectable));},_mouseDown:function(event){event.originalEvent=event.originalEvent||{};if(event.originalEvent.mouseHandled){return;}
(this._mouseStarted&&this._mouseUp(event));this._mouseDownEvent=event;var self=this,btnIsLeft=(event.which==1),elIsCancel=(typeof this.options.cancel=="string"?$(event.target).parents().add(event.target).filter(this.options.cancel).length:false);if(!btnIsLeft||elIsCancel||!this._mouseCapture(event)){return true;}
this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){self.mouseDelayMet=true;},this.options.delay);}
if(this._mouseDistanceMet(event)&&this._mouseDelayMet(event)){this._mouseStarted=(this._mouseStart(event)!==false);if(!this._mouseStarted){event.preventDefault();return true;}}
this._mouseMoveDelegate=function(event){return self._mouseMove(event);};this._mouseUpDelegate=function(event){return self._mouseUp(event);};$(document).bind('mousemove.'+this.widgetName,this._mouseMoveDelegate).bind('mouseup.'+this.widgetName,this._mouseUpDelegate);($.browser.safari||event.preventDefault());event.originalEvent.mouseHandled=true;return true;},_mouseMove:function(event){if($.browser.msie&&!event.button){return this._mouseUp(event);}
if(this._mouseStarted){this._mouseDrag(event);return event.preventDefault();}
if(this._mouseDistanceMet(event)&&this._mouseDelayMet(event)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,event)!==false);(this._mouseStarted?this._mouseDrag(event):this._mouseUp(event));}
return!this._mouseStarted;},_mouseUp:function(event){$(document).unbind('mousemove.'+this.widgetName,this._mouseMoveDelegate).unbind('mouseup.'+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=(event.target==this._mouseDownEvent.target);this._mouseStop(event);}
return false;},_mouseDistanceMet:function(event){return(Math.max(Math.abs(this._mouseDownEvent.pageX-event.pageX),Math.abs(this._mouseDownEvent.pageY-event.pageY))>=this.options.distance);},_mouseDelayMet:function(event){return this.mouseDelayMet;},_mouseStart:function(event){},_mouseDrag:function(event){},_mouseStop:function(event){},_mouseCapture:function(event){return true;}};$.ui.mouse.defaults={cancel:null,distance:1,delay:0};})(jQuery);


/**** AssetPackerHelper::process()  ui.draggable.js  ****/


(function($){$.widget("ui.draggable",$.extend({},$.ui.mouse,{_init:function(){if(this.options.helper=='original'&&!(/^(?:r|a|f)/).test(this.element.css("position")))
this.element[0].style.position='relative';(this.options.addClasses&&this.element.addClass("ui-draggable"));(this.options.disabled&&this.element.addClass("ui-draggable-disabled"));this._mouseInit();},destroy:function(){if(!this.element.data('draggable'))return;this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable"
+" ui-draggable-dragging"
+" ui-draggable-disabled");this._mouseDestroy();},_mouseCapture:function(event){var o=this.options;if(this.helper||o.disabled||$(event.target).is('.ui-resizable-handle'))
return false;this.handle=this._getHandle(event);if(!this.handle)
return false;return true;},_mouseStart:function(event){var o=this.options;this.helper=this._createHelper(event);this._cacheHelperProportions();if($.ui.ddmanager)
$.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};$.extend(this.offset,{click:{left:event.pageX-this.offset.left,top:event.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(event);this.originalPageX=event.pageX;this.originalPageY=event.pageY;if(o.cursorAt)
this._adjustOffsetFromHelper(o.cursorAt);if(o.containment)
this._setContainment();this._trigger("start",event);this._cacheHelperProportions();if($.ui.ddmanager&&!o.dropBehaviour)
$.ui.ddmanager.prepareOffsets(this,event);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(event,true);return true;},_mouseDrag:function(event,noPropagation){this.position=this._generatePosition(event);this.positionAbs=this._convertPositionTo("absolute");if(!noPropagation){var ui=this._uiHash();this._trigger('drag',event,ui);this.position=ui.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($.ui.ddmanager)$.ui.ddmanager.drag(this,event);return false;},_mouseStop:function(event){var dropped=false;if($.ui.ddmanager&&!this.options.dropBehaviour)
dropped=$.ui.ddmanager.drop(this,event);if(this.dropped){dropped=this.dropped;this.dropped=false;}
if((this.options.revert=="invalid"&&!dropped)||(this.options.revert=="valid"&&dropped)||this.options.revert===true||($.isFunction(this.options.revert)&&this.options.revert.call(this.element,dropped))){var self=this;$(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){self._trigger("stop",event);self._clear();});}else{this._trigger("stop",event);this._clear();}
return false;},_getHandle:function(event){var handle=!this.options.handle||!$(this.options.handle,this.element).length?true:false;$(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==event.target)handle=true;});return handle;},_createHelper:function(event){var o=this.options;var helper=$.isFunction(o.helper)?$(o.helper.apply(this.element[0],[event])):(o.helper=='clone'?this.element.clone():this.element);if(!helper.parents('body').length)
helper.appendTo((o.appendTo=='parent'?this.element[0].parentNode:o.appendTo));if(helper[0]!=this.element[0]&&!(/(fixed|absolute)/).test(helper.css("position")))
helper.css("position","absolute");return helper;},_adjustOffsetFromHelper:function(obj){if(obj.left!=undefined)this.offset.click.left=obj.left+this.margins.left;if(obj.right!=undefined)this.offset.click.left=this.helperProportions.width-obj.right+this.margins.left;if(obj.top!=undefined)this.offset.click.top=obj.top+this.margins.top;if(obj.bottom!=undefined)this.offset.click.top=this.helperProportions.height-obj.bottom+this.margins.top;},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var po=this.offsetParent.offset();if(this.cssPosition=='absolute'&&this.scrollParent[0]!=document&&$.ui.contains(this.scrollParent[0],this.offsetParent[0])){po.left+=this.scrollParent.scrollLeft();po.top+=this.scrollParent.scrollTop();}
if((this.offsetParent[0]==document.body)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=='html'&&$.browser.msie))
po={top:0,left:0};return{top:po.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:po.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)};},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var p=this.element.position();return{top:p.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:p.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()};}else{return{top:0,left:0};}},_cacheMargins:function(){this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0)};},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()};},_setContainment:function(){var o=this.options;if(o.containment=='parent')o.containment=this.helper[0].parentNode;if(o.containment=='document'||o.containment=='window')this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,$(o.containment=='document'?document:window).width()-this.helperProportions.width-this.margins.left,($(o.containment=='document'?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!(/^(document|window|parent)$/).test(o.containment)&&o.containment.constructor!=Array){var ce=$(o.containment)[0];if(!ce)return;var co=$(o.containment).offset();var over=($(ce).css("overflow")!='hidden');this.containment=[co.left+(parseInt($(ce).css("borderLeftWidth"),10)||0)+(parseInt($(ce).css("paddingLeft"),10)||0)-this.margins.left,co.top+(parseInt($(ce).css("borderTopWidth"),10)||0)+(parseInt($(ce).css("paddingTop"),10)||0)-this.margins.top,co.left+(over?Math.max(ce.scrollWidth,ce.offsetWidth):ce.offsetWidth)-(parseInt($(ce).css("borderLeftWidth"),10)||0)-(parseInt($(ce).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,co.top+(over?Math.max(ce.scrollHeight,ce.offsetHeight):ce.offsetHeight)-(parseInt($(ce).css("borderTopWidth"),10)||0)-(parseInt($(ce).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top];}else if(o.containment.constructor==Array){this.containment=o.containment;}},_convertPositionTo:function(d,pos){if(!pos)pos=this.position;var mod=d=="absolute"?1:-1;var o=this.options,scroll=this.cssPosition=='absolute'&&!(this.scrollParent[0]!=document&&$.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,scrollIsRootNode=(/(html|body)/i).test(scroll[0].tagName);return{top:(pos.top
+this.offset.relative.top*mod
+this.offset.parent.top*mod
-($.browser.safari&&this.cssPosition=='fixed'?0:(this.cssPosition=='fixed'?-this.scrollParent.scrollTop():(scrollIsRootNode?0:scroll.scrollTop()))*mod)),left:(pos.left
+this.offset.relative.left*mod
+this.offset.parent.left*mod
-($.browser.safari&&this.cssPosition=='fixed'?0:(this.cssPosition=='fixed'?-this.scrollParent.scrollLeft():scrollIsRootNode?0:scroll.scrollLeft())*mod))};},_generatePosition:function(event){var o=this.options,scroll=this.cssPosition=='absolute'&&!(this.scrollParent[0]!=document&&$.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,scrollIsRootNode=(/(html|body)/i).test(scroll[0].tagName);if(this.cssPosition=='relative'&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0])){this.offset.relative=this._getRelativeOffset();}
var pageX=event.pageX;var pageY=event.pageY;if(this.originalPosition){if(this.containment){if(event.pageX-this.offset.click.left<this.containment[0])pageX=this.containment[0]+this.offset.click.left;if(event.pageY-this.offset.click.top<this.containment[1])pageY=this.containment[1]+this.offset.click.top;if(event.pageX-this.offset.click.left>this.containment[2])pageX=this.containment[2]+this.offset.click.left;if(event.pageY-this.offset.click.top>this.containment[3])pageY=this.containment[3]+this.offset.click.top;}
if(o.grid){var top=this.originalPageY+Math.round((pageY-this.originalPageY)/o.grid[1])*o.grid[1];pageY=this.containment?(!(top-this.offset.click.top<this.containment[1]||top-this.offset.click.top>this.containment[3])?top:(!(top-this.offset.click.top<this.containment[1])?top-o.grid[1]:top+o.grid[1])):top;var left=this.originalPageX+Math.round((pageX-this.originalPageX)/o.grid[0])*o.grid[0];pageX=this.containment?(!(left-this.offset.click.left<this.containment[0]||left-this.offset.click.left>this.containment[2])?left:(!(left-this.offset.click.left<this.containment[0])?left-o.grid[0]:left+o.grid[0])):left;}}
return{top:(pageY
-this.offset.click.top
-this.offset.relative.top
-this.offset.parent.top
+($.browser.safari&&this.cssPosition=='fixed'?0:(this.cssPosition=='fixed'?-this.scrollParent.scrollTop():(scrollIsRootNode?0:scroll.scrollTop())))),left:(pageX
-this.offset.click.left
-this.offset.relative.left
-this.offset.parent.left
+($.browser.safari&&this.cssPosition=='fixed'?0:(this.cssPosition=='fixed'?-this.scrollParent.scrollLeft():scrollIsRootNode?0:scroll.scrollLeft())))};},_clear:function(){this.helper.removeClass("ui-draggable-dragging");if(this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval)this.helper.remove();this.helper=null;this.cancelHelperRemoval=false;},_trigger:function(type,event,ui){ui=ui||this._uiHash();$.ui.plugin.call(this,type,[event,ui]);if(type=="drag")this.positionAbs=this._convertPositionTo("absolute");return $.widget.prototype._trigger.call(this,type,event,ui);},plugins:{},_uiHash:function(event){return{helper:this.helper,position:this.position,absolutePosition:this.positionAbs,offset:this.positionAbs};}}));$.extend($.ui.draggable,{version:"1.7",eventPrefix:"drag",defaults:{addClasses:true,appendTo:"parent",axis:false,cancel:":input,option",connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,delay:0,distance:1,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false}});$.ui.plugin.add("draggable","connectToSortable",{start:function(event,ui){var inst=$(this).data("draggable"),o=inst.options,uiSortable=$.extend({},ui,{item:inst.element});inst.sortables=[];$(o.connectToSortable).each(function(){var sortable=$.data(this,'sortable');if(sortable&&!sortable.options.disabled){inst.sortables.push({instance:sortable,shouldRevert:sortable.options.revert});sortable._refreshItems();sortable._trigger("activate",event,uiSortable);}});},stop:function(event,ui){var inst=$(this).data("draggable"),uiSortable=$.extend({},ui,{item:inst.element});$.each(inst.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;inst.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert)this.instance.options.revert=true;this.instance._mouseStop(event);this.instance.options.helper=this.instance.options._helper;if(inst.options.helper=='original')
this.instance.currentItem.css({top:'auto',left:'auto'});}else{this.instance.cancelHelperRemoval=false;this.instance._trigger("deactivate",event,uiSortable);}});},drag:function(event,ui){var inst=$(this).data("draggable"),self=this;var checkPos=function(o){var dyClick=this.offset.click.top,dxClick=this.offset.click.left;var helperTop=this.positionAbs.top,helperLeft=this.positionAbs.left;var itemHeight=o.height,itemWidth=o.width;var itemTop=o.top,itemLeft=o.left;return $.ui.isOver(helperTop+dyClick,helperLeft+dxClick,itemTop,itemLeft,itemHeight,itemWidth);};$.each(inst.sortables,function(i){this.instance.positionAbs=inst.positionAbs;this.instance.helperProportions=inst.helperProportions;this.instance.offset.click=inst.offset.click;if(this.instance._intersectsWith(this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=$(self).clone().appendTo(this.instance.element).data("sortable-item",true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return ui.helper[0];};event.target=this.instance.currentItem[0];this.instance._mouseCapture(event,true);this.instance._mouseStart(event,true,true);this.instance.offset.click.top=inst.offset.click.top;this.instance.offset.click.left=inst.offset.click.left;this.instance.offset.parent.left-=inst.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=inst.offset.parent.top-this.instance.offset.parent.top;inst._trigger("toSortable",event);inst.dropped=this.instance.element;inst.currentItem=inst.element;this.instance.fromOutside=inst;}
if(this.instance.currentItem)this.instance._mouseDrag(event);}else{if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._trigger('out',event,this.instance._uiHash(this.instance));this.instance._mouseStop(event,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();if(this.instance.placeholder)this.instance.placeholder.remove();inst._trigger("fromSortable",event);inst.dropped=false;}};});}});$.ui.plugin.add("draggable","cursor",{start:function(event,ui){var t=$('body'),o=$(this).data('draggable').options;if(t.css("cursor"))o._cursor=t.css("cursor");t.css("cursor",o.cursor);},stop:function(event,ui){var o=$(this).data('draggable').options;if(o._cursor)$('body').css("cursor",o._cursor);}});$.ui.plugin.add("draggable","iframeFix",{start:function(event,ui){var o=$(this).data('draggable').options;$(o.iframeFix===true?"iframe":o.iframeFix).each(function(){$('<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($(this).offset()).appendTo("body");});},stop:function(event,ui){$("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this);});}});$.ui.plugin.add("draggable","opacity",{start:function(event,ui){var t=$(ui.helper),o=$(this).data('draggable').options;if(t.css("opacity"))o._opacity=t.css("opacity");t.css('opacity',o.opacity);},stop:function(event,ui){var o=$(this).data('draggable').options;if(o._opacity)$(ui.helper).css('opacity',o._opacity);}});$.ui.plugin.add("draggable","scroll",{start:function(event,ui){var i=$(this).data("draggable");if(i.scrollParent[0]!=document&&i.scrollParent[0].tagName!='HTML')i.overflowOffset=i.scrollParent.offset();},drag:function(event,ui){var i=$(this).data("draggable"),o=i.options,scrolled=false;if(i.scrollParent[0]!=document&&i.scrollParent[0].tagName!='HTML'){if(!o.axis||o.axis!='x'){if((i.overflowOffset.top+i.scrollParent[0].offsetHeight)-event.pageY<o.scrollSensitivity)
i.scrollParent[0].scrollTop=scrolled=i.scrollParent[0].scrollTop+o.scrollSpeed;else if(event.pageY-i.overflowOffset.top<o.scrollSensitivity)
i.scrollParent[0].scrollTop=scrolled=i.scrollParent[0].scrollTop-o.scrollSpeed;}
if(!o.axis||o.axis!='y'){if((i.overflowOffset.left+i.scrollParent[0].offsetWidth)-event.pageX<o.scrollSensitivity)
i.scrollParent[0].scrollLeft=scrolled=i.scrollParent[0].scrollLeft+o.scrollSpeed;else if(event.pageX-i.overflowOffset.left<o.scrollSensitivity)
i.scrollParent[0].scrollLeft=scrolled=i.scrollParent[0].scrollLeft-o.scrollSpeed;}}else{if(!o.axis||o.axis!='x'){if(event.pageY-$(document).scrollTop()<o.scrollSensitivity)
scrolled=$(document).scrollTop($(document).scrollTop()-o.scrollSpeed);else if($(window).height()-(event.pageY-$(document).scrollTop())<o.scrollSensitivity)
scrolled=$(document).scrollTop($(document).scrollTop()+o.scrollSpeed);}
if(!o.axis||o.axis!='y'){if(event.pageX-$(document).scrollLeft()<o.scrollSensitivity)
scrolled=$(document).scrollLeft($(document).scrollLeft()-o.scrollSpeed);else if($(window).width()-(event.pageX-$(document).scrollLeft())<o.scrollSensitivity)
scrolled=$(document).scrollLeft($(document).scrollLeft()+o.scrollSpeed);}}
if(scrolled!==false&&$.ui.ddmanager&&!o.dropBehaviour)
$.ui.ddmanager.prepareOffsets(i,event);}});$.ui.plugin.add("draggable","snap",{start:function(event,ui){var i=$(this).data("draggable"),o=i.options;i.snapElements=[];$(o.snap.constructor!=String?(o.snap.items||':data(draggable)'):o.snap).each(function(){var $t=$(this);var $o=$t.offset();if(this!=i.element[0])i.snapElements.push({item:this,width:$t.outerWidth(),height:$t.outerHeight(),top:$o.top,left:$o.left});});},drag:function(event,ui){var inst=$(this).data("draggable"),o=inst.options;var d=o.snapTolerance;var x1=ui.offset.left,x2=x1+inst.helperProportions.width,y1=ui.offset.top,y2=y1+inst.helperProportions.height;for(var i=inst.snapElements.length-1;i>=0;i--){var l=inst.snapElements[i].left,r=l+inst.snapElements[i].width,t=inst.snapElements[i].top,b=t+inst.snapElements[i].height;if(!((l-d<x1&&x1<r+d&&t-d<y1&&y1<b+d)||(l-d<x1&&x1<r+d&&t-d<y2&&y2<b+d)||(l-d<x2&&x2<r+d&&t-d<y1&&y1<b+d)||(l-d<x2&&x2<r+d&&t-d<y2&&y2<b+d))){if(inst.snapElements[i].snapping)(inst.options.snap.release&&inst.options.snap.release.call(inst.element,event,$.extend(inst._uiHash(),{snapItem:inst.snapElements[i].item})));inst.snapElements[i].snapping=false;continue;}
if(o.snapMode!='inner'){var ts=Math.abs(t-y2)<=d;var bs=Math.abs(b-y1)<=d;var ls=Math.abs(l-x2)<=d;var rs=Math.abs(r-x1)<=d;if(ts)ui.position.top=inst._convertPositionTo("relative",{top:t-inst.helperProportions.height,left:0}).top-inst.margins.top;if(bs)ui.position.top=inst._convertPositionTo("relative",{top:b,left:0}).top-inst.margins.top;if(ls)ui.position.left=inst._convertPositionTo("relative",{top:0,left:l-inst.helperProportions.width}).left-inst.margins.left;if(rs)ui.position.left=inst._convertPositionTo("relative",{top:0,left:r}).left-inst.margins.left;}
var first=(ts||bs||ls||rs);if(o.snapMode!='outer'){var ts=Math.abs(t-y1)<=d;var bs=Math.abs(b-y2)<=d;var ls=Math.abs(l-x1)<=d;var rs=Math.abs(r-x2)<=d;if(ts)ui.position.top=inst._convertPositionTo("relative",{top:t,left:0}).top-inst.margins.top;if(bs)ui.position.top=inst._convertPositionTo("relative",{top:b-inst.helperProportions.height,left:0}).top-inst.margins.top;if(ls)ui.position.left=inst._convertPositionTo("relative",{top:0,left:l}).left-inst.margins.left;if(rs)ui.position.left=inst._convertPositionTo("relative",{top:0,left:r-inst.helperProportions.width}).left-inst.margins.left;}
if(!inst.snapElements[i].snapping&&(ts||bs||ls||rs||first))
(inst.options.snap.snap&&inst.options.snap.snap.call(inst.element,event,$.extend(inst._uiHash(),{snapItem:inst.snapElements[i].item})));inst.snapElements[i].snapping=(ts||bs||ls||rs||first);};}});$.ui.plugin.add("draggable","stack",{start:function(event,ui){var o=$(this).data("draggable").options;var group=$.makeArray($(o.stack.group)).sort(function(a,b){return(parseInt($(a).css("zIndex"),10)||o.stack.min)-(parseInt($(b).css("zIndex"),10)||o.stack.min);});$(group).each(function(i){this.style.zIndex=o.stack.min+i;});this[0].style.zIndex=o.stack.min+group.length;}});$.ui.plugin.add("draggable","zIndex",{start:function(event,ui){var t=$(ui.helper),o=$(this).data("draggable").options;if(t.css("zIndex"))o._zIndex=t.css("zIndex");t.css('zIndex',o.zIndex);},stop:function(event,ui){var o=$(this).data("draggable").options;if(o._zIndex)$(ui.helper).css('zIndex',o._zIndex);}});})(jQuery);


/**** AssetPackerHelper::process()  ui.droppable.js  ****/


(function($){$.widget("ui.droppable",{_init:function(){var o=this.options,accept=o.accept;this.isover=0;this.isout=1;this.options.accept=this.options.accept&&$.isFunction(this.options.accept)?this.options.accept:function(d){return d.is(accept);};this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};$.ui.ddmanager.droppables[this.options.scope]=$.ui.ddmanager.droppables[this.options.scope]||[];$.ui.ddmanager.droppables[this.options.scope].push(this);(this.options.addClasses&&this.element.addClass("ui-droppable"));},destroy:function(){var drop=$.ui.ddmanager.droppables[this.options.scope];for(var i=0;i<drop.length;i++)
if(drop[i]==this)
drop.splice(i,1);this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable");},_setData:function(key,value){if(key=='accept'){this.options.accept=value&&$.isFunction(value)?value:function(d){return d.is(accept);};}else{$.widget.prototype._setData.apply(this,arguments);}},_activate:function(event){var draggable=$.ui.ddmanager.current;if(this.options.activeClass)this.element.addClass(this.options.activeClass);(draggable&&this._trigger('activate',event,this.ui(draggable)));},_deactivate:function(event){var draggable=$.ui.ddmanager.current;if(this.options.activeClass)this.element.removeClass(this.options.activeClass);(draggable&&this._trigger('deactivate',event,this.ui(draggable)));},_over:function(event){var draggable=$.ui.ddmanager.current;if(!draggable||(draggable.currentItem||draggable.element)[0]==this.element[0])return;if(this.options.accept.call(this.element[0],(draggable.currentItem||draggable.element))){if(this.options.hoverClass)this.element.addClass(this.options.hoverClass);this._trigger('over',event,this.ui(draggable));}},_out:function(event){var draggable=$.ui.ddmanager.current;if(!draggable||(draggable.currentItem||draggable.element)[0]==this.element[0])return;if(this.options.accept.call(this.element[0],(draggable.currentItem||draggable.element))){if(this.options.hoverClass)this.element.removeClass(this.options.hoverClass);this._trigger('out',event,this.ui(draggable));}},_drop:function(event,custom){var draggable=custom||$.ui.ddmanager.current;if(!draggable||(draggable.currentItem||draggable.element)[0]==this.element[0])return false;var childrenIntersection=false;this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var inst=$.data(this,'droppable');if(inst.options.greedy&&$.ui.intersect(draggable,$.extend(inst,{offset:inst.element.offset()}),inst.options.tolerance)){childrenIntersection=true;return false;}});if(childrenIntersection)return false;if(this.options.accept.call(this.element[0],(draggable.currentItem||draggable.element))){if(this.options.activeClass)this.element.removeClass(this.options.activeClass);if(this.options.hoverClass)this.element.removeClass(this.options.hoverClass);this._trigger('drop',event,this.ui(draggable));return this.element;}
return false;},ui:function(c){return{draggable:(c.currentItem||c.element),helper:c.helper,position:c.position,absolutePosition:c.positionAbs,offset:c.positionAbs};}});$.extend($.ui.droppable,{version:"1.7",eventPrefix:'drop',defaults:{accept:'*',activeClass:false,addClasses:true,greedy:false,hoverClass:false,scope:'default',tolerance:'intersect'}});$.ui.intersect=function(draggable,droppable,toleranceMode){if(!droppable.offset)return false;var x1=(draggable.positionAbs||draggable.position.absolute).left,x2=x1+draggable.helperProportions.width,y1=(draggable.positionAbs||draggable.position.absolute).top,y2=y1+draggable.helperProportions.height;var l=droppable.offset.left,r=l+droppable.proportions.width,t=droppable.offset.top,b=t+droppable.proportions.height;switch(toleranceMode){case'fit':return(l<x1&&x2<r&&t<y1&&y2<b);break;case'intersect':return(l<x1+(draggable.helperProportions.width/2)&&x2-(draggable.helperProportions.width/2)<r&&t<y1+(draggable.helperProportions.height/2)&&y2-(draggable.helperProportions.height/2)<b);break;case'pointer':var draggableLeft=((draggable.positionAbs||draggable.position.absolute).left+(draggable.clickOffset||draggable.offset.click).left),draggableTop=((draggable.positionAbs||draggable.position.absolute).top+(draggable.clickOffset||draggable.offset.click).top),isOver=$.ui.isOver(draggableTop,draggableLeft,t,l,droppable.proportions.height,droppable.proportions.width);return isOver;break;case'touch':return((y1>=t&&y1<=b)||(y2>=t&&y2<=b)||(y1<t&&y2>b))&&((x1>=l&&x1<=r)||(x2>=l&&x2<=r)||(x1<l&&x2>r));break;default:return false;break;}};$.ui.ddmanager={current:null,droppables:{'default':[]},prepareOffsets:function(t,event){var m=$.ui.ddmanager.droppables[t.options.scope];var type=event?event.type:null;var list=(t.currentItem||t.element).find(":data(droppable)").andSelf();droppablesLoop:for(var i=0;i<m.length;i++){if(m[i].options.disabled||(t&&!m[i].options.accept.call(m[i].element[0],(t.currentItem||t.element))))continue;for(var j=0;j<list.length;j++){if(list[j]==m[i].element[0]){m[i].proportions.height=0;continue droppablesLoop;}};m[i].visible=m[i].element.css("display")!="none";if(!m[i].visible)continue;m[i].offset=m[i].element.offset();m[i].proportions={width:m[i].element[0].offsetWidth,height:m[i].element[0].offsetHeight};if(type=="mousedown")m[i]._activate.call(m[i],event);}},drop:function(draggable,event){var dropped=false;$.each($.ui.ddmanager.droppables[draggable.options.scope],function(){if(!this.options)return;if(!this.options.disabled&&this.visible&&$.ui.intersect(draggable,this,this.options.tolerance))
dropped=this._drop.call(this,event);if(!this.options.disabled&&this.visible&&this.options.accept.call(this.element[0],(draggable.currentItem||draggable.element))){this.isout=1;this.isover=0;this._deactivate.call(this,event);}});return dropped;},drag:function(draggable,event){if(draggable.options.refreshPositions)$.ui.ddmanager.prepareOffsets(draggable,event);$.each($.ui.ddmanager.droppables[draggable.options.scope],function(){if(this.options.disabled||this.greedyChild||!this.visible)return;var intersects=$.ui.intersect(draggable,this,this.options.tolerance);var c=!intersects&&this.isover==1?'isout':(intersects&&this.isover==0?'isover':null);if(!c)return;var parentInstance;if(this.options.greedy){var parent=this.element.parents(':data(droppable):eq(0)');if(parent.length){parentInstance=$.data(parent[0],'droppable');parentInstance.greedyChild=(c=='isover'?1:0);}}
if(parentInstance&&c=='isover'){parentInstance['isover']=0;parentInstance['isout']=1;parentInstance._out.call(parentInstance,event);}
this[c]=1;this[c=='isout'?'isover':'isout']=0;this[c=="isover"?"_over":"_out"].call(this,event);if(parentInstance&&c=='isout'){parentInstance['isout']=0;parentInstance['isover']=1;parentInstance._over.call(parentInstance,event);}});}};})(jQuery);


/**** AssetPackerHelper::process()  infowin.js  ****/


if(!window.tbt)window.tbt=tbt={};if(!tbt.maps)tbt.maps={};tbt.maps.Infowin=function(latlng,dom){this.offsetX=0;this.offsetY=-17;this.latlng_=latlng;this.dom_=dom;this.prototype=new GOverlay();this._mouseInBubble=false;this.map_=null;this.layoutStrategy=null;this.initialize=function(map){if(!this.layoutStrategy){this.setLayout(new tbt.maps.InfoWinSimpleLayout({offset:{x:this.offsetX,y:this.offsetY}}));}
var div=jQuery('<div />');div.css('display','none').attr('class','map-info-win').appendTo(map.getPane(G_MAP_FLOAT_PANE));var closer=document.createElement('a');closer.setAttribute('class',closer.className='close');var _this=this;closer.onclick=function(){_this.hide();}
if(jQuery.browser.msie6){closer.setAttribute('href','javascript:void(null)');}
div.append(closer);this.contentDiv=jQuery('<div />').attr('class','map-info-content').appendTo(div);jQuery('<div />').attr('class','map-info-beak').appendTo(div);this.map_=map;this.div_=div;var _this=this;var closeHandler=google.maps.Event.addListener(map,'click',function(overlay,latlng){if(_this._mouseInBubble||overlay||_this.div_.css('display')=='none')return;_this.hide();});div.get(0).onmouseover=function(){_this._onBubbleOver()}
div.get(0).onmouseout=function(){_this._onBubbleOut()}
this.update(dom);}
this._onBubbleOver=function(){this._mouseInBubble=true;}
this._onBubbleOut=function(){this._mouseInBubble=false;}
this.setLayout=function(layoutStrategy){this.layoutStrategy=layoutStrategy;layoutStrategy.setInfoWin(this);}
this.update=function(dom){this.dom_=dom;this.contentDiv.empty();this.contentDiv.append(dom);this.redraw(true);}
this.remove=function(){this.div_.remove();}
this.copy=function(){return new Infowin(this.latlng_,this.dom_);}
this.redraw=function(force){if(!force)return;var point=this.map_.fromLatLngToDivPixel(this.latlng_);this.layoutStrategy.layout(point);if(this.div_.css('display')!='block'){if(jQuery.browser.msie){this.div_.show();}else{this.div_.fadeIn('fast');}}}
this.hide=function(){if(jQuery.browser.msie){this.div_.hide();}else{this.div_.fadeOut('fast');}}
this.getMap=function(){return this.map_;}}
tbt.maps.InfoWinLayoutStrategy={setInfoWin:null,layout:null};tbt.maps.InfoWinSimpleLayout=function(options){this.offset=options.offset;this.infoWin=null;this.setInfoWin=function(infoWin){this.infoWin=infoWin;}
this.layout=function(point){var div=this.infoWin.div_;var o=this.offset;div.css({left:point.x+o.x-div.outerWidth()/2,top:point.y+o.y-div.outerHeight()});div.find('.map-info-beak').css({'left':'50%','margin-left':'-8px'});}};tbt.maps.InfoWinTopLeftImportantLayout=function(options){this.offset=options.offset;this.beakLen=options.beak;this.beakWidth=options.beak;this.infoWin=null;this.mapBounds;this.win;this.point;this.beakCss;this.beakSpacing=this.beakWidth;this.setInfoWin=function(infoWin){this.infoWin=infoWin;}
this.layout=function(point){this.point=point;var div=this.infoWin.div_;var map=this.infoWin.getMap();var bounds=map.getBounds();var mapBounds=this.mapBounds=new google.maps.Bounds([map.fromLatLngToDivPixel(bounds.getSouthWest()),map.fromLatLngToDivPixel(bounds.getNorthEast())]);delete(map);delete(bounds);this.win={minY:null,minX:null,maxX:null,maxY:null,width:div.outerWidth(),height:div.outerHeight()};do{if(this._fitNorth())break;if(this._fitEast())break;if(this._fitWest())break;if(this._fitSouth())break;var center=mapBounds.mid();if(point.y-center.y<0){this._fitSouth(true);break;}else{this._fitNorth(true);break;}}while(false);div.css({left:this.win.minX,top:this.win.minY});div.find('.map-info-beak').css(this.beakCss);};this.resetCss=function(){this.beakCss={left:'',top:'',bottom:'',right:'','background-position':''};};this._fitNorth=function(ignoreBounds){var o=this.offset.north;var point=this.point;var win=this.win;var mapBounds=this.mapBounds;win.minX=point.x+o.x-win.width/2;win.minY=point.y+o.y-win.height-this.beakLen;win.maxX=win.minX+win.width;win.maxY=win.minY+win.height;if(ignoreBounds||(mapBounds.minY<win.minY&&mapBounds.minX<point.x+o.x-this.beakSpacing&&mapBounds.maxX>point.x+o.x+this.beakSpacing)){var d=this._shiftHorizontal(mapBounds,win);this.resetCss();this.beakCss.left=win.width/2-d-this.beakWidth/2;this.beakCss.bottom=-this.beakLen;this.beakCss['background-image']='url(/img/widgets/beak_north.png)';return true;}
return false;};this._fitEast=function(ignoreBounds){var o=this.offset.east;var point=this.point;var win=this.win;var mapBounds=this.mapBounds;win.minX=point.x+o.x+this.beakLen;win.minY=point.y+o.y-win.height/2;win.maxX=win.minX+win.width;win.maxY=win.minY+win.height;if(ignoreBounds||(mapBounds.maxX>win.maxX&&mapBounds.minY<point.y+o.y-this.beakSpacing&&mapBounds.maxY>point.y+o.y+this.beakSpacing)){var d=this._shiftVertical(mapBounds,win);this.resetCss();this.beakCss.left=-this.beakLen;this.beakCss.top=win.height/2-d-this.beakWidth/2;this.beakCss['background-image']='url(/img/widgets/beak_east.png)';return true;}
return false;};this._fitWest=function(ignoreBounds){var o=this.offset.west;var point=this.point;var win=this.win;var mapBounds=this.mapBounds;win.minX=point.x+o.x-win.width-this.beakLen;win.minY=point.y+o.y-win.height/2;win.maxX=win.minX+win.width;win.maxY=win.minY+win.height;if(ignoreBounds||(mapBounds.minX<win.minX&&mapBounds.minY<point.y+o.y-this.beakSpacing&&mapBounds.maxY>point.y+o.y+this.beakSpacing)){var d=this._shiftVertical(mapBounds,win);this.resetCss();this.beakCss.right=-this.beakLen;this.beakCss.top=win.height/2-d-this.beakWidth/2;this.beakCss['background-image']='url(/img/widgets/beak_west.png)';this.beakCss['background-position']='-5px';return true;}
return false;};this._fitSouth=function(ignoreBounds){var o=this.offset.south;var point=this.point;var win=this.win;var mapBounds=this.mapBounds;win.minX=point.x+o.x-win.width/2;win.minY=point.y+o.y+this.beakLen;win.maxX=win.minX+win.width;win.maxY=win.minY+win.height;if(ignoreBounds||(mapBounds.maxY>win.maxY&&mapBounds.minX<point.x+o.x-this.beakSpacing&&mapBounds.maxX>point.x+o.x+this.beakSpacing)){var d=this._shiftHorizontal(mapBounds,win);this.resetCss();this.beakCss.left=win.width/2-d-this.beakWidth/2;this.beakCss.top=-this.beakLen;this.beakCss['background-image']='url(/img/widgets/beak_south.png)';return true;}
return false;};this._shiftHorizontal=function(mapBounds,win){var delta=0;if(mapBounds.maxX<win.maxX){delta=mapBounds.maxX-win.maxX-2;}
if(mapBounds.minX>win.minX){delta=mapBounds.minX-win.minX+2;}
var ord=delta>0?1:-1;delta=Math.min(Math.abs(delta),win.width/2-this.beakSpacing)*ord;win.minX+=delta;return delta;};this._shiftVertical=function(mapBounds,win){var delta=0;if(mapBounds.maxY<win.maxY){delta=mapBounds.maxY-win.maxY-2;}
if(mapBounds.minY>win.minY){delta=mapBounds.minY-win.minY+2;}
var ord=delta>0?1:-1;delta=Math.min(Math.abs(delta),win.height/2-this.beakSpacing)*ord;win.minY+=delta;return delta;};};


/**** AssetPackerHelper::process()  widget.js  ****/


if(!window.tbt){tbt=window.tbt={};}
if(!tbt.widget){tbt.widget={};}
tbt.widget.checkInterface=function(object,interf){if(console.warn||tbt.DEBUG){for(var method in interf){if(!object[method]){var e=new Error('Method not implemented! '+method);if(tbt.DEBUG){throw e;}else{console.warn(e);}}}}}
tbt.widget.HoverListener={onOver:null,onOut:null}
tbt.widget.MapHoverListener={onOver:null,onOut:null,onZoomBounds:null,onZoomIn:null,onClick:null}
tbt.widget.Map=function(htmlId,size){this.__ID=tbt.widget.Map.__ID__++;tbt.widget.Map.__instances__[this.__ID]=this;this.markers={};this.markerCount=0;this.container=typeof(htmlId)=='string'?document.getElementById(htmlId):htmlId;if(!this.container)throw new Error("parameter not valid! htmlId: "+htmlId);this.size=size;this.higlightedMarker=null;this.defaultImage=null;this.targetZoom=15;this.initalZoomBox=null;this._hoverListeners=[];this.imgPath=(tbt.mediaServer||'/')+'img/icon/';this.map=null;var _this=this;this.markerBehaviour={onOver:function(source,uid){_this.onOver(this,uid)},onOut:function(source,uid){},onZoomBounds:function(source,event,uid){},onZoomIn:function(source,uid){_this.zoomMarker(uid)},onClick:function(source,event,uid){_this.onZoomIn(this,uid)}};}
tbt.widget.Map.__instances__=[];tbt.widget.Map.__ID__=0;tbt.widget.Map.call=function(id,method,data){return tbt.widget.Map.__instances__[id][method](data);}
tbt.widget.Map.prototype={show:function(){if(this.isReady()){try{this.onReady();}catch(e){if(console.error)console.error(e);}
return;}
this._init();},_init:function(){var _this=this;if(!window.google){var script=document.createElement('script');script.setAttribute('type','text/javascript');script.setAttribute('src','http://www.google.com/jsapi?key='+tbt.googleMapsApiKey+'&callback=tbt.widget.Map.__instances__['+this.__ID+']._init');document.getElementsByTagName('head')[0].appendChild(script);return;}
if(!google.maps){google.load('maps','2',{callback:function(){_this._init()}});return;}
var options={};if(this.size){options.size=new google.maps.Size(this.size.width,this.size.height);}
this.map=new google.maps.Map2(this.container,options);this.map.addControl(new google.maps.SmallZoomControl());this.map.addMapType(G_PHYSICAL_MAP);this.map.addControl(new GMenuMapTypeControl());tbt.widget.ZoomAll=function(){this.button=null;}
tbt.widget.ZoomAll.prototype=new google.maps.Control();tbt.widget.ZoomAll.prototype.initialize=function(map){var button=this.button=document.createElement('div');button.setAttribute('title','Alle zeigen');button.setAttribute('class','map-zoom-bounds');button.className='map-zoom-bounds';map.getContainer().appendChild(button);return button;}
tbt.widget.ZoomAll.prototype.getButton=function(){return this.button;}
tbt.widget.ZoomAll.prototype.getDefaultPosition=function(){return new google.maps.ControlPosition(google.maps.ANCHOR_TOP_LEFT,new google.maps.Size(7,43));}
this.zoomAllControl=new tbt.widget.ZoomAll()
this.map.addControl(this.zoomAllControl);this.map.enableScrollWheelZoom();this.map.enableContinuousZoom();try{this.onReady();this.addHoverListener(this.markerBehaviour);}catch(e){if(console.error)console.error(e);}},isReady:function(){return this.map!=null;},getGMap:function(){return this.map;},checkResize:function(){if(this.map){console.debug('checkResize');this.map.checkResize();if(this.markerCount&&this.markerBbox){this._fitMarkers(this.markerBbox);}}},addHoverListener:function(listener){tbt.widget.checkInterface(listener,tbt.widget.MapHoverListener);this._hoverListeners.push(listener);},removeHoverListener:function(listener){for(var i=0;i<this._hoverListeners.length;i++){if(listener==this._hoverListeners[i]){this._hoverListeners.splice(i,1);return;}}},clearHoverListeners:function(){this._hoverListeners=[];},setMapType:function(type){if(!type)return;this.map.setMapType(type);},add:function(objects,markerFactory){if(!markerFactory)
markerFactory=new tbt.widget.DefaultMarkerFactory();this.higlightedMarker=null;var markerBbox=null;if(this.markerCount){markerBbox=this.markerBbox;}
var newMarkers=[];var _this=this;for(var i=0;i<objects.length;i++){var place=objects[i];var id=markerFactory.getId(place);if(!id)continue;var marker;var point;var options={icon:null};if(markerFactory.createMarker){marker=markerFactory.createMarker(place);options.icon=marker.getIcon();point=marker.getLatLng();}else{point=markerFactory.getPoint(place);options.icon=markerFactory.getIcon(place);options.title=markerFactory.getTooltip(place);marker=new google.maps.Marker(point,options);}
newMarkers.push(marker);if(markerBbox==null){markerBbox=this.markerBbox=new google.maps.LatLngBounds(point);}else{markerBbox.extend(point);}
marker._id=id;marker._widgetMap=this;marker._image=options.icon.image;marker._hoverImage=markerFactory.getHoverImage(place);google.maps.Event.addListener(marker,"mouseover",function(latlng){this._widgetMap.fireHover(this._id);});google.maps.Event.addListener(marker,"click",function(event){this._widgetMap.fireClick(event,this._id);});google.maps.Event.addListener(marker,"dblclick",function(event){this._widgetMap.fireDblClick(event,this._id);});}
if(markerBbox){var w=markerFactory.getDefaultIcon().iconSize.width;var h=markerFactory.getDefaultIcon().iconSize.height;this._fitMarkers(markerBbox,w,h);}else{this.map.setCenter(new google.maps.LatLng(0,0),0);this.initalZoomBox=this.map.getBounds();}
jQuery(this.zoomAllControl.getButton()).click(function(event){_this.zoomBounds(event);});for(var i=0;i<newMarkers.length;i++){try{var m=newMarkers[i];this.markerCount++;this.markers[m._id]=m;this.map.addOverlay(m);}catch(e){if(console.error)console.error(e);}}},_fitMarkers:function(markerBbox,w,h){if(w){this.currentMarkerW=w;}else{w=this.currentMarkerW;}
if(h){this.currentMarkerH=h;}else{h=this.currentMarkerH;}
this.initalZoomBox=new google.maps.LatLngBounds(markerBbox.getSouthWest(),markerBbox.getNorthEast());this.zoomBounds();if(true){var debug=false;if(debug){debug(['initalZoomBox',this.initalZoomBox]);this.map.addOverlay(new google.maps.Marker(this.initalZoomBox.getSouthWest()));this.map.addOverlay(new google.maps.Marker(this.initalZoomBox.getNorthEast()));}
var screenBounds=new google.maps.Bounds([this.map.fromLatLngToContainerPixel(this.initalZoomBox.getSouthWest()),this.map.fromLatLngToContainerPixel(this.initalZoomBox.getNorthEast())]);if(debug){console.debug(['screenBounds',screenBounds]);}
screenBounds.extend(new google.maps.Point(screenBounds.minX-w,screenBounds.minY-h));screenBounds.extend(new google.maps.Point(screenBounds.maxX+5.,screenBounds.maxY+5.));if(debug){console.debug(['screenBounds',screenBounds])}
this.initalZoomBox.extend(this.map.fromContainerPixelToLatLng(screenBounds.min()));this.initalZoomBox.extend(this.map.fromContainerPixelToLatLng(screenBounds.max()));if(debug){this.map.addOverlay(new google.maps.Marker(this.initalZoomBox.getSouthWest()));this.map.addOverlay(new google.maps.Marker(this.initalZoomBox.getNorthEast()));if(console.debug)console.debug(['initalZoomBox',this.initalZoomBox]);}
if(!this.map.getBounds().containsBounds(this.initalZoomBox)){this.zoomBounds();}else{this.initalZoomBox=new google.maps.LatLngBounds(markerBbox.getSouthWest(),markerBbox.getNorthEast());}}},clear:function(){if(!this.map)return;for(var uid in this.markers){google.maps.Event.clearInstanceListeners(this.markers[uid]);}
this.map.clearOverlays();this.markers={};this.markerCount=0;},remove:function(id){if(!this.map)return;var m=this.markers[id];if(!m){if(console.warn)console.warn('marker not defined! id: '+id);return;}
this.map.removeOverlay(m);delete(this.markers[id]);},highlightMarker:function(id){try{var m=this.markers[id];if(!m){if(console.warn)console.warn('marker not defined! id: '+id);return;}
if(m==this.higlightedMarker)return;if(this.higlightedMarker&&this.higlightedMarker._image){this.higlightedMarker.setImage(this.higlightedMarker._image);this.fireOut(this.higlightedMarkerId);}
if(m._hoverImage)
m.setImage(m._hoverImage);this.higlightedMarker=m;this.higlightedMarkerId=id;}catch(e){if(console.error)console.error(e);}},zoomMarker:function(i){try{var m=this.markers[i];if(!m){return;}
if(this.map.getZoom()==this.targetZoom){this.map.panTo(m.getLatLng());}else{this.map.setCenter(m.getLatLng(),this.targetZoom)}}catch(e){if(console.error)console.error(e);}},panMarker:function(i){try{var m=this.markers[i];if(!m){return;}
this.map.panTo(m.getLatLng());}catch(e){if(console.error)console.error(e);}},zoomBounds:function(event){this.map.setCenter(this.initalZoomBox.getCenter(),Math.min(this.map.getBoundsZoomLevel(this.initalZoomBox),this.targetZoom));this.fireZoomBounds(event);},zoomBox:function(bounds){if(bounds.getBounds)
bounds=bounds.getBounds();this.map.setCenter(bounds.getCenter(),Math.min(this.map.getBoundsZoomLevel(bounds),this.targetZoom));},fireHover:function(id){for(var i=0;i<this._hoverListeners.length;i++){this._hoverListeners[i].onOver(this,id);}},fireOut:function(id){for(var i=0;i<this._hoverListeners.length;i++){this._hoverListeners[i].onOut(this,id);}},fireClick:function(event,id){for(var i=0;i<this._hoverListeners.length;i++){this._hoverListeners[i].onClick(this,event,id);}},fireDblClick:function(event,id){for(var i=0;i<this._hoverListeners.length;i++){if(this._hoverListeners[i].onDblClick)
this._hoverListeners[i].onDblClick(this,event,id);}},fireZoomBounds:function(event,id){for(var i=0;i<this._hoverListeners.length;i++){this._hoverListeners[i].onZoomBounds(this,event,id);}},onOver:function(source,id){this.highlightMarker(id);},onZoomIn:function(source,id){for(var i=0;i<this._hoverListeners.length;i++){this._hoverListeners[i].onZoomIn(source,id);}},onOut:function(source,id){},onReady:null};tbt.widget.DefaultMarkerFactory=function(){this.imgPath=(tbt.mediaServer||'/')+'img/';this.defaultIcon=new google.maps.Icon();this.defaultIcon.image=this.imgPath+'icon/kof_small_rot.png';this.hoverImage=this.imgPath+'icon/kof_small_orange.png'
this.defaultIcon.shadow=this.imgPath+'icon/kof_small_schatten.png';this.defaultIcon.iconSize=new google.maps.Size(17,20);this.defaultIcon.shadowSize=new google.maps.Size(33,20);this.defaultIcon.iconAnchor=new google.maps.Point(17,20);}
tbt.widget.DefaultMarkerFactory.prototype={getDefaultIcon:function(){return this.defaultIcon;},getTooltip:function(object){return object.name||'Heran zoomen';},getIcon:function(object){return this.defaultIcon;},getHoverImage:function(object){return this.hoverImage;},getPoint:function(object){return new google.maps.LatLng(object.lat,object.lng);},getId:function(object){return typeof(object.uid)=='string'?object.uid:object.uid.toString();}}
tbt.widget.InfoWinMarkerFactory=function(map){var parent=new tbt.widget.DefaultMarkerFactory();for(var method in parent){if(this[method])continue;tbt.widget.InfoWinMarkerFactory.prototype[method]=parent[method];}
this.map=map;this.infoWin=null;this._offsetX=-8;this._offsetY=-31;}
tbt.widget.InfoWinMarkerFactory.prototype={hideInfoWin:function(){if(!this.infoWin)return;this.infoWin.hide();},createMarker:function(object){var _this=this;var m=new google.maps.Marker(this.getPoint(object),{icon:this.getIcon(object),title:this.getTooltip(object)});m._tbtObject=object;google.maps.Event.addListener(m,"mouseover",function(point){_this.showInfoWin(this,point);});return m;},showInfoWin:function(marker,latlng){var content=this.createInfoWinContent(marker._tbtObject);if(!this.infoWin){this.infoWin=new tbt.maps.Infowin(latlng,content);this.infoWin.setLayout(new tbt.maps.InfoWinTopLeftImportantLayout({offset:{north:{x:-9,y:-19},east:{x:0,y:-10},south:{x:-2,y:-1},west:{x:-17,y:-11}},beak:16}));this.map.addOverlay(this.infoWin);}else{this.infoWin.latlng_=latlng;this.infoWin.update(content);}},setOffset:function(x,y){this._offsetX=x;this._offsetY=y;if(this.infoWin){this.infoWin.offsetX=x;this.infoWin.offsetY=y;}}}
tbt.widget.InfoWinMarkerFactory.prototype.createInfoWinContent=function(tbtObject){if(!tbtObject.uid&&tbtObject.Place)tbtObject=tbtObject.Place;var content=document.createElement('div');if(tbtObject.name){var titel=document.createElement('h4');titel.setAttribute('class',titel.className='titel');titel.appendChild(document.createTextNode(tbtObject.name));content.appendChild(titel);}
if(tbtObject.text){content.appendChild(document.createTextNode(tbtObject.text));}
return content;};tbt.widget.List=function(htmlId){this.container=htmlId.firstChild?htmlId:document.getElementById(htmlId);this.highlightColor='#eaf1f9';this.places=[];this.placesIndex={};this._rows=[];this._hoverListeners=[];};tbt.widget.List.prototype={setPlaces:function(places){this.places=places;var index=this.placesIndex={};if(!places){return}
for(var i=0;i<places.length;i++){index[places[i].uid+'']=i;}},setHighlightColor:function(cssColor){this.highlightColor=cssColor;},init:function(){this._rows=[];var _this=this;this.currentTip=-1;jQuery(this.container).find('a').each(function(i){var row=this;var iTip=i-0;_this._rows.push(row);jRow=jQuery(row);jRow.mouseover(function(){var tip=_this.places[iTip];if(tip==_this.currentTip)
return;_this.currentTip=tip;_this.fireHover(iTip);});jRow.find('span.lupe').click(function(event){if(event.target==_this.currentZoomIcon){_this.fireZoomBounds();}else{_this.fireZoomIn(iTip);}
event.stopPropagation();return false;}).css('visibility','');if(jQuery.browser.msie6){jRow.mouseover(function(){$(this).css('background-color',_this.highlightColor)});jRow.mouseout(function(){$(this).css('background-color','')});}
if(_this.onInit)_this.onInit(jRow,iTip);});},onInit:null,addHoverListener:function(listener){tbt.widget.checkInterface(listener,tbt.widget.HoverListener);this._hoverListeners.push(listener);},fireHover:function(i){if(!this.places[i])return;var uid=this.places[i].uid;for(var i=0;i<this._hoverListeners.length;i++){this._hoverListeners[i].onOver(this,uid);}},fireZoomIn:function(i){var uid=this.places[i].uid;for(var i=0;i<this._hoverListeners.length;i++){this._hoverListeners[i].onZoomIn(this,uid);}},fireZoomBounds:function(){for(var i=0;i<this._hoverListeners.length;i++){this._hoverListeners[i].zoomBounds(this);}},onOver:function(source,uid){if(source==this)
return;var row=this.getRowByUid(uid);jQuery(row).css('background-color',this.highlightColor);jQuery(this.container).scrollTo(row,100);},onOut:function(source,uid){jQuery(this.getRowByUid(uid)).css('background-color','');},onClick:function(source,event,uid){if(source==this)
return;var row=this.getRowByUid(uid);if(console.debug)console.debug(['List.onClick() row: ',row]);jQuery(row).trigger('click',event);},onZoomBounds:function(source,event){if(this.currentZoomIcon){jQuery(this.currentZoomIcon).removeClass('current').attr('title','heran zoomen');this.currentZoomIcon=null;}},onZoomIn:function(source,uid){if(this.currentZoomIcon){jQuery(this.currentZoomIcon).removeClass('current').attr('title','heran zoomen')}
var row=this.getRowByUid(uid);var lupe=jQuery(row).find('span.lupe');this.currentZoomIcon=lupe[0];lupe.addClass('current');lupe.attr('title','Alle zeigen');jQuery(row).css('background-color',this.highlightColor);},getRowByIndex:function(i){var row=this._rows[i];if(!row){throw new Error('List.getRowByIndex() row not found! i: '+i);}
return row;},getRowByUid:function(uid){if(typeof(uid)!='string')
uid=uid.toString();var i=this.placesIndex[uid];if(i==undefined){throw new Error('List.getRowByUid() row not found! uid: '+uid);}
return this.getRowByIndex(i);},getPlaceByUid:function(uid){if(typeof(uid)!='string')
uid=uid.toString();var i=this.placesIndex[uid];if(i==undefined){throw new Error('List.getRowByUid() row not found! uid: '+uid);}
return this.places[i];}};


/**** AssetPackerHelper::process()  jquery.scrollTo.js  ****/

;(function($){var $scrollTo=$.scrollTo=function(target,duration,settings){$(window).scrollTo(target,duration,settings);};$scrollTo.defaults={axis:'xy',duration:parseFloat($.fn.jquery)>=1.3?0:1};$scrollTo.window=function(scope){return $(window).scrollable();};$.fn.scrollable=function(){return this.map(function(){var elem=this,isWin=!elem.nodeName||$.inArray(elem.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!isWin)
return elem;var doc=(elem.contentWindow||elem).document||elem.ownerDocument||elem;return $.browser.safari||doc.compatMode=='BackCompat'?doc.body:doc.documentElement;});};$.fn.scrollTo=function(target,duration,settings){if(typeof duration=='object'){settings=duration;duration=0;}
if(typeof settings=='function')
settings={onAfter:settings};if(target=='max')
target=9e9;settings=$.extend({},$scrollTo.defaults,settings);duration=duration||settings.speed||settings.duration;settings.queue=settings.queue&&settings.axis.length>1;if(settings.queue)
duration/=2;settings.offset=both(settings.offset);settings.over=both(settings.over);return this.scrollable().each(function(){var elem=this,$elem=$(elem),targ=target,toff,attr={},win=$elem.is('html,body');switch(typeof targ){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px)?$/.test(targ)){targ=both(targ);break;}
targ=$(targ,this);case'object':if(targ.is||targ.style)
toff=(targ=$(targ)).offset();}
$.each(settings.axis.split(''),function(i,axis){var Pos=axis=='x'?'Left':'Top',pos=Pos.toLowerCase(),key='scroll'+Pos,old=elem[key],Dim=axis=='x'?'Width':'Height';if(toff){attr[key]=toff[pos]+(win?0:old-$elem.offset()[pos]);if(settings.margin){attr[key]-=parseInt(targ.css('margin'+Pos))||0;attr[key]-=parseInt(targ.css('border'+Pos+'Width'))||0;}
attr[key]+=settings.offset[pos]||0;if(settings.over[pos])
attr[key]+=targ[Dim.toLowerCase()]()*settings.over[pos];}else
attr[key]=targ[pos];if(/^\d+$/.test(attr[key]))
attr[key]=attr[key]<=0?0:Math.min(attr[key],max(Dim));if(!i&&settings.queue){if(old!=attr[key])
animate(settings.onAfterFirst);delete attr[key];}});animate(settings.onAfter);function animate(callback){$elem.animate(attr,duration,settings.easing,callback&&function(){callback.call(this,target,settings);});};function max(Dim){var scroll='scroll'+Dim;if(!win)
return elem[scroll];var size='client'+Dim,html=elem.ownerDocument.documentElement,body=elem.ownerDocument.body;return Math.max(html[scroll],body[scroll])
-Math.min(html[size],body[size]);};}).end();};function both(val){return typeof val=='object'?val:{top:val,left:val};};})(jQuery);


/**** AssetPackerHelper::process()  boxes.js  ****/


if(!window.tbt)window.tbt=tbt={};if(!tbt.widget.Map&&window.console&&console.error)console.error('tbt.widget.Map needed by tbt.detail');if(!window.tbt.boxes)tbt.boxes={};tbt.boxes.DetailMap={init:function(config){var places=config.places;var currentPlace=config.currentPlace;var hoverList=(config.hoverList?config.hoverList:true);var showRegion=(config.showRegion?config.showRegion:false);var showShape=(config.shape?config.shape:false);var map=new tbt.widget.Map('neighbours-map');map.targetZoom=(showRegion?1:17);map.onReady=function(){try{var markerFactory=new tbt.widget.InfoWinMarkerFactory(this.getGMap());if(!showRegion){markerFactory.setOffset(-12,-(24+16));markerFactory.defaultIcon.image=markerFactory.imgPath+'map/26x27_orange.png';markerFactory.hoverImage=null;markerFactory.defaultIcon.shadow=markerFactory.imgPath+'map/26x27_shadow.png';markerFactory.defaultIcon.iconSize=new google.maps.Size(26,27);markerFactory.defaultIcon.shadowSize=new google.maps.Size(42,27);markerFactory.defaultIcon.iconAnchor=new google.maps.Point(25,26);markerFactory.getIcon=function(place){if(place.label){return new google.maps.Icon(this.defaultIcon,this.imgPath+'map/26x27_orange_'+place.label+'.png');}
return this.defaultIcon;}}
markerFactory.createInfoWinContent=function(place){var uid=place.uid;var content=document.createElement('div');if(place.uid!=currentPlace.uid){var titel=document.createElement('a');titel.setAttribute('class',titel.className='titel');titel.appendChild(document.createTextNode(place.name));titel.setAttribute('title','Details ansehen');titel.setAttribute('href',place.url);content.appendChild(titel);}
else{var titel=document.createElement('b');titel.setAttribute('class',titel.className='titel');titel.appendChild(document.createTextNode(place.name));content.appendChild(titel);}
if(place.text){content.appendChild(document.createTextNode(place.text));if(place.uid!=currentPlace.uid){var link=document.createElement('a');link.setAttribute('class',link.className='more');link.appendChild(document.createTextNode('mehr'));link.setAttribute('href',place.url);content.appendChild(link);}}
return content;};markerFactory.getTooltip=function(place){return'Details ansehen'};this.add(places,markerFactory);if(currentPlace){markerFactory.defaultIcon.image=markerFactory.imgPath+'map/26x27_red.png';this.add([currentPlace],markerFactory);places.push(currentPlace);}
if(showShape){var sStrokeColor='#00b8e6';var sFillColor='#beeefa';var iStrokeWeight=3;var fStrokeOpacity=0.7;var fFillOpacity='0.3';setPolygon();polygon=new GPolygon(showShape,sStrokeColor,iStrokeWeight,fStrokeOpacity,sFillColor,fFillOpacity);this.map.addOverlay(polygon);this.map.setMapType(G_PHYSICAL_MAP);this.map.addControl(new GMenuMapTypeControl());this.map.setCenter(new google.maps.LatLng(51.546820076626,7.138181640625),9);}}
catch(e){if(console.error)
console.error(e);}}
map.targetZoom=(showRegion?9:16);;if(showShape){map.center="{[1,0]}";}
map.show();var list=new tbt.widget.List('neighbours-list');list.setPlaces(places);if(hoverList=='true'){list.setPlaces(places);list.init();list.addHoverListener(map);}
map.markerBehaviour.onClick=function(source,event,uid){window.location.href=list.getPlaceByUid(uid).url;};map.addHoverListener({onOver:function(source,uid){if(uid==currentPlace.uid||hoverList!='true')return;list.onOver(source,uid);},onOut:function(source,uid){if(uid==currentPlace.uid||hoverList!='true')return;list.onOut(source,uid);},onZoomBounds:function(source,event,uid){list.onZoomBounds(source,event,uid)},onZoomIn:function(source,uid){if(uid==currentPlace.uid)return;list.onZoomIn(source,uid)},onClick:function(source,event,uid){if(uid==currentPlace.uid)return;}});}};


/**** AssetPackerHelper::process()  jquery.autogrow.js  ****/


(function(jQuery){var self=null;jQuery.fn.autogrow=function(o)
{return this.each(function(){new jQuery.autogrow(this,o);});};jQuery.autogrow=function(e,o)
{this.options=o||{};this.dummy=null;this.interval=null;this.line_height=this.options.lineHeight||parseInt(jQuery(e).css('line-height'));this.min_height=this.options.minHeight||parseInt(jQuery(e).css('min-height'));this.max_height=this.options.maxHeight||parseInt(jQuery(e).css('max-height'));;this.textarea=jQuery(e);if(this.line_height==NaN)
this.line_height=0;this.init();};jQuery.autogrow.fn=jQuery.autogrow.prototype={autogrow:'1.2.2'};jQuery.autogrow.fn.extend=jQuery.autogrow.extend=jQuery.extend;jQuery.autogrow.fn.extend({init:function(){var self=this;this.textarea.css({overflow:'hidden',display:'block'});this.textarea.bind('focus',function(){self.startExpand()}).bind('blur',function(){self.stopExpand()});this.checkExpand();},startExpand:function(){var self=this;this.interval=window.setInterval(function(){self.checkExpand()},400);},stopExpand:function(){clearInterval(this.interval);},checkExpand:function(){if(this.dummy==null)
{this.dummy=jQuery('<div></div>');this.dummy.css({'font-size':this.textarea.css('font-size'),'font-family':this.textarea.css('font-family'),'width':this.textarea.css('width'),'padding':this.textarea.css('padding'),'line-height':this.line_height+'px','overflow-x':'hidden','position':'absolute','top':0,'left':-9999}).appendTo('body');}
var html=this.textarea.val().replace(/(<|>)/g,'');if($.browser.msie)
{html=html.replace(/\n/g,'<BR>new');}
else
{html=html.replace(/\n/g,'<br>new');}
if(this.dummy.html()!=html)
{this.dummy.html(html);if(this.max_height>0&&(this.dummy.height()+this.line_height>this.max_height))
{this.textarea.css('overflow-y','auto');}
else
{this.textarea.css('overflow-y','hidden');if(this.textarea.height()<this.dummy.height()+this.line_height||(this.dummy.height()<this.textarea.height()))
{if(this.dummy.height()>this.min_height){this.textarea.animate({height:(this.dummy.height()+this.line_height)+'px'},100);}}}}}});})(jQuery);

/* EOF */
