
(function(c){function r(b,d){d=d==="x"?m.width():m.height();return typeof b==="string"?Math.round(b.match(/%/)?d/100*parseInt(b,10):parseInt(b,10)):b}function M(b){b=c.isFunction(b)?b.call(i):b;return a.photo||b.match(/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i)}function Y(){for(var b in a)if(c.isFunction(a[b])&&b.substring(0,2)!=="on")a[b]=a[b].call(i);a.rel=a.rel||i.rel;a.href=a.href||i.href;a.title=a.title||i.title}function Z(b){i=b;a=c(i).data(q);Y();if(a.rel&&a.rel!=="nofollow"){g= c(".cboxElement").filter(function(){return(c(this).data(q).rel||this.rel)===a.rel});j=g.index(i);if(j<0){g=g.add(i);j=g.length-1}}else{g=c(i);j=0}if(!B){C=B=n;N=i;N.blur();c(document).bind("keydown.cbox_close",function(d){if(d.keyCode===27){d.preventDefault();e.close()}}).bind("keydown.cbox_arrows",function(d){if(g.length>1)if(d.keyCode===37){d.preventDefault();D.click()}else if(d.keyCode===39){d.preventDefault();E.click()}});a.overlayClose&&s.css({cursor:"pointer"}).one("click",e.close);c.event.trigger(aa); a.onOpen&&a.onOpen.call(i);s.css({opacity:a.opacity}).show();a.w=r(a.initialWidth,"x");a.h=r(a.initialHeight,"y");e.position(0);O&&m.bind("resize.cboxie6 scroll.cboxie6",function(){s.css({width:m.width(),height:m.height(),top:m.scrollTop(),left:m.scrollLeft()})}).trigger("scroll.cboxie6")}P.add(D).add(E).add(t).add(Q).hide();R.html(a.close).show();e.slideshow();e.load()}var q="colorbox",F="hover",n=true,e,x=!c.support.opacity,O=x&&!window.XMLHttpRequest,aa="cbox_open",H="cbox_load",S="cbox_complete", T="resize.cbox_resize",s,k,u,p,U,V,W,X,g,m,l,I,J,K,Q,P,t,E,D,R,y,z,v,w,i,N,j,a,B,C,$={transition:"elastic",speed:350,width:false,height:false,innerWidth:false,innerHeight:false,initialWidth:"400",initialHeight:"400",maxWidth:false,maxHeight:false,scalePhotos:n,scrolling:n,inline:false,html:false,iframe:false,photo:false,href:false,title:false,rel:false,opacity:0.9,preloading:n,current:"Bild {current} von {total}",previous:"previous",next:"next",close:"close",open:false,overlayClose:n,slideshow:false, slideshowAuto:n,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",onOpen:false,onLoad:false,onComplete:false,onCleanup:false,onClosed:false};e=c.fn.colorbox=function(b,d){var h=this;if(!h.length)if(h.selector===""){h=c("<a/>");b.open=n}else return this;h.each(function(){var f=c.extend({},c(this).data(q)?c(this).data(q):$,b);c(this).data(q,f).addClass("cboxElement");if(d)c(this).data(q).onComplete=d});b&&b.open&&Z(h);return this};e.init=function(){function b(d){return c('<div id="cbox'+ d+'"/>')}m=c(window);k=c('<div id="colorbox"/>');s=b("Overlay").hide();u=b("Wrapper");p=b("Content").append(l=b("LoadedContent").css({width:0,height:0}),J=b("LoadingOverlay"),K=b("LoadingGraphic"),Q=b("Title"),P=b("Current"),t=b("Slideshow"),E=b("Next"),D=b("Previous"),R=b("Close"));u.append(c("<div/>").append(b("TopLeft"),U=b("TopCenter"),b("TopRight")),c("<div/>").append(V=b("MiddleLeft"),p,W=b("MiddleRight")),c("<div/>").append(b("BottomLeft"),X=b("BottomCenter"),b("BottomRight"))).children().children().css({"float":"left"}); I=c("<div style='position:absolute; top:0; left:0; width:9999px; height:0;'/>");c("body").prepend(s,k.append(u,I));if(x){k.addClass("cboxIE");O&&s.css("position","absolute")}p.children().bind("mouseover mouseout",function(){c(this).toggleClass(F)}).addClass(F);y=U.height()+X.height()+p.outerHeight(n)-p.height();z=V.width()+W.width()+p.outerWidth(n)-p.width();v=l.outerHeight(n);w=l.outerWidth(n);k.css({"padding-bottom":y,"padding-right":z}).hide();E.click(e.next);D.click(e.prev);R.click(e.close);p.children().removeClass(F); c(".cboxElement").live("click",function(d){if(d.button!==0&&typeof d.button!=="undefined")return n;else{Z(this);return false}})};e.position=function(b,d){function h(A){U[0].style.width=X[0].style.width=p[0].style.width=A.style.width;K[0].style.height=J[0].style.height=p[0].style.height=V[0].style.height=W[0].style.height=A.style.height}var f=m.height();f=Math.max(f-a.h-v-y,0)/2+m.scrollTop();var o=Math.max(document.documentElement.clientWidth-a.w-w-z,0)/2+m.scrollLeft();b=k.width()===a.w+w&&k.height()=== a.h+v?0:b;u[0].style.width=u[0].style.height="9999px";k.dequeue().animate({width:a.w+w,height:a.h+v,top:f,left:o},{duration:b,complete:function(){h(this);C=false;u[0].style.width=a.w+w+z+"px";u[0].style.height=a.h+v+y+"px";d&&d()},step:function(){h(this)}})};e.resize=function(b){function d(){a.w=a.w||l.width();a.w=a.mw&&a.mw<a.w?a.mw:a.w;return a.w}function h(){a.h=a.h||l.height();a.h=a.mh&&a.mh<a.h?a.mh:a.h;return a.h}function f(G){e.position(G,function(){if(B){if(x){A&&l.fadeIn(100);k[0].style.removeAttribute("filter")}if(a.iframe)l.append("<iframe id='cboxIframe'"+ (a.scrolling?" ":"scrolling='no'")+" name='iframe_"+(new Date).getTime()+"' frameborder=0 src='"+a.href+"' "+(x?"allowtransparency='true'":"")+" />");l.show();Q.show().html(a.title);if(g.length>1){P.html(a.current.replace(/\{current\}/,j+1).replace(/\{total\}/,g.length)).show();E.html(a.next).show();D.html(a.previous).show();a.slideshow&&t.show()}J.hide();K.hide();c.event.trigger(S);a.onComplete&&a.onComplete.call(i);a.transition==="fade"&&k.fadeTo(L,1,function(){x&&k[0].style.removeAttribute("filter")}); m.bind(T,function(){e.position(0)})}})}if(B){var o,A,L=a.transition==="none"?0:a.speed;m.unbind(T);if(b){l.remove();l=c('<div id="cboxLoadedContent"/>').html(b);l.hide().appendTo(I).css({width:d(),overflow:a.scrolling?"auto":"hidden"}).css({height:h()}).prependTo(p);c("#cboxPhoto").css({cssFloat:"none"});O&&c("select:not(#colorbox select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one("cbox_cleanup",function(){this.style.visibility="inherit"});a.transition=== "fade"&&k.fadeTo(L,0,function(){f(0)})||f(L);if(a.preloading&&g.length>1){b=j>0?g[j-1]:g[g.length-1];o=j<g.length-1?g[j+1]:g[0];o=c(o).data(q).href||o.href;b=c(b).data(q).href||b.href;M(o)&&c("<img />").attr("src",o);M(b)&&c("<img />").attr("src",b)}}else setTimeout(function(){var G=l.wrapInner("<div style='overflow:auto'></div>").children();a.h=G.height();l.css({height:a.h});G.replaceWith(G.children());e.position(L)},1)}};e.load=function(){var b,d,h,f=e.resize;C=n;i=g[j];a=c(i).data(q);Y();c.event.trigger(H); a.onLoad&&a.onLoad.call(i);a.h=a.height?r(a.height,"y")-v-y:a.innerHeight?r(a.innerHeight,"y"):false;a.w=a.width?r(a.width,"x")-w-z:a.innerWidth?r(a.innerWidth,"x"):false;a.mw=a.w;a.mh=a.h;if(a.maxWidth){a.mw=r(a.maxWidth,"x")-w-z;a.mw=a.w&&a.w<a.mw?a.w:a.mw}if(a.maxHeight){a.mh=r(a.maxHeight,"y")-v-y;a.mh=a.h&&a.h<a.mh?a.h:a.mh}b=a.href;J.show();K.show();if(a.inline){c('<div id="cboxInlineTemp" />').hide().insertBefore(c(b)[0]).bind(H+" cbox_cleanup",function(){c(this).replaceWith(l.children())}); f(c(b))}else if(a.iframe)f(" ");else if(a.html)f(a.html);else if(M(b)){d=new Image;d.onload=function(){var o;d.onload=null;d.id="cboxPhoto";c(d).css({margin:"auto",border:"none",display:"block",cssFloat:"left"});if(a.scalePhotos){h=function(){d.height-=d.height*o;d.width-=d.width*o};if(a.mw&&d.width>a.mw){o=(d.width-a.mw)/d.width;h()}if(a.mh&&d.height>a.mh){o=(d.height-a.mh)/d.height;h()}}if(a.h)d.style.marginTop=Math.max(a.h-d.height,0)/2+"px";f(d);g.length>1&&c(d).css({cursor:"pointer"}).click(e.next); if(x)d.style.msInterpolationMode="bicubic"};d.src=b}else c("<div />").appendTo(I).load(b,function(o,A){A==="success"?f(this):f(c("<p>Request unsuccessful.</p>"))})};e.next=function(){if(!C){j=j<g.length-1?j+1:0;e.load()}};e.prev=function(){if(!C){j=j>0?j-1:g.length-1;e.load()}};e.slideshow=function(){function b(){t.text(a.slideshowStop).bind(S,function(){h=setTimeout(e.next,a.slideshowSpeed)}).bind(H,function(){clearTimeout(h)}).one("click",function(){d();c(this).removeClass(F)});k.removeClass(f+ "off").addClass(f+"on")}var d,h,f="cboxSlideshow_";t.bind("cbox_closed",function(){t.unbind();clearTimeout(h);k.removeClass(f+"off "+f+"on")});d=function(){clearTimeout(h);t.text(a.slideshowStart).unbind(S+" "+H).one("click",function(){b();h=setTimeout(e.next,a.slideshowSpeed);c(this).removeClass(F)});k.removeClass(f+"on").addClass(f+"off")};if(a.slideshow&&g.length>1)a.slideshowAuto?b():d()};e.close=function(){c.event.trigger("cbox_cleanup");a.onCleanup&&a.onCleanup.call(i);B=false;c(document).unbind("keydown.cbox_close keydown.cbox_arrows"); m.unbind(T+" resize.cboxie6 scroll.cboxie6");s.css({cursor:"auto"}).fadeOut("fast");k.stop(n,false).fadeOut("fast",function(){c("#colorbox iframe").attr("src","about:blank");l.remove();k.css({opacity:1});try{N.focus()}catch(b){}c.event.trigger("cbox_closed");a.onClosed&&a.onClosed.call(i)})};e.element=function(){return c(i)};e.settings=$;c(e.init)})(jQuery);
﻿/*
*
* jQuery listnav plugin
* Copyright (c) 2009 iHwy, Inc.
* Author: Jack Killpatrick
*
* Version 2.1 (08/09/2009)
* Requires jQuery 1.3.2, jquery 1.2.6 or jquery 1.2.x plus the jquery dimensions plugin
*
* Visit http://www.ihwy.com/labs/jquery-listnav-plugin.aspx for more information.
*
* Dual licensed under the MIT and GPL licenses:
*   http://www.opensource.org/licenses/mit-license.php
*   http://www.gnu.org/licenses/gpl.html
*
*/
(function($) {
$.fn.listnav = function(options) {
var opts = $.extend({}, $.fn.listnav.defaults, options);
var letters = ['_', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '-'];
var firstClick = false;
opts.prefixes = $.map(opts.prefixes, function(n) { return n.toLowerCase(); });
return this.each(function() {
var $wrapper, list, $list, $letters, $letterCount, id;
id = this.id;
$wrapper = $('#' + id + '-nav'); // user must abide by the convention: <ul id="myList"> for list and <div id="myList-nav"> for nav wrapper
$list = $(this);
var counts = {}, allCount = 0, isAll = true, numCount = 0, prevLetter = '';
function init() {
$wrapper.append(createLettersHtml());
$letters = $('.ln-letters', $wrapper).slice(0, 1); // will always be a single item
if (opts.showCounts) $letterCount = $('.ln-letter-count', $wrapper).slice(0, 1); // will always be a single item
addClasses();
addNoMatchLI();
if (opts.flagDisabled) addDisabledClass();
bindHandlers();
if (!opts.includeAll) $list.show(); // show the list in case the recommendation for includeAll=false was taken
if (!opts.includeAll) $('.all', $letters).remove();
if (!opts.includeNums) $('._', $letters).remove();
if (!opts.includeOther) $('.-', $letters).remove();
$(':last', $letters).addClass('ln-last'); // allows for styling a case where last item needs right border set (because items before that only have top, left and bottom so that border between items isn't doubled)
if ($.cookie && (opts.cookieName != null)) {
var cookieLetter = $.cookie(opts.cookieName);
if (cookieLetter != null) opts.initLetter = cookieLetter;
}
if (opts.initLetter != '') {
firstClick = true;
$('.' + opts.initLetter.toLowerCase(), $letters).slice(0, 1).click(); // click the initLetter if there was one
}
else {
if (opts.includeAll) $('.all', $letters).addClass('ln-selected'); // showing all: we don't need to click this: the whole list is already loaded
else { // ALL link is hidden, click the first letter that will display LI's
for (var i = ((opts.includeNums) ? 0 : 1); i < letters.length; i++) {
if (counts[letters[i]] > 0) {
firstClick = true;
$('.' + letters[i], $letters).slice(0, 1).click();
break;
}
}
}
}
}
function setLetterCountTop() {
$letterCount.css({ top: $('.a', $letters).slice(0, 1).offset({ margin: false, border: true }).top - $letterCount.outerHeight({ margin: true }) }); // note: don't set top based on '.all': it might not be visible
}
function addClasses() {
var str, firstChar, firstWord, spl, $this, hasPrefixes = (opts.prefixes.length > 0);
$($list).children().each(function() {
$this = $(this), firstChar = '', str = $.trim($this.text()).toLowerCase();
if (str != '') {
if (hasPrefixes) {
spl = str.split(' ');
if ((spl.length > 1) && ($.inArray(spl[0], opts.prefixes) > -1)) {
firstChar = spl[1].charAt(0);
addLetterClass(firstChar, $this, true);
}
}
firstChar = str.charAt(0);
addLetterClass(firstChar, $this);
}
});
}
function addLetterClass(firstChar, $el, isPrefix) {
if (/\W/.test(firstChar)) firstChar = '-'; // not A-Z, a-z or 0-9, so considered "other"
if (!isNaN(firstChar)) firstChar = '_'; // use '_' if the first char is a number
$el.addClass('ln-' + firstChar);
if (counts[firstChar] == undefined) counts[firstChar] = 0;
counts[firstChar]++;
if (!isPrefix) allCount++;
}
function addDisabledClass() {
for (var i = 0; i < letters.length; i++) {
if (counts[letters[i]] == undefined) $('.' + letters[i], $letters).addClass('ln-disabled');
}
}
function addNoMatchLI() {
$list.append('<li class="ln-no-match" style="display:none">' + opts.noMatchText + '</li>');
}
function getLetterCount(el) {
if ($(el).hasClass('all')) return allCount;
else {
var count = counts[$(el).attr('class').split(' ')[0]];
return (count != undefined) ? count : 0; // some letters may not have a count in the hash
}
}
function bindHandlers() {
if (opts.showCounts) {
$wrapper.mouseover(function() {
setLetterCountTop();
});
}
if (opts.showCounts) {
$('a', $letters).mouseover(function() {
var left = $(this).position().left;
var width = ($(this).outerWidth({ margin: true }) - 1) + 'px'; // the -1 is to tweak the width a bit due to a seeming inaccuracy in jquery ui/dimensions outerWidth (same result in FF2 and IE6/7)
var count = getLetterCount(this);
$letterCount.css({ left: left, width: width }).text(count).show(); // set left position and width of letter count, set count text and show it
});
$('a', $letters).mouseout(function() {
$letterCount.hide();
});
}
$('a', $letters).click(function() {
$('a.ln-selected', $letters).removeClass('ln-selected');
var letter = $(this).attr('class').split(' ')[0];
if (letter == 'all') {
$list.children().show();
$list.children('.ln-no-match').hide();
isAll = true;
} else {
if (isAll) {
$list.children().hide();
isAll = false;
} else if (prevLetter != '') $list.children('.ln-' + prevLetter).hide();
var count = getLetterCount(this);
if (count > 0) {
$list.children('.ln-no-match').hide(); // in case it's showing
$list.children('.ln-' + letter).show();
}
else $list.children('.ln-no-match').show();
prevLetter = letter;
}
if ($.cookie && (opts.cookieName != null)) $.cookie(opts.cookieName, letter);
$(this).addClass('ln-selected');
$(this).blur();
if (!firstClick && (opts.onClick != null)) opts.onClick(letter);
else firstClick = false;
return false;
});
}
function createLettersHtml() {
var html = [];
for (var i = 1; i < letters.length; i++) {
if (html.length == 0) html.push('<a class="all" href="#">Alle</a><a class="_" href="#">0-9</a>');
html.push('<a class="' + letters[i] + '" href="#">' + ((letters[i] == '-') ? '...' : letters[i].toUpperCase()) + '</a>');
}
return '<div class="ln-letters">' + html.join('') + '</div>' + ((opts.showCounts) ? '<div class="ln-letter-count">0</div>' : ''); // the styling for ln-letter-count is to give us a starting point for the element, which will be repositioned when made visible (ie, should not need to be styled by the user)
}
init();
});
};
$.fn.listnav.defaults = {
initLetter: '',
includeAll: true,
incudeOther: false,
includeNums: true,
flagDisabled: true,
noMatchText: 'No matching entries',
showCounts: true,
cookieName: null,
onClick: null,
prefixes: []
};
})(jQuery);
(function($) {
$.fn.easySlider = function(options){
var defaults = {
prevId: 		'prevBtn',
prevText: 		'Previous',
nextId: 		'nextBtn',
nextText: 		'Next',
controlsShow:	true,
controlsBefore:	'',
controlsAfter:	'',
controlsFade:	true,
firstId: 		'firstBtn',
firstText: 		'First',
firstShow:		false,
lastId: 		'lastBtn',
lastText: 		'Last',
lastShow:		false,
vertical:		false,
speed: 			800,
auto:			false,
pause:			2000,
continuous:		false,
numeric: 		false,
numericId: 		'controls'
};
var options = $.extend(defaults, options);
this.each(function() {
var obj = $(this);
var s = $("li", obj).length;
var w = $("li", obj).width();
var h = $("li", obj).height();
var clickable = true;
obj.width(w);
obj.height(h);
obj.css("overflow","hidden");
var ts = s-1;
var t = 0;
$("ul", obj).css('width',s*w);
if(options.continuous){
$("ul", obj).prepend($("ul li:last-child", obj).clone().css("margin-left","-"+ w +"px"));
$("ul", obj).append($("ul li:nth-child(2)", obj).clone());
$("ul", obj).css('width',(s+1)*w);
};
if(!options.vertical) $("li", obj).css('float','left');
if(options.controlsShow){
var html = options.controlsBefore;
if(options.numeric){
html += '<ol id="'+ options.numericId +'"></ol>';
} else {
if(options.firstShow) html += '<span id="'+ options.firstId +'"><a href=\"javascript:void(0);\">'+ options.firstText +'</a></span>';
html += ' <span id="'+ options.prevId +'"><a href=\"javascript:void(0);\">'+ options.prevText +'</a></span>';
html += ' <span id="'+ options.nextId +'"><a href=\"javascript:void(0);\">'+ options.nextText +'</a></span>';
if(options.lastShow) html += ' <span id="'+ options.lastId +'"><a href=\"javascript:void(0);\">'+ options.lastText +'</a></span>';
};
html += options.controlsAfter;
$(obj).after(html);
};
if(options.numeric){
for(var i=0;i<s;i++){
$(document.createElement("li"))
.attr('id',options.numericId + (i+1))
.html('<a rel='+ i +' href=\"javascript:void(0);\">'+ (i+1) +'</a>')
.appendTo($("#"+ options.numericId))
.click(function(){
animate($("a",$(this)).attr('rel'),true);
});
};
} else {
$("a","#"+options.nextId).click(function(){
animate("next",true);
});
$("a","#"+options.prevId).click(function(){
animate("prev",true);
});
$("a","#"+options.firstId).click(function(){
animate("first",true);
});
$("a","#"+options.lastId).click(function(){
animate("last",true);
});
};
function setCurrent(i){
i = parseInt(i)+1;
$("li", "#" + options.numericId).removeClass("current");
$("li#" + options.numericId + i).addClass("current");
};
function adjust(){
if(t>ts) t=0;
if(t<0) t=ts;
if(!options.vertical) {
$("ul",obj).css("margin-left",(t*w*-1));
} else {
$("ul",obj).css("margin-left",(t*h*-1));
}
clickable = true;
if(options.numeric) setCurrent(t);
};
function animate(dir,clicked){
if (clickable){
clickable = false;
var ot = t;
switch(dir){
case "next":
t = (ot>=ts) ? (options.continuous ? t+1 : ts) : t+1;
break;
case "prev":
t = (t<=0) ? (options.continuous ? t-1 : 0) : t-1;
break;
case "first":
t = 0;
break;
case "last":
t = ts;
break;
default:
t = dir;
break;
};
var diff = Math.abs(ot-t);
var speed = diff*options.speed;
if(!options.vertical) {
p = (t*w*-1);
$("ul",obj).animate(
{ marginLeft: p },
{ queue:false, duration:speed, complete:adjust }
);
} else {
p = (t*h*-1);
$("ul",obj).animate(
{ marginTop: p },
{ queue:false, duration:speed, complete:adjust }
);
};
if(!options.continuous && options.controlsFade){
if(t==ts){
$("a","#"+options.nextId).hide();
$("a","#"+options.lastId).hide();
} else {
$("a","#"+options.nextId).show();
$("a","#"+options.lastId).show();
};
if(t==0){
$("a","#"+options.prevId).hide();
$("a","#"+options.firstId).hide();
} else {
$("a","#"+options.prevId).show();
$("a","#"+options.firstId).show();
};
};
if(clicked) clearTimeout(timeout);
if(options.auto && dir=="next" && !clicked){;
timeout = setTimeout(function(){
animate("next",false);
},diff*options.speed+options.pause);
};
};
};
var timeout;
if(options.auto){;
timeout = setTimeout(function(){
animate("next",false);
},options.pause);
};
if(options.numeric) setCurrent(0);
if(!options.continuous && options.controlsFade){
$("a","#"+options.prevId).hide();
$("a","#"+options.firstId).hide();
};
});
};
})(jQuery);
(function($) {
$.fn.innerfade = function(options) {
return this.each(function() {
$.innerfade(this, options);
});
};
$.innerfade = function(container, options) {
var settings = {
'animationtype':    'fade',
'speed':            'normal',
'type':             'sequence',
'timeout':          2000,
'containerheight':  'auto',
'runningclass':     'innerfade',
'children':         null
};
if (options)
$.extend(settings, options);
if (settings.children === null)
var elements = $(container).children();
else
var elements = $(container).children(settings.children);
if (elements.length > 1) {
$(container).css('position', 'relative').css('height', settings.containerheight).addClass(settings.runningclass);
for (var i = 0; i < elements.length; i++) {
$(elements[i]).css('z-index', String(elements.length-i)).css('position', 'absolute').hide();
};
if (settings.type == "sequence") {
setTimeout(function() {
$.innerfade.next(elements, settings, 1, 0);
}, settings.timeout);
$(elements[0]).show();
} else if (settings.type == "random") {
var last = Math.floor ( Math.random () * ( elements.length ) );
setTimeout(function() {
do {
current = Math.floor ( Math.random ( ) * ( elements.length ) );
} while (last == current );
$.innerfade.next(elements, settings, current, last);
}, settings.timeout);
$(elements[last]).show();
} else if ( settings.type == 'random_start' ) {
settings.type = 'sequence';
var current = Math.floor ( Math.random () * ( elements.length ) );
setTimeout(function(){
$.innerfade.next(elements, settings, (current + 1) %  elements.length, current);
}, settings.timeout);
$(elements[current]).show();
}	else {
alert('Innerfade-Type must either be \'sequence\', \'random\' or \'random_start\'');
}
}
};
$.innerfade.next = function(elements, settings, current, last) {
if (settings.animationtype == 'slide') {
$(elements[last]).slideUp(settings.speed);
$(elements[current]).slideDown(settings.speed);
} else if (settings.animationtype == 'fade') {
$(elements[last]).fadeOut(settings.speed);
$(elements[current]).fadeIn(settings.speed, function() {
removeFilter($(this)[0]);
});
} else
alert('Innerfade-animationtype must either be \'slide\' or \'fade\'');
if (settings.type == "sequence") {
if ((current + 1) < elements.length) {
current = current + 1;
last = current - 1;
} else {
current = 0;
last = elements.length - 1;
}
} else if (settings.type == "random") {
last = current;
while (current == last)
current = Math.floor(Math.random() * elements.length);
} else
alert('Innerfade-Type must either be \'sequence\', \'random\' or \'random_start\'');
setTimeout((function() {
$.innerfade.next(elements, settings, current, last);
}), settings.timeout);
};
})(jQuery);
function removeFilter(element) {
if(element.style.removeAttribute){
element.style.removeAttribute('filter');
}
}
$(document).ready(function(){
$("a[rel='gallery']").colorbox();
$("a.video").colorbox({iframe:true, innerWidth:480, innerHeight:385});
$(".toggle_container").hide();
$("h2.trigger").toggle(function(){
$(this).addClass("active");
}, function () {
$(this).removeClass("active");
});
$("h2.trigger").click(function(){
$(this).next(".toggle_container").slideToggle("slow");
});
$('#language a[href][title]').each(function() {
$(this).qtip({
content: { text: false },
position: {
corner: { tooltip: 'topMiddle', target: 'bottomMiddle' },
adjust: { x: 0, y: 0 }
},
hide: { fixed: true, delay: 1000, effect: 'slide' },
show: { effect: { type: 'slide' } }
});
});
});
function changeMenuWidth(menuWidth){
var menuItems = $('#menu li').size();
var itemWidth = (menuWidth/menuItems)-2;
$('#menu').css({'width': menuWidth +'px'});
$('#menu a').css({'width': itemWidth +'px'});
}
function popup(ziel,w,h) {
h = h - 20; var x=0, y=0, parameter="";
if (w < screen.availWidth || h < screen.availHeight) {
x = (screen.availWidth - w - 12) / 2;
y = (screen.availHeight - h - 104) / 2;
if (window.opera) y = 0; // Opera positioniert unter den Symbolleisten
if (x<0 || y<0) { x=0; y=0; }
else parameter = "width=" + w + ",height=" + h + ",";
}
parameter += "left=" + x + ",top=" + y;
parameter += ",menubar=0,location=0,toolbar=0,status=0";
parameter += ",resizable=1,scrollbars=1";
var Fenster = window.open(ziel,"",parameter);
if (Fenster) Fenster.focus();
return !Fenster;
}
function openLink(link) {
location.href = link;
return false;
}
(function ($) {
"use strict";
var $googlemaps = google.maps,
$geocoder = new $googlemaps.Geocoder(),
opts = {},
markerGroups = {},
$markersToLoad = 0,
methods = {}; // for JSLint
methods = {
init: function (options) {
var k,
opts = $.extend({}, $.fn.gMap.defaults, options);
for (k in $.fn.gMap.defaults.icon) {
if(!opts.icon[k]) {
opts.icon[k] = $.fn.gMap.defaults.icon[k];
}
}
return this.each(function () {
var $this = $(this),
center = methods._getMapCenter.apply($this, [opts]),
i, $data;
if (opts.zoom == "fit") {
opts.zoom = methods.autoZoom.apply($this, [opts]);
}
var mapOptions = {
zoom: opts.zoom,
center: center,
mapTypeControl: opts.mapTypeControl,
zoomControl: opts.zoomControl,
panControl : opts.panControl,
scaleControl : opts.scaleControl,
streetViewControl: opts.streetViewControl,
mapTypeId: opts.maptype,
mapTypeIds: opts.maptypeids,
mapTypeControlOptions: { style: google.maps.MapTypeControlStyle.DROPDOWN_MENU, position: google.maps.ControlPosition.TOP_LEFT },
scrollwheel: opts.scrollwheel,
maxZoom: opts.maxZoom,
minZoom: opts.minZoom
};
if (opts.alpmap == false) {
var $gmap = new $googlemaps.Map(this, mapOptions);
} else {
var mapTypeIds = ['alpstein_map', 'alpstein_hybrid', 'alpstein_map_winter', $googlemaps.MapTypeId.SATELLITE, $googlemaps.MapTypeId.TERRAIN];
var $gmap = new alp.gmap3.Map(document.getElementById("lisgmap_map"), {
center : new $googlemaps.LatLng(opts.latitude, opts.longitude),
zoom : opts.zoom,
mapTypeId : mapTypeIds[ 0 ],
mapTypeControlOptions : { mapTypeIds: mapTypeIds, style: google.maps.MapTypeControlStyle.DROPDOWN_MENU, position: google.maps.ControlPosition.TOP_LEFT }
});
}
if (opts.log) {console.log('map center is:'); }
if (opts.log) {console.log(center); }
$this.data("$gmap", $gmap);
$this.data('gmap', {
'opts': opts,
'gmap': $gmap,
'markers': [],
'markerKeys' : {},
'infoWindow': null,
'lisWindow': null
});
if (opts.controls.length !== 0) {
for (i = 0; i < opts.controls.length; i += 1) {
$gmap.controls[opts.controls[i].pos].push(opts.controls[i].div);
}
}
if (opts.markers.length !== 0) {
methods.addMarkers.apply($this, [opts.markers]);
methods._lisbounds.apply($this, [opts]);
}
if (opts.kml != "") {
var georssLayer = new google.maps.KmlLayer(opts.kml);
georssLayer.setMap($gmap);
}
$(document)
.ajaxStart(function() {
$('#lisgmap_container_loader').show();
$('.lisgmap_trigger').addClass('lisgmap_trigger_loading');
})
.ajaxStop(function(){
$('#lisgmap_container_loader').hide();
$('.lisgmap_trigger').removeClass('lisgmap_trigger_loading');
});
$('a.lisgmap_nav_list_link').click(function(e) {
var group = "group_"+$(this).attr('rel');
if (opts.log) {console.log("toggle group: " + group)};
if (typeof markerGroups[group] == "undefined") {
markerGroups[group] = [];
$.ajax({
url: opts.baseuri + '/' + $(this).attr('rel'),
dataType: 'json',
async: true,
success: function(data) {
if (opts.log) {console.log(data)};
methods.addMarkers.apply($this, [data]);
for (var i = 0; i < data.length; i+= 1) {
opts.markers.push(data[i]);
}
methods._lisbounds.apply($this, [opts]);
}
});
} else {
methods.lisToggleGroup(group);
}
if ($(this).hasClass('active')) {
$(this).removeClass('active');
} else {
$(this).addClass('active');
}
e.preventDefault();
return false;
});
$('.lisgmap_nav_list_link_fullscreen').click( function(e) {
$('.lisgmap_container').toggleClass('lisgmap_fullscreen_container');
if ($('.lisgmap_container').hasClass('lisgmap_fullscreen_container')) {
$('.lisgmap_fullscreen_panel').show();
$('#lisgmap_map').css({"height":jQuery(window).height() + 15, "width":jQuery(window).width() + 15});
$('body').css({"overflow":"hidden", "height":jQuery(window).height() + 15, "width":jQuery(window).width() + 15});
} else {
$('.lisgmap_fullscreen_panel').hide();
$('#lisgmap_map').css({"height":"500px", "width":"100%"});
$('body').css({"overflow":"visible", "height":"auto", "width":"auto"});
}
methods._lisresize.apply($this, [opts]);
methods._lisbounds.apply($this, [opts]);
e.preventDefault();
return false;
});
var first_load = 0;
$("a.lisgmap_nav_list_link").each(function() {
if ($(this).attr('rev') == 1) {
first_load = 1;
$(this).click();
}
});
if (first_load == 0) {
$('a.lisgmap_nav_list_link:first').click();
}
methods._onComplete.apply($this, []);
});
},
_lisresize: function(opts) {
var $data = this.data('gmap');
$googlemaps.event.trigger($data.gmap, 'resize');
$data.gmap.setZoom( $data.gmap.getZoom() );
},
_lisbounds: function(opts) {
var $data = this.data('gmap'),
opts = $data.opts;
var mylisbounds = new $googlemaps.LatLngBounds();
if (opts.bounding == true) {
$.each(opts.markers, function(key, value) {
mylisbounds.extend(new $googlemaps.LatLng(value.latitude, value.longitude));
if (value.geometry_show == 1) {
var pointAllArray = value.geometry.split(" ");
for (var i = 0; i < pointAllArray.length; i++) {
var pointArray = pointAllArray[i].split(",");
mylisbounds.extend(new $googlemaps.LatLng(pointArray[1], pointArray[0]));
}
}
});
$data.gmap.setCenter(mylisbounds.getCenter());
$data.gmap.fitBounds(mylisbounds);
}
},
lisToggleGroup: function (group) {
for (var i = 0; i < markerGroups[group].length; i++) {
var marker = markerGroups[group][i];
if (marker.getVisible()) {
marker.setVisible(false);
} else {
marker.setVisible(true);
}
}
return false;
},
_onComplete: function () {
var $data = this.data('gmap'),
that = this;
if ($markersToLoad !== 0) {
window.setTimeout(function () {methods._onComplete.apply(that, []); }, 1000);
return;
}
$data.opts.onComplete();
},
processMarker: function (marker, gicon, gshadow, location) {
var $data = this.data('gmap'),
$gmap = $data.gmap,
opts = $data.opts,
gmarker,
markeropts;
if (location === undefined) {
location = new $googlemaps.LatLng(marker.latitude, marker.longitude);
}
if (!gicon) {
var _gicon = {
image: opts.icon.image,
iconSize: new $googlemaps.Size(opts.icon.iconsize[0], opts.icon.iconsize[1]),
iconAnchor: new $googlemaps.Point(opts.icon.iconanchor[0], opts.icon.iconanchor[1]),
infoWindowAnchor: new $googlemaps.Size(opts.icon.infowindowanchor[0], opts.icon.infowindowanchor[1])
};
gicon = new $googlemaps.MarkerImage(_gicon.image, _gicon.iconSize, null, _gicon.iconAnchor);
}
markeropts = {
position: location,
icon: gicon,
title: marker.title,
map: $gmap
};
console.log(markeropts);
gmarker = new $googlemaps.Marker(markeropts);
$data.markers.push(gmarker);
if (marker.group)
markerGroups[marker.group].push(gmarker);
if(marker.key) {$data.markerKeys[marker.key] = gmarker; }
var markerContent = document.createElement("div");
markerContent.innerHTML = '<div class="lisgmap_marker">' + marker.html + '<div class="lisgmap_marker_arrow"><img src="' + opts.img_arrow_icon + '" /></div></div>';
var lisWindowOptions = {
content: markerContent,
pixelOffset: new google.maps.Size(-112, -20),
boxClass: "lisgmap_marker_window",
closeBoxMargin: "-10px",
closeBoxURL: opts.img_close_icon,
enableEventPropagation: false,
alignBottom: true
};
$googlemaps.event.addListener(gmarker, "click", function() {
if (opts.singleInfoWindow && $data.lisWindow) {$data.lisWindow.close();}
var lisWindow = new InfoBox(lisWindowOptions);
lisWindow.open($gmap, gmarker);
$data.lisWindow = lisWindow;
});
if (marker.popup) {
var lisWindow = new InfoBox(lisWindowOptions);
lisWindow.open($gmap, gmarker);
$data.lisWindow = lisWindow;
}
if (marker.kml) {
var georssLayer = new google.maps.KmlLayer(marker.kml, { preserveViewport : true });
$googlemaps.event.addListener(gmarker, 'mouseover', function() {
georssLayer.setMap($gmap);
});
$googlemaps.event.addListener(gmarker, 'mouseout', function() {
georssLayer.setMap(null);
});
}
if (marker.geometry) {
var pointAllArray = marker.geometry.split(" ");
var tourCoordinates = [];
for (var i = 0; i < pointAllArray.length; i++) {
var pointArray = pointAllArray[i].split(",");
var point = new $googlemaps.LatLng(pointArray[1], pointArray[0]);
tourCoordinates.push(point);
}
var tourPath = new $googlemaps.Polyline({
path: tourCoordinates,
strokeColor: "#ac1512",
strokeOpacity: 0.9,
strokeWeight: 4
});
if (marker.geometry_show == 0) {
$googlemaps.event.addListener(gmarker, 'mouseover', function() {
tourPath.setMap($gmap);
$googlemaps.event.addListener(gmarker, 'mouseout', function() {
tourPath.setMap(null);
});
});
} else {
tourPath.setMap($gmap);
}
}
$googlemaps.event.addListener($gmap, 'click', function() {
$data.lisWindow.hide();
});
},
addMarkers: function (markers){
var opts = this.data('gmap').opts;
if (markers.length !== 0) {
if (opts.log) {console.log("adding " + markers.length +" markers");}
for (var i = 0; i < markers.length; i+= 1) {
methods.addMarker.apply($(this),[markers[i]]);
}
}
return this;
},
addMarker: function (marker) {
var opts = this.data('gmap').opts;
if (opts.log) {console.log("putting marker at " + marker.latitude + ', ' + marker.longitude + " with address " + marker.address + " and html "  + marker.html); }
var _gicon = {
image: opts.icon.image,
iconSize: new $googlemaps.Size(opts.icon.iconsize[0], opts.icon.iconsize[1]),
iconAnchor: new $googlemaps.Point(opts.icon.iconanchor[0], opts.icon.iconanchor[1]),
infoWindowAnchor: new $googlemaps.Size(opts.icon.infowindowanchor[0], opts.icon.infowindowanchor[1])
}
marker.infoWindowAnchor = _gicon.infoWindowAnchor;
if (marker.icon) {
if (marker.icon.image) { _gicon.image = marker.icon.image; }
if (marker.icon.iconsize) { _gicon.iconSize = new $googlemaps.Size(marker.icon.iconsize[0], marker.icon.iconsize[1]); }
if (marker.icon.iconanchor) { _gicon.iconAnchor = new $googlemaps.Point(marker.icon.iconanchor[0], marker.icon.iconanchor[1]); }
if (marker.icon.infowindowanchor) { _gicon.infoWindowAnchor = new $googlemaps.Size(marker.icon.infowindowanchor[0], marker.icon.infowindowanchor[1]); }
}
var gicon = new $googlemaps.MarkerImage(_gicon.image, _gicon.iconSize, null, _gicon.iconAnchor);
var gshadow;
if (marker.address) {
if (marker.html === '_address') {
marker.html = marker.address;
}
if (marker.title == '_address') {
marker.title = marker.address;
}
if (opts.log) {console.log('geocoding marker: ' + marker.address); }
methods._geocodeMarker.apply(this, [marker, gicon, gshadow]);
} else {
if (marker.html === '_latlng') {
marker.html = marker.latitude + ', ' + marker.longitude;
}
if (marker.title == '_latlng') {
marker.title = marker.latitude + ', ' + marker.longitude;
}
var gpoint = new $googlemaps.LatLng(marker.latitude, marker.longitude);
methods.processMarker.apply(this, [marker, gicon, gshadow, gpoint]);
}
return this;
},
_setMapCenter: function (center) {
var $data = this.data('gmap');
if ($data.opts.log) {console.log('delayed setMapCenter called'); }
if ($data.gmap !== undefined) {
$data.gmap.setCenter(center);
} else {
var that = this;
window.setTimeout(function () {methods._setMapCenter.apply(that, [center]); }, 500);
}
},
_boundaries: null,
_getBoundaries: function (opts) {
if(methods._boundaries) {return methods._boundaries; }
var mostN = opts.markers[0].latitude,
mostE = opts.markers[0].longitude,
mostW = opts.markers[0].longitude,
mostS = opts.markers[0].latitude,
i;
for (i = 1; i < opts.markers.length; i += 1) {
if(mostN > opts.markers[i].latitude) {mostN = opts.markers[i].latitude; }
if(mostE < opts.markers[i].longitude) {mostE = opts.markers[i].longitude; }
if(mostW > opts.markers[i].longitude) {mostW = opts.markers[i].longitude; }
if(mostS < opts.markers[i].latitude) {mostS = opts.markers[i].latitude; }
}
methods._boundaries = {N: mostN, E: mostE, W: mostW, S: mostS};
return methods._boundaries;
},
_getMapCenter: function (opts) {
var center,
that = this, // 'that' scope fix in geocoding
i,
selectedToCenter,
most; //hoisting
if (opts.markers.length && (opts.latitude == "fit" || opts.longitude == "fit")) {
most = methods._getBoundaries(opts);
center = new $googlemaps.LatLng((most.N + most.S)/2, (most.E + most.W)/2);
return center;
}
if (opts.latitude && opts.longitude && opts.markers.length == 0) {
center = new $googlemaps.LatLng(opts.latitude, opts.longitude);
return center;
} else {
center = new $googlemaps.LatLng(0, 0);
}
if (opts.address) {
$geocoder.geocode(
{address: opts.address},
function (result, status) {
if (status === google.maps.GeocoderStatus.OK) {
methods._setMapCenter.apply(that, [result[0].geometry.location]);
} else {
if (opts.log) {console.log("Geocode was not successful for the following reason: " + status); }
}
}
);
return center;
}
if (opts.markers.length > 0) {
selectedToCenter = null;
for (i = 0; i < opts.markers.length; i += 1) {
if(opts.markers[i].setCenter) {
selectedToCenter = opts.markers[i];
break;
}
}
if (selectedToCenter === null) {
for (i = 0; i < opts.markers.length; i += 1) {
if (opts.markers[i].latitude && opts.markers[i].longitude) {
selectedToCenter = opts.markers[i];
break;
}
if (opts.markers[i].address) {
selectedToCenter = opts.markers[i];
}
}
}
if (selectedToCenter === null) {
return center;
}
if (selectedToCenter.latitude && selectedToCenter.longitude) {
return new $googlemaps.LatLng(selectedToCenter.latitude, selectedToCenter.longitude);
}
if (selectedToCenter.address) {
$geocoder.geocode(
{address: selectedToCenter.address},
function (result, status) {
if (status === google.maps.GeocoderStatus.OK) {
methods._setMapCenter.apply(that, [result[0].geometry.location]);
} else {
if (opts.log) {console.log("Geocode was not successful for the following reason: " + status); }
}
}
);
}
}
return center;
},
setZoom: function (zoom) {
var $map = this.data('gmap').gmap;
if (zoom === "fit"){
zoom = methods.autoZoom.apply($(this), []);
}
$map.setZoom(parseInt(zoom));
},
getRoute: function (options) {
var $data = this.data('gmap'),
$gmap = $data.gmap,
$directionsDisplay = new $googlemaps.DirectionsRenderer(),
$directionsService = new $googlemaps.DirectionsService(),
$travelModes = { 'BYCAR': $googlemaps.DirectionsTravelMode.DRIVING, 'BYBICYCLE': $googlemaps.DirectionsTravelMode.BICYCLING, 'BYFOOT': $googlemaps.DirectionsTravelMode.WALKING },
$travelUnits = { 'MILES': $googlemaps.DirectionsUnitSystem.IMPERIAL, 'KM': $googlemaps.DirectionsUnitSystem.METRIC },
displayObj = null,
travelMode = null,
travelUnit = null,
unitSystem = null;
if(options.routeDisplay !== undefined){
displayObj = (options.routeDisplay instanceof jQuery) ? options.routeDisplay[0] : ((typeof options.routeDisplay == "string") ? $(options.routeDisplay)[0] : null);
} else if($data.opts.routeDisplay !== null){
displayObj = ($data.opts.routeDisplay instanceof jQuery) ? $data.opts.routeDisplay[0] : ((typeof $data.opts.routeDisplay == "string") ? $($data.opts.routeDisplay)[0] : null);
}
$directionsDisplay.setMap($gmap);
if(displayObj !== null){
$directionsDisplay.setPanel(displayObj);
}
travelMode = ($travelModes[$data.opts.travelMode] !== undefined) ? $travelModes[$data.opts.travelMode] : $travelModes['BYCAR'];
travelUnit = ($travelUnits[$data.opts.travelUnit] !== undefined) ? $travelUnits[$data.opts.travelUnit] : $travelUnits['KM'];
var request = {
origin: options.from,
destination: options.to,
travelMode: travelMode,
unitSystem: travelUnit
};
$directionsService.route(request, function(result, status) {
if (status == $googlemaps.DirectionsStatus.OK) {
$directionsDisplay.setDirections(result);
} else if(displayObj !== null){
$(displayObj).html($data.opts.routeErrors[status]);
}
});
return this;
},
_geocodeMarker: function (marker, gicon, gshadow) {
$markersToLoad += 1;
var that = this;
$geocoder.geocode({'address': marker.address}, function (results, status) {
$markersToLoad -= 1;
if (status === $googlemaps.GeocoderStatus.OK) {
if (that.data('gmap').opts.log) {console.log("Geocode was successful with point: ", results[0].geometry.location); }
methods.processMarker.apply(that, [marker, gicon, gshadow, results[0].geometry.location]);
} else {
if (that.data('gmap').opts.log) {console.log("Geocode was not successful for the following reason: " + status); }
}
});
},
autoZoom: function (opts){
var data = this.data('gmap'),
i, boundaries, resX, resY, baseScale = 39135.758482;
opts = data?data.opts:opts
if (opts.log) {console.log("autozooming map");}
boundaries = methods._getBoundaries(opts);
resX = (boundaries.E - boundaries.W) * 111000 / this.width();
resY = (boundaries.S - boundaries.N) * 111000 / this.height();
for(i = 2; i < 20; i += 1) {
if (resX > baseScale || resY > baseScale) {
break;
}
baseScale = baseScale / 2;
}
return i - 2;
},
removeAllMarkers: function () {
var markers = this.data('gmap').markers, i;
for (i = 0; i < markers.length; i += 1) {
markers[i].setMap(null);
delete markers[i];
}
markers.length = 0;
},
getMarker: function (key) {
return this.data('gmap').markerKeys[key];
}
};
$.fn.gMap = function (method) {
if (methods[method]) {
return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
} else if (typeof method === 'object' || !method) {
return methods.init.apply(this, arguments);
} else {
$.error('Method ' +  method + ' does not exist on jQuery.gmap');
}
};
$.fn.gMap.defaults = {
baseuri:				 '/lisgmap/getmarkers',
bounding:				 true,
client:					 'default',
alpmap:					 false,
main_design:			 'standard',
log:                     false,
address:                 '',
latitude:                null,
longitude:               null,
kml:					 '',
zoom:                    3,
maxZoom: 				 null,
minZoom: 				 null,
markers:                 [],
controls:                {},
scrollwheel:             true,
maptype:                 google.maps.MapTypeId.TERRAIN,
maptypeids:              [google.maps.MapTypeId.ROADMAP, google.maps.MapTypeId.SATELLITE, google.maps.MapTypeId.HYBRID, google.maps.MapTypeId.TERRAIN],
mapTypeControl:          true,
zoomControl:             true,
panControl:              false,
scaleControl:            false,
streetViewControl:       true,
singleInfoWindow:        true,
img_close_icon:			 "/extension/lisgmap/design/standard/images/lisgmap_window_close.png",
img_arrow_icon:			 "/extension/lisgmap/design/standard/images/lisgmap_window_arrow.png",
icon: {
image:               "http://www.google.com/mapfiles/marker.png",
iconsize:            [20, 34],
iconanchor:          [9, 34],
infowindowanchor:    [9, 2]
},
onComplete:              function () {},
travelMode:              'BYCAR',
travelUnit:              'KM',
routeDisplay:            null,
routeErrors:			 {
'INVALID_REQUEST': 'The provided request is invalid.',
'NOT_FOUND': 'One or more of the given addresses could not be found.',
'OVER_QUERY_LIMIT': 'A temporary error occured. Please try again in a few minutes.',
'REQUEST_DENIED': 'An error occured. Please contact us.',
'UNKNOWN_ERROR': 'An unknown error occured. Please try again.',
'ZERO_RESULTS': 'No route could be found within the given addresses.'
}
};
}(jQuery));
function InfoBox(opt_opts) {
opt_opts = opt_opts || {};
google.maps.OverlayView.apply(this, arguments);
this.content_ = opt_opts.content || "";
this.disableAutoPan_ = opt_opts.disableAutoPan || false;
this.maxWidth_ = opt_opts.maxWidth || 0;
this.pixelOffset_ = opt_opts.pixelOffset || new google.maps.Size(0, 0);
this.position_ = opt_opts.position || new google.maps.LatLng(0, 0);
this.zIndex_ = opt_opts.zIndex || null;
this.boxClass_ = opt_opts.boxClass || "infoBox";
this.boxStyle_ = opt_opts.boxStyle || {};
this.closeBoxMargin_ = opt_opts.closeBoxMargin || "2px";
this.closeBoxURL_ = opt_opts.closeBoxURL || "http://www.google.com/intl/en_us/mapfiles/close.gif";
if (opt_opts.closeBoxURL === "") {
this.closeBoxURL_ = "";
}
this.infoBoxClearance_ = opt_opts.infoBoxClearance || new google.maps.Size(1, 1);
this.isHidden_ = opt_opts.isHidden || false;
this.alignBottom_ = opt_opts.alignBottom || false;
this.pane_ = opt_opts.pane || "floatPane";
this.enableEventPropagation_ = opt_opts.enableEventPropagation || false;
this.div_ = null;
this.closeListener_ = null;
this.eventListener1_ = null;
this.eventListener2_ = null;
this.eventListener3_ = null;
this.moveListener_ = null;
this.contextListener_ = null;
this.fixedWidthSet_ = null;
}
InfoBox.prototype = new google.maps.OverlayView();
InfoBox.prototype.createInfoBoxDiv_ = function () {
var bw;
var me = this;
var cancelHandler = function (e) {
e.cancelBubble = true;
if (e.stopPropagation) {
e.stopPropagation();
}
};
var ignoreHandler = function (e) {
e.returnValue = false;
if (e.preventDefault) {
e.preventDefault();
}
if (!me.enableEventPropagation_) {
cancelHandler(e);
}
};
if (!this.div_) {
this.div_ = document.createElement("div");
this.setBoxStyle_();
if (typeof this.content_.nodeType === "undefined") {
this.div_.innerHTML = this.getCloseBoxImg_() + this.content_;
} else {
this.div_.innerHTML = this.getCloseBoxImg_();
this.div_.appendChild(this.content_);
}
this.getPanes()[this.pane_].appendChild(this.div_);
this.addClickHandler_();
if (this.div_.style.width) {
this.fixedWidthSet_ = true;
} else {
if (this.maxWidth_ !== 0 && this.div_.offsetWidth > this.maxWidth_) {
this.div_.style.width = this.maxWidth_;
this.div_.style.overflow = "auto";
this.fixedWidthSet_ = true;
} else { // The following code is needed to overcome problems with MSIE
bw = this.getBoxWidths_();
this.div_.style.width = (this.div_.offsetWidth - bw.left - bw.right) + "px";
this.fixedWidthSet_ = false;
}
}
this.panBox_(this.disableAutoPan_);
if (!this.enableEventPropagation_) {
this.eventListener1_ = google.maps.event.addDomListener(this.div_, "mousedown", cancelHandler);
this.eventListener2_ = google.maps.event.addDomListener(this.div_, "click", cancelHandler);
this.eventListener3_ = google.maps.event.addDomListener(this.div_, "dblclick", cancelHandler);
}
this.contextListener_ = google.maps.event.addDomListener(this.div_, "contextmenu", ignoreHandler);
google.maps.event.trigger(this, "domready");
}
};
InfoBox.prototype.getCloseBoxImg_ = function () {
var img = "";
if (this.closeBoxURL_ !== "") {
img  = "<img";
img += " src='" + this.closeBoxURL_ + "'";
img += " align=right"; // Do this because Opera chokes on style='float: right;'
img += " style='";
img += " position: relative;"; // Required by MSIE
img += " cursor: pointer;";
img += " z-index:999999;";
img += " margin: " + this.closeBoxMargin_ + ";";
img += "'>";
}
return img;
};
InfoBox.prototype.addClickHandler_ = function () {
var closeBox;
if (this.closeBoxURL_ !== "") {
closeBox = this.div_.firstChild;
this.closeListener_ = google.maps.event.addDomListener(closeBox, 'click', this.getCloseClickHandler_());
} else {
this.closeListener_ = null;
}
};
InfoBox.prototype.getCloseClickHandler_ = function () {
var me = this;
return function (e) {
e.cancelBubble = true;
if (e.stopPropagation) {
e.stopPropagation();
}
me.close();
google.maps.event.trigger(me, "closeclick");
};
};
InfoBox.prototype.panBox_ = function (disablePan) {
var map;
var bounds;
var xOffset = 0, yOffset = 0;
if (!disablePan) {
map = this.getMap();
if (map instanceof google.maps.Map) { // Only pan if attached to map, not panorama
if (!map.getBounds().contains(this.position_)) {
map.setCenter(this.position_);
}
bounds = map.getBounds();
var mapDiv = map.getDiv();
var mapWidth = mapDiv.offsetWidth;
var mapHeight = mapDiv.offsetHeight;
var iwOffsetX = this.pixelOffset_.width;
var iwOffsetY = this.pixelOffset_.height;
var iwWidth = this.div_.offsetWidth;
var iwHeight = this.div_.offsetHeight;
var padX = this.infoBoxClearance_.width;
var padY = this.infoBoxClearance_.height;
var pixPosition = this.getProjection().fromLatLngToContainerPixel(this.position_);
if (pixPosition.x < (-iwOffsetX + padX)) {
xOffset = pixPosition.x + iwOffsetX - padX;
} else if ((pixPosition.x + iwWidth + iwOffsetX + padX) > mapWidth) {
xOffset = pixPosition.x + iwWidth + iwOffsetX + padX - mapWidth;
}
if (this.alignBottom_) {
if (pixPosition.y < (-iwOffsetY + padY + iwHeight)) {
yOffset = pixPosition.y + iwOffsetY - padY - iwHeight;
} else if ((pixPosition.y + iwOffsetY + padY) > mapHeight) {
yOffset = pixPosition.y + iwOffsetY + padY - mapHeight;
}
} else {
if (pixPosition.y < (-iwOffsetY + padY)) {
yOffset = pixPosition.y + iwOffsetY - padY;
} else if ((pixPosition.y + iwHeight + iwOffsetY + padY) > mapHeight) {
yOffset = pixPosition.y + iwHeight + iwOffsetY + padY - mapHeight;
}
}
if (!(xOffset === 0 && yOffset === 0)) {
var c = map.getCenter();
map.panBy(xOffset, yOffset);
}
}
}
};
InfoBox.prototype.setBoxStyle_ = function () {
var i, boxStyle;
if (this.div_) {
this.div_.className = this.boxClass_;
this.div_.style.cssText = "";
boxStyle = this.boxStyle_;
for (i in boxStyle) {
if (boxStyle.hasOwnProperty(i)) {
this.div_.style[i] = boxStyle[i];
}
}
if (typeof this.div_.style.opacity !== "undefined" && this.div_.style.opacity !== "") {
this.div_.style.filter = "alpha(opacity=" + (this.div_.style.opacity * 100) + ")";
}
this.div_.style.position = "absolute";
this.div_.style.visibility = 'hidden';
if (this.zIndex_ !== null) {
this.div_.style.zIndex = this.zIndex_;
}
}
};
InfoBox.prototype.getBoxWidths_ = function () {
var computedStyle;
var bw = {top: 0, bottom: 0, left: 0, right: 0};
var box = this.div_;
if (document.defaultView && document.defaultView.getComputedStyle) {
computedStyle = box.ownerDocument.defaultView.getComputedStyle(box, "");
if (computedStyle) {
bw.top = parseInt(computedStyle.borderTopWidth, 10) || 0;
bw.bottom = parseInt(computedStyle.borderBottomWidth, 10) || 0;
bw.left = parseInt(computedStyle.borderLeftWidth, 10) || 0;
bw.right = parseInt(computedStyle.borderRightWidth, 10) || 0;
}
} else if (document.documentElement.currentStyle) { // MSIE
if (box.currentStyle) {
bw.top = parseInt(box.currentStyle.borderTopWidth, 10) || 0;
bw.bottom = parseInt(box.currentStyle.borderBottomWidth, 10) || 0;
bw.left = parseInt(box.currentStyle.borderLeftWidth, 10) || 0;
bw.right = parseInt(box.currentStyle.borderRightWidth, 10) || 0;
}
}
return bw;
};
InfoBox.prototype.onRemove = function () {
if (this.div_) {
this.div_.parentNode.removeChild(this.div_);
this.div_ = null;
}
};
InfoBox.prototype.draw = function () {
this.createInfoBoxDiv_();
var pixPosition = this.getProjection().fromLatLngToDivPixel(this.position_);
this.div_.style.left = (pixPosition.x + this.pixelOffset_.width) + "px";
if (this.alignBottom_) {
this.div_.style.bottom = -(pixPosition.y + this.pixelOffset_.height) + "px";
} else {
this.div_.style.top = (pixPosition.y + this.pixelOffset_.height) + "px";
}
if (this.isHidden_) {
this.div_.style.visibility = 'hidden';
} else {
this.div_.style.visibility = "visible";
}
};
InfoBox.prototype.setOptions = function (opt_opts) {
if (typeof opt_opts.boxClass !== "undefined") { // Must be first
this.boxClass_ = opt_opts.boxClass;
this.setBoxStyle_();
}
if (typeof opt_opts.boxStyle !== "undefined") { // Must be second
this.boxStyle_ = opt_opts.boxStyle;
this.setBoxStyle_();
}
if (typeof opt_opts.content !== "undefined") {
this.setContent(opt_opts.content);
}
if (typeof opt_opts.disableAutoPan !== "undefined") {
this.disableAutoPan_ = opt_opts.disableAutoPan;
}
if (typeof opt_opts.maxWidth !== "undefined") {
this.maxWidth_ = opt_opts.maxWidth;
}
if (typeof opt_opts.pixelOffset !== "undefined") {
this.pixelOffset_ = opt_opts.pixelOffset;
}
if (typeof opt_opts.position !== "undefined") {
this.setPosition(opt_opts.position);
}
if (typeof opt_opts.zIndex !== "undefined") {
this.setZIndex(opt_opts.zIndex);
}
if (typeof opt_opts.closeBoxMargin !== "undefined") {
this.closeBoxMargin_ = opt_opts.closeBoxMargin;
}
if (typeof opt_opts.closeBoxURL !== "undefined") {
this.closeBoxURL_ = opt_opts.closeBoxURL;
}
if (typeof opt_opts.infoBoxClearance !== "undefined") {
this.infoBoxClearance_ = opt_opts.infoBoxClearance;
}
if (typeof opt_opts.isHidden !== "undefined") {
this.isHidden_ = opt_opts.isHidden;
}
if (typeof opt_opts.enableEventPropagation !== "undefined") {
this.enableEventPropagation_ = opt_opts.enableEventPropagation;
}
if (this.div_) {
this.draw();
}
};
InfoBox.prototype.setContent = function (content) {
this.content_ = content;
if (this.div_) {
if (this.closeListener_) {
google.maps.event.removeListener(this.closeListener_);
this.closeListener_ = null;
}
if (!this.fixedWidthSet_) {
this.div_.style.width = "";
}
if (typeof content.nodeType === "undefined") {
this.div_.innerHTML = this.getCloseBoxImg_() + content;
} else {
this.div_.innerHTML = this.getCloseBoxImg_();
this.div_.appendChild(content);
}
if (!this.fixedWidthSet_) {
this.div_.style.width = this.div_.offsetWidth + "px";
if (typeof content.nodeType === "undefined") {
this.div_.innerHTML = this.getCloseBoxImg_() + content;
} else {
this.div_.innerHTML = this.getCloseBoxImg_();
}
}
this.addClickHandler_();
}
google.maps.event.trigger(this, "content_changed");
};
InfoBox.prototype.setPosition = function (latlng) {
this.position_ = latlng;
if (this.div_) {
this.draw();
}
google.maps.event.trigger(this, "position_changed");
};
InfoBox.prototype.setZIndex = function (index) {
this.zIndex_ = index;
if (this.div_) {
this.div_.style.zIndex = index;
}
google.maps.event.trigger(this, "zindex_changed");
};
InfoBox.prototype.getContent = function () {
return this.content_;
};
InfoBox.prototype.getPosition = function () {
return this.position_;
};
InfoBox.prototype.getZIndex = function () {
return this.zIndex_;
};
InfoBox.prototype.show = function () {
this.isHidden_ = false;
if (this.div_) {
this.div_.style.visibility = "visible";
}
};
InfoBox.prototype.hide = function () {
this.isHidden_ = true;
if (this.div_) {
this.div_.style.visibility = "hidden";
}
};
InfoBox.prototype.open = function (map, anchor) {
var me = this;
if (anchor) {
this.position_ = anchor.getPosition();
this.moveListener_ = google.maps.event.addListener(anchor, "position_changed", function () {
me.setPosition(this.getPosition());
});
}
this.setMap(map);
if (this.div_) {
this.panBox_();
}
};
InfoBox.prototype.close = function () {
if (this.closeListener_) {
google.maps.event.removeListener(this.closeListener_);
this.closeListener_ = null;
}
if (this.eventListener1_) {
google.maps.event.removeListener(this.eventListener1_);
google.maps.event.removeListener(this.eventListener2_);
google.maps.event.removeListener(this.eventListener3_);
this.eventListener1_ = null;
this.eventListener2_ = null;
this.eventListener3_ = null;
}
if (this.moveListener_) {
google.maps.event.removeListener(this.moveListener_);
this.moveListener_ = null;
}
if (this.contextListener_) {
google.maps.event.removeListener(this.contextListener_);
this.contextListener_ = null;
}
this.setMap(null);
};
function poi_filter(value) {
var target = value;
$('li.line').hide();
switch (target) {
case "all":
$('li.line').show();
break;
case "open_today":
$('li.open_today').show();
$('li.open').show();
break;
case "open":
$('li.open').show();
break;
}
}
$.fn.lisopentimes = function(optionen){
optionen = $.extend({
remote_ids: "",
view: "full"
}, optionen);
function showOpentimes (remote_id, data)
{
var day_translation = { 0: "Heute Montag", 1: "Heute Dienstag", 2: "Heute Mittwoch", 3: "Heute Donnerstag", 4: "Heute Freitag", 5: "Heute Samstag", 6: "Heute Sonntag", 99: "Feiertag" };
var status_translation = { "open": "geöffnet", "closed": "geschlossen", "undefined": "unbekannt" };
if (data['status'] != "undefined")
{
var filter_status = data['status'];
switch (optionen.view) {
case "full":
var lisTable = '<table class="lisopentimesnow_table">';
lisTable += '<tr>';
lisTable += '<td style="width:15px">';
lisTable += '<div class="lisopentimesnow_status_'+data['status']+'">&nbsp;</div>';
lisTable += '</td>';
lisTable += '<td>';
lisTable += '<div class="lisopentimesnow_status_text">'+status_translation[data['status']]+'</div>';
if (data['today'] != false) {
filter_status = "open_today";
lisTable += '<div class="lisopentimesnow_day">'+day_translation[data['weekday']]+'</div>';
lisTable += '<div class="lisopentimesnow_times">';
$.each(data['today'], function(i) {
lisTable += '<div>' + data['today'][i]['from'] + ' - ' + data['today'][i]['to'] + ' Uhr</div>';
});
lisTable += '</div>';
}
lisTable += '</td>';
lisTable += '</tr>';
lisTable += '<tr>';
lisTable += '<td></td>';
lisTable += '<td>';
lisTable += '<a href="#mobile_opentimes" class="ui-btn-up-c" style="padding:3px 5px">&raquo; Öffnungszeiten</a>';
lisTable += '</td>';
lisTable += '</tr>';
lisTable += '</table>';
$("#lisopentimesnow_" + remote_id).html(lisTable);
$("#lisopentimesnow_" + remote_id).fadeIn(1000);
break;
case "line":
var lisContent = '<div class="lisopentimesnow_line_status_'+data['status']+'">'+status_translation[data['status']]+'</div>';
$("#lisopentimesnow_line_" + remote_id).html(lisContent);
$("#lisopentimesnow_line_" + remote_id).fadeIn(1000);
if (data['today'] != false && data['status'] != "open") {
filter_status = "open_today";
}
$("#poi_line_" + remote_id).addClass(filter_status);
break;
} //ende switch
}
}
var remote_ids_string = optionen.remote_ids.join(',');
var opentimes = $.ajax({
url: "/listdbclient/isnowopen/" + remote_ids_string,
dataType: "json",
cache: false,
success: function(data){
$.each(data, function(id) {
showOpentimes(id, data[id]);
});
}
});
}
var CLASSLISTS_MAIN_CONTENT_ID = 'maincontent-design';
function classListsFilter( baseURL, imgLoader )
{
if ( !YAHOO.util.Connect.asyncRequest )
{
return true;
}
var callback = { success: function( o )
{
var content = document.getElementById( CLASSLISTS_MAIN_CONTENT_ID );
if ( !content )
{
return;
}
content.innerHTML = o.responseText;
}
};
var classListsURL = classListsBuildURL( baseURL );
classListsWait( imgLoader );
var transaction = YAHOO.util.Connect.asyncRequest( 'GET', classListsURL, callback );
return false;
}
function classListsWait( imgLoader )
{
var content = document.getElementById( CLASSLISTS_MAIN_CONTENT_ID );
if ( !content )
{
return;
}
content.innerHTML = '<p style="text-align:center;padding-top:4em;"><img src="' + imgLoader + '" alt="Loading..." /></p>';
}
function classListsBuildURL( baseURL )
{
var classIdentfier = classListsGetSelectValue( 'classIdentifier' );
var sortMethod = classListsGetSelectValue( 'sortMethod' );
var sortOrder  = classListsGetSelectValue( 'sortOrder' );
return baseURL + '/' + classIdentfier + '/' + sortMethod + '/' + sortOrder + '/ajax';
}
function classListsGetSelectValue( selectID )
{
var element = document.getElementById( selectID );
if ( !element )
{
return '';
}
return element.options[element.selectedIndex].value;
}

