/*!
 * jQuery UI 1.8.5
 *
 * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI
 */
(function(c,j){function k(a){return!c(a).parents().andSelf().filter(function(){return c.curCSS(this,"visibility")==="hidden"||c.expr.filters.hidden(this)}).length}c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.5",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,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,WINDOWS:91}});c.fn.extend({_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d=this;setTimeout(function(){c(d).focus();b&&b.call(d)},a)}):this._focus.apply(this,arguments)},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(c.curCSS(this,
"position",1))&&/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?c(document):a},zIndex:function(a){if(a!==j)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position");
if(b==="absolute"||b==="relative"||b==="fixed"){b=parseInt(a.css("zIndex"));if(!isNaN(b)&&b!=0)return b}a=a.parent()}}return 0},disableSelection:function(){return this.bind("mousedown.ui-disableSelection selectstart.ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});c.each(["Width","Height"],function(a,b){function d(f,g,l,m){c.each(e,function(){g-=parseFloat(c.curCSS(f,"padding"+this,true))||0;if(l)g-=parseFloat(c.curCSS(f,
"border"+this+"Width",true))||0;if(m)g-=parseFloat(c.curCSS(f,"margin"+this,true))||0});return g}var e=b==="Width"?["Left","Right"]:["Top","Bottom"],h=b.toLowerCase(),i={innerWidth:c.fn.innerWidth,innerHeight:c.fn.innerHeight,outerWidth:c.fn.outerWidth,outerHeight:c.fn.outerHeight};c.fn["inner"+b]=function(f){if(f===j)return i["inner"+b].call(this);return this.each(function(){c.style(this,h,d(this,f)+"px")})};c.fn["outer"+b]=function(f,g){if(typeof f!=="number")return i["outer"+b].call(this,f);return this.each(function(){c.style(this,
h,d(this,f,true,g)+"px")})}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){var b=a.nodeName.toLowerCase(),d=c.attr(a,"tabindex");if("area"===b){b=a.parentNode;d=b.name;if(!a.href||!d||b.nodeName.toLowerCase()!=="map")return false;a=c("img[usemap=#"+d+"]")[0];return!!a&&k(a)}return(/input|select|textarea|button|object/.test(b)?!a.disabled:"a"==b?a.href||!isNaN(d):!isNaN(d))&&k(a)},tabbable:function(a){var b=c.attr(a,"tabindex");return(isNaN(b)||b>=0)&&c(a).is(":focusable")}});
c(function(){var a=document.createElement("div"),b=document.body;c.extend(a.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});c.support.minHeight=b.appendChild(a).offsetHeight===100;b.removeChild(a).style.display="none"});c.extend(c.ui,{plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&&a.element[0].parentNode)for(var e=0;e<b.length;e++)a.options[b[e][0]]&&b[e][1].apply(a.element,
d)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(a,b){if(c(a).css("overflow")==="hidden")return false;b=b&&b==="left"?"scrollLeft":"scrollTop";var d=false;if(a[b]>0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a<b+d},isOver:function(a,b,d,e,h,i){return c.ui.isOverAxis(a,d,h)&&c.ui.isOverAxis(b,e,i)}})}})(jQuery);
;/*!
 * jQuery UI Widget 1.8.5
 *
 * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Widget
 */
