var _id="navigation";var _innerEl="ul";var _className="active";var _hide=true;var _dropShow=false;var _menu;var _nodes;var _search="Search";var _providers=["W3C","Gears","Loki","MaxMind"];var _accuracy;Event.observe(window,"load",initSearch);Event.observe(window,"load",initInputs);Event.observe(window,"load",initMenu);Event.observe(window,"load",initFancyZoom);function initFancyZoom(){FancyZoomBox.directory="/images";if(typeof FancyZoom=="function"){$$("a.fancyBox").each(function(a){new FancyZoom(a)})}}function initSearch(){var a=document.getElementsByTagName("input");for(var b=0;b<a.length;b++){if(a[b].type=="text"){a[b].onfocus=function(){if(this.className.indexOf("focus")==-1){this.value="";this.className+=" focus"}};a[b].onblur=function(){this.className=this.className.replace("focus","");this.value=_search}}}}function emptySearch(){if($("text").value==_search){$("text").value=""}}function initInputs(){var a=document.getElementsByTagName("input");var c=[];for(var b=0;b<a.length;b++){if(a[b].type=="text"){c[b]=a[b].value;a[b].index=b;a[b].onfocus=function(){if(c[this.index]==this.value){this.value=""}};a[b].onblur=function(){if(c[this.index]==this.value||this.value==""){this.value=c[this.index]}}}if(a[b].type=="password"){c[b]=a[b].value;a[b].index=b;a[b].onfocus=function(){if(c[this.index]==this.value){this.value=""}};a[b].onblur=function(){if(c[this.index]==this.value||this.value==""){this.value=c[this.index]}}}}}function initMenu(){_menu=document.getElementById(_id);if(_menu){_nodes=_menu.getElementsByTagName("a");for(var a=0;a<_nodes.length;a++){if(_nodes[a].parentNode.getElementsByTagName(_innerEl)[0]){_nodes[a].onclick=function(){if(this.parentNode.className.indexOf(_className)!=-1){this.parentNode.className=this.parentNode.className.replace(_className,"");_dropShow=false}else{if(_hide){hideLevels(this)}this.parentNode.className+=" "+_className;setTimeout(function(){_dropShow=true},100)}return false}}}}document.body.onclick=function(f){if(_dropShow){if(!f){f=window.event}var c=(f.target||f.srcElement);var d=b(c,"drop");if(d.className.indexOf("drop")==-1){hideLevels(document.body);_dropShow=false}}};function b(f,c){var d=f;do{d=d.parentNode}while(d&&d.tagName!="HTML"&&d.className.indexOf(c)==-1);return d}}function hideLevels(g){var d=_menu.getElementsByTagName("li");for(var c=0;c<d.length;c++){var f=false;var b=d[c].getElementsByTagName("a");for(var a=0;a<b.length;a++){if(b[a]==g){f=true}}if(!f){d[c].className=d[c].className.replace(_className,"")}}}function modal(c,b,a){Modalbox.show(b,{title:c,width:a});return false}function hideBoxReloadMenu(){new Ajax.Request("/session/reload_menu",{asynchronous:true,evalScripts:true})}function facebookSignin(){new Ajax.Request("/session/facebook_signin",{asynchronous:true,evalScripts:true})}function localityFromResponse(b){var a;try{a=b.Placemark[0].AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.Locality.LocalityName}catch(c){a=b.Placemark[0].AddressDetails.Country.AdministrativeArea.Locality.LocalityName}return a}function respondToAddress(a){locality=localityFromResponse(a);if(locality){$("text").value="Search in "+locality;$("locality").value=locality;_search="Search in "+locality;initSearch();initInputs()}}function initLocateMe(){var a=function(c){if((_accuracy==undefined)||(_providers.indexOf(c.provider)<_accuracy)){_accuracy=_providers.indexOf(c.provider);var d=new GClientGeocoder();var b=new GLatLng(c.latitude,c.longitude);d.getLocations(b,respondToAddress);$("latitude").value=c.latitude;$("longitude").value=c.longitude}};MorizGmbH_LocateMe.set_options(locateMeOptions);MorizGmbH_LocateMe.locate(a);MorizGmbH_LocateMe.selected_providers=_providers}var _modalMap;function initModalMap(){_modalMap=new GMap2($("MB_map"));var d=$("latitude").value;var a=$("longitude").value;var c=15;if(d==undefined){d=0;a=0;c=1}_modalMap.setCenter(new GLatLng(d,a),c);var b=_modalMap.getDefaultUI();b.controls.maptypecontrol=false;b.controls.scalecontrol=false;_modalMap.setUI(b);window.onunload=GUnload}function showAddress(a){var b=new GClientGeocoder();b.getLatLng(a,function(c){if(!c){alert(a+" not found")}else{_modalMap.setCenter(c,15)}})}function defaultLocate(){var d=_modalMap.getCenter().lat();var b=_modalMap.getCenter().lng();$("default_lat").value=$("latitude").value=d;$("default_lng").value=$("longitude").value=b;$("default_zoom").value=_modalMap.getZoom();var c=new GClientGeocoder();var a=new GLatLng(d,b);c.getLocations(a,modalLocality)}function modalLocality(a){locality=localityFromResponse(a);if(locality){$("default_locality").value=locality;respondToAddress(a)}new Ajax.Request("/my/account/save_default_location",{asynchronous:true,evalScripts:true,parameters:Form.serialize("modal-map-default")})}function tellFriends(){if($("mode").value=="facebook"){facebookPromptPermission("offline_access,publish_stream,email",tellFacebookFriends,Modalbox.hide)}else{tellFacebookFriends()}}function facebookPromptPermission(a,c,b){FB.ensureInit(function(){FB.Connect.requireSession(function(){FB.Facebook.apiClient.users_hasAppPermission(a,function(d){if(d==0){FB.Connect.showPermissionDialog(a,function(f){if(null==f){b()}else{c()}},true,null)}else{c()}})})})}function tellFacebookFriends(){new Ajax.Request("/social.js",{asynchronous:true,evalScripts:true,parameters:Form.serialize("tell-friends")})}function createMarker(a,c){var d=new GIcon(baseIcon);d.image="/images/pin"+c+".png";markerOptions={icon:d};var b=new GMarker(a,markerOptions);GEvent.addListener(b,"click",function(){var f=$("info-"+c).cloneNode(true);f.id="map-node";b.openInfoWindow(f)});return b}function defaultIcon(){baseIcon=new GIcon();baseIcon.image="/images/pin.png";baseIcon.shadow="/images/pin-shadow.png";baseIcon.iconSize=new GSize(20,36);baseIcon.shadowSize=new GSize(34,36);baseIcon.iconAnchor=new GPoint(10,36);baseIcon.infoWindowAnchor=new GPoint(5,1);return baseIcon}function mapInitialise(){_map=new GMap2($("map-canvas"));_map.setCenter(_map_centre,_zoom);_map.setUIToDefault();var h=defaultIcon();var g=new GIcon();g.image="/images/map-bullet.png";g.iconSize=new GSize(10,10);g.iconAnchor=new GPoint(5,10);markerOptions={icon:h};var f=_supplement.length;if(f>0){for(var d=0;d<f;d++){var c=_supplement[d];var a=new GLatLng(c.place.lat,c.place.lng);var b=new GMarker(a,{icon:g});_map.addOverlay(b)}}f=_placemarks.length;for(var d=0;d<f;d++){var c=_placemarks[d];var a=new GLatLng(c.place.lat,c.place.lng);_map.addOverlay(createMarker(a,d+1))}GEvent.addListener(_map,"zoomend",function(){$("gzoom").value=_map.getZoom();setBounds()});GEvent.addListener(_map,"dragend",function(){$("latitude").value=_map.getCenter().lat();$("longitude").value=_map.getCenter().lng();setBounds();$("locality").value=null});window.onunload=GUnload}function setBounds(){$("bounds").value=_map.getBounds().toString()}var _placeMap;function initPlaceMap(){var d=defaultIcon();var a=new GMarker(_map_centre,{icon:d});var c=18;_placeMap=new GMap2($("map-canvas"));_placeMap.setCenter(_map_centre,c);_placeMap.addOverlay(a);var b=_placeMap.getDefaultUI();b.controls.maptypecontrol=false;b.controls.scalecontrol=false;_placeMap.setUI(b);window.onunload=GUnload}function fb_avatars(){FB.Facebook.apiClient.fql_query("SELECT uid,pic_square FROM user WHERE uid in ("+_facebook_ids+")",fb_set)}function fb_set(c){for(var b=0;b<c.length;b++){fbav=$$(".c-"+c[b].uid);for(var a=0;a<fbav.length;a++){if(c[b].pic_square!==null){fbav[a].src=c[b].pic_square;fbav[a].width=64}}fbav=$$(".tb-"+c[b].uid);for(var a=0;a<fbav.length;a++){if(c[b].pic_square!==null){fbav[a].src=c[b].pic_square;fbav[a].width=32}}}}var _errorMessages=["Nope","Keep Trying","Nadda","Sorry","Arg","Bummer","Whoops","Snafu"];function respondToDateInput(a){date=Date.parse(a.value);if(date!==null){$("result_"+a.id).innerHTML=date.toString("h:mm tt, dddd MMMM dd, yyyy");$("result_"+a.id).className="";$("input_"+a.id).value=date.toISOString()}else{$("result_"+a.id).innerHTML=_errorMessages[Math.round(_errorMessages.length*Math.random())]+"...";$("result_"+a.id).className="wrong";$("input_"+a.id).value=""}}function yoyoyo(a){var b="citytag.com.au";mailto="mailto:";document.location=mailto+a+"@"+b}var _charMaxLength=100;if(!window.Modalbox){var Modalbox=new Object()}Modalbox.Methods={overrideAlert:false,focusableElements:new Array,currFocused:0,initialized:false,active:true,options:{title:"ModalBox Window",overlayClose:true,width:500,height:90,overlayOpacity:0.65,overlayDuration:0.2,slideDownDuration:0.1,slideUpDuration:0.1,resizeDuration:0.1,inactiveFade:true,transitions:true,loadingString:"Please wait. Loading...",closeString:"Close window",closeValue:"&times;",params:{},method:"get",autoFocusing:true,aspnet:false},_options:new Object,setOptions:function(a){Object.extend(this.options,a||{})},_init:function(b){Object.extend(this._options,this.options);this.setOptions(b);this.MBoverlay=new Element("div",{id:"MB_overlay",opacity:"0"});this.MBwindow=new Element("div",{id:"MB_window",style:"display: none"}).update(this.MBframe=new Element("div",{id:"MB_frame"}).update(this.MBheader=new Element("div",{id:"MB_header"}).update(this.MBcaption=new Element("div",{id:"MB_caption"}))));this.MBclose=new Element("a",{id:"MB_close",title:this.options.closeString,href:"#"}).update("<span>"+this.options.closeValue+"</span>");this.MBheader.insert({bottom:this.MBclose});this.MBcontent=new Element("div",{id:"MB_content"}).update(this.MBloading=new Element("div",{id:"MB_loading"}).update(this.options.loadingString));this.MBframe.insert({bottom:this.MBcontent});var a=this.options.aspnet?$(document.body).down("form"):$(document.body);a.insert({top:this.MBwindow});a.insert({top:this.MBoverlay});this.initScrollX=window.pageXOffset||document.body.scrollLeft||document.documentElement.scrollLeft;this.initScrollY=window.pageYOffset||document.body.scrollTop||document.documentElement.scrollTop;this.hideObserver=this._hide.bindAsEventListener(this);this.kbdObserver=this._kbdHandler.bindAsEventListener(this);this._initObservers();this.initialized=true},show:function(b,a){if(!this.initialized){this._init(a)}this.content=b;this.setOptions(a);if(this.options.title){$(this.MBcaption).update(this.options.title)}else{$(this.MBheader).hide();$(this.MBcaption).hide()}if(this.MBwindow.style.display=="none"){this._appear();this.event("onShow")}else{this._update();this.event("onUpdate")}},hide:function(a){if(this.initialized){if(a&&typeof a.element!="function"){Object.extend(this.options,a)}this.event("beforeHide");if(this.options.transitions){Effect.SlideUp(this.MBwindow,{duration:this.options.slideUpDuration,transition:Effect.Transitions.sinoidal,afterFinish:this._deinit.bind(this)})}else{$(this.MBwindow).hide();this._deinit()}}else{throw ("Modalbox is not initialized.")}},_hide:function(a){a.stop();if(a.element().id=="MB_overlay"&&!this.options.overlayClose){return false}this.hide()},alert:function(b){var a='<div class="MB_alert"><p>'+b+'</p><input type="button" onclick="Modalbox.hide()" value="OK" /></div>';Modalbox.show(a,{title:"Alert: "+document.title,width:300})},_appear:function(){if(Prototype.Browser.IE&&!navigator.appVersion.match(/\b7.0\b/)){window.scrollTo(0,0);this._prepareIE("100%","hidden")}this._setWidth();this._setPosition();if(this.options.transitions){$(this.MBoverlay).setStyle({opacity:0});new Effect.Fade(this.MBoverlay,{from:0,to:this.options.overlayOpacity,duration:this.options.overlayDuration,afterFinish:function(){new Effect.SlideDown(this.MBwindow,{duration:this.options.slideDownDuration,transition:Effect.Transitions.sinoidal,afterFinish:function(){this._setPosition();this.loadContent()}.bind(this)})}.bind(this)})}else{$(this.MBoverlay).setStyle({opacity:this.options.overlayOpacity});$(this.MBwindow).show();this._setPosition();this.loadContent()}this._setWidthAndPosition=this._setWidthAndPosition.bindAsEventListener(this);Event.observe(window,"resize",this._setWidthAndPosition)},resize:function(h,i,c){var g=$(this.MBwindow).getHeight();var d=$(this.MBwindow).getWidth();var f=$(this.MBheader).getHeight();var b=$(this.MBcontent).getHeight();var a=((g-f+i)<b)?(b+f-g):i;if(c){this.setOptions(c)}if(this.options.transitions){new Effect.ScaleBy(this.MBwindow,h,a,{duration:this.options.resizeDuration,afterFinish:function(){this.event("_afterResize");this.event("afterResize")}.bind(this)})}else{this.MBwindow.setStyle({width:d+h+"px",height:g+a+"px"});setTimeout(function(){this.event("_afterResize");this.event("afterResize")}.bind(this),1)}},resizeToContent:function(a){var b=this.options.height-this.MBwindow.offsetHeight;if(b!=0){if(a){this.setOptions(a)}Modalbox.resize(0,b)}},resizeToInclude:function(c,b){var d=$(c);var a=d.getHeight()+parseInt(d.getStyle("margin-top"))+parseInt(d.getStyle("margin-bottom"))+parseInt(d.getStyle("border-top-width"))+parseInt(d.getStyle("border-bottom-width"));if(a>0){if(b){this.setOptions(b)}Modalbox.resize(0,a)}},_update:function(){$(this.MBcontent).update("");this.MBcontent.appendChild(this.MBloading);$(this.MBloading).update(this.options.loadingString);this.currentDims=[this.MBwindow.offsetWidth,this.MBwindow.offsetHeight];Modalbox.resize((this.options.width-this.currentDims[0]),(this.options.height-this.currentDims[1]),{_afterResize:this._loadAfterResize.bind(this)})},loadContent:function(){if(this.event("beforeLoad")!=false){if(typeof this.content=="string"){var htmlRegExp=new RegExp(/<\/?[^>]+>/gi);if(htmlRegExp.test(this.content)){this._insertContent(this.content.stripScripts());this._putContent(function(){this.content.extractScripts().map(function(script){return eval(script.replace("<!--","").replace("// -->",""))}.bind(window))}.bind(this))}else{new Ajax.Request(this.content,{method:this.options.method.toLowerCase(),parameters:this.options.params,onSuccess:function(transport){var response=new String(transport.responseText);this._insertContent(transport.responseText.stripScripts());this._putContent(function(){response.extractScripts().map(function(script){return eval(script.replace("<!--","").replace("// -->",""))}.bind(window))});setTimeout(function(){var _txt=$("txt");var _char=$("char");if(_txt&&_char){var _charLength=_charMaxLength-_txt.value.length;_char.innerHTML=_charLength;_txt.observe("keydown",function(){_charLength=_charMaxLength-_txt.value.length;if(_charLength>=0){_char.innerHTML=_charLength}else{var _text=_txt.value;var _textTmp="";for(var i=0;i<_charMaxLength;i++){_textTmp+=_text.charAt(i)}_txt.value=_textTmp}})}},200)}.bind(this),onException:function(instance,exception){Modalbox.hide();throw ("Modalbox Loading Error: "+exception)}})}}else{if(typeof this.content=="object"){this._insertContent(this.content);this._putContent()}else{Modalbox.hide();throw ("Modalbox Parameters Error: Please specify correct URL or HTML element (plain HTML or object)")}}}},_insertContent:function(b){$(this.MBcontent).hide().update("");if(typeof b=="string"){setTimeout(function(){this.MBcontent.update(b)}.bind(this),1)}else{if(typeof b=="object"){var a=b.cloneNode(true);if(b.id){b.id="MB_"+b.id}$(b).select("*[id]").each(function(c){c.id="MB_"+c.id});this.MBcontent.appendChild(a);this.MBcontent.down().show();if(Prototype.Browser.IE){$$("#MB_content select").invoke("setStyle",{visibility:""})}}}},_putContent:function(a){if(this.options.height==this._options.height){setTimeout(function(){Modalbox.resize(0,$(this.MBcontent).getHeight()-$(this.MBwindow).getHeight()+$(this.MBheader).getHeight(),{afterResize:function(){this.MBcontent.show().makePositioned();this.focusableElements=this._findFocusableElements();this._setFocus();setTimeout(function(){if(a!=undefined){a()}this.event("afterLoad")}.bind(this),1)}.bind(this)})}.bind(this),1)}else{this._setWidth();this.MBcontent.setStyle({overflow:"auto",height:$(this.MBwindow).getHeight()-$(this.MBheader).getHeight()-13+"px"});this.MBcontent.show();this.focusableElements=this._findFocusableElements();this._setFocus();setTimeout(function(){if(a!=undefined){a()}this.event("afterLoad")}.bind(this),1)}},activate:function(a){this.setOptions(a);this.active=true;$(this.MBclose).observe("click",this.hideObserver);if(this.options.overlayClose){$(this.MBoverlay).observe("click",this.hideObserver)}$(this.MBclose).show();if(this.options.transitions&&this.options.inactiveFade){new Effect.Appear(this.MBwindow,{duration:this.options.slideUpDuration})}},deactivate:function(a){this.setOptions(a);this.active=false;$(this.MBclose).stopObserving("click",this.hideObserver);if(this.options.overlayClose){$(this.MBoverlay).stopObserving("click",this.hideObserver)}$(this.MBclose).hide();if(this.options.transitions&&this.options.inactiveFade){new Effect.Fade(this.MBwindow,{duration:this.options.slideUpDuration,to:0.75})}},_initObservers:function(){$(this.MBclose).observe("click",this.hideObserver);if(this.options.overlayClose){$(this.MBoverlay).observe("click",this.hideObserver)}if(Prototype.Browser.IE){Event.observe(document,"keydown",this.kbdObserver)}else{Event.observe(document,"keypress",this.kbdObserver)}},_removeObservers:function(){$(this.MBclose).stopObserving("click",this.hideObserver);if(this.options.overlayClose){$(this.MBoverlay).stopObserving("click",this.hideObserver)}if(Prototype.Browser.IE){Event.stopObserving(document,"keydown",this.kbdObserver)}else{Event.stopObserving(document,"keypress",this.kbdObserver)}},_loadAfterResize:function(){this._setWidth();this._setPosition();this.loadContent()},_setFocus:function(){if(this.focusableElements.length>0&&this.options.autoFocusing==true){var a=this.focusableElements.find(function(b){return b.tabIndex==1})||this.focusableElements.first();this.currFocused=this.focusableElements.toArray().indexOf(a);a.focus()}else{if($(this.MBclose).visible()){$(this.MBclose).focus()}}},_findFocusableElements:function(){this.MBcontent.select("input:not([type~=hidden]), select, textarea, button, a[href]").invoke("addClassName","MB_focusable");return this.MBcontent.select(".MB_focusable")},_kbdHandler:function(b){var a=b.element();switch(b.keyCode){case Event.KEY_TAB:b.stop();if(a!=this.focusableElements[this.currFocused]){this.currFocused=this.focusableElements.toArray().indexOf(a)}if(!b.shiftKey){if(this.currFocused==this.focusableElements.length-1){this.focusableElements.first().focus();this.currFocused=0}else{this.currFocused++;this.focusableElements[this.currFocused].focus()}}else{if(this.currFocused==0){this.focusableElements.last().focus();this.currFocused=this.focusableElements.length-1}else{this.currFocused--;this.focusableElements[this.currFocused].focus()}}break;case Event.KEY_ESC:if(this.active){this._hide(b)}break;case 32:this._preventScroll(b);break;case 0:if(b.which==32){this._preventScroll(b)}break;case Event.KEY_UP:case Event.KEY_DOWN:case Event.KEY_PAGEDOWN:case Event.KEY_PAGEUP:case Event.KEY_HOME:case Event.KEY_END:if(Prototype.Browser.WebKit&&!["textarea","select"].include(a.tagName.toLowerCase())){b.stop()}else{if((a.tagName.toLowerCase()=="input"&&["submit","button"].include(a.type))||(a.tagName.toLowerCase()=="a")){b.stop()}}break}},_preventScroll:function(a){if(!["input","textarea","select","button"].include(a.element().tagName.toLowerCase())){a.stop()}},_deinit:function(){this._removeObservers();Event.stopObserving(window,"resize",this._setWidthAndPosition);if(this.options.transitions){Effect.toggle(this.MBoverlay,"appear",{duration:this.options.overlayDuration,afterFinish:this._removeElements.bind(this)})}else{this.MBoverlay.hide();this._removeElements()}$(this.MBcontent).setStyle({overflow:"",height:""})},_removeElements:function(){$(this.MBoverlay).remove();$(this.MBwindow).remove();if(Prototype.Browser.IE&&!navigator.appVersion.match(/\b7.0\b/)){this._prepareIE("","");window.scrollTo(this.initScrollX,this.initScrollY)}if(typeof this.content=="object"){if(this.content.id&&this.content.id.match(/MB_/)){this.content.id=this.content.id.replace(/MB_/,"")}this.content.select("*[id]").each(function(a){a.id=a.id.replace(/MB_/,"")})}this.initialized=false;this.event("afterHide");this.setOptions(this._options)},_setWidth:function(){$(this.MBwindow).setStyle({width:this.options.width+"px",height:this.options.height+"px"})},_setPosition:function(){$(this.MBwindow).setStyle({left:Math.round((Element.getWidth(document.body)-Element.getWidth(this.MBwindow))/2)+"px"})},_setWidthAndPosition:function(){$(this.MBwindow).setStyle({width:this.options.width+"px"});this._setPosition()},_getScrollTop:function(){var a;if(document.documentElement&&document.documentElement.scrollTop){a=document.documentElement.scrollTop}else{if(document.body){a=document.body.scrollTop}}return a},_prepareIE:function(a,b){$$("html, body").invoke("setStyle",{width:a,height:a,overflow:b});$$("select").invoke("setStyle",{visibility:b})},event:function(a){if(this.options[a]){var b=this.options[a]();this.options[a]=null;if(b!=undefined){return b}else{return true}}return true}};Object.extend(Modalbox,Modalbox.Methods);if(Modalbox.overrideAlert){window.alert=Modalbox.alert}Effect.ScaleBy=Class.create();Object.extend(Object.extend(Effect.ScaleBy.prototype,Effect.Base.prototype),{initialize:function(b,c,d,a){this.element=$(b);var a=Object.extend({scaleFromTop:true,scaleMode:"box",scaleByWidth:c,scaleByHeight:d},arguments[3]||{});this.start(a)},setup:function(){this.elementPositioning=this.element.getStyle("position");this.originalTop=this.element.offsetTop;this.originalLeft=this.element.offsetLeft;this.dims=null;if(this.options.scaleMode=="box"){this.dims=[this.element.offsetHeight,this.element.offsetWidth]}if(/^content/.test(this.options.scaleMode)){this.dims=[this.element.scrollHeight,this.element.scrollWidth]}if(!this.dims){this.dims=[this.options.scaleMode.originalHeight,this.options.scaleMode.originalWidth]}this.deltaY=this.options.scaleByHeight;this.deltaX=this.options.scaleByWidth},update:function(a){var c=this.dims[0]+(this.deltaY*a);var b=this.dims[1]+(this.deltaX*a);c=(c>0)?c:0;b=(b>0)?b:0;this.setDimensions(c,b)},setDimensions:function(a,f){var g={};g.width=f+"px";g.height=a+"px";var c=Math.round((a-this.dims[0])/2);var b=Math.round((f-this.dims[1])/2);if(this.elementPositioning=="absolute"||this.elementPositioning=="fixed"){if(!this.options.scaleFromTop){g.top=this.originalTop-c+"px"}g.left=this.originalLeft-b+"px"}else{if(!this.options.scaleFromTop){g.top=-c+"px"}g.left=-b+"px"}this.element.setStyle(g)}});Object.extend(String.prototype,{ensureEndsWith:function(a){return this.endsWith(a)?this:this+a},px:function(){return this.ensureEndsWith("px")}});Object.extend(Number.prototype,{px:function(){return this.toString().px()}});var Window={size:function(){var c=window.innerWidth||(window.document.documentElement.clientWidth||window.document.body.clientWidth);var b=window.innerHeight||(window.document.documentElement.clientHeight||window.document.body.clientHeight);var a=window.pageXOffset||(window.document.documentElement.scrollLeft||window.document.body.scrollLeft);var d=window.pageYOffset||(window.document.documentElement.scrollTop||window.document.body.scrollTop);return{width:c,height:b,x:a,y:d}}};var FancyZoomBox={directory:"images",zooming:false,setup:false,init:function(c){if(FancyZoomBox.setup){return}FancyZoomBox.setup=true;var f=navigator.userAgent.match(/MSIE\s(\d)+/);if(f){var b=parseInt(f[1]);Prototype.Browser["IE"+b.toString()]=true;Prototype.Browser.ltIE7=(b<7)?true:false}var d='<div id="zoom" style="display:none;">                   <table id="zoom_table" style="border-collapse:collapse; width:100%; height:100%;">                     <tbody>                       <tr>                         <td class="tl" style="background:url('+FancyZoomBox.directory+'/tl.png) 0 0 no-repeat; width:20px; height:20px; overflow:hidden;" />                         <td class="tm" style="background:url('+FancyZoomBox.directory+'/tm.png) 0 0 repeat-x; height:20px; overflow:hidden;" />                         <td class="tr" style="background:url('+FancyZoomBox.directory+'/tr.png) 100% 0 no-repeat; width:20px; height:20px; overflow:hidden;" />                       </tr>                       <tr>                         <td class="ml" style="background:url('+FancyZoomBox.directory+'/ml.png) 0 0 repeat-y; width:20px; overflow:hidden;" />                         <td class="mm" style="background:#fff; vertical-align:top; padding:10px;">                           <div id="zoom_content">                           </div>                         </td>                         <td class="mr" style="background:url('+FancyZoomBox.directory+'/mr.png) 100% 0 repeat-y;  width:20px; overflow:hidden;" />                       </tr>                       <tr>                         <td class="bl" style="background:url('+FancyZoomBox.directory+'/bl.png) 0 100% no-repeat; width:20px; height:20px; overflow:hidden;" />                         <td class="bm" style="background:url('+FancyZoomBox.directory+'/bm.png) 0 100% repeat-x; height:20px; overflow:hidden;" />                         <td class="br" style="background:url('+FancyZoomBox.directory+'/br.png) 100% 100% no-repeat; width:20px; height:20px; overflow:hidden;" />                       </tr>                     </tbody>                   </table>                   <a href="#" title="Close" id="zoom_close" style="position:absolute; top:0; left:0;">                     <img src="'+FancyZoomBox.directory+'/closebox.png" alt="Close" style="border:none; margin:0; padding:0;" />                   </a>                 </div>';var a=$$("body").first();a.insert(d);FancyZoomBox.zoom=$("zoom");FancyZoomBox.zoom_table=$("zoom_table");FancyZoomBox.zoom_close=$("zoom_close");FancyZoomBox.zoom_content=$("zoom_content");FancyZoomBox.zoom_close.observe("click",FancyZoomBox.hide);FancyZoomBox.middle_row=$A([$$("td.ml"),$$("td.mm"),$$("td.mr")]).flatten();FancyZoomBox.cells=FancyZoomBox.zoom_table.select("td");$$("html").first().observe("click",function(i){var h=i.findElement("#zoom"),g=FancyZoomBox.zoom.getStyle("display");if(g=="block"&&!h){FancyZoomBox.hide(i)}});$(document).observe("keyup",function(h){var g=FancyZoomBox.zoom.getStyle("display");if(h.keyCode==Event.KEY_ESC&&g=="block"){FancyZoomBox.hide(h)}});if(Prototype.Browser.ltIE7){FancyZoomBox.switchBackgroundImagesTo("gif")}},show:function(g){g.stop();if(FancyZoomBox.zooming){return}FancyZoomBox.zooming=true;var c=g.findElement("a");var f=c.content_div;var a=(c.zoom_width||f.getWidth())+60;var k=(c.zoom_height||f.getHeight())+60;var h=Window.size();var b=document.viewport.getScrollOffsets()[1];var i=Math.max((h.height/2)-(k/2)+b,0);var j=(h.width/2)-(a/2);FancyZoomBox.curTop=g.pointerY();FancyZoomBox.curLeft=g.pointerX();FancyZoomBox.moveX=-(FancyZoomBox.curLeft-j);FancyZoomBox.moveY=-(FancyZoomBox.curTop-i);FancyZoomBox.zoom.hide().setStyle({position:"absolute",top:FancyZoomBox.curTop.px(),left:FancyZoomBox.curLeft.px()});new Effect.Parallel([new Effect.Appear(FancyZoomBox.zoom,{sync:true}),new Effect.Move(FancyZoomBox.zoom,{x:FancyZoomBox.moveX,y:FancyZoomBox.moveY,sync:true}),new Effect.Morph(FancyZoomBox.zoom,{style:{width:a.px(),height:k.px()},sync:true,beforeStart:function(d){if(Prototype.Browser.IE){FancyZoomBox.middle_row.invoke("setStyle",{height:(k-40).px()})}FancyZoomBox.fixBackgroundsForIE()},afterFinish:function(d){FancyZoomBox.zoom_content.innerHTML=f.innerHTML;FancyZoomBox.unfixBackgroundsForIE();FancyZoomBox.zoom_close.show();FancyZoomBox.zooming=false}})],{duration:0.5})},hide:function(a){a.stop();if(FancyZoomBox.zooming){return}FancyZoomBox.zooming=true;new Effect.Parallel([new Effect.Move(FancyZoomBox.zoom,{x:FancyZoomBox.moveX*-1,y:FancyZoomBox.moveY*-1,sync:true}),new Effect.Morph(FancyZoomBox.zoom,{style:{width:"1".px(),height:"1".px()},sync:true,beforeStart:function(b){FancyZoomBox.fixBackgroundsForIE();FancyZoomBox.zoom_content.innerHTML="";FancyZoomBox.zoom_close.hide()},afterFinish:function(b){FancyZoomBox.unfixBackgroundsForIE();FancyZoomBox.zooming=false}}),new Effect.Fade(FancyZoomBox.zoom,{sync:true})],{duration:0.5})},switchBackgroundImagesTo:function(c){FancyZoomBox.cells.each(function(f){var d=f.getStyle("background-image").gsub(/\.(png|gif|none)\)$/,"."+c+")");f.setStyle("background-image: "+d)});var b=FancyZoomBox.zoom_close.firstDescendant();var a=b.readAttribute("src").gsub(/\.(png|gif|none)$/,"."+c);b.writeAttribute("src",a)},fixBackgroundsForIE:function(){if(Prototype.Browser.IE7){FancyZoomBox.switchBackgroundImagesTo("gif")}},unfixBackgroundsForIE:function(){if(Prototype.Browser.IE7){FancyZoomBox.switchBackgroundImagesTo("png")}}};var FancyZoom=Class.create({initialize:function(a){this.options=arguments.length>1?arguments[1]:{};FancyZoomBox.init();this.element=$(a);if(this.element){this.element.content_div=$(this.element.readAttribute("href").gsub(/^#/,""));this.element.content_div.hide();this.element.zoom_width=this.options.width;this.element.zoom_height=this.options.height;this.element.observe("click",FancyZoomBox.show)}}});var LocateMe={Version:"0.0.1",};(function(){var c=0,a=$$("head")[0],b=this;b.getMaxMindFunctions=function(f,h){var d=document.createElement("script"),g="__jsonp"+c;d.src=f;d.onload=function(){d.remove();d=null;h()};a.appendChild(d);c++};b.getJSONP=function(f,h){var d=document.createElement("script"),g="__jsonp"+c;b[g]=h;d.src=f.replace(/\?(&|$)/,"__jsonp"+c+"$1");d.onload=function(){d.remove();d=null;delete b[g]};a.appendChild(d);c++}})();try{console.log("init console... done")}catch(e){console={log:function(){}}}var MorizGmbH_LocateMe_Result=Class.create({initialize:function(a){this.provider=a;this.timestamp="";this.latitude="";this.longitude="";this.success=false}});var MorizGmbH_LocateMe_ProviderBase=Class.create({initialize:function(a){console.log("initialize called");this.name="";this.errors=0;this.options=a;this.set_defaults(a)},set_defaults:function(){return false},available:function(){return false},locate:function(){return false},handle_result:function(){return false},handle_error:function(){return false}});var MorizGmbH_LocateMe_ProviderLoki=Class.create(MorizGmbH_LocateMe_ProviderBase,{set_defaults:function(){this.name="Loki"},available:function(b){var a=false;if((typeof LokiAPI!="undefined")&&LokiAPI.isInstalled()&&b.loki_key!=false){a=true}return a},locate:function(){console.log("Loki::locate, key:"+options.loki_key);try{var a=LokiAPI();a.onSuccess=this.handle_result;a.onFailure=this.handle_error;a.setKey(options.loki_key);a.requestLocation(true,a.NO_STREET_ADDRESS_LOOKUP)}catch(b){this.handle_error(b)}},handle_result:function(b){console.log("Loki::handle_result");var a=new MorizGmbH_LocateMe_Result("Loki");a.timestamp=(new Date).getTime();a.latitude=b.latitude;a.longitude=b.longitude;a.success=true;MorizGmbH_LocateMe.add_result(a)},handle_error:function(a){console.log("Loki::handle_error");console.log(a);MorizGmbH_LocateMe.errors++;if(a==1001){MorizGmbH_LocateMe.user_abort=true}}});var MorizGmbH_LocateMe_ProviderGears=Class.create(MorizGmbH_LocateMe_ProviderBase,{set_defaults:function(a){this.name="Gears"},available:function(){var a=false;if(window.google&&google.gears){a=true}return a},locate:function(){console.log("Gears::locate");try{var b=google.gears.factory.create("beta.geolocation");b.getCurrentPosition(this.handle_result,this.handle_error,this.options.gears_options)}catch(a){this.handle_error(a)}},handle_result:function(b){console.log("Gears::handle_result");var a=new MorizGmbH_LocateMe_Result("Gears");a.timestamp=(new Date).getTime();a.latitude=b.coords["latitude"];a.longitude=b.coords["longitude"];a.success=true;MorizGmbH_LocateMe.add_result(a)},handle_error:function(a){console.log("Gears::handle_error");console.log(a);MorizGmbH_LocateMe.errors++}});var MorizGmbH_LocateMe_ProviderW3C=Class.create(MorizGmbH_LocateMe_ProviderBase,{set_defaults:function(a){this.name="W3C"},available:function(){var a=false;if(typeof navigator.geolocation!="undefined"){a=true}return a},locate:function(){console.log("W3C::locate");try{navigator.geolocation.getCurrentPosition(this.handle_result,this.handle_error)}catch(a){this.handle_error(a)}},handle_result:function(b){console.log("W3C::handle_result");var a=new MorizGmbH_LocateMe_Result("W3C");a.timestamp=(new Date).getTime();a.success=true;if(typeof b.coords!="undefined"){a.latitude=b.coords["latitude"];a.longitude=b.coords["longitude"]}else{a.latitude=b.latitude;a.longitude=b.longitude}MorizGmbH_LocateMe.add_result(a)},handle_error:function(a){console.log("W3C::handle_error");console.log(a);MorizGmbH_LocateMe.errors++}});var MorizGmbH_LocateMe_ProviderMaxMind=Class.create(MorizGmbH_LocateMe_ProviderBase,{set_defaults:function(a){this.name="MaxMind"},available:function(){var a=true;return a},locate:function(){var a=this;console.log("MaxMind::locate");try{var b="http://j.maxmind.com/app/geoip.js";getMaxMindFunctions(b,function(){a.handle_result()})}catch(c){this.handle_error(c)}},handle_result:function(){console.log("MaxMind::handle_result");var a=new MorizGmbH_LocateMe_Result("MaxMind");a.timestamp=(new Date).getTime();a.success=true;a.latitude=parseFloat(geoip_latitude());a.longitude=parseFloat(geoip_longitude());MorizGmbH_LocateMe.add_result(a)},handle_error:function(a){console.log("MaxMind::handle_error");console.log(a);MorizGmbH_LocateMe.errors++}});var MorizGmbH_LocateMe_ProviderIPLocationTools=Class.create(MorizGmbH_LocateMe_ProviderBase,{set_defaults:function(a){this.name="IPLocationTools"},available:function(){var a=true;return a},locate:function(){var a=this;console.log("IPLocationTools::locate");try{var b="http://iplocationtools.com/ip_query.php?output=json&callback=?";getJSONP(b,function(d){a.handle_result(d)})}catch(c){this.handle_error(c)}},handle_result:function(b){console.log("IPLocationTools::handle_result");var a=new MorizGmbH_LocateMe_Result("IPLocationTools");a.timestamp=(new Date).getTime();a.success=true;a.latitude=parseFloat(b.Latitude);a.longitude=parseFloat(b.Longitude);MorizGmbH_LocateMe.add_result(a)},handle_error:function(a){console.log("MaxMind::handle_error");console.log(a);MorizGmbH_LocateMe.errors++}});var MorizGmbH_LocateMe_Klass=Class.create({initialize:function(a){this.defaults={loki_key:false,gears_options:{},};this.options=this.mergeOptions(this.defaults,a);this.provider_shortcuts=new Hash();this.provider_shortcuts.set("W3C","MorizGmbH_LocateMe_ProviderW3C");this.provider_shortcuts.set("Gears","MorizGmbH_LocateMe_ProviderGears");this.provider_shortcuts.set("Loki","MorizGmbH_LocateMe_ProviderLoki");this.provider_shortcuts.set("MaxMind","MorizGmbH_LocateMe_ProviderMaxMind");this.provider_shortcuts.set("IPLocationTools","MorizGmbH_LocateMe_ProviderIPLocationTools");this.selected_providers=["W3C","Gears","Loki","IPLocationTools","MaxMind"];this.available_methods=new Hash();this.results=new Array();this.errors=0;this.successes=0;this.user_abort=false},mergeOptions:function(d,c){var a=d;for(var b in c){a[b]=c[b]}return a},set_callback:function(a){this.callback=a},set_options:function(a){this.options=this.mergeOptions(this.options,a)},locate:function(a){this.set_callback(a);this.check_available_geolocation_methods();this.get_location()},add_result:function(a){this.results.push(a);this.successes++;this.callback(a)},check_available_geolocation_methods:function(){var self=this;this.available_methods=new Hash();this.selected_providers.each(function(provider_shortcut){console.log("provider_shortcut: "+provider_shortcut);var provider=eval("new "+self.provider_shortcuts.get(provider_shortcut)+"(self.options);");if(provider.available(self.options)){console.log("Available: "+provider_shortcut);self.available_methods.set(provider_shortcut,provider)}})},get_location:function(){var a=this;this.available_methods.each(function(d){var b=d[0];var d=d[1];if(a.user_abort==true){console.log("user abort");return}try{d.locate(a.options)}catch(c){console.log(c)}})},});var MorizGmbH_LocateMe=new MorizGmbH_LocateMe_Klass();