$.log = function(text) {
    if((window.console !== undefined) && false) {
        console.log(text);
    }
    return true;
};


jQuery().ready(function(){   
    if($("#AssistEditing").length > 0) {
        $("#AssistEditing script").remove();
        $("#assist_area").append($("#AssistEditing").html());
        $("#AssistEditing").remove();
        $("#printContact.assist_box:first").remove();
    }
    /**** init actions ****/
    $(".extendedtext").hide("0",function (){ $(".splitteaser").css("position", "static").css("position", "relative"); });


    $("a.showtext").show('fast');
    $(".tripple > div:not(.active)").hide();
    $("#navigation li ul:not('.active')").hide();
    $(".navbar").show();
    $("body").append('<div class="hiddenHoverBlock"></div><!-- Event Calendar Div -->');    

    navigationHeight = $("#navigation").height();
    $("#content-container").css( "min-height", navigationHeight+ 80 +"px" );

    var browser;
    browser = navigator.userAgent.substring(25,31);   
    //alert(browser);
    
    if ((browser == "MSIE 6")||(browser == "MSIE 5")){$("#content-container").css( "height", navigationHeight+ 80 +"px" );};

    $("#navigation").children("ul").children("li")
        .children("a").each(function(i){    if (this.offsetHeight < 40 ){$(this).addClass("oneline");}});
    $("#navigation").children("ul").children("li").children("ul").children("li").children("a").each(function(i){
        if ($(this).text().length < 22 ){
            $(this).addClass("oneline"); 
            //alert($(this).text());
        }
    });
//
        //    .children("ul").children("li").children("a").each(function(i){ alert('test');    if (this.offsetHeight < 25 ){$(this).addClass("oneline");}});
    
    $(".monthslidingview").attr("class","sliederframe monthslidingview-active");
    $(".monthblock h3").each(function(){ $(this).clone().insertAfter(this).addClass("bottom"); });
    $(".teaserslider").attr("class","sliederframe teaserslider-active");
    $(".imageslider").attr("class","sliederframe imageslider-active");   
      
    $(".sitemap li:has(ul)").attr("class","closed");
    //$(".sitemap li").attr("class","closed");
    
    /**** Table Styleing ****/
    rowspancount = 0;
    $("#maincontent table:not(.rd-comment-table) tr:first-child").children("th, td").addClass("header");    
    if ($("#maincontent table:not(.rd-comment-table) tr:not(:first)").parents("table").is(":has(th)")){        
                if (rowspancount < 1 ) {$(this).children("*:eq(0)").addClass("header");    }
                if (rowspancount != 0 ){ rowspancount = rowspancount-1;    }        
                if ($(this).children("*:eq(0)").attr("rowspan") > 1) { rowspancount = $(this).children("*:eq(0)").attr("rowspan")-1; }        
    }
    
    /**** Tab Navigation ****/
    //$(".tab")
    $(".tab").hide();    
    $(".tab:first").show();    
    
    $(".tab:first").before('\
                <div class="text tabnav\">\
                    <ul class="tabnavigation clearfix">\
                    </ul>\
                </div>')
        
    $(".tab .tab-title:first").each(function(){    $(".tabnavigation").append('<li class="active">'+$(this).html()+'</li>'); });
    $(".tab .tab-title:not(:first)").each(function(){    $(".tabnavigation").append('<li>'+$(this).html()+'</li>'); });
    
    $(".tabnavigation li").click(function(){    
        tabindex = $(".tabnavigation li").index(this);    
        if ($(this).attr("class") != "active"){
            
            $(".tabnavigation li").attr("class","");
            $(".tabnavigation li:eq("+tabindex+")").attr("class","active");        
            $(".tab").hide();
            $(".tab:eq("+tabindex+")").show();
        }
        return false;        
    })    
    
    /**** Sitemap ****/ 
    $(".sitemap .sitemapnavigation .closed").click(function(){    $(this).closest(".sitemap").find("li:has(ul)").attr("class","open"); return false; });
    $(".sitemap .sitemapnavigation .open").click(function(){    $(this).closest(".sitemap").find("li:has(ul)").attr("class","closed"); return false; });
    
    $(".sitemap li:has(ul)").children(".magnifier").click(function(){
        if ($(this).parent().is(":has(ul)")) { 
            $(this).parent().toggleClass("open").toggleClass("closed")
            return false;
        } else {
            return false;
        }
        
        
    });

    /**** Navigation Script ****/
    activePoint = $("#navigation a.active:last");
    $("#navigation a.active:not(:last)").addClass("root").removeClass("active");
    activePoint.addClass("active").removeClass("root");
    $("#navigation ul a").click(function(){
        //if ( (!($(this).is(":last-child"))) && (!($(this).is(".root"))) && (!($(this).is(".active"))) ) {
        
        //Wenn Punkt nicht letzter in Hirarchie
        if ( (!($(this).is(":last-child"))) && ((!($(this).is(".root"))) || ($(this).is(".root[href='#']")))   ) {
        
            //alle UL auf selber Ebene und Ebene drunter schließen
            $(this).parent().siblings().find("ul")
                .slideUp()
                .find("ul").slideUp();
                
            // das A-Tag über dem aktuellen Punkt wird von "active" auf "root" gesetzt
            $(this).parent().siblings().find("a")
                .removeClass("active")
                .removeClass("root");    
                
            // die aktuelle Liste unterhalb des geklickten A-Tags öffnen
            $(this).next("ul").slideToggle('slow', function(){        
            
                newNavigationHeight = $("#navigation")[0].offsetHeight;
                $("#content-container").css( "min-height", newNavigationHeight+ 80 +"px" );

                    if ((browser == "MSIE 6")||(browser == "MSIE 5")){$("#content-container").css( "height", newNavigationHeight+ 80 +"px" );};
            
            });
            
            
            //$(this).parent().removeClass("active");
            
            // das Highlighting zum es aktuellen Punktes richtig setzten
            if ($(this).hasClass("root") ) {
                $(this).addClass("inactiveRoot");
                $(this).removeClass("root");
            } else if ($(this).hasClass("inactiveRoot")){
                $(this).addClass("root");
                $(this).removeClass("inactiveRoot");
            } else if ($(this).hasClass("active")){                                 
                $(this).removeClass("active")
            } else {
                $(this).addClass("active");
            }
            $(this).parent().parent().prev("a")
                .removeClass("active")
                .addClass("root");            
            if (( $(this).not(".active")) || ( $(this).not(".root"))){return false};
        }
    });
    
    /**** Text Extending Script ****/    
    $("a.showtext").click(function(){
        $(".splitteaser").css("position", "static");
        $(".extendedtext").css("zoom", "0");
        $(this).prev(".extendedtext").slideToggle("fast", function (){
            $(".splitteaser").css("position", "relative");
        });
        $(this).toggleClass("showtext").toggleClass("hidetext");
        return false;  
    });



    
    /**** Script for assist area tripple accordion slider ****/
    $(".tripple h4").click(function(){        
        if (!($(this).is(".active"))){
            $(this).parent().children(".tripple > div").slideUp();
            $(this).parent().children("h4").removeClass("active");
            $(this).next("div").slideToggle('slow');
            $(this).next().next("div.bottomshadow").slideToggle('slow');
            $(this).toggleClass("active");        
        }        
        return false;
    });
    
    /**** set slideblock item container width ****/
    
    $(".sliederframe").each(function(i){
        if ($(this).find(".slideitem").css("width")){ 
            var slideItem = $(this).find(".slideitem");
            var slideItemWidth = slideItem.css("width").replace(/px/,"");            
            //var slideItemSpace = parseInt(slideItem.css("border-left-width").replace(/px/,"")) + parseInt(slideItem.css("border-right-width").replace(/px/,"")) + parseInt(slideItem.css("margin-left").replace(/px/,"")) + parseInt(slideItem.css("margin-right").replace(/px/,"")) + parseInt(slideItem.css("padding-left").replace(/px/,"")) + parseInt(slideItem.css("padding-right").replace(/px/,"")) ;      
            var itemCount = $(this).find(".slideitem").length;            
            //$(this).find(".slideitemcontainer").width((parseInt(slideItemSpace) + parseInt(slideItemWidth))*itemCount);
            $(this).find(".slideitemcontainer").width(parseInt(slideItemWidth)*itemCount);
        }                
    })    
        
    $(".sliederframe .left").click(function(){
        var $slideItemContainer = $(this).closest(".sliederframe").find(".slideitemcontainer");
        var sliderPosition = $slideItemContainer.css("left").replace(/px/,"");    
        var slideItem = $slideItemContainer.find(".slideitem");        
        var slideItemWidth = $(slideItem).css("width").replace(/px/,"");
        //var slideItemSpace = parseInt(slideItem.css("border-left-width").replace(/px/,"")) + parseInt(slideItem.css("border-right-width").replace(/px/,"")) + parseInt(slideItem.css("margin-left").replace(/px/,"")) + parseInt(slideItem.css("margin-right").replace(/px/,"")) + parseInt(slideItem.css("padding-left").replace(/px/,"")) + parseInt(slideItem.css("padding-right").replace(/px/,"")) ;      
        var slideItemCount = $(slideItem).length;                
        if ( (sliderPosition < 0) && (((sliderPosition*(-1))% parseInt(slideItemWidth)) == 0)) {$slideItemContainer.animate({ left: (-1)*((-1)*sliderPosition-parseInt(slideItemWidth))}, 300 )}

        if (sliderPosition*(-1) <= slideItemWidth){
            $(this).addClass("SlideEndLeft");
        } 
        else {$(this).removeClass("SlideEndLeft");}
        
        if(slideItemCount > 1){
            $(this).siblings(".right").removeClass("SlideEndRight");
        }

        return false;
    });                    
    $(".sliederframe .right").click(function(){
        var $slideItemContainer = $(this).closest(".sliederframe").find(".slideitemcontainer");    
        var sliderPosition = $slideItemContainer.css("left").replace(/px/,"");        
        var slideItem = $slideItemContainer.find(".slideitem");        
        var slideItemWidth = $(slideItem).css("width").replace(/px/,"");
        //var slideItemSpace = parseInt(slideItem.css("border-left-width").replace(/px/,"")) + parseInt(slideItem.css("border-right-width").replace(/px/,"")) + parseInt(slideItem.css("margin-left").replace(/px/,"")) + parseInt(slideItem.css("margin-right").replace(/px/,"")) + parseInt(slideItem.css("padding-left").replace(/px/,"")) + parseInt(slideItem.css("padding-right").replace(/px/,"")) ;      
        var slideItemCount = $(slideItem).length;
        if ((((-1) * sliderPosition) < ( parseInt(slideItemWidth)*(slideItemCount-1))  ) && ((sliderPosition*(-1))%parseInt(slideItemWidth)) == 0) {    $slideItemContainer.animate({ left: sliderPosition-parseInt(slideItemWidth)}, 300) }

        if (sliderPosition*(-1) == $slideItemContainer.css("width").replace(/px/,"") - slideItemWidth*2){
            $(this).addClass("SlideEndRight");
        } 
        if($slideItemContainer.css("width").replace(/px/,"") != slideItemWidth ){
            $(this).siblings(".left").removeClass("SlideEndLeft");
        }
        return false;
    });    
    
    /**** Font Size Navigation ****/
    
    //document.getElementById("bigfontsize").disabled = true;
    //$(".fontSwitch").attr("disabled","disabled");
    
    function setCookie(name, value, hours) {
      var expires = "";
      if (hours) {
        var date = new Date();
        date.setTime(date.getTime() + (hours * 60 * 60 * 1000));
        var expires = "; expires="+date.toGMTString();
      }
      document.cookie = name + "=" + value + expires + "; path=/";
    }
    
    
    $("#smallfont").click(function(){ 
        $(".fontSwitch").attr("disabled","disabled");
        $(".fontSwitch").each(function(){
            if ($(this).hasClass("small")){
                $(this).removeAttr("disabled");
            }
        })
        return false;
    });
    
    $("#middlefont").click(function(){
        $(".fontSwitch").attr("disabled","disabled");
        $(".fontSwitch").each(function(){
            if ($(this).hasClass("middle")){
                $(this).removeAttr("disabled");
            }
        })
        return false;
    });
    $("#bigfont").click(function(){ 
        $(".fontSwitch").attr("disabled","disabled");
        $(".fontSwitch").each(function(){
            if ($(this).hasClass("big")){
                $(this).removeAttr("disabled");
            }
        })
        return false;
    });   



        /**** hide coursedetails ****/

        $(".hideCourse").css("display","none");
        $("ul#searchresults li a.linkCourse").click( function () {  
            return false;
        });




    monthItemWidth = $(".monthslideblock").find(".slideitem").width();
    eventTableWidth = $(".eventtable .slideitemcontainer .slideitem").width();    
    slidingPointMonth = monthItemWidth*6;
    slidingPointEvent = eventTableWidth*6;  



               // $(".monthslideblock").css("left", slidingPointMonth*(-1) );
               // $(".eventtable .slideitemcontainer").css("left", slidingPointEvent*(-1) );                
           

    $(".eventtable .slideitem a").click(function(){
        sItem = $(this).closest(".slideitem");
        itemIndex = $(".eventtable .slideitemcontainer .slideitem").index(sItem);
        slidingPoint = monthItemWidth*itemIndex;
        $(".monthslideblock").css("left", slidingPoint*(-1) );        
        if ($(this).attr("href") == "#" )
        {return false;}
    });



    $(".eventtable .slideitem a").mousemove(function(e){
        //alert($(this)[0].offsetTop);
        //alert($(this).next(".hiddenhovertext").text());
      focusText = $(this).next(".hiddenhovertext");
      hoverBlock = $('.hiddenHoverBlock');
      //alert(focusText.text());
      hoverBlock.show();
      
      //focusText.html(e.pageX +', '+ e.pageY);
      
          var x = e.pageX - $(this)[0].offsetLeft - 240;
        var y = e.pageY - $(this)[0].offsetTop;  
        
        hoverBlock.html(focusText.html());
        
        hoverBlock.css( "left", x );
        hoverBlock.css( "top", y );    
    }).mouseleave(function(){
        $('.hiddenHoverBlock').hide();
    });
    

    
});

