
/* DateTime: Fri, 03 Sep 2010 09:16:36 */

/* Type: bottom, Subtype: ,Mask: all, Maske:  */

/* FILES: 
/_em_oas/jslibs/jquery/jquery.ifixpng2.js
/_em_oas/jslibs/jquery/jquery.toggleval_2.1.min.js
/_em_oas/jslibs/gmaps.custom.js
/_em_oas/jslibs/functions.js
/_em_oas/jslibs/jquery/jquery.corner.js*/


/* FILE: /_em_oas/jslibs/jquery/jquery.ifixpng2.js (Modified: Wed, 16 Jun 2010 09:36:40) */
/*
 * jQuery ifixpng plugin
 * (previously known as pngfix)
 * Version 3.1.2  (2008/09/01)
 * @requires jQuery v1.2.6 or above, or a lower version with the dimensions plugin
 *
 * Based on the plugin by Kush M., http://jquery.khurshid.com
 *
 * Background position Fixed
 * Also fixes non-visible images
 * (c) Copyright Yereth Jansen (yereth@yereth.nl)
 * personal website: http://www.yereth.nl
 * Company website: http://www.wharf.nl
 *
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 * For a demonstration of the background-position being fixed:
 * http://www.yereth.nl/bgpos.html
 *
 * Plugin page:
 * http://plugins.jquery.com/project/iFixPng2
 *
 */