(function(b,j){if(b.cleanData){var k=b.cleanData;b.cleanData=function(a){for(var c=0,d;(d=a[c])!=null;c++)b(d).triggerHandler("remove");k(a)}}else{var l=b.fn.remove;b.fn.remove=function(a,c){return this.each(function(){if(!c)if(!a||b.filter(a,[this]).length)b("*",this).add([this]).each(function(){b(this).triggerHandler("remove")});return l.call(b(this),a,c)})}}b.widget=function(a,c,d){var e=a.split(".")[0],f;a=a.split(".")[1];f=e+"-"+a;if(!d){d=c;c=b.Widget}b.expr[":"][f]=function(h){return!!b.data(h,
a)};b[e]=b[e]||{};b[e][a]=function(h,g){arguments.length&&this._createWidget(h,g)};c=new c;c.options=b.extend(true,{},c.options);b[e][a].prototype=b.extend(true,c,{namespace:e,widgetName:a,widgetEventPrefix:b[e][a].prototype.widgetEventPrefix||a,widgetBaseClass:f},d);b.widget.bridge(a,b[e][a])};b.widget.bridge=function(a,c){b.fn[a]=function(d){var e=typeof d==="string",f=Array.prototype.slice.call(arguments,1),h=this;d=!e&&f.length?b.extend.apply(null,[true,d].concat(f)):d;if(e&&d.substring(0,1)===
"_")return h;e?this.each(function(){var g=b.data(this,a);if(!g)throw"cannot call methods on "+a+" prior to initialization; attempted to call method '"+d+"'";if(!b.isFunction(g[d]))throw"no such method '"+d+"' for "+a+" widget instance";var i=g[d].apply(g,f);if(i!==g&&i!==j){h=i;return false}}):this.each(function(){var g=b.data(this,a);g?g.option(d||{})._init():b.data(this,a,new c(d,this))});return h}};b.Widget=function(a,c){arguments.length&&this._createWidget(a,c)};b.Widget.prototype={widgetName:"widget",
widgetEventPrefix:"",options:{disabled:false},_createWidget:function(a,c){b.data(c,this.widgetName,this);this.element=b(c);this.options=b.extend(true,{},this.options,b.metadata&&b.metadata.get(c)[this.widgetName],a);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()});this._create();this._init()},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+
"-disabled ui-state-disabled")},widget:function(){return this.element},option:function(a,c){var d=a,e=this;if(arguments.length===0)return b.extend({},e.options);if(typeof a==="string"){if(c===j)return this.options[a];d={};d[a]=c}b.each(d,function(f,h){e._setOption(f,h)});return e},_setOption:function(a,c){this.options[a]=c;if(a==="disabled")this.widget()[c?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",c);return this},enable:function(){return this._setOption("disabled",
false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(a,c,d){var e=this.options[a];c=b.Event(c);c.type=(a===this.widgetEventPrefix?a:this.widgetEventPrefix+a).toLowerCase();d=d||{};if(c.originalEvent){a=b.event.props.length;for(var f;a;){f=b.event.props[--a];c[f]=c.originalEvent[f]}}this.element.trigger(c,d);return!(b.isFunction(e)&&e.call(this.element[0],c,d)===false||c.isDefaultPrevented())}}})(jQuery);
;/*
 * jQuery UI Accordion 1.8.5
 *
 * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Accordion
 *
 * Depends:
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 */
(function(c){c.widget("ui.accordion",{options:{active:0,animated:"slide",autoHeight:true,clearStyle:false,collapsible:false,event:"click",fillSpace:false,header:"> li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:false,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}},_create:function(){var a=this,b=a.options;a.running=0;a.element.addClass("ui-accordion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix");
a.headers=a.element.find(b.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){b.disabled||c(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){b.disabled||c(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){b.disabled||c(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){b.disabled||c(this).removeClass("ui-state-focus")});a.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");
if(b.navigation){var d=a.element.find("a").filter(b.navigationFilter).eq(0);if(d.length){var f=d.closest(".ui-accordion-header");a.active=f.length?f:d.closest(".ui-accordion-content").prev()}}a.active=a._findActive(a.active||b.active).addClass("ui-state-default ui-state-active").toggleClass("ui-corner-all ui-corner-top");a.active.next().addClass("ui-accordion-content-active");a._createIcons();a.resize();a.element.attr("role","tablist");a.headers.attr("role","tab").bind("keydown.accordion",function(g){return a._keydown(g)}).next().attr("role",
"tabpanel");a.headers.not(a.active||"").attr({"aria-expanded":"false",tabIndex:-1}).next().hide();a.active.length?a.active.attr({"aria-expanded":"true",tabIndex:0}):a.headers.eq(0).attr("tabIndex",0);c.browser.safari||a.headers.find("a").attr("tabIndex",-1);b.event&&a.headers.bind(b.event.split(" ").join(".accordion ")+".accordion",function(g){a._clickHandler.call(a,g,this);g.preventDefault()})},_createIcons:function(){var a=this.options;if(a.icons){c("<span></span>").addClass("ui-icon "+a.icons.header).prependTo(this.headers);
this.active.children(".ui-icon").toggleClass(a.icons.header).toggleClass(a.icons.headerSelected);this.element.addClass("ui-accordion-icons")}},_destroyIcons:function(){this.headers.children(".ui-icon").remove();this.element.removeClass("ui-accordion-icons")},destroy:function(){var a=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role");this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("tabIndex");
this.headers.find("a").removeAttr("tabIndex");this._destroyIcons();var b=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled");if(a.autoHeight||a.fillHeight)b.css("height","");return c.Widget.prototype.destroy.call(this)},_setOption:function(a,b){c.Widget.prototype._setOption.apply(this,arguments);a=="active"&&this.activate(b);if(a=="icons"){this._destroyIcons();
b&&this._createIcons()}if(a=="disabled")this.headers.add(this.headers.next())[b?"addClass":"removeClass"]("ui-accordion-disabled ui-state-disabled")},_keydown:function(a){if(!(this.options.disabled||a.altKey||a.ctrlKey)){var b=c.ui.keyCode,d=this.headers.length,f=this.headers.index(a.target),g=false;switch(a.keyCode){case b.RIGHT:case b.DOWN:g=this.headers[(f+1)%d];break;case b.LEFT:case b.UP:g=this.headers[(f-1+d)%d];break;case b.SPACE:case b.ENTER:this._clickHandler({target:a.target},a.target);
a.preventDefault()}if(g){c(a.target).attr("tabIndex",-1);c(g).attr("tabIndex",0);g.focus();return false}return true}},resize:function(){var a=this.options,b;if(a.fillSpace){if(c.browser.msie){var d=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}b=this.element.parent().height();c.browser.msie&&this.element.parent().css("overflow",d);this.headers.each(function(){b-=c(this).outerHeight(true)});this.headers.next().each(function(){c(this).height(Math.max(0,b-c(this).innerHeight()+
c(this).height()))}).css("overflow","auto")}else if(a.autoHeight){b=0;this.headers.next().each(function(){b=Math.max(b,c(this).height("").height())}).height(b)}return this},activate:function(a){this.options.active=a;a=this._findActive(a)[0];this._clickHandler({target:a},a);return this},_findActive:function(a){return a?typeof a==="number"?this.headers.filter(":eq("+a+")"):this.headers.not(this.headers.not(a)):a===false?c([]):this.headers.filter(":eq(0)")},_clickHandler:function(a,b){var d=this.options;
if(!d.disabled)if(a.target){a=c(a.currentTarget||b);b=a[0]===this.active[0];d.active=d.collapsible&&b?false:this.headers.index(a);if(!(this.running||!d.collapsible&&b)){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);if(!b){a.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").children(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected);
a.next().addClass("ui-accordion-content-active")}h=a.next();f=this.active.next();g={options:d,newHeader:b&&d.collapsible?c([]):a,oldHeader:this.active,newContent:b&&d.collapsible?c([]):h,oldContent:f};d=this.headers.index(this.active[0])>this.headers.index(a[0]);this.active=b?c([]):a;this._toggle(h,f,g,b,d)}}else if(d.collapsible){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);
this.active.next().addClass("ui-accordion-content-active");var f=this.active.next(),g={options:d,newHeader:c([]),oldHeader:d.active,newContent:c([]),oldContent:f},h=this.active=c([]);this._toggle(h,f,g)}},_toggle:function(a,b,d,f,g){var h=this,e=h.options;h.toShow=a;h.toHide=b;h.data=d;var j=function(){if(h)return h._completed.apply(h,arguments)};h._trigger("changestart",null,h.data);h.running=b.size()===0?a.size():b.size();if(e.animated){d={};d=e.collapsible&&f?{toShow:c([]),toHide:b,complete:j,
down:g,autoHeight:e.autoHeight||e.fillSpace}:{toShow:a,toHide:b,complete:j,down:g,autoHeight:e.autoHeight||e.fillSpace};if(!e.proxied)e.proxied=e.animated;if(!e.proxiedDuration)e.proxiedDuration=e.duration;e.animated=c.isFunction(e.proxied)?e.proxied(d):e.proxied;e.duration=c.isFunction(e.proxiedDuration)?e.proxiedDuration(d):e.proxiedDuration;f=c.ui.accordion.animations;var i=e.duration,k=e.animated;if(k&&!f[k]&&!c.easing[k])k="slide";f[k]||(f[k]=function(l){this.slide(l,{easing:k,duration:i||700})});
f[k](d)}else{if(e.collapsible&&f)a.toggle();else{b.hide();a.show()}j(true)}b.prev().attr({"aria-expanded":"false",tabIndex:-1}).blur();a.prev().attr({"aria-expanded":"true",tabIndex:0}).focus()},_completed:function(a){this.running=a?0:--this.running;if(!this.running){this.options.clearStyle&&this.toShow.add(this.toHide).css({height:"",overflow:""});this.toHide.removeClass("ui-accordion-content-active");this._trigger("change",null,this.data)}}});c.extend(c.ui.accordion,{version:"1.8.5",animations:{slide:function(a,
b){a=c.extend({easing:"swing",duration:300},a,b);if(a.toHide.size())if(a.toShow.size()){var d=a.toShow.css("overflow"),f=0,g={},h={},e;b=a.toShow;e=b[0].style.width;b.width(parseInt(b.parent().width(),10)-parseInt(b.css("paddingLeft"),10)-parseInt(b.css("paddingRight"),10)-(parseInt(b.css("borderLeftWidth"),10)||0)-(parseInt(b.css("borderRightWidth"),10)||0));c.each(["height","paddingTop","paddingBottom"],function(j,i){h[i]="hide";j=(""+c.css(a.toShow[0],i)).match(/^([\d+-.]+)(.*)$/);g[i]={value:j[1],
unit:j[2]||"px"}});a.toShow.css({height:0,overflow:"hidden"}).show();a.toHide.filter(":hidden").each(a.complete).end().filter(":visible").animate(h,{step:function(j,i){if(i.prop=="height")f=i.end-i.start===0?0:(i.now-i.start)/(i.end-i.start);a.toShow[0].style[i.prop]=f*g[i.prop].value+g[i.prop].unit},duration:a.duration,easing:a.easing,complete:function(){a.autoHeight||a.toShow.css("height","");a.toShow.css({width:e,overflow:d});a.complete()}})}else a.toHide.animate({height:"hide",paddingTop:"hide",
paddingBottom:"hide"},a);else a.toShow.animate({height:"show",paddingTop:"show",paddingBottom:"show"},a)},bounceslide:function(a){this.slide(a,{easing:a.down?"easeOutBounce":"swing",duration:a.down?1E3:200})}}})})(jQuery);
;



