
 /*************************************************************************************************************
 * fancy box
 ***************************************************/
 
 /*
 * 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">Der angeforderte Inhalt konnte nicht geladen werden.<br />Bitte versuchen Sie es sp�ter.</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);
 
  /*************************************************************************************************************
 * fancy box ende
 ***************************************************/
 


 
/**
 * Accessible Tabs - jQuery plugin for accessible, unobtrusive tabs
 * Build to seemlessly work with the CCS-Framework YAML (yaml.de) not depending on YAML though
 * @requires jQuery v1.0.3
 *
 * english article: http://blog.ginader.de/archives/2009/02/07/jQuery-Accessible-Tabs-How-to-make-tabs-REALLY-accessible.php
 * german article: http://blog.ginader.de/archives/2009/02/07/jQuery-Accessible-Tabs-Wie-man-Tabs-WIRKLICH-zugaenglich-macht.php
 * 
 * code: http://github.com/ginader/Accessible-Tabs
 * please report issues at: http://github.com/ginader/Accessible-Tabs/issues
 *
 * Copyright (c) 2007 Dirk Ginader (ginader.de)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 * Version: 1.5
 * 
 * History:
 * * 1.0 initial release
 * * 1.1 added a lot of Accessibility enhancements
 * * * rewrite to use "fn.extend" structure
 * * * added check for existing ids on the content containers to use to proper anchors in the tabs
 * * 1.1.1 changed the headline markup. thanks to Mike Davies for the hint.
 * * 1.5 thanks to Dirk Jesse, Ansgar Hein, David Maciejewski and Mike West for commiting patches to this release
 * * * new option syncheights that syncs the heights of the tab contents when the SyncHeight plugin 
 * *   is available http://blog.ginader.de/dev/jquery/syncheight/index.php
 * * * fixed the hardcoded current class
 * * * new option tabsListClass to be applied to the generated list of tabs above the content so lists 
 * *   inside the tabscontent can be styled differently
 * * * added clearfix and tabcounter that adds a class in the schema "tabamount{number amount of tabs}" 
 * *   to the ul containg the tabs so one can style the tabs to fit 100% into the width
 * * * new option "syncHeightMethodName" fixed issue: http://github.com/ginader/Accessible-Tabs/issues/2/find
 * * * new Method showAccessibleTab({index number of the tab to show starting with 0})  fixed issue: http://github.com/ginader/Accessible-Tabs/issues/3/find
 * * * added support for the Cursor Keys to come closer to the WAI ARIA Tab Panel Best Practices http://github.com/ginader/Accessible-Tabs/issues/1/find
 */


(function($) {
    var debugMode = false;
    $.fn.extend({
        getUniqueId: function(p){
            return p + new Date().getTime();
        },
        accessibleTabs: function(config) {
            var defaults = {
                wrapperClass: 'content', // Classname to apply to the div that is wrapped around the original Markup
                currentClass: 'current', // Classname to apply to the LI of the selected Tab
                tabhead: 'h3', // Tag or valid Query Selector of the Elements to Transform the Tabs-Navigation from (originals are removed)
                tabbody: '.tabbody', // Tag or valid Query Selector of the Elements to be treated as the Tab Body
                fx:'show', // can be "fadeIn", "slideDown", "show"
                fxspeed: 'normal', // speed (String|Number): "slow", "normal", or "fast") or the number of milliseconds to run the animation
                currentInfoText: 'current tab: ', // text to indicate for screenreaders which tab is the current one
                currentInfoPosition: 'prepend', // Definition where to insert the Info Text. Can be either "prepend" or "append"
                currentInfoClass: 'current-info', // Class to apply to the span wrapping the CurrentInfoText
                tabsListClass:'tabs-list', // Class to apply to the generated list of tabs above the content
                syncheights:false, // syncs the heights of the tab contents when the SyncHeight plugin is available http://blog.ginader.de/dev/jquery/syncheight/index.php
                syncHeightMethodName:'syncHeight' // set the Method name of the plugin you want to use to sync the tab contents. Defaults to the SyncHeight plugin: http://github.com/ginader/syncHeight
            };
            // cursor key codes
            /*
            backspace  	8


            tab 	9
            enter 	13
            shift 	16
            ctrl 	17
            alt 	18
            pause/break 	19
            caps lock 	20
            escape 	27
            page up 	33
            page down 	34
            end 	35
            home 	36
            left arrow 	37
            up arrow 	38
            right arrow 	39
            down arrow 	40
            insert 	45
            delete 	46
            */
            var keyCodes = {
                37 : -1, //LEFT
                38 : -1, //UP
                39 : +1, //RIGHT 
                40 : +1 //DOWN
            };
            this.options = $.extend(defaults, config);
            var o = this;
            return this.each(function() {
                var el = $(this);
                var list = '';
                var tabCount = 0;

                var contentAnchor = o.getUniqueId('accessibletabscontent');
                var tabsAnchor = o.getUniqueId('accessibletabs');
                $(el).wrapInner('<div class="'+o.options.wrapperClass+'"></div>');

                $(el).find(o.options.tabhead).each(function(i){
                    var id = '';
                    if(i === 0){
                        id =' id="'+tabsAnchor+'"';
                    }
                    list += '<li><a'+id+' href="#'+contentAnchor+'">'+$(this).text()+'</a></li>';
                    $(this).remove();
                    tabCount++;
                });

                $(el).prepend('<ul class="clear '+o.options.tabsListClass+' tabamount'+tabCount+'">'+list+'</ul>');
                $(el).find(o.options.tabbody).hide();
             /*   $(el).find(o.options.tabbody+':first').show().before('<'+o.options.tabhead+'><a tabindex="0" class="accessibletabsanchor" name="'+contentAnchor+'" id="'+contentAnchor+'">'+$(el).find("ul>li:first").text()+'</a></'+o.options.tabhead+'>');*/
			 
			  $(el).find(o.options.tabbody+':first').show().before('<a tabindex="0" class="accessibletabsanchor" name="'+contentAnchor+'" id="'+contentAnchor+'">'+$(el).find("ul>li:first").text()+'</a></'+o.options.tabhead+'>');
                $(el).find("ul>li:first").addClass(o.options.currentClass)
                .find('a')[o.options.currentInfoPosition]('<span class="'+o.options.currentInfoClass+'">'+o.options.currentInfoText+'</span>');

                if (o.options.syncheights && $.fn[o.options.syncHeightMethodName]) {
                    $(el).find(o.options.tabbody)[o.options.syncHeightMethodName]();
                    $(window).resize(function(){ 
                        $(el).find(o.options.tabbody)[o.options.syncHeightMethodName]();
                    });
                }

                $(el).find('ul.'+o.options.tabsListClass+'>li>a').each(function(i){
                    $(this).click(function(event){

		                valid = o.options.validators[o.getCurrentTabIndex()].data("validator").checkValidity();;

                   		if (valid) {
	                        event.preventDefault();
	                        $(el).find('ul>li.'+o.options.currentClass).removeClass(o.options.currentClass)
	                        .find("span."+o.options.currentInfoClass).remove();
	                        $(this).blur();
	                        $(el).find(o.options.tabbody+':visible').hide();
	                        $(el).find(o.options.tabbody).eq(i)[o.options.fx](o.options.fxspeed);
	                        $( '#'+contentAnchor ).text( $(this).text() ).focus().keyup(function(event){
	                            if(keyCodes[event.keyCode]){
	                                o.showAccessibleTab(i+keyCodes[event.keyCode]);
	                                debug(i);
	                                $(this).unbind( "keyup" );
	                            }
	                        });
	                        $(this)[o.options.currentInfoPosition]('<span class="'+o.options.currentInfoClass+'">'+o.options.currentInfoText+'</span>')
	                        .parent().addClass(o.options.currentClass);
	
	
	                        // $(el).find('.accessibletabsanchor').keyup(function(event){
	                        //     if(keyCodes[event.keyCode]){
	                        //         o.showAccessibleTab(i+keyCodes[event.keyCode]);
	                        //     }
	                        // });                   			
                   		}
                   		else {
                   			event.preventDefault();
                   			$(this).blur();
                   		}

                        
                        
                    });

                    $(this).focus(function(event){
                        debug($(this));
                        $(document).keyup(function(event){
                            if(keyCodes[event.keyCode]){
                                o.showAccessibleTab(i+keyCodes[event.keyCode]);
                            }
                        });
                    });
                    $(this).blur(function(event){
                        $(document).unbind( "keyup" );
                    });
                    

                });
            });
        },
        showAccessibleTab: function(index){
            debug('showAccessibleTab');
            debug(index);
            var o = this;
            o.options.currentIndex = index;
            return this.each(function() {
                var el = $(this);
                var links = el.find('ul.'+o.options.tabsListClass+'>li>a');
                debug(links);
                links.eq(index).click();
            });
        },
        
		getCurrentTabIndex: function() {
			var o = this;
			currentIndex = 0;
			$('ul.'+o.options.tabsListClass+'>li').each(function(index,item) {
				if ($(item).hasClass('current')) {
					currentIndex = index;
				}	
			});
			return currentIndex;
		}        
    });
    // private Methods
    function debug(msg){
        if(debugMode && window.console && window.console.log){
            window.console.log(msg);
        }
    }
})(jQuery);