;(function($){$.ifixpng=function(customPixel){$.ifixpng.pixel=customPixel;};$.ifixpng.regexp={bg:/^url\(["']?(.*\.png([?].*)?)["']?\)$/i,img:/.*\.png([?].*)?$/i},$.ifixpng.getPixel=function(){return $.ifixpng.pixel||'/no.gif';};var hack={base:$('base').attr('href'),ltie7:$.browser.msie&&$.browser.version<7,filter:function(src){return"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=crop,src='"+src+"')";}};$.fn.ifixpng=hack.ltie7?function(){function fixImage(image,source,width,height,hidden){image.css({filter:hack.filter(source),width:width,height:height}).attr({src:$.ifixpng.getPixel()}).positionFix();}
return this.each(function(){var $$=$(this);if($$.is('img')||$$.is('input')){var source,img;if(this.src&&this.src.match($.ifixpng.regexp.img)){source=(hack.base&&this.src.substring(0,1)!='/'&&this.src.indexOf(hack.base)===-1)?hack.base+this.src:this.src;if(!this.width||!this.height){$(new Image()).one('load',function(){fixImage($$,source,this.width,this.height);$(this).remove();}).attr('src',source);}else fixImage($$,source,this.width,this.height);}}else if(this.style){var imageSrc=$$.css('backgroundImage');if(imageSrc&&imageSrc.match($.ifixpng.regexp.bg)&&this.currentStyle.backgroundRepeat=='no-repeat'){imageSrc=RegExp.$1;var x=this.currentStyle.backgroundPositionX||0,y=this.currentStyle.backgroundPositionY||0;if(x||y){var css={},img;if(typeof x!='undefined'){if(x=='left')css.left=0;else if(x=='right')css.right=$$.width()%2===1?-1:0;else css.left=x;}
if(typeof y!='undefined'){if(y=='bottom')css.bottom=$$.height()%2===1?-1:0;else if(y=='top')css.top=0;else css.top=y;}
img=new Image();$(img).one('load',function(){var x,y,expr={},prop;if(/center|%/.test(css.top)){expr.top="(this.parentNode.offsetHeight - this.offsetHeight) * "+(css.top=='center'?0.5:(parseInt(css.top)/100));delete css.top;}
if(/center|%/.test(css.left)){expr.left="(this.parentNode.offsetWidth - this.offsetWidth) * "+(css.left=='center'?0.5:(parseInt(css.left)/100));delete css.left;}
$$.positionFix().css({backgroundImage:'none'}).prepend($('<div></div>').css(css).css({width:this.width,height:this.height,position:'absolute',filter:hack.filter(imageSrc)}));if(expr.top||expr.left){var elem=$$.children(':first')[0];for(prop in expr)elem.style.setExpression(prop,expr[prop],'JavaScript');}
$(this).remove();});img.src=imageSrc;}else{$$.css({backgroundImage:'none',filter:hack.filter(imageSrc)});}}}});}:function(){return this;};$.fn.positionFix=function(){return this.each(function(){var $$=$(this);if($$.css('position')!='absolute')$$.css({position:'relative'});});};})(jQuery);


/* FILE: /_em_oas/jslibs/jquery/jquery.toggleval_2.1.min.js (Modified: Wed, 16 Jun 2010 09:36:40) */
/* -------------------------------------------------- *
 * ToggleVal 2.1
 * Updated: 1/16/09
 * -------------------------------------------------- *
 * Author: Aaron Kuzemchak
 * URL: http://aaronkuzemchak.com/
 * Copyright: 2008-2009 Aaron Kuzemchak
 * License: MIT License
** -------------------------------------------------- */

(function($){$.fn.toggleVal=function(theOptions){if(!theOptions||typeof(theOptions)=="object"){theOptions=$.extend({focusClass:"tv-focused",changedClass:"tv-changed",populateFrom:"default",text:null,removeLabels:false},theOptions)}else if(typeof(theOptions)=="string"&&theOptions.toLowerCase()=="destroy"){var destroy=true}return this.each(function(){if(destroy){$(this).unbind("focus.toggleval").unbind("blur.toggleval").removeData("defText");return false}var defText="";switch(theOptions.populateFrom){case"alt":defText=$(this).attr("alt");$(this).val(defText);break;case"label":defText=$("label[for='"+$(this).attr("id")+"']").text();$(this).val(defText);break;case"custom":defText=theOptions.text;$(this).val(defText);break;default:defText=$(this).val()}$(this).addClass("toggleval").data("defText",defText);if(theOptions.removeLabels==true){$("label[for='"+$(this).attr("id")+"']").remove()}$(this).bind("focus.toggleval",function(){if($(this).val()==$(this).data("defText")){$(this).val("")}$(this).addClass(theOptions.focusClass).removeClass(theOptions.changedClass)}).bind("blur.toggleval",function(){if($(this).val()==""){$(this).val($(this).data("defText"))}$(this).removeClass(theOptions.focusClass);if($(this).val()!=$(this).data("defText")){$(this).addClass(theOptions.changedClass)}else{$(this).removeClass(theOptions.changedClass)}})})}})(jQuery);


/* FILE: /_em_oas/jslibs/gmaps.custom.js (Modified: Wed, 16 Jun 2010 09:36:40) */
/*
* ExtInfoWindow Class, v1.0
*  Copyright (c) 2007, Joe Monahan (http://www.seejoecode.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*       http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* This class lets you add an info window to the map which mimics GInfoWindow
* and allows for users to skin it via CSS.  Additionally it has options to
* pull in HTML content from an ajax request, triggered when a user clicks on
* the associated marker.
*/


/**
 * Creates a new ExtInfoWindow that will initialize by reading styles from css
 *
 * @constructor
 * @param {GMarker} marker The marker associated with the info window
 * @param {String} windowId The DOM Id we will use to reference the info window
 * @param {String} html The HTML contents
 * @param {Object} opt_opts A contianer for optional arguments:
 *    {String} ajaxUrl The Url to hit on the server to request some contents
 *    {Number} paddingX The padding size in pixels that the info window will leave on
 *                    the left and right sides of the map when panning is involved.
 *    {Number} paddingY The padding size in pixels that the info window will leave on
 *                    the top and bottom sides of the map when panning is involved.
 *    {Number} beakOffset The repositioning offset for when aligning the beak element.
 *                    This is used to make sure the beak lines up correcting if the
 *                    info window styling containers a border.
 */


if(document.getElementById("em_google_maps")){function ExtInfoWindow(marker,windowId,html,opt_opts){this.html_=html;this.marker_=marker;this.infoWindowId_=windowId;this.options_=opt_opts==null?{}:opt_opts;this.ajaxUrl_=this.options_.ajaxUrl==null?null:this.options_.ajaxUrl;this.callback_=this.options_.ajaxCallback==null?null:this.options_.ajaxCallback;this.borderSize_=this.options_.beakOffset==null?0:this.options_.beakOffset;this.paddingX_=this.options_.paddingX==null?0+this.borderSize_:this.options_.paddingX+this.borderSize_;this.paddingY_=this.options_.paddingY==null?0+this.borderSize_:this.options_.paddingY+this.borderSize_;this.map_=null;this.container_=document.createElement('div');this.container_.style.position='relative';this.container_.style.display='none';this.contentDiv_=document.createElement('div');this.contentDiv_.id=this.infoWindowId_+'_contents';this.contentDiv_.innerHTML=this.html_;this.contentDiv_.style.display='block';this.contentDiv_.style.visibility='hidden';jQuery("#move_map_left").fadeOut(500);jQuery("#move_map_right").fadeOut(500);jQuery("#move_map_top").fadeOut(500);jQuery("#move_map_down").fadeOut(500);jQuery("#zoom_map_out").fadeOut(500);jQuery("#zoom_map_in").fadeOut(500);this.wrapperDiv_=document.createElement('div');};ExtInfoWindow.prototype=new GOverlay();ExtInfoWindow.prototype.initialize=function(map){this.map_=map;this.defaultStyles={containerWidth:this.map_.getSize().width/2,borderSize:1};this.wrapperParts={tl:{t:0,l:0,w:0,h:0,domElement:null},t:{t:0,l:0,w:0,h:0,domElement:null},tr:{t:0,l:0,w:0,h:0,domElement:null},l:{t:0,l:0,w:0,h:0,domElement:null},r:{t:0,l:0,w:0,h:0,domElement:null},bl:{t:0,l:0,w:0,h:0,domElement:null},b:{t:0,l:0,w:0,h:0,domElement:null},br:{t:0,l:0,w:0,h:0,domElement:null},beak:{t:0,l:0,w:0,h:0,domElement:null},close:{t:0,l:0,w:0,h:0,domElement:null}};for(var i in this.wrapperParts){var tempElement=document.createElement('div');tempElement.id=this.infoWindowId_+'_'+i;tempElement.style.visibility='hidden';document.body.appendChild(tempElement);tempElement=document.getElementById(this.infoWindowId_+'_'+i);var tempWrapperPart=eval('this.wrapperParts.'+i);tempWrapperPart.w=parseInt(this.getStyle_(tempElement,'width'));tempWrapperPart.h=parseInt(this.getStyle_(tempElement,'height'));document.body.removeChild(tempElement);}
for(var i in this.wrapperParts){if(i=='close'){this.wrapperDiv_.appendChild(this.contentDiv_);}
var wrapperPartsDiv=null;if(this.wrapperParts[i].domElement==null){wrapperPartsDiv=document.createElement('div');this.wrapperDiv_.appendChild(wrapperPartsDiv);}else{wrapperPartsDiv=this.wrapperParts[i].domElement;}
wrapperPartsDiv.id=this.infoWindowId_+'_'+i;wrapperPartsDiv.style.position='absolute';wrapperPartsDiv.style.width=this.wrapperParts[i].w+'px';wrapperPartsDiv.style.height=this.wrapperParts[i].h+'px';wrapperPartsDiv.style.top=this.wrapperParts[i].t+'px';wrapperPartsDiv.style.left=this.wrapperParts[i].l+'px';this.wrapperParts[i].domElement=wrapperPartsDiv;}
this.map_.getPane(G_MAP_FLOAT_PANE).appendChild(this.container_);this.container_.id=this.infoWindowId_;var containerWidth=this.getStyle_(document.getElementById(this.infoWindowId_),'width');this.container_.style.width=(containerWidth==null?this.defaultStyles.containerWidth:containerWidth);this.map_.getContainer().appendChild(this.contentDiv_);this.contentWidth=this.getDimensions_(this.container_).width;this.contentDiv_.style.width=this.contentWidth+'px';this.contentDiv_.style.position='absolute';this.container_.appendChild(this.wrapperDiv_);GEvent.bindDom(this.container_,'mousedown',this,this.onClick_);GEvent.bindDom(this.container_,'dblclick',this,this.onClick_);GEvent.bindDom(this.container_,'DOMMouseScroll',this,this.onClick_);GEvent.trigger(this.map_,'extinfowindowopen');if(this.ajaxUrl_!=null){this.ajaxRequest_(this.ajaxUrl_);}};ExtInfoWindow.prototype.onClick_=function(e){if(navigator.userAgent.toLowerCase().indexOf('msie')!=-1&&document.all){window.event.cancelBubble=true;window.event.returnValue=false;}else{e.stopPropagation();}};ExtInfoWindow.prototype.remove=function(){if(this.map_.getExtInfoWindow()!=null){GEvent.trigger(this.map_,'extinfowindowbeforeclose');GEvent.clearInstanceListeners(this.container_);if(this.container_.outerHTML){this.container_.outerHTML='';}
if(this.container_.parentNode){this.container_.parentNode.removeChild(this.container_);}
this.container_=null;GEvent.trigger(this.map_,'extinfowindowclose');this.map_.setExtInfoWindow_(null);}};ExtInfoWindow.prototype.copy=function(){return new ExtInfoWindow(this.marker_,this.infoWindowId_,this.html_,this.options_);};ExtInfoWindow.prototype.redraw=function(force){if(!force||this.container_==null)return;var contentHeight=this.contentDiv_.offsetHeight;this.contentDiv_.style.height=contentHeight+'px';this.contentDiv_.style.left=this.wrapperParts.l.w+'px';this.contentDiv_.style.top=this.wrapperParts.tl.h+'px';this.contentDiv_.style.visibility='visible';jQuery("#move_map_left").css("display","none");jQuery("#move_map_right").css("display","none");jQuery("#move_map_top").css("display","none");jQuery("#move_map_down").css("display","none");jQuery("#zoom_map_out").css("display","none");jQuery("#zoom_map_in").css("display","none");this.wrapperParts.tl.t=0;this.wrapperParts.tl.l=0;this.wrapperParts.t.l=this.wrapperParts.tl.w;this.wrapperParts.t.w=(this.wrapperParts.l.w+this.contentWidth+this.wrapperParts.r.w)-this.wrapperParts.tl.w-this.wrapperParts.tr.w;this.wrapperParts.t.h=this.wrapperParts.tl.h;this.wrapperParts.tr.l=this.wrapperParts.t.w+this.wrapperParts.tl.w;this.wrapperParts.l.t=this.wrapperParts.tl.h;this.wrapperParts.l.h=contentHeight;this.wrapperParts.r.l=this.contentWidth+this.wrapperParts.l.w;this.wrapperParts.r.t=this.wrapperParts.tr.h;this.wrapperParts.r.h=contentHeight;this.wrapperParts.bl.t=contentHeight+this.wrapperParts.tl.h;this.wrapperParts.b.l=this.wrapperParts.bl.w;this.wrapperParts.b.t=contentHeight+this.wrapperParts.tl.h;this.wrapperParts.b.w=(this.wrapperParts.l.w+this.contentWidth+this.wrapperParts.r.w)-this.wrapperParts.bl.w-this.wrapperParts.br.w;this.wrapperParts.b.h=this.wrapperParts.bl.h;this.wrapperParts.br.l=this.wrapperParts.b.w+this.wrapperParts.bl.w;this.wrapperParts.br.t=contentHeight+this.wrapperParts.tr.h;this.wrapperParts.close.l=this.wrapperParts.tr.l+this.wrapperParts.tr.w-this.wrapperParts.close.w-this.borderSize_;this.wrapperParts.close.t=this.borderSize_;this.wrapperParts.beak.l=this.borderSize_+(this.contentWidth/2)-(this.wrapperParts.beak.w/2);this.wrapperParts.beak.t=this.wrapperParts.bl.t+this.wrapperParts.bl.h-this.borderSize_;for(var i in this.wrapperParts){if(i=='close'){this.wrapperDiv_.insertBefore(this.contentDiv_,this.wrapperParts[i].domElement);}
var wrapperPartsDiv=null;if(this.wrapperParts[i].domElement==null){wrapperPartsDiv=document.createElement('div');this.wrapperDiv_.appendChild(wrapperPartsDiv);}else{wrapperPartsDiv=this.wrapperParts[i].domElement;}
wrapperPartsDiv.id=this.infoWindowId_+'_'+i;wrapperPartsDiv.style.position='absolute';wrapperPartsDiv.style.width=this.wrapperParts[i].w+'px';wrapperPartsDiv.style.height=this.wrapperParts[i].h+'px';wrapperPartsDiv.style.top=this.wrapperParts[i].t+'px';wrapperPartsDiv.style.left=this.wrapperParts[i].l+'px';this.wrapperParts[i].domElement=wrapperPartsDiv;}
var currentMarker=this.marker_;var thisMap=this.map_;GEvent.addDomListener(this.wrapperParts.close.domElement,'click',function(){thisMap.closeExtInfoWindow();});var pixelLocation=this.map_.fromLatLngToDivPixel(this.marker_.getPoint());this.container_.style.position='absolute';var markerIcon=this.marker_.getIcon();this.container_.style.left=(pixelLocation.x
-(this.contentWidth/2)
-markerIcon.iconAnchor.x
+markerIcon.infoWindowAnchor.x)+'px';this.container_.style.top=(pixelLocation.y
-this.wrapperParts.bl.h
-contentHeight
-this.wrapperParts.tl.h
-this.wrapperParts.beak.h
-markerIcon.iconAnchor.y
+markerIcon.infoWindowAnchor.y
+this.borderSize_)+'px';this.container_.style.display='block';if(this.map_.getExtInfoWindow()!=null){this.repositionMap_();}};ExtInfoWindow.prototype.resize=function(){var tempElement=this.contentDiv_.cloneNode(true);tempElement.id=this.infoWindowId_+'_tempContents';tempElement.style.visibility='hidden';tempElement.style.height='auto';document.body.appendChild(tempElement);tempElement=document.getElementById(this.infoWindowId_+'_tempContents');var contentHeight=tempElement.offsetHeight;document.body.removeChild(tempElement);this.contentDiv_.style.height=contentHeight+'px';var contentWidth=this.contentDiv_.offsetWidth;var pixelLocation=this.map_.fromLatLngToDivPixel(this.marker_.getPoint());var oldWindowHeight=this.wrapperParts.t.domElement.offsetHeight+this.wrapperParts.l.domElement.offsetHeight+this.wrapperParts.b.domElement.offsetHeight;var oldWindowPosTop=this.wrapperParts.t.domElement.offsetTop;this.wrapperParts.l.domElement.style.height=contentHeight+'px';this.wrapperParts.r.domElement.style.height=contentHeight+'px';var newPosTop=this.wrapperParts.b.domElement.offsetTop-contentHeight;this.wrapperParts.l.domElement.style.top=newPosTop+'px';this.wrapperParts.r.domElement.style.top=newPosTop+'px';this.contentDiv_.style.top=newPosTop+'px';windowTHeight=parseInt(this.wrapperParts.t.domElement.style.height);newPosTop-=windowTHeight;this.wrapperParts.close.domElement.style.top=newPosTop+this.borderSize_+'px';this.wrapperParts.tl.domElement.style.top=newPosTop+'px';this.wrapperParts.t.domElement.style.top=newPosTop+'px';this.wrapperParts.tr.domElement.style.top=newPosTop+'px';this.repositionMap_();};ExtInfoWindow.prototype.repositionMap_=function(){var mapNE=this.map_.fromLatLngToDivPixel(this.map_.getBounds().getNorthEast());var mapSW=this.map_.fromLatLngToDivPixel(this.map_.getBounds().getSouthWest());var markerPosition=this.map_.fromLatLngToDivPixel(this.marker_.getPoint());var panX=0;var panY=0;var paddingX=this.paddingX_;var paddingY=this.paddingY_;var infoWindowAnchor=this.marker_.getIcon().infoWindowAnchor;var iconAnchor=this.marker_.getIcon().iconAnchor;var windowT=this.wrapperParts.t.domElement;var windowL=this.wrapperParts.l.domElement;var windowB=this.wrapperParts.b.domElement;var windowR=this.wrapperParts.r.domElement;var windowBeak=this.wrapperParts.beak.domElement;var offsetTop=markerPosition.y-(-infoWindowAnchor.y+iconAnchor.y+this.getDimensions_(windowBeak).height+this.getDimensions_(windowB).height+this.getDimensions_(windowL).height+this.getDimensions_(windowT).height+this.paddingY_);if(offsetTop<mapNE.y){panY=mapNE.y-offsetTop;}else{var offsetBottom=markerPosition.y+this.paddingY_;if(offsetBottom>=mapSW.y){panY=-(offsetBottom-mapSW.y);}}
var offsetRight=Math.round(markerPosition.x+this.getDimensions_(this.container_).width/2+this.getDimensions_(windowR).width+this.paddingX_+infoWindowAnchor.x-iconAnchor.x);if(offsetRight>mapNE.x){panX=-(offsetRight-mapNE.x);}else{var offsetLeft=-(Math.round((this.getDimensions_(this.container_).width/2-this.marker_.getIcon().iconSize.width/2)+this.getDimensions_(windowL).width+this.borderSize_+this.paddingX_)-markerPosition.x-infoWindowAnchor.x+iconAnchor.x);if(offsetLeft<mapSW.x){panX=mapSW.x-offsetLeft;}}
if(panX!=0||panY!=0&&this.map_.getExtInfoWindow()!=null){this.map_.panBy(new GSize(panX,panY));}};ExtInfoWindow.prototype.ajaxRequest_=function(url){var thisMap=this.map_;var thisCallback=this.callback_;GDownloadUrl(url,function(response,status){var infoWindow=document.getElementById(thisMap.getExtInfoWindow().infoWindowId_+'_contents');if(response==null||status==-1){infoWindow.innerHTML='<span class="error">ERROR: The Ajax request failed to get HTML content from "'+url+'"</span>';}else{infoWindow.innerHTML=response;}
if(thisCallback!=null){thisCallback();}
thisMap.getExtInfoWindow().resize();GEvent.trigger(thisMap,'extinfowindowupdate');});};ExtInfoWindow.prototype.getDimensions_=function(element){var display=this.getStyle_(element,'display');if(display!='none'&&display!=null){return{width:element.offsetWidth,height:element.offsetHeight};}
var els=element.style;var originalVisibility=els.visibility;var originalPosition=els.position;var originalDisplay=els.display;els.visibility='hidden';els.position='absolute';els.display='block';var originalWidth=element.clientWidth;var originalHeight=element.clientHeight;els.display=originalDisplay;els.position=originalPosition;els.visibility=originalVisibility;return{width:originalWidth,height:originalHeight};};ExtInfoWindow.prototype.getStyle_=function(element,style){var found=false;style=this.camelize_(style);var value=element.style[style];if(!value){if(document.defaultView&&document.defaultView.getComputedStyle){var css=document.defaultView.getComputedStyle(element,null);value=css?css[style]:null;}else if(element.currentStyle){value=element.currentStyle[style];}}
if((value=='auto')&&(style=='width'||style=='height')&&(this.getStyle_(element,'display')!='none')){if(style=='width'){value=element.offsetWidth;}else{value=element.offsetHeight;}}
return(value=='auto')?null:value;};ExtInfoWindow.prototype.camelize_=function(element){var parts=element.split('-'),len=parts.length;if(len==1)return parts[0];var camelized=element.charAt(0)=='-'?parts[0].charAt(0).toUpperCase()+parts[0].substring(1):parts[0];for(var i=1;i<len;i++){camelized+=parts[i].charAt(0).toUpperCase()+parts[i].substring(1);}
return camelized;};GMap.prototype.ExtInfoWindowInstance_=null;GMap.prototype.ClickListener_=null;GMap.prototype.InfoWindowListener_=null;GMarker.prototype.openExtInfoWindow=function(map,cssId,html,opt_opts){if(map==null){throw'Error in GMarker.openExtInfoWindow: map cannot be null';return false;}
if(cssId==null||cssId==''){throw'Error in GMarker.openExtInfoWindow: must specify a cssId';return false;}
map.closeInfoWindow();if(map.getExtInfoWindow()!=null){map.closeExtInfoWindow();}
if(map.getExtInfoWindow()==null){map.setExtInfoWindow_(new ExtInfoWindow(this,cssId,html,opt_opts));if(map.ClickListener_==null){map.ClickListener_=GEvent.addListener(map,'click',function(event){if(!event&&map.getExtInfoWindow()!=null){map.closeExtInfoWindow();}});}
if(map.InfoWindowListener_==null){map.InfoWindowListener_=GEvent.addListener(map,'infowindowopen',function(event){if(map.getExtInfoWindow()!=null){map.closeExtInfoWindow();}});}
map.addOverlay(map.getExtInfoWindow());}};GMarker.prototype.closeExtInfoWindow=function(map){if(map.getExtInfWindow()!=null){map.closeExtInfoWindow();}};GMap2.prototype.getExtInfoWindow=function(){return this.ExtInfoWindowInstance_;};GMap2.prototype.setExtInfoWindow_=function(extInfoWindow){this.ExtInfoWindowInstance_=extInfoWindow;}
GMap2.prototype.closeExtInfoWindow=function(){if(this.getExtInfoWindow()!=null){this.ExtInfoWindowInstance_.remove();jQuery("#move_map_left").fadeIn(500);jQuery("#move_map_right").fadeIn(500);jQuery("#move_map_top").fadeIn(500);jQuery("#move_map_down").fadeIn(500);jQuery("#zoom_map_out").fadeIn(500);jQuery("#zoom_map_in").fadeIn(500);}};};



/* FILE: /_em_oas/jslibs/functions.js (Modified: Wed, 16 Jun 2010 09:36:40) */

/*--------------------
 * SUGGEST BOX
 *------------------*/

function emSuggestSetCity(_obj) {
    var objThis = jQuery(_obj);
    var intCity = objThis.attr("id");
    jQuery("input#suche[ort]").val(intCity);
}

jQuery(document).ready(function() {
    if (document.getElementById("suggestBox")) {
        if (typeof emSuggests != "undefined"
        && typeof emSuggests.orte != "undefined"
        ) {
            jQuery('input#suggestBox').jsonSuggest(emSuggests.orte, {onSelect:emSuggestSetCity});
        }
    }
});


/*--------------------
 * KARTENAUSWAHL
 *------------------*/

function emSetCity(_obj) {
    var objThis = jQuery(_obj);
    var strCity = objThis.attr("alt");
    jQuery("#suggestBox").val(strCity);
    emBoxClose();
}

function emSetCityMuenster(_obj) {
    var objThis = jQuery(_obj);
    var strCity = objThis.attr("alt");
    var strStadtteil = objThis.attr("lang");
    jQuery("#suggestBox").val(strCity);
    jQuery("#em_map").hide();
    jQuery("#em_map_muenster_" + strStadtteil).show();
    emBoxClose();
}

/*--------------------
 * GLOBAL: GET PROPERTY FUNCTIONS
 *------------------*/

function emInitFacebox()
{
    var arrEmBox = jQuery('a[rel=facebox]');
    arrEmBox.each(function(intIdx)
        {
            jQuery(this).click(emBoxOpen);
        }
    );
}

function microtime(get_as_float)
{

    var now = new Date().getTime() / 1000;
    var s = parseInt(now);

    return (get_as_float) ? now : (Math.round((now - s) * 1000) / 1000) + ' ' + s;
}

function emInitLightbox()
{
   jQuery('a[rel*=em_lightbox]').lightBox({
	overlayBgColor: '#E9E8E5',
	overlayOpacity: 0.8,
	imageLoading: '/_em_oas/_locals/owl/images/_layout/top_news_loading.gif',
	imageBtnClose: '/_em_oas/_locals/owl/images/_layout/lightbox-btn-close.gif',
	imageBtnPrint: '/_em_oas/_locals/owl/images/_layout/btn_print.gif',
	imageBtnSend: '/_em_oas/_locals/owl/images/_layout/btn_send.gif',
	imageBtnPrev: '/_em_oas/_locals/owl/images/_layout/lightbox-btn-prev.gif',
	imageBtnNext: '/_em_oas/_locals/owl/images/_layout/lightbox-btn-next.gif',
	containerResizeSpeed: 350,
	txtImage: 'Bild',
	txtOf: 'von',
	checkTarget: 1
   });
}

function getPageScroll()
{
	var xScroll, yScroll;
	if (self.pageYOffset) {
		yScroll = self.pageYOffset;
		xScroll = self.pageXOffset;
	} else if (document.documentElement && document.documentElement.scrollTop) {	 // Explorer 6 Strict
		yScroll = document.documentElement.scrollTop;
		xScroll = document.documentElement.scrollLeft;
	} else if (document.body) {// all other Explorers
		yScroll = document.body.scrollTop;
		xScroll = document.body.scrollLeft;
	}
	arrayPageScroll = new Array(xScroll, yScroll);
	return arrayPageScroll;
};

function getPageSize()
{
	var xScroll, yScroll;
	if (window.innerHeight && window.scrollMaxY) {
		xScroll = window.innerWidth + window.scrollMaxX;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		if(document.documentElement.clientWidth){
			windowWidth = document.documentElement.clientWidth;
		} else {
			windowWidth = self.innerWidth;
		}
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else {
		pageHeight = yScroll;
	}
	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){
		pageWidth = xScroll;
	} else {
		pageWidth = windowWidth;
	}
	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight);
	return arrayPageSize;
};

function emTextKuerzen(_strText, _intMax, _intMin, _strEndRepl)
{
    if (!_strText.length) {
        return '';
    }

    _strText = html_entity_decode(_strText);
    var strTemp = _strText;
    _strText = strip_tags(_strText);
    _strText = _strText.replace(/[\s]+/, ' ');
    _strText = _strText.replace(/^[\s]+|[\s]+$/, ' ');
    if (!_strText.length) {
        _strText = strTemp;
    }
    _strText = _strText.replace(/ +/, ' ');
    if (!_intMin) {
        _intMin = _intMax - 50;
    }
    if (_intMax
    &&  _strText.length > parseInt(_intMax + _strEndRepl.length)
    ) {
        var bolOk = 0;
        for (var intIdx = 0; intIdx <= _intMax - _intMin; intIdx++) {
            if (substr(_strText, _intMax - intIdx, 1).match(/\.\?\!/)) {
                _strText = substr(_strText, 0, _intMax - intIdx + (_strEndRepl ? 0 : 1)) + _strEndRepl;
                bolOk = 1;
                break;
            }
        }
        if (!bolOk) {
            for (var intIdx = 0; intIdx <= _intMax - _intMin; intIdx++) {
                if (substr(_strText, _intMax - intIdx, 1).match(/[,]/)) {
                    _strText = substr(_strText, 0, _intMax - intIdx) + _strEndRepl;
                    bolOk = 1;
                    break;
                }
            }
        }
        if (!bolOk) {
            for (var intIdx = 0; intIdx <= _intMax - _intMin; intIdx++) {
                if (!substr(_strText, _intMax - intIdx, 1).match(/[\w\d]/, 'i')) {
                    _strText = substr(_strText, 0, _intMax - intIdx) + _strEndRepl;
                    bolOk = 1;
                    break;
                }
            }
        }
        if (strrpos(_strText, '<') > strrpos(_strText, '>')) {
            _strText = substr(_strText, 0, strrpos(_strText, '<'));
            if (!bolOk) {
                _strText+= _strEndRepl;
            }
        } else if (!bolOk) {
            _strText = substr(_strText, 0, _intMin) + _strEndRepl;
        }
        if (_strEndRepl == '...') {
            _strText = _strText.replace(/\.{3,}/, '...');
        }
    }
    return htmlentities(_strText);
}

/*--------------------
 * GOOGLE MAPS FUNCTIONS
 *------------------*/

var em_objMap;
function emMarkerOpen(_objMapSmall, _objPoint, _objIcon, _strHtml, _bolInit)
{
    if (_bolInit) {
        var strId = 'emGm_' + microtime(true);
            strId = strId.replace('.', '_');

        var intMapWidth = 640;
        var intMapHeight = 480;

        if (document.getElementById('emBox')) {
            emBoxClose();
        }

        var objContent = jQuery('<div>');

        var objGMapContainer = jQuery('<div>')
            .attr('id', strId)
            .css({
                'height' : intMapHeight + 'px',
                'width' : intMapWidth + 'px',
                'background' : 'url(/_em_daten/mh/_layout/top_news_loading.gif) no-repeat center center'
            })
            .appendTo(objContent);

        var objEndLine = jQuery('<div>')
            .css({
                'margin-left' : (intMapWidth - 90) + 'px',
                'margin-top' : '10px',
                'margin-bottom' : '3px'
            })
            .appendTo(objContent);

        var objLink = jQuery('<a>')
            .attr('href', 'javascript:void(0);')
            .click(emBoxCloseVideo)
            .appendTo(objEndLine);

        var objLinkImg = jQuery('<img>')
            .attr('src', '/_em_daten/mh/_layout/lightbox-btn-close.gif')
            .attr('border', '0')
            .appendTo(objLink);

        _emOverlayOpen(
            objContent,
            {
                'width' : intMapWidth,
                'height' : intMapHeight
            },
            function ()
            {
                _emMarkerOpen(_objMapSmall, _objPoint, _objIcon, _strHtml, strId, _bolInit);
            }
        );
    }

    _emMarkerOpen(_objMapSmall, _objPoint, _objIcon, _strHtml, strId);
}

function _emMarkerOpen(_objMapSmall, _objPoint, _objIcon, _strHtml, _strId, _bolInit)
{
    if (GBrowserIsCompatible()
    &&  _bolInit
    ) {
        em_objMap = new GMap2(document.getElementById(_strId));

        em_objMap.addControl(new GMapTypeControl());

        function ImageZoomControl() {
        }

        ImageZoomControl.prototype = new GControl();

        ImageZoomControl.prototype.initialize = function(map) {
          var container = document.createElement('div');

          var zoomInDiv = document.createElement('div');
          this.setButtonStyle_(zoomInDiv);
          container.appendChild(zoomInDiv);
          var zoomInImg=document.createElement('IMG');
            zoomInImg.setAttribute('src', '/_em_daten/mh/_media/fct_font_plus.gif');
            zoomInImg.setAttribute('alt', 'alternate text');
            zoomInImg.setAttribute('height', '15px');
            zoomInImg.setAttribute('width', '16px');
          zoomInDiv.appendChild(zoomInImg);
          GEvent.addDomListener(zoomInDiv, 'click', function() {
            map.zoomIn();
          });

          var zoomOutDiv = document.createElement('div');
          this.setButtonStyle_(zoomOutDiv);
          container.appendChild(zoomOutDiv);
          var zoomOutImg=document.createElement('IMG');
            zoomOutImg.setAttribute('src', '/_em_daten/mh/_media/fct_font_minus.gif');
            zoomOutImg.setAttribute('alt', 'alternate text');
            zoomOutImg.setAttribute('height', '15px');
            zoomOutImg.setAttribute('width', '16px');
          zoomOutDiv.appendChild(zoomOutImg);
          GEvent.addDomListener(zoomOutDiv, 'click', function() {
            map.zoomOut();
          });

          map.getContainer().appendChild(container);
          return container;
        }

        ImageZoomControl.prototype.getDefaultPosition = function() {
          return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(7, 7));
        }

        ImageZoomControl.prototype.setButtonStyle_ = function(button) {
          button.style.float = 'left';
          button.style.cursor = 'pointer';
          button.style.marginBottom = '5px';
        }

        em_objMap.addControl(new ImageZoomControl());
        // em_objMap.addControl(new GLargeMapControl());

        em_objMap.enableScrollWheelZoom();
        em_objMap.setCenter(_objMapSmall.getCenter(), _objMapSmall.getZoom(), _objMapSmall.getCurrentMapType());
    }

    if (em_objMap) {
        var objMarker = new GMarker(_objPoint, _objIcon);
        GEvent.addListener(objMarker, 'click', function() {
           var html = _strHtml;
           objMarker.openInfoWindowHtml(html);
        });
        em_objMap.addOverlay(objMarker);
        //GEvent.trigger(objMarker, 'click');
    }
}