/*
 * FancyBox - jQuery Plugin
 * Simple and fancy lightbox alternative
 *
 * Examples and documentation at: http://fancybox.net
 * 
 * Copyright (c) 2008 - 2010 Janis Skarnelis
 *
 * Version: 1.3.1 (05/03/2010)
 * Requires: jQuery v1.3+
 *
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 */

(function(b){var m,u,x,g,D,i,z,A,B,p=0,e={},q=[],n=0,c={},j=[],E=null,s=new Image,G=/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,S=/[^\.]\.(swf)\s*$/i,H,I=1,k,l,h=false,y=b.extend(b("<div/>")[0],{prop:0}),v=0,O=!b.support.opacity&&!window.XMLHttpRequest,J=function(){u.hide();s.onerror=s.onload=null;E&&E.abort();m.empty()},P=function(){b.fancybox('<p id="fancybox_error">The requested content cannot be loaded.<br />Please try again later.</p>',{scrolling:"no",padding:20,transitionIn:"none",transitionOut:"none"})},
K=function(){return[b(window).width(),b(window).height(),b(document).scrollLeft(),b(document).scrollTop()]},T=function(){var a=K(),d={},f=c.margin,o=c.autoScale,t=(20+f)*2,w=(20+f)*2,r=c.padding*2;if(c.width.toString().indexOf("%")>-1){d.width=a[0]*parseFloat(c.width)/100-40;o=false}else d.width=c.width+r;if(c.height.toString().indexOf("%")>-1){d.height=a[1]*parseFloat(c.height)/100-40;o=false}else d.height=c.height+r;if(o&&(d.width>a[0]-t||d.height>a[1]-w))if(e.type=="image"||e.type=="swf"){t+=r;
w+=r;o=Math.min(Math.min(a[0]-t,c.width)/c.width,Math.min(a[1]-w,c.height)/c.height);d.width=Math.round(o*(d.width-r))+r;d.height=Math.round(o*(d.height-r))+r}else{d.width=Math.min(d.width,a[0]-t);d.height=Math.min(d.height,a[1]-w)}d.top=a[3]+(a[1]-(d.height+40))*0.5;d.left=a[2]+(a[0]-(d.width+40))*0.5;if(c.autoScale===false){d.top=Math.max(a[3]+f,d.top);d.left=Math.max(a[2]+f,d.left)}return d},U=function(a){if(a&&a.length)switch(c.titlePosition){case "inside":return a;case "over":return'<span id="fancybox-title-over">'+
a+"</span>";default:return'<span id="fancybox-title-wrap"><span id="fancybox-title-left"></span><span id="fancybox-title-main">'+a+'</span><span id="fancybox-title-right"></span></span>'}return false},V=function(){var a=c.title,d=l.width-c.padding*2,f="fancybox-title-"+c.titlePosition;b("#fancybox-title").remove();v=0;if(c.titleShow!==false){a=b.isFunction(c.titleFormat)?c.titleFormat(a,j,n,c):U(a);if(!(!a||a==="")){b('<div id="fancybox-title" class="'+f+'" />').css({width:d,paddingLeft:c.padding,
paddingRight:c.padding}).html(a).appendTo("body");switch(c.titlePosition){case "inside":v=b("#fancybox-title").outerHeight(true)-c.padding;l.height+=v;break;case "over":b("#fancybox-title").css("bottom",c.padding);break;default:b("#fancybox-title").css("bottom",b("#fancybox-title").outerHeight(true)*-1);break}b("#fancybox-title").appendTo(D).hide()}}},W=function(){b(document).unbind("keydown.fb").bind("keydown.fb",function(a){if(a.keyCode==27&&c.enableEscapeButton){a.preventDefault();b.fancybox.close()}else if(a.keyCode==
37){a.preventDefault();b.fancybox.prev()}else if(a.keyCode==39){a.preventDefault();b.fancybox.next()}});if(b.fn.mousewheel){g.unbind("mousewheel.fb");j.length>1&&g.bind("mousewheel.fb",function(a,d){a.preventDefault();h||d===0||(d>0?b.fancybox.prev():b.fancybox.next())})}if(c.showNavArrows){if(c.cyclic&&j.length>1||n!==0)A.show();if(c.cyclic&&j.length>1||n!=j.length-1)B.show()}},X=function(){var a,d;if(j.length-1>n){a=j[n+1].href;if(typeof a!=="undefined"&&a.match(G)){d=new Image;d.src=a}}if(n>0){a=
j[n-1].href;if(typeof a!=="undefined"&&a.match(G)){d=new Image;d.src=a}}},L=function(){i.css("overflow",c.scrolling=="auto"?c.type=="image"||c.type=="iframe"||c.type=="swf"?"hidden":"auto":c.scrolling=="yes"?"auto":"visible");if(!b.support.opacity){i.get(0).style.removeAttribute("filter");g.get(0).style.removeAttribute("filter")}b("#fancybox-title").show();c.hideOnContentClick&&i.one("click",b.fancybox.close);c.hideOnOverlayClick&&x.one("click",b.fancybox.close);c.showCloseButton&&z.show();W();b(window).bind("resize.fb",
b.fancybox.center);c.centerOnScroll?b(window).bind("scroll.fb",b.fancybox.center):b(window).unbind("scroll.fb");b.isFunction(c.onComplete)&&c.onComplete(j,n,c);h=false;X()},M=function(a){var d=Math.round(k.width+(l.width-k.width)*a),f=Math.round(k.height+(l.height-k.height)*a),o=Math.round(k.top+(l.top-k.top)*a),t=Math.round(k.left+(l.left-k.left)*a);g.css({width:d+"px",height:f+"px",top:o+"px",left:t+"px"});d=Math.max(d-c.padding*2,0);f=Math.max(f-(c.padding*2+v*a),0);i.css({width:d+"px",height:f+
"px"});if(typeof l.opacity!=="undefined")g.css("opacity",a<0.5?0.5:a)},Y=function(a){var d=a.offset();d.top+=parseFloat(a.css("paddingTop"))||0;d.left+=parseFloat(a.css("paddingLeft"))||0;d.top+=parseFloat(a.css("border-top-width"))||0;d.left+=parseFloat(a.css("border-left-width"))||0;d.width=a.width();d.height=a.height();return d},Q=function(){var a=e.orig?b(e.orig):false,d={};if(a&&a.length){a=Y(a);d={width:a.width+c.padding*2,height:a.height+c.padding*2,top:a.top-c.padding-20,left:a.left-c.padding-
20}}else{a=K();d={width:1,height:1,top:a[3]+a[1]*0.5,left:a[2]+a[0]*0.5}}return d},N=function(){u.hide();if(g.is(":visible")&&b.isFunction(c.onCleanup))if(c.onCleanup(j,n,c)===false){b.event.trigger("fancybox-cancel");h=false;return}j=q;n=p;c=e;i.get(0).scrollTop=0;i.get(0).scrollLeft=0;if(c.overlayShow){O&&b("select:not(#fancybox-tmp select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one("fancybox-cleanup",function(){this.style.visibility="inherit"});
x.css({"background-color":c.overlayColor,opacity:c.overlayOpacity}).unbind().show()}l=T();V();if(g.is(":visible")){b(z.add(A).add(B)).hide();var a=g.position(),d;k={top:a.top,left:a.left,width:g.width(),height:g.height()};d=k.width==l.width&&k.height==l.height;i.fadeOut(c.changeFade,function(){var f=function(){i.html(m.contents()).fadeIn(c.changeFade,L)};b.event.trigger("fancybox-change");i.empty().css("overflow","hidden");if(d){i.css({top:c.padding,left:c.padding,width:Math.max(l.width-c.padding*
2,1),height:Math.max(l.height-c.padding*2-v,1)});f()}else{i.css({top:c.padding,left:c.padding,width:Math.max(k.width-c.padding*2,1),height:Math.max(k.height-c.padding*2,1)});y.prop=0;b(y).animate({prop:1},{duration:c.changeSpeed,easing:c.easingChange,step:M,complete:f})}})}else{g.css("opacity",1);if(c.transitionIn=="elastic"){k=Q();i.css({top:c.padding,left:c.padding,width:Math.max(k.width-c.padding*2,1),height:Math.max(k.height-c.padding*2,1)}).html(m.contents());g.css(k).show();if(c.opacity)l.opacity=
0;y.prop=0;b(y).animate({prop:1},{duration:c.speedIn,easing:c.easingIn,step:M,complete:L})}else{i.css({top:c.padding,left:c.padding,width:Math.max(l.width-c.padding*2,1),height:Math.max(l.height-c.padding*2-v,1)}).html(m.contents());g.css(l).fadeIn(c.transitionIn=="none"?0:c.speedIn,L)}}},F=function(){m.width(e.width);m.height(e.height);if(e.width=="auto")e.width=m.width();if(e.height=="auto")e.height=m.height();N()},Z=function(){h=true;e.width=s.width;e.height=s.height;b("<img />").attr({id:"fancybox-img",
src:s.src,alt:e.title}).appendTo(m);N()},C=function(){J();var a=q[p],d,f,o,t,w;e=b.extend({},b.fn.fancybox.defaults,typeof b(a).data("fancybox")=="undefined"?e:b(a).data("fancybox"));o=a.title||b(a).title||e.title||"";if(a.nodeName&&!e.orig)e.orig=b(a).children("img:first").length?b(a).children("img:first"):b(a);if(o===""&&e.orig)o=e.orig.attr("alt");d=a.nodeName&&/^(?:javascript|#)/i.test(a.href)?e.href||null:e.href||a.href||null;if(e.type){f=e.type;if(!d)d=e.content}else if(e.content)f="html";else if(d)if(d.match(G))f=
"image";else if(d.match(S))f="swf";else if(b(a).hasClass("iframe"))f="iframe";else if(d.match(/#/)){a=d.substr(d.indexOf("#"));f=b(a).length>0?"inline":"ajax"}else f="ajax";else f="inline";e.type=f;e.href=d;e.title=o;if(e.autoDimensions&&e.type!=="iframe"&&e.type!=="swf"){e.width="auto";e.height="auto"}if(e.modal){e.overlayShow=true;e.hideOnOverlayClick=false;e.hideOnContentClick=false;e.enableEscapeButton=false;e.showCloseButton=false}if(b.isFunction(e.onStart))if(e.onStart(q,p,e)===false){h=false;
return}m.css("padding",20+e.padding+e.margin);b(".fancybox-inline-tmp").unbind("fancybox-cancel").bind("fancybox-change",function(){b(this).replaceWith(i.children())});switch(f){case "html":m.html(e.content);F();break;case "inline":b('<div class="fancybox-inline-tmp" />').hide().insertBefore(b(a)).bind("fancybox-cleanup",function(){b(this).replaceWith(i.children())}).bind("fancybox-cancel",function(){b(this).replaceWith(m.children())});b(a).appendTo(m);F();break;case "image":h=false;b.fancybox.showActivity();
s=new Image;s.onerror=function(){P()};s.onload=function(){s.onerror=null;s.onload=null;Z()};s.src=d;break;case "swf":t='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+e.width+'" height="'+e.height+'"><param name="movie" value="'+d+'"></param>';w="";b.each(e.swf,function(r,R){t+='<param name="'+r+'" value="'+R+'"></param>';w+=" "+r+'="'+R+'"'});t+='<embed src="'+d+'" type="application/x-shockwave-flash" width="'+e.width+'" height="'+e.height+'"'+w+"></embed></object>";m.html(t);
F();break;case "ajax":a=d.split("#",2);f=e.ajax.data||{};if(a.length>1){d=a[0];if(typeof f=="string")f+="&selector="+a[1];else f.selector=a[1]}h=false;b.fancybox.showActivity();E=b.ajax(b.extend(e.ajax,{url:d,data:f,error:P,success:function(r){if(E.status==200){m.html(r);F()}}}));break;case "iframe":b('<iframe id="fancybox-frame" name="fancybox-frame'+(new Date).getTime()+'" frameborder="0" hspace="0" scrolling="'+e.scrolling+'" src="'+e.href+'"></iframe>').appendTo(m);N();break}},$=function(){if(u.is(":visible")){b("div",
u).css("top",I*-40+"px");I=(I+1)%12}else clearInterval(H)},aa=function(){if(!b("#fancybox-wrap").length){b("body").append(m=b('<div id="fancybox-tmp"></div>'),u=b('<div id="fancybox-loading"><div></div></div>'),x=b('<div id="fancybox-overlay"></div>'),g=b('<div id="fancybox-wrap"></div>'));if(!b.support.opacity){g.addClass("fancybox-ie");u.addClass("fancybox-ie")}D=b('<div id="fancybox-outer"></div>').append('<div class="fancy-bg" id="fancy-bg-n"></div><div class="fancy-bg" id="fancy-bg-ne"></div><div class="fancy-bg" id="fancy-bg-e"></div><div class="fancy-bg" id="fancy-bg-se"></div><div class="fancy-bg" id="fancy-bg-s"></div><div class="fancy-bg" id="fancy-bg-sw"></div><div class="fancy-bg" id="fancy-bg-w"></div><div class="fancy-bg" id="fancy-bg-nw"></div>').appendTo(g);
D.append(i=b('<div id="fancybox-inner"></div>'),z=b('<a id="fancybox-close"></a>'),A=b('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),B=b('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>'));z.click(b.fancybox.close);u.click(b.fancybox.cancel);A.click(function(a){a.preventDefault();b.fancybox.prev()});B.click(function(a){a.preventDefault();b.fancybox.next()});if(O){x.get(0).style.setExpression("height",
"document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px'");u.get(0).style.setExpression("top","(-20 + (document.documentElement.clientHeight ? document.documentElement.clientHeight/2 : document.body.clientHeight/2 ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop )) + 'px'");D.prepend('<iframe id="fancybox-hide-sel-frame" src="javascript:\'\';" scrolling="no" frameborder="0" ></iframe>')}}};
b.fn.fancybox=function(a){b(this).data("fancybox",b.extend({},a,b.metadata?b(this).metadata():{})).unbind("click.fb").bind("click.fb",function(d){d.preventDefault();if(!h){h=true;b(this).blur();q=[];p=0;d=b(this).attr("rel")||"";if(!d||d==""||d==="nofollow")q.push(this);else{q=b("a[rel="+d+"], area[rel="+d+"]");p=q.index(this)}C();return false}});return this};b.fancybox=function(a,d){if(!h){h=true;d=typeof d!=="undefined"?d:{};q=[];p=d.index||0;if(b.isArray(a)){for(var f=0,o=a.length;f<o;f++)if(typeof a[f]==
"object")b(a[f]).data("fancybox",b.extend({},d,a[f]));else a[f]=b({}).data("fancybox",b.extend({content:a[f]},d));q=jQuery.merge(q,a)}else{if(typeof a=="object")b(a).data("fancybox",b.extend({},d,a));else a=b({}).data("fancybox",b.extend({content:a},d));q.push(a)}if(p>q.length||p<0)p=0;C()}};b.fancybox.showActivity=function(){clearInterval(H);u.show();H=setInterval($,66)};b.fancybox.hideActivity=function(){u.hide()};b.fancybox.next=function(){return b.fancybox.pos(n+1)};b.fancybox.prev=function(){return b.fancybox.pos(n-
1)};b.fancybox.pos=function(a){if(!h){a=parseInt(a,10);if(a>-1&&j.length>a){p=a;C()}if(c.cyclic&&j.length>1&&a<0){p=j.length-1;C()}if(c.cyclic&&j.length>1&&a>=j.length){p=0;C()}}};b.fancybox.cancel=function(){if(!h){h=true;b.event.trigger("fancybox-cancel");J();e&&b.isFunction(e.onCancel)&&e.onCancel(q,p,e);h=false}};b.fancybox.close=function(){function a(){x.fadeOut("fast");g.hide();b.event.trigger("fancybox-cleanup");i.empty();b.isFunction(c.onClosed)&&c.onClosed(j,n,c);j=e=[];n=p=0;c=e={};h=false}
if(!(h||g.is(":hidden"))){h=true;if(c&&b.isFunction(c.onCleanup))if(c.onCleanup(j,n,c)===false){h=false;return}J();b(z.add(A).add(B)).hide();b("#fancybox-title").remove();g.add(i).add(x).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");i.css("overflow","hidden");if(c.transitionOut=="elastic"){k=Q();var d=g.position();l={top:d.top,left:d.left,width:g.width(),height:g.height()};if(c.opacity)l.opacity=1;y.prop=1;b(y).animate({prop:0},{duration:c.speedOut,easing:c.easingOut,
step:M,complete:a})}else g.fadeOut(c.transitionOut=="none"?0:c.speedOut,a)}};b.fancybox.resize=function(){var a,d;if(!(h||g.is(":hidden"))){h=true;a=i.wrapInner("<div style='overflow:auto'></div>").children();d=a.height();g.css({height:d+c.padding*2+v});i.css({height:d});a.replaceWith(a.children());b.fancybox.center()}};b.fancybox.center=function(){h=true;var a=K(),d=c.margin,f={};f.top=a[3]+(a[1]-(g.height()-v+40))*0.5;f.left=a[2]+(a[0]-(g.width()+40))*0.5;f.top=Math.max(a[3]+d,f.top);f.left=Math.max(a[2]+
d,f.left);g.css(f);h=false};b.fn.fancybox.defaults={padding:10,margin:20,opacity:false,modal:false,cyclic:false,scrolling:"auto",width:560,height:340,autoScale:true,autoDimensions:true,centerOnScroll:false,ajax:{},swf:{wmode:"transparent"},hideOnOverlayClick:true,hideOnContentClick:false,overlayShow:true,overlayOpacity:0.3,overlayColor:"#666",titleShow:true,titlePosition:"outside",titleFormat:null,transitionIn:"fade",transitionOut:"fade",speedIn:300,speedOut:300,changeSpeed:300,changeFade:"fast",
easingIn:"swing",easingOut:"swing",showCloseButton:true,showNavArrows:true,enableEscapeButton:true,onStart:null,onCancel:null,onComplete:null,onCleanup:null,onClosed:null};b(document).ready(function(){aa()})})(jQuery);



