(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));

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(b){for(var a in b){this.options[a]=b[a]}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(b,d){var e=new RegExp("\\b"+this.options.hyperlinkClass+"\\b");for(var c=0;c<b.length;c++){if((d&&e.test(b[c].className))||!d){if(this.iphone&&!d){this.mobile(b[c])}else{this.disable(b[c]);this.setup(b[c])}if(!d){this.buttons.push(b[c])}}}},mobile:function(e){var d=document.createElement("input");d.setAttribute("type",e.getAttribute("type")=="submit"?"submit":"button");var c=new Array("id","name","value","class","onclick","onmouseover","onmouseout","onpress","onfocus","onblur","onmouseup","onmousedown");for(var b=0;b<c.length;b++){if(e.getAttribute(c[b])){d.setAttribute(c[b],e.getAttribute(c[b]))}}d.style.marginLeft=e.style.marginLeft;d.style.marginRight=e.style.marginRight;e.parentNode.insertBefore(d,e)},remove:function(){for(var b=0;b<this.buttons.length;b++){this.buttons[b].parentNode.removeChild(this.buttons[b])}},disable:function(a){a.onselectstart=function(){return false};a.style.MozUserSelect="none";a.style.KhtmlUserSelect="none";a.style.UserSelect="none";a.style.cursor="default"},setup:function(a){if(document.all){if(a.tagName=="BUTTON"){a.attachEvent("onfocus",this.bind(this.toggle,this,a))}else{a.attachEvent("onmousedown",this.bind(this.toggle,this,a))}a.attachEvent("onmouseup",this.bind(this.toggle,this,a))}else{a.onfocus=function(){this.blur()}}},toggle:function(b,a){if(a.tagName!="BUTTON"&&a.tagName!="A"){while(a.tagName!="A"){a=a.parentNode}}if(event.type=="focus"||event.type=="mousedown"){a.className+=" "+b.options.activeButtonClass;b.style(a.childNodes[0],b.options.states.inner.active);b.style(a.childNodes[0].childNodes[0],b.options.states.outer.active);a.blur()}else{a.className=a.className.replace(b.options.activeButtonClass,"");b.style(a.childNodes[0],b.options.states.inner.inactive);b.style(a.childNodes[0].childNodes[0],b.options.states.outer.inactive)}},style:function(c,b){for(var a in b){c.style[a]=b[a]}},bind:function(d){var c=[];for(var b=1;b<arguments.length;b++){c.push(arguments[b])}return function(){return d.apply(this,c)}}};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;}}window.onload = function() {SimplyButtons.init({states:{outer:{active:{backgroundPosition: 'left -372px'},inactive: {backgroundPosition: 'left -349px'}},inner:{active:{backgroundPosition: 'right -372px'},inactive:{backgroundPosition: 'right -349px'}}}});};

/*
 *
 * 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 show(element){$(element).addClass("hover")}
function hide(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;
        });
    });
});

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);
    })
  })
};

$(document).ready(function() {
    $('#newsticker ul').newsTicker(2000);
});