function emMapZoom(_strMapIdx)
{
    if (typeof(arrMaps) != 'undefined'
    &&  typeof(arrMaps[_strMapIdx]) != 'undefined'
    ) {
        for (var i=0; i<arrMaps[_strMapIdx].length;i++) {
            emMarkerOpen(
                arrMaps[_strMapIdx][i]['map'],
                arrMaps[_strMapIdx][i]['point'],
                arrMaps[_strMapIdx][i]['icon'],
                arrMaps[_strMapIdx][i]['html'],
                !i
            );
        }
    }
}

/*--------------------
 * OVERLAY OPEN
 *------------------*/

function _emOverlayOpen(_objContent, _objOptions, _fnCallback)
{
    var arrPageScroll = getPageScroll();
    var arrPageSize = getPageSize();

    if (document.getElementById('emBox')) {
         //_emOverlayClose();
    } else {
        var intHeight = _objOptions.height || _objContent.height();
        var intWidth = _objOptions.width || _objContent.width();
        var intTop = _objOptions.top || (arrPageSize[3] / 2) - (intHeight / 2) + arrPageScroll[1];
        var intLeft = _objOptions.left || (arrPageSize[2] / 2) - (intWidth / 2);
        var intSpeed = _objOptions.speed || 200;
        var intSpeedBg = _objOptions.speedBg || intSpeed;
        var intSpeedCnt = _objOptions.speedCnt || intSpeed;
        var strType = _objOptions.content || '';


        var intAdHeight =  jQuery("#em_ad_superbanner").height();
        if(intTop < (120 + intAdHeight) && strType != 'alert') {
            intTop = 120 + intAdHeight;
        }

        jQuery("embed, object, select").css({ "visibility" : "hidden" });

        var objBoxBg = jQuery('<div>')
            .attr('id', 'emBoxBg')
            .css({
                'display' : 'none',
                'position' : 'absolute',
                'z-index' : '99980',
                'background-color' : '#E9E8E5',
                'left' : '0px',
                'top' : '0px',
                'height' : arrPageSize[1] + 'px',
                'width' : arrPageSize[2] + 'px',
                'opacity' : 0.7
            })
            .click(emBoxClose)
            .append(jQuery('<br>'));
        jQuery('body:first').append(objBoxBg);

        var objBox = jQuery('<div>')
            .attr('id', 'emBox')
            .css({
                'display' : 'none',
                'position' : 'absolute',
                'z-index' : '99990',
                'left' : intLeft + 'px',
                'top' : intTop + 'px'
            });


        if (_objOptions.setWidth) {
            objBox.css('width', intWidth + 'px');
        }
        if (_objOptions.setHeight) {
            objBox.css('height', intHeight + 'px');
        }
        jQuery('body:first').append(objBox);

        objBox.append(_objContent);

        objBoxBg.fadeIn(intSpeed, function() { objBox.fadeIn(intSpeed, _fnCallback); });
    }
}