/* ################ tabs ende ############### */


jQuery.easing['jswing'] = jQuery.easing['swing'];

jQuery.extend( jQuery.easing,
{
	def: 'easeOutQuad',
	swing: function (x, t, b, c, d) {
		//alert(jQuery.easing.default);
		return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
	},
	easeInQuad: function (x, t, b, c, d) {
		return c*(t/=d)*t + b;
	},
	easeOutQuad: function (x, t, b, c, d) {
		return -c *(t/=d)*(t-2) + b;
	},
	easeInOutQuad: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t + b;
		return -c/2 * ((--t)*(t-2) - 1) + b;
	},
	easeInCubic: function (x, t, b, c, d) {
		return c*(t/=d)*t*t + b;
	},
	easeOutCubic: function (x, t, b, c, d) {
		return c*((t=t/d-1)*t*t + 1) + b;
	},
	easeInOutCubic: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t + b;
		return c/2*((t-=2)*t*t + 2) + b;
	},
	easeInQuart: function (x, t, b, c, d) {
		return c*(t/=d)*t*t*t + b;
	},
	easeOutQuart: function (x, t, b, c, d) {
		return -c * ((t=t/d-1)*t*t*t - 1) + b;
	},
	easeInOutQuart: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
		return -c/2 * ((t-=2)*t*t*t - 2) + b;
	},
	easeInQuint: function (x, t, b, c, d) {
		return c*(t/=d)*t*t*t*t + b;
	},
	easeOutQuint: function (x, t, b, c, d) {
		return c*((t=t/d-1)*t*t*t*t + 1) + b;
	},
	easeInOutQuint: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
		return c/2*((t-=2)*t*t*t*t + 2) + b;
	},
	easeInSine: function (x, t, b, c, d) {
		return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
	},
	easeOutSine: function (x, t, b, c, d) {
		return c * Math.sin(t/d * (Math.PI/2)) + b;
	},
	easeInOutSine: function (x, t, b, c, d) {
		return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
	},
	easeInExpo: function (x, t, b, c, d) {
		return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
	},
	easeOutExpo: function (x, t, b, c, d) {
		return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
	},
	easeInOutExpo: function (x, t, b, c, d) {
		if (t==0) return b;
		if (t==d) return b+c;
		if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
		return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
	},
	easeInCirc: function (x, t, b, c, d) {
		return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
	},
	easeOutCirc: function (x, t, b, c, d) {
		return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
	},
	easeInOutCirc: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
		return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
	},
	easeInElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
	},
	easeOutElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
	},
	easeInOutElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d/2)==2) return b+c;  if (!p) p=d*(.3*1.5);
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
		return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
	},
	easeInBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158;
		return c*(t/=d)*t*((s+1)*t - s) + b;
	},
	easeOutBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158;
		return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
	},
	easeInOutBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158; 
		if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
		return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
	},
	easeInBounce: function (x, t, b, c, d) {
		return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
	},
	easeOutBounce: function (x, t, b, c, d) {
		if ((t/=d) < (1/2.75)) {
			return c*(7.5625*t*t) + b;
		} else if (t < (2/2.75)) {
			return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
		} else if (t < (2.5/2.75)) {
			return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
		} else {
			return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
		}
	},
	easeInOutBounce: function (x, t, b, c, d) {
		if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
		return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
	}
});