/**** show coursedetails ****/

function showCourse(idCourse) {    
    $(".hideCourse").css("display","none");
    if($("#"+idCourse).length > 0) {
        $("#"+idCourse).show();
    }
}

function SetActiveID() {
    var _url = document.URL;
    var _l = _url.length;
    var _x = _url.indexOf("#");
    var _i = _url.substring(_x+1,_l);
    
    if(_x > 0){
        $(".hideCourse").css("display","none");
        if($("#idCourse"+_i).length > 0) {
            $("#idCourse"+_i).show();
        }
    }
}

/**** Assist E-Mail ****/

  function noSpam() {
    var a = document.getElementsByTagName("a");
    for (var i = a.length-1; i >= 0; i--) {
      if (a[i].className.search(/\bemail\b/) != -1) {
        var email = a[i].firstChild.data + "@" + a[i].lastChild.data;
        a[i].innerHTML = 'E-Mail senden';
        a[i].href = "mailto:" + email;
      }
    }
  }
// window.onload=noSpam;


function setRight() {
    if (document.getElementById("setRight")) {
        document.getElementById("setRight").style.position="static"; 
    }
}

  function reloadCaptcha() {
    var c = document.getElementById('captcha_img');
    if( c != null ) {
      var xmlHttp = false;   //globale Instanz von XMLHttpRequest
      //XMLHttpRequest-Instanz erstellen (IE)
      try {
        xmlHttp  = new ActiveXObject("Msxml2.XMLHTTP");
      } catch(e) {
        try {
          xmlHttp  = new ActiveXObject("Microsoft.XMLHTTP");
        } catch(e) {
          xmlHttp  = false;
        }
      }
      // (Mozilla, Opera, Safari, ...)
      if (!xmlHttp  && typeof XMLHttpRequest != 'undefined') {
        xmlHttp = new XMLHttpRequest();
      }
      if (xmlHttp) {
        xmlHttp.open('GET', '/cps/rde/rendercaptchaimageweblet', true);
        xmlHttp.onreadystatechange = function () {
          if (xmlHttp.readyState == 4) {
            captcha = new Image();
            var tmp = Math.round(Math.random() * (1 + 100000));
            var cSrc = '/cps/rde/rendercaptchaimageweblet?p=' + tmp.toString();
            captcha.src = cSrc;
            c.src = captcha.src;
          }
       }
       xmlHttp.send(null);
    }
  }
}


/* AB Seminarsuche
 * Open popup window from submit action
 */
function createTarget(t){
    window.open("", t, "width="+screen.width+",height="+screen.height+",location=yes,menubar=yes,resizable=yes,scrollbars=yes,status=yes,toolbar=yes");
    return true;
}
/* AB Seminarsuche
 * Open popup window 
 */
function openPopup(url,width,height){
      fenster=window.open(url, "_blank", "width="+screen.width+",height="+screen.height+",location=yes,menubar=yes,resizable=yes,scrollbars=yes,status=yes,toolbar=yes");
      fenster.focus();
      return false;
}
 
/* 
 * EVENTSLIDER
 */
//Global Settings for EventSlider
$.EventSliderLinkTemplate = "events_selector.htm"; //Adresse des Scripts
$.EventSliderLinkTemplateQuery = "month=<@month@>&year=<@year@>"; //Query für das Script
$.EventSliderBuffer = 3;
$.EventSliderScrollSpeed = 300; //Time to slide the EventSlider in milliseconds
//EventSlider Libary
$.currentEventQuartal = function() {
    var month = parseInt($(".monthblock.slideitem.activea").attr("id").split("-")[1]);
    //Modifing for Quartal. Read Month and calculate Quartal (LiveServer are giving Month)
    $.log('Current Month: '+month);
    return Math.ceil(month / 3);
};
$.currentEventYear = function() {
    return parseInt($(".monthblock.slideitem.activea").attr("id").split("-")[2]);
};
$.nextEventQuartal = function(quartal) {
    var Q = quartal || $.currentEventQuartal();
    if(Q==4){return 1;}else{return Q+1;}
}
$.prevEventQuartal = function(quartal) {
    var Q = quartal || $.currentEventQuartal();
    if(Q==1){return 4;}else{return Q-1;}
}
$.nextEventYear = function(quartal,year) {
    var Y = year || $.currentEventYear();var Q = quartal || $.currentEventQuartal();
    if(Q==4){return Y+1;}else{return Y;}
}
$.prevEventYear = function(quartal,year) {
    var Y = year || $.currentEventYear();var Q = quartal || $.currentEventQuartal();
    if(Q==1){return Y-1;}else{return Y;}
}
$.fn.getNextEventQuartal = function(quartal,year) {
    $.log('Current Quartal: '+$.currentEventQuartal());
    $.log('Current Year: '+$.currentEventYear());
    var Q = quartal || $.nextEventQuartal($.nextEventQuartal());
    var Y = year || $.nextEventYear($.nextEventQuartal(),$.nextEventYear());
    $.log('Next Qurtal: '+Q);
    $.log('Next Year: '+Y);
    return $(this).getEventSlider(Q,Y,true);
}
$.fn.getPrevEventQuartal = function(quartal,year) {
    $.log('Current Quartal: '+$.currentEventQuartal());
    $.log('Current Year: '+$.currentEventYear());
    var Q = quartal || $.prevEventQuartal($.prevEventQuartal());
    var Y = year || $.prevEventYear($.prevEventQuartal(),$.prevEventYear());
    $.log('Prev Qurtal: '+Q);
    $.log('Prev Year: '+Y);
    return $(this).getEventSlider(Q,Y,false);
}
$.fn.getEventSlider = function(quartal,year,append,async) {
    var a = async || true;
    var container = $(this);
    var dummyevent = "<div id=\"dummyevsl-"+quartal+"-"+year+"\" class=\"monthblock slideitem\" style=\"height:50px;\"></div>";
    if(append) {
       if(container.children("#dummyevsl-r").length > 0) {
          container.children("#dummyevsl-r").replaceWith(dummyevent);
       } else {
          container.append(dummyevent);
       }
    } else {
       if(container.children("#dummyevsl-l").length > 0) {
          container.children("#dummyevsl-l").replaceWith(dummyevent);
       } else {
          $(dummyevent).insertBefore(".monthblock.slideitem:first");
       }
    }
    $.ajax({type: "GET",async: false,url: $.EventSliderLinkTemplate.replace(/<@month@>/,(quartal*3)-2).replace(/<@year@>/,year),data: $.EventSliderLinkTemplateQuery.replace(/<@month@>/,(quartal*3)-2).replace(/<@year@>/,year),success: function(data){
             if($(data).hasClass(".monthblock")) { $("#dummyevsl-"+quartal+"-"+year).replaceWith(data); }
           }
    });
    return container;
}
$.fn.EventSliderLeftSwitch = function() {
    $.unsetEventSliderFunction();
    var prev = $(".monthblock.slideitem:first"); //Nächstes Quartal speichern
    prev.parent().children(".monthblock.slideitem:last").remove();
    prev.parent().css("left","-1040px");
    prev.parent().getPrevEventQuartal();
    $(".monthblock.slideitem.activea").removeClass("activea");//Aktuelles Quartal inaktive setzen
    prev.addClass("activea"); //Nächstes Quartal aktiv setzen
    prev.parent().animate({left:"-520px"},$.EventSliderScrollSpeed,function(){ $.setEventSliderFunction(); });
    return false;
}
$.fn.EventSliderRightSwitch = function() {
    $.unsetEventSliderFunction();
    var next = $(".monthblock.slideitem:last"); //Nächstes Quartal speichern
    next.parent().getNextEventQuartal();
    next.parent().animate({left:"-1040px"},$.EventSliderScrollSpeed,function(){
        next.parent().children(".monthblock.slideitem:first").remove();
        next.parent().css("left","-520px");
        $(".monthblock.slideitem.activea").removeClass("activea");//Aktuelles Quartal inaktive setzen
        next.addClass("activea"); //Nächstes Quartal aktiv setzen
        $.setEventSliderFunction();
    });
    return false;
}
$.setEventSliderFunction = function() {
    $(".monthslidingview-active .navbar a.left").click(function() {$(this).EventSliderLeftSwitch();});
    $(".monthslidingview-active .navbar a.right").click(function() {$(this).EventSliderRightSwitch();});
}
$.unsetEventSliderFunction = function() {
    $(".monthslidingview-active .navbar a.left").unbind().click(function() { return false; });
    $(".monthslidingview-active .navbar a.right").unbind().click(function() { return false; });
}
$.loadClientDate = function() {var d = new Date();$.clientMonth = Math.floor(d.getMonth() / 3)+1;var y = d.getYear();if ((y > 99) && (y < 1900)) y += 1900;$.clientYear = y;}
$.loadEventSlider = function(month,year) {
   $.unsetEventSliderFunction(); //Left- und Rightbutton Funktionen aufheben falls vorhanden
   //Falls ein Monat vorhanden ist setze ihn "activea" wenn dieser es noch nicht ist.
   if(!($(".monthslideblock.slideitemcontainer .monthblock.slideitem.activea").length > 0)) {
      $(".monthslideblock.slideitemcontainer .monthblock.slideitem").addClass("activea");
   }
   $.loadClientDate(); //Client Infos laden
   var Qplus = Qcurrent = month || $.currentEventQuartal(); //Startmonat festlegen
   var Yplus = year || $.currentEventYear(); //Startjahr festlegen
   var Qminus = Qplus;
   var Yminus = Yplus;
   //Wenn der aktuell vorhandene Monat NICHT der gewünschte Monat ist, lade den richtigen
   if((Qplus != $.currentEventQuartal()) || (Yplus != $.currentEventYear())) {
      $(".monthslideblock.slideitemcontainer").empty(); //EventSlider leeren
      $(".monthslideblock.slideitemcontainer").getEventSlider(Qplus,Yplus,true); //Monat laden
      $(".monthslideblock.slideitemcontainer .monthblock.slideitem").addClass("activea"); //Monat Active setzen
   }
   $(".monthslideblock.slideitemcontainer").css({"left":"-520px","width":"2080px"}); //Masse setzen
   //Buffer-Monate laden
   for(var i=1;i<=(($.EventSliderBuffer-1)/2);i++) {
      var Qplus = $.nextEventQuartal(Qcurrent);
      var Yplus = $.nextEventYear(Qcurrent,Yplus);
      $.log('Next Qurtal: '+Qplus);
      $.log('Next Year: '+Yplus);
      if(!($(".monthslideblock.slideitemcontainer #evsl-"+Qplus+"-"+Yplus).length > 0)) {
         $(".monthslideblock.slideitemcontainer").getNextEventQuartal(Qplus,Yplus);
      }
      var Qminus = $.prevEventQuartal(Qcurrent);
      var Yminus = $.prevEventYear(Qcurrent,Yminus);
      $.log('Prev Qurtal: '+Qplus);
      $.log('Prev Year: '+Yplus);
      if(!($(".monthslideblock.slideitemcontainer #evsl-"+Qminus+"-"+Yminus).length > 0)) {
         $(".monthslideblock.slideitemcontainer").getPrevEventQuartal(Qminus,Yminus);
      }
   }
   $.setEventSliderFunction(); //Left- und Rightbutton Funktionen setzen
}

/*
 * CALENDAR
 */
//Global Settings for Calendar
$.calendarLinkTemplate = "/de/cal_single_month.htm"; //Adresse des Scripts
$.calendarLinkTemplateQuery = "sliderpresent=1&month=<@month@>&year=<@year@>"; //Query für das Script
$.calendarBuffer = 3;
$.calendarScrollSpeed = 300; //Time to slide the calendar in milliseconds
$.calendarEventLink = false; //Default no modified Links for EventSlider