function _emOverlayClose(_intWait)
{
    jQuery('#emBox')
        .animate({'opacity' : 1}, _intWait)
        .fadeOut(
            200,
            function() {
                jQuery('#emBox').remove();
                if (document.getElementById('emBoxBg')) {
                    jQuery('#emBoxBg').fadeOut(
                        200,
                        function() {
                            jQuery('#emBoxBg').remove();
                            jQuery("embed, object, select").css({ "visibility" : "visible" });
                        }
                    );
                }
            }
        );

}

function emBoxClose()
{
    _emOverlayClose();
}

function emBoxOpen(objElement)
{
    var strType = jQuery(this).attr('class');
    if(strType == undefined) {
        var strType = objElement.attr('class');
    }

    var intFrameWidth = 0;
    var intFrameHeight = 0;
    var bolCreateIframe = false;
    var objOptions = {};

    if (document.getElementById('emBox')) {
         emBoxClose();
    } else {
        if (strType.match(/(^| )imagesend( |$)/)) {
            objOptions.top = objElement.pageY - 20 - 280;
            objOptions.left = objElement.pageX - 20 - 380;
        }

        if (strType.match(/(^| )em_box_iframe( |$)/)) {
            bolCreateIframe = true;
            intFrameWidth = 420;
            intFrameHeight = 280;
        } else if (strType.match(/(^| )em_box_map( |$)/)) {
            bolCreateIframe = true;
            intFrameWidth = 957;
            intFrameHeight = 660;
        } else if (strType.match(/(^| )em_box_image( |$)/)) {
            bolCreateIframe = false;
            var thisImage = objElement.attr('href');
            intFrameWidth = 560;
            intFrameHeight = 430;
        } else if (strType.match(/(^| )em_box_innercontent_(.*)( |$)/)) {
            bolCreateIframe = false;
            jQuery('#' + RegExp.$2).show();
        }

        if (bolCreateIframe) {
            objOptions.height = intFrameHeight;
            objOptions.width = intFrameWidth;

            var objFrame = jQuery('<iframe class="emBoxIframe" scrolling="no" frameborder="0" src="' + jQuery(this).attr('href')
                + '" style="border: 0px none; margin: 0px; padding: 0px; width: ' + intFrameWidth + 'px; height: '
                + intFrameHeight + 'px;" border="0" marginheight="0" marginwidth="0"></iframe>');

            _emOverlayOpen(objFrame, objOptions);
        } else if (strType.match(/(^| )em_box_image( |$)/)) {

            objOptions.height = intFrameHeight;
            objOptions.width = intFrameWidth;

            var strImgHeight = "";
            var strImgWidth = "";
            strImgHeight = jQuery("#em_img_orig_size").css('height');
            strImgWidth = jQuery("#em_img_orig_size").css('width');

            if (strImgHeight) {
                strImgHeight = "height:"+strImgHeight+";";
            }
            if (strImgWidth) {
                strImgWidth = "width:"+strImgWidth+";";
            }

            var objFrame = jQuery('<div id="em_image_big_container" style="overflow:visible; text-align: right;"><img src="' + objElement.attr('href')
                + '" style="border: 0px none; margin: 0px; padding: 0px;" border="0" id="em_image_big" /></div>'
                + '<div class="em_clear" style="height: 8px;"><br/></div><div id="em_image_big_caption" style="' + strImgWidth + '">' + objElement.attr('title') + '</div>'
                + '<div class="em_clear"><br/></div>'
                + '<a href="javascript:emBoxClose();"><img src="http://www.nw-news.de/_em_daten/nw/_layout/lightbox-btn-close.gif" border="0"/></a>');

            _emOverlayOpen(objFrame, objOptions);

//            jQuery("#em_image_big_container").css("width", intFrameWidth + "px");
//            jQuery("#em_image_big").css("width", intFrameWidth + "px");
//            jQuery("#em_image_big_caption").css("width", intFrameWidth + "px");
        }
    }
    return false;
}

