/*
 * jQuery Tools 1.2.2 - The missing UI library for the Web
 * 
 * [tabs, scrollable, overlay, toolbox.expose]
 * 
 * NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE.
 * 
 * http://flowplayer.org/tools/
 * 
 * File generated: Thu Jun 03 21:18:38 GMT 2010
 */
(function(c){function p(d,a,b){var e=this,l=d.add(this),h=d.find(b.tabs),j=a.jquery?a:d.children(a),i;h.length||(h=d.children());j.length||(j=d.parent().find(a));j.length||(j=c(a));c.extend(this,{click:function(f,g){var k=h.eq(f);if(typeof f=="string"&&f.replace("#","")){k=h.filter("[href*="+f.replace("#","")+"]");f=Math.max(h.index(k),0)}if(b.rotate){var n=h.length-1;if(f<0)return e.click(n,g);if(f>n)return e.click(0,g)}if(!k.length){if(i>=0)return e;f=b.initialIndex;k=h.eq(f)}if(f===i)return e;
g=g||c.Event();g.type="onBeforeClick";l.trigger(g,[f]);if(!g.isDefaultPrevented()){o[b.effect].call(e,f,function(){g.type="onClick";l.trigger(g,[f])});i=f;h.removeClass(b.current);k.addClass(b.current);return e}},getConf:function(){return b},getTabs:function(){return h},getPanes:function(){return j},getCurrentPane:function(){return j.eq(i)},getCurrentTab:function(){return h.eq(i)},getIndex:function(){return i},next:function(){return e.click(i+1)},prev:function(){return e.click(i-1)}});c.each("onBeforeClick,onClick".split(","),
function(f,g){c.isFunction(b[g])&&c(e).bind(g,b[g]);e[g]=function(k){c(e).bind(g,k);return e}});if(b.history&&c.fn.history){c.tools.history.init(h);b.event="history"}h.each(function(f){c(this).bind(b.event,function(g){e.click(f,g);return g.preventDefault()})});j.find("a[href^=#]").click(function(f){e.click(c(this).attr("href"),f)});if(location.hash)e.click(location.hash);else if(b.initialIndex===0||b.initialIndex>0)e.click(b.initialIndex)}c.tools=c.tools||{version:"1.2.2"};c.tools.tabs={conf:{tabs:"a",
current:"current",onBeforeClick:null,onClick:null,effect:"default",initialIndex:0,event:"click",rotate:false,history:false},addEffect:function(d,a){o[d]=a}};var o={"default":function(d,a){this.getPanes().hide().eq(d).show();a.call()},fade:function(d,a){var b=this.getConf(),e=b.fadeOutSpeed,l=this.getPanes();e?l.fadeOut(e):l.hide();l.eq(d).fadeIn(b.fadeInSpeed,a)},slide:function(d,a){this.getPanes().slideUp(200);this.getPanes().eq(d).slideDown(400,a)},ajax:function(d,a){this.getPanes().eq(0).load(this.getTabs().eq(d).attr("href"),
a)}},m;c.tools.tabs.addEffect("horizontal",function(d,a){m||(m=this.getPanes().eq(0).width());this.getCurrentPane().animate({width:0},function(){c(this).hide()});this.getPanes().eq(d).animate({width:m},function(){c(this).show();a.call()})});c.fn.tabs=function(d,a){var b=this.data("tabs");if(b)return b;if(c.isFunction(a))a={onBeforeClick:a};a=c.extend({},c.tools.tabs.conf,a);this.each(function(){b=new p(c(this),d,a);c(this).data("tabs",b)});return a.api?b:this}})(jQuery);
(function(e){function n(f,c){var a=e(c);return a.length<2?a:f.parent().find(c)}function t(f,c){var a=this,l=f.add(a),g=f.children(),k=0,m=c.vertical;j||(j=a);if(g.length>1)g=e(c.items,f);e.extend(a,{getConf:function(){return c},getIndex:function(){return k},getSize:function(){return a.getItems().size()},getNaviButtons:function(){return o.add(p)},getRoot:function(){return f},getItemWrap:function(){return g},getItems:function(){return g.children(c.item).not("."+c.clonedClass)},move:function(b,d){return a.seekTo(k+
b,d)},next:function(b){return a.move(1,b)},prev:function(b){return a.move(-1,b)},begin:function(b){return a.seekTo(0,b)},end:function(b){return a.seekTo(a.getSize()-1,b)},focus:function(){return j=a},addItem:function(b){b=e(b);if(c.circular){e(".cloned:last").before(b);e(".cloned:first").replaceWith(b.clone().addClass(c.clonedClass))}else g.append(b);l.trigger("onAddItem",[b]);return a},seekTo:function(b,d,h){if(c.circular&&b===0&&k==-1&&d!==0)return a;if(!c.circular&&b<0||b>a.getSize()||b<-1)return a;
var i=b;if(b.jquery)b=a.getItems().index(b);else i=a.getItems().eq(b);var q=e.Event("onBeforeSeek");if(!h){l.trigger(q,[b,d]);if(q.isDefaultPrevented()||!i.length)return a}i=m?{top:-i.position().top}:{left:-i.position().left};k=b;j=a;if(d===undefined)d=c.speed;g.animate(i,d,c.easing,h||function(){l.trigger("onSeek",[b])});return a}});e.each(["onBeforeSeek","onSeek","onAddItem"],function(b,d){e.isFunction(c[d])&&e(a).bind(d,c[d]);a[d]=function(h){e(a).bind(d,h);return a}});if(c.circular){var r=a.getItems().slice(-1).clone().prependTo(g),
s=a.getItems().eq(1).clone().appendTo(g);r.add(s).addClass(c.clonedClass);a.onBeforeSeek(function(b,d,h){if(!b.isDefaultPrevented())if(d==-1){a.seekTo(r,h,function(){a.end(0)});return b.preventDefault()}else d==a.getSize()&&a.seekTo(s,h,function(){a.begin(0)})});a.seekTo(0,0)}var o=n(f,c.prev).click(function(){a.prev()}),p=n(f,c.next).click(function(){a.next()});!c.circular&&a.getSize()>1&&a.onBeforeSeek(function(b,d){o.toggleClass(c.disabledClass,d<=0);p.toggleClass(c.disabledClass,d>=a.getSize()-
1)});c.mousewheel&&e.fn.mousewheel&&f.mousewheel(function(b,d){if(c.mousewheel){a.move(d<0?1:-1,c.wheelSpeed||50);return false}});c.keyboard&&e(document).bind("keydown.scrollable",function(b){if(!(!c.keyboard||b.altKey||b.ctrlKey||e(b.target).is(":input")))if(!(c.keyboard!="static"&&j!=a)){var d=b.keyCode;if(m&&(d==38||d==40)){a.move(d==38?-1:1);return b.preventDefault()}if(!m&&(d==37||d==39)){a.move(d==37?-1:1);return b.preventDefault()}}});e(a).trigger("onBeforeSeek",[c.initialIndex])}e.tools=e.tools||
{version:"1.2.2"};e.tools.scrollable={conf:{activeClass:"active",circular:false,clonedClass:"cloned",disabledClass:"disabled",easing:"swing",initialIndex:0,item:null,items:".items",keyboard:true,mousewheel:false,next:".next",prev:".prev",speed:400,vertical:false,wheelSpeed:0}};var j;e.fn.scrollable=function(f){var c=this.data("scrollable");if(c)return c;f=e.extend({},e.tools.scrollable.conf,f);this.each(function(){c=new t(e(this),f);e(this).data("scrollable",c)});return f.api?c:this}})(jQuery);
(function(a){function t(d,b){var c=this,i=d.add(c),o=a(window),k,f,m,g=a.tools.expose&&(b.mask||b.expose),n=Math.random().toString().slice(10);if(g){if(typeof g=="string")g={color:g};g.closeOnClick=g.closeOnEsc=false}var p=b.target||d.attr("rel");f=p?a(p):d;if(!f.length)throw"Could not find Overlay: "+p;d&&d.index(f)==-1&&d.click(function(e){c.load(e);return e.preventDefault()});a.extend(c,{load:function(e){if(c.isOpened())return c;var h=q[b.effect];if(!h)throw'Overlay: cannot find effect : "'+b.effect+
'"';b.oneInstance&&a.each(s,function(){this.close(e)});e=e||a.Event();e.type="onBeforeLoad";i.trigger(e);if(e.isDefaultPrevented())return c;m=true;g&&a(f).expose(g);var j=b.top,r=b.left,u=f.outerWidth({margin:true}),v=f.outerHeight({margin:true});if(typeof j=="string")j=j=="center"?Math.max((o.height()-v)/2,0):parseInt(j,10)/100*o.height();if(r=="center")r=Math.max((o.width()-u)/2,0);h[0].call(c,{top:j,left:r},function(){if(m){e.type="onLoad";i.trigger(e)}});g&&b.closeOnClick&&a.mask.getMask().one("click",
c.close);b.closeOnClick&&a(document).bind("click."+n,function(l){a(l.target).parents(f).length||c.close(l)});b.closeOnEsc&&a(document).bind("keydown."+n,function(l){l.keyCode==27&&c.close(l)});return c},close:function(e){if(!c.isOpened())return c;e=e||a.Event();e.type="onBeforeClose";i.trigger(e);if(!e.isDefaultPrevented()){m=false;q[b.effect][1].call(c,function(){e.type="onClose";i.trigger(e)});a(document).unbind("click."+n).unbind("keydown."+n);g&&a.mask.close();return c}},getOverlay:function(){return f},
getTrigger:function(){return d},getClosers:function(){return k},isOpened:function(){return m},getConf:function(){return b}});a.each("onBeforeLoad,onStart,onLoad,onBeforeClose,onClose".split(","),function(e,h){a.isFunction(b[h])&&a(c).bind(h,b[h]);c[h]=function(j){a(c).bind(h,j);return c}});k=f.find(b.close||".close");if(!k.length&&!b.close){k=a('<div class="close"></div>');f.prepend(k)}k.click(function(e){c.close(e)});b.load&&c.load()}a.tools=a.tools||{version:"1.2.2"};a.tools.overlay={addEffect:function(d,
b,c){q[d]=[b,c]},conf:{close:null,closeOnClick:true,closeOnEsc:true,closeSpeed:"fast",effect:"default",fixed:!a.browser.msie||a.browser.version>6,left:"center",load:false,mask:null,oneInstance:true,speed:"normal",target:null,top:"10%"}};var s=[],q={};a.tools.overlay.addEffect("default",function(d,b){var c=this.getConf(),i=a(window);if(!c.fixed){d.top+=i.scrollTop();d.left+=i.scrollLeft()}d.position=c.fixed?"fixed":"absolute";this.getOverlay().css(d).fadeIn(c.speed,b)},function(d){this.getOverlay().fadeOut(this.getConf().closeSpeed,
d)});a.fn.overlay=function(d){var b=this.data("overlay");if(b)return b;if(a.isFunction(d))d={onBeforeLoad:d};d=a.extend(true,{},a.tools.overlay.conf,d);this.each(function(){b=new t(a(this),d);s.push(b);a(this).data("overlay",b)});return d.api?b:this}})(jQuery);
(function(b){function k(){if(b.browser.msie){var a=b(document).height(),d=b(window).height();return[window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,a-d<20?d:a]}return[b(window).width(),b(document).height()]}function h(a){if(a)return a.call(b.mask)}b.tools=b.tools||{version:"1.2.2"};var l;l=b.tools.expose={conf:{maskId:"exposeMask",loadSpeed:"slow",closeSpeed:"fast",closeOnClick:true,closeOnEsc:true,zIndex:9998,opacity:0.8,startOpacity:0,color:"#fff",onLoad:null,
onClose:null}};var c,i,f,g,j;b.mask={load:function(a,d){if(f)return this;if(typeof a=="string")a={color:a};a=a||g;g=a=b.extend(b.extend({},l.conf),a);c=b("#"+a.maskId);if(!c.length){c=b("<div/>").attr("id",a.maskId);b("body").append(c)}var m=k();c.css({position:"absolute",top:0,left:0,width:m[0],height:m[1],display:"none",opacity:a.startOpacity,zIndex:a.zIndex});a.color&&c.css("backgroundColor",a.color);if(h(a.onBeforeLoad)===false)return this;a.closeOnEsc&&b(document).bind("keydown.mask",function(e){e.keyCode==
27&&b.mask.close(e)});a.closeOnClick&&c.bind("click.mask",function(e){b.mask.close(e)});b(window).bind("resize.mask",function(){b.mask.fit()});if(d&&d.length){j=d.eq(0).css("zIndex");b.each(d,function(){var e=b(this);/relative|absolute|fixed/i.test(e.css("position"))||e.css("position","relative")});i=d.css({zIndex:Math.max(a.zIndex+1,j=="auto"?0:j)})}c.css({display:"block"}).fadeTo(a.loadSpeed,a.opacity,function(){b.mask.fit();h(a.onLoad)});f=true;return this},close:function(){if(f){if(h(g.onBeforeClose)===
false)return this;c.fadeOut(g.closeSpeed,function(){h(g.onClose);i&&i.css({zIndex:j})});b(document).unbind("keydown.mask");c.unbind("click.mask");b(window).unbind("resize.mask");f=false}return this},fit:function(){if(f){var a=k();c.css({width:a[0],height:a[1]})}},getMask:function(){return c},isLoaded:function(){return f},getConf:function(){return g},getExposed:function(){return i}};b.fn.mask=function(a){b.mask.load(a);return this};b.fn.expose=function(a){b.mask.load(a,this);return this}})(jQuery);