//Libary for Calendar
$.fn.elMonth=function(){if($(this).length>0){return parseInt($(this).attr("id").split("-")[0]);} return null;}
$.fn.elYear=function(){if($(this).length>0){return parseInt($(this).attr("id").split("-")[1]);} return null;}
$.currentMonth=function(){return $(".slideitemcontainer.calendar table.activea").elMonth();};$.currentYear=function(){return $(".slideitemcontainer.calendar table.activea").elYear();};$.nextMonth=function(month){var M=month||$.currentMonth();if(M==12){return 1;}else{return M+1;}}
$.prevMonth=function(month){var M=month||$.currentMonth();if(M==1){return 12;}else{return M-1;}}
$.nextYear=function(month,year){var Y=year||$.currentYear();var M=month||$.currentMonth();if(M==12){return Y+1;}else{return Y;}}
$.prevYear=function(month,year){var Y=year||$.currentYear();var M=month||$.currentMonth();if(M==1){return Y-1;}else{return Y;}}
$.fn.getClientMonth=function(){var M=$.clientMonth();var Y=$.clientYear();$(this).empty();return $(this).getCalendar(M,Y,true,false);}
$.fn.getNextMonth=function(month,year){var M=month||$.nextMonth($.nextMonth($(this).elMonth()));var Y=year||$.nextYear($.nextMonth($(this).elMonth()),$.nextYear($(this).elMonth(),$(this).elYear()));return $(this).getCalendar(M,Y,true);}
$.fn.getPrevMonth=function(month,year){var M=month||$.prevMonth($.prevMonth($(this).elMonth()));var Y=year||$.prevYear($.prevMonth($(this).elMonth()),$.prevYear($(this).elMonth(),$(this).elYear()));return $(this).getCalendar(M,Y);}
$.fn.getCalendar=function(month,year,append,async){var a=async||false;var container=$(this);var divdummy = "<table id=\"dummy-"+month+"-"+year+"\" class=\"slideitem calendar\" style=\"width:153px;float:left;height:145px;\"></table>";if(append){if(container.children("#dummycal-r").length > 0) {container.children("#dummycal-r").replaceWith(divdummy);} else {container.append(divdummy);}}else{if(container.children("#dummycal-l").length > 0) {container.children("#dummycal-l").replaceWith(divdummy);} else {container.prepend(divdummy);}}$.ajax({type:"GET",async:false,url:$.calendarLinkTemplate.replace(/<@month@>/,month).replace(/<@year@>/,year),data:$.calendarLinkTemplateQuery.replace(/<@month@>/,month).replace(/<@year@>/,year),success:function(data){if($(data).hasClass(".calendar")) { $("#dummy-"+month+"-"+year).replaceWith(data);$("#"+month+"-"+year).setEventLinksInCalendar(); }}});return container;}
$.fn.calendarLeftSwitch=function(){$.unsetCalendarScrollerFunction();var prev=$("#"+$.prevMonth()+"-"+$.prevYear());prev.parent().children("table.calendar:last").remove();prev.parent().css("left","-306px");prev.parent().getPrevMonth();$("#"+$.currentMonth()+"-"+$.currentYear()).removeClass("activea");prev.addClass("activea");prev.parent().animate({left:"-153px"},$.calendarScrollSpeed,function() { $.setCalendarScrollFunction(); });return false;}
$.fn.calendarRightSwitch=function(){$.unsetCalendarScrollerFunction();var next=$("#"+$.nextMonth()+"-"+$.nextYear());next.parent().getNextMonth();next.parent().animate({left: "-306px"},$.calendarScrollSpeed,function() {$("#"+$.currentMonth()+"-"+$.currentYear()).removeClass("activea");next.addClass("activea");next.parent().children("table.calendar:first").remove();next.parent().css("left","-153px");$.setCalendarScrollFunction();});return false;}
$.setCalendarScrollFunction = function() {$.unsetCalendarScrollerFunction();$(".slideitemcontainer.calendar").parent().parent().children(".eventtablenav").children(".left").click(function() {$('.slideitemcontainer .calendar.activea').calendarLeftSwitch();return false;});$(".slideitemcontainer.calendar").parent().parent().children(".eventtablenav").children(".right").click(function() {$('.slideitemcontainer .calendar.activea').calendarRightSwitch();return false;});}
$.unsetCalendarScrollerFunction = function() {$(".slideitemcontainer.calendar").parent().parent().children(".eventtablenav").children(".left").unbind().click(function(){return false;});$(".slideitemcontainer.calendar").parent().parent().children(".eventtablenav").children(".right").unbind().click(function(){return false;});}
$.fn.setEventLinksInCalendar = function() { $.setCalendarLinkHover(); if($.calendarEventLink) {$(this).children("tbody").children("tr").children("td.we").children("a").click(function(){var c = $(this).parent().parent().parent().parent(); $.loadEventSlider(c.elMonth(),c.elYear());return false;});}return this;} 
$.loadCalendar = function(eventlinks) {
    $.calendarEventLink = eventlinks || false; //Gibt an ob die Links im Calendar für den Eventslider bearbeitet werden oder nicht.
    $.loadClientDate();
    $(".calendar").css({"left":"-153px"}).children("table.calendar").addClass("activea").setEventLinksInCalendar();;
    var Mplus = Mminus = Mcurrent = $.currentMonth() || $.clientMonth;var Yplus = Yminus = $.currentYear() || $.clientYear;
    var Mplus = Mminus = $.currentMonth() || $.clientMonth;var Yplus = Yminus = $.currentYear() || $.clientYear;
    for(var i=1;i<=(($.calendarBuffer-1)/2);i++) {
        var Mplus = $.nextMonth(Mcurrent);var Yplus = $.nextYear(Mcurrent,Yplus);
        $(".calendar").getNextMonth(Mplus,Yplus);
        var Mminus = $.prevMonth(Mcurrent);var Yminus = $.prevYear(Mcurrent,Yminus);
        $(".calendar").getPrevMonth(Mminus,Yminus);
        

    }
    $.setCalendarScrollFunction();
}
$.setCalendarLinkHover = function() {
    $(".eventtable .slideitem a").mousemove(function(e){
    focusText = $(this).next(".hiddenhovertext");
    hoverBlock = $('.hiddenHoverBlock');
    hoverBlock.show();
    var x = e.pageX - $(this)[0].offsetLeft - 240;
    var y = e.pageY - $(this)[0].offsetTop;
    hoverBlock.html(focusText.html());
    hoverBlock.css( "left", x );
    hoverBlock.css( "top", y );
    }).mouseleave(function(){
    $('.hiddenHoverBlock').hide();
});}



/*
 * TABNAVIGATION: Open (switch to) tab which contains the formular
 * e.g. Messen__Veranstaltungen_1829_DEU_5236_DEU_PRODUCTIVE.htm
 */
var timercount = 0;
function switchToLastTab() {
 timercount++;
 if (!$(".tabnavigation li:first").hasClass("active")) {
   // Warten, bis die Tabs initialisiert sind. Dann hat der erste die Klasse "active"
   // Max. 5x Durchläufe = max. 5 Sekunden
   if( timercount < 5 ) {
     setTimeout("switchToLastTab()", 1000);
   }
 } else {
   $(".tabnavigation li").removeClass("active");
   $(".tabnavigation li:last").addClass("active");
   $(".tab").hide();
   $(".tab:last").show();
 }
 return false;
}