/**
 * VIDEO IN GALLERY
 */

function em_load_video_gallery(zoom, video, mediaid, width, height)
{
    var em_newvideo = new SWFObject("/_em_oas/_locals/owl/images/video/em_player.swf", "em_video_gallery", "100%", "100%", "8");
    em_newvideo.addVariable("id", mediaid);
    em_newvideo.addVariable("playerskin", "/_em_oas/_locals/owl/images/video/skin_max.swf");
    em_newvideo.addVariable("playerskin2", "/_em_oas/_locals/owl/images/video/skin_max.swf");
    em_newvideo.addVariable("autoplay", "0");
    em_newvideo.addVariable("zoommax", zoom ? "1" : "0");
    em_newvideo.addVariable("playervolume", "50");
    em_newvideo.addVariable("playerwidth", width);
    em_newvideo.addVariable("playerwidthmax", width);
    em_newvideo.addVariable("buffertime", "2");
    em_newvideo.addVariable("contentvideo", "/" + video + "?nocache=1245224432");
    em_newvideo.addVariable("btn_farbwert", "0xD71920");
    em_newvideo.addVariable("hg_farbwert", "");
    em_newvideo.addVariable("overlay", "0");
    em_newvideo.addParam("wmode", "transparent");
    em_newvideo.addParam("allowScriptAccess", "always");
    em_newvideo.addVariable("icon_farbwert", "0xffffff");
    em_newvideo.addVariable("Fullscreen","1");
    em_newvideo.addVariable("autohide", "0");
    em_newvideo.addVariable("hg_farbwert_fullscreen", "0x000000");
    em_newvideo.addVariable("hg_alpha", "100");
    em_newvideo.addParam("allowFullScreen", "true");
    em_newvideo.addParam("scale", "noscale");
    em_newvideo.addParam("salign", "LT");
    em_newvideo.write(mediaid);
}