;(function($){
	$.fn.navSlider = function(options){

		this.options = options;
		
		this.elements = this.find('.'+this.options['elementClass']);
		that = this;
		
		// set opacity of image-text-divs
		this.elementsImageTexts = this.find('.'+this.options['elementClass']+' .imageText');
		this.elementsImageTexts.each(function(index, item) {
			$(item).css('opacity', 0.5);	
		});
		
		// just show first element
		for (c=0; c<this.elements.length; c++) {
			if (c) {
				$(this.elements[c]).css('opacity', 0);
				$(this.elements[c]).css('display', 'none');
			}
		}
		
		// build slider navigation
		
		//$('<div class="sliderNavBrowse prev" /><div id="'+this.options['navId']+'"><div class="sliderNavItems"></div></div><div class="sliderNavBrowse next" />').appendTo($('#'+this.options['rootId']));
		
		
		this.navElements = this.find('.'+this.options['menuClass']);
		this.navElements.each(function(index, item) {

			$(item).addClass('navElement-'+String(index));
			$(item).detach().appendTo($('#'+that.options['rootId']));
			
			$(item).bind('mouseup', {index:index}, function (event) {
				if (that.selectedIndex != event.data.index) {
					if (that.slideTimeout) {
						window.clearTimeout(that.slideTimeout);
					}
					that.selectedIndex = event.data.index;
					that.doSlide();	
				}
			})
						
		});
		/*
		$('#'+this.options['navId']).scrollable({
			items: '.sliderNavElement',
			circular: true
			
		});
		*/
		
		
		
		this.currentIndex = 0;
		this.hideIndex = 0;
		this.periodical = true;
		this.selectedIndex = -1;
		this.slideTimeout = false;
		
                this.doSlide = function() {

                    //if (!that.slideActive) {
                        that.slideActive = true;
                        //$('#debug').html('true');
                        for (c=0; c<that.elements.length; c++) {
                            $(that.elements[c]).stop(true,true);
                        }


                        that.hideIndex = that.currentIndex;
                        $(that.navElements[that.currentIndex]).parent('li').removeClass('active');
                        $(that.elements[that.currentIndex]).stop(true,true).animate(
                        {
                            opacity: 0
                        },
                        {
                            duration: 150,
                            specialEasing: {
                                opacity: 'linear'
                            },
                            complete: function() {
                                $(that.elements[that.currentIndex]).css('display', 'none');
                                if (that.selectedIndex>=0) {
                                    that.currentIndex = that.selectedIndex;
                                }
                                else {
                                    that.currentIndex++;
                                    if (that.currentIndex >= that.elements.length) {
                                        that.currentIndex = 0;
                                    }
                                }

                                $(that.navElements[that.currentIndex]).parent('li').addClass('active');
                                $(that.elements[that.currentIndex]).css('display', 'block');
                                $(that.elements[that.currentIndex]).stop(true,true).animate(
                                {
                                    opacity: 1
                                },
                                {
                                    duration: 900,
                                    specialEasing: {
                                        opacity: 'linear'
                                    },
                                    complete: function() {
                                        $(that.elements[that.hideIndex]).css('display', 'none');
                                        that.slideActive = false;
                                        //$('#debug').html('false');
                                        if (that.periodical) {
                                            that.slideTimeout = window.setTimeout(that.doSlide, 4000);
                                        }
                                    }
                                }
                                );
                            }
                        }
                        );


                    //}

                }

                that.slideTimeout = window.setTimeout(this.doSlide, 4000);
		
		
	};
})(jQuery);

;(function($){
	$.fn.scrollableSlider = function(options){

		this.options = options;
		
		this.thumbnails = this.find('#'+this.options['thumbnails']+' img');
		this.zoomImages = this.find('#'+this.options['zoomImages']+' div');
		that = this;
		
		// just show first element
		for (c=0; c<this.zoomImages.length; c++) {
			if (c) {
				$(this.zoomImages[c]).css('opacity', 0);
				$(this.zoomImages[c]).css('display', 'none');
			}
		}
				
		$(this.thumbnails).each(function(index,item) {
			$(item).bind('mouseup', {index:index}, function(event) {
				if (that.selectedIndex != event.data.index) {
					if (that.slideTimeout) {
						window.clearTimeout(that.slideTimeout);
					}
					that.selectedIndex = event.data.index;
					that.doSlide();	
				}
			});
		});		
		
		this.currentIndex = 0;
		this.hideIndex = 0;
		this.periodical = true;
		this.selectedIndex = -1;
		this.slideTimeout = false;
		
		this.doSlide = function() {
			
			that.periodical = (that.selectedIndex>=0)?false:true;
			that.hideIndex = that.currentIndex;
			
			$(that.zoomImages[that.currentIndex]).stop(true,true).animate(
				{
					opacity: 0
				},
				{
				    duration: 2000, 
				    specialEasing: {
				      	opacity: 'easeOutExpo'
				    },
				    complete: function() {
				    	
				    }
				}				
			);
			
			if (that.selectedIndex>=0) {
				that.currentIndex = that.selectedIndex;
			}
			else {
				that.currentIndex++;
				if (that.currentIndex >= that.elements.length) {
					that.currentIndex = 0;
				}				
			}
			
			$(that.zoomImages[that.currentIndex]).css('display', 'block');
			$(that.zoomImages[that.currentIndex]).stop(true,true).animate(
				{
					opacity: 1
				},
				{
				    duration: 1600, 
				    specialEasing: {
				      	opacity: 'linear'
				    }, 
				    complete: function() {
				    	$(that.zoomImages[that.hideIndex]).css('display', 'none');
						if (that.periodical) {
							that.slideTimeout = window.setTimeout(that.doSlide, 4000);
						}
					}
				}								
			);	
		}		
		
	};
})(jQuery);		