<!-- MARI FlowPlayer JavaScript //-->
(function(){function g(o){console.log("$f.fireEvent",[].slice.call(o))}function k(q){if(!q||typeof q!="object"){return q}var o=new q.constructor();for(var p in q){if(q.hasOwnProperty(p)){o[p]=k(q[p])}}return o}function m(t,q){if(!t){return}var o,p=0,r=t.length;if(r===undefined){for(o in t){if(q.call(t[o],o,t[o])===false){break}}}else{for(var s=t[0];p<r&&q.call(s,p,s)!==false;s=t[++p]){}}return t}function c(o){return document.getElementById(o)}function i(q,p,o){if(typeof p!="object"){return q}if(q&&p){m(p,function(r,s){if(!o||typeof s!="function"){q[r]=s}})}return q}function n(s){var q=s.indexOf(".");if(q!=-1){var p=s.substring(0,q)||"*";var o=s.substring(q+1,s.length);var r=[];m(document.getElementsByTagName(p),function(){if(this.className&&this.className.indexOf(o)!=-1){r.push(this)}});return r}}function f(o){o=o||window.event;if(o.preventDefault){o.stopPropagation();o.preventDefault()}else{o.returnValue=false;o.cancelBubble=true}return false}function j(q,o,p){q[o]=q[o]||[];q[o].push(p)}function e(){return"_"+(""+Math.random()).substring(2,10)}var h=function(t,r,s){var q=this;var p={};var u={};q.index=r;if(typeof t=="string"){t={url:t}}i(this,t,true);m(("Begin*,Start,Pause*,Resume*,Seek*,Stop*,Finish*,LastSecond,Update,BufferFull,BufferEmpty,BufferStop").split(","),function(){var v="on"+this;if(v.indexOf("*")!=-1){v=v.substring(0,v.length-1);var w="onBefore"+v.substring(2);q[w]=function(x){j(u,w,x);return q}}q[v]=function(x){j(u,v,x);return q};if(r==-1){if(q[w]){s[w]=q[w]}if(q[v]){s[v]=q[v]}}});i(this,{onCuepoint:function(x,w){if(arguments.length==1){p.embedded=[null,x];return q}if(typeof x=="number"){x=[x]}var v=e();p[v]=[x,w];if(s.isLoaded()){s._api().fp_addCuepoints(x,r,v)}return q},update:function(w){i(q,w);if(s.isLoaded()){s._api().fp_updateClip(w,r)}var v=s.getConfig();var x=(r==-1)?v.clip:v.playlist[r];i(x,w,true)},_fireEvent:function(v,y,w,A){if(v=="onLoad"){m(p,function(B,C){if(C[0]){s._api().fp_addCuepoints(C[0],r,B)}});return false}A=A||q;if(v=="onCuepoint"){var z=p[y];if(z){return z[1].call(s,A,w)}}if(y&&"onBeforeBegin,onMetaData,onStart,onUpdate,onResume".indexOf(v)!=-1){i(A,y);if(y.metaData){if(!A.duration){A.duration=y.metaData.duration}else{A.fullDuration=y.metaData.duration}}}var x=true;m(u[v],function(){x=this.call(s,A,y,w)});return x}});if(t.onCuepoint){var o=t.onCuepoint;q.onCuepoint.apply(q,typeof o=="function"?[o]:o);delete t.onCuepoint}m(t,function(v,w){if(typeof w=="function"){j(u,v,w);delete t[v]}});if(r==-1){s.onCuepoint=this.onCuepoint}};var l=function(p,r,q,t){var s={};var o=this;var u=false;if(t){i(s,t)}m(r,function(v,w){if(typeof w=="function"){s[v]=w;delete r[v]}});i(this,{animate:function(y,z,x){if(!y){return o}if(typeof z=="function"){x=z;z=500}if(typeof y=="string"){var w=y;y={};y[w]=z;z=500}if(x){var v=e();s[v]=x}if(z===undefined){z=500}r=q._api().fp_animate(p,y,z,v);return o},css:function(w,x){if(x!==undefined){var v={};v[w]=x;w=v}r=q._api().fp_css(p,w);i(o,r);return o},show:function(){this.display="block";q._api().fp_showPlugin(p);return o},hide:function(){this.display="none";q._api().fp_hidePlugin(p);return o},toggle:function(){this.display=q._api().fp_togglePlugin(p);return o},fadeTo:function(y,x,w){if(typeof x=="function"){w=x;x=500}if(w){var v=e();s[v]=w}this.display=q._api().fp_fadeTo(p,y,x,v);this.opacity=y;return o},fadeIn:function(w,v){return o.fadeTo(1,w,v)},fadeOut:function(w,v){return o.fadeTo(0,w,v)},getName:function(){return p},getPlayer:function(){return q},_fireEvent:function(w,v,x){if(w=="onUpdate"){var y=q._api().fp_getPlugin(p);if(!y){return}i(o,y);delete o.methods;if(!u){m(y.methods,function(){var A=""+this;o[A]=function(){var B=[].slice.call(arguments);var C=q._api().fp_invoke(p,A,B);return C==="undefined"||C===undefined?o:C}});u=true}}var z=s[w];if(z){z.apply(o,v);if(w.substring(0,1)=="_"){delete s[w]}}}})};function b(o,t,z){var E=this,y=null,x,u,p=[],s={},B={},r,v,w,D,A,q;i(E,{id:function(){return r},isLoaded:function(){return(y!==null)},getParent:function(){return o},hide:function(F){if(F){o.style.height="0px"}if(y){y.style.height="0px"}return E},show:function(){o.style.height=q+"px";if(y){y.style.height=A+"px"}return E},isHidden:function(){return y&&parseInt(y.style.height,10)===0},load:function(F){if(!y&&E._fireEvent("onBeforeLoad")!==false){m(a,function(){this.unload()});x=o.innerHTML;if(x&&!flashembed.isSupported(t.version)){o.innerHTML=""}flashembed(o,t,{config:z});if(F){F.cached=true;j(B,"onLoad",F)}}return E},unload:function(){try{if(!y||y.fp_isFullscreen()){return E}}catch(F){return E}if(x.replace(/\s/g,"")!==""){if(E._fireEvent("onBeforeUnload")===false){return E}y.fp_close();y=null;o.innerHTML=x;E._fireEvent("onUnload")}return E},getClip:function(F){if(F===undefined){F=D}return p[F]},getCommonClip:function(){return u},getPlaylist:function(){return p},getPlugin:function(F){var H=s[F];if(!H&&E.isLoaded()){var G=E._api().fp_getPlugin(F);if(G){H=new l(F,G,E);s[F]=H}}return H},getScreen:function(){return E.getPlugin("screen")},getControls:function(){return E.getPlugin("controls")},getConfig:function(F){return F?k(z):z},getFlashParams:function(){return t},loadPlugin:function(I,H,K,J){if(typeof K=="function"){J=K;K={}}var G=J?e():"_";E._api().fp_loadPlugin(I,H,K,G);var F={};F[G]=J;var L=new l(I,null,E,F);s[I]=L;return L},getState:function(){return y?y.fp_getState():-1},play:function(G,F){function H(){if(G!==undefined){E._api().fp_play(G,F)}else{E._api().fp_play()}}if(y){H()}else{E.load(function(){H()})}return E},getVersion:function(){var G="flowplayer.js 3.1.2";if(y){var F=y.fp_getVersion();F.push(G);return F}return G},_api:function(){if(!y){throw"Flowplayer "+E.id()+" not loaded when calling an API method"}return y},setClip:function(F){E.setPlaylist([F]);return E},getIndex:function(){return w}});m(("Click*,Load*,Unload*,Keypress*,Volume*,Mute*,Unmute*,PlaylistReplace,ClipAdd,Fullscreen*,FullscreenExit,Error,MouseOver,MouseOut").split(","),function(){var F="on"+this;if(F.indexOf("*")!=-1){F=F.substring(0,F.length-1);var G="onBefore"+F.substring(2);E[G]=function(H){j(B,G,H);return E}}E[F]=function(H){j(B,F,H);return E}});m(("pause,resume,mute,unmute,stop,toggle,seek,getStatus,getVolume,setVolume,getTime,isPaused,isPlaying,startBuffering,stopBuffering,isFullscreen,toggleFullscreen,reset,close,setPlaylist,addClip").split(","),function(){var F=this;E[F]=function(H,G){if(!y){return E}var I=null;if(H!==undefined&&G!==undefined){I=y["fp_"+F](H,G)}else{I=(H===undefined)?y["fp_"+F]():y["fp_"+F](H)}return I==="undefined"||I===undefined?E:I}});E._fireEvent=function(O){if(typeof O=="string"){O=[O]}var P=O[0],M=O[1],K=O[2],J=O[3],I=0;if(z.debug){g(O)}if(!y&&P=="onLoad"&&M=="player"){y=y||c(v);A=y.clientHeight;m(p,function(){this._fireEvent("onLoad")});m(s,function(Q,R){R._fireEvent("onUpdate")});u._fireEvent("onLoad")}if(P=="onLoad"&&M!="player"){return}if(P=="onError"){if(typeof M=="string"||(typeof M=="number"&&typeof K=="number")){M=K;K=J}}if(P=="onContextMenu"){m(z.contextMenu[M],function(Q,R){R.call(E)});return}if(P=="onPluginEvent"){var F=M.name||M;var G=s[F];if(G){G._fireEvent("onUpdate",M);G._fireEvent(K,O.slice(3))}return}if(P=="onPlaylistReplace"){p=[];var L=0;m(M,function(){p.push(new h(this,L++,E))})}if(P=="onClipAdd"){if(M.isInStream){return}M=new h(M,K,E);p.splice(K,0,M);for(I=K+1;I<p.length;I++){p[I].index++}}var N=true;if(typeof M=="number"&&M<p.length){D=M;var H=p[M];if(H){N=H._fireEvent(P,K,J)}if(!H||N!==false){N=u._fireEvent(P,K,J,H)}}m(B[P],function(){N=this.call(E,M,K);if(this.cached){B[P].splice(I,1)}if(N===false){return false}I++});return N};function C(){if($f(o)){$f(o).getParent().innerHTML="";w=$f(o).getIndex();a[w]=E}else{a.push(E);w=a.length-1}q=parseInt(o.style.height,10)||o.clientHeight;if(typeof t=="string"){t={src:t}}r=o.id||"fp"+e();v=t.id||r+"_api";t.id=v;z.playerId=r;if(typeof z=="string"){z={clip:{url:z}}}if(typeof z.clip=="string"){z.clip={url:z.clip}}z.clip=z.clip||{};if(o.getAttribute("href",2)&&!z.clip.url){z.clip.url=o.getAttribute("href",2)}u=new h(z.clip,-1,E);z.playlist=z.playlist||[z.clip];var F=0;m(z.playlist,function(){var H=this;if(typeof H=="object"&&H.length){H={url:""+H}}m(z.clip,function(I,J){if(J!==undefined&&H[I]===undefined&&typeof J!="function"){H[I]=J}});z.playlist[F]=H;H=new h(H,F,E);p.push(H);F++});m(z,function(H,I){if(typeof I=="function"){if(u[H]){u[H](I)}else{j(B,H,I)}delete z[H]}});m(z.plugins,function(H,I){if(I){s[H]=new l(H,I,E)}});if(!z.plugins||z.plugins.controls===undefined){s.controls=new l("controls",null,E)}s.canvas=new l("canvas",null,E);t.bgcolor=t.bgcolor||"#000000";t.version=t.version||[9,0];t.expressInstall="http://www.flowplayer.org/swf/expressinstall.swf";function G(H){if(!E.isLoaded()&&E._fireEvent("onBeforeClick")!==false){E.load()}return f(H)}x=o.innerHTML;if(x.replace(/\s/g,"")!==""){if(o.addEventListener){o.addEventListener("click",G,false)}else{if(o.attachEvent){o.attachEvent("onclick",G)}}}else{if(o.addEventListener){o.addEventListener("click",f,false)}E.load()}}if(typeof o=="string"){flashembed.domReady(function(){var F=c(o);if(!F){throw"Flowplayer cannot access element: "+o}else{o=F;C()}})}else{C()}}var a=[];function d(o){this.length=o.length;this.each=function(p){m(o,p)};this.size=function(){return o.length}}window.flowplayer=window.$f=function(){var p=null;var o=arguments[0];if(!arguments.length){m(a,function(){if(this.isLoaded()){p=this;return false}});return p||a[0]}if(arguments.length==1){if(typeof o=="number"){return a[o]}else{if(o=="*"){return new d(a)}m(a,function(){if(this.id()==o.id||this.id()==o||this.getParent()==o){p=this;return false}});return p}}if(arguments.length>1){var r=arguments[1];var q=(arguments.length==3)?arguments[2]:{};if(typeof o=="string"){if(o.indexOf(".")!=-1){var t=[];m(n(o),function(){t.push(new b(this,k(r),k(q)))});return new d(t)}else{var s=c(o);return new b(s!==null?s:o,r,q)}}else{if(o){return new b(o,r,q)}}}return null};i(window.$f,{fireEvent:function(){var o=[].slice.call(arguments);var q=$f(o[0]);return q?q._fireEvent(o.slice(1)):null},addPlugin:function(o,p){b.prototype[o]=p;return $f},each:m,extend:i});if(typeof jQuery=="function"){jQuery.prototype.flowplayer=function(q,p){if(!arguments.length||typeof arguments[0]=="number"){var o=[];this.each(function(){var r=$f(this);if(r){o.push(r)}});return arguments.length?o[arguments[0]]:new d(o)}return this.each(function(){$f(this,k(q),p?k(p):{})})}}})();(function(){var e=typeof jQuery=="function";function i(){if(c.done){return false}var k=document;if(k&&k.getElementsByTagName&&k.getElementById&&k.body){clearInterval(c.timer);c.timer=null;for(var j=0;j<c.ready.length;j++){c.ready[j].call()}c.ready=null;c.done=true}}var c=e?jQuery:function(j){if(c.done){return j()}if(c.timer){c.ready.push(j)}else{c.ready=[j];c.timer=setInterval(i,13)}};function f(k,j){if(j){for(key in j){if(j.hasOwnProperty(key)){k[key]=j[key]}}}return k}function g(j){switch(h(j)){case"string":j=j.replace(new RegExp('(["\\\\])',"g"),"\\$1");j=j.replace(/^\s?(\d+)%/,"$1pct");return'"'+j+'"';case"array":return"["+b(j,function(m){return g(m)}).join(",")+"]";case"function":return'"function()"';case"object":var k=[];for(var l in j){if(j.hasOwnProperty(l)){k.push('"'+l+'":'+g(j[l]))}}return"{"+k.join(",")+"}"}return String(j).replace(/\s/g," ").replace(/\'/g,'"')}function h(k){if(k===null||k===undefined){return false}var j=typeof k;return(j=="object"&&k.push)?"array":j}if(window.attachEvent){window.attachEvent("onbeforeunload",function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){}})}function b(j,m){var l=[];for(var k in j){if(j.hasOwnProperty(k)){l[k]=m(j[k])}}return l}function a(q,s){var o=f({},q);var r=document.all;var m='<object width="'+o.width+'" height="'+o.height+'"';if(r&&!o.id){o.id="_"+(""+Math.random()).substring(9)}if(o.id){m+=' id="'+o.id+'"'}o.src+=((o.src.indexOf("?")!=-1?"&":"?")+Math.random());if(o.w3c||!r){m+=' data="'+o.src+'" type="application/x-shockwave-flash"'}else{m+=' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'}m+=">";if(o.w3c||r){m+='<param name="movie" value="'+o.src+'" />'}o.width=o.height=o.id=o.w3c=o.src=null;for(var j in o){if(o[j]!==null){m+='<param name="'+j+'" value="'+o[j]+'" />'}}var n="";if(s){for(var l in s){if(s[l]!==null){n+=l+"="+(typeof s[l]=="object"?g(s[l]):s[l])+"&"}}n=n.substring(0,n.length-1);m+='<param name="flashvars" value=\''+n+"' />"}m+="</object>";return m}function d(l,o,k){var j=flashembed.getVersion();f(this,{getContainer:function(){return l},getConf:function(){return o},getVersion:function(){return j},getFlashvars:function(){return k},getApi:function(){return l.firstChild},getHTML:function(){return a(o,k)}});var p=o.version;var q=o.expressInstall;var n=!p||flashembed.isSupported(p);if(n){o.onFail=o.version=o.expressInstall=null;l.innerHTML=a(o,k)}else{if(p&&q&&flashembed.isSupported([6,65])){f(o,{src:q});k={MMredirectURL:location.href,MMplayerType:"PlugIn",MMdoctitle:document.title};l.innerHTML=a(o,k)}else{if(l.innerHTML.replace(/\s/g,"")!==""){}else{l.innerHTML="<h2>Flash version "+p+" or greater is required</h2><h3>"+(j[0]>0?"Your version is "+j:"You have no flash plugin installed")+"</h3>"+(l.tagName=="A"?"<p>Click here to download latest version</p>":"<p>Download latest version from <a href='http://www.adobe.com/go/getflashplayer'>here</a></p>");if(l.tagName=="A"){l.onclick=function(){location.href="http://www.adobe.com/go/getflashplayer"}}}}}if(!n&&o.onFail){var m=o.onFail.call(this);if(typeof m=="string"){l.innerHTML=m}}if(document.all){window[o.id]=document.getElementById(o.id)}}window.flashembed=function(k,l,j){if(typeof k=="string"){var m=document.getElementById(k);if(m){k=m}else{c(function(){flashembed(k,l,j)});return}}if(!k){return}var n={width:"100%",height:"100%",allowfullscreen:true,allowscriptaccess:"always",quality:"high",version:null,onFail:null,expressInstall:null,w3c:false};if(typeof l=="string"){l={src:l}}f(n,l);return new d(k,n,j)};f(window.flashembed,{getVersion:function(){var l=[0,0];if(navigator.plugins&&typeof navigator.plugins["Shockwave Flash"]=="object"){var k=navigator.plugins["Shockwave Flash"].description;if(typeof k!="undefined"){k=k.replace(/^.*\s+(\S+\s+\S+$)/,"$1");var m=parseInt(k.replace(/^(.*)\..*$/,"$1"),10);var q=/r/.test(k)?parseInt(k.replace(/^.*r(.*)$/,"$1"),10):0;l=[m,q]}}else{if(window.ActiveXObject){try{var o=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(p){try{o=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");l=[6,0];o.AllowScriptAccess="always"}catch(j){if(l[0]==6){return l}}try{o=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(n){}}if(typeof o=="object"){k=o.GetVariable("$version");if(typeof k!="undefined"){k=k.replace(/^\S+\s+(.*)$/,"$1").split(",");l=[parseInt(k[0],10),parseInt(k[2],10)]}}}}return l},isSupported:function(j){var l=flashembed.getVersion();var k=(l[0]>j[0])||(l[0]==j[0]&&l[1]>=j[1]);return k},domReady:c,asString:g,getHTML:a});if(e){jQuery.tools=jQuery.tools||{version:{}};jQuery.tools.version.flashembed="1.0.3";jQuery.fn.flashembed=function(k,j){var l=null;this.each(function(){l=flashembed(this,k,j)});return k.api===false?this:l}}})();

<!-- FlowPlayer JavaScript //-->
<!-- MARI VideoGallery Class & MediaItem Struct //-->
//Tuev-Nord VideoGallery Class & MediaItem Struct
//VideoGallery Class
$.VideoGallery = function(selector,options) {
    this.set = jQuery.extend({
        width: 520,
        height: 313, // Clip = 520, 291 + 22
        autostart: true,
        firstmedia: "first",
        mediacontainer: "",
        mediaitem: ".media-item", 
        mediathumb: "img", 
        mediaplayerimage: "img.media-playerbackground",
        mediaheadline: "h2", 
        mediacontenttext: "p.content-text", 
        mediateasertext: "h1", 
        mediatime: "p.media-time", 
        mediadownload: "a.media-download",
        mediapräfix: "",
        flowplayerflash: "",
        flowplayercontrols: "",
        onClickElements: "img,h2,h1,.media-time",
        debug: false
    }, options);
    this.object = $(selector); //Define the VideoGalleryObject.
    this.MediaItems = new Array(); //List of MediaItems in this VideoGallery.
    this.Id = this.object.attr("id"); //Gets the ID of this VideoGallery.
    
    //Methode to add MediaItems to this VideoGallery.
    this.AddMediaItems = function(selector,options) {
        var gal = this;
        $(selector).each(function() {
            gal.MediaItems.push(new $.MediaItem(this,options));
        });
    };
    //Add MediaItems to VideoGallery.
    this.AddMediaItems(this.set.mediaitem,{
                                            mediathumb: this.set.mediathumb, 
                                            mediaplayerimage: this.set.mediaplayerimage,
                                            mediaheadline: this.set.mediaheadline, 
                                            mediacontenttext: this.set.mediacontenttext, 
                                            mediateasertext: this.set.mediateasertext, 
                                            mediatime: this.set.mediatime, 
                                            mediadownload: this.set.mediadownload
                                          });
    
    //Gets the first Media to play
    this.FirstMedia = function() {
        switch(this.set.firstmedia) {
            case"first":
                return this.MediaItems[0];
            break;
            case"last":
                return this.MediaItems[this.MediaItems.length-1];
            break;
            default:
                return this.MediaItems[this.set.firstmedia-1];
            break;
        }
    };
    //Get FirstMedia Item
    var firstmediaele = this.FirstMedia();
    
    //Set onClick-Function to Elements in MediaItems
    this.setOnClick = function() {
        var vidgal = this;
        $(this.set.mediaitem).find(this.set.onClickElements).each(function() {
                                                            $(this).css("cursor","pointer").unbind("click");
                                                            $(this).click(function() {
                                                               vidgal.PlayMediaItem($(this).parents(vidgal.set.mediaitem).attr("id"));
                                                               return false;
                                                               });
                                                            });
    };
    
    //Draw the Player with Teaser
    this.Draw = function() {
        //Draw required Containers
        this.object.prepend("<div class=\"mediaplayer\"><div class=\"playerwindow\"><a id=\"" + this.Id + "flowplayer\"></a></div>" +
                            "<div style=\"background-image:none;\" class=\"text mediateaser " + this.set.mediaitem.replace(/\./,"") + "\">" +
                            "<h1></h1><h2></h2>" + 
                            "<p class=\"content-text\"></p><p class=\"media-time\"></p>" +
                            "<a class=\"bottomlink media-download\" href=\"#\" target=\"_blank\" style=\"display:none;\">Download</a>" +
                            "</div>" +
                            "</div>");
        var playerwindow = this.object.children(".mediaplayer").children(".playerwindow");
        //Justify Containers
        playerwindow.css({"width":this.set.width+"px","height":this.set.height+"px"});
        //Display
        this.object.children(".mediaplayer").css("display","block");
    };
    
    //Set the MediaItem in Player
    this.PlayMediaItem = function(id) {
        //Find MediaItem in Array
        for(var i = 0; i < this.MediaItems.length; ++i) {
            if(this.MediaItems[i].Id == id) {
                var media = this.MediaItems[i];
                //Set MediaItem into Player
                this.object.children(".mediaplayer").children(".playerwindow").children("#" + this.Id + "flowplayer")
                .attr("href",this.set.mediapräfix + media.Download).parent().children("p").remove();
                try {
                    // Tobias Kling Abschaltung von Backround in Canvas Parameter background: '#ffffff url('+media.PlayerImage+') no-repeat 50pct 50pct', backgroundGradient: 'none' }
                    flowplayer(this.Id + "flowplayer", this.set.flowplayerflash,{
                            key: '$de17da271e8071e4c3a',                          
                            canvas: { }, 
                            clip: { autoPlay:this.set.autostart, scaling: 'orig'},
                            plugins: { controls: { 
                                 url:this.set.flowplayercontrols,
                                 timeBgColor: '#555555',
                                 bufferGradient: 'none',
                                 timeColor: '#037EFF',
                                 buttonColor: '#3B7ABD',
                                 progressColor: '#3B7ABD',
                                 volumeSliderGradient: 'none',
                                 bufferColor: '#6D94BD',
                                 height: 22
                                 } } 
                    });
                } catch(err) {
                    $("#"+this.Id + "flowplayer").parent().append("<p><b>ERROR: Flowplayer Flash-File not found!</b><br />" +
                                                                  "<b>Flash-File: </b>" + this.set.flowplayerflash + "<br />" +
                                                                  "<b>InnerException: </b>" + err.description + "</p>").css("color","red");
                }                //Set MediaItem Data into MediaTeaser
                var mediateaser = this.object.children(".mediaplayer").children(".mediateaser");
                //Set ThumbImage
                //mediateaser.children("img").attr("src",media.ThumbImage).attr("alt",media.ThumbImageAlt).attr("title",media.ThumbImageAlt);
                //Set Headline & Content Text
                var tmparr = media.Download.split('/');
                ET_Event.videoStart(tmparr[tmparr.length-1], jQuery.competence);
                mediateaser.children("h2").text(media.Headline);
                mediateaser.children("h1").html(media.Teasertext);
                mediateaser.children(".content-text").html(media.Contenttext);
                //Set Media Info & DownloadLink
                mediateaser.children(".media-time").text(media.Time);
                mediateaser.children(".media-download").attr("href",media.Download);
            }
        }
    };
    
    this.Draw();
    this.setOnClick();
    this.PlayMediaItem(firstmediaele.Id);
        
    //################## DEBUG #############################
    if(this.set.debug) {
        console.log("VideoGallery ID: " + this.Id);
        console.log("  Width: " + this.set.width + "px");
        console.log("  Height: " + this.set.height + "px");
        console.log("  AutoStart Playing: " + this.set.autostart);
        console.log("  First MediaItem: "+ this.set.firstmedia);
        console.log("  Flowplayer Flash-File: " + this.set.flowplayerflash);
        console.log("  onClick Elements: " + this.set.onClickElements);
        console.log("  Loaded MediaItems:");
        for(x in this.MediaItems) {
            console.log("    ID: " + this.MediaItems[x].Id);    
            console.log("    Headline: " + this.MediaItems[x].Headline);
            console.log("    Teasertext: " + this.MediaItems[x].Teasertext);
            console.log("    Contenttext: " + this.MediaItems[x].Contenttext);
            console.log("    Time: " + this.MediaItems[x].Time);
            console.log("    Downloadaddress: " + this.MediaItems[x].Download);
            console.log("    Imageaddress: " + this.MediaItems[x].ThumbImage);
            console.log("    Image Alt-text: " + this.MediaItems[x].ThumbImageAlt);
            console.log("    PlayerImageaddress: " + this.MediaItems[x].PlayerImage);
            console.log("  -------------------------------------------------------------------------------------------");
        }
    }
    //################ DEBUG ################################
    if(this.MediaItems.length > 1) {
        $(this.set.mediacontainer).makeScroller(this);
    } else {
        var mcnt = $(this.set.mediacontainer);
        jQuery(document).ready(function() {
            mcnt.parents('div.videogallery').prev().remove();
            mcnt.parents('div.videogallery').remove();
            mcnt.remove();
        });
    }
};
//MediaItem Struct
$.MediaItem = function(object,options) {
    this.set = jQuery.extend({
        mediathumb: "img", 
        mediaplayerimage: "img.media-playerbackground",
        mediaheadline: "h2", 
        mediacontenttext: "p.content-text", 
        mediateasertext: "h1", 
        mediatime: "p.media-time", 
        mediadownload: "a.media-download"
    }, options);
    this.object = $(object);
    //Read ID
    this.Id = this.object.attr("id");
    //Read ThumbImage
    this.ThumbImage = this.object.find(this.set.mediathumb).attr("src");
    this.ThumbImageAlt = this.object.find(this.set.mediathumb).attr("alt");
    //Read PlayerImage
    this.PlayerImage = this.object.find(this.set.mediaplayerimage).attr("src");
    //Read Headline & Content
    this.Headline = this.object.find(this.set.mediaheadline).text();
    this.Teasertext = this.object.find(this.set.mediateasertext).html();
    this.Contenttext = this.object.find(this.set.mediacontenttext).html();
    //Read Media Informations
    this.Time = this.object.find(this.set.mediatime).text();
    this.Download =  this.object.find(this.set.mediadownload).attr("href");
};
$.fn.makeScroller = function(gallery) {
    if(gallery != null) {
        //Build Navigation
        var firstcount = gallery.MediaItems.length;
        if(firstcount > 3) firstcount = 3;
        var navigation = "<div class=\"pressnavbar clearfix\"><a href=\"#\" class=\"left\">zurück</a>" +
                         "<p>1 - "+firstcount+" von " + gallery.MediaItems.length + "</p><a href=\"#\" class=\"right\">vor</a></div>";
        if(firstcount == 1) navigation = "<div class=\"pressnavbar clearfix\"><a href=\"#\" class=\"left\">zurück</a>" +
                                         "<p>1 von " + gallery.MediaItems.length + "</p><a href=\"#\" class=\"right\">vor</a></div>";
        $(this).before(navigation);
        $(this).after(navigation);
        //Adjust MediaItems
        $(this).children(gallery.set.mediaitem).css("width","492px");
        var containercount = 0;
        //Build Containers
        for(a=0;a<(gallery.MediaItems.length/3);a++) {
            if(gallery.set.debug) console.log("MediaItem-Container erstellt. Nr.: " + a);
            $(this).append("<div class=\"container"+a+"\" style=\"float:left;\"></div>");
            for(i=0;i<3;i++) {
                if(((a*3)+i)+1 <= gallery.MediaItems.length) {
                    if(gallery.set.debug) console.log("   MediaItem wird eingefügt. Index: (" + a + " * 3" + ") + " + i +
                                                                                            " = " + ((a*3)+i) + " MediaItemId: " + gallery.MediaItems[((a*3)+i)].Id);
                    $(this).children(".container"+a).append(gallery.MediaItems[((a*3)+i)].object);
                } else {
                    break;
                }
            }
            if(gallery.set.debug) console.log("--------------------------------------------");
            containercount = a+1;
        }
        $(this).css({"width":(containercount*520)+"px","left":"0px"});
        //Make ScrollFunctions
        var navbars = $(this).parent().children(".pressnavbar");
        navbars.children(".right").click(function(){
            if($.ScrollEnabled) {
                var maincontainer = $(this).parent().parent().children(".maincontainer");
                var curleft = parseInt(maincontainer.css("left").replace(/px/,""));
                if(curleft > ((containercount-1)*520)-(((containercount-1)*520)*2)) {
                    $.ScrollEnabled = false;
                    maincontainer.animate({left:(curleft-520)+"px"},200,function() {
                        var curleft = parseInt(maincontainer.css("left").replace(/px/,""));
                        var count = ((curleft-(2*curleft))/520);
                        var allcount = $(this).parent().find(".media-item").size();
                        var endcount = ((count*3)+3);
                        if(endcount > allcount) endcount = allcount;
                        $(this).parent().children(".pressnavbar").children("p").text(((count*3)+1) + " - " + endcount + " von " + allcount);
                        $.ScrollEnabled = true;
                    });
                }
            }
            return false;
        });
        navbars.children(".left").click(function(){
            if($.ScrollEnabled) {
                var maincontainer = $(this).parent().parent().children(".maincontainer");
                var curleft = parseInt(maincontainer.css("left").replace(/px/,""));
                if(curleft < 0) {
                    $.ScrollEnabled = false;
                    maincontainer.animate({left:(curleft+520)+"px"},200,function() {
                        var curleft = parseInt(maincontainer.css("left").replace(/px/,""));
                        var count = ((curleft-(2*curleft))/520);
                        var allcount = $(this).parent().find(".media-item").size();
                        var endcount = ((count*3)+3);
                        if(endcount > allcount) endcount = allcount;
                        $(this).parent().children(".pressnavbar").children("p").text(((count*3)+1) + " - " + endcount + " von " + allcount);
                        $.ScrollEnabled = true;
                    });
                }
            }
            return false;
        });
    } else {
        throw("No VideoGallery is defined!");
    }
};
$.ScrollEnabled = true;
<!-- VideoGallery Class & MediaItem Struct //-->

jQuery(document).ready(function(){
    var searchfields = jQuery('input#searchterm.searchfield, input#search.searchfield'), searchlink = jQuery('#navigation h3 a.active');
    (searchfields.length > 0 && searchlink.length > 0) && searchfields.bind('blur',{link:searchlink},function(e){
        e.data.link.unbind('click').bind('click',{field:jQuery(this)},function(e){
            e.data.field.parents('form').submit();
            return false;
        });
     });
     var results = jQuery('#searchpageform .searchresult p').text().split(' ');
     results = parseInt(results[0]) || 0;
     var searchquery = escape(jQuery('#searchterm').val());
     /*(results > 0) && jQuery.get('comp_search.htm?hits='+results+'&search-modified='+searchquery, function(data){
        jQuery('#assist_area').append(jQuery(data));
     }, 'html');*/
     (results > 0) && jQuery.ajax({url:'http://www.tuv.nl/nl/write_tagcloud.xml?hits='+results});
});

// Tooltip

(function(f){f.fn.qtip=function(B,u){var y,t,A,s,x,w,v,z;if(typeof B=="string"){if(typeof f(this).data("qtip")!=="object"){f.fn.qtip.log.error.call(self,1,f.fn.qtip.constants.NO_TOOLTIP_PRESENT,false)}if(B=="api"){return f(this).data("qtip").interfaces[f(this).data("qtip").current]}else{if(B=="interfaces"){return f(this).data("qtip").interfaces}}}else{if(!B){B={}}if(typeof B.content!=="object"||(B.content.jquery&&B.content.length>0)){B.content={text:B.content}}if(typeof B.content.title!=="object"){B.content.title={text:B.content.title}}if(typeof B.position!=="object"){B.position={corner:B.position}}if(typeof B.position.corner!=="object"){B.position.corner={target:B.position.corner,tooltip:B.position.corner}}if(typeof B.show!=="object"){B.show={when:B.show}}if(typeof B.show.when!=="object"){B.show.when={event:B.show.when}}if(typeof B.show.effect!=="object"){B.show.effect={type:B.show.effect}}if(typeof B.hide!=="object"){B.hide={when:B.hide}}if(typeof B.hide.when!=="object"){B.hide.when={event:B.hide.when}}if(typeof B.hide.effect!=="object"){B.hide.effect={type:B.hide.effect}}if(typeof B.style!=="object"){B.style={name:B.style}}B.style=c(B.style);s=f.extend(true,{},f.fn.qtip.defaults,B);s.style=a.call({options:s},s.style);s.user=f.extend(true,{},B)}return f(this).each(function(){if(typeof B=="string"){w=B.toLowerCase();A=f(this).qtip("interfaces");if(typeof A=="object"){if(u===true&&w=="destroy"){while(A.length>0){A[A.length-1].destroy()}}else{if(u!==true){A=[f(this).qtip("api")]}for(y=0;y<A.length;y++){if(w=="destroy"){A[y].destroy()}else{if(A[y].status.rendered===true){if(w=="show"){A[y].show()}else{if(w=="hide"){A[y].hide()}else{if(w=="focus"){A[y].focus()}else{if(w=="disable"){A[y].disable(true)}else{if(w=="enable"){A[y].disable(false)}}}}}}}}}}}else{v=f.extend(true,{},s);v.hide.effect.length=s.hide.effect.length;v.show.effect.length=s.show.effect.length;if(v.position.container===false){v.position.container=f(document.body)}if(v.position.target===false){v.position.target=f(this)}if(v.show.when.target===false){v.show.when.target=f(this)}if(v.hide.when.target===false){v.hide.when.target=f(this)}t=f.fn.qtip.interfaces.length;for(y=0;y<t;y++){if(typeof f.fn.qtip.interfaces[y]=="undefined"){t=y;break}}x=new d(f(this),v,t);f.fn.qtip.interfaces[t]=x;if(typeof f(this).data("qtip")=="object"){if(typeof f(this).attr("qtip")==="undefined"){f(this).data("qtip").current=f(this).data("qtip").interfaces.length}f(this).data("qtip").interfaces.push(x)}else{f(this).data("qtip",{current:0,interfaces:[x]})}if(v.content.prerender===false&&v.show.when.event!==false&&v.show.ready!==true){v.show.when.target.bind(v.show.when.event+".qtip-"+t+"-create",{qtip:t},function(C){z=f.fn.qtip.interfaces[C.data.qtip];z.options.show.when.target.unbind(z.options.show.when.event+".qtip-"+C.data.qtip+"-create");z.cache.mouse={x:C.pageX,y:C.pageY};p.call(z);z.options.show.when.target.trigger(z.options.show.when.event)})}else{x.cache.mouse={x:v.show.when.target.offset().left,y:v.show.when.target.offset().top};p.call(x)}}})};function d(u,t,v){var s=this;s.id=v;s.options=t;s.status={animated:false,rendered:false,disabled:false,focused:false};s.elements={target:u.addClass(s.options.style.classes.target),tooltip:null,wrapper:null,content:null,contentWrapper:null,title:null,button:null,tip:null,bgiframe:null};s.cache={mouse:{},position:{},toggle:0};s.timers={};f.extend(s,s.options.api,{show:function(y){var x,z;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"show")}if(s.elements.tooltip.css("display")!=="none"){return s}s.elements.tooltip.stop(true,false);x=s.beforeShow.call(s,y);if(x===false){return s}function w(){if(s.options.position.type!=="static"){s.focus()}s.onShow.call(s,y);if(f.browser.msie){s.elements.tooltip.get(0).style.removeAttribute("filter")}}s.cache.toggle=1;if(s.options.position.type!=="static"){s.updatePosition(y,(s.options.show.effect.length>0))}if(typeof s.options.show.solo=="object"){z=f(s.options.show.solo)}else{if(s.options.show.solo===true){z=f("div.qtip").not(s.elements.tooltip)}}if(z){z.each(function(){if(f(this).qtip("api").status.rendered===true){f(this).qtip("api").hide()}})}if(typeof s.options.show.effect.type=="function"){s.options.show.effect.type.call(s.elements.tooltip,s.options.show.effect.length);s.elements.tooltip.queue(function(){w();f(this).dequeue()})}else{switch(s.options.show.effect.type.toLowerCase()){case"fade":s.elements.tooltip.fadeIn(s.options.show.effect.length,w);break;case"slide":s.elements.tooltip.slideDown(s.options.show.effect.length,function(){w();if(s.options.position.type!=="static"){s.updatePosition(y,true)}});break;case"grow":s.elements.tooltip.show(s.options.show.effect.length,w);break;default:s.elements.tooltip.show(null,w);break}s.elements.tooltip.addClass(s.options.style.classes.active)}return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_SHOWN,"show")},hide:function(y){var x;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"hide")}else{if(s.elements.tooltip.css("display")==="none"){return s}}clearTimeout(s.timers.show);s.elements.tooltip.stop(true,false);x=s.beforeHide.call(s,y);if(x===false){return s}function w(){s.onHide.call(s,y)}s.cache.toggle=0;if(typeof s.options.hide.effect.type=="function"){s.options.hide.effect.type.call(s.elements.tooltip,s.options.hide.effect.length);s.elements.tooltip.queue(function(){w();f(this).dequeue()})}else{switch(s.options.hide.effect.type.toLowerCase()){case"fade":s.elements.tooltip.fadeOut(s.options.hide.effect.length,w);break;case"slide":s.elements.tooltip.slideUp(s.options.hide.effect.length,w);break;case"grow":s.elements.tooltip.hide(s.options.hide.effect.length,w);break;default:s.elements.tooltip.hide(null,w);break}s.elements.tooltip.removeClass(s.options.style.classes.active)}return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_HIDDEN,"hide")},updatePosition:function(w,x){var C,G,L,J,H,E,y,I,B,D,K,A,F,z;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updatePosition")}else{if(s.options.position.type=="static"){return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.CANNOT_POSITION_STATIC,"updatePosition")}}G={position:{left:0,top:0},dimensions:{height:0,width:0},corner:s.options.position.corner.target};L={position:s.getPosition(),dimensions:s.getDimensions(),corner:s.options.position.corner.tooltip};if(s.options.position.target!=="mouse"){if(s.options.position.target.get(0).nodeName.toLowerCase()=="area"){J=s.options.position.target.attr("coords").split(",");for(C=0;C<J.length;C++){J[C]=parseInt(J[C])}H=s.options.position.target.parent("map").attr("name");E=f('img[usemap="#'+H+'"]:first').offset();G.position={left:Math.floor(E.left+J[0]),top:Math.floor(E.top+J[1])};switch(s.options.position.target.attr("shape").toLowerCase()){case"rect":G.dimensions={width:Math.ceil(Math.abs(J[2]-J[0])),height:Math.ceil(Math.abs(J[3]-J[1]))};break;case"circle":G.dimensions={width:J[2]+1,height:J[2]+1};break;case"poly":G.dimensions={width:J[0],height:J[1]};for(C=0;C<J.length;C++){if(C%2==0){if(J[C]>G.dimensions.width){G.dimensions.width=J[C]}if(J[C]<J[0]){G.position.left=Math.floor(E.left+J[C])}}else{if(J[C]>G.dimensions.height){G.dimensions.height=J[C]}if(J[C]<J[1]){G.position.top=Math.floor(E.top+J[C])}}}G.dimensions.width=G.dimensions.width-(G.position.left-E.left);G.dimensions.height=G.dimensions.height-(G.position.top-E.top);break;default:return f.fn.qtip.log.error.call(s,4,f.fn.qtip.constants.INVALID_AREA_SHAPE,"updatePosition");break}G.dimensions.width-=2;G.dimensions.height-=2}else{if(s.options.position.target.add(document.body).length===1){G.position={left:f(document).scrollLeft(),top:f(document).scrollTop()};G.dimensions={height:f(window).height(),width:f(window).width()}}else{if(typeof s.options.position.target.attr("qtip")!=="undefined"){G.position=s.options.position.target.qtip("api").cache.position}else{G.position=s.options.position.target.offset()}G.dimensions={height:s.options.position.target.outerHeight(),width:s.options.position.target.outerWidth()}}}y=f.extend({},G.position);if(G.corner.search(/right/i)!==-1){y.left+=G.dimensions.width}if(G.corner.search(/bottom/i)!==-1){y.top+=G.dimensions.height}if(G.corner.search(/((top|bottom)Middle)|center/)!==-1){y.left+=(G.dimensions.width/2)}if(G.corner.search(/((left|right)Middle)|center/)!==-1){y.top+=(G.dimensions.height/2)}}else{G.position=y={left:s.cache.mouse.x,top:s.cache.mouse.y};G.dimensions={height:1,width:1}}if(L.corner.search(/right/i)!==-1){y.left-=L.dimensions.width}if(L.corner.search(/bottom/i)!==-1){y.top-=L.dimensions.height}if(L.corner.search(/((top|bottom)Middle)|center/)!==-1){y.left-=(L.dimensions.width/2)}if(L.corner.search(/((left|right)Middle)|center/)!==-1){y.top-=(L.dimensions.height/2)}I=(f.browser.msie)?1:0;B=(f.browser.msie&&parseInt(f.browser.version.charAt(0))===6)?1:0;if(s.options.style.border.radius>0){if(L.corner.search(/Left/)!==-1){y.left-=s.options.style.border.radius}else{if(L.corner.search(/Right/)!==-1){y.left+=s.options.style.border.radius}}if(L.corner.search(/Top/)!==-1){y.top-=s.options.style.border.radius}else{if(L.corner.search(/Bottom/)!==-1){y.top+=s.options.style.border.radius}}}if(I){if(L.corner.search(/top/)!==-1){y.top-=I}else{if(L.corner.search(/bottom/)!==-1){y.top+=I}}if(L.corner.search(/left/)!==-1){y.left-=I}else{if(L.corner.search(/right/)!==-1){y.left+=I}}if(L.corner.search(/leftMiddle|rightMiddle/)!==-1){y.top-=1}}if(s.options.position.adjust.screen===true){y=o.call(s,y,G,L)}if(s.options.position.target==="mouse"&&s.options.position.adjust.mouse===true){if(s.options.position.adjust.screen===true&&s.elements.tip){K=s.elements.tip.attr("rel")}else{K=s.options.position.corner.tooltip}y.left+=(K.search(/right/i)!==-1)?-6:6;y.top+=(K.search(/bottom/i)!==-1)?-6:6}if(!s.elements.bgiframe&&f.browser.msie&&parseInt(f.browser.version.charAt(0))==6){f("select, object").each(function(){A=f(this).offset();A.bottom=A.top+f(this).height();A.right=A.left+f(this).width();if(y.top+L.dimensions.height>=A.top&&y.left+L.dimensions.width>=A.left){k.call(s)}})}y.left+=s.options.position.adjust.x;y.top+=s.options.position.adjust.y;F=s.getPosition();if(y.left!=F.left||y.top!=F.top){z=s.beforePositionUpdate.call(s,w);if(z===false){return s}s.cache.position=y;if(x===true){s.status.animated=true;s.elements.tooltip.animate(y,200,"swing",function(){s.status.animated=false})}else{s.elements.tooltip.css(y)}s.onPositionUpdate.call(s,w);if(typeof w!=="undefined"&&w.type&&w.type!=="mousemove"){f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_POSITION_UPDATED,"updatePosition")}}return s},updateWidth:function(w){var x;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateWidth")}else{if(w&&typeof w!=="number"){return f.fn.qtip.log.error.call(s,2,"newWidth must be of type number","updateWidth")}}x=s.elements.contentWrapper.siblings().add(s.elements.tip).add(s.elements.button);if(!w){if(typeof s.options.style.width.value=="number"){w=s.options.style.width.value}else{s.elements.tooltip.css({width:"auto"});x.hide();if(f.browser.msie){s.elements.wrapper.add(s.elements.contentWrapper.children()).css({zoom:"normal"})}w=s.getDimensions().width+1;if(!s.options.style.width.value){if(w>s.options.style.width.max){w=s.options.style.width.max}if(w<s.options.style.width.min){w=s.options.style.width.min}}}}if(w%2!==0){w-=1}s.elements.tooltip.width(w);x.show();if(s.options.style.border.radius){s.elements.tooltip.find(".qtip-betweenCorners").each(function(y){f(this).width(w-(s.options.style.border.radius*2))})}if(f.browser.msie){s.elements.wrapper.add(s.elements.contentWrapper.children()).css({zoom:"1"});s.elements.wrapper.width(w);if(s.elements.bgiframe){s.elements.bgiframe.width(w).height(s.getDimensions.height)}}return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_WIDTH_UPDATED,"updateWidth")},updateStyle:function(w){var z,A,x,y,B;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateStyle")}else{if(typeof w!=="string"||!f.fn.qtip.styles[w]){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.STYLE_NOT_DEFINED,"updateStyle")}}s.options.style=a.call(s,f.fn.qtip.styles[w],s.options.user.style);s.elements.content.css(q(s.options.style));if(s.options.content.title.text!==false){s.elements.title.css(q(s.options.style.title,true))}s.elements.contentWrapper.css({borderColor:s.options.style.border.color});if(s.options.style.tip.corner!==false){if(f("<canvas>").get(0).getContext){z=s.elements.tooltip.find(".qtip-tip canvas:first");x=z.get(0).getContext("2d");x.clearRect(0,0,300,300);y=z.parent("div[rel]:first").attr("rel");B=b(y,s.options.style.tip.size.width,s.options.style.tip.size.height);h.call(s,z,B,s.options.style.tip.color||s.options.style.border.color)}else{if(f.browser.msie){z=s.elements.tooltip.find('.qtip-tip [nodeName="shape"]');z.attr("fillcolor",s.options.style.tip.color||s.options.style.border.color)}}}if(s.options.style.border.radius>0){s.elements.tooltip.find(".qtip-betweenCorners").css({backgroundColor:s.options.style.border.color});if(f("<canvas>").get(0).getContext){A=g(s.options.style.border.radius);s.elements.tooltip.find(".qtip-wrapper canvas").each(function(){x=f(this).get(0).getContext("2d");x.clearRect(0,0,300,300);y=f(this).parent("div[rel]:first").attr("rel");r.call(s,f(this),A[y],s.options.style.border.radius,s.options.style.border.color)})}else{if(f.browser.msie){s.elements.tooltip.find('.qtip-wrapper [nodeName="arc"]').each(function(){f(this).attr("fillcolor",s.options.style.border.color)})}}}return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_STYLE_UPDATED,"updateStyle")},updateContent:function(A,y){var z,x,w;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateContent")}else{if(!A){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.NO_CONTENT_PROVIDED,"updateContent")}}z=s.beforeContentUpdate.call(s,A);if(typeof z=="string"){A=z}else{if(z===false){return}}if(f.browser.msie){s.elements.contentWrapper.children().css({zoom:"normal"})}if(A.jquery&&A.length>0){A.clone(true).appendTo(s.elements.content).show()}else{s.elements.content.html(A)}x=s.elements.content.find("img[complete=false]");if(x.length>0){w=0;x.each(function(C){f('<img src="'+f(this).attr("src")+'" />').load(function(){if(++w==x.length){B()}})})}else{B()}function B(){s.updateWidth();if(y!==false){if(s.options.position.type!=="static"){s.updatePosition(s.elements.tooltip.is(":visible"),true)}if(s.options.style.tip.corner!==false){n.call(s)}}}s.onContentUpdate.call(s);return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_CONTENT_UPDATED,"loadContent")},loadContent:function(w,z,A){var y;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"loadContent")}y=s.beforeContentLoad.call(s);if(y===false){return s}if(A=="post"){f.post(w,z,x)}else{f.get(w,z,x)}function x(B){s.onContentLoad.call(s);f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_CONTENT_LOADED,"loadContent");s.updateContent(B)}return s},updateTitle:function(w){if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateTitle")}else{if(!w){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.NO_CONTENT_PROVIDED,"updateTitle")}}returned=s.beforeTitleUpdate.call(s);if(returned===false){return s}if(s.elements.button){s.elements.button=s.elements.button.clone(true)}s.elements.title.html(w);if(s.elements.button){s.elements.title.prepend(s.elements.button)}s.onTitleUpdate.call(s);return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_TITLE_UPDATED,"updateTitle")},focus:function(A){var y,x,w,z;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"focus")}else{if(s.options.position.type=="static"){return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.CANNOT_FOCUS_STATIC,"focus")}}y=parseInt(s.elements.tooltip.css("z-index"));x=6000+f("div.qtip[qtip]").length-1;if(!s.status.focused&&y!==x){z=s.beforeFocus.call(s,A);if(z===false){return s}f("div.qtip[qtip]").not(s.elements.tooltip).each(function(){if(f(this).qtip("api").status.rendered===true){w=parseInt(f(this).css("z-index"));if(typeof w=="number"&&w>-1){f(this).css({zIndex:parseInt(f(this).css("z-index"))-1})}f(this).qtip("api").status.focused=false}});s.elements.tooltip.css({zIndex:x});s.status.focused=true;s.onFocus.call(s,A);f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_FOCUSED,"focus")}return s},disable:function(w){if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"disable")}if(w){if(!s.status.disabled){s.status.disabled=true;f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_DISABLED,"disable")}else{f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.TOOLTIP_ALREADY_DISABLED,"disable")}}else{if(s.status.disabled){s.status.disabled=false;f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_ENABLED,"disable")}else{f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.TOOLTIP_ALREADY_ENABLED,"disable")}}return s},destroy:function(){var w,x,y;x=s.beforeDestroy.call(s);if(x===false){return s}if(s.status.rendered){s.options.show.when.target.unbind("mousemove.qtip",s.updatePosition);s.options.show.when.target.unbind("mouseout.qtip",s.hide);s.options.show.when.target.unbind(s.options.show.when.event+".qtip");s.options.hide.when.target.unbind(s.options.hide.when.event+".qtip");s.elements.tooltip.unbind(s.options.hide.when.event+".qtip");s.elements.tooltip.unbind("mouseover.qtip",s.focus);s.elements.tooltip.remove()}else{s.options.show.when.target.unbind(s.options.show.when.event+".qtip-create")}if(typeof s.elements.target.data("qtip")=="object"){y=s.elements.target.data("qtip").interfaces;if(typeof y=="object"&&y.length>0){for(w=0;w<y.length-1;w++){if(y[w].id==s.id){y.splice(w,1)}}}}delete f.fn.qtip.interfaces[s.id];if(typeof y=="object"&&y.length>0){s.elements.target.data("qtip").current=y.length-1}else{s.elements.target.removeData("qtip")}s.onDestroy.call(s);f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_DESTROYED,"destroy");return s.elements.target},getPosition:function(){var w,x;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"getPosition")}w=(s.elements.tooltip.css("display")!=="none")?false:true;if(w){s.elements.tooltip.css({visiblity:"hidden"}).show()}x=s.elements.tooltip.offset();if(w){s.elements.tooltip.css({visiblity:"visible"}).hide()}return x},getDimensions:function(){var w,x;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"getDimensions")}w=(!s.elements.tooltip.is(":visible"))?true:false;if(w){s.elements.tooltip.css({visiblity:"hidden"}).show()}x={height:s.elements.tooltip.outerHeight(),width:s.elements.tooltip.outerWidth()};if(w){s.elements.tooltip.css({visiblity:"visible"}).hide()}return x}})}function p(){var s,w,u,t,v,y,x;s=this;s.beforeRender.call(s);s.status.rendered=true;s.elements.tooltip='<div qtip="'+s.id+'" class="qtip '+(s.options.style.classes.tooltip||s.options.style)+'"style="display:none; -moz-border-radius:0; -webkit-border-radius:0; border-radius:0;position:'+s.options.position.type+';">  <div class="qtip-wrapper" style="position:relative; overflow:hidden; text-align:left;">    <div class="qtip-contentWrapper" style="overflow:hidden;">       <div class="qtip-content '+s.options.style.classes.content+'"></div></div></div></div>';s.elements.tooltip=f(s.elements.tooltip);s.elements.tooltip.appendTo(s.options.position.container);s.elements.tooltip.data("qtip",{current:0,interfaces:[s]});s.elements.wrapper=s.elements.tooltip.children("div:first");s.elements.contentWrapper=s.elements.wrapper.children("div:first").css({background:s.options.style.background});s.elements.content=s.elements.contentWrapper.children("div:first").css(q(s.options.style));if(f.browser.msie){s.elements.wrapper.add(s.elements.content).css({zoom:1})}if(s.options.hide.when.event=="unfocus"){s.elements.tooltip.attr("unfocus",true)}if(typeof s.options.style.width.value=="number"){s.updateWidth()}if(f("<canvas>").get(0).getContext||f.browser.msie){if(s.options.style.border.radius>0){m.call(s)}else{s.elements.contentWrapper.css({border:s.options.style.border.width+"px solid "+s.options.style.border.color})}if(s.options.style.tip.corner!==false){e.call(s)}}else{s.elements.contentWrapper.css({border:s.options.style.border.width+"px solid "+s.options.style.border.color});s.options.style.border.radius=0;s.options.style.tip.corner=false;f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.CANVAS_VML_NOT_SUPPORTED,"render")}if((typeof s.options.content.text=="string"&&s.options.content.text.length>0)||(s.options.content.text.jquery&&s.options.content.text.length>0)){u=s.options.content.text}else{if(typeof s.elements.target.attr("title")=="string"&&s.elements.target.attr("title").length>0){u=s.elements.target.attr("title").replace("\\n","<br />");s.elements.target.attr("title","")}else{if(typeof s.elements.target.attr("alt")=="string"&&s.elements.target.attr("alt").length>0){u=s.elements.target.attr("alt").replace("\\n","<br />");s.elements.target.attr("alt","")}else{u=" ";f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.NO_VALID_CONTENT,"render")}}}if(s.options.content.title.text!==false){j.call(s)}s.updateContent(u);l.call(s);if(s.options.show.ready===true){s.show()}if(s.options.content.url!==false){t=s.options.content.url;v=s.options.content.data;y=s.options.content.method||"get";s.loadContent(t,v,y)}s.onRender.call(s);f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_RENDERED,"render")}function m(){var F,z,t,B,x,E,u,G,D,y,w,C,A,s,v;F=this;F.elements.wrapper.find(".qtip-borderBottom, .qtip-borderTop").remove();t=F.options.style.border.width;B=F.options.style.border.radius;x=F.options.style.border.color||F.options.style.tip.color;E=g(B);u={};for(z in E){u[z]='<div rel="'+z+'" style="'+((z.search(/Left/)!==-1)?"left":"right")+":0; position:absolute; height:"+B+"px; width:"+B+'px; overflow:hidden; line-height:0.1px; font-size:1px">';if(f("<canvas>").get(0).getContext){u[z]+='<canvas height="'+B+'" width="'+B+'" style="vertical-align: top"></canvas>'}else{if(f.browser.msie){G=B*2+3;u[z]+='<v:arc stroked="false" fillcolor="'+x+'" startangle="'+E[z][0]+'" endangle="'+E[z][1]+'" style="width:'+G+"px; height:"+G+"px; margin-top:"+((z.search(/bottom/)!==-1)?-2:-1)+"px; margin-left:"+((z.search(/Right/)!==-1)?E[z][2]-3.5:-1)+'px; vertical-align:top; display:inline-block; behavior:url(#default#VML)"></v:arc>'}}u[z]+="</div>"}D=F.getDimensions().width-(Math.max(t,B)*2);y='<div class="qtip-betweenCorners" style="height:'+B+"px; width:"+D+"px; overflow:hidden; background-color:"+x+'; line-height:0.1px; font-size:1px;">';w='<div class="qtip-borderTop" dir="ltr" style="height:'+B+"px; margin-left:"+B+'px; line-height:0.1px; font-size:1px; padding:0;">'+u.topLeft+u.topRight+y;F.elements.wrapper.prepend(w);C='<div class="qtip-borderBottom" dir="ltr" style="height:'+B+"px; margin-left:"+B+'px; line-height:0.1px; font-size:1px; padding:0;">'+u.bottomLeft+u.bottomRight+y;F.elements.wrapper.append(C);if(f("<canvas>").get(0).getContext){F.elements.wrapper.find("canvas").each(function(){A=E[f(this).parent("[rel]:first").attr("rel")];r.call(F,f(this),A,B,x)})}else{if(f.browser.msie){F.elements.tooltip.append('<v:image style="behavior:url(#default#VML);"></v:image>')}}s=Math.max(B,(B+(t-B)));v=Math.max(t-B,0);F.elements.contentWrapper.css({border:"0px solid "+x,borderWidth:v+"px "+s+"px"})}function r(u,w,s,t){var v=u.get(0).getContext("2d");v.fillStyle=t;v.beginPath();v.arc(w[0],w[1],s,0,Math.PI*2,false);v.fill()}function e(v){var t,s,x,u,w;t=this;if(t.elements.tip!==null){t.elements.tip.remove()}s=t.options.style.tip.color||t.options.style.border.color;if(t.options.style.tip.corner===false){return}else{if(!v){v=t.options.style.tip.corner}}x=b(v,t.options.style.tip.size.width,t.options.style.tip.size.height);t.elements.tip='<div class="'+t.options.style.classes.tip+'" dir="ltr" rel="'+v+'" style="position:absolute; height:'+t.options.style.tip.size.height+"px; width:"+t.options.style.tip.size.width+'px; margin:0 auto; line-height:0.1px; font-size:1px;">';if(f("<canvas>").get(0).getContext){t.elements.tip+='<canvas height="'+t.options.style.tip.size.height+'" width="'+t.options.style.tip.size.width+'"></canvas>'}else{if(f.browser.msie){u=t.options.style.tip.size.width+","+t.options.style.tip.size.height;w="m"+x[0][0]+","+x[0][1];w+=" l"+x[1][0]+","+x[1][1];w+=" "+x[2][0]+","+x[2][1];w+=" xe";t.elements.tip+='<v:shape fillcolor="'+s+'" stroked="false" filled="true" path="'+w+'" coordsize="'+u+'" style="width:'+t.options.style.tip.size.width+"px; height:"+t.options.style.tip.size.height+"px; line-height:0.1px; display:inline-block; behavior:url(#default#VML); vertical-align:"+((v.search(/top/)!==-1)?"bottom":"top")+'"></v:shape>';t.elements.tip+='<v:image style="behavior:url(#default#VML);"></v:image>';t.elements.contentWrapper.css("position","relative")}}t.elements.tooltip.prepend(t.elements.tip+"</div>");t.elements.tip=t.elements.tooltip.find("."+t.options.style.classes.tip).eq(0);if(f("<canvas>").get(0).getContext){h.call(t,t.elements.tip.find("canvas:first"),x,s)}if(v.search(/top/)!==-1&&f.browser.msie&&parseInt(f.browser.version.charAt(0))===6){t.elements.tip.css({marginTop:-4})}n.call(t,v)}function h(t,v,s){var u=t.get(0).getContext("2d");u.fillStyle=s;u.beginPath();u.moveTo(v[0][0],v[0][1]);u.lineTo(v[1][0],v[1][1]);u.lineTo(v[2][0],v[2][1]);u.fill()}function n(u){var t,w,s,x,v;t=this;if(t.options.style.tip.corner===false||!t.elements.tip){return}if(!u){u=t.elements.tip.attr("rel")}w=positionAdjust=(f.browser.msie)?1:0;t.elements.tip.css(u.match(/left|right|top|bottom/)[0],0);if(u.search(/top|bottom/)!==-1){if(f.browser.msie){if(parseInt(f.browser.version.charAt(0))===6){positionAdjust=(u.search(/top/)!==-1)?-3:1}else{positionAdjust=(u.search(/top/)!==-1)?1:2}}if(u.search(/Middle/)!==-1){t.elements.tip.css({left:"50%",marginLeft:-(t.options.style.tip.size.width/2)})}else{if(u.search(/Left/)!==-1){t.elements.tip.css({left:t.options.style.border.radius-w})}else{if(u.search(/Right/)!==-1){t.elements.tip.css({right:t.options.style.border.radius+w})}}}if(u.search(/top/)!==-1){t.elements.tip.css({top:-positionAdjust})}else{t.elements.tip.css({bottom:positionAdjust})}}else{if(u.search(/left|right/)!==-1){if(f.browser.msie){positionAdjust=(parseInt(f.browser.version.charAt(0))===6)?1:((u.search(/left/)!==-1)?1:2)}if(u.search(/Middle/)!==-1){t.elements.tip.css({top:"50%",marginTop:-(t.options.style.tip.size.height/2)})}else{if(u.search(/Top/)!==-1){t.elements.tip.css({top:t.options.style.border.radius-w})}else{if(u.search(/Bottom/)!==-1){t.elements.tip.css({bottom:t.options.style.border.radius+w})}}}if(u.search(/left/)!==-1){t.elements.tip.css({left:-positionAdjust})}else{t.elements.tip.css({right:positionAdjust})}}}s="padding-"+u.match(/left|right|top|bottom/)[0];x=t.options.style.tip.size[(s.search(/left|right/)!==-1)?"width":"height"];t.elements.tooltip.css("padding",0);t.elements.tooltip.css(s,x);if(f.browser.msie&&parseInt(f.browser.version.charAt(0))==6){v=parseInt(t.elements.tip.css("margin-top"))||0;v+=parseInt(t.elements.content.css("margin-top"))||0;t.elements.tip.css({marginTop:v})}}function j(){var s=this;if(s.elements.title!==null){s.elements.title.remove()}s.elements.title=f('<div class="'+s.options.style.classes.title+'">').css(q(s.options.style.title,true)).css({zoom:(f.browser.msie)?1:0}).prependTo(s.elements.contentWrapper);if(s.options.content.title.text){s.updateTitle.call(s,s.options.content.title.text)}if(s.options.content.title.button!==false&&typeof s.options.content.title.button=="string"){s.elements.button=f('<a class="'+s.options.style.classes.button+'" style="float:right; position: relative"></a>').css(q(s.options.style.button,true)).html(s.options.content.title.button).prependTo(s.elements.title).click(function(t){if(!s.status.disabled){s.hide(t)}})}}function l(){var t,v,u,s;t=this;v=t.options.show.when.target;u=t.options.hide.when.target;if(t.options.hide.fixed){u=u.add(t.elements.tooltip)}if(t.options.hide.when.event=="inactive"){s=["click","dblclick","mousedown","mouseup","mousemove","mouseout","mouseenter","mouseleave","mouseover"];function y(z){if(t.status.disabled===true){return}clearTimeout(t.timers.inactive);t.timers.inactive=setTimeout(function(){f(s).each(function(){u.unbind(this+".qtip-inactive");t.elements.content.unbind(this+".qtip-inactive")});t.hide(z)},t.options.hide.delay)}}else{if(t.options.hide.fixed===true){t.elements.tooltip.bind("mouseover.qtip",function(){if(t.status.disabled===true){return}clearTimeout(t.timers.hide)})}}function x(z){if(t.status.disabled===true){return}if(t.options.hide.when.event=="inactive"){f(s).each(function(){u.bind(this+".qtip-inactive",y);t.elements.content.bind(this+".qtip-inactive",y)});y()}clearTimeout(t.timers.show);clearTimeout(t.timers.hide);t.timers.show=setTimeout(function(){t.show(z)},t.options.show.delay)}function w(z){if(t.status.disabled===true){return}if(t.options.hide.fixed===true&&t.options.hide.when.event.search(/mouse(out|leave)/i)!==-1&&f(z.relatedTarget).parents("div.qtip[qtip]").length>0){z.stopPropagation();z.preventDefault();clearTimeout(t.timers.hide);return false}clearTimeout(t.timers.show);clearTimeout(t.timers.hide);t.elements.tooltip.stop(true,true);t.timers.hide=setTimeout(function(){t.hide(z)},t.options.hide.delay)}if((t.options.show.when.target.add(t.options.hide.when.target).length===1&&t.options.show.when.event==t.options.hide.when.event&&t.options.hide.when.event!=="inactive")||t.options.hide.when.event=="unfocus"){t.cache.toggle=0;v.bind(t.options.show.when.event+".qtip",function(z){if(t.cache.toggle==0){x(z)}else{w(z)}})}else{v.bind(t.options.show.when.event+".qtip",x);if(t.options.hide.when.event!=="inactive"){u.bind(t.options.hide.when.event+".qtip",w)}}if(t.options.position.type.search(/(fixed|absolute)/)!==-1){t.elements.tooltip.bind("mouseover.qtip",t.focus)}if(t.options.position.target==="mouse"&&t.options.position.type!=="static"){v.bind("mousemove.qtip",function(z){t.cache.mouse={x:z.pageX,y:z.pageY};if(t.status.disabled===false&&t.options.position.adjust.mouse===true&&t.options.position.type!=="static"&&t.elements.tooltip.css("display")!=="none"){t.updatePosition(z)}})}}function o(u,v,A){var z,s,x,y,t,w;z=this;if(A.corner=="center"){return v.position}s=f.extend({},u);y={x:false,y:false};t={left:(s.left<f.fn.qtip.cache.screen.scroll.left),right:(s.left+A.dimensions.width+2>=f.fn.qtip.cache.screen.width+f.fn.qtip.cache.screen.scroll.left),top:(s.top<f.fn.qtip.cache.screen.scroll.top),bottom:(s.top+A.dimensions.height+2>=f.fn.qtip.cache.screen.height+f.fn.qtip.cache.screen.scroll.top)};x={left:(t.left&&(A.corner.search(/right/i)!=-1||(A.corner.search(/right/i)==-1&&!t.right))),right:(t.right&&(A.corner.search(/left/i)!=-1||(A.corner.search(/left/i)==-1&&!t.left))),top:(t.top&&A.corner.search(/top/i)==-1),bottom:(t.bottom&&A.corner.search(/bottom/i)==-1)};if(x.left){if(z.options.position.target!=="mouse"){s.left=v.position.left+v.dimensions.width}else{s.left=z.cache.mouse.x}y.x="Left"}else{if(x.right){if(z.options.position.target!=="mouse"){s.left=v.position.left-A.dimensions.width}else{s.left=z.cache.mouse.x-A.dimensions.width}y.x="Right"}}if(x.top){if(z.options.position.target!=="mouse"){s.top=v.position.top+v.dimensions.height}else{s.top=z.cache.mouse.y}y.y="top"}else{if(x.bottom){if(z.options.position.target!=="mouse"){s.top=v.position.top-A.dimensions.height}else{s.top=z.cache.mouse.y-A.dimensions.height}y.y="bottom"}}if(s.left<0){s.left=u.left;y.x=false}if(s.top<0){s.top=u.top;y.y=false}if(z.options.style.tip.corner!==false){s.corner=new String(A.corner);if(y.x!==false){s.corner=s.corner.replace(/Left|Right|Middle/,y.x)}if(y.y!==false){s.corner=s.corner.replace(/top|bottom/,y.y)}if(s.corner!==z.elements.tip.attr("rel")){e.call(z,s.corner)}}return s}function q(u,t){var v,s;v=f.extend(true,{},u);for(s in v){if(t===true&&s.search(/(tip|classes)/i)!==-1){delete v[s]}else{if(!t&&s.search(/(width|border|tip|title|classes|user)/i)!==-1){delete v[s]}}}return v}function c(s){if(typeof s.tip!=="object"){s.tip={corner:s.tip}}if(typeof s.tip.size!=="object"){s.tip.size={width:s.tip.size,height:s.tip.size}}if(typeof s.border!=="object"){s.border={width:s.border}}if(typeof s.width!=="object"){s.width={value:s.width}}if(typeof s.width.max=="string"){s.width.max=parseInt(s.width.max.replace(/([0-9]+)/i,"$1"))}if(typeof s.width.min=="string"){s.width.min=parseInt(s.width.min.replace(/([0-9]+)/i,"$1"))}if(typeof s.tip.size.x=="number"){s.tip.size.width=s.tip.size.x;delete s.tip.size.x}if(typeof s.tip.size.y=="number"){s.tip.size.height=s.tip.size.y;delete s.tip.size.y}return s}function a(){var s,t,u,x,v,w;s=this;u=[true,{}];for(t=0;t<arguments.length;t++){u.push(arguments[t])}x=[f.extend.apply(f,u)];while(typeof x[0].name=="string"){x.unshift(c(f.fn.qtip.styles[x[0].name]))}x.unshift(true,{classes:{tooltip:"qtip-"+(arguments[0].name||"defaults")}},f.fn.qtip.styles.defaults);v=f.extend.apply(f,x);w=(f.browser.msie)?1:0;v.tip.size.width+=w;v.tip.size.height+=w;if(v.tip.size.width%2>0){v.tip.size.width+=1}if(v.tip.size.height%2>0){v.tip.size.height+=1}if(v.tip.corner===true){v.tip.corner=(s.options.position.corner.tooltip==="center")?false:s.options.position.corner.tooltip}return v}function b(v,u,t){var s={bottomRight:[[0,0],[u,t],[u,0]],bottomLeft:[[0,0],[u,0],[0,t]],topRight:[[0,t],[u,0],[u,t]],topLeft:[[0,0],[0,t],[u,t]],topMiddle:[[0,t],[u/2,0],[u,t]],bottomMiddle:[[0,0],[u,0],[u/2,t]],rightMiddle:[[0,0],[u,t/2],[0,t]],leftMiddle:[[u,0],[u,t],[0,t/2]]};s.leftTop=s.bottomRight;s.rightTop=s.bottomLeft;s.leftBottom=s.topRight;s.rightBottom=s.topLeft;return s[v]}function g(s){var t;if(f("<canvas>").get(0).getContext){t={topLeft:[s,s],topRight:[0,s],bottomLeft:[s,0],bottomRight:[0,0]}}else{if(f.browser.msie){t={topLeft:[-90,90,0],topRight:[-90,90,-s],bottomLeft:[90,270,0],bottomRight:[90,270,-s]}}}return t}function k(){var s,t,u;s=this;u=s.getDimensions();t='<iframe class="qtip-bgiframe" frameborder="0" tabindex="-1" src="javascript:false" style="display:block; position:absolute; z-index:-1; filter:alpha(opacity=\'0\'); border: 1px solid red; height:'+u.height+"px; width:"+u.width+'px" />';s.elements.bgiframe=s.elements.wrapper.prepend(t).children(".qtip-bgiframe:first")}f(document).ready(function(){f.fn.qtip.cache={screen:{scroll:{left:f(window).scrollLeft(),top:f(window).scrollTop()},width:f(window).width(),height:f(window).height()}};var s;f(window).bind("resize scroll",function(t){clearTimeout(s);s=setTimeout(function(){if(t.type==="scroll"){f.fn.qtip.cache.screen.scroll={left:f(window).scrollLeft(),top:f(window).scrollTop()}}else{f.fn.qtip.cache.screen.width=f(window).width();f.fn.qtip.cache.screen.height=f(window).height()}for(i=0;i<f.fn.qtip.interfaces.length;i++){var u=f.fn.qtip.interfaces[i];if(u.status.rendered===true&&(u.options.position.type!=="static"||u.options.position.adjust.scroll&&t.type==="scroll"||u.options.position.adjust.resize&&t.type==="resize")){u.updatePosition(t,true)}}},100)});f(document).bind("mousedown.qtip",function(t){if(f(t.target).parents("div.qtip").length===0){f(".qtip[unfocus]").each(function(){var u=f(this).qtip("api");if(f(this).is(":visible")&&!u.status.disabled&&f(t.target).add(u.elements.target).length>1){u.hide(t)}})}})});f.fn.qtip.interfaces=[];f.fn.qtip.log={error:function(){return this}};f.fn.qtip.constants={};f.fn.qtip.defaults={content:{prerender:false,text:false,url:false,data:null,title:{text:false,button:false}},position:{target:false,corner:{target:"bottomRight",tooltip:"topLeft"},adjust:{x:0,y:0,mouse:true,screen:false,scroll:true,resize:true},type:"absolute",container:false},show:{when:{target:false,event:"mouseover"},effect:{type:"fade",length:100},delay:140,solo:false,ready:false},hide:{when:{target:false,event:"mouseout"},effect:{type:"fade",length:100},delay:0,fixed:false},api:{beforeRender:function(){},onRender:function(){},beforePositionUpdate:function(){},onPositionUpdate:function(){},beforeShow:function(){},onShow:function(){},beforeHide:function(){},onHide:function(){},beforeContentUpdate:function(){},onContentUpdate:function(){},beforeContentLoad:function(){},onContentLoad:function(){},beforeTitleUpdate:function(){},onTitleUpdate:function(){},beforeDestroy:function(){},onDestroy:function(){},beforeFocus:function(){},onFocus:function(){}}};f.fn.qtip.styles={defaults:{background:"008DE8",color:"#fff",overflow:"hidden",textAlign:"left",width:{min:0,max:250},padding:"5px 9px",border:{width:1,radius:0,color:"#008DE8"},tip:{corner:false,color:false,size:{width:13,height:13},opacity:1},title:{background:"#008DE8",fontWeight:"bold",padding:"7px 12px"},button:{cursor:"pointer"},classes:{target:"",tip:"qtip-tip",title:"qtip-title",button:"qtip-button",content:"qtip-content",active:"qtip-active"}},blue:{border:{width:3,radius:0,color:"#008DE8"},title:{background:"#008DE8",color:"#fff"},background:"#008DE8",color:"#fff",classes:{tooltip:"qtip-blue"}}}})(jQuery);

jQuery(document).ready(function(){
$("div#breadcrumb a[title]").qtip({
   position: {
      corner: {
         tooltip: 'bottomLeft', // Use the corner...
         target: 'leftTop' // ...and opposite corner
      }
   },
   style: {
      border: {
         width: 0,
         radius: 0
      },
      padding: 5, 
      textAlign: 'center',
      tip: true, // Give it a speech bubble tip with automatic corner detection
      name: 'blue' // Style it according to the preset 'cream' style
   }
});
});

function openPrintView(fileName)
{
  window.open(fileName,'Printview');
}
function openPrintDialog()
{
  window.print();
}