/*--------------------
 * SEARCH VALIDATION
 *------------------*/

function search(_form)
{
    var objSearchBox = jQuery('#' + _form + ' .em_form_user_login');
    var strSearchText = objSearchBox.val();
	if (strSearchText == ''
	||  strSearchText == 'Suche'
	) {
		objSearchBox.focus();
		return false;
	}
}

/*--------------------
 * ANIMATIONS
 *------------------*/

function emSlideDown(strObject, fnCallback)
{
    jQuery(strObject).slideDown(500, fnCallback);
}

function emSlideUp(strObject, fnCallback)
{
    jQuery(strObject).slideUp(500, fnCallback);
}

function emSlideToggle(strObject, fnCallback)
{
    jQuery(strObject).slideToggle(500, fnCallback);
}

function emFadeIn(strObject, fnCallback)
{
    jQuery(strObject).fadeIn(500, fnCallback);
}

function emToggle(strObjectId)
{
    var strOpenId = '';
    jQuery('.em_toggle_box').each(function () {
        var objThis = jQuery(this);
        if (objThis.css('display') != 'none') {
            objThis.animate(
                {
                    'opacity' : 'toggle',
                    'height' : 'toggle'
                },
                500
            );
            strOpenId = '#' + objThis.attr('id');
        }
    });

    if (strOpenId != strObjectId) {
        jQuery(strObjectId).animate(
            {
                'opacity' : 'toggle',
                'height' : 'toggle'
            },
            500
        );
    }
}


var emSucheDetailsShowed = 0;
function emToggleSucheDetails()
{
    emToggle('#em_no_detail_search');
    emToggle('#em_detail_search');

    if (!emSucheDetailsShowed) {
        var srcIfr = jQuery('#em_suche_erweitert_src').attr('src');
        jQuery('#em_suche_erweitert_src').attr('src', srcIfr);
        emSucheDetailsShowed = 1;
    }
}