/* 
 * flowplayer.js 3.2.2. The Flowplayer API
 * 
 * Copyright 2010 Flowplayer Oy
 * 
 * This file is part of Flowplayer.
 * 
 * Flowplayer is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * Flowplayer is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with Flowplayer.  If not, see <http://www.gnu.org/licenses/>.
 * 
 * Date: 2010-05-20 17:15:38 +0000 (Thu, 20 May 2010)
 * Revision: 480 
 */
(function(){function g(o){console.log("$f.fireEvent",[].slice.call(o))}function k(q){if(!q||typeof q!="object"){return q}var o=new q.constructor();for(var p in q){if(q.hasOwnProperty(p)){o[p]=k(q[p])}}return o}function m(t,q){if(!t){return}var o,p=0,r=t.length;if(r===undefined){for(o in t){if(q.call(t[o],o,t[o])===false){break}}}else{for(var s=t[0];p<r&&q.call(s,p,s)!==false;s=t[++p]){}}return t}function c(o){return document.getElementById(o)}function i(q,p,o){if(typeof p!="object"){return q}if(q&&p){m(p,function(r,s){if(!o||typeof s!="function"){q[r]=s}})}return q}function n(s){var q=s.indexOf(".");if(q!=-1){var p=s.slice(0,q)||"*";var o=s.slice(q+1,s.length);var r=[];m(document.getElementsByTagName(p),function(){if(this.className&&this.className.indexOf(o)!=-1){r.push(this)}});return r}}function f(o){o=o||window.event;if(o.preventDefault){o.stopPropagation();o.preventDefault()}else{o.returnValue=false;o.cancelBubble=true}return false}function j(q,o,p){q[o]=q[o]||[];q[o].push(p)}function e(){return"_"+(""+Math.random()).slice(2,10)}var h=function(t,r,s){var q=this,p={},u={};q.index=r;if(typeof t=="string"){t={url:t}}i(this,t,true);m(("Begin*,Start,Pause*,Resume*,Seek*,Stop*,Finish*,LastSecond,Update,BufferFull,BufferEmpty,BufferStop").split(","),function(){var v="on"+this;if(v.indexOf("*")!=-1){v=v.slice(0,v.length-1);var w="onBefore"+v.slice(2);q[w]=function(x){j(u,w,x);return q}}q[v]=function(x){j(u,v,x);return q};if(r==-1){if(q[w]){s[w]=q[w]}if(q[v]){s[v]=q[v]}}});i(this,{onCuepoint:function(x,w){if(arguments.length==1){p.embedded=[null,x];return q}if(typeof x=="number"){x=[x]}var v=e();p[v]=[x,w];if(s.isLoaded()){s._api().fp_addCuepoints(x,r,v)}return q},update:function(w){i(q,w);if(s.isLoaded()){s._api().fp_updateClip(w,r)}var v=s.getConfig();var x=(r==-1)?v.clip:v.playlist[r];i(x,w,true)},_fireEvent:function(v,y,w,A){if(v=="onLoad"){m(p,function(B,C){if(C[0]){s._api().fp_addCuepoints(C[0],r,B)}});return false}A=A||q;if(v=="onCuepoint"){var z=p[y];if(z){return z[1].call(s,A,w)}}if(y&&"onBeforeBegin,onMetaData,onStart,onUpdate,onResume".indexOf(v)!=-1){i(A,y);if(y.metaData){if(!A.duration){A.duration=y.metaData.duration}else{A.fullDuration=y.metaData.duration}}}var x=true;m(u[v],function(){x=this.call(s,A,y,w)});return x}});if(t.onCuepoint){var o=t.onCuepoint;q.onCuepoint.apply(q,typeof o=="function"?[o]:o);delete t.onCuepoint}m(t,function(v,w){if(typeof w=="function"){j(u,v,w);delete t[v]}});if(r==-1){s.onCuepoint=this.onCuepoint}};var l=function(p,r,q,t){var o=this,s={},u=false;if(t){i(s,t)}m(r,function(v,w){if(typeof w=="function"){s[v]=w;delete r[v]}});i(this,{animate:function(y,z,x){if(!y){return o}if(typeof z=="function"){x=z;z=500}if(typeof y=="string"){var w=y;y={};y[w]=z;z=500}if(x){var v=e();s[v]=x}if(z===undefined){z=500}r=q._api().fp_animate(p,y,z,v);return o},css:function(w,x){if(x!==undefined){var v={};v[w]=x;w=v}r=q._api().fp_css(p,w);i(o,r);return o},show:function(){this.display="block";q._api().fp_showPlugin(p);return o},hide:function(){this.display="none";q._api().fp_hidePlugin(p);return o},toggle:function(){this.display=q._api().fp_togglePlugin(p);return o},fadeTo:function(y,x,w){if(typeof x=="function"){w=x;x=500}if(w){var v=e();s[v]=w}this.display=q._api().fp_fadeTo(p,y,x,v);this.opacity=y;return o},fadeIn:function(w,v){return o.fadeTo(1,w,v)},fadeOut:function(w,v){return o.fadeTo(0,w,v)},getName:function(){return p},getPlayer:function(){return q},_fireEvent:function(w,v,x){if(w=="onUpdate"){var z=q._api().fp_getPlugin(p);if(!z){return}i(o,z);delete o.methods;if(!u){m(z.methods,function(){var B=""+this;o[B]=function(){var C=[].slice.call(arguments);var D=q._api().fp_invoke(p,B,C);return D==="undefined"||D===undefined?o:D}});u=true}}var A=s[w];if(A){var y=A.apply(o,v);if(w.slice(0,1)=="_"){delete s[w]}return y}return o}})};function b(q,G,t){var w=this,v=null,D=false,u,s,F=[],y={},x={},E,r,p,C,o,A;i(w,{id:function(){return E},isLoaded:function(){return(v!==null&&v.fp_play!=undefined&&!D)},getParent:function(){return q},hide:function(H){if(H){q.style.height="0px"}if(w.isLoaded()){v.style.height="0px"}return w},show:function(){q.style.height=A+"px";if(w.isLoaded()){v.style.height=o+"px"}return w},isHidden:function(){return w.isLoaded()&&parseInt(v.style.height,10)===0},load:function(J){if(!w.isLoaded()&&w._fireEvent("onBeforeLoad")!==false){var H=function(){u=q.innerHTML;if(u&&!flashembed.isSupported(G.version)){q.innerHTML=""}flashembed(q,G,{config:t});if(J){J.cached=true;j(x,"onLoad",J)}};var I=0;m(a,function(){this.unload(function(K){if(++I==a.length){H()}})})}return w},unload:function(J){if(this.isFullscreen()&&/WebKit/i.test(navigator.userAgent)){if(J){J(false)}return w}if(u.replace(/\s/g,"")!==""){if(w._fireEvent("onBeforeUnload")===false){if(J){J(false)}return w}D=true;try{if(v){v.fp_close();w._fireEvent("onUnload")}}catch(H){}var I=function(){v=null;q.innerHTML=u;D=false;if(J){J(true)}};setTimeout(I,50)}else{if(J){J(false)}}return w},getClip:function(H){if(H===undefined){H=C}return F[H]},getCommonClip:function(){return s},getPlaylist:function(){return F},getPlugin:function(H){var J=y[H];if(!J&&w.isLoaded()){var I=w._api().fp_getPlugin(H);if(I){J=new l(H,I,w);y[H]=J}}return J},getScreen:function(){return w.getPlugin("screen")},getControls:function(){return w.getPlugin("controls")._fireEvent("onUpdate")},getLogo:function(){try{return w.getPlugin("logo")._fireEvent("onUpdate")}catch(H){}},getPlay:function(){return w.getPlugin("play")._fireEvent("onUpdate")},getConfig:function(H){return H?k(t):t},getFlashParams:function(){return G},loadPlugin:function(K,J,M,L){if(typeof M=="function"){L=M;M={}}var I=L?e():"_";w._api().fp_loadPlugin(K,J,M,I);var H={};H[I]=L;var N=new l(K,null,w,H);y[K]=N;return N},getState:function(){return w.isLoaded()?v.fp_getState():-1},play:function(I,H){var J=function(){if(I!==undefined){w._api().fp_play(I,H)}else{w._api().fp_play()}};if(w.isLoaded()){J()}else{if(D){setTimeout(function(){w.play(I,H)},50)}else{w.load(function(){J()})}}return w},getVersion:function(){var I="flowplayer.js 3.2.0";if(w.isLoaded()){var H=v.fp_getVersion();H.push(I);return H}return I},_api:function(){if(!w.isLoaded()){throw"Flowplayer "+w.id()+" not loaded when calling an API method"}return v},setClip:function(H){w.setPlaylist([H]);return w},getIndex:function(){return p}});m(("Click*,Load*,Unload*,Keypress*,Volume*,Mute*,Unmute*,PlaylistReplace,ClipAdd,Fullscreen*,FullscreenExit,Error,MouseOver,MouseOut").split(","),function(){var H="on"+this;if(H.indexOf("*")!=-1){H=H.slice(0,H.length-1);var I="onBefore"+H.slice(2);w[I]=function(J){j(x,I,J);return w}}w[H]=function(J){j(x,H,J);return w}});m(("pause,resume,mute,unmute,stop,toggle,seek,getStatus,getVolume,setVolume,getTime,isPaused,isPlaying,startBuffering,stopBuffering,isFullscreen,toggleFullscreen,reset,close,setPlaylist,addClip,playFeed,setKeyboardShortcutsEnabled,isKeyboardShortcutsEnabled").split(","),function(){var H=this;w[H]=function(J,I){if(!w.isLoaded()){return w}var K=null;if(J!==undefined&&I!==undefined){K=v["fp_"+H](J,I)}else{K=(J===undefined)?v["fp_"+H]():v["fp_"+H](J)}return K==="undefined"||K===undefined?w:K}});w._fireEvent=function(Q){if(typeof Q=="string"){Q=[Q]}var R=Q[0],O=Q[1],M=Q[2],L=Q[3],K=0;if(t.debug){g(Q)}if(!w.isLoaded()&&R=="onLoad"&&O=="player"){v=v||c(r);o=v.clientHeight;m(F,function(){this._fireEvent("onLoad")});m(y,function(S,T){T._fireEvent("onUpdate")});s._fireEvent("onLoad")}if(R=="onLoad"&&O!="player"){return}if(R=="onError"){if(typeof O=="string"||(typeof O=="number"&&typeof M=="number")){O=M;M=L}}if(R=="onContextMenu"){m(t.contextMenu[O],function(S,T){T.call(w)});return}if(R=="onPluginEvent"||R=="onBeforePluginEvent"){var H=O.name||O;var I=y[H];if(I){I._fireEvent("onUpdate",O);return I._fireEvent(M,Q.slice(3))}return}if(R=="onPlaylistReplace"){F=[];var N=0;m(O,function(){F.push(new h(this,N++,w))})}if(R=="onClipAdd"){if(O.isInStream){return}O=new h(O,M,w);F.splice(M,0,O);for(K=M+1;K<F.length;K++){F[K].index++}}var P=true;if(typeof O=="number"&&O<F.length){C=O;var J=F[O];if(J){P=J._fireEvent(R,M,L)}if(!J||P!==false){P=s._fireEvent(R,M,L,J)}}m(x[R],function(){P=this.call(w,O,M);if(this.cached){x[R].splice(K,1)}if(P===false){return false}K++});return P};function B(){if($f(q)){$f(q).getParent().innerHTML="";p=$f(q).getIndex();a[p]=w}else{a.push(w);p=a.length-1}A=parseInt(q.style.height,10)||q.clientHeight;E=q.id||"fp"+e();r=G.id||E+"_api";G.id=r;t.playerId=E;if(typeof t=="string"){t={clip:{url:t}}}if(typeof t.clip=="string"){t.clip={url:t.clip}}t.clip=t.clip||{};if(q.getAttribute("href",2)&&!t.clip.url){t.clip.url=q.getAttribute("href",2)}s=new h(t.clip,-1,w);t.playlist=t.playlist||[t.clip];var H=0;m(t.playlist,function(){var J=this;if(typeof J=="object"&&J.length){J={url:""+J}}m(t.clip,function(K,L){if(L!==undefined&&J[K]===undefined&&typeof L!="function"){J[K]=L}});t.playlist[H]=J;J=new h(J,H,w);F.push(J);H++});m(t,function(J,K){if(typeof K=="function"){if(s[J]){s[J](K)}else{j(x,J,K)}delete t[J]}});m(t.plugins,function(J,K){if(K){y[J]=new l(J,K,w)}});if(!t.plugins||t.plugins.controls===undefined){y.controls=new l("controls",null,w)}y.canvas=new l("canvas",null,w);function I(J){if(!w.isLoaded()&&w._fireEvent("onBeforeClick")!==false){w.load()}return f(J)}u=q.innerHTML;if(u.replace(/\s/g,"")!==""){if(q.addEventListener){q.addEventListener("click",I,false)}else{if(q.attachEvent){q.attachEvent("onclick",I)}}}else{if(q.addEventListener){q.addEventListener("click",f,false)}w.load()}}if(typeof q=="string"){var z=c(q);if(!z){throw"Flowplayer cannot access element: "+q}else{q=z;B()}}else{B()}}var a=[];function d(o){this.length=o.length;this.each=function(p){m(o,p)};this.size=function(){return o.length}}window.flowplayer=window.$f=function(){var p=null;var o=arguments[0];if(!arguments.length){m(a,function(){if(this.isLoaded()){p=this;return false}});return p||a[0]}if(arguments.length==1){if(typeof o=="number"){return a[o]}else{if(o=="*"){return new d(a)}m(a,function(){if(this.id()==o.id||this.id()==o||this.getParent()==o){p=this;return false}});return p}}if(arguments.length>1){var t=arguments[1],q=(arguments.length==3)?arguments[2]:{};if(typeof t=="string"){t={src:t}}t=i({bgcolor:"#000000",version:[9,0],expressInstall:"http://static.flowplayer.org/swf/expressinstall.swf",cachebusting:true},t);if(typeof o=="string"){if(o.indexOf(".")!=-1){var s=[];m(n(o),function(){s.push(new b(this,k(t),k(q)))});return new d(s)}else{var r=c(o);return new b(r!==null?r:o,t,q)}}else{if(o){return new b(o,t,q)}}}return null};i(window.$f,{fireEvent:function(){var o=[].slice.call(arguments);var q=$f(o[0]);return q?q._fireEvent(o.slice(1)):null},addPlugin:function(o,p){b.prototype[o]=p;return $f},each:m,extend:i});if(typeof jQuery=="function"){jQuery.fn.flowplayer=function(q,p){if(!arguments.length||typeof arguments[0]=="number"){var o=[];this.each(function(){var r=$f(this);if(r){o.push(r)}});return arguments.length?o[arguments[0]]:new d(o)}return this.each(function(){$f(this,k(q),p?k(p):{})})}}})();(function(){var h=document.all,j="http://www.adobe.com/go/getflashplayer",c=typeof jQuery=="function",e=/(\d+)[^\d]+(\d+)[^\d]*(\d*)/,b={width:"100%",height:"100%",id:"_"+(""+Math.random()).slice(9),allowfullscreen:true,allowscriptaccess:"always",quality:"high",version:[3,0],onFail:null,expressInstall:null,w3c:false,cachebusting:false};if(window.attachEvent){window.attachEvent("onbeforeunload",function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){}})}function i(l,f){if(f){for(key in f){if(f.hasOwnProperty(key)){l[key]=f[key]}}}return l}function a(f,n){var m=[];for(var l in f){if(f.hasOwnProperty(l)){m[l]=n(f[l])}}return m}window.flashembed=function(f,m,l){if(typeof f=="string"){f=document.getElementById(f.replace("#",""))}if(!f){return}if(typeof m=="string"){m={src:m}}return new d(f,i(i({},b),m),l)};var g=i(window.flashembed,{conf:b,getVersion:function(){var f;try{f=navigator.plugins["Shockwave Flash"].description.slice(16)}catch(n){try{var l=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");f=l&&l.GetVariable("$version")}catch(m){}}f=e.exec(f);return f?[f[1],f[3]]:[0,0]},asString:function(l){if(l===null||l===undefined){return null}var f=typeof l;if(f=="object"&&l.push){f="array"}switch(f){case"string":l=l.replace(new RegExp('(["\\\\])',"g"),"\\$1");l=l.replace(/^\s?(\d+\.?\d+)%/,"$1pct");return'"'+l+'"';case"array":return"["+a(l,function(o){return g.asString(o)}).join(",")+"]";case"function":return'"function()"';case"object":var m=[];for(var n in l){if(l.hasOwnProperty(n)){m.push('"'+n+'":'+g.asString(l[n]))}}return"{"+m.join(",")+"}"}return String(l).replace(/\s/g," ").replace(/\'/g,'"')},getHTML:function(o,l){o=i({},o);var n='<object width="'+o.width+'" height="'+o.height+'" id="'+o.id+'" name="'+o.id+'"';if(o.cachebusting){o.src+=((o.src.indexOf("?")!=-1?"&":"?")+Math.random())}if(o.w3c||!h){n+=' data="'+o.src+'" type="application/x-shockwave-flash"'}else{n+=' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'}n+=">";if(o.w3c||h){n+='<param name="movie" value="'+o.src+'" />'}o.width=o.height=o.id=o.w3c=o.src=null;o.onFail=o.version=o.expressInstall=null;for(var m in o){if(o[m]){n+='<param name="'+m+'" value="'+o[m]+'" />'}}var p="";if(l){for(var f in l){if(l[f]){var q=l[f];p+=f+"="+(/function|object/.test(typeof q)?g.asString(q):q)+"&"}}p=p.slice(0,-1);n+='<param name="flashvars" value=\''+p+"' />"}n+="</object>";return n},isSupported:function(f){return k[0]>f[0]||k[0]==f[0]&&k[1]>=f[1]}});var k=g.getVersion();function d(f,n,m){if(g.isSupported(n.version)){f.innerHTML=g.getHTML(n,m)}else{if(n.expressInstall&&g.isSupported([6,65])){f.innerHTML=g.getHTML(i(n,{src:n.expressInstall}),{MMredirectURL:location.href,MMplayerType:"PlugIn",MMdoctitle:document.title})}else{if(!f.innerHTML.replace(/\s/g,"")){f.innerHTML="<h2>Flash version "+n.version+" or greater is required</h2><h3>"+(k[0]>0?"Your version is "+k:"You have no flash plugin installed")+"</h3>"+(f.tagName=="A"?"<p>Click here to download latest version</p>":"<p>Download latest version from <a href='"+j+"'>here</a></p>");if(f.tagName=="A"){f.onclick=function(){location.href=j}}}if(n.onFail){var l=n.onFail.call(this);if(typeof l=="string"){f.innerHTML=l}}}}if(h){window[n.id]=document.getElementById(n.id)}i(this,{getRoot:function(){return f},getOptions:function(){return n},getConf:function(){return m},getApi:function(){return f.firstChild}})}if(c){jQuery.tools=jQuery.tools||{version:"3.2.0"};jQuery.tools.flashembed={conf:b};jQuery.fn.flashembed=function(l,f){return this.each(function(){$(this).data("flashembed",flashembed(this,l,f))})}}})();



/**************
* JQUERY PLUGINS
***************/
(function($) {
	var t = $.tools.overlay; 
	t.plugins = t.plugins || {};

	/**
	 * Overlay Gallery plugin, version: 1.0.0
	 * 
	 * Copyright (c) 2009 Tero Piirainen
	 * http://flowplayer.org/tools/overlay.html#gallery
	 *
	 * Dual licensed under MIT and GPL 2+ licenses
	 * http://www.opensource.org/licenses
	 *
	 * Since  : July 2009
	 * Date: ${date}
	 * Revision: ${revision} 
	 */
	// TODO: next(), prev(), getIndex(), onChange event
	// version number
	t.plugins.gallery = {
		version: '1.0.0', 
		conf: { 
			imgId: 'img',
			next: '.next',
			prev: '.prev',
			info: '.info',
			progress: '.progress',
			disabledClass: 'disabled',
			activeClass: 'active',
			opacity: 0.8,
			speed: 'slow',
			template: '<strong>${title}</strong> <span>Image ${index} of ${total}</span>',  
			autohide: true,
			preload: true,
			api: false,
			minWidth: 0,
			minHeight: 0,
			// Addtions by Franz Koch
			attrTarget:		'el',//'el.children(\'img\')',
			useAsTitle:		'el.attr(\'title\')'//'$(\'#\'+el.attr(\'name\')).html()', //available objects: $this (jQueryObject from matching lightbox enabled item), $tgt (jQueryObject from settings.attrTarget)
		}
	};			

	$.fn.gallery = function(opts) {
		
		var conf = $.extend({}, t.plugins.gallery.conf), api;
		$.extend(conf, opts);   	

		// common variables for all gallery images
		api = this.overlay();
		
		var links = this,
			 overlay = api.getOverlay(),
			 next = overlay.find(conf.next),
			 prev = overlay.find(conf.prev),
			 info = overlay.find(conf.info),
			 progress = overlay.find(conf.progress),
			 els = prev.add(next).css({opacity: conf.opacity}),
			 close = api.getClosers(), 			 
			 index,
			 animating = false,
			 targets = [];

		// remove duplicate links (by Franz Koch)
		links = $($.grep(links, function(o, i) {
			var l = $(o).attr('href');
			if ($.inArray(l,targets) > -1) {
				return false;
			}
			targets.push(l);
			return true;
		}));

//{{{ load 

		function load(el) {
			
			//progress.fadeIn();
			overlay.addClass('loading');
			els.hide(); close.hide(); info.hide();
			animating = true;
			
			var url = el.attr("href"); 
			
			// download the image 
			var image = new Image();
			
			image.onload = function() {
				
				progress.fadeOut();
				
				// find image inside overlay
				var img = $("#" + conf.imgId, overlay); 
				
				// or append it to the overlay 
				if (!img.length) { 
					img = $("<img/>").attr("id", conf.imgId).css("visibility", "hidden");
					overlay.prepend(img);
				}
				
				// make initially invisible to get it's dimensions
				img.attr("src", url).css("visibility", "hidden"); 			
					
				// animate overlay to fit the image dimensions
				var width = Math.max(image.width,conf.minWidth),
					left = ($(window).width() - width) / 2;
					
				// calculate index number
				index = links.index(links.filter("[href=" +url+ "]"));	
				
				// activate trigger
				links.removeClass(conf.activeClass).eq(index).addClass(conf.activeClass);
				
				// enable/disable next/prev links
				var cls = conf.disabledClass;
				els.removeClass(cls);

				if (index === 0) { prev.addClass(cls); }
				if (index == links.length -1) { next.addClass(cls); }
				
				// prepare title (by Franz Koch)
				var $tgt = eval(conf.attrTarget), title='';
				if(conf.useAsTitle) {
					title = eval(conf.useAsTitle);
				} else {
					title = el.attr("title") || el.data("title") || '';
				}
				// set info text & width
				var text = conf.template
					.replace("${title}", title)
					.replace("${index}", index + 1)
					.replace("${total}", links.length);
					
				//var padd = parseInt(info.css("paddingLeft"), 10) +  parseInt(info.css("paddingRight"), 10);
				info.html(text);//.css({width: width - padd});

				overlay.removeClass('loading').animate({
					width: width, height:  Math.max(image.height,conf.minHeight), left: left}, conf.speed, function() {
					animating = false;
					// gradually show the image
					img.add(info).hide().css("visibility", "visible").fadeIn(function() {
						if (!conf.autohide) {
							showEls();
						}
					});								

				}); 
			};
			
			image.onerror = function() {
				overlay.fadeIn().html("Cannot find image " + url); 
			};
			
			image.src = url;
			
			if (conf.preload) {
				links.filter(":eq(" +(index-1)+ "), :eq(" +(index+1)+ ")").each(function()  {
					var img = new Image();
					img.src = $(this).attr("href");					
				});
			}
			
		}
		
//}}}


		// function to add click handlers to next/prev links	 
		function addClick(el, isNext)  {
			el.click(function() {
				if (el.hasClass(conf.disabledClass)) { return; }				
				
				// find the triggering link
				var trigger = links.eq(i = index + (isNext ? 1 : -1));			
					 
				// if found load it's href
				if (trigger.length) { load(trigger); }
			});				
		}

		// assign next/prev click handlers
		addClick(next, true);
		addClick(prev);

		
		// arrow keys
		$(document).keydown(function(evt) {
			if (!overlay.is(":visible") || evt.altKey || evt.ctrlKey) { return; }
			
			if (evt.keyCode == 37 || evt.keyCode == 39) {					
				var btn = evt.keyCode == 37 ? prev : next;
				btn.click();
				return evt.preventDefault();
			}	
			return true;			
		});		
		
		function showEls() {
			if (!overlay.is(":animated") && !animating) {
				els.show(); close.show(); info.slideDown();	
			}	
		}
		
		// autohide functionality
		if (conf.autohide) { 
			overlay.hover(showEls, function() { els.fadeOut(); /*info.slideUp();*/	close.hide(); }).mouseover(showEls);
		}		
		
		// load a proper gallery image when overlay trigger is clicked
		var ret;
		
		this.each(function() {
			var el = $(this), api = el.overlay(), ret = api;
			
			api.onBeforeLoad(function() {
				load(el);
			});
			
			api.onClose(function() {
				links.removeClass(conf.activeClass);	
			});			
		});  		
		return conf.api ? ret : this;
	};


	// Diashow script by Franz Koch (2010)
	// v1.0
	$.fn.diashow = function(options) {
		var defaults = {
			start: 0,
			delay: 10000,
			hide: 'fadeOut',
			show: 'fadeIn',
			speed: 'slow',
			animate: true,
			loop: true,
			animateAtSameTime: false,
			randomize: false,
			pauseOnHover:false,
			applyHeightToContainer:false,
			autoPlay:true,
			buttonNext:false,
			buttonPrev:false,
			swapTransitions:false,
			swapDepth:false,
			api:false,
			enableHover:true
		},
			isAnimating = false,
			stopped = false,
			lastSlide = null,
			timer = null,
			self = this;

		self.options = jQuery.extend(defaults, options);

		// bind all callbacks from configuration
		$.each(self.options, function(name, fn) {
			if ($.isFunction(fn)) { self.bind(name, fn); }
		});

		$.extend(self,{
			getNextSlide: function() {
				if(self.options.randomize && slides > 2) {
					if(slideNo >= slides-1) {
						slideNo = 0;
						slideStack = $.shuffle(slideStack);
					} else {
						slideNo++;	
					}
					var oldSlide = slide;
					slide = slideStack[slideNo];
					if(slide == oldSlide) {
						slide = slideStack[++slideNo];
					}
				} else if (self.options.loop && slide+1 == slides) {
					slide = 0;
				} else {
					slide++;	
				}
			},
			getPrevSlide: function() {
				if (self.options.loop && slide-1 < 0) {
					slide = slides-1;
				} else {
					slide--;	
				}
			},
			setEnableHover: function(v) {
				self.options.enableHover = v;	
			},
			startTimer: function() {
				if((self.options.loop || (slide+1 < slides && slide > -1)) && !hovered && !stopped && self.options.autoPlay) {
					timer = setTimeout(self.next,self.options.delay);
				}
			},
			stopTimer: function() {
				clearTimeout(timer);
			},
			stop: function() {
				self.stopTimer();
				stopped = true;
			},
			play: function() {
				stopped = false;
				self.startTimer();
			},
			gotoSlide: function(no) {
				if(no >= 0 && no <= slides && no != slide) {
					self.stopTimer();
					self.doTransition(function() {
						slide = no;
					});
				}
			},
			next: function() {
				if((self.options.loop || (slide+1 < slides && slide > -1)) && !isAnimating) {
					self.stopTimer();
					self.doTransition(self.getNextSlide);
				}
			},
			prev: function() {
				if((self.options.loop || slide-1 >= 0) && !isAnimating) {
					self.stopTimer();
					self.doTransition(self.getPrevSlide);
				}
			},
			doTransition: function(getSlideFunc) {

				if(lastSlide) {
					$childs.eq(lastSlide).hide();
				}
				lastSlide = slide;
				getSlideFunc();

				var first = self.options.swapTransitions ? 'show' : 'hide',
					last = self.options.swapTransitions ? 'hide' : 'show',
					fS = self.options.swapTransitions ? slide : lastSlide,
					lS = self.options.swapTransitions ? lastSlide : slide;

				// onBeforeTransition
				var e = $.Event("onBeforeTransition");
				self.trigger(e, [lastSlide,slide]);				
				if (e.isDefaultPrevented()) { return self; }

				isAnimating = true;
				if (self.options.animateAtSameTime) {
					self.animateSlide(fS,first);
					self.animateSlide(lS,last,self.onAfterTransition);
				} else {
					self.animateSlide(fS,first,function() {
						self.animateSlide(lS,last,self.onAfterTransition);
					});
				}
			},
			animateSlide: function(nr,transition,fn) {
				var $t = $childs.eq(nr),zindex = $t.css('z-index');
/*
				// until a good solution is found, hardcode a resouce friendly animation as fading at the same time is quite processor hungry
				if (transition == 'hide') {
					$t.css('z-index',0).toggleClass('active');
					self.transitionFinished(fn);
				} else {
					$t.css('z-index',Number(slides))[options[transition]](options.speed,function() {
						$t.toggleClass('active');
						self.transitionFinished(fn);
					});
				}
*/
				if (self.options.swapDepth) {
					$t.css({'z-index': (transition == 'hide' ? 0 : Number(slides))});
				}
				if(!self.options.animate) {
					$t.toggleClass('active')[transition]();
					self.transitionFinished(fn);
				} else if(self.options[transition] === null || self.options[transition] === false) {
					zindex = (transition == 'hide' ? /*slides *-1*/0 : Number(slides))/*(zindex != 'auto' ? Number(zindex) : 0) +*/;
					$t.css({'z-index':zindex}).toggleClass('active');
						self.transitionFinished(fn);
				} else if(self.options[transition] == 'animate') {
					$t.animate(self.options[transition+'Params'],self.options.speed,self.options[transition+'Easing'],function() {
						$.toggleClass('active');
						self.transitionFinished(fn);
					});
				} else {
					$t[self.options[transition]](self.options.speed,function() {
						$t.toggleClass('active');
						self.transitionFinished(fn);
					});
				}
				var e = $.Event("onTransition");
				self.trigger(e, [nr]);
			},
			onAfterTransition: function() {
				$childs.eq(lastSlide).hide().css('z-index',0);
				self.startTimer();

				// onAfterTransition
				var e = $.Event("onAfterTransition");
				self.trigger(e, [lastSlide,slide]);				
				if (e.isDefaultPrevented()) { return self; }
			},
			transitionFinished: function(fn) {
				if($.isFunction(fn)) { fn.call() }
				isAnimating = false;
			}
		});

		function _init() {
			if(slides > 1) {
				if(self.options.buttonNext) {
					self.options.buttonNext.click(function() {self.next();return false;});	
				}
				if(self.options.buttonPrev) {
					self.options.buttonPrev.click(function() {self.prev();return false;});	
				}

				classes = $this.attr('class').split(' ');
				$(classes).each(function() {
					var strParts = this.split('-');
					if(strParts[0] == 'opt') {
						self.options[strParts[1]] = strParts[2];	
					}
				});

				if(self.options.applyHeightToContainer) {
					if($this.height() > 10) {
						$this.css('height',$this.height());
					} else {
						var heightTimer = setInterval(function($this) {
							var h = $this.children().height();
							if(h > 10) {
								$this.css('height',h);
								clearInterval(heightTimer);
							}
						},200,$this);
					}
				}
				$this.addClass('slideshowActive');

				for(var i=0; i < slides; i++) {
					slideStack.push(i);
				}
				if(self.options.randomize) {
					slideStack = $.shuffle(slideStack);
				}
				$childs.removeClass('active').addClass(selector).eq(slide).addClass('active');
				if(self.options.pauseOnHover) {
					$childs.children().hover(
						function() {
							if(self.options.enableHover) {
								self.stopTimer();
							}
							hovered = true;
						},
						function() {
							hovered = false;
							if (self.options.enableHover) {
								self.startTimer();
							}
						}
					);
				}
				self.startTimer();
			}
		}

		var $this = $(this),
			selector = 'slideShowItem',
			$childs = $this.children(),
			slides = $childs.length,
			slide = self.options.start,
			slideStack = [],
			slideNo = 0,
			hovered = false,
			classes = [];
		
		$this.load(_init());
		return self.options.api ? self : $this;
	};


	/*
	 * jQuery shuffle
	 *
	 * Copyright (c) 2008 Ca Phun Ung <caphun at yelotofu dot com>
	 * Dual licensed under the MIT (MIT-LICENSE.txt)
	 * and GPL (GPL-LICENSE.txt) licenses.
	 *
	 * http://yelotofu.com/labs/jquery/snippets/shuffle/
	 *
	 * Shuffles an array or the children of a element container.
	 * This uses the Fisher-Yates shuffle algorithm <http://jsfromhell.com/array/shuffle [v1.0]>
	 */

	$.fn.shuffle = function() {
		return this.each(function(){
			var items = $(this).children();
			return (items.length) ? $(this).html($.shuffle(items)) : this;
		});
	}
	
	$.shuffle = function(arr) {
		for(var j, x, i = arr.length; i; j = parseInt(Math.random() * i), x = arr[--i], arr[i] = arr[j], arr[j] = x);
		return arr;
	}
})(jQuery); // Call and execute the function immediately passing the jQuery object


/* custom additions for website */
// jQuery
$(function() {
	// General methods
	$.enet = {};
	$.enet.baseUrl = $('base').attr('href');
	$.enet.locale = 'de';

	$.enet.getCookies = function(force) {
		if (document.cookie && document.cookie.length && (typeof($.enet.cookies) == 'undefined' || force == true)) {
			var tmp,val = document.cookie;
			$.enet.cookies = {};
			// convert cookie values to manageable data
			$(val.split(';')).each(function() {
				tmp = this.replace(/^\s+/,'').replace('/\s+$/','').split('=');
				$.enet.cookies[tmp[0]] = tmp[1];
			});
			
		}
		return $.enet.cookies;
	}

	$.enet.absoluteUrl = function(url) {
		if (!url.match(/^(http|https|ftp):\/\/.*/)) {
			url = $.enet.baseUrl+url;
		}
		return url;
	}

	// early auto-redirect to mobile version
	var cookies = $.enet.getCookies();
	if (
		(window.screen.width < 600
			|| (window.screen.width < 980 && window.screen.height < 700) // check for resultion a little lower then iPad and a little more like retina display and other high res smartphones
		)
		&& (typeof(cookies.isMobileRedirect) == 'undefined' || cookies.isMobileRedirect == 'FALSE')
		//&& (typeof(cookies.hadMobileRedirect) == 'undefined' || cookies.hadMobileRedirect == 'FALSE' || cookies.hadMobileRedirect == '')
		) {
			document.location.href = 'http://mobil.eurobaustoff-forum.de/';
	}
	
	if (typeof(console) != 'undefined') {
//		console.log(window.screen.width, window.screen.height, window.screen.availWidth, window.screen.availHeight);	
	}

	var players = [];
/*
	$.enet.extendImageRotator = function(selector,url) {
		$t = $(selector);
		if($t.hasClass('imageRotator')) {
			$.get(url,function(data,status) {
				if(status == 'success' || status == 'notmodified') {
					var $d = $($('data',data).text()),
						$items = $d.children('li').removeClass('first'),
						current = $t.children('li').removeClass('last').attr('id');
					$d.hide();
	
					if($items.length > 1) {
						$items.each(function() {
							if($(this).attr('id') == current) {
								$(this).remove();
							}
						});
						$items.appendTo(selector);
						$.enet.enableDiaShow($t);
					}
					$d.remove();
				}
			},'xml');
		}
	}
*/
/*
	$.enet.enableDiaShow = function(t) {
		if(t.children().length > 1) {
			t.diashow({delay:3000,speed:2000,randomize:true,applyHeightToContainer:true,animateAtSameTime:true,pauseOnHover:false});
		}
	}
*/
	$.enet.enrichContent = function(selector) {
		var $s = $(selector), teaserApi;
/*
		// slideshows
		$s.find('.imageRotator').each(function() {
			$.enet.enableDiaShow($(this));
		});
*/
		

		// scroller
		$s.find('.scrollable').each(function() {
			var $scroller = $(this), $childs = $scroller.children(), $container='',$menu='', w=$scroller.outerWidth(), h=0, count = Math.round(w / $childs.eq(0).outerWidth());
			if($childs.outerWidth() * $childs.length > w) {
				$container = $scroller.wrap('<div class="scrollerContainer"></div>').parent();
				h = $scroller.outerHeight();
				$container.css('width',w).css('height',h);
				$menu = $('<ul class="scrollerNavi"></ul>');
				$menu.append('<li class="prev"><a title="'+$.enet.l18n('showPrevImage')+'"><span>&nbsp;<dfn title="'+$.enet.l18n('showPrevImage')+'">&lt;</dfn></span></a></li><li class="next"><a title="'+$.enet.l18n('showNextImage')+'"><span>&nbsp;<dfn title="'+$.enet.l18n('showNextImage')+'">&gt;</dfn></span></a></li>');
				//$navi = $('<div class="navi"/>');
				//$scroller.diashow({applyHeightToContainer:false,animateAtSameTime:true,autoPlay:false,buttonNext:$menu.find('.next a'),buttonPrev:$menu.find('.prev a')});
				var api = $container.append($menu).scrollable({items:$scroller,size:count,clickable:false,api:true});

				// show/hide all images at once
				if ($scroller.hasClass('imageStrip')) {
					var $open = $('<a href="#" class="link-down open"><span>Alle Fotos</span></a>').click(function(e) {
						$open.hide();
						$menu.fadeOut();
						api.seekTo(0,0);
						api.getConf().keyboard = false;
						$container.addClass('showAll').animate({'height':$scroller.outerHeight()},function() {
							$close.fadeIn();
						});
						return e.preventDefault();
					}).hide(),
					$close = $('<a href="#" class="link-up close">Weniger Fotos</a>').click(function(e) {
						$close.hide();
						$container.animate({'height':h},function() {
							$container.removeClass('showAll');
							$open.fadeIn();
							$menu.fadeIn();
							api.getConf().keyboard = true;
						});
						return e.preventDefault();
					}).hide();
					$container.append($open,$close);
					$open.fadeIn();
				}

			}
		});	

		// tabs
		var $tab = $s.find('.tabs');
		if ($tab.children('.pane').length) {
			var $m = $('<ul class="tabNavi"></ul>');
			$tab.children('.pane').each(function(){
				var $t = $(this), h = $t.find('h2:first').hide().html();
				if (h !== null && h.length) {
					$m.append('<li><a href="#'+$t.attr('id')+'">'+h+'</a></li>');
				}
			});
			$tab.wrapInner('<div class="tabContent"></div>');
			$tab.find('.tabContent').append('<span class="clearFix"></span>');
			$tab.prepend($m);
			var api = $m.tabs($m.next().children('.pane'),{effect:'default',api:true,
				onClick: function(e,i) {/*
					var p = api.getCurrentPane(), i = $(p).find('.tx-wecmap-map').attr('id'), m = mark = null;
					if (i != null && typeof(WecMap) != null) {
						mark = WecMap.markers[i][0][0];
						m = WecMap.get(i);
						m.checkResize();
						m.setCenter(mark.getLatLng());
						GEvent.trigger(mark,'click');
					}
					return true;*/
				}
			});
		}

		// accordeon
		$s.find('.accordeon').each(function() {
			var $t = $(this).addClass('jsEnhanced');
			$t.children('h3:first').addClass('current');
			$t.children('.pane:first').css('display','block');
			$t.tabs($t.children('.pane'), {tabs: 'h3', effect: 'slide', initialIndex: null});
		});

		// Startpage Teasers
		$s.find('ul.teaserList').each(function() {
			var $t = $(this), $c = $t.children(), $container='', $menu='', api;
			if($c.length > 1) {
				$container = $t.parent();
				$menu = $('<ul class="slideshowNavi buttonNavi"></ul>').hide();
				teaserApi = $t.diashow({delay:6000,speed:1000,applyHeightToContainer:true,swapDepth:true,hide:null,randomize:false,api:true,animateAtSameTime:false,pauseOnHover:true/*,animate:($.browser.msie ? false : true)*/,
					onTransition:function(e,slide) {
						//use a slight delay for the detection in order for the player/object to be initiated
						var t = setTimeout(function() {
							var $p = $t.children().eq(slide).find('[id^=mediaPlayerNo]');
							$p.each(function() {
								var p = document.getElementById($(this).attr('id'));
								if (typeof(p) == 'object' || typeof(p) == 'function' /*FF*/) {
									try {
										p.StopPlay();
									} catch (e) {}
								}
							});
						},10);
					},
					onAfterTransition:function(e,last,current) {
						$menu.children().removeClass('current');
						$menu.children().eq(current).addClass('current');
						var $p = $t.children().eq(current).add($t.children().eq(last));
						$p.find('[id^=mediaPlayerNo]').each(function() {
							var $i = $(this),
								p = document.getElementById($i.attr('id'));
							if (typeof(p) == 'object' || typeof(p) == 'function' /*FF*/) {
								try {
									if($i.closest('li').index() == current) {
										p.Play();
									} else {
										p.Rewind();
									}
								} catch (e) {}
							}
						});
					}
				});
				// numbered menu
				$c.each(function(nr) {
					var $link = $('<a href="#">'+(nr+1)+'</a>'),$item = $('<li></li>').append($link);
					$menu.append($item);
					$link.bind('click',function() {
						teaserApi.gotoSlide(nr);
						return false;
					}).hover(function() {teaserApi.stop()},function() {teaserApi.play()});
				});
				$container.append($menu);
				$menu.fadeIn().children().eq(0).addClass('current');
			}
			// mediaPlayer
			$.enet.addMediaPlayer($t,teaserApi);
		});

		// lightbox
		if($s.find('a[rel*=lightbox]').length) {
			$s.find('a[rel*=lightbox]').overlay({
				target: '#lightbox',
				expose: {color:'#333', zIndex:9999},
				oneInstance: false
			}).gallery({
				speed:800,
				opacity: null,
				minWidth: 200,
				template: '<div class="description">${title}</div><span class="imageCount">'+$.enet.l18n('image')+' ${index} '+$.enet.l18n('of')+' ${total}</span>',
				useAsTitle: '(el.attr(\'name\') && $(\'#\'+el.attr(\'name\')).length) ? $(\'#\'+el.attr(\'name\')).html() : el.children(\'img\').attr(\'title\')'
			});
		};

		// popups
		$s.find('.link-popup, a[rel=popup]').each(function() {
			var $t = $(this);
			$t.click(function() {
				return $.enet.displayPopup($t.attr('href'));
			});
		});

/*
		// inline-popups
		$s.find('.link-inlinePopup').overlay({
			expose: '#333',
			target: '#overlayContainer',
			closeOnClick:false,
			onBeforeLoad: function(event) {
				var url = $.enet.absoluteUrl(this.getTrigger().attr('href')+'&type=644');
				createOverlayContainer();
				$overlay.addClass('loading');
				$.get(url,function(data,status) {
					$overlayContent.html($('data',data).text());
					$overlay.removeClass('loading');
					if(status === 'success' || status === 'notmodified') {
						$.enet.enrichContent($overlayContent);
						$overlayContent.fadeIn(400);	
					} else {
						window.location.href = url;
					}
				},'xml');
			},
			onClose: function() {
				removeOverlayContainer();
			}
		});
*/


		// search forms
		$s.find('.searchForm').each( function() {
			var sf = $(this).find('input.searchField'),
				dt = sf.val();
			if(dt != '' && dt != undefined && !sf.hasClass('dontEnhance')) {
				$(this).submit(function() {
					if(sf.val() != dt || (sf.hasClass('matchTitle') && sf.attr('title') != sf.val())) {
						return true;	
					}
					return false;
				});
				sf.focus(function() {
					if($(this).val() == dt) {
						$(this).val('');					
					}
				})
				.blur(function() {
					if($(this).val() == '') {
						$(this).val(dt);	
					}
				});
			}
		});	


		// equal height of multicolumn FCEs
		$s.find('div.multicolumn').each(function(){
			var $fceCol = $(this), h = $fceCol.innerHeight();
			if ($fceCol.children('[class*=framed]').length) {
				$fceCol.children('div').css('height',h);
			}
		});



	}

	// video
	// add mediaplayer
	$.enet.addMediaPlayer = function($c,api) {
		$c.find('a[rel=mediaPlayer]').each(function(i) {
			var $t = $(this), $i = $t.children('img'), pid = 'mediaPlayerNo'+i,
				file = $i.attr('longdesc') || $t.attr('href'),
				fileUrl = file.substr(0,4) == 'http' ? file : $.enet.baseUrl+file,
				thumb = $i.attr('src'),
				thumbUrl = thumb.substr(0,4) == 'http' ? thumb : $.enet.baseUrl+thumb,
				type = file.substr(file.length-3);

			$t.css({
				//Math.max is defining a minimum height for the player if there is no image or the image hasn't been fully loaded yet
				height:Math.max(300,$i.attr('height') || $t.parent().height()),
				display:'block'
			});

			if (type == 'swf') {
				players[i] = $t.flashembed(
					{src:file,version:[9,115],w3c:true,wmode:'transparent',allowscriptaccess:'always',loop:'false','id':pid, 'name':pid, onFail:$.enet.onFlashembedFail}				   
				);
			} else {
				players[i] = $t.flowplayer(
   					{src:'templates/eurobaustoff-forum/media/flowplayer.swf',version:[9,115],w3c:true,wmode:'transparent',allowscriptaccess:'always', 'id':pid, 'name':pid, onFail:$.enet.onFlashembedFail},
					{
//						config: {
							clip: {
								scaling: 'fit',
								baseUrl: $.enet.baseUrl
							},
							playlist: [
								{ url: thumbUrl},
								{ url: fileUrl, autoPlay: true, autoBuffering: true,
									onStart: function() {
										if (api != null) { api.stop();api.setEnableHover(false);}
									},
									onFinish: function() {
										if (api != null) { api.setEnableHover(true);api.play();api.next(); }
									}
								}
							],
							onMouseOver: function() {
								if (api != null) { api.stop();api.setEnableHover(false);}
							},
							onMouseOut: function() {
								if (api != null) { api.stop();api.setEnableHover(false);}
							},
							plugins: {
									controls: null
							},
/*
							plugins: {
								controls: {
									//fullscreen:false,
									fontColor:'#ffffff',
									timeFontColor:'#999999',
									volumeSliderColor: '#4d4d4d',
									timeColor: '#999999',
									durationColor: '#ffffff',
									timeBgColor: '#333333',
									tooltipTextColor: '#ffffff',
									buttonColor: '#4d4d4d',
									borderRadius: '0',
									buttonOverColor: '#cccccc',
									sliderColor: '#000000',
									backgroundGradient: 'none',
									backgroundColor: '#000000',
									progressColor: '#999999',
									bufferColor: '#4d4d4d',
									tooltipColor: '#999999',
									progressGradient: 'medium',
									height: 25,
									opacity: 0.7,
									autoHide:'always'
								}
							},
*/
							canvas: {
								backgroundGradient:'none',
								backgroundColor:'transparent'
/*							},
							onFinish: function() {
								this.unload();*/
							}
//						}
					}
				);
				flowplayer().load();
			}
			if($t.children('object,embed').length) {
				$t.click(function() {return false});
			};
		});
	};


	$.enet.displayError = function(headline,message){
		var $messageContainer = $('<div class="infoMessage layout-error" id="errorMessage"></div>');
		$('body').append($messageContainer);
		$messageContainer.html('<h3>'+headline+'</h3>'+message).hide().overlay({
			api:true,
			expose:'#333',
			onLoad: function() {$messageContainer.fadeIn()},
			onBeforeClose: function() {$messageContainer.fadeOut()},
			onClose:function() {$messageContainer.remove()}
		}).load();
		return false;
	}

	$.enet.displayPopup = function(url,options) {
		var defaults = {
			'name'	:	'pollin',
			windowParams	: {
				'width'	:	800,
				'height'	:	400,
				'left'		:	'',
				'top'		:	'',
				'scrollbars'	: 'auto',
				'menubar'	: 'false',
				'status'		: 'false',
				'location'	: 'false'
			}
		},
			params = '', popup = false;
		options = $.extend(defaults, options);
		$.each(options.windowParams, function(n) {
			if(this && this != '') {
				params += n+'='+this+',';
			}
		});
		params = params.substr(0,params.length-1);
		popup = window.open(url,options.name,params);
		if(popup) {
			return false;	
		}
	}

	$.enet.loaderClass = function(){
		this.loader = $('<div id="loader"></div>').hide();

		this.display = function(message) {
			if (message) {
				this.loader.html(message);
			}
			$('body').append(this.loader);
			this.loader.expose({
				color:'#333',
				caller: this,
				zIndex: 9999,
				closeOnClick: false,
				closeOnEsc: false,
				onLoad: function() {this.getConf().caller.loader.fadeIn()},
				onBeforeClose: function() {this.getConf().caller.loader.stop(true).fadeOut()},
				onClose: function() {this.getConf().caller.loader.stop(true).hide()}
			});
		};

		this.hide = function() {
			$.mask.close();
			$('body').remove(this.loader);
			this.loader.stop(true).hide().html();
		};
	}
	$.enet.loader = new $.enet.loaderClass();


/**************
* LOCALIZATION
***************/
	$.enet.lll = {
		'de' : {
			// general
			'error'						:	'Fehler',
			// modal box
			'attention'					:	'Achtung!',
			'close'						:	'Schließen',
			'prev'						:	'zurück',
			'next'						:	'weiter',
			// image scroller
			'showNextImage'			:	'nächstes Bild',
			'showPrevImage'			:	'vorheriges Bild',
			// lightbox
			'image'					:	'Bild',
			'of'					:	'von',
			// tooltips
			'displayImageNo'			:	'Bild {s} anzeigen',
			// form validation
			'evalMsgValidEmail'		: 'Geben Sie eine gültige E-Mail-Adresse an',
			'evalMsgFillRequiredFields' : 'Bitte füllen Sie alle markierten Felder aus.',
			'evalMsgInteger'			: 'Geben Sie eine gültige Zahl ein',
			'evalMsgRepeat'			: 'Die wiederholte Eingabe stimmt leider nicht mit der ersten überein',
			// ajax
			'errorMessageAjaxRequest' : 'Bei der Verarbeitung Ihrer Anfrage ist leider ein Fehler aufgetreten. Bitte versuchen Sie es erneut.'
		}
	};
	
	$.enet.l18n = function (k) {
		if(typeof($.enet.lll[$.enet.locale][k]) == 'string') {
			return $.enet.lll[$.enet.locale][k];
		} else {
			return '';	
		}
	}



/**************
* ENRICH USEREXPERIENCE
***************/
	// prepare popup containers
	$('body').append('<div id="overlayContainer"></div>');
	var $overlay = $('#overlayContainer'),
		$overlayContent=null,
		$lightBox = $('<div id="lightbox"><div class="navItems"><a class="prev" title="'+$.enet.l18n('showPrevImage')+'"><strong><dfn title="'+$.enet.l18n('showPrevImage')+'">&lt</dfn></strong></a><a class="next" title="'+$.enet.l18n('showNextImage')+'"><strong><dfn title="'+$.enet.l18n('showNextImage')+'">&gt;</dfn></strong></a></div><div class="info"></div><div class="loader"></div></div>').hide();

	function createOverlayContainer() {
		$overlay.append('<div class="contentContainer"/>'),
		$overlayContent = $overlay.find('.contentContainer').hide();	
	}
	function removeOverlayContainer() {
		$overlayContent.trigger('unload').unbind().remove();
	}

	// gallery/lightbox container
	$('body').append($lightBox);

	// add extra functionality to the content
	$.enet.enrichContent('body');
	// mediaPlayer
	$.enet.addMediaPlayer($('#content'));

/**************
* NAVIGATION
***************/

	// animate main Navi
	var $nav = $('#mainMenu ul');
	if ($nav.length) {
		var navT, cur;
		$nav.children().each(function() {
			var $t = $(this), $i = $t, $m = $t.children('ul');
			if ($m.length) {
				$t.addClass('hasSub').hover(
					function() {
						if (typeof(cur) == 'object' && cur != $t) {
							cur.removeClass('hover').children('ul,span').stop(true,true).slideUp(0);
						}
						if (typeof(navT) != 'undefined') {
							clearTimeout(navT);
						}
						if (cur != $t) {
							cur = $t;
							$m.hide().css('opacity',null).slideDown();	
						}
						$t.addClass('hover');
					},
					function() {
						clearTimeout(navT);
						navT = setTimeout(function() {
							$m.stop(true,true).slideUp(function() {$t.removeClass('hover');});
							cur = false;
						},600);
					}
				);
			}
		});
	}

/**************
* LAYOUT OPTIMIZATIONS
***************/

	// call methods in onJQueryReady stack. The stack get's filled from inline JS or some other external scripts
	if(typeof(onJQueryReady) == 'object') {
		$(onJQueryReady).each(function() {
			this.fn.call(this.p);
		});
	}
});