;(function($){
	$.fn.multiSiteForm = function(options){

		this.options = options;
		that = this;
		
		
		$('.'+this.options['couponClass']).each(function(index,item) {
			$(item).bind('mouseenter mouseleave', function() {
			  	$(this).toggleClass('couponHover');
			});
			$(item).bind('click', {index:index}, function(event) {
				$('#'+that.options['couponHiddenValue']).attr('value',event.data.index+1);	
				$('#'+that.options['tabs']+' ul.tabs-list li a').slice(1,2).click();
			});
		});
		// click for prev-buttons
		$('.'+this.options['prevButtons']).each(function(index,item) {
			$(item).bind('click', {index:index}, function(event) {
				$('#'+that.options['tabs']+' ul.tabs-list li a').slice(event.data.index,event.data.index+1).click();
			});
		});
		
		// click for next-buttons
		$('.'+this.options['nextButtons']).each(function(index,item) {
			$(item).bind('click', {index:index}, function(event) {
				$('#'+that.options['tabs']+' ul.tabs-list li a').slice(event.data.index+2,event.data.index+3).click();	
			});
		});	

		$('#'+this.options['nameSource']).bind('keyup', function(event) {
			var name = $(this).val();
			$('.'+that.options['nameSpans']).each(function(index,item) {
				$(item).html(name);	
			});
			$('.'+that.options['nameInputs']).each(function(index,item) {
				$(item).val(name);	
			});
		});
		
		this.getCurrentTabIndex = function() {
			currentIndex = 0;
			$('#'+that.options['tabs']+' ul.tabs-list li').each(function(index,item) {
				if ($(item).hasClass('current')) {
					currentIndex = index;
				}	
			});
			return currentIndex;
		};
		
		return this;
		
	};
})(jQuery);




/* ######################### polarizer ########### */

function polarize(){
	// When everything has loaded, place all polaroids on a random position	
	$(".polaroid").each(function (i) {
		var tempVal = Math.round(Math.random());
		if(tempVal == 1) {
			var rotDegrees = randomXToY(330, 360); // rotate left
		} else {
			var rotDegrees = randomXToY(0, 30); // rotate right
		}
		
		// Internet Explorer doesn't have the "window.innerWidth" and "window.innerHeight" properties
		if(window.innerWidth == undefined) { 
			var wiw = 1000;
			var wih = 700;
		} else {
			var wiw = window.innerWidth;
			var wih = window.innerHeight;	
		}
		
		var cssObj = { 'left' : Math.random()*(wiw-400),
			'top' : Math.random()*(wih-400),
			'-webkit-transform' : 'rotate('+ rotDegrees +'deg)',  // safari only
			'tranform' : 'rotate('+ rotDegrees +'deg)' }; // added in case CSS3 is standard
		$(this).css(cssObj);
	});
	
	// Set the Z-Index (used to display images on top while dragging)
	var zindexnr = 1;
	
	// boolean to check if the user is dragging
	var dragging = false;
	
	// Show the polaroid on top when clicked on
	$(".polaroid").mouseup(function(e){
		if(!dragging) {
			// Bring polaroid to the foreground
			zindexnr++;
			var cssObj = { 'z-index' : zindexnr,
			'transform' : 'rotate(0deg)',	 // added in case CSS3 is standard
			'-webkit-transform' : 'rotate(0deg)' };  // safari only
			$(this).css(cssObj);
		}
	});
	
	// Make the polaroid draggable & display a shadow when dragging
	$(".polaroid").draggable({
		cursor: 'crosshair',
		start: function(event, ui) {
			dragging = true;
			zindexnr++;
			var cssObj = { 'box-shadow' : '#888 5px 10px 10px', // added in case CSS3 is standard
				'-webkit-box-shadow' : '#888 5px 10px 10px', // safari only
				'margin-left' : '-10px',
				'margin-top' : '-10px',
				'z-index' : zindexnr };
			$(this).css(cssObj);
		},
		stop: function(event, ui) {
			var tempVal = Math.round(Math.random());
			if(tempVal == 1) {
				var rotDegrees = randomXToY(330, 360); // rotate left
			} else {
				var rotDegrees = randomXToY(0, 30); // rotate right
			}
			var cssObj = { 'box-shadow' : '', // added in case CSS3 is standard
				'-webkit-box-shadow' : '', // safari only
				'transform' : 'rotate('+ rotDegrees +'deg)', // added in case CSS3 is standard
				'-webkit-transform' : 'rotate('+ rotDegrees +'deg)', // safari only
				'margin-left' : '0px',
				'margin-top' : '0px' };
			$(this).css(cssObj);
			dragging = false;
		}
	});
	
	// Function to get random number upto m
	// http://roshanbh.com.np/2008/09/get-random-number-range-two-numbers-javascript.html
	function randomXToY(minVal,maxVal,floatVal) {
		var randVal = minVal+(Math.random()*(maxVal-minVal));
		return typeof floatVal=='undefined'?Math.round(randVal):randVal.toFixed(floatVal);
	}
	
}



/* Copyright (c) 2009 Jordan Kasper
 * Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
 * Copyright notice and license must remain intact for legal use
 * Requires: jQuery 1.2+
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 *
 * Fore usage documentation and examples, visit:
 *         http://jkdesign.org/captcha/
 *
 * TODO:
 *   Full testing suite
 *
 * REVISIONS:
 *   0.1 Initial release
 *   0.2 Changed to use title attribute of image for hash (versus alt)
 *       (We don't want the hash showing as images load)
 *       Fixed simpleCaptcha.php to return properly formatted JSON (fixes bug in jQuery 1.4)
 *
 */