function alert(em_alert_txt){
    emShowMessageLayer(em_alert_txt);
}

function open(objElement, strName, strOptions){
    //alert("open: "+strName+" "+objElement+" "+strOptions);
    var strBoxContent = "";
    var objOptions = {};

	if (!strHeight) {
	    var strHeight = 0;

	    if (strOptions.match(/(^\s*|,)height=(\d+)(,|\s*$)/)) {
	        strHeight = RegExp.$2;
	    } else {
    	    strHeight = 350;
	    }
	}

	if (!strWidth) {
	    var strWidth = 0;

	    if (strOptions.match(/(^\s*|,)width=(\d+)(,|\s*$)/)) {
	        strWidth = RegExp.$2;

	    } else {
    	    strWidth = 600;
	    }
	}
    objOptions.height = strHeight;
    objOptions.width = strWidth;

    strBoxContent = "<iframe src=\"" + objElement + "\" scrolling=\"no\" style=\"width:" + strWidth + "px; height:" + strHeight + "px; frame-border: 0px; border: 0px; padding: 0px;\" border=\"0\" frameborder=\"0\" marginheight=\"0\" marginwidth=\"0\" scrolling=\"auto\" id=\"emBoxIf\" name=\"" + strName + "\"></iframe>";

    _emOverlayOpen(strBoxContent, objOptions);

    return false;
}

function emShowMessageLayer(_strInfoMsg)
{

    if (_strInfoMsg) {
        jQuery('div.info').each(function ()
            {
                _strInfoMsg+= jQuery(this).text() + '<br />';
            }
        );
        if (_strInfoMsg.length) {
            var objContent = jQuery('<div style="float: left; padding: 10px; font-weight: bold; width: 200px;">' + _strInfoMsg + '<\/div><div style="float: right; padding: 5px;"><img src="/_em_oas/_locals/owl/images/_layout/changed.png" border="0"><br/><br/><br/><\/div><div class="em_clear"><br\/><\/div><div style="position: absolute; right: 10px; bottom: 10px;"><a href="javascript:_emOverlayClose();" class="content_link_button"><img src=\"http://www.nw-news.de/_em_daten/nw/_layout/lightbox-btn-close.gif\" border=\"0\"/><\/a><\/div>');
            _emOverlayOpen(
                objContent,
                {
                    'height' : 200,
                    'width' : 300,
                    'setWidth' : true,
                    'content' : 'alert'
                },
                function()
                {

                }
            );
        }
    }
}


/*--------------------
 * Autorefresh if page has no focus
 *------------------*/

var em_hdlAutoRefresh = null;

function emAutoRefresh()
{
    jQuery(document)
        .blur(function()
        {
            _emAutoRefresh(1);
        })
        .focus(function()
        {
            _emAutoRefresh(0);
        }
    );
}

function _emAutoRefresh(_intAction)
{
    if (_intAction == 1) {
        _emAutoRefresh(0);
        em_hdlAutoRefresh = window.setInterval('_emAutoRefresh()',  5 * 60 * 1000);
    } else if (_intAction == 0) {
        if (em_hdlAutoRefresh) {
            clearInterval(em_hdlAutoRefresh);
            em_hdlAutoRefresh = null;
        }
    } else {
        var strHref = location.href.replace(/(&|\?)em_arf=1/, '');
        location.href = strHref + (strHref.match(/\?/) ? '&' : '?') + 'em_arf=1';
    }
}

/*--------------------
 * REMOVE EMPTY ADS
 *------------------*/

jQuery(document).ready(function() {
    jQuery("div.em_ad_rectangle").each(function()
    {
        if (jQuery(this).find("table").height() < 50) {
           jQuery(this).remove();
        }
    });
});

/*--------------------
 * NEW TO MERKBOX ANIMATION EFFECT
 *------------------*/

function emTransferAnimation(_intID) {
    var strId = "#em_ergebnis_nr_" + _intID;
    jQuery(strId).effect("transfer", { to: "#em_merkbox_transfer" }, 1000);
}


/*--------------------
 * CHANGE GOOGLE MARKER COLOR
 *------------------*/

function emHighlightMarker(_strId) {
    var strId = "#mtgt_" + _strId;
    jQuery(strId).attr("src", "/_em_oas/_locals/owl/images/_layout/em_gmap_pin_active.png");
}

function emHighlightMarkerDis(_strId) {
    var strId = "#mtgt_" + _strId;
    jQuery(strId).attr("src", "/_em_oas/_locals/owl/images/_layout/em_gmap_pin.png");
}

/*--------------------
 * CHANGE ANZEIGEN BG COLOR
 *------------------*/

function emHighlightObject(_strId) {
    var strId = "#em_ergebnis_nr_" + _strId;
    jQuery(strId + " .em_round_grey_top").attr("class", "em_round_grey_top_active");
    jQuery(strId + " .em_round_grey_bottom").attr("class", "em_round_grey_bottom_active");
    jQuery(strId + " .em_round_grey_body").attr("class", "em_round_grey_body_active");
}

function emHighlightObjectDis(_strId) {
    var strId = "#em_ergebnis_nr_" + _strId;

    jQuery(strId)
        .animate({'opacity' : 1}, 500, '',
            function() {
                    jQuery(strId + " .em_round_grey_top_active").attr("class", "em_round_grey_top");
                    jQuery(strId + " .em_round_grey_bottom_active").attr("class", "em_round_grey_bottom");
                    jQuery(strId + " .em_round_grey_body_active").attr("class", "em_round_grey_body");
                }
        );
}

/*--------------------
 * RESIZE OVERLAY
 *------------------*/


function emPlaceObjects(intWidth,intHeight) {
    var arrPageScroll = getPageScroll();
    var arrPageSize = getPageSize();
    var intMapHeight = intHeight;
    var frameTop = (arrPageSize[3] / 2) - (intMapHeight / 2) + arrPageScroll[1];
    var frameLeft = (arrPageSize[2] / 2) - (intWidth / 2);

    if(frameTop < 220) {
        frameTop = 220;
    }

    jQuery("#emBox").animate({"top":frameTop + "px"}, { duration: 200 });
    jQuery("#emBox").animate({"left":frameLeft + "px"}, { duration: 200 });
    jQuery("#emBoxIf").animate({"height":intHeight + 10 + "px" }, { duration: 200 });
    jQuery("#emBoxIf").animate({"width":intWidth + "px" }, { duration: 200 });
}


/*--------------------
 * WARTEFUNKTION
 *------------------*/

function emWaitOpen(_fnCallback)
{
    var arrPageScroll = getPageScroll();
    var arrPageSize = getPageSize();

    if (document.getElementById('emBoxWait')) {
         emWaitClose();
    } else {

        var intHeight = 50;
        var intWidth = 250;
        var intTop = (arrPageSize[3] / 2) - (intHeight / 2) + arrPageScroll[1];
        var intLeft = (arrPageSize[2] / 2) - (intWidth / 2);
        var intSpeed = 200;
        var intSpeedBg = intSpeed;
        var intSpeedCnt = intSpeed;

        if(intTop < 220) {
            intTop = 220;
        }

        jQuery("embed, object, select").css({ "visibility" : "hidden" });

        var objBoxBg = jQuery('<div>')
            .attr('id', 'emBgWait')
            .css({
                'display' : 'none',
                'position' : 'absolute',
                'z-index' : '99980',
                'background-color' : '#E9E8E5',
                'left' : '0px',
                'top' : '0px',
                'height' : arrPageSize[1] + 'px',
                'width' : arrPageSize[2] + 'px',
                'opacity' : 0.7
            })
            .append(jQuery('<br>'));
        jQuery('body:first').append(objBoxBg);

        var objBox = jQuery('<div>')
            .attr('id', 'emBoxWait')
            .css({
                'display' : 'none',
                'position' : 'absolute',
                'z-index' : '99990',
                'text-align' : 'center',
                'width' : '260px',
                'font-weight' : 'bold',
                'left' : intLeft + 'px',
                'top' : intTop + 'px'
            });

        jQuery('body:first').append(objBox);

        objBox.append("<img src=\"/_em_oas/_locals/owl/images/_layout/em_wait.gif\" border=\"0\" alt=\"Bitte Warten\"><br/><br/>Einen kleinen Moment Geduld. <br/> Ihre &Auml;nderungen werden &uuml;bernommen.");

        objBoxBg.fadeIn(intSpeed, function() { objBox.fadeIn(intSpeed, _fnCallback); });
    }
}

