
(function(a,b,c){function bc(b){if(!U){P=b,_(),y=a(P),Q=0,K.rel!=="nofollow"&&(y=a("."+g).filter(function(){var b=a.data(this,e).rel||this.rel;return b===K.rel}),Q=y.index(P),Q===-1&&(y=y.add(P),Q=y.length-1));if(!S){S=T=!0,r.show();if(K.returnFocus)try{P.blur(),a(P).one(l,function(){try{this.focus()}catch(a){}})}catch(c){}q.css({opacity:+K.opacity,cursor:K.overlayClose?"pointer":"auto"}).show(),K.w=Z(K.initialWidth,"x"),K.h=Z(K.initialHeight,"y"),X.position(),o&&z.bind("resize."+p+" scroll."+p,function(){q.css({width:z.width(),height:z.height(),top:z.scrollTop(),left:z.scrollLeft()})}).trigger("resize."+p),ba(h,K.onOpen),J.add(D).hide(),I.html(K.close).show()}X.load(!0)}}function bb(){var a,b=f+"Slideshow_",c="click."+f,d,e,g;K.slideshow&&y[1]?(d=function(){F.text(K.slideshowStop).unbind(c).bind(j,function(){if(Q<y.length-1||K.loop)a=setTimeout(X.next,K.slideshowSpeed)}).bind(i,function(){clearTimeout(a)}).one(c+" "+k,e),r.removeClass(b+"off").addClass(b+"on"),a=setTimeout(X.next,K.slideshowSpeed)},e=function(){clearTimeout(a),F.text(K.slideshowStart).unbind([j,i,k,c].join(" ")).one(c,d),r.removeClass(b+"on").addClass(b+"off")},K.slideshowAuto?d():e()):r.removeClass(b+"off "+b+"on")}function ba(b,c){c&&c.call(P),a.event.trigger(b)}function _(b){K=a.extend({},a.data(P,e));for(b in K)a.isFunction(K[b])&&b.substring(0,2)!=="on"&&(K[b]=K[b].call(P));K.rel=K.rel||P.rel||"nofollow",K.href=K.href||a(P).attr("href"),K.title=K.title||P.title,typeof K.href=="string"&&(K.href=a.trim(K.href))}function $(a){return K.photo||/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i.test(a)}function Z(a,b){return Math.round((/%/.test(a)?(b==="x"?z.width():z.height())/100:1)*parseInt(a,10))}function Y(c,d,e){e=b.createElement("div"),c&&(e.id=f+c),e.style.cssText=d||"";return a(e)}var d={transition:"elastic",speed:300,width:!1,initialWidth:"600",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,inline:!1,html:!1,iframe:!1,fastIframe:!0,photo:!1,href:!1,title:!1,rel:!1,opacity:.9,preloading:!0,current:"image {current} of {total}",previous:"previous",next:"next",close:"close",open:!1,returnFocus:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1,overlayClose:!0,escKey:!0,arrowKey:!0,top:!1,bottom:!1,left:!1,right:!1,fixed:!1,data:!1},e="colorbox",f="cbox",g=f+"Element",h=f+"_open",i=f+"_load",j=f+"_complete",k=f+"_cleanup",l=f+"_closed",m=f+"_purge",n=a.browser.msie&&!a.support.opacity,o=n&&a.browser.version<7,p=f+"_IE6",q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X;X=a.fn[e]=a[e]=function(b,c){var f=this;b=b||{};if(!f[0]){if(f.selector)return f;f=a("<a/>"),b.open=!0}c&&(b.onComplete=c),f.each(function(){a.data(this,e,a.extend({},a.data(this,e)||d,b)),a(this).addClass(g)}),(a.isFunction(b.open)&&b.open.call(f)||b.open)&&bc(f[0]);return f},X.init=function(){z=a(c),r=Y().attr({id:e,"class":n?f+(o?"IE6":"IE"):""}),q=Y("Overlay",o?"position:absolute":"").hide(),s=Y("Wrapper"),t=Y("Content").append(A=Y("LoadedContent","width:0; height:0; overflow:hidden"),C=Y("LoadingOverlay").add(Y("LoadingGraphic")),D=Y("Title"),E=Y("Current"),G=Y("Next"),H=Y("Previous"),F=Y("Slideshow").bind(h,bb),I=Y("Close")),s.append(Y().append(Y("TopLeft"),u=Y("TopCenter"),Y("TopRight")),Y(!1,"clear:left").append(v=Y("MiddleLeft"),t,w=Y("MiddleRight")),Y(!1,"clear:left").append(Y("BottomLeft"),x=Y("BottomCenter"),Y("BottomRight"))).children().children().css({"float":"left"}),B=Y(!1,"position:absolute; width:9999px; visibility:hidden; display:none"),a("body").prepend(q,r.append(s,B)),t.children().hover(function(){a(this).addClass("hover")},function(){a(this).removeClass("hover")}).addClass("hover"),L=u.height()+x.height()+t.outerHeight(!0)-t.height(),M=v.width()+w.width()+t.outerWidth(!0)-t.width(),N=A.outerHeight(!0),O=A.outerWidth(!0),r.css({"padding-bottom":L,"padding-right":M}).hide(),G.click(function(){X.next()}),H.click(function(){X.prev()}),I.click(function(){X.close()}),J=G.add(H).add(E).add(F),t.children().removeClass("hover"),q.click(function(){K.overlayClose&&X.close()}),a(b).bind("keydown."+f,function(a){var b=a.keyCode;S&&K.escKey&&b===27&&(a.preventDefault(),X.close()),S&&K.arrowKey&&y[1]&&(b===37?(a.preventDefault(),H.click()):b===39&&(a.preventDefault(),G.click()))})},X.remove=function(){r.add(q).remove(),a("."+g).removeData(e).removeClass(g)},X.position=function(a,c){function g(a){u[0].style.width=x[0].style.width=t[0].style.width=a.style.width,C[0].style.height=C[1].style.height=t[0].style.height=v[0].style.height=w[0].style.height=a.style.height}var d=0,e=0;z.unbind("resize."+f),r.hide(),K.fixed&&!o?r.css({position:"fixed"}):(d=z.scrollTop(),e=z.scrollLeft(),r.css({position:"absolute"})),K.right!==!1?e+=Math.max(z.width()-K.w-O-M-Z(K.right,"x"),0):K.left!==!1?e+=Z(K.left,"x"):e+=Math.round(Math.max(z.width()-K.w-O-M,0)/2),K.bottom!==!1?d+=Math.max(b.documentElement.clientHeight-K.h-N-L-Z(K.bottom,"y"),0):K.top!==!1?d+=Z(K.top,"y"):d+=Math.round(Math.max(b.documentElement.clientHeight-K.h-N-L,0)/2),r.show(),a=r.width()===K.w+O&&r.height()===K.h+N?0:a||0,s[0].style.width=s[0].style.height="9999px",r.dequeue().animate({width:K.w+O,height:K.h+N,top:d,left:e},{duration:a,complete:function(){g(this),T=!1,s[0].style.width=K.w+O+M+"px",s[0].style.height=K.h+N+L+"px",c&&c(),setTimeout(function(){z.bind("resize."+f,X.position)},1)},step:function(){g(this)}})},X.resize=function(a){if(S){a=a||{},a.width&&(K.w=Z(a.width,"x")-O-M),a.innerWidth&&(K.w=Z(a.innerWidth,"x")),A.css({width:K.w}),a.height&&(K.h=Z(a.height,"y")-N-L),a.innerHeight&&(K.h=Z(a.innerHeight,"y"));if(!a.innerHeight&&!a.height){var b=A.wrapInner("<div style='overflow:auto'></div>").children();K.h=b.height(),b.replaceWith(b.children())}A.css({height:K.h}),X.position(K.transition==="none"?0:K.speed)}},X.prep=function(b){function h(){K.h=K.h||A.height(),K.h=K.mh&&K.mh<K.h?K.mh:K.h;return K.h}function g(){K.w=K.w||A.width(),K.w=K.mw&&K.mw<K.w?K.mw:K.w;return K.w}if(!!S){var c,d=K.transition==="none"?0:K.speed;A.remove(),A=Y("LoadedContent").append(b),A.hide().appendTo(B.show()).css({width:g(),overflow:K.scrolling?"auto":"hidden"}).css({height:h()}).prependTo(t),B.hide(),a(R).css({"float":"none"}),o&&a("select").not(r.find("select")).filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one(k,function(){this.style.visibility="inherit"}),c=function(){function o(){n&&r[0].style.removeAttribute("filter")}var b,c,g,h,i=y.length,k,l;!S||(l=function(){clearTimeout(W),C.hide(),ba(j,K.onComplete)},n&&R&&A.fadeIn(100),D.html(K.title).add(A).show(),i>1?(typeof K.current=="string"&&E.html(K.current.replace("{current}",Q+1).replace("{total}",i)).show(),G[K.loop||Q<i-1?"show":"hide"]().html(K.next),H[K.loop||Q?"show":"hide"]().html(K.previous),b=Q?y[Q-1]:y[i-1],g=Q<i-1?y[Q+1]:y[0],K.slideshow&&F.show(),K.preloading&&(h=a.data(g,e).href||g.href,c=a.data(b,e).href||b.href,h=a.isFunction(h)?h.call(g):h,c=a.isFunction(c)?c.call(b):c,$(h)&&(a("<img/>")[0].src=h),$(c)&&(a("<img/>")[0].src=c))):J.hide(),K.iframe?(k=a("<iframe/>").addClass(f+"Iframe")[0],K.fastIframe?l():a(k).one("load",l),k.name=f+ +(new Date),k.src=K.href,K.scrolling||(k.scrolling="no"),n&&(k.frameBorder=0,k.allowTransparency="true"),a(k).appendTo(A).one(m,function(){k.src="//about:blank"})):l(),K.transition==="fade"?r.fadeTo(d,1,o):o())},K.transition==="fade"?r.fadeTo(d,0,function(){X.position(0,c)}):X.position(d,c)}},X.load=function(b){var c,d,e=X.prep;T=!0,R=!1,P=y[Q],b||_(),ba(m),ba(i,K.onLoad),K.h=K.height?Z(K.height,"y")-N-L:K.innerHeight&&Z(K.innerHeight,"y"),K.w=K.width?Z(K.width,"x")-O-M:K.innerWidth&&Z(K.innerWidth,"x"),K.mw=K.w,K.mh=K.h,K.maxWidth&&(K.mw=Z(K.maxWidth,"x")-O-M,K.mw=K.w&&K.w<K.mw?K.w:K.mw),K.maxHeight&&(K.mh=Z(K.maxHeight,"y")-N-L,K.mh=K.h&&K.h<K.mh?K.h:K.mh),c=K.href,W=setTimeout(function(){C.show()},100),K.inline?(Y().hide().insertBefore(a(c)[0]).one(m,function(){a(this).replaceWith(A.children())}),e(a(c))):K.iframe?e(" "):K.html?e(K.html):$(c)?(a(R=new Image).addClass(f+"Photo").error(function(){K.title=!1,e(Y("Error").text("This image could not be loaded"))}).load(function(){var a;R.onload=null,K.scalePhotos&&(d=function(){R.height-=R.height*a,R.width-=R.width*a},K.mw&&R.width>K.mw&&(a=(R.width-K.mw)/R.width,d()),K.mh&&R.height>K.mh&&(a=(R.height-K.mh)/R.height,d())),K.h&&(R.style.marginTop=Math.max(K.h-R.height,0)/2+"px"),y[1]&&(Q<y.length-1||K.loop)&&(R.style.cursor="pointer",R.onclick=function(){X.next()}),n&&(R.style.msInterpolationMode="bicubic"),setTimeout(function(){e(R)},1)}),setTimeout(function(){R.src=c},1)):c&&B.load(c,K.data,function(b,c,d){e(c==="error"?Y("Error").text("Request unsuccessful: "+d.statusText):a(this).contents())})},X.next=function(){!T&&y[1]&&(Q<y.length-1||K.loop)&&(Q=Q<y.length-1?Q+1:0,X.load())},X.prev=function(){!T&&y[1]&&(Q||K.loop)&&(Q=Q?Q-1:y.length-1,X.load())},X.close=function(){S&&!U&&(U=!0,S=!1,ba(k,K.onCleanup),z.unbind("."+f+" ."+p),q.fadeTo(200,0),r.stop().fadeTo(300,0,function(){r.add(q).css({opacity:1,cursor:"auto"}).hide(),ba(m),A.remove(),setTimeout(function(){U=!1,ba(l,K.onClosed)},1)}))},X.element=function(){return a(P)},X.settings=d,V=function(a){a.button!==0&&typeof a.button!="undefined"||a.ctrlKey||a.shiftKey||a.altKey||(a.preventDefault(),bc(this))},a.fn.delegate?a(b).delegate("."+g,"click",V):a("."+g).live("click",V),a(X.init)})(jQuery,document,this);
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 init_colorbox () {
$(".colorbox_free").colorbox({width:"50%", inline:true});
$(".colorbox_inline").colorbox({width:"680px", inline:true});
$(".colorbox_profile").colorbox({width:"760px", inline:true});
$(".colorbox_ajax").colorbox({width:"700px", maxHeight:"700px", initialHeight:"500px"});
$(".colorbox_iframe").colorbox({width:"700px", height:"700px", iframe:true});
}
function initialize_handler() {
$('.map_nav_head').click(function(){
idelem = $(this).attr('id');
idelemdiv = idelem.replace('_head', '_content');
$('#'+idelemdiv).slideToggle("normal");
src = $(this).attr('src');
if (src.indexOf("_open") >= 0){
src = src.replace('_open', '_close');
} else {
src = src.replace('_close', '_open');
}
src = $(this).attr('src', src);
});
$('.map_nav_head').hover(
function() {
$(this).css('cursor', 'pointer');
},
function() {
$(this).css('cursor', 'default');
}
);
}
$(document).ready(function(){
FB.init({
appId  : '102318529820408',
status : true,
cookie : true,
xfbml  : true
});
if (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.indexOf("IE 6.0") != "-1") {
$('#iewarning').show();
}
initialize_handler();
init_colorbox ();
});
(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: '/lisgmap/getmarkers/' + $(this).attr('rel') + '/' + opts.client,
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;
});
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();
}
$('.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;
});
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
};
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 = {
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]);
});
}
});
}

