(function(C){var s="colorbox",q="hover",y=true,Q=false,V,o=!C.support.opacity,S=o&&!window.XMLHttpRequest,z="cbox_open",K="cbox_load",v="cbox_complete",J="cbox_cleanup",p="cbox_closed",N="resize.cbox_resize",H,T,U,d,A,l,b,G,c,O,E,h,g,t,k,n,L,m,I,u,W,j,f,a,r,i,B,P,x,M,D={transition:"elastic",speed:350,width:Q,height:Q,innerWidth:Q,innerHeight:Q,initialWidth:"400",initialHeight:"400",maxWidth:Q,maxHeight:Q,scalePhotos:y,scrolling:y,inline:Q,html:Q,iframe:Q,photo:Q,href:Q,title:Q,rel:Q,opacity:0.9,preloading:y,current:"image {current} of {total}",previous:"previous",next:"next",close:"close",open:Q,overlayClose:y,slideshow:Q,slideshowAuto:y,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",onOpen:Q,onLoad:Q,onComplete:Q,onCleanup:Q,onClosed:Q};function F(X,Y){Y=Y==="x"?O.width():O.height();return(typeof X==="string")?Math.round((X.match(/%/)?(Y/100)*parseInt(X,10):parseInt(X,10))):X}function w(X){X=C.isFunction(X)?X.call(r):X;return P.photo||X.match(/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i)}function R(){for(var X in P){if(C.isFunction(P[X])&&X.substring(0,2)!=="on"){P[X]=P[X].call(r)}}P.rel=P.rel||r.rel;P.href=P.href||r.href;P.title=P.title||r.title}function e(X){r=X;P=C(r).data(s);R();if(P.rel&&P.rel!=="nofollow"){c=C(".cboxElement").filter(function(){var Y=C(this).data(s).rel||this.rel;return(Y===P.rel)});B=c.index(r);if(B<0){c=c.add(r);B=c.length-1}}else{c=C(r);B=0}if(!x){x=y;M=y;i=r;i.blur();C(document).bind("keydown.cbox_close",function(Y){if(Y.keyCode===27){Y.preventDefault();V.close()}}).bind("keydown.cbox_arrows",function(Y){if(c.length>1){if(Y.keyCode===37){Y.preventDefault();I.click()}else{if(Y.keyCode===39){Y.preventDefault();m.click()}}}});if(P.overlayClose){H.css({cursor:"pointer"}).one("click",V.close)}C.event.trigger(z);if(P.onOpen){P.onOpen.call(r)}H.css({opacity:P.opacity}).show();P.w=F(P.initialWidth,"x");P.h=F(P.initialHeight,"y");V.position(0);if(S){O.bind("resize.cboxie6 scroll.cboxie6",function(){H.css({width:O.width(),height:O.height(),top:O.scrollTop(),left:O.scrollLeft()})}).trigger("scroll.cboxie6")}}n.add(I).add(m).add(L).add(k).hide();u.html(P.close).show();V.slideshow();V.load()}V=C.fn.colorbox=function(X,Z){var Y=this;if(!Y.length){if(Y.selector===""){Y=C("<a/>");X.open=y}else{return this}}Y.each(function(){var aa=C.extend({},C(this).data(s)?C(this).data(s):D,X);C(this).data(s,aa).addClass("cboxElement");if(Z){C(this).data(s).onComplete=Z}});if(X&&X.open){e(Y)}return this};V.init=function(){function X(Y){return C('<div id="cbox'+Y+'"/>')}O=C(window);T=C('<div id="colorbox"/>');H=X("Overlay").hide();U=X("Wrapper");d=X("Content").append(E=X("LoadedContent").css({width:0,height:0}),g=X("LoadingOverlay"),t=X("LoadingGraphic"),k=X("Title"),n=X("Current"),L=X("Slideshow"),m=X("Next"),I=X("Previous"),u=X("Close"));U.append(C("<div/>").append(X("TopLeft"),A=X("TopCenter"),X("TopRight")),C("<div/>").append(l=X("MiddleLeft"),d,b=X("MiddleRight")),C("<div/>").append(X("BottomLeft"),G=X("BottomCenter"),X("BottomRight"))).children().children().css({"float":"left"});h=C("<div style='position:absolute; top:0; left:0; width:9999px; height:0;'/>");C("body").prepend(H,T.append(U,h));if(o){T.addClass("cboxIE");if(S){H.css("position","absolute")}}d.children().bind("mouseover mouseout",function(){C(this).toggleClass(q)}).addClass(q);W=A.height()+G.height()+d.outerHeight(y)-d.height();j=l.width()+b.width()+d.outerWidth(y)-d.width();f=E.outerHeight(y);a=E.outerWidth(y);T.css({"padding-bottom":W,"padding-right":j}).hide();m.click(V.next);I.click(V.prev);u.click(V.close);d.children().removeClass(q);C(".cboxElement").live("click",function(Y){if(Y.button!==0&&typeof Y.button!=="undefined"){return y}else{e(this);return Q}})};V.position=function(ac,Z){var ab,Y=O.height(),aa=Math.max(Y-P.h-f-W,0)/2+O.scrollTop(),X=Math.max(document.documentElement.clientWidth-P.w-a-j,0)/2+O.scrollLeft();ab=(T.width()===P.w+a&&T.height()===P.h+f)?0:ac;U[0].style.width=U[0].style.height="9999px";function ad(ae){A[0].style.width=G[0].style.width=d[0].style.width=ae.style.width;t[0].style.height=g[0].style.height=d[0].style.height=l[0].style.height=b[0].style.height=ae.style.height}T.dequeue().animate({width:P.w+a,height:P.h+f,top:aa,left:X},{duration:ab,complete:function(){ad(this);M=Q;U[0].style.width=(P.w+a+j)+"px";U[0].style.height=(P.h+f+W)+"px";if(Z){Z()}},step:function(){ad(this)}})};V.resize=function(ab){if(!x){return}var ac,aa,Y,ae,ai,X,ag,Z=P.transition==="none"?0:P.speed;O.unbind(N);if(!ab){ag=setTimeout(function(){var aj=E.wrapInner("<div style='overflow:auto'></div>").children();P.h=aj.height();E.css({height:P.h});aj.replaceWith(aj.children());V.position(Z)},1);return}E.remove();E=C('<div id="cboxLoadedContent"/>').html(ab);function af(){P.w=P.w||E.width();P.w=P.mw&&P.mw<P.w?P.mw:P.w;return P.w}function ad(){P.h=P.h||E.height();P.h=P.mh&&P.mh<P.h?P.mh:P.h;return P.h}E.hide().appendTo(h).css({width:af(),overflow:P.scrolling?"auto":"hidden"}).css({height:ad()}).prependTo(d);C("#cboxPhoto").css({cssFloat:"none"});if(S){C("select:not(#colorbox select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one(J,function(){this.style.visibility="inherit"})}function ah(aj){V.position(aj,function(){if(!x){return}if(o){if(X){E.fadeIn(100)}T[0].style.removeAttribute("filter")}if(P.iframe){E.append("<iframe id='cboxIframe'"+(P.scrolling?" ":"scrolling='no'")+" name='iframe_"+new Date().getTime()+"' frameborder=0 src='"+P.href+"' "+(o?"allowtransparency='true'":"")+" />")}E.show();k.show().html(P.title);if(c.length>1){n.html(P.current.replace(/\{current\}/,B+1).replace(/\{total\}/,c.length)).show();m.html(P.next).show();I.html(P.previous).show();if(P.slideshow){L.show()}}g.hide();t.hide();C.event.trigger(v);if(P.onComplete){P.onComplete.call(r)}if(P.transition==="fade"){T.fadeTo(Z,1,function(){if(o){T[0].style.removeAttribute("filter")}})}if(jQuery.browser.version!=="7.0"){O.bind(N,function(){V.position(0)})}})}if((P.transition==="fade"&&T.fadeTo(Z,0,function(){ah(0)}))||ah(Z)){}if(P.preloading&&c.length>1){aa=B>0?c[B-1]:c[c.length-1];ae=B<c.length-1?c[B+1]:c[0];ai=C(ae).data(s).href||ae.href;Y=C(aa).data(s).href||aa.href;if(w(ai)){C("<img />").attr("src",ai)}if(w(Y)){C("<img />").attr("src",Y)}}};V.load=function(){var Y,X,aa,Z=V.resize;M=y;r=c[B];P=C(r).data(s);R();C.event.trigger(K);if(P.onLoad){P.onLoad.call(r)}P.h=P.height?F(P.height,"y")-f-W:P.innerHeight?F(P.innerHeight,"y"):Q;P.w=P.width?F(P.width,"x")-a-j:P.innerWidth?F(P.innerWidth,"x"):Q;P.mw=P.w;P.mh=P.h;if(P.maxWidth){P.mw=F(P.maxWidth,"x")-a-j;P.mw=P.w&&P.w<P.mw?P.w:P.mw}if(P.maxHeight){P.mh=F(P.maxHeight,"y")-f-W;P.mh=P.h&&P.h<P.mh?P.h:P.mh}Y=P.href;g.show();t.show();if(P.inline){C('<div id="cboxInlineTemp" />').hide().insertBefore(C(Y)[0]).bind(K+" "+J,function(){C(this).replaceWith(E.children())});Z(C(Y))}else{if(P.iframe){Z(" ")}else{if(P.html){Z(P.html)}else{if(w(Y)){X=new Image();X.onload=function(){var ab;X.onload=null;X.id="cboxPhoto";C(X).css({margin:"auto",border:"none",display:"block",cssFloat:"left"});if(P.scalePhotos){aa=function(){X.height-=X.height*ab;X.width-=X.width*ab};if(P.mw&&X.width>P.mw){ab=(X.width-P.mw)/X.width;aa()}if(P.mh&&X.height>P.mh){ab=(X.height-P.mh)/X.height;aa()}}if(P.h){X.style.marginTop=Math.max(P.h-X.height,0)/2+"px"}Z(X);if(c.length>1){C(X).css({cursor:"pointer"}).click(V.next)}if(o){X.style.msInterpolationMode="bicubic"}};X.src=Y}else{C("<div />").appendTo(h).load(Y,function(ab,ac){if(ac==="success"){Z(this)}else{Z(C("<p>Request unsuccessful.</p>"))}})}}}}};V.next=function(){if(!M){B=B<c.length-1?B+1:0;V.load()}};V.prev=function(){if(!M){B=B>0?B-1:c.length-1;V.load()}};V.slideshow=function(){var Y,X,Z="cboxSlideshow_";L.bind(p,function(){L.unbind();clearTimeout(X);T.removeClass(Z+"off "+Z+"on")});function aa(){L.text(P.slideshowStop).bind(v,function(){X=setTimeout(V.next,P.slideshowSpeed)}).bind(K,function(){clearTimeout(X)}).one("click",function(){Y();C(this).removeClass(q)});T.removeClass(Z+"off").addClass(Z+"on")}Y=function(){clearTimeout(X);L.text(P.slideshowStart).unbind(v+" "+K).one("click",function(){aa();X=setTimeout(V.next,P.slideshowSpeed);C(this).removeClass(q)});T.removeClass(Z+"on").addClass(Z+"off")};if(P.slideshow&&c.length>1){if(P.slideshowAuto){aa()}else{Y()}}};V.close=function(){C.event.trigger(J);if(P.onCleanup){P.onCleanup.call(r)}x=Q;C(document).unbind("keydown.cbox_close keydown.cbox_arrows");O.unbind(N+" resize.cboxie6 scroll.cboxie6");H.css({cursor:"auto"}).fadeOut("fast");T.stop(y,Q).fadeOut("fast",function(){C("#colorbox iframe").attr("src","about:blank");E.remove();T.css({opacity:1});try{i.focus()}catch(X){}C.event.trigger(p);if(P.onClosed){P.onClosed.call(r)}})};V.element=function(){return C(r)};V.settings=D;C(V.init)}(jQuery));

// jQuery Text Change Event
// http://www.zurb.com/playground/jquery-text-change-custom-event

(function(a){a.event.special.textchange={setup:function(){a(this).bind("keyup",a.event.special.textchange.handler);a(this).bind("cut paste input",a.event.special.textchange.delayedHandler)},teardown:function(){a(this).unbind("keyup",a.event.special.textchange.keyuphandler);a(this).unbind("cut",a.event.special.textchange.cuthandler)},handler:function(){a.event.special.textchange.triggerIfChanged(a(this))},delayedHandler:function(){var b=a(this);setTimeout(function(){a.event.special.textchange.triggerIfChanged(b)},
25)},triggerIfChanged:function(b){if(b.val()!==b.data("lastValue")){b.trigger("textchange",b.data("lastValue"));b.data("lastValue",b.val())}}};a.event.special.hastext={setup:function(){a(this).bind("textchange",a.event.special.hastext.handler)},teardown:function(){a(this).unbind("textchange",a.event.special.hastext.handler)},handler:function(b,c){a.event.special.hastext.check(a(this),c)},check:function(b,c){if((c===""||c===undefined)&&c!==b.val())b.trigger("hastext")}};a.event.special.notext={setup:function(){a(this).bind("textchange",
a.event.special.notext.handler)},teardown:function(){a(this).unbind("textchange",a.event.special.notext.handler)},handler:function(b,c){a(this).val()===""&&a(this).val()!==c&&a(this).trigger("notext")}}})(jQuery);

/*
 * jQuery 'onImagesLoaded' plugin v1.1.1 (Updated January 27, 2010)
 * Fires callback functions when images have loaded within a particular selector.
 *
 * Copyright (c) Cirkuit Networks, Inc. (http://www.cirkuit.net), 2008-2010.
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 *
 * For documentation and usage, visit "http://includes.cirkuit.net/includes/js/jquery/plugins/onImagesLoad/1.1.1/documentation/"
 */
(function($){
    $.fn.onImagesLoad = function(options){
        var self = this;
        self.opts = $.extend({}, $.fn.onImagesLoad.defaults, options);

        self.bindEvents = function($imgs, container, callback){
            if ($imgs.length === 0){ //no images were in selection. callback based on options
                if (self.opts.callbackIfNoImagesExist && callback){ callback(container); }
            }
            else {
                var loadedImages = [];
                if (!$imgs.jquery){ $imgs = $($imgs); }
                $imgs.each(function(i){
                    //webkit fix inspiration thanks to bmsterling: http://plugins.jquery.com/node/10312
                    var orgSrc = this.src;
                    if (!$.browser.msie) {
                        this.src = ""; //ie will do funky things if this is here (show the image as an X, only show half of the image, etc)
                    }
                    $(this).bind('load', function(){
                        if (jQuery.inArray(i, loadedImages) < 0){ //don't double count images
                            loadedImages.push(i); //keep a record of images we've seen
                            if (loadedImages.length == $imgs.length){
                                if (callback){ callback.call(container, container); }
                            }
                        }
                    });
                    if (!$.browser.msie) {
                        this.src = orgSrc; //needed for potential cached images
                    }
                    else if (this.complete || this.complete === undefined){ this.src = orgSrc; }
                });
            }
        };

        var imgAry = []; //only used if self.opts.selectorCallback exists
        self.each(function(){
            if (self.opts.itemCallback){
                var $imgs;
                if (this.tagName == "IMG"){ $imgs = this; } //is an image
                else { $imgs = $('img', this); } //contains image(s)
                self.bindEvents($imgs, this, self.opts.itemCallback);
            }
            if (self.opts.selectorCallback){
                if (this.tagName == "IMG"){ imgAry.push(this); } //is an image
                else { //contains image(s)
                    $('img', this).each(function(){ imgAry.push(this); });
                }
            }
        });
        if (self.opts.selectorCallback){ self.bindEvents(imgAry, this, self.opts.selectorCallback); }

        return self.each(function(){}); //dont break the chain
    };

    //DEFAULT OPTOINS
    $.fn.onImagesLoad.defaults = {
        selectorCallback: null,        //the function to invoke when all images that $(yourSelector) encapsultaes have loaded (invoked only once per selector. see documentation)
        itemCallback: null,            //the function to invoke when each item that $(yourSelector) encapsultaes has loaded (invoked one or more times depending on selector. see documentation)
        callbackIfNoImagesExist: false //if true, the callbacks will be invoked even if no images exist within $(yourSelector).
                                       //if false, the callbacks will not be invoked if no images exist within $(yourSelector).
    };
})(jQuery);

//  Simply Buttons, version 2.0
//  (c) 2007-2009 Kevin Miller
//
//  This script is freely distributable under the terms of an MIT-style license.
// 
/*-----------------------------------------------------------------------------------------------*/
// 
// * Adjusts the buttons so that they will not have an outline when they are pressed.
// * If the browser is mobile then we replace the buttons with inputs for compatibility.
// * Disables the text in the buttons from being selected.
// * The default styles here are meant for use with the Sliding Doors technique http://alistapart.com/articles/slidingdoors/
//     to be used for IE so we can have nice states with a horrid browser too!
//
/*-----------------------------------------------------------------------------------------------*/

var SimplyButtons = {
  
  options : {
    hyperlinkClass : 'button'
    ,activeButtonClass : 'button_active'
    ,states : {
      outer : {
        active : {
          backgroundPosition : 'bottom left'
        }
        ,inactive : {
          backgroundPosition : 'top left'
        }
      }
      ,inner : {
        active : {
          backgroundPosition : 'bottom right'
        }
        ,inactive : {
          backgroundPosition : 'top right'
        }
      }
    }
    ,iphone : {
      replaceButtons : true
    }
  }
  
  ,buttons : []
  
  ,iphone : false
  
  ,init : function(options)
  {
    for (var property in options)
    {
      this.options[property] = options[property];
    }
    
    this.iphone = (navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i));
    
    this.process(document.getElementsByTagName('button'), false);
    this.process(document.getElementsByTagName('a'), true);
    
    if (this.iphone && this.options.iphone.replaceButtons)
    {
      this.remove();
    }
  }

  ,process : function(elements, links)
  {
    var linkTest = new RegExp('\\b' + this.options.hyperlinkClass + '\\b');
    for (var a = 0; a < elements.length; a++)
    {
      if ((links && linkTest.test(elements[a].className)) || !links)
      {
        if (this.iphone && !links)
        {
          this.mobile(elements[a]);
        }
        else
        {
          this.disable(elements[a]);
          this.setup(elements[a]);
        }
        
        if (!links)
        {
          this.buttons.push(elements[a]);
        }
      }
    }
  }
  
  ,mobile : function(element)
  {
		var input = document.createElement('input');
		input.setAttribute('type', element.getAttribute('type') == 'submit' ? 'submit' : 'button');
    
		var attributes = new Array('id', 'name', 'value', 'class', 'onclick', 'onmouseover', 'onmouseout', 'onpress', 'onfocus', 'onblur', 'onmouseup', 'onmousedown');
		for (var a = 0; a < attributes.length; a++)
		{
			if (element.getAttribute(attributes[a]))
			{
				input.setAttribute(attributes[a], element.getAttribute(attributes[a])); 			
			}
		}
		
		input.style.marginLeft = element.style.marginLeft;
		input.style.marginRight = element.style.marginRight;

		element.parentNode.insertBefore(input, element);
		
	}
	
	,remove : function()
	{
	  for (var a = 0; a < this.buttons.length; a++)
    {
	    this.buttons[a].parentNode.removeChild(this.buttons[a]);
    }      
  }
   
  ,disable : function(element)
  {
    element.onselectstart = function() { return false; };
    element.style.MozUserSelect = 'none';
    element.style.KhtmlUserSelect = 'none';
    element.style.UserSelect = 'none';
    element.style.cursor = 'default';
  }
  
  ,setup : function(element) 
  {
    if (document.all)
    {
      if (element.tagName == 'BUTTON')
      {
        element.attachEvent('onfocus', this.bind(this.toggle, this, element));
      }
      else
      {
        element.attachEvent('onmousedown', this.bind(this.toggle, this, element));
      }
      element.attachEvent('onmouseup', this.bind(this.toggle, this, element));
    }
    else
    {
      element.onfocus = function() { this.blur(); };
    }
  }
  
  ,toggle : function(o, element)
  {
    if (element.tagName != 'BUTTON' && element.tagName != 'A')
    {
      while (element.tagName != 'A')
      {
        element = element.parentNode;
      }
    }
    if (event.type == 'focus' || event.type == 'mousedown')
    {
      element.className += ' ' + o.options.activeButtonClass;
      o.style(element.childNodes[0], o.options.states.inner.active);
      o.style(element.childNodes[0].childNodes[0], o.options.states.outer.active);
      element.blur();
    } 
    else
    {
      element.className = element.className.replace(o.options.activeButtonClass, '');
      o.style(element.childNodes[0], o.options.states.inner.inactive);
      o.style(element.childNodes[0].childNodes[0], o.options.states.outer.inactive);
    }
  }
  
  ,style : function(element, styles)
  {
    for (var property in styles)
    {
      element.style[property] = styles[property];
    }    
  }
  
  ,bind : function(func)
  {
    var args = [];
    for (var a = 1; a < arguments.length; a++)
    {
      args.push(arguments[a]);
    }
    return function() { return func.apply(this, args); };
  }
};

//window.onload = function() {SimplyButtons.init({states:{outer:{active:{backgroundPosition: 'left -372px'},inactive: {backgroundPosition: 'left -349px'}},inner:{active:{backgroundPosition: 'right -372px'},inactive:{backgroundPosition: 'right -349px'}}}});};


/*
 * jQuery EasIng v1.1.2 - http://gsgd.co.uk/sandbox/jquery.easIng.php
 *
 * Uses the built In easIng capabilities added In jQuery 1.1
 * to offer multiple easIng options
 *
 * Copyright (c) 2007 George Smith
 * Licensed under the MIT License:
 *   http://www.opensource.org/licenses/mit-license.php
 */

// t: current time, b: begInnIng value, c: change In value, d: duration

jQuery.extend( jQuery.easing,
{
	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;
	}
});

/*
    anythingSlider v1.2
    
    By Chris Coyier: http://css-tricks.com
    with major improvements by Doug Neiner: http://pixelgraphics.us/
    based on work by Remy Sharp: http://jqueryfordesigners.com/


	To use the navigationFormatter function, you must have a function that
	accepts two paramaters, and returns a string of HTML text.
	
	index = integer index (1 based);
	panel = jQuery wrapped LI item this tab references
	@return = Must return a string of HTML/Text
	
	navigationFormatter: function(index, panel){
		return index + " Panel"; // This would have each tab with the text 'X Panel' where X = index
	}
*/

(function($){
	
    $.anythingSlider = function(el, options){
        // To avoid scope issues, use 'base' instead of 'this'
        // to reference this class from internal events and functions.
        var base = this;
        
        // Access to jQuery and DOM versions of element
        base.$el = $(el);
        base.el = el; 

		// Set up a few defaults
        base.currentPage = 1;
		base.timer = null;
		base.playing = false;

        // Add a reverse reference to the DOM object
        base.$el.data("AnythingSlider", base);
        
        base.init = function(){
            base.options = $.extend({},$.anythingSlider.defaults, options);
			
			// Cache existing DOM elements for later 
			base.$wrapper = base.$el.find('> div').css('overflow', 'hidden');
            base.$slider  = base.$wrapper.find('> ul');
            base.$items   = base.$slider.find('> li');
            base.$single  = base.$items.filter(':first');

			// Build the navigation if needed
			if(base.options.buildNavigation) base.buildNavigation();
        
        	// Get the details
            base.singleWidth = base.$single.outerWidth();
            base.pages = base.$items.length;

            // Top and tail the list with 'visible' number of items, top has the last section, and tail has the first
			// This supports the "infinite" scrolling
			base.$items.filter(':first').before(base.$items.filter(':last').clone().addClass('cloned'));
            base.$items.filter(':last' ).after(base.$items.filter(':first').clone().addClass('cloned'));

			// We just added two items, time to re-cache the list
            base.$items = base.$slider.find('> li'); // reselect
            
			// Setup our forward/backward navigation
			base.buildNextBackButtons();
		
			// If autoPlay functionality is included, then initialize the settings
			if(base.options.autoPlay) {
				base.playing = !base.options.startStopped; // Sets the playing variable to false if startStopped is true
				base.buildAutoPlay();
			};
			
			// If pauseOnHover then add hover effects
			if(base.options.pauseOnHover) {
				base.$el.hover(function(){
					base.clearTimer();
				}, function(){
					base.startStop(base.playing);
				});
			}
			
			// If a hash can not be used to trigger the plugin, then go to page 1
			if((base.options.hashTags == true && !base.gotoHash()) || base.options.hashTags == false){
				base.setCurrentPage(1);
			};
        };

		base.gotoPage = function(page, autoplay){
			// When autoplay isn't passed, we stop the timer
			if(autoplay !== true) autoplay = false;
			if(!autoplay) base.startStop(false);
			
			if(typeof(page) == "undefined" || page == null) {
				page = 1;
				base.setCurrentPage(1);
			};
			
			// Just check for bounds
			if(page > base.pages + 1) page = base.pages;
			if(page < 0 ) page = 1;

			var dir = page < base.currentPage ? -1 : 1,
                n = Math.abs(base.currentPage - page),
                left = base.singleWidth * dir * n;
			
			base.$wrapper.filter(':not(:animated)').animate({
                scrollLeft : '+=' + left
            }, base.options.animationTime, base.options.easing, function () {
                if (page == 0) {
                    base.$wrapper.scrollLeft(base.singleWidth * base.pages);
					page = base.pages;
                } else if (page > base.pages) {
                    base.$wrapper.scrollLeft(base.singleWidth);
                    // reset back to start position
                    page = 1;
                };
				base.setCurrentPage(page);
				
            });
		};
		
		base.setCurrentPage = function(page, move){
			// Set visual
			if(base.options.buildNavigation){
				base.$nav.find('.cur').removeClass('cur');
				$(base.$navLinks[page - 1]).addClass('cur');	
			};
			
			// Only change left if move does not equal false
			if(move !== false) base.$wrapper.scrollLeft(base.singleWidth * page);

			// Update local variable
			base.currentPage = page;
		};
		
		base.goForward = function(autoplay){
			if(autoplay !== true) autoplay = false;
			base.gotoPage(base.currentPage + 1, autoplay);
		};
		
		base.goBack = function(){
			base.gotoPage(base.currentPage - 1);
		};
		
		// This method tries to find a hash that matches panel-X
		// If found, it tries to find a matching item
		// If that is found as well, then that item starts visible
		base.gotoHash = function(){
			if(/^#?panel-\d+$/.test(window.location.hash)){
				var index = parseInt(window.location.hash.substr(7));
				var $item = base.$items.filter(':eq(' + index + ')');
				if($item.length != 0){
					base.setCurrentPage(index);
					return true;
				};
			};
			return false; // A item wasn't found;
		};
        
		// Creates the numbered navigation links
		base.buildNavigation = function(){
			base.$nav = $("<div id='thumbNav'></div>").appendTo(base.$el);
			base.$items.each(function(i,el){
				var index = i + 1;
				var $a = $("<a href='#'></a>");
				
				// If a formatter function is present, use it
				if( typeof(base.options.navigationFormatter) == "function"){
					$a.html(base.options.navigationFormatter(index, $(this)));
				} else {
					$a.text(index);
				}
				$a.click(function(e){
                    base.gotoPage(index);
                    
                    if (base.options.hashTags)
						base.setHash('panel-' + index);
						
                    e.preventDefault();
				});
				base.$nav.append($a);
			});
			base.$navLinks = base.$nav.find('> a');
		};
		
		
		// Creates the Forward/Backward buttons
		base.buildNextBackButtons = function(){
			var $forward = $('<a class="arrow forward"></a>'),
				$back    = $('<a class="arrow back"></a>');
				
				    base.$el.mouseover(function(){
				      $forward.addClass('forward_hover');
				      $back.addClass('back_hover')
				    });
				    base.$el.mouseout(function(){
				      $forward.removeClass('forward_hover');
				      $back.removeClass('back_hover')
				    });
				
            // Bind to the forward and back buttons
            $back.click(function(e){
                base.goBack();
				e.preventDefault();
            });

            $forward.click(function(e){
                base.goForward();
				e.preventDefault();
            });

			// Append elements to page
			base.$wrapper.after($back).after($forward);
		};
		
		// Creates the Start/Stop button
		base.buildAutoPlay = function(){
      
  			base.$startStop = $("<a href='#' id='start-stop'></a>").html(base.playing ? base.options.stopText :  base.options.startText);
	 		  base.$el.append(base.$startStop);            
        base.$startStop.click(function(e){
				  base.startStop(!base.playing);
				  e.preventDefault();
        });
      
      
			// Use the same setting, but trigger the start;
			base.startStop(base.playing);
		};
		
		// Handles stopping and playing the slideshow
		// Pass startStop(false) to stop and startStop(true) to play
		base.startStop = function(playing){
			if(playing !== true) playing = false; // Default if not supplied is false
			
			// Update variable
			base.playing = playing;
			
			// Toggle playing and text
			if(base.options.autoPlay) base.$startStop.toggleClass("playing", playing).html( playing ? base.options.stopText : base.options.startText );
			
			if(playing){
				base.clearTimer(); // Just in case this was triggered twice in a row
				base.timer = window.setInterval(function(){
					base.goForward(true);
				}, base.options.delay);
			} else {
				base.clearTimer();
			};
		};
		
		base.clearTimer = function(){
			// Clear the timer only if it is set
			if(base.timer) window.clearInterval(base.timer);
		};
		
		// Taken from AJAXY jquery.history Plugin
		base.setHash = function ( hash ) {
			// Write hash
			if ( typeof window.location.hash !== 'undefined' ) {
				if ( window.location.hash !== hash ) {
					window.location.hash = hash;
				};
			} else if ( location.hash !== hash ) {
				location.hash = hash;
			};
			
			// Done
			return hash;
		};
		// <-- End AJAXY code


		// Trigger the initialization
        base.init();
    };

	
    $.anythingSlider.defaults = {
        easing: "swing",                // Anything other than "linear" or "swing" requires the easing plugin
        autoPlay: true,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not
        startStopped: false,            // If autoPlay is on, this can force it to start stopped
        delay: 3000,                    // How long between slide transitions in AutoPlay mode
        animationTime: 600,             // How long the slide transition takes
        hashTags: true,                 // Should links change the hashtag in the URL?
        buildNavigation: true,          // If true, builds and list of anchor links to link to each slide
        pauseOnHover: true,             // If true, and autoPlay is enabled, the show will pause on hover
		startText: "Start",             // Start text
		stopText: "Stop",               // Stop text
		navigationFormatter: null       // Details at the top of the file on this use (advanced use)
    };
	

    $.fn.anythingSlider = function(options){
		if(typeof(options) == "object"){
		    return this.each(function(i){			
				(new $.anythingSlider(this, options));

	            // This plugin supports multiple instances, but only one can support hash-tag support
				// This disables hash-tags on all items but the first one
				options.hashTags = false;
	        });	
		} else if (typeof(options) == "number") {

			return this.each(function(i){
				var anySlide = $(this).data('AnythingSlider');
				if(anySlide){
					anySlide.gotoPage(options);
				}
			});
		}
    };

	
})(jQuery);

/*
 *
 * Copyright (c) 2006/2007 Sam Collett (http://www.texotela.co.uk)
 * Licensed under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 * 
 * Version 2.0
 * Demo: http://www.texotela.co.uk/code/jquery/newsticker/
 *
 * $LastChangedDate: 2007-05-29 11:31:36 +0100 (Tue, 29 May 2007) $
 * $Rev: 2005 $
 *
 */
 
(function($) {
/*
 * A basic news ticker.
 *
 * @name     newsticker (or newsTicker)
 * @param    delay      Delay (in milliseconds) between iterations. Default 4 seconds (4000ms)
 * @author   Sam Collett (http://www.texotela.co.uk)
 * @example  $("#news").newsticker(); // or $("#news").newsTicker(5000);
 *
 */
$.fn.newsTicker = $.fn.newsticker = function(delay)
{
	delay = delay || 4000;
	initTicker = function(el)
	{
		stopTicker(el);
		el.items = $("li", el);
		// hide all items (except first one)
		el.items.not(":eq(0)").hide().end();
		// current item
		el.currentitem = 0;
		$(el.parentNode).show();
		startTicker(el);
	};
	startTicker = function(el)
	{
		el.tickfn = setInterval(function() { doTick(el) }, delay)
	};
	stopTicker = function(el)
	{
		clearInterval(el.tickfn);
	};
	pauseTicker = function(el)
	{
		el.pause = true;
	};
	resumeTicker = function(el)
	{
		el.pause = false;
	};
	doTick = function(el)
	{
		// don't run if paused
		if(el.pause) return;
		// pause until animation has finished
		el.pause = true;
		// hide current item
		$(el.items[el.currentitem]).fadeOut("slow",
			function()
			{
				$(this).hide();
				// move to next item and show
				el.currentitem = ++el.currentitem % (el.items.size());
				$(el.items[el.currentitem]).fadeIn("slow",
					function()
					{
						el.pause = false;
					}
				);
			}
		);
	};
	this.each(
		function()
		{
			if(this.nodeName.toLowerCase()!= "ul") return;
			initTicker(this);
		}
	)
	.addClass("newsticker")
	.hover(
		function()
		{
			// pause if hovered over
			pauseTicker(this);
		},
		function()
		{
			// resume when not hovered over
			resumeTicker(this);
		}
	);
	return this;
};

})(jQuery);

function showMenu(element){$(element).addClass("hover")}
function hideMenu(element){$(element).removeClass("hover")}

$(function () {
    $('.popupBubble').each(function () {
        var distance = 6;
        var time = 0;
        var hideDelay = 0;
    
        var hideDelayTimer = null;
    
        var beingShown = false;
        var shown = false;
        var trigger = $(this);
        var info = $('.popup', this);
        
        $([trigger.get(0), info.get(0)]).mouseover(function () {
            if (hideDelayTimer) clearTimeout(hideDelayTimer);
            if (beingShown || shown) {
                // don't trigger the animation again
                return;
            } else {
                // reset position of info box
                beingShown = true;

                info.css({
                    top: 20,
                    display: 'block'
                }).animate({
                    top: '-=' + distance + 'px'
                }, time, 'swing', function() {
                    beingShown = false;
                    shown = true;
                });
            }
    
            return false;
        }).mouseout(function () {
            if (hideDelayTimer) clearTimeout(hideDelayTimer);
            hideDelayTimer = setTimeout(function () {
                hideDelayTimer = null;
                info.animate({
                    top: '-=' + distance + 'px'
                }, time, 'swing', function () {
                    shown = false;
                    info.css('display', 'none');
                });
    
            }, hideDelay);
    
            return false;
        });
    });
});

/*
* http://github.com/MrHus/jquery-monthly-ical
*
* @author Maarten Hus
*/
(function($)
{
    var eventdates = {};
    
    $.fn.ical = function(options) 
    {
        $.fn.ical.defaults = {
           daynames: ['Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa', 'So'], //default short names for the days of the week
           monthnames: ['Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez'],
           startdate: new Date(), // The date the calender should take as start point
           eventdates: {},
           beforeDay: function (insdate) {},
           beforeMonth: function(insdate) {},
           beforeYear: function(insdate) {}
        };
        
        var options = $.extend({}, $.fn.ical.defaults, options);
          
        return this.each(function() 
        {
            var obj = $(this); //get the object
            eventdates = options.eventdates;
            
            var insdate = options.startdate; //The date that gets used for calculating the month
            createCalendar(obj, insdate);
        });
        
        /**
        * Create the calendar
        */
        function createCalendar(obj, insdate)
        {
            obj.html('');
            createNavigation(obj, insdate);
            createTable(obj); //create table
            addDatesToTable(obj, insdate);
            codabubble();
        };
        
        /**
        * Create the navigation and handle its clicks
        */
        function createNavigation(obj, insdate)
        {
            obj.append("<div id='ical_head'><a id='icalprev' href='javascript:void(0)'></a><div id='ical_monthyear'><span id='currentmonth'>"+ options.monthnames[insdate.getMonth()] +"</span> <span id='currentyear'>"+ insdate.getFullYear() +"</span></div><a id='icalnext' href='javascript:void(0)'></a></div>");
                      
            $("#icalnext", obj).click(function()
            {
                var month = insdate.getMonth() + 1;
                
                if(month > 11)
                {
                    month = 0;
                    var year = insdate.getFullYear() + 1;
                    options.beforeYear(formatDate(year, month, 1));
                }
                else
                {
                    var year = insdate.getFullYear();    
                }
                
                options.beforeMonth(formatDate(year, month, 1));
                                
                date2 = new Date(year, month, 1);
                createCalendar(obj, date2);
            }); 
            
            $("#icalprev", obj).click(function()
            {
                var month = insdate.getMonth() - 1;
                
                if(month < 0)
                {
                    month = 11;
                    var year = insdate.getFullYear() - 1;
                    options.beforeYear(formatDate(year, month, 1));
                }
                else
                {
                    var year = insdate.getFullYear();    
                }
                
                options.beforeMonth(formatDate(year, month, 1));
                
                date2 = new Date(year, month, 1);
                createCalendar(obj, date2);
            });         
        };
        
        /**
        * Create the table for the calendar
        */
        function createTable(obj)
        {
            obj.append("<table cellspacing='0'><thead><tr></tr></thead></table>"); //add a table 
            
            for (var i = 0; i < options.daynames.length; i++) 
            {
               $("table tr", obj).append("<th>"+ options.daynames[i] +"</th>"); //add the day header
            }
        };
        
        function addDatesToTable(obj, insdate)
        {
            var month = insdate.getMonth();
            var year  = insdate.getFullYear();
            
            var days = getDaysInMonth(year, month);
            var first = getFirstDayOfMonth(year, month); // 0 - 6
            var last = getLastDayOfMonth(year, month, days);// 0 - 6 
            
            var afterpadding = 6 - last; // week minus the last day of the month = afterpadding
            
            var firstrow = true;
            
            for (var i = 1; i <= days; i++) //each day in month
            {
                if((first + i - 1) % 7 === 0 || firstrow === true ) //add new tr for each new monday our if $i is zero
                {
                    $("table", obj).append("<tr></tr>");
                }
                
                for(var j = 0; j < first && firstrow; j++) //add pre padding
                {
                    $("table tr:last, obj").append("<td class = 'padding'></td>");
                }
                
                firstrow = false; //no more pre padding
                
                var month = getMonthNumber($("#currentmonth", obj).text());
                var year = $("#currentyear", obj).text();
                
                var formatdate = formatDate(year, month, i);
                
                var datejson = isEventDate(formatdate)
             
                if (i < 10)
                  k = "0" + i;
                else
                  k = i;
                
                if(!datejson)
                {
                    options.beforeDay(formatdate);
                    $("table tr:last, obj").append('<td id="' + formatdate + '">' + k + '</td>'); //add day
                }
                else
                {
                    options.beforeDay(formatdate);
                    $("table tr:last, obj").append("<td class='date_has_event' align='center' id='"+formatdate+"'>" + k + '<div class="popup_posabs"> \
                        <div class="popup"> \
                            <div class="popup_ur"></div> \
                            <div class="popup_lr"> \
                                <div class="popup_cnt"> \
                                  <span class="ical_duration">' + datejson.duration + '</span><br/> \
                                  <a href="' + datejson.link + '"> \
                                    <span class="ical_title">' + datejson.title + '</span><br/> \
                                    <span class="ical_more smallarrow">mehr</span> \
                                  </a> \
                                </div> \
                            </div> \
                            <div class="popup_ll"></div> \
                            <div class="popup_arrow"></div> \
                        </div> \
                      </div> \
                    </td>'); //add day
                }
            };
            
            for (var i = 0; i < afterpadding; i++) //add after padding
            {
                $("table tr:last, obj").append("<td class = 'padding'></td>");
            }
            
            highlightToday(obj);
        };
        
        function getMonthNumber(month)
        {
            for (var i = 0; i < options.monthnames.length; i++)
            {
                if(options.monthnames[i] === month)
                {
                    return i;
                }
            }
        };
        
        function getDaysInMonth(year, month)
        {
            return 32 - new Date(year, month, 32).getDate();
        };
        
        function highlightToday(obj)
        {
            var today = new Date();
            today = formatDate(today.getFullYear(), today.getMonth(), today.getDate());
            $("#"+today, obj).addClass("today");
        };
        
        function isEventDate(date) 
        {     
            for (var eventdate in eventdates['dates'])
            {     
                var evaldate = evaluateEventDate(eventdate, date);
                if(date === evaldate)
                {
                   return eventdates.dates[eventdate]; 
                } 
            }
            
            return false;
        };
        
        function evaluateEventDate(eventdate, date)
        {
            var eventdate = eventdate.split('-');
            var date = date.split('-');
            
            if(eventdate[0] === 'yyyy')
            {
                eventdate[0] = date[0];
            }
            
            if (eventdate[1] === 'mm') 
            {
                eventdate[1] = date[1];
            }
            
            if(eventdate[2] === 'dd')
            {
                eventdate[2] = date[2];
            }
            
            return eventdate[0]+'-'+eventdate[1]+'-'+eventdate[2];
        };
        
        function getLastDayOfMonth(year, month, days)
        {
            var date = new Date(year, month, days);
            if(date.getDay() == 0)//we start on monday!
            {
                return 6;
            }
            else
            {
                return date.getDay() -1;
            }
        };
            
        function getFirstDayOfMonth(year, month)
        {
            var date = new Date(year, month, 1);
            if(date.getDay() == 0) //we start on monday!
            {
                return 6;
            }
            else
            {
                return date.getDay() -1;
            }
        };
        
        function formatDate (year, month, day) 
        {    
            return year+'-'+formatMonth(month)+'-'+formatDay(day);
        };
        
        function formatMonth(month)
        {
            month = month + 1;
            
            if (month < 10)
            {
                month = '0'+month;
            }
            
            return month; 
        };
        
        function formatDay(day)
        {
            if (day < 10) 
            {
                day = '0'+day;
            }
            
            return day;
        };
        
        function codabubble() //Stefano Verna
        {
            $('.date_has_event').each(function () {
              var distance = 0;
              var time = 0;
              var hideDelay = 0;
          
              var hideDelayTimer = null;
          
              var beingShown = false;
              var shown = false;
              var trigger = $(this);
              var info = $('.popup', this);
              
              $([trigger.get(0), info.get(0)]).mouseover(function () {
                  if (hideDelayTimer) clearTimeout(hideDelayTimer);
                  if (beingShown || shown) {
                      // don't trigger the animation again
                      return;
                  } else {
                      // reset position of info box
                      beingShown = true;
      
                      info.css({
                          top: '-1px',
                          display: 'block'
                      }).animate({
                          top: '-=' + distance + 'px'
                      }, time, 'swing', function() {
                          beingShown = false;
                          shown = true;
                      });
                  }
          
                  return false;
              }).mouseout(function () {
                  if (hideDelayTimer) clearTimeout(hideDelayTimer);
                  hideDelayTimer = setTimeout(function () {
                      hideDelayTimer = null;
                      info.animate({
                          top: '-=' + distance + 'px'
                      }, time, 'swing', function () {
                          shown = false;
                          info.css('display', 'none');
                      });
          
                  }, hideDelay);
          
                  return false;
              });
            });
        }
    };
    
    $.fn.ical.changeEventDates = function(array){
       eventdates = array;
    };
    
})(jQuery);

function getDpCmtCount (guid, link, type) {
  if (!type) { var type = "list" };
  $.getJSON("http://www.dentapress.de/?cmtcount=" + type + "&guid=" + guid + "&call_back=?", function(data){
    $.each(data, function(key, val){
      cmtcnt = $("#cmtcnt-" + key);
      switch(val.count) {
        case "0":
          val.count = "Kommentieren";
          break;
        case "1":
          val.count = "1 Kommentar";
          break;
        default:
          val.count = val.count + " Kommentare"; 
      }
      $(cmtcnt).html(val.count);
    })
  })
};

function tx_wtdirectory_autocomplete(ctrlId, acId, pid, cat, field) {
  $("input#" + ctrlId).autocomplete({
		// TODO doesn't work when loaded from /demos/#autocomplete|remote
		source: 'index.php?eID=wtdirectory_autocomplete&pid=' + pid + '&field=' + field + '&cat=' + cat,
		minLength: 2,
		select: function(event, ui) {
      console.log(ui);
		}
	});
}

function keyPress(myfield, e){
  var keycode;
  if (window.event) keycode = window.event.keyCode;
  else if (e) keycode = e.which;
  else return true;
  if (keycode == 13){
    myfield.form.submit();
    return false;
  } else {
    return true;
  }
}

/*
$(document).ready(function()
{  
  $("#ical").ical({
    startdate: new Date(2008, 8, 9), //month starts at 0 so 11 is december
    eventdates: {"dates":
      { 
        "2008-09-09": {"duration": "09.09.2009 - 12.09.2009", "title": "FDI Kongress Singapur", "link": "#"}
      }
    }    
  })
});
*/

function anythingSliderImagesLoaded() {
  $('.anythingSlider').anythingSlider({
    easing: "easeInOutExpo",        // Anything other than "linear" or "swing" requires the easing plugin
    autoPlay: true,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not.
    delay: 6000,                    // How long between slide transitions in AutoPlay mode
    startStopped: false,            // If autoPlay is on, this can force it to start stopped
    animationTime: 1200,             // How long the slide transition takes
    hashTags: false,                 // Should links change the hashtag in the URL?
    buildNavigation: false,          // If true, builds and list of anchor links to link to each slide
    pauseOnHover: true             // If true, and autoPlay is enabled, the show will pause on hover
  })
};

function dcsMultiTrack(){}

$(function () {  
/*  $("#ical").ical() */
  
  $('ul', '#newsticker').newsTicker(2000);
  
  $('#searchButton', '#menu').toggle(function() {
    $('#searchbox', '#menu').show();
  }, function() {
    $('#searchbox', '#menu').hide();
  });

  ssP('#socialprivacy_head', '262112243819299');
  ssP('#socialprivacy_bottom', '262112243819299');
  ssPLikeBox('#facebook_likebox', 'dentsde');
}); 

OA_zones = {
  'LB Startseite' : 15,
  'LB Unterseite' : 14,
  'CR Startseite' : 26,
  'CR Unterseite' : 27,
  'SKY Startseite' : 9,
  'SKY Unterseite' : 11,
  'Partner1' : 39,
  'Partner2' : 39,
  'Partner3' : 39,
  'Partner4' : 39,
  'Partner5' : 39,
  'Partner6' : 39,
  'Partner7' : 39,
  'Partner8' : 39,
  'Partner9' : 39,
  'Partner10' : 39,
  'Partner11' : 39,
  'Partner12' : 39,
  'Partner13' : 39,
  'Partner14' : 39,
  'Partner15' : 39,
  'Partner16' : 39,
  'Partner17' : 39,
  'Partner18' : 39,
  'Partner19' : 39,
  'Partner20' : 39,
  'Partner21' : 39,
  'Partner22' : 39,
  'Partner23' : 39,
  'Partner24' : 39,
  'Partner25' : 39
}