;
(function($) {

    $.fn.simpleCaptcha = function(o) {
        var n = this;
        if (n.length < 1) {
            return n;
        }

        o = (o)?o:{};
        o = auditOptions($.extend({}, $.fn.simpleCaptcha.defaults, o));

        var inputId = "simpleCaptcha_"+($.fn.simpleCaptcha.uid++);
        n
        .addClass('simpleCaptcha')
        .html('')  // clear out the container
        .append(
            "<div class='"+o.introClass+"'>"+o.introText+"</div>"+
            "<div class='"+o.imageBoxClass+"'></div>"+
            "<input class='simpleCaptchaInput' id='"+inputId+"' name='"+o.inputName+"' type='hidden' value='' />"
            );

        // Call simpleCaptcha.php to get images and current selection
        $.ajax({
            url: o.scriptPath,
            data: {
                numImages: o.numImages
            },
            method: 'post',
            dataType: 'json',
            success: function(data, status) {
                if (typeof data.error == 'string') {
                    handleError(n, data.error);
                    return;
                } else {
                    // Add image text to correct place
                    n.find('.'+o.textClass).html(data.text);

                    // Add images to container with click handlers
                    var imgBox = n.find('.'+o.imageBoxClass);
                    $.each(data.images, function() {
                        imgBox.append("<img class='"+o.imageClass+"' src='"+this.file+"' alt='' title='"+this.hash+"' />");
                    });
                    imgBox.find('img.'+o.imageClass)
                    .click(function(e) {
                        n.find('img.'+o.imageClass).removeClass('simpleCaptchaSelected');
                        var hash = $(this).addClass('simpleCaptchaSelected').attr('title');
                        $('#'+inputId).val(hash);
                        n.trigger('select.simpleCaptcha', [hash]);
                        return false;
                    })
                    .keyup(function(e) {
                        if (e.keyCode == 13 || e.which == 13) {
                            $(this).click();
                        }
                    });
                    n.trigger('loaded.simpleCaptcha', [data]);
                }
            },
            error: function(xhr, status) {
                handleError(n, 'Es gab ein Problem: '+xhr.status);
            }
        });

        return n;  // Continue jQuery chain
    };

    var handleError = function(n, msg) {
        n.trigger('error.simpleCaptcha', [msg]);
    }

    // Defined outside simpleCaptcha to allow for usage during construction
    var auditOptions = function(o) {
        if (typeof o.numImages != 'number' || o.numImages < 1) {
            o.numImages = $.fn.simpleCaptcha.defaults.numImages;
        }
        if (typeof o.introText != 'string' || o.introText.length < 1) {
            o.introText = $.fn.simpleCaptcha.defaults.introText;
        }
        if (typeof o.inputName != 'string') {
            o.inputName = $.fn.simpleCaptcha.defaults.inputName;
        }
        if (typeof o.scriptPath != 'string') {
            o.scriptPath = $.fn.simpleCaptcha.defaults.scriptPath;
        }
        if (typeof o.introClass != 'string') {
            o.introClass = $.fn.simpleCaptcha.defaults.introClass;
        }
        if (typeof o.textClass != 'string') {
            o.textClass = $.fn.simpleCaptcha.defaults.textClass;
        }
        if (typeof o.imageBoxClass != 'string') {
            o.imageBoxClass = $.fn.simpleCaptcha.defaults.imageBoxClass;
        }
        if (typeof o.imageClass != 'string') {
            o.imageClass = $.fn.simpleCaptcha.defaults.imageClass;
        }

        return o;
    }

    $.fn.simpleCaptcha.uid = 0;

    // options for simpleCaptcha instances...
    $.fn.simpleCaptcha.defaults = {
        numImages: 5,                     // Number How many images to show the user (providing there are at least that many defined in the script file).
        introText: "<p>Antispam: Klicken Sie auf <span class='captchaText'></span>.</p>",
        // String Text to place above captcha images (can contain html). IMPORTANT: You should probably include a tag with the textClass name on it, for example: <span id='captchaText'></span>
        inputName: 'captchaSelection',    // String Name to use for the captcha hidden input, this is what you will need to check on the receiving end of the form submission.
        scriptPath: 'simpleCaptcha.php',  // String Relative path to the script file to use (usually simpleCaptcha.php).
        introClass: 'captchaIntro',       // String Class to use for the captcha introduction text container.
        textClass: 'captchaText',         // String Class to look for to place the text for the correct captcha image.
        imageBoxClass: 'captchaImages',   // String Class to use for the captchas images container.
        imageClass: 'captchaImage'        // String Class to use for each captcha image.
    };

})(jQuery);





/*
 * Superfish v1.4.8 - jQuery menu widget
 * Copyright (c) 2008 Joel Birch
 *
 * Dual licensed under the MIT and GPL licenses:
 * 	http://www.opensource.org/licenses/mit-license.php
 * 	http://www.gnu.org/licenses/gpl.html
 *
 * CHANGELOG: http://users.tpg.com.au/j_birch/plugins/superfish/changelog.txt
 */