/* * * * * * * * * * * * * * * * * * *
 *
 * toiSlider v2.0
 * --------------
 * Simpler Slider mit Controls fÃ¼r 
 * Prev/Next und auto-play.
 * 
 * Copyright (c) 2010 - 2011
 * by Martin Vennemann
 *
 * Version: 1.2.1 (20/02/2011)
 * Requires: jQuery v1.3+
 *
 */ 
(function( $ ){

	var methods = {
		/* * *
		* Methode zum vollständigen Stoppen des Sliders
		*/
		kill : function( options ) {
			return this.each(function() {
				
				var opts = $.extend({}, $.fn.toiSlider.defaults, options);
				
				$(this).find(opts.boxClass).each(function() {
					$(this).stop(true, false);
					$(this).find(opts.overlayClass).stop(true, false);
				});
				
				$(opts.slideNavi).stop();
				$(opts.slideNavi).find(opts.slideNaviElement).each(function() {
					$(this).stop(true, false);
				});
				$('#slideNaviInner').empty().remove();
				
				$(this).stop().unbind();
				
				$('.slideOverlay').each(function() {
					$(this).stop(true, false);
				});
				$('#slideOverlays').empty().remove();
				
				$(this).empty().remove();
				$('#slideNaviLeft, #slideNaviRight').unbind().remove();
			});
		},
		
		
		/* * *
		* Methode zum Starten des Sliders
		*/
    	init : function( options ) { 
			return this.each(function(){
			
				var opts = $.extend({}, $.fn.toiSlider.defaults, options);
				var _this = {
					selector   : $(this),
					current    : 0,
					previous   : 0,
					slides     : new Array(),
					baseZ      : 10,
					add        : true,
					autoPlay   : true,
					stopped    : false,
					slideNavi  : '#slideNavi',
					naviWidth  : 0,
					naviEWidth : 0,
					navis      : new Array(),
					overlays   : new Array(),
					useOverlay : false,
					lastOverlay: 0,
					lazySource : new Array(),
					lazyImages : new Array(),
					isLoading  : false
				}
				if(opts.showControls) {
					_this.selector.append('<div class="slideControl prev">&lt;</div><div class="slideControl next">&gt;</div>');
				
					var controlVis  = false;
					var controlAnim = false;				
					var prevButton  = {
						obj     : _this.selector.find('.prev'),
						hasAnim : false,
						active  : false
					}			
					var nextButton  = {
						obj     : _this.selector.find('.next'),
						hasAnim : false,
						active  : false
					}
				}
				
				initialize();
				
				
				
				/* * *
				 * Vorbereitungen / Einstellungen
				 *
				 * Events initialisieren, Slides in Array ablegen, 
				 * alle Slides bis auf ersten ausblenden
				 */
				function initialize() {
					
					_this.slides = new Array();
					
					if($(opts.overlayClass).length > 0) {
						$('body').append('<div id="slideOverlays" />');
						$(opts.overlayClass).each(function() {
							$('#slideOverlays').append($(this));
							_this.overlays.push($(this));
						});
						
						_this.overlays[0].css('right', '0');
						_this.useOverlay  = true;
						_this.lastOverlay = 0;
					}
					
					if(_this.slideNavi) {
						
						var navCount = 0;
						var slideNaviWidth = 0;
						
						$(_this.slideNavi).parent().show();
						
						if(opts.showPlayStop) {
							$(_this.slideNavi).parent().append('<div id="slideNaviControl"><span id="slideCountInfo" /><span id="slideStopper">Pause</span></div>');
							_this.stopButton = $('#slideStopper');
							_this.naviInfo = $('#slideCountInfo');
						}
						
						$(_this.slideNavi).append('<div id="slideNaviInner" />');
						$(_this.slideNavi).parent().append('<div id="slideNaviLeft" /><div id="slideNaviRight" />');
						$(_this.selector).find('.prevImage').each(function() {
						    $('#slideNaviInner').append($(this).clone());
						});
						
						$(_this.selector).find('.prevImage').remove();
						$(_this.slideNavi).show();
						
						$(_this.slideNavi).find('.prevImage').each(function() {
							$(this).data('idx', navCount);
							_this.navis.push($(this));
							slideNaviWidth += ($(this).width() + 10);
							navCount++;
						});
						
						_this.naviWidth  = $(_this.slideNavi).width();
						_this.naviEWidth = $('.prevImage').width();
						
						$('#slideNaviInner').width(slideNaviWidth);
						
						initPrevImageNavi();
						$(_this.slideNavi).find('.prevImage:first').addClass('act');
					}
					
					if(opts.useLazyLoad) {
						createImageArray(opts.lazyLoadResource);
						loadImg = new Image();
						$(loadImg).load(function() {
							_this.lazyImages.push($(this).attr('src'));
							$(this).hide();
							$(this).wrap('<div class="mainImage"></div>');
							$(this).parent().append('<div class="slideOverlay"></div>');
							$(_this.selector).append($(this).parent());							
							_this.slides.push($(this).parent());
							
							setTimeout( function() {	
								firstResize();							
								_this.slides[0].find('img').fadeIn();
							}, 500);
							
						}).error(function() {
							alert('ERROR: could not load image ' + _this.lazySource[0]);
						}).attr('src', _this.lazySource[0]);
					} else {
						setTimeout(firstResize, 500);
					}
					
					//console.log('init toislider…');
					if(opts.showControls) initUserEvents();
					if(opts.showPlayStop) initPlayStopEvents();
					
					referenceCount = (opts.useLazyLoad) ? _this.lazySource.length : _this.slides.length;
					_this.naviInfo.html('Bild 1 von ' + referenceCount);
				}
				
				
				/* * *
				* Dateinamen für lazyLoad in globalem Array ablegen
				*/
				function createImageArray(res) {
					$(res).each(function() {
						_this.lazySource.push($(this).html());
					});
				}
				
				
				/* * *
				* Fullscreen Resize
				*
				* Bild an die Fenstergröße anpassen
				*/
				function firstResize() {
									
					_this.selector.find(opts.boxClass).each(function() {
						_this.slides.push($(this));
						resizeBackground($(this).find('img'));
					});
					
					_this.previous = (_this.slides.length -1);
					
					var doResize;
	 				$(window).resize(function() {
	 					if(doResize !== false) {
     						clearTimeout(doResize);
	 						doResize = setTimeout(eachResize, 400);
	 					}		
	 				});
					
					start();
				}
				
				
				/* * *
				* Ersten Slide starten, alle anderen verbergen
				*/
				function start() {
					_this.selector.find(opts.boxClass + ':not(:first)').hide();
					_this.selector.find(opts.boxClass + ':first').css({display: 'block', opacity: 1}).animate({opacity: 1.0}, 2000, function() {
						switchOverlay(0);
					});
				}
				
				
				/* t.b.a. */
				function eachResize() {
					_this.selector.find(opts.boxClass).each(function() {
     					resizeBackground($(this).find('img'));
	 				});
				}
				
				
				/* * *
				 * Slide wechsel
				 *
				 * @idx = int (slide ID)
				 * Slide wird oben positioniert (z-index) und Ã¼ber
				 * opacity eingeblendet -> delay 5000.
				 */
				function switchBox(idx) {
					_this.baseZ++;
					
					if(opts.showPlayStop) {
						referenceCount = (opts.useLazyLoad) ? _this.lazySource.length : _this.slides.length;
						_this.naviInfo.html('Bild ' + (idx + 1) + ' von ' + referenceCount);
					}
					
					if(opts.showControls) $('.slideControl').css('z-index', _this.baseZ + 1);
					
					setTimeout(function () { resizeBackground(_this.slides[idx].find('img')) }, 200);
					if(_this.navis[idx].length > 0) _this.navis[idx].addClass('act');
					
					if(_this.slideNavi) setNaviPosition(idx);
					
					if(_this.autoPlay && !_this.stopped) {
						_this.slides[idx].find(opts.overlayClass).css(opts.transitionOverPos);
						_this.slides[idx].hide().css('z-index', _this.baseZ).css(opts.transitionSlidePos).show().animate(opts.transitionSlideIn, opts.transitionSpeed, function() {
							//$(this).find(opts.overlayClass).animate(opts.transitionOverIn, opts.transitionSpeed, function() {
								if(_this.useOverlay == true && _this.overlays[idx].find('h2').html() != '') {
									_this.overlays[idx].animate({right: 0}, 500);
									_this.lastOverlay = idx;
								}
							
								$(this).addClass('act');
								$(this).animate({opacity : 1}, opts.delay, function() {
									switchOverlay(idx);
								});	
							//});
						});
					}
				}
				
				
				/* * *
				 * Textbox wechsel, current Ãnderung
				 *
				 * @idx = int (slide ID)
				 * Text Overlay ein- ausblenden -> anschlieÃŸend
				 * Neustart Ã¼ber Aufruf von switchBox()
				 */
				function switchOverlay(idx) {
				
					if(_this.useOverlay == true) {
						_this.overlays[_this.lastOverlay].animate({right: '-400px'}, 500);
					}
				
					if(opts.useLazyLoad) {
						checkNext = (_this.lazySource[(idx + 1)] != '' && _this.lazySource[(idx + 1)] != undefined) ? idx + 1 : 0;
						if($.inArray(_this.lazySource[checkNext], _this.lazyImages) == -1) {
							preloadImage(_this.lazySource[checkNext], checkNext, false, false);
						}
					}
							
					_this.slides[idx].find(opts.overlayClass).animate(opts.transitionOverOut, 1000, function() {
						_this.previous = _this.current;
						_this.current  = setCurrent();
						
						if(opts.transitionSlideOut) {
							_this.slides[idx].animate(opts.transitionSlideOut, opts.transitionSpeed);
						}
						
						_this.navis[idx].removeClass('act');
						_this.slides[idx].removeClass('act');
						
						checkLoadAndSwitch(_this.current);
												
					});
				}
				
				
				function checkLoadAndSwitch(idx) {
					if(!_this.isLoading) {
						switchBox(idx);
					} else {
						setTimeout(function() { checkLoadAndSwitch(idx); }, 500);
					}
				}
				
				
				/* * *
				* Position der slideNavi anpassen (caroussel)
				*
				* Der aktive Slide immer sichtbar
				*/
				function setNaviPosition(idx) {
					targetPos  = idx * (_this.naviEWidth + 9);
					currentPos = ($('#slideNavi').length > 0) ? $('#slideNavi').scrollLeft() : 0;
					
					if((targetPos + _this.naviEWidth) > (_this.naviWidth - currentPos)) {
						$('#slideNavi').animate({scrollLeft: targetPos+'px'}, 400);
					} else if(targetPos == 0) {
						$('#slideNavi').animate({scrollLeft: 0}, 400);
					}
				}
				
				
				/* * *
				* PRELOADER
				*
				* wenn lazyLoad aktiv, werden Bilder erst hier richtig geladen
				*/
				function preloadImage(src, idx, doStop, gotoSwitch) {
					_this.isLoading = true;
					loadImg = new Image();
					$(loadImg).load(function() {
					    _this.lazyImages[idx] = $(this).attr('src');
					    $(this).wrap('<div class="mainImage" style="opacity: 0"></div>');
					    $(this).parent().append('<div class="slideOverlay"></div>');
					    $('#toiSlider').append($(this).parent());
					    _this.slides[idx] = $(this).parent();
					    _this.isLoading = false;
					    
					    if(doStop) stopAll();
					    if(gotoSwitch) checkLoadAndSwitch(idx);
					}).error(function() {
					    alert('ERROR: could not load image ' + _this.lazySource[0]);
					}).attr('src', src);
				}
				
				
				/* * *
				 * Nächste Slide-ID ermitteln
				 *
				 * Änderung von _this.current anhand der Controls/SlideNavi
				 * (next/prev) oder auto-play.
				 */
				function setCurrent() {
					relation = (opts.useLazyLoad) ? _this.lazySource.length : _this.slides.length;
				
					if(_this.add) {
						res = ((_this.current + 1) == relation) ? 0 : _this.current + 1;
					} else {
						res = ((_this.current - 1 ) < 0) ? (relation - 1) : _this.current - 1;
						_this.add = true;
					}
					
					return res;
				}
				
				
				/* * *
				 * Event Initialisierung
				 *
				 * Einstellung und Konfiguration der Benutzer
				 * Interaktionen
				 */
				function initUserEvents() {
					var selectorOffset = _this.selector.offset();
					// HOVER event: CONTROLS  ein- / ausblenden
					// (AbhÃ¤ngigkeit zur Cursor Distanz)
					_this.selector.hover(function() {	
						_this.selector.find('.slideControl').show();
						controlVis = true;
						
						overallWidth = _this.selector.width();
						
						// MOUSEMOVE event: Immer aktuelle Maus-Posi
						// (Wenn Maus links im Slider -> PREV BUTTON zeigen,
						// Wenn Maus rechts im Slider -> NEXT BUTTON zeigen)
						_this.selector.mousemove(function(e) {
							var _mx = e.pageX - selectorOffset.left;
							var _my = e.pageY - selectorOffset.top;
							
							if(_mx < 250 && !prevButton.hasAnim && !prevButton.active && controlVis && !controlAnim) {
								prevButton.hasAnim = true;
								prevButton.obj.animate({opacity: 0.7}, 600, function() {
									prevButton.hasAnim = false;	
									prevButton.active  = true;
								});
							} else if(_mx > 250 && !prevButton.hasAnim && prevButton.active && controlVis && !controlAnim) {
								prevButton.hasAnim = true
								prevButton.obj.animate({opacity: 0}, 300, function() {
									prevButton.hasAnim = false;
									prevButton.active  = false;
								});
							} else if(_mx > (overallWidth - 250) && !nextButton.hasAnim && !nextButton.active && controlVis && !controlAnim) {
								nextButton.hasAnim = true
								nextButton.obj.animate({opacity: 0.7}, 600, function() {
									nextButton.hasAnim = false;
									nextButton.active  = true
								});
							} else if(_mx < (overallWidth - 250) && !nextButton.hasAnim && nextButton.active && controlVis && !controlAnim) {
								nextButton.hasAnim = true
								nextButton.obj.animate({opacity: 0}, 300, function() {
									nextButton.hasAnim = false;
									nextButton.active  = false;
								});
							}
						});
					}, function() {
						controlVis = false;
						controlAnim = true;
						_this.selector.find('.slideControl').stop().animate({opacity: 0}, 300, function() {
							controlVis = false;
							prevButton.hasAnim = false;
							prevButton.active  = false;
							nextButton.hasAnim = false;
							nextButton.active  = false;
							controlAnim = false;
						});
					});
					
					
					// PREV BUTTON Click -> zeige vorherigen Slide
					prevButton.obj.click(function() {
						_this.add = false;
						stopAll();						
					});
					
					
					// NEXT BUTTON Click -> zeige nÃ¤chsten Slide
					nextButton.obj.click(function() {
						_this.add = true;
						stopAll();
					});
				}
				
				
				function initPlayStopEvents() {
					_this.stopButton.html('Pause');
					// STOP Button Click
					_this.stopButton.click(function() {
						if(_this.stopped) {
							_this.stopped  = false;
							_this.add      = true;
							_this.autoPlay = true;
							
							if(_this.slideNavi) _this.navis[_this.current].removeClass('act'); 
							
							_this.current  = setCurrent();
							
							if(_this.useOverlay == true) {
								_this.overlays[_this.lastOverlay].animate({right: '-400px'}, 500);
							}
							
							if(opts.useLazyLoad) {
								checkNext = _this.current;
								if($.inArray(_this.lazySource[checkNext], _this.lazyImages) == -1) {
									preloadImage(_this.lazySource[checkNext], checkNext, false, true);
								}
							} else {
								switchBox(_this.current);
							}
							_this.stopButton.html('Pause');
						} else {							
							_this.stopped = true;
							_this.selector.find(opts.boxClass).each(function() {
								$(this).stop(true, false);
								$(this).find(opts.overlayClass).stop(true, false);
							});
							_this.stopButton.html('Abspielen');
						}
					});
				}
				
				
				/* * *
				* slideNavi Event Initialisierung
				*/
				function initPrevImageNavi() {
					for(var i = 0; i < _this.navis.length; i++) {
						$(_this.navis[i]).click(function() {
							_this.stopped  = false;
							_this.autoPlay = true;
							_this.current = ($(this).data('idx') > _this.navis.length) ? 0 : ($(this).data('idx') - 1);
							
							if(opts.useLazyLoad) {
								if($.inArray(_this.lazySource[$(this).data('idx')], _this.lazyImages) == -1) {
									preloadImage(_this.lazySource[$(this).data('idx')], $(this).data('idx'), true, false);
								} else {
									stopAll();
								}
							} else {
								stopAll();
							}
							
							$(opts.slideNaviElement).each(function() {
								$(this).removeClass('act');
							});
							
							$(this).addClass('act');							
							_this.stopButton.html('Pause');
						});
					}
					
					fullWidth = $('#slideNaviInner').width();
					elemWidth = $(opts.slideNaviElement).width() + 9;
					
					if(fullWidth < $(_this.slideNavi).width()) {
						$('#slideNaviRight, #slideNaviLeft').hide();
					}
					
					$('#slideNaviRight').click(function() {
						pos       = $('#slideNaviInner').position().left;
						if((pos - _this.naviWidth) > -fullWidth) $('#slideNaviInner').animate({left: pos - elemWidth}, 500);
					});
					
					$('#slideNaviLeft').click(function() {
						pos = $('#slideNaviInner').position().left;
						if(pos < 0) $('#slideNaviInner').animate({left: pos + elemWidth}, 500);
					});
				}
				
				
				/* * *
				 * SÃ¤mtliche Events abbrechen, Loop neu starten
				 *
				 * Notwendig um Konflikte zwischen auto-play und
				 * manuell ausgelÃ¶sten Events zu verhindern.
				 */ 
				function stopAll() {
					_this.selector.find(opts.boxClass).each(function() {
						$(this).stop(true, false);
						$(this).find(opts.overlayClass).stop(true, false);
					});
					
					if(_this.useOverlay == true) {
						_this.overlays[_this.lastOverlay].animate({right: '-400px'}, 500);
					}
					
					//_this.autoPlay = false;
					_this.previous = _this.current;
					_this.current  = setCurrent();
					
					if(opts.transitionSlideOut) {
						_this.slides[_this.previous].animate(opts.transitionSlideOut, opts.transitionSpeed);
					}

					switchBox(_this.current);
				}
				
				
				/* * *
				* Fullscreen Background Funktion
				*
				* Passt die Größe eines Bildes an die Fenstergröße an
				* (ripped aus toi.fullscreenBG jQuery Plugin)
				*/
				function resizeBackground(img) {
					fix = img;
					
					iW = fix.width();
					iH = fix.height();	  
					
					sW = $(window).width();
					sH = $(window).height();
					
					if(iW != sW) {
					    fix.removeAttr('height');
					    fix.attr('width', sW);
					    iW = fix.width();
					    iH = fix.height();
					    
					    /*
if(iH > sH) {
					  	  nH = iH - sH;
					  	  fix.css({
					  		'position': 'absolute',
					  		'top'     : '-'+nH+'px'
					  	  });
					    }
*/			  
					}
					
					iW = fix.width();
					iH = fix.height();
					
					/*
if(iH < sH) {
					    fix.removeAttr('width'); 
					    
					    fix.attr('height', sH); 
					    fix.css({
					  	'position': 'absolute',
					  	'top'     : '0'
					    });
					}
*/
				}
			});
		}
	};
	
	
	/* * *
	 * Hauptfunktion zum Aufruf der Methoden
	 */ 
	$.fn.toiSlider = function( method ) {    
		// Method calling logic
		if ( methods[method] ) {
			return methods[ method ].apply( this, Array.prototype.slice.call( arguments, 1 ));
		} else if ( typeof method === 'object' || ! method ) {
			return methods.init.apply( this, arguments );
		} else {
			$.error( 'Method ' +  method + ' does not exist on jQuery.tooltip' );
		}
	};
	
	
	/* * *
	 * Standard Einstellungen
	 */ 
	$.fn.toiSlider.defaults = {
		boxClass:           ".mainImage",
		overlayClass:       ".slideOverlay",
		slideNavi:          "#slideNavi",
		slideNaviElement:   ".prevImage",
		transitionSpeed:    800,
		transitionSlideOut: false, // {opacity : 0, 'left' : '-1000px'},
		transitionSlidePos: {opacity : 0}, // {opacity : 0, 'left' : '1000px'}
		transitionSlideIn:  {opacity : 1},
		transitionOverOut:  {opacity : 0, 'left' : '-500px'}, // {opacity : 0, 'left' : '-1000px'},
		transitionOverPos:  {opacity : 0, 'left' : '-500px'}, // {opacity : 0, 'left' : '1000px'}
		transitionOverIn:   {opacity : 1, 'left' : '0'},
		delay:              5000,
		showControls:       true,
		showPlayStop:       true,
		useLazyLoad:        true,
		lazyLoadResource:   '.imgResource'
	};

})( jQuery );