function emWaitClose(_intWait)
{
    jQuery('#emBoxWait')
        .animate({'opacity' : 1}, _intWait)
        .fadeOut(
            200,
            function() {
                jQuery('#emBoxWait').remove();
                if (document.getElementById('emBgWait')) {
                    jQuery('#emBgWait').fadeOut(
                        200,
                        function() {
                            jQuery('#emBgWait').remove();
                            jQuery("embed, object, select").css({ "visibility" : "visible" });
                        }
                    );
                }
            }
        );
}


/*--------------------
 * process global function when document is ready
 *------------------*/

jQuery(document).ready(function() {

    jQuery(".togglevalue").toggleVal();

    if (document.getElementById("em_map")) {
        jQuery('#em_map').show();
    }

	emInitFacebox();

    emShowMessageLayer();

    jQuery('img, div, #em_body').ifixpng();

});


/* FILE: /_em_oas/jslibs/jquery/jquery.corner.js (Modified: Wed, 16 Jun 2010 09:36:40) */
/*!
 * jQuery corner plugin: simple corner rounding
 * Examples and documentation at: http://jquery.malsup.com/corner/
 * version 1.98 (02-JUN-2009)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 */

/**
 *  corner() takes a single string argument:  $('#myDiv').corner("effect corners width")
 *
 *  effect:  name of the effect to apply, such as round, bevel, notch, bite, etc (default is round).
 *  corners: one or more of: top, bottom, tr, tl, br, or bl.
 *           by default, all four corners are adorned.
 *  width:   width of the effect; in the case of rounded corners this is the radius.
 *           specify this value using the px suffix such as 10px (and yes, it must be pixels).
 *
 * @name corner
 * @type jQuery
 * @param String options Options which control the corner style
 * @cat Plugins/Corner
 * @return jQuery
 * @author Dave Methvin (http://methvin.com/jquery/jq-corner.html)
 * @author Mike Alsup   (http://jquery.malsup.com/corner/)
 */
;(function($){var expr=(function(){if(!$.browser.msie)return false;var div=document.createElement('div');try{div.style.setExpression('width','0+0');}
catch(e){return false;}
return true;})();function sz(el,p){return parseInt($.css(el,p))||0;};function hex2(s){var s=parseInt(s).toString(16);return(s.length<2)?'0'+s:s;};function gpc(node){for(;node&&node.nodeName.toLowerCase()!='html';node=node.parentNode){var v=$.css(node,'backgroundColor');if(v=='rgba(0, 0, 0, 0)')
continue;if(v.indexOf('rgb')>=0){var rgb=v.match(/\d+/g);return'#'+hex2(rgb[0])+hex2(rgb[1])+hex2(rgb[2]);}
if(v&&v!='transparent')
return v;}
return'#ffffff';};function getWidth(fx,i,width){switch(fx){case'round':return Math.round(width*(1-Math.cos(Math.asin(i/width))));case'cool':return Math.round(width*(1+Math.cos(Math.asin(i/width))));case'sharp':return Math.round(width*(1-Math.cos(Math.acos(i/width))));case'bite':return Math.round(width*(Math.cos(Math.asin((width-i-1)/width))));case'slide':return Math.round(width*(Math.atan2(i,width/i)));case'jut':return Math.round(width*(Math.atan2(width,(width-i-1))));case'curl':return Math.round(width*(Math.atan(i)));case'tear':return Math.round(width*(Math.cos(i)));case'wicked':return Math.round(width*(Math.tan(i)));case'long':return Math.round(width*(Math.sqrt(i)));case'sculpt':return Math.round(width*(Math.log((width-i-1),width)));case'dog':return(i&1)?(i+1):width;case'dog2':return(i&2)?(i+1):width;case'dog3':return(i&3)?(i+1):width;case'fray':return(i%2)*width;case'notch':return width;case'bevel':return i+1;}};$.fn.corner=function(o){if(this.length==0){if(!$.isReady&&this.selector){var s=this.selector,c=this.context;$(function(){$(s,c).corner(o);});}
return this;}
o=(o||"").toLowerCase();var keep=/keep/.test(o);var cc=((o.match(/cc:(#[0-9a-f]+)/)||[])[1]);var sc=((o.match(/sc:(#[0-9a-f]+)/)||[])[1]);var width=parseInt((o.match(/(\d+)px/)||[])[1])||10;var re=/round|bevel|notch|bite|cool|sharp|slide|jut|curl|tear|fray|wicked|sculpt|long|dog3|dog2|dog/;var fx=((o.match(re)||['round'])[0]);var edges={T:0,B:1};var opts={TL:/top|tl/.test(o),TR:/top|tr/.test(o),BL:/bottom|bl/.test(o),BR:/bottom|br/.test(o)};if(!opts.TL&&!opts.TR&&!opts.BL&&!opts.BR)
opts={TL:1,TR:1,BL:1,BR:1};var strip=document.createElement('div');strip.style.overflow='hidden';strip.style.height='1px';strip.style.backgroundColor=sc||'transparent';strip.style.borderStyle='solid';return this.each(function(index){var pad={T:parseInt($.css(this,'paddingTop'))||0,R:parseInt($.css(this,'paddingRight'))||0,B:parseInt($.css(this,'paddingBottom'))||0,L:parseInt($.css(this,'paddingLeft'))||0};if(typeof this.style.zoom!=undefined)this.style.zoom=1;if(!keep)this.style.border='none';strip.style.borderColor=cc||gpc(this.parentNode);var cssHeight=$.curCSS(this,'height');for(var j in edges){var bot=edges[j];if((bot&&(opts.BL||opts.BR))||(!bot&&(opts.TL||opts.TR))){strip.style.borderStyle='none '+(opts[j+'R']?'solid':'none')+' none '+(opts[j+'L']?'solid':'none');var d=document.createElement('div');$(d).addClass('jquery-corner');var ds=d.style;bot?this.appendChild(d):this.insertBefore(d,this.firstChild);if(bot&&cssHeight!='auto'){if($.css(this,'position')=='static')
this.style.position='relative';ds.position='absolute';ds.bottom=ds.left=ds.padding=ds.margin='0';if(expr)
ds.setExpression('width','this.parentNode.offsetWidth');else
ds.width='100%';}
else if(!bot&&$.browser.msie){if($.css(this,'position')=='static')
this.style.position='relative';ds.position='absolute';ds.top=ds.left=ds.right=ds.padding=ds.margin='0';if(expr){var bw=sz(this,'borderLeftWidth')+sz(this,'borderRightWidth');ds.setExpression('width','this.parentNode.offsetWidth - '+bw+'+ "px"');}
else
ds.width='100%';}
else{ds.margin=!bot?'-'+pad.T+'px -'+pad.R+'px '+(pad.T-width)+'px -'+pad.L+'px':(pad.B-width)+'px -'+pad.R+'px -'+pad.B+'px -'+pad.L+'px';}
for(var i=0;i<width;i++){var w=Math.max(0,getWidth(fx,i,width));var e=strip.cloneNode(false);e.style.borderWidth='0 '+(opts[j+'R']?w:0)+'px 0 '+(opts[j+'L']?w:0)+'px';bot?d.appendChild(e):d.insertBefore(e,d.firstChild);}}}});};$.fn.uncorner=function(){$('div.jquery-corner',this).remove();return this;};})(jQuery);