;
(function($){
    $.fn.superfish = function(op){

        var sf = $.fn.superfish,
        c = sf.c,
        $arrow = $(['<span class="',c.arrowClass,'"> &#187;</span>'].join('')),
        over = function(){
            var $$ = $(this), menu = getMenu($$);
            clearTimeout(menu.sfTimer);
            $$.showSuperfishUl().siblings().hideSuperfishUl();
        },
        out = function(){
            var $$ = $(this), menu = getMenu($$), o = sf.op;
            clearTimeout(menu.sfTimer);
            menu.sfTimer=setTimeout(function(){
                o.retainPath=($.inArray($$[0],o.$path)>-1);
                $$.hideSuperfishUl();
                if (o.$path.length && $$.parents(['li.',o.hoverClass].join('')).length<1){
                    over.call(o.$path);
                }
            },o.delay);
        },
        getMenu = function($menu){
            var menu = $menu.parents(['ul.',c.menuClass,':first'].join(''))[0];
            sf.op = sf.o[menu.serial];
            return menu;
        },
        addArrow = function($a){
            $a.addClass(c.anchorClass).append($arrow.clone());
        };

        return this.each(function() {
            var s = this.serial = sf.o.length;
            var o = $.extend({},sf.defaults,op);
            o.$path = $('li.'+o.pathClass,this).slice(0,o.pathLevels).each(function(){
                $(this).addClass([o.hoverClass,c.bcClass].join(' '))
                .filter('li:has(ul)').removeClass(o.pathClass);
            });
            sf.o[s] = sf.op = o;

            $('li:has(ul)',this)[($.fn.hoverIntent && !o.disableHI) ? 'hoverIntent' : 'hover'](over,out).each(function() {
                if (o.autoArrows) addArrow( $('>a:first-child',this) );
            })
            .not('.'+c.bcClass)
            .hideSuperfishUl();

            var $a = $('a',this);
            $a.each(function(i){
                var $li = $a.eq(i).parents('li');
                $a.eq(i).focus(function(){
                    over.call($li);
                }).blur(function(){
                    out.call($li);
                });
            });
            o.onInit.call(this);

        }).each(function() {
            var menuClasses = [c.menuClass];
            if (sf.op.dropShadows  && !($.browser.msie && $.browser.version < 7)) menuClasses.push(c.shadowClass);
            $(this).addClass(menuClasses.join(' '));
        });
    };

    var sf = $.fn.superfish;
    sf.o = [];
    sf.op = {};
    sf.IE7fix = function(){
        var o = sf.op;
        if ($.browser.msie && $.browser.version > 6 && o.dropShadows && o.animation.opacity!=undefined)
            this.toggleClass(sf.c.shadowClass+'-off');
    };
    sf.c = {
        bcClass     : 'sf-breadcrumb',
        menuClass   : 'sf-js-enabled',
        anchorClass : 'sf-with-ul',
        arrowClass  : 'sf-sub-indicator',
        shadowClass : 'sf-shadow'
    };
    sf.defaults = {
        hoverClass	: 'sfHover',
        pathClass	: 'overideThisToUse',
        pathLevels	: 1,
        delay		: 800,
        animation	: {
            opacity:'show'
        },
        speed		: 'normal',
        autoArrows	: true,
        dropShadows : true,
        disableHI	: false,		// true disables hoverIntent detection
        onInit		: function(){}, // callback functions
        onBeforeShow: function(){},
        onShow		: function(){},
        onHide		: function(){}
    };
    $.fn.extend({
        hideSuperfishUl : function(){
            var o = sf.op,
            not = (o.retainPath===true) ? o.$path : '';
            o.retainPath = false;
            var $ul = $(['li.',o.hoverClass].join(''),this).add(this).not(not).removeClass(o.hoverClass)
            .find('>ul').hide().css('visibility','hidden');
            o.onHide.call($ul);
            return this;
        },
        showSuperfishUl : function(){
            var o = sf.op,
            sh = sf.c.shadowClass+'-off',
            $ul = this.addClass(o.hoverClass)
            .find('>ul:hidden').css('visibility','visible');
            sf.IE7fix.call($ul);
            o.onBeforeShow.call($ul);
            $ul.animate(o.animation,o.speed,function(){
                sf.IE7fix.call($ul);
                o.onShow.call($ul);
            });
            return this;
        }
    });

})(jQuery);


/*
 * Supersubs v0.2b - jQuery plugin
 * Copyright (c) 2008 Joel Birch
 *
 * Dual licensed under the MIT and GPL licenses:
 * 	http://www.opensource.org/licenses/mit-license.php
 * 	http://www.gnu.org/licenses/gpl.html
 *
 *
 * This plugin automatically adjusts submenu widths of suckerfish-style menus to that of
 * their longest list item children. If you use this, please expect bugs and report them
 * to the jQuery Google Group with the word 'Superfish' in the subject line.
 *
 */

;
(function($){ // $ will refer to jQuery within this closure

    $.fn.supersubs = function(options){
        var opts = $.extend({}, $.fn.supersubs.defaults, options);
        // return original object to support chaining
        return this.each(function() {
            // cache selections
            var $$ = $(this);
            // support metadata
            var o = $.meta ? $.extend({}, opts, $$.data()) : opts;
            // get the font size of menu.
            // .css('fontSize') returns various results cross-browser, so measure an em dash instead
            var fontsize = $('<li id="menu-fontsize">&#8212;</li>').css({
                'padding' : 0,
                'position' : 'absolute',
                'top' : '-999em',
                'width' : 'auto'
            }).appendTo($$).width(); //clientWidth is faster, but was incorrect here
            // remove em dash
            $('#menu-fontsize').remove();
            // cache all ul elements
            $ULs = $$.find('ul');
            // loop through each ul in menu
            $ULs.each(function(i) {
                // cache this ul
                var $ul = $ULs.eq(i);
                // get all (li) children of this ul
                var $LIs = $ul.children();
                // get all anchor grand-children
                var $As = $LIs.children('a');
                // force content to one line and save current float property
                var liFloat = $LIs.css('white-space','nowrap').css('float');
                // remove width restrictions and floats so elements remain vertically stacked
                var emWidth = $ul.add($LIs).add($As).css({
                    'float' : 'none',
                    'width'	: 'auto'
                    })
                // this ul will now be shrink-wrapped to longest li due to position:absolute
                // so save its width as ems. Clientwidth is 2 times faster than .width() - thanks Dan Switzer
                .end().end()[0].clientWidth / fontsize;
                // add more width to ensure lines don't turn over at certain sizes in various browsers
                emWidth += o.extraWidth;
                // restrict to at least minWidth and at most maxWidth
                if (emWidth > o.maxWidth)		{
                    emWidth = o.maxWidth;
                }
                else if (emWidth < o.minWidth)	{
                    emWidth = o.minWidth;
                }
                emWidth += 'em';
                // set ul to width in ems
                $ul.css('width',emWidth);
                // restore li floats to avoid IE bugs
                // set li width to full width of this ul
                // revert white-space to normal
                $LIs.css({
                    'float' : liFloat,
                    'width' : '100%',
                    'white-space' : 'normal'
                })
                // update offset position of descendant ul to reflect new width of parent
                .each(function(){
                    var $childUl = $('>ul',this);
                    var offsetDirection = $childUl.css('left')!==undefined ? 'left' : 'right';
                    $childUl.css(offsetDirection,emWidth);
                });
            });

        });
    };
    // expose defaults
    $.fn.supersubs.defaults = {
        minWidth		: 9,		// requires em unit.
        maxWidth		: 25,		// requires em unit.
        extraWidth		: 0			// extra width can ensure lines don't sometimes turn over due to slight browser differences in how they round-off values
    };

})(jQuery); // plugin code ends



