// (c) 2009 tricos media. All rights reserved.
// JavaScript auto-compressed @ 19.10.2009 14:42:53 GMT
var halloweeniesClass=Class.create({page:null,blowupPhotoContainer:null,blowupVisible:false,articleListX:null,openedArticle:null,shippingInfoImageUrl:'http://www.horrorklinik.de/product_images/images/versandInfos_de.gif',twistedAmbienceElements:null,map:null,geocoder:null,hauntIcon:null,eventIcon:null,partyIcon:null,eventAddCache:null,geoObject:null,colors:['F39F12','ff8000','c40000','dd4772','c726d9','0000c4','1580ea','008040','00c400','88aa55','666666','000000'],currentPickedColor:'c40000',initialize:function(){tricosUtils=new tricosUtilsClass($('main'),'/img/ajaxloader.gif');if($('geoInfo')!=null){this.geoObject=new tricosGeoClass();this.geoMM(function(data){var city=data.city;var long=data.long;var lat=data.lat;if($('geoInfo').hasClassName('geo_home')){var addsHtml='';if(this.geoObject.supportsGeolocation){var addsHtml='<br /><a href="#" id="geoLocateMe" style="font-size:11px;color:#666">Ich befinde mich gar nicht in '+city+', meine Position bitte genauer lokalisieren!</a><div id="geoLoader" style="margin-top:3px;font-size:11px;color:#c40000;display:none"><img src="/img/loader_geo.gif" alt="" style="vertical-align:text-top;margin-right:3px">Lokalisierung erfolgt - bitte warten...</div>'}$('geoInfo').update('<a id="geoLocateCustomLink" href="/events.html#'+long+','+lat+','+encodeURIComponent(city)+'">Jetzt Halloween-Events <strong>in der Nähe von '+city+'</strong> und in ganz Deutschland finden!</a>'+addsHtml);this.initHomeContent($('geoInfo').getHeight());if(addsHtml!=''){$('geoLocateMe').observe('click',function(e){$('geoLoader').show();$('geoLocateMe').hide();this.geoObject.find(function(pos){if(pos!=null){this.getReverseGeo(pos.coords.latitude,pos.coords.longitude,function(cityName){if(cityName==null){cityName='*unbekannt*'}$('geoLocateMe').hide();$('geoLoader').hide();$('geoInfo').update('<a id="geoLocateCustomLink" href="/events.html#'+pos.coords.longitude+','+pos.coords.latitude+','+encodeURIComponent(cityName)+'">Jetzt Halloween-Events <strong>in der Nähe von '+cityName+'</strong> und in ganz Deutschland finden!</a>')})}else{$('geoLocateMe').show();$('geoLoader').hide();alert('Schade, wir konnten Dich nicht genauer lokalisieren.')}}.bindAsEventListener(this))}.bindAsEventListener(this))}}$('geoInfo').show()}.bind(this))}if(typeof hwGeoData!='undefined'){alert(hwGeoData)}this.eventAddCache=new Array();if($('shop')!=null){if($('shop').hasClassName('singlearticle')){this.page='shop_article'}this.initShop()}if($('editor')!=null){$('editForm').observe('submit',this.handleImageFactoryRequest.bindAsEventListener(this));$('editForm').down('input[name=preview]').observe('click',this.handleImageFactoryRequest.bindAsEventListener(this));$('editForm').down('input[name=download]').observe('click',this.handleImageFactoryRequest.bindAsEventListener(this));$('fontSelector').select('a').each(function(lnk){lnk.observe('click',this.handleImageFactoryFont.bindAsEventListener(this))}.bind(this));$('fontSelectbox').observe('click',function(e){this.blur();this.disable();$('fontSelector').show()});if($('picker')!=null){var colors=this.colors;colors.each(function(col){var color=new Element('div',{id:'color_'+col});$('picker').appendChild(color);color.setStyle({border:'2px solid #888',width:'16px',height:'16px',float:'left',marginRight:'2px',backgroundColor:'#'+col,cursor:'pointer'});color.observe('click',this.pickColor.bindAsEventListener(this))}.bind(this))}if($('previewImg')!=null){$('previewImg').observe('load',function(){$('factoryIndicator').hide()})}var gallery=$('generatorgallery');if(gallery!=null){var imgLinks=gallery.select('a');if(imgLinks.length>0){imgLinks.each(function(imgLink){imgLink.observe('click',this.handleFactoryGalleryClick.bindAsEventListener(this))}.bind(this))}}}var shippingInfoLinks=$('main').select('a.shippingInfo');if(shippingInfoLinks.length>0){shippingInfoLinks.each(function(lnk){lnk.observe('click',this.showShippingInfo.bindAsEventListener(this))}.bind(this));var orderLinks=$$('span.order a');if(orderLinks.length>0){var orderLink=orderLinks[0];orderLink.observe('click',function(e){var linkEl=Event.element(e);Event.stop(e);if(!tricosUtils.getcookie('partnerinfo')){var el=new Element('div',{id:'redirectInfo'});$(document.body).appendChild(el);el.setStyle({position:'absolute',zIndex:20000});el.update('<img src="/img/logo-horrorklinik.gif" alt="" border="0" /><br /><div style="padding:8px"><h2 style="color:#c40000">Sie werden nun zu unserem Partnershop weitergeleitet...</h2><h2>Dort können Sie diesen Artikel direkt bestellen.</h2><img src="/img/ajaxloader_redirect.gif" alt="" border="0" /><br /><em>Mit jedem Kauf eines Artikels bei unserem Partner über halloweenies.de unterstützen Sie uns!</em></div>');tricosUtils.showPane(function(){tricosUtils.centerDivInDiv(el,$('pane'),0,0);el.show();window.setTimeout(function(t){this.setCookie('partnerinfo',1,3600*24);top.location.href='http://'+location.hostname+'/shop/clickthrough?target='+encodeURIComponent(linkEl.getAttribute('href'))}.bind(this),10000)}.bind(this))}else{top.location.href='http://'+location.hostname+'/shop/clickthrough?target='+encodeURIComponent(linkEl.getAttribute('href'))}}.bindAsEventListener(this))}}var blowupImages=$$('a.click2blowup');if(blowupImages.length>0){blowupImages.each(function(i){i.observe('click',this.handleClick2BlowupPhoto.bindAsEventListener(this))}.bind(this))}var zoomBoxes=$$('div.zoombox');if(zoomBoxes.length>0){zoomBoxes.each(function(box){box.observe('click',this.zoomFromImage.bindAsEventListener(this))}.bind(this))}if($('costumeLink')!=null){$('costumeLink').hide();$('pleaseWait').show();new Ajax.Updater('ajaxContainer','/kostueme/ajax.php',{onComplete:function(){$('pleaseWait').hide();halloweenies.resizeNavbar()}})}if($('twistedambience')!=null){if(Prototype.Browser.Gecko){$('twistedAmbienceFrame').show()}this.twistedAmbienceElements=new Array();var taLinks=$('twistedambience').select('a');taLinks.each(function(taLink){var str=taLink.classNames().toString();this.twistedAmbienceElements.push(str);taLink.observe('click',this.showTaMovie.bindAsEventListener(this))}.bind(this))}if($('homeContent')!=null){this.initHomeContent()}this.resizeNavbar();if($('socialbox')!=null){var frmFields=$('socialbox').select('input');if(frmFields.length>0){frmFields.each(function(f){f.observe('click',function(e){var o=Event.element(e);o.focus();o.select()})})}}var hiddenLinkElements=$$('span.hiddenJSLink');if(hiddenLinkElements.length>0){hiddenLinkElements.each(function(el){if(typeof el.title!='undefined'){var elId='';if(typeof el.id!='undefined'){elId=el.id}var targt='_self';if(el.hasClassName('t_blank')){targt='_blank'}var newLink=new Element('a');if(elId!=''){newLink.setAttribute('id',elId)}var classNames=$w(el.className);classNames.each(function(cls){if(cls!='hiddenJSLink'){newLink.addClassName(cls)}});newLink.update(el.innerHTML);newLink.setAttribute('href',el.title);newLink.setAttribute('target',targt);Element.replace(el,newLink)}})}if($('eventMap')!=null){if($('mapNav')!=null){$('mapNav').down('a.reset').observe('click',this.mapShowGermany.bindAsEventListener(this));$('mapNav').down('a.myloc').observe('click',this.mapShowMyLocation.bindAsEventListener(this))}if(GBrowserIsCompatible()){var mapOptions={googleBarOptions:{style:"new"}};var locationData=this.getLocationFromUrl();this.map=new GMap2($("eventMap"));if(locationData!=null){this.map.setCenter(new GLatLng(locationData.lat,locationData.long),10)}else{this.map.setCenter(new GLatLng(51.165,10.455278),6)}this.map.setUIToDefault();this.map.enableGoogleBar();document.body.onUnload=GUnload;this.geocoder=new GClientGeocoder();this.geocoder.setBaseCountryCode('de');this.hauntIcon=new GIcon(G_DEFAULT_ICON);this.hauntIcon.image='http://'+location.hostname+'/img/eventmap/homehaunt.png';this.hauntIcon.shadow=null;this.hauntIcon.iconSize=new GSize(25,28);this.hauntIcon.shadowSize=new GSize(60,26);this.partyIcon=new GIcon(G_DEFAULT_ICON);this.partyIcon.image='http://'+location.hostname+'/img/eventmap/party.png';this.partyIcon.shadow=null;this.partyIcon.iconSize=new GSize(15,31);this.partyIcon.shadowSize=new GSize(38,28);this.eventIcon=new GIcon(G_DEFAULT_ICON);this.eventIcon.image='http://'+location.hostname+'/img/eventmap/event.png';this.eventIcon.shadow=null;'http://'+location.hostname+'/img/eventmap/event_s.png';this.eventIcon.iconSize=new GSize(29,26);this.eventIcon.shadowSize=new GSize(67,24);new Ajax.Request('/ajaxGetEvents.php',{onComplete:function(req){if(req.status==200){if(req.responseJSON){var events=req.responseJSON;events.each(function(evnt){var p=new GLatLng(evnt.long,evnt.lat);var m=this.getMapMarkerByType(evnt.type,p);GEvent.addListener(m,'click',function(){this.handleMarkerClick(evnt.id,m)}.bind(this));this.map.addOverlay(m)}.bind(this))}}}.bind(this)})}if($('eventForm')!=null){$('eventForm').observe('submit',this.handleEventFormSubmit.bindAsEventListener(this));$('eventForm').down('input[type=submit]').observe('click',this.handleEventFormSubmit.bindAsEventListener(this))}}if($('halloweenEventList')!=null){var mapLinks=$('halloweenEventList').select('a.maplink');if(mapLinks.length>0){mapLinks.each(function(mapLink){mapLink.observe('click',function(e){var el=Event.element(e);Event.stop(e);top.location.href=el.getAttribute('href');var locationData=this.getLocationFromUrl();this.map.setCenter(new GLatLng(locationData.lat,locationData.long),11);top.location.href='#map'}.bindAsEventListener(this))}.bind(this))}}},setCookie:function(name,value,expires){var domain=location.hostname;domain=domain.replace(/^www\./,'');tricosUtils.setrawcookie(name,value,expires,'/','.'+domain,false)},pickColor:function(e){var el=Event.element(e);Event.stop(e);this.colors.each(function(color){$('color_'+color).setStyle({border:'2px solid #666'})});el.setStyle({border:'2px solid #c40000'});var col=el.id;col=col.replace(/^color_/,'');this.currentPickedColor=col;this.updateFactoryImage()},mapShowGermany:function(e){Event.stop(e);this.map.setCenter(new GLatLng(51.165,10.455278),6)},mapShowLocation:function(long,lat){this.map.setCenter(new GLatLng(lat,long),11)},mapShowMyLocation:function(e){Event.stop(e);this.geoMM(function(data){this.mapShowLocation(data.long,data.lat)}.bind(this))},getReverseGeo:function(long,lat,callback){new Ajax.Request('/dynamic/geoCity',{parameters:{long:long,lat:lat},method:'GET',onComplete:function(req){if(req.status==200){callback(req.responseText)}else{callback(null)}}})},updateFactoryImage:function(){var eType=$('ed_type').getValue();var eNumber=$('ed_number').getValue();var eFont=$('fontSelectbox').getValue();var eColor=this.currentPickedColor;var url='/dynamic/factory?type='+eType+'&no='+eNumber+'&action=preview&text='+encodeURIComponent($('toolboxText').getValue())+'&font='+eFont+'&color='+eColor;$('factoryIndicator').show();$('previewImg').src=url},handleImageFactoryRequest:function(e){var el=Event.element(e);Event.stop(e);if(el.getAttribute('name')=='preview'){this.updateFactoryImage()}else if(el.getAttribute('name')=='download'){top.location.href='/dynamic/factory?type='+$('ed_type').getValue()+'&no='+$('ed_number').getValue()+'&action=download&text='+encodeURIComponent($('toolboxText').getValue())+'&font='+$('fontSelectbox').getValue()+'&color='+this.currentPickedColor}},handleImageFactoryFont:function(e){var el=Event.element(e);Event.stop(e);if(el.tagName.toLowerCase()!='a'){el=el.up('a')}var lnk=el.getAttribute('id');lnk=lnk.replace(/^edlnk_/,'');$('fontSelector').hide();$('fontSelectbox').enable();$('fontSelectbox').setValue(lnk);this.updateFactoryImage()},handleFactoryGalleryClick:function(e){var el=Event.element(e);Event.stop(e);if(el.tagName.toLowerCase()!='a'){el=el.up('a')}var m=el.getAttribute('id').match(/^(tischkarten)_([0-9]+)$/);var eType=m[1];var eId=m[2];$('ed_type').setValue(eType);$('ed_number').setValue(eId);this.updateFactoryImage()},getLocationFromUrl:function(){var ret=null;var h=window.location.hash;var long=null;var lat=null;var city=null;if(h.length>1){var m=h.match(/^#([0-9\.]+),([0-9\.]+)(.*)$/);if(m){var long=m[1];var lat=m[2];var city=null;if(m[3]){var m1=m[3].match(/^,(.+)$/);if(m1){var city=m1[1]}}var ret={city:city,long:long,lat:lat}}}return ret},geoMM:function(callback){new Ajax.Request('/ajaxGeo.json',{method:'GET',onComplete:function(req){if(req.responseCode=200){callback(req.responseJSON)}else{callback(null)}}.bind(this)})},initHomeContent:function(additionalHeight){var hc=$('homeContent');var hgt=hc.getHeight();$('homeContentBox').setStyle({height:hgt+'px'});hgt=hc.getHeight();if(additionalHeight!=null){hgt+=additionalHeight}$('homeContent').down('div.world').setStyle({height:hgt+'px'});$('main').select('div.transHomeBox').each(function(bb){})},handleMarkerClick:function(eventId,marker){new Ajax.Request('/ajaxGetEventInfo_'+eventId+'.json',{method:'get',onComplete:function(req){if(req.status==200){var obj=req.responseJSON;var p=new GLatLng(obj.long,obj.lat);var tabs=[];var urlText='';if(obj.url!=null&&obj.url!=''){urlText='<br /><a href="'+obj.url+'" target="_blank">Zur Website</a>'}urlText+='&nbsp;&nbsp;<a href="/events/route?event='+eventId+'" rel="nofollow" target="_blank">Route planen</a>';urlText+='&nbsp;&nbsp;<a href="/halloweenshop-kostueme.html" target="_blank">Kostüm kaufen</a>';var imgType='haunt';if(obj.type=='PARTY'){imgType='party'}else if(obj.type=='EVENT'){imgType='event'}if(obj.district!=''){var districtText=' ('+obj.district+') '}else{var districtText=''}tabs.push(new GInfoWindowTab('Ort','<div style="width:400px"><img src="/img/eventmap/'+imgType+'.gif" alt="" style="margin-right:6px;margin-bottom:6px;float:left" /><strong>'+obj.title+'</strong><br />'+obj.street+'<br />'+obj.zipcode+' '+obj.city+districtText+'<br />'+urlText+'&nbsp;&nbsp;&nbsp;<span style="font-size:9px">EventId #'+obj.id+'</span><div style="clear:both"></div></div>'));if(obj.description!=''){tabs.push(new GInfoWindowTab('Beschreibung','<div style="width:400px">'+obj.description+'</div>'))}marker.openInfoWindowTabsHtml(tabs)}else{alert('FEHLER: Daten konnten nicht geladen werden.')}}})},getMapMarkerByType:function(eType,point){if(eType=='HAUNT'){var marker=new GMarker(point,{icon:this.hauntIcon})}else if(eType=='PARTY'){var marker=new GMarker(point,{icon:this.partyIcon})}else{var marker=new GMarker(point,{icon:this.eventIcon})}return marker},handleEventFormSubmit:function(e){Event.stop(e);var frm=$('eventForm');var eTitle=frm.down('input[name=title]').getValue();var eType=frm.down('select[name=type]').getValue();var eDesc=frm.down('textarea').getValue();var eLoc=frm.down('input[name=location]').getValue();var eUrl=frm.down('input[name=url]').getValue();if(eTitle.length!=0&&eType!=''&&eLoc.length!=0){this.geocoder.getLocations(eLoc,function(response){var place=response.Placemark[0];var point=new GLatLng(place.Point.coordinates[1],place.Point.coordinates[0]);this.eventAddCache.push({id:this.eventAddCache.length+1,title:eTitle,eType:eType,desc:eDesc,loc:eLoc,url:eUrl,place:place});if(!point){alert(eLoc+" wurde nicht gefunden - bitte Adresse prüfen und neu versuchen!")}else{this.map.setCenter(point,16);if(eType=='haunt'){var marker=new GMarker(point,{icon:this.hauntIcon})}else if(eType=='party'){var marker=new GMarker(point,{icon:this.partyIcon})}else{var marker=new GMarker(point,{icon:this.eventIcon})}marker.title=eTitle;this.map.addOverlay(marker);marker.openInfoWindowHtml('<strong>'+eTitle+'</strong><br />Bitte hier klicken zur Bestätigung der (einigermaßen) korrekten Position:<br /><a href="#" onclick="halloweenies.saveEventEx(halloweenies.eventAddCache.length, this)">Event speichern!</a>');location.href='#map'}}.bind(halloweenies))}},saveEventEx:function(eventId,linkEl){var evnt=this.eventAddCache[eventId-1];var params=evnt;params.geo_accuracy=evnt.place.AddressDetails.Accuracy;params.geo_country=evnt.place.AddressDetails.Country.CountryName;params.geo_state=evnt.place.AddressDetails.Country.AdministrativeArea.AdministrativeAreaName;if(typeof evnt.place.AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.Locality!='undefined'){if(typeof evnt.place.AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.Locality.DependentLocality!='undefined'){params.geo_district=evnt.place.AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.Locality.DependentLocality.DependentLocalityName;if(typeof evnt.place.AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.Locality.DependentLocality.PostalCode!='undefined'){params.geo_zipcode=evnt.place.AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.Locality.DependentLocality.PostalCode.PostalCodeNumber}if(typeof evnt.place.AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.Locality.DependentLocality.Thoroughfare!='undefined'){params.geo_street=evnt.place.AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.Locality.DependentLocality.Thoroughfare.ThoroughfareName}}params.geo_city=evnt.place.AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.Locality.LocalityName}params.geo_long=evnt.place.Point.coordinates[1];params.geo_lat=evnt.place.Point.coordinates[0];new Ajax.Request('/ajaxSaveEvent.php',{method:'post',parameters:params,onComplete:function(req){if(req.status!=200){alert('Event konnte nicht gespeichert werden (1) - bitte versuche es später noch einmal!')}else{if(req.responseText=='ERROR'){alert('Event konnte nicht gespeichert werden (2) - bitte versuche es später noch einmal!')}else{alert("Vielen Dank, nach redaktioneller Prüfung wird der Event hier angezeigt.\nDies kann einige Stunden dauern.");top.location.href='/events.html?rnd='+Math.random()}}}})},resizeNavbar:function(){var contentContainer=$('content').down('div.contentContainer');if(contentContainer!=null){var hgt=contentContainer.getHeight();var navBars=$$('div.dynaNav');if(navBars.length!=0){navBars.each(function(navBar){navBar.setStyle({height:hgt+'px'})})}}},showTaMovie:function(e){var el=Event.element(e);Event.stop(e);var elId=el.classNames().toString();this.twistedAmbienceElements.each(function(eli){$(eli).hide();$('twistedambience').select('a').each(function(elg){elg.removeClassName('active');if(elg.classNames().toString()==elId){elg.addClassName('active')}}.bind(this))});$(elId).show()},zoomFromImage:function(e){var el=Event.element(e);Event.stop(e);var mainDiv=el.up('div.zoombox');var mainLink=mainDiv.down('a').getAttribute('href');this.blowupPhoto(mainLink)},initShop:function(){if(this.page=='shop_article'){var magnifyEl=$('shop').down('div.photomagnify');if(magnifyEl!=null){magnifyEl.show();var articlePhotoEl=magnifyEl.up('div.articlephoto');var photoLinkEl=articlePhotoEl.down('div.photo').down('a');var photoLink=photoLinkEl.getAttribute('href');photoLinkEl.observe('click',this.handleBlowupPhoto.bindAsEventListener(this));var magnifyLinks=magnifyEl.select('a').each(function(lnk){lnk.href=photoLink;lnk.observe('click',this.handleBlowupPhoto.bindAsEventListener(this))}.bind(this))}}},handleClick2BlowupPhoto:function(e){var el=Event.element(e);Event.stop(e);if(el.tagName.toLowerCase()!='img'){el=el.down('img')}var url=el.src;url=el.up('a').getAttribute('href');this.blowupPhoto(url)},handleBlowupPhoto:function(e){var el=Event.element(e);Event.stop(e);if(el.tagName.toLowerCase()!='a'){el=el.up('a')}var url=el.getAttribute('href');this.blowupPhoto(url)},blowupPhoto:function(url){if(this.blowupPhotoContainer==null){this.blowupPhotoContainer=new Element('div',{id:'blowupPhoto'});$(document.body).appendChild(this.blowupPhotoContainer);this.blowupPhotoContainer.setStyle({display:'none'})}tricosUtils.showPane(function(){tricosUtils.showAjaxLoader();var image=new Element('img');if($('tempImage')==null){var tempImg=new Element('img',{id:'tempImage'});$(document.body).appendChild(tempImg)}if($('photoOverlay')==null){var overlay=new Element('div',{id:'photoOverlay'});$(document.body).appendChild(overlay);overlay.setStyle({display:'none',position:'absolute',top:0,left:0,padding:'2px',backgroundColor:'white',cursor:'pointer'});$('photoOverlay').observe('contextmenu',function(e){Event.stop(e)});$('photoOverlay').observe('click',function(e){if(Event.element(e).tagName.toLowerCase()!='a'){Event.stop(e)}new Effect.Fade($('photoOverlay'));tricosUtils.hidePane();this.blowupVisible=false;$('photoOverlay').remove()}.bindAsEventListener(this))}$('tempImage').galleryimg='no';$('tempImage').setStyle({position:'absolute',display:'block',top:0,left:'-2000px'});$('tempImage').hide();$('tempImage').observe('load',function(e){if(this.blowupVisible==false){var imgDims=$('tempImage').getDimensions();var imgW=imgDims.width;var imgH=imgDims.height;$('photoOverlay').appendChild($('tempImage'));$('tempImage').setStyle({marginTop:'5px',marginLeft:'5px'});$('photoOverlay').setStyle({width:(imgW+5)+'px',height:(imgH+40)+'px',zIndex:22222,position:'absolute'});var offSet=document.viewport.getScrollOffsets();var topOff=offSet.top-10;$('photoOverlay').setStyle({top:topOff+'px'});$('tempImage').setStyle({top:0,left:0});$('tempImage').show();tricosUtils.centerDivInDiv($('photoOverlay'),$('pane'),0,topOff);tricosUtils.hideAjaxLoader();new Effect.Appear($('photoOverlay'));this.blowupVisible=true}}.bindAsEventListener(this));if(this.blowupVisible==false){$('tempImage').src=url}}.bindAsEventListener(this))},showShippingInfo:function(e){if(e!=null)Event.stop(e);this.blowupPhoto(this.shippingInfoImageUrl)}});var halloweenies;Event.observe(window,'load',function(){halloweenies=new halloweeniesClass});var tricosUtilsClass=Class.create({ajaxLoaderEl:null,ajaxLoaderImageUrl:null,mainDiv:null,paneEl:null,initialize:function(mainDiv,ajaxLoaderImageUrl,ajaxLoaderEl){console.log('tricosutils class initializing');this.mainDiv=mainDiv;this.ajaxLoaderEl=ajaxLoaderEl;this.ajaxLoaderImageUrl=ajaxLoaderImageUrl},setrawcookie:function(name,value,expires,path,domain,secure){if(expires instanceof Date){expires=expires.toGMTString()}else if(typeof(expires)=='number'){expires=(new Date(+(new Date())+expires*1e3)).toGMTString()}var r=[name+"="+value],s={},i='';s={expires:expires,path:path,domain:domain};for(i in s){s[i]&&r.push(i+"="+s[i])}return secure&&r.push("secure"),window.document.cookie=r.join(";"),true},getcookie:function(cookieName){var theCookie=""+document.cookie;var ind=theCookie.indexOf(cookieName);if(ind==-1||cookieName=="")return"";var ind1=theCookie.indexOf(';',ind);if(ind1==-1)ind1=theCookie.length;return unescape(theCookie.substring(ind+cookieName.length+1,ind1))},showAjaxLoader:function(yOffset){if(yOffset==null)yOffset=0;if($(this.ajaxLoaderEl)==null){var loader=new Element('div',{id:'ajaxLoader'});$(document.body).appendChild(loader);this.ajaxLoaderEl=loader;loader.setStyle({display:'none',width:'32px',height:'32px',border:'1px dotted black',position:'absolute',padding:'20px',backgroundColor:'white',zIndex:8500});var img=new Element('img',{src:this.ajaxLoaderImageUrl});loader.appendChild(img)}this.centerDivInDiv(this.ajaxLoaderEl,this.mainDiv,0,0);if(yOffset>0){this.ajaxLoaderEl.setStyle({top:yOffset+'px'})}this.ajaxLoaderEl.show()},hideAjaxLoader:function(){this.ajaxLoaderEl.hide()},centerDivInDiv:function(divToCenter,divToCenterIn,xOffset,yOffset){var fullDIVSize=document.viewport.getDimensions();var fullDivWidth=fullDIVSize.width;var fullDivHeight=fullDIVSize.height;var divToCenterSize=divToCenter.getDimensions();var divToCenterWidth=divToCenterSize.width;var divToCenterHeight=divToCenterSize.height;var divOffsetX=Math.round((fullDivWidth-divToCenterWidth)/2);var divOffsetY=Math.round((fullDivHeight-divToCenterHeight)/2);$(divToCenter).setStyle({left:(divOffsetX+xOffset)+'px',top:(divOffsetY+yOffset)+'px'})},resizePane:function(){var bodyDimensions=$(document.body).getDimensions();var newHeight=bodyDimensions.height;var newWidth=bodyDimensions.width;var viewportHeight=$('main').getHeight();if(viewportHeight>newHeight){newHeight=viewportHeight}var newDims={height:newHeight+'px',width:newWidth+'px',top:'0',left:'0'};this.paneEl.setStyle(newDims)},showPane:function(callback){Event.observe(window,'resize',this.resizePane.bindAsEventListener(this));var dims=document.viewport.getDimensions();console.log(dims);if(this.paneEl==null){this.paneEl=new Element('div',{id:'pane'});$(document.body).appendChild(this.paneEl);this.paneEl.setStyle({display:'none',zIndex:8000,position:'absolute',backgroundColor:'#000',opacity:0.5});this.paneEl.observe('click',this.clearPane.bindAsEventListener(this))}this.resizePane();new Effect.Appear(this.paneEl,{to:0.5,duration:0.4,afterFinish:callback})},hidePane:function(callback){Event.stopObserving(window,'resize',this.resizePane.bindAsEventListener(this));new Effect.Fade(this.paneEl,{duration:0.4,afterFinish:callback})},clearPane:function(e){if($('photoOverlay')==null){if(e!=null)Event.stop(e);new Effect.Fade(this.infoDiv);this.hidePane()}},getVerticalScrollOffset:function(){if(typeof window.pageYOffset=='undefined'){var iebody=(document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body;var yOffset=iebody.scrollTop}else{var yOffset=window.pageYOffset}return yOffset}});if(!window.console||!console.firebug){var names=["log","debug","info","warn","error","assert","dir","dirxml","group","groupEnd","time","timeEnd","count","trace","profile","profileEnd"];window.console={};for(var i=0;i<names.length;++i)window.console[names[i]]=function(){}}var tricosUtils;Event.observe(window,'dom:loaded',function(){});var copyrightObserverClass=Class.create({mouseButton:false,clickPosX:0,clickPosY:0,textEl:null,initialize:function(){if($('editor')==null){$(document.body).observe('mousedown',this.mouseDown.bindAsEventListener(this));$(document.body).observe('mouseup',this.mouseUp.bindAsEventListener(this));$(document.body).observe('contextmenu',this.onContextMenu.bindAsEventListener(this))}Event.observe(window,'keydown',this.keydown.bindAsEventListener(this));var frm=new Element('form',{id:'copyrightObserver_frm'});$(document.body).appendChild(frm);var txtEl=new Element('input',{type:'text'});frm.appendChild(txtEl);txtEl.setStyle({display:'block',width:'1px',height:'1px'});this.textEl=txtEl},onContextMenu:function(e){var allow=false;var el=Event.element(e);if(el!=null){var tz=el.up('#socialbox');if(tz!=null){allow=true}else{var tag=el.tagName.toLowerCase();if(tag=='a'){var link=el.getAttribute('href');if(link){if(link.match(/\.(pdf|zip)$/)){allow=true}}}else if(tag=='img'){var imgLink=el.up('a');if(imgLink!=null){var link=imgLink.getAttribute('href');if(link){if(link.match(/\.(pdf|zip)$/)){allow=true}}}}}}if(!allow){Event.stop(e)}},mouseDown:function(e){this.mouseButton=true;this.clickPosX=e.clientX;this.clickPosY=e.clientY},mouseUp:function(e){if($('eventMap')!=null){return}this.mouseButton=false;var diffX=Math.abs(this.clickPosX-e.clientX);var diffY=Math.abs(this.clickPosY-e.clientY);var diffSum=diffX+diffY;if(Event.element(e).tagName.toLowerCase()=='input'){}else{if(diffSum>50){this.undo()}}},keydown:function(e){var ch=String.fromCharCode(e.keyCode);if((e.ctrlLeft||e.ctrlRight)){if(ch=="a"||ch=="A"){}Event.stop(e);this.undo()}},undo:function(){blur();this.textEl.focus();alert('Dieser Inhalt ist - wie alle Inhalte auf dieser Seite - urheberrechtlich geschützt.\nSie dürfen diesen daher nicht ohne unsere vorherige schriftliche Zustimmung anderweitig veröffentlichen - auch nicht in einem Forum oder auf einer privaten oder gewerblichen Homepage (§15 UrhG).\n\nVerlinken Sie doch einfach auf diese Seite anstatt den Inhalt zu kopieren - davon lebt das Internet!')},mouseOver:function(e){},mouseOut:function(e){}});var copyrightObserver;Event.observe(window,'load',function(){copyrightObserver=new copyrightObserverClass()});var tricosGeoClass=Class.create({supportsGeolocation:false,resultCallback:null,initialize:function(){this.supportsGeolocation=(typeof navigator.geolocation!='undefined')},find:function(callback){this.resultCallback=callback;navigator.geolocation.getCurrentPosition(this._foundLocation.bindAsEventListener(this),this._noLocation.bindAsEventListener(this))},_foundLocation:function(position){this.resultCallback(position)},_noLocation:function(){this.resultCallback(null)}});