/****************
* toiFullBG jQuery Plugin
* (Fullscreen Background on every resolution)
****************/

(function( $ ){

  $.fn.toiFullBG = function() {
  	  var isiPad  = navigator.userAgent.match(/iPad/i) != null;
  	   
	  $('body').append('<div id="fixedBG"></div><div id="oldBG"></div>');
	  $('#fixedBG').append($(this).find('img'));
	  
	  var fix = $('#fixedBG').find('img');
	  var contentElement = $('#contentWrap');
	  var naviWidth = $('#naviWrap').width() + 120;
	  
	  var sW;
	  var sH;
	  var iW = fix.width();
	  var iH = fix.height();
	  
	  setTimeout(fixBG, 500);
	  
	  function fixBG() {
		  sW = $(window).width();
	  	  sH = $(window).height();
	  	  
	  	  if(isiPad) {
	  	  	sW = window.innerWidth ? window.innerWidth : $(window).width()
	  	  	sH = window.innerHeight ? window.innerHeight : $(window).height();
	  	  }
	  	  
		  if(iW != sW) {
			  fix.removeAttr('height');
			  fix.attr('width', sW);
			  iW = fix.width();
			  niH = fix.height();
			  
			  /*
if(niH > sH) {
				  nH = niH - sH;
				  fix.css({
					'position': 'absolute',
					'top'     : '-'+nH+'px'
				  });
			  }	
*/		  
		  }
		  
		  iW = fix.width();
		  
		  /*
if(niH < sH) {
			  fix.removeAttr('width'); 
			  
			  fix.attr('height', sH); 
			  fix.css({
				'position': 'absolute',
				'top'     : '0'
			  });
		  }
*/
		  
		  $('#fixedBG').css({
		  	'z-index'  : '-4',
		  	'overflow' : 'hidden',
		  	'width'    : sW,
		  	'height'   : sH
		  });
		  
		  $('#oldBG').css({
		  	'z-index': '-5',
		  });
		  
		  $('#leftOverlay, #mainOverlay').css({
		  	'width': sW - 10,
		  	'height': sH - 10
		  });
		  
		  $('#footWrap').css({
		  	'width': sW - 10
		  });
		  
		  checkScrollableContent(contentElement);
	  }
	  
	  
	  function checkScrollableContent(obj) {
	  	//console.log('Window: ' + $(window).height() + ' | Content: ' + obj.height());
	  	
		if(($(window).height() - 400) <= obj.height()) {
			obj.css({
				'overflow': 'auto',
				'height'  : $(window).height() - 300
			});
		} else {
			obj.css({
				'overflow': 'hidden',
				'height'  : 'auto'
			});
		}
		
		obj.css('width', (sW - naviWidth));
	  }
	  
	  var doResize;
	  $(window).resize(function() {
	  	fix = $('#fixedBG').find('img');
		if(doResize !== false) {
    		clearTimeout(doResize);
			doResize = setTimeout(fixBG, 100);
		}		
	  });
	  
	  $(this).hide().remove();

  };
})( jQuery );


jQuery.fx.interval = 1000;