(function($){
    /* hoverIntent by Brian Cherne */
    $.fn.hoverIntent = function(f,g) {
        // default configuration options
        var cfg = {
            sensitivity: 7,
            interval: 100,
            timeout: 0
        };
        // override configuration options with user supplied object
        cfg = $.extend(cfg, g ? {
            over: f,
            out: g
        } : f );

        // instantiate variables
        // cX, cY = current X and Y position of mouse, updated by mousemove event
        // pX, pY = previous X and Y position of mouse, set by mouseover and polling interval
        var cX, cY, pX, pY;

        // A private function for getting mouse position
        var track = function(ev) {
            cX = ev.pageX;
            cY = ev.pageY;
        };

        // A private function for comparing current and previous mouse position
        var compare = function(ev,ob) {
            ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);
            // compare mouse positions to see if they've crossed the threshold
            if ( ( Math.abs(pX-cX) + Math.abs(pY-cY) ) < cfg.sensitivity ) {
                $(ob).unbind("mousemove",track);
                // set hoverIntent state to true (so mouseOut can be called)
                ob.hoverIntent_s = 1;
                return cfg.over.apply(ob,[ev]);
            } else {
                // set previous coordinates for next time
                pX = cX;
                pY = cY;
                // use self-calling timeout, guarantees intervals are spaced out properly (avoids JavaScript timer bugs)
                ob.hoverIntent_t = setTimeout( function(){
                    compare(ev, ob);
                } , cfg.interval );
            }
        };

        // A private function for delaying the mouseOut function
        var delay = function(ev,ob) {
            ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);
            ob.hoverIntent_s = 0;
            return cfg.out.apply(ob,[ev]);
        };

        // A private function for handling mouse 'hovering'
        var handleHover = function(e) {
            // next three lines copied from jQuery.hover, ignore children onMouseOver/onMouseOut
            var p = (e.type == "mouseover" ? e.fromElement : e.toElement) || e.relatedTarget;
            while ( p && p != this ) {
                try {
                    p = p.parentNode;
                } catch(e) {
                    p = this;
                }
            }
        if ( p == this ) {
            return false;
        }

        // copy objects to be passed into t (required for event object to be passed in IE)
        var ev = jQuery.extend({},e);
        var ob = this;

        // cancel hoverIntent timer if it exists
        if (ob.hoverIntent_t) {
            ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);
        }

        // else e.type == "onmouseover"
        if (e.type == "mouseover") {
            // set "previous" X and Y position based on initial entry point
            pX = ev.pageX;
            pY = ev.pageY;
            // update "current" X and Y position based on mousemove
            $(ob).bind("mousemove",track);
            // start polling interval (self-calling timeout) to compare mouse coordinates over time
            if (ob.hoverIntent_s != 1) {
                ob.hoverIntent_t = setTimeout( function(){
                    compare(ev,ob);
                } , cfg.interval );
            }

        // else e.type == "onmouseout"
        } else {
            // unbind expensive mousemove event
            $(ob).unbind("mousemove",track);
            // if hoverIntent state is true, then call the mouseOut function after the specified delay
            if (ob.hoverIntent_s == 1) {
                ob.hoverIntent_t = setTimeout( function(){
                    delay(ev,ob);
                } , cfg.timeout );
            }
        }
    };

    // bind the function to the two event listeners
    return this.mouseover(handleHover).mouseout(handleHover);
};

})(jQuery);

function startScroll() {

        var api = $("#scroll").scrollable({
        easing: 'swing',
        speed: 0,
         circular: true,
        items: '#tools'
        ,
        onBeforeSeek: function () {
            /*
            n=this.getIndex();
            $('#tools .tool:eq('+n+')').animate(
            {
                opacity: 0
            },
            {
                duration: 600,
                specialEasing: {
                    opacity: 'easeOutSine'
                }
            });
*/
        }
        ,
        onSeek: function () {

            n=this.getIndex();
            $('#tools .tool').not('#tools .tool:eq('+n+')').animate(
            {
                opacity: 0
            },
            {
                duration: 0,
                specialEasing: {
                    opacity: 'easeOutExpo'
                }
            });



            $('#tools .tool:eq('+n+')').css('display','block');
            $('#tools .tool:eq('+n+')').animate(
            {
                opacity: 1
            },
            {
                duration: 2000,
                specialEasing: {
                    opacity: 'easeOutExpo'
                },
                complete: function() {

                    $('#tools .tool').not('#tools .tool:eq('+n+')').css('display','none');
                }
            });


        }


    }).autoscroll({

}).navigator({
}).data("scrollable");
    $("#t0").click();
   $(".navi a").click(function() {
           api.stop();
        });

/*
    api.onBeforeSeek(function(e, i) {

        if (i) {
            $("#intro").fadeOut("slow");
            if ($.browser.msie && $.browser.version < 8) {
                $("#intro").hide();
            }
        } else {
            $("#intro").fadeIn(1000);

        }
        $("#t0").toggleClass("active", i == 0);
    });

    $("#t0").click(function() {

        $("#scroll").scrollable().begin();

    });
*/
}



/***************************************************
 * startskripte
 ***************************************************/

jQuery(document).ready(function(){

startScroll();

    /* ############### menu ###### */

    $("ul.sf-menu").supersubs({
        minWidth:    12,   // minimum width of sub-menus in em units
        maxWidth:    50,   // maximum width of sub-menus in em units
        extraWidth:  1     // extra width can ensure lines don't sometimes turn over
    // due to slight rounding differences and font-family
    }).superfish({
        delay:       10,                            // one second delay on mouseout
        //  animation:   {opacity:'show',height:'show'},  // fade-in and slide-down animation
        animation:   {
            opacity:'show'
        },  // fade-in and slide-down animation
        speed:       50,                          // faster animation speed
        autoArrows:  true,                           // disable generation of arrow mark-up
        dropShadows: true

    });  // call supersubs first, then superfish, so that subs are
    // not display:none when measuring. Call before initialising
    // containing tabs for same reason.

//polarize();
	if ($('#slider').length > 0 && $('.sliderElement').length > 0) {
		$('#slider').navSlider({
			elementClass: 'sliderElement',
			menuClass: 'sliderNavElement',
			rootId: 'slider',
			navId: 'sliderNav'	
		});
	}
	
	if ($('#slider').length > 0 && $('.sliderScrollable').length > 0) {
		$('#sliderThumbnails').scrollable({
			onBeforeSeek: function(event, i, time) {
				if (this.getSize()-i < 5) {
					return false;
				}
			}
		});
		
		$('.sliderScrollable').scrollableSlider({
			thumbnails: 'sliderThumbnails',
			zoomImages: 'sliderImagesZoom'
		});

		$('#sliderImagesZoom img').each(function(index, item) {
			$(item).bind('focus click mouseup', function(event) {
				this.blur();	
			});
		})

	}	
	$('#sliderThumbnails img').each(function() {
			$('#sliderThumbnails').css('opacity', 0.9);
			$(this).css('opacity', 0.2);
            $(this).hover(function() {
				$('#sliderThumbnails').stop().fadeTo(100, 1.0);
                $(this).stop().fadeTo(50, 1.0);
            },
           function() {
			   $('#sliderThumbnails').stop().fadeTo(500, 0.9);
               $(this).stop().fadeTo(500, 0.2);
           });
        });
	
	
	/*
	$('#sliderImagesZoom').each(function() {
			
			$('#sliderThumbnails').css('opacity', 0.3);
            $(this).hover(function() {
				
                $('#sliderThumbnails').stop().fadeTo(100, 1.0);
            },
           function() {
			  
               $('#sliderThumbnails').stop().fadeTo(500, 0.3);
           });
        });

*/

	
	$("a[class~=imgPop]").fancybox({
					'transitionIn'		: 'fade',
					'transitionOut'		: 'elastic',
					'titlePosition' 	: 'inside',
					'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
						return '<span id="fancybox-title-inside">Bild ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
					},
					'onComplete'	:	function() {
			$("#fancybox-wrap").hover(function() {
				$("#fancybox-title").show();
			}, function() {
				$("#fancybox-title").hide();
			});
		}
	
	});	
	
	$.tools.dateinput.localize("de",  {
	   months:        'Januar,Februar,M&auml;rz,April,Mai,Juni,Juli,August,' +
	                   	'September,Oktober,November,Dezember',
	   shortMonths:   'Jan,Feb,M&auml;r,Apr,Mai,Jun,Jul,Aug,Sep,Okt,Nov,Dez',
	   days:          'Sonntag,Montag,Dienstag,Mittwoch,Donnerstag,Freitag,Samstag',
	   shortDays:     'So,Mo,Di,Mi,Do,Fr,Sa'
	});
	
	
	
	$(".dateInput").dateinput({ 
		lang: 'de', 
		format: 'dd.mm.yyyy'
	});
	


	if ($('#gutschein_form').length > 0) {
		
		$.tools.validator.localize("de", {
			':email'  		: 'Bitte geben Sie eine g&uuml;ltige email-Adresse an.',
			':number' 		: 'Bitte geben Sie hier nur einen Zahlenwert ein',
			'[max]'	 		: 'Der Wert darf maximal $1 betragen',
			'[min]'	 		: 'Der Wert muss mindestens $1 betragen',
			'[required]' 	: 'Bitte f&uuml;llen Sie dieses Feld aus!'
		});		

		var tabPage1 = $('#tabPage1').validator({lang: 'de'});		
		var tabPage2 = $('#tabPage2 input').validator({lang: 'de'});
		var tabPage3 = $('#tabPage3 input').validator({lang: 'de'});
		var tabPage4 = $('#tabPage4').validator({lang: 'de'});
		
		gutschein_formTabs = jQuery("#gutschein_formTabs").accessibleTabs({
			fx:"show",
			fxspeed: '', 
			syncheights: false, 
			tabhead: '.tab-headline', 
			tabbody:'.tab-content',
			validators: [tabPage1,tabPage2,tabPage3,tabPage4]
		});		
				
		$('#gutschein_form').multiSiteForm({
			rootId: 'gutschein_form',
			couponClass: 'coupon',
			couponHiddenValue: 'couponHiddenValue',
			tabs: 'gutschein_formTabs',
			aTabs: gutschein_formTabs,
			prevButtons: 'buttonPrev',
			nextButtons: 'buttonNext',
			nameSource: 'receiver_name',
			nameSpans: 'receiverName',
			nameInputs: 'receiverNameInput',
			validators: [tabPage1,tabPage2,tabPage3,tabPage4]
		});
		

	}
	

    $('#captcha').bind('loaded.simpleCaptcha', function() {

        $('.captchaImages img').click(function() {
            $('.simpleCaptchaInput').val($(this).attr('title'));
            $(this).parents('form').submit();
        });
    })
    .simpleCaptcha({
        numImages: 8,
        introText: '<p>Zum Absenden klicken Sie bitte auf <strong class="captchaText"></strong></p>'
    });

});

	
	
	
	
