jQuery(function(a){a.datepicker.regional.de={closeText:"schlie\u00dfen",prevText:"&#x3c;zur\u00fcck",nextText:"Vor&#x3e;",currentText:"heute",monthNames:"Januar,Februar,M\u00e4rz,April,Mai,Juni,Juli,August,September,Oktober,November,Dezember".split(","),monthNamesShort:"Jan,Feb,M\u00e4r,Apr,Mai,Jun,Jul,Aug,Sep,Okt,Nov,Dez".split(","),dayNames:"Sonntag,Montag,Dienstag,Mittwoch,Donnerstag,Freitag,Samstag".split(","),dayNamesShort:"So,Mo,Di,Mi,Do,Fr,Sa".split(","),dayNamesMin:"So,Mo,Di,Mi,Do,Fr,Sa".split(","),
dateFormat:"dd.mm.yy",firstDay:1,isRTL:!1};a.datepicker.setDefaults(a.datepicker.regional.de)});function MarkerManager(a,b){var c=this;c.map_=a;c.mapZoom_=a.getZoom();c.projection_=a.getCurrentMapType().getProjection();b=b||{};c.tileSize_=MarkerManager.DEFAULT_TILE_SIZE_;for(var e=a.getMapTypes(),d=e[0].getMaximumResolution(),f=0;f<e.length;f++){var g=e[f].getMaximumResolution();g>d&&(d=g)}c.maxZoom_=b.maxZoom||d;c.trackMarkers_=b.trackMarkers;c.show_=b.show||!0;e="number"===typeof b.borderPadding?b.borderPadding:MarkerManager.DEFAULT_BORDER_PADDING_;c.swPadding_=new GSize(-e,e);c.nePadding_=
new GSize(e,-e);c.borderPadding_=e;c.gridWidth_=[];c.grid_=[];c.grid_[c.maxZoom_]=[];c.numMarkers_=[];c.numMarkers_[c.maxZoom_]=0;GEvent.bind(a,"moveend",c,c.onMapMoveEnd_);c.removeOverlay_=function(b){a.removeOverlay(b);c.shownMarkers_--};c.addOverlay_=function(b){c.show_&&(a.addOverlay(b),c.shownMarkers_++)};c.resetManager_();c.shownMarkers_=0;c.shownBounds_=c.getMapGridBounds_()}MarkerManager.DEFAULT_TILE_SIZE_=1024;MarkerManager.DEFAULT_BORDER_PADDING_=100;
MarkerManager.MERCATOR_ZOOM_LEVEL_ZERO_RANGE=256;MarkerManager.prototype.resetManager_=function(){for(var a=MarkerManager.MERCATOR_ZOOM_LEVEL_ZERO_RANGE,b=0;b<=this.maxZoom_;++b)this.grid_[b]=[],this.numMarkers_[b]=0,this.gridWidth_[b]=Math.ceil(a/this.tileSize_),a<<=1};MarkerManager.prototype.clearMarkers=function(){this.processAll_(this.shownBounds_,this.removeOverlay_);this.resetManager_()};
MarkerManager.prototype.getTilePoint_=function(a,b,c){a=this.projection_.fromLatLngToPixel(a,b);return new GPoint(Math.floor((a.x+c.width)/this.tileSize_),Math.floor((a.y+c.height)/this.tileSize_))};MarkerManager.prototype.addMarkerBatch_=function(a,b,c){var e=a.getPoint();a.MarkerManager_minZoom=b;this.trackMarkers_&&GEvent.bind(a,"changed",this,this.onMarkerMoved_);for(e=this.getTilePoint_(e,c,GSize.ZERO);c>=b;c--)this.getGridCellCreate_(e.x,e.y,c).push(a),e.x>>=1,e.y>>=1};
MarkerManager.prototype.isGridPointVisible_=function(a){var b=this.shownBounds_.minY<=a.y&&a.y<=this.shownBounds_.maxY,c=this.shownBounds_.minX,e=c<=a.x&&a.x<=this.shownBounds_.maxX;!e&&0>c&&(e=this.gridWidth_[this.shownBounds_.z],e=c+e<=a.x&&a.x<=e-1);return b&&e};
MarkerManager.prototype.onMarkerMoved_=function(a,b,c){for(var e=this.maxZoom_,d=!1,b=this.getTilePoint_(b,e,GSize.ZERO),c=this.getTilePoint_(c,e,GSize.ZERO);0<=e&&(b.x!==c.x||b.y!==c.y);){var f=this.getGridCellNoCreate_(b.x,b.y,e);f&&this.removeFromArray_(f,a)&&this.getGridCellCreate_(c.x,c.y,e).push(a);e===this.mapZoom_&&(this.isGridPointVisible_(b)?this.isGridPointVisible_(c)||(this.removeOverlay_(a),d=!0):this.isGridPointVisible_(c)&&(this.addOverlay_(a),d=!0));b.x>>=1;b.y>>=1;c.x>>=1;c.y>>=1;
--e}d&&this.notifyListeners_()};MarkerManager.prototype.removeMarker=function(a){for(var b=this.maxZoom_,c=!1,e=this.getTilePoint_(a.getPoint(),b,GSize.ZERO);0<=b;){var d=this.getGridCellNoCreate_(e.x,e.y,b);d&&this.removeFromArray_(d,a);b===this.mapZoom_&&this.isGridPointVisible_(e)&&(this.removeOverlay_(a),c=!0);e.x>>=1;e.y>>=1;--b}c&&this.notifyListeners_();this.numMarkers_[a.MarkerManager_minZoom]--};
MarkerManager.prototype.addMarkers=function(a,b,c){for(var c=this.getOptMaxZoom_(c),e=a.length-1;0<=e;e--)this.addMarkerBatch_(a[e],b,c);this.numMarkers_[b]+=a.length};MarkerManager.prototype.getOptMaxZoom_=function(a){return a||this.maxZoom_};MarkerManager.prototype.getMarkerCount=function(a){for(var b=0,c=0;c<=a;c++)b+=this.numMarkers_[c];return b};
MarkerManager.prototype.getMarker=function(a,b,c){var e=new GLatLng(a,b),d=this.getTilePoint_(e,c,GSize.ZERO),e=new GMarker(e),c=this.getGridCellNoCreate_(d.x,d.y,c);if(void 0!=c)for(d=0;d<c.length;d++)a==c[d].getLatLng().lat()&&b==c[d].getLatLng().lng()&&(e=c[d]);return e};
MarkerManager.prototype.addMarker=function(a,b,c){c=this.getOptMaxZoom_(c);this.addMarkerBatch_(a,b,c);this.isGridPointVisible_(this.getTilePoint_(a.getPoint(),this.mapZoom_,GSize.ZERO))&&b<=this.shownBounds_.z&&this.shownBounds_.z<=c&&(this.addOverlay_(a),this.notifyListeners_());this.numMarkers_[b]++};GBounds.prototype.containsPoint=function(a){return this.minX<=a.x&&this.maxX>=a.x&&this.minY<=a.y&&this.maxY>=a.y};
MarkerManager.prototype.getGridCellCreate_=function(a,b,c){var e=this.grid_[c];0>a&&(a+=this.gridWidth_[c]);c=e[a];if(!c)return c=e[a]=[],c[b]=[];a=c[b];return!a?c[b]=[]:a};MarkerManager.prototype.getGridCellNoCreate_=function(a,b,c){var e=this.grid_[c];0>a&&(a+=this.gridWidth_[c]);return(a=e[a])?a[b]:void 0};
MarkerManager.prototype.getGridBounds_=function(a,b,c,e){var b=Math.min(b,this.maxZoom_),d=a.getSouthWest(),a=a.getNorthEast(),c=this.getTilePoint_(d,b,c),e=this.getTilePoint_(a,b,e),f=this.gridWidth_[b];if(a.lng()<d.lng()||e.x<c.x)c.x-=f;e.x-c.x+1>=f&&(c.x=0,e.x=f-1);d=new GBounds([c,e]);d.z=b;return d};MarkerManager.prototype.getMapGridBounds_=function(){return this.getGridBounds_(this.map_.getBounds(),this.mapZoom_,this.swPadding_,this.nePadding_)};
MarkerManager.prototype.onMapMoveEnd_=function(){this.objectSetTimeout_(this,this.updateMarkers_,0)};MarkerManager.prototype.objectSetTimeout_=function(a,b,c){return window.setTimeout(function(){b.call(a)},c)};MarkerManager.prototype.visible=function(){return this.show_?!0:!1};MarkerManager.prototype.isHidden=function(){return!this.show_};MarkerManager.prototype.show=function(){this.show_=!0;this.refresh()};MarkerManager.prototype.hide=function(){this.show_=!1;this.refresh()};
MarkerManager.prototype.toggle=function(){this.show_=!this.show_;this.refresh()};MarkerManager.prototype.refresh=function(){0<this.shownMarkers_&&this.processAll_(this.shownBounds_,this.removeOverlay_);this.show_&&this.processAll_(this.shownBounds_,this.addOverlay_);this.notifyListeners_()};
MarkerManager.prototype.updateMarkers_=function(){this.mapZoom_=this.map_.getZoom();var a=this.getMapGridBounds_();a.equals(this.shownBounds_)&&a.z===this.shownBounds_.z||(a.z!==this.shownBounds_.z?(this.processAll_(this.shownBounds_,this.removeOverlay_),this.show_&&this.processAll_(a,this.addOverlay_)):(this.rectangleDiff_(this.shownBounds_,a,this.removeCellMarkers_),this.show_&&this.rectangleDiff_(a,this.shownBounds_,this.addCellMarkers_)),this.shownBounds_=a,this.notifyListeners_())};
MarkerManager.prototype.notifyListeners_=function(){GEvent.trigger(this,"changed",this.shownBounds_,this.shownMarkers_)};MarkerManager.prototype.processAll_=function(a,b){for(var c=a.minX;c<=a.maxX;c++)for(var e=a.minY;e<=a.maxY;e++)this.processCellMarkers_(c,e,a.z,b)};MarkerManager.prototype.processCellMarkers_=function(a,b,c,e){if(a=this.getGridCellNoCreate_(a,b,c))for(b=a.length-1;0<=b;b--)e(a[b])};MarkerManager.prototype.removeCellMarkers_=function(a,b,c){this.processCellMarkers_(a,b,c,this.removeOverlay_)};
MarkerManager.prototype.addCellMarkers_=function(a,b,c){this.processCellMarkers_(a,b,c,this.addOverlay_)};MarkerManager.prototype.rectangleDiff_=function(a,b,c){var e=this;e.rectangleDiffCoords_(a,b,function(b,f){c.apply(e,[b,f,a.z])})};
MarkerManager.prototype.rectangleDiffCoords_=function(a,b,c){var e=a.minX,d=a.minY,f=a.maxX,a=a.maxY,g=b.minX,k=b.minY,h=b.maxX,b=b.maxY,l,m;for(l=e;l<=f;l++){for(m=d;m<=a&&m<k;m++)c(l,m);for(m=Math.max(b+1,d);m<=a;m++)c(l,m)}for(m=Math.max(d,k);m<=Math.min(a,b);m++){for(l=Math.min(f+1,g)-1;l>=e;l--)c(l,m);for(l=Math.max(e,h+1);l<=f;l++)c(l,m)}};MarkerManager.prototype.removeFromArray_=function(a,b,c){for(var e=0,d=0;d<a.length;++d)if(a[d]===b||c&&a[d]===b)a.splice(d--,1),e++;return e};var SWFUpload;void 0==SWFUpload&&(SWFUpload=function(a){this.initSWFUpload(a)});SWFUpload.prototype.initSWFUpload=function(a){try{this.customSettings={},this.settings=a,this.eventQueue=[],this.movieName="SWFUpload_"+SWFUpload.movieCount++,this.movieElement=null,SWFUpload.instances[this.movieName]=this,this.initSettings(),this.loadFlash(),this.displayDebugInfo()}catch(b){throw delete SWFUpload.instances[this.movieName],b;}};SWFUpload.instances={};SWFUpload.movieCount=0;SWFUpload.version="2.2.0 2009-03-25";
SWFUpload.QUEUE_ERROR={QUEUE_LIMIT_EXCEEDED:-100,FILE_EXCEEDS_SIZE_LIMIT:-110,ZERO_BYTE_FILE:-120,INVALID_FILETYPE:-130};SWFUpload.UPLOAD_ERROR={HTTP_ERROR:-200,MISSING_UPLOAD_URL:-210,IO_ERROR:-220,SECURITY_ERROR:-230,UPLOAD_LIMIT_EXCEEDED:-240,UPLOAD_FAILED:-250,SPECIFIED_FILE_ID_NOT_FOUND:-260,FILE_VALIDATION_FAILED:-270,FILE_CANCELLED:-280,UPLOAD_STOPPED:-290};SWFUpload.FILE_STATUS={QUEUED:-1,IN_PROGRESS:-2,ERROR:-3,COMPLETE:-4,CANCELLED:-5};
SWFUpload.BUTTON_ACTION={SELECT_FILE:-100,SELECT_FILES:-110,START_UPLOAD:-120};SWFUpload.CURSOR={ARROW:-1,HAND:-2};SWFUpload.WINDOW_MODE={WINDOW:"window",TRANSPARENT:"transparent",OPAQUE:"opaque"};SWFUpload.completeURL=function(a){if(!a||"string"!==typeof a||a.match(/^https?:\/\//i)||a.match(/^\//))return a;var b=window.location.pathname.lastIndexOf("/");path=0>=b?"/":window.location.pathname.substr(0,b)+"/";return path+a};
SWFUpload.prototype.initSettings=function(){this.ensureDefault=function(a,b){this.settings[a]=void 0==this.settings[a]?b:this.settings[a]};this.ensureDefault("upload_url","");this.ensureDefault("preserve_relative_urls",!1);this.ensureDefault("file_post_name","Filedata");this.ensureDefault("post_params",{});this.ensureDefault("use_query_string",!1);this.ensureDefault("requeue_on_error",!1);this.ensureDefault("http_success",[]);this.ensureDefault("assume_success_timeout",0);this.ensureDefault("file_types",
"*.*");this.ensureDefault("file_types_description","All Files");this.ensureDefault("file_size_limit",0);this.ensureDefault("file_upload_limit",0);this.ensureDefault("file_queue_limit",0);this.ensureDefault("flash_url","swfupload.swf");this.ensureDefault("prevent_swf_caching",!0);this.ensureDefault("button_image_url","");this.ensureDefault("button_width",1);this.ensureDefault("button_height",1);this.ensureDefault("button_text","");this.ensureDefault("button_text_style","color: #000000; font-size: 16pt;");
this.ensureDefault("button_text_top_padding",0);this.ensureDefault("button_text_left_padding",0);this.ensureDefault("button_action",SWFUpload.BUTTON_ACTION.SELECT_FILES);this.ensureDefault("button_disabled",!1);this.ensureDefault("button_placeholder_id","");this.ensureDefault("button_placeholder",null);this.ensureDefault("button_cursor",SWFUpload.CURSOR.ARROW);this.ensureDefault("button_window_mode",SWFUpload.WINDOW_MODE.WINDOW);this.ensureDefault("debug",!1);this.settings.debug_enabled=this.settings.debug;
this.settings.return_upload_start_handler=this.returnUploadStart;this.ensureDefault("swfupload_loaded_handler",null);this.ensureDefault("file_dialog_start_handler",null);this.ensureDefault("file_queued_handler",null);this.ensureDefault("file_queue_error_handler",null);this.ensureDefault("file_dialog_complete_handler",null);this.ensureDefault("upload_start_handler",null);this.ensureDefault("upload_progress_handler",null);this.ensureDefault("upload_error_handler",null);this.ensureDefault("upload_success_handler",
null);this.ensureDefault("upload_complete_handler",null);this.ensureDefault("debug_handler",this.debugMessage);this.ensureDefault("custom_settings",{});this.customSettings=this.settings.custom_settings;this.settings.prevent_swf_caching&&(this.settings.flash_url=this.settings.flash_url+(0>this.settings.flash_url.indexOf("?")?"?":"&")+"preventswfcaching="+(new Date).getTime());this.settings.preserve_relative_urls||(this.settings.upload_url=SWFUpload.completeURL(this.settings.upload_url),this.settings.button_image_url=
SWFUpload.completeURL(this.settings.button_image_url));delete this.ensureDefault};
SWFUpload.prototype.loadFlash=function(){var a,b;if(null!==document.getElementById(this.movieName))throw"ID "+this.movieName+" is already in use. The Flash Object could not be added";a=document.getElementById(this.settings.button_placeholder_id)||this.settings.button_placeholder;if(void 0==a)throw"Could not find the placeholder element: "+this.settings.button_placeholder_id;b=document.createElement("div");b.innerHTML=this.getFlashHTML();a.parentNode.replaceChild(b.firstChild,a);void 0==window[this.movieName]&&
(window[this.movieName]=this.getMovieElement())};
SWFUpload.prototype.getFlashHTML=function(){return['<object id="',this.movieName,'" type="application/x-shockwave-flash" data="',this.settings.flash_url,'" width="',this.settings.button_width,'" height="',this.settings.button_height,'" class="swfupload"><param name="wmode" value="',this.settings.button_window_mode,'" /><param name="movie" value="',this.settings.flash_url,'" /><param name="quality" value="high" /><param name="menu" value="false" /><param name="allowScriptAccess" value="always" />','<param name="flashvars" value="'+
this.getFlashVars()+'" />',"</object>"].join("")};
SWFUpload.prototype.getFlashVars=function(){var a=this.buildParamString(),b=this.settings.http_success.join(",");return["movieName=",encodeURIComponent(this.movieName),"&amp;uploadURL=",encodeURIComponent(this.settings.upload_url),"&amp;useQueryString=",encodeURIComponent(this.settings.use_query_string),"&amp;requeueOnError=",encodeURIComponent(this.settings.requeue_on_error),"&amp;httpSuccess=",encodeURIComponent(b),"&amp;assumeSuccessTimeout=",encodeURIComponent(this.settings.assume_success_timeout),"&amp;params=",
encodeURIComponent(a),"&amp;filePostName=",encodeURIComponent(this.settings.file_post_name),"&amp;fileTypes=",encodeURIComponent(this.settings.file_types),"&amp;fileTypesDescription=",encodeURIComponent(this.settings.file_types_description),"&amp;fileSizeLimit=",encodeURIComponent(this.settings.file_size_limit),"&amp;fileUploadLimit=",encodeURIComponent(this.settings.file_upload_limit),"&amp;fileQueueLimit=",encodeURIComponent(this.settings.file_queue_limit),"&amp;debugEnabled=",encodeURIComponent(this.settings.debug_enabled),
"&amp;buttonImageURL=",encodeURIComponent(this.settings.button_image_url),"&amp;buttonWidth=",encodeURIComponent(this.settings.button_width),"&amp;buttonHeight=",encodeURIComponent(this.settings.button_height),"&amp;buttonText=",encodeURIComponent(this.settings.button_text),"&amp;buttonTextTopPadding=",encodeURIComponent(this.settings.button_text_top_padding),"&amp;buttonTextLeftPadding=",encodeURIComponent(this.settings.button_text_left_padding),"&amp;buttonTextStyle=",encodeURIComponent(this.settings.button_text_style),
"&amp;buttonAction=",encodeURIComponent(this.settings.button_action),"&amp;buttonDisabled=",encodeURIComponent(this.settings.button_disabled),"&amp;buttonCursor=",encodeURIComponent(this.settings.button_cursor)].join("")};SWFUpload.prototype.getMovieElement=function(){void 0==this.movieElement&&(this.movieElement=document.getElementById(this.movieName));if(null===this.movieElement)throw"Could not find Flash element";return this.movieElement};
SWFUpload.prototype.buildParamString=function(){var a=this.settings.post_params,b=[];if("object"===typeof a)for(var c in a)a.hasOwnProperty(c)&&b.push(encodeURIComponent(c.toString())+"="+encodeURIComponent(a[c].toString()));return b.join("&amp;")};
SWFUpload.prototype.destroy=function(){try{this.cancelUpload(null,!1);var a=null;if((a=this.getMovieElement())&&"unknown"===typeof a.CallFunction){for(var b in a)try{"function"===typeof a[b]&&(a[b]=null)}catch(c){}try{a.parentNode.removeChild(a)}catch(e){}}window[this.movieName]=null;SWFUpload.instances[this.movieName]=null;delete SWFUpload.instances[this.movieName];this.movieName=this.eventQueue=this.customSettings=this.settings=this.movieElement=null;return!0}catch(d){return!1}};
SWFUpload.prototype.displayDebugInfo=function(){this.debug(["---SWFUpload Instance Info---\nVersion: ",SWFUpload.version,"\nMovie Name: ",this.movieName,"\nSettings:\n\tupload_url:               ",this.settings.upload_url,"\n\tflash_url:                ",this.settings.flash_url,"\n\tuse_query_string:         ",this.settings.use_query_string.toString(),"\n\trequeue_on_error:         ",this.settings.requeue_on_error.toString(),"\n\thttp_success:             ",this.settings.http_success.join(", "),"\n\tassume_success_timeout:   ",
this.settings.assume_success_timeout,"\n\tfile_post_name:           ",this.settings.file_post_name,"\n\tpost_params:              ",this.settings.post_params.toString(),"\n\tfile_types:               ",this.settings.file_types,"\n\tfile_types_description:   ",this.settings.file_types_description,"\n\tfile_size_limit:          ",this.settings.file_size_limit,"\n\tfile_upload_limit:        ",this.settings.file_upload_limit,"\n\tfile_queue_limit:         ",this.settings.file_queue_limit,"\n\tdebug:                    ",
this.settings.debug.toString(),"\n\tprevent_swf_caching:      ",this.settings.prevent_swf_caching.toString(),"\n\tbutton_placeholder_id:    ",this.settings.button_placeholder_id.toString(),"\n\tbutton_placeholder:       ",this.settings.button_placeholder?"Set":"Not Set","\n\tbutton_image_url:         ",this.settings.button_image_url.toString(),"\n\tbutton_width:             ",this.settings.button_width.toString(),"\n\tbutton_height:            ",this.settings.button_height.toString(),"\n\tbutton_text:              ",
this.settings.button_text.toString(),"\n\tbutton_text_style:        ",this.settings.button_text_style.toString(),"\n\tbutton_text_top_padding:  ",this.settings.button_text_top_padding.toString(),"\n\tbutton_text_left_padding: ",this.settings.button_text_left_padding.toString(),"\n\tbutton_action:            ",this.settings.button_action.toString(),"\n\tbutton_disabled:          ",this.settings.button_disabled.toString(),"\n\tcustom_settings:          ",this.settings.custom_settings.toString(),"\nEvent Handlers:\n\tswfupload_loaded_handler assigned:  ",
("function"===typeof this.settings.swfupload_loaded_handler).toString(),"\n\tfile_dialog_start_handler assigned: ",("function"===typeof this.settings.file_dialog_start_handler).toString(),"\n\tfile_queued_handler assigned:       ",("function"===typeof this.settings.file_queued_handler).toString(),"\n\tfile_queue_error_handler assigned:  ",("function"===typeof this.settings.file_queue_error_handler).toString(),"\n\tupload_start_handler assigned:      ",("function"===typeof this.settings.upload_start_handler).toString(),
"\n\tupload_progress_handler assigned:   ",("function"===typeof this.settings.upload_progress_handler).toString(),"\n\tupload_error_handler assigned:      ",("function"===typeof this.settings.upload_error_handler).toString(),"\n\tupload_success_handler assigned:    ",("function"===typeof this.settings.upload_success_handler).toString(),"\n\tupload_complete_handler assigned:   ",("function"===typeof this.settings.upload_complete_handler).toString(),"\n\tdebug_handler assigned:             ",("function"===
typeof this.settings.debug_handler).toString(),"\n"].join(""))};SWFUpload.prototype.addSetting=function(a,b,c){return void 0==b?this.settings[a]=c:this.settings[a]=b};SWFUpload.prototype.getSetting=function(a){return void 0!=this.settings[a]?this.settings[a]:""};
SWFUpload.prototype.callFlash=function(a,b){var b=b||[],c=this.getMovieElement(),e,d;try{d=c.CallFunction('<invoke name="'+a+'" returntype="javascript">'+__flash__argumentsToXML(b,0)+"</invoke>"),e=eval(d)}catch(f){throw"Call to "+a+" failed";}void 0!=e&&"object"===typeof e.post&&(e=this.unescapeFilePostParams(e));return e};SWFUpload.prototype.selectFile=function(){this.callFlash("SelectFile")};SWFUpload.prototype.selectFiles=function(){this.callFlash("SelectFiles")};
SWFUpload.prototype.startUpload=function(a){this.callFlash("StartUpload",[a])};SWFUpload.prototype.cancelUpload=function(a,b){!1!==b&&(b=!0);this.callFlash("CancelUpload",[a,b])};SWFUpload.prototype.stopUpload=function(){this.callFlash("StopUpload")};SWFUpload.prototype.getStats=function(){return this.callFlash("GetStats")};SWFUpload.prototype.setStats=function(a){this.callFlash("SetStats",[a])};
SWFUpload.prototype.getFile=function(a){return"number"===typeof a?this.callFlash("GetFileByIndex",[a]):this.callFlash("GetFile",[a])};SWFUpload.prototype.addFileParam=function(a,b,c){return this.callFlash("AddFileParam",[a,b,c])};SWFUpload.prototype.removeFileParam=function(a,b){this.callFlash("RemoveFileParam",[a,b])};SWFUpload.prototype.setUploadURL=function(a){this.settings.upload_url=a.toString();this.callFlash("SetUploadURL",[a])};
SWFUpload.prototype.setPostParams=function(a){this.settings.post_params=a;this.callFlash("SetPostParams",[a])};SWFUpload.prototype.addPostParam=function(a,b){this.settings.post_params[a]=b;this.callFlash("SetPostParams",[this.settings.post_params])};SWFUpload.prototype.removePostParam=function(a){delete this.settings.post_params[a];this.callFlash("SetPostParams",[this.settings.post_params])};
SWFUpload.prototype.setFileTypes=function(a,b){this.settings.file_types=a;this.settings.file_types_description=b;this.callFlash("SetFileTypes",[a,b])};SWFUpload.prototype.setFileSizeLimit=function(a){this.settings.file_size_limit=a;this.callFlash("SetFileSizeLimit",[a])};SWFUpload.prototype.setFileUploadLimit=function(a){this.settings.file_upload_limit=a;this.callFlash("SetFileUploadLimit",[a])};
SWFUpload.prototype.setFileQueueLimit=function(a){this.settings.file_queue_limit=a;this.callFlash("SetFileQueueLimit",[a])};SWFUpload.prototype.setFilePostName=function(a){this.settings.file_post_name=a;this.callFlash("SetFilePostName",[a])};SWFUpload.prototype.setUseQueryString=function(a){this.settings.use_query_string=a;this.callFlash("SetUseQueryString",[a])};SWFUpload.prototype.setRequeueOnError=function(a){this.settings.requeue_on_error=a;this.callFlash("SetRequeueOnError",[a])};
SWFUpload.prototype.setHTTPSuccess=function(a){"string"===typeof a&&(a=a.replace(" ","").split(","));this.settings.http_success=a;this.callFlash("SetHTTPSuccess",[a])};SWFUpload.prototype.setAssumeSuccessTimeout=function(a){this.settings.assume_success_timeout=a;this.callFlash("SetAssumeSuccessTimeout",[a])};SWFUpload.prototype.setDebugEnabled=function(a){this.settings.debug_enabled=a;this.callFlash("SetDebugEnabled",[a])};
SWFUpload.prototype.setButtonImageURL=function(a){void 0==a&&(a="");this.settings.button_image_url=a;this.callFlash("SetButtonImageURL",[a])};SWFUpload.prototype.setButtonDimensions=function(a,b){this.settings.button_width=a;this.settings.button_height=b;var c=this.getMovieElement();void 0!=c&&(c.style.width=a+"px",c.style.height=b+"px");this.callFlash("SetButtonDimensions",[a,b])};SWFUpload.prototype.setButtonText=function(a){this.settings.button_text=a;this.callFlash("SetButtonText",[a])};
SWFUpload.prototype.setButtonTextPadding=function(a,b){this.settings.button_text_top_padding=b;this.settings.button_text_left_padding=a;this.callFlash("SetButtonTextPadding",[a,b])};SWFUpload.prototype.setButtonTextStyle=function(a){this.settings.button_text_style=a;this.callFlash("SetButtonTextStyle",[a])};SWFUpload.prototype.setButtonDisabled=function(a){this.settings.button_disabled=a;this.callFlash("SetButtonDisabled",[a])};
SWFUpload.prototype.setButtonAction=function(a){this.settings.button_action=a;this.callFlash("SetButtonAction",[a])};SWFUpload.prototype.setButtonCursor=function(a){this.settings.button_cursor=a;this.callFlash("SetButtonCursor",[a])};
SWFUpload.prototype.queueEvent=function(a,b){void 0==b?b=[]:b instanceof Array||(b=[b]);var c=this;if("function"===typeof this.settings[a])this.eventQueue.push(function(){this.settings[a].apply(this,b)}),setTimeout(function(){c.executeNextEvent()},0);else if(null!==this.settings[a])throw"Event handler "+a+" is unknown or is not a function";};SWFUpload.prototype.executeNextEvent=function(){var a=this.eventQueue?this.eventQueue.shift():null;"function"===typeof a&&a.apply(this)};
SWFUpload.prototype.unescapeFilePostParams=function(a){var b=/[$]([0-9a-f]{4})/i,c={},e;if(void 0!=a){for(var d in a.post)if(a.post.hasOwnProperty(d)){e=d;for(var f;null!==(f=b.exec(e));)e=e.replace(f[0],String.fromCharCode(parseInt("0x"+f[1],16)));c[e]=a.post[d]}a.post=c}return a};SWFUpload.prototype.testExternalInterface=function(){try{return this.callFlash("TestExternalInterface")}catch(a){return!1}};
SWFUpload.prototype.flashReady=function(){var a=this.getMovieElement();a?(this.cleanUp(a),this.queueEvent("swfupload_loaded_handler")):this.debug("Flash called back ready but the flash movie can't be found.")};
SWFUpload.prototype.cleanUp=function(a){try{if(this.movieElement&&"unknown"===typeof a.CallFunction){this.debug("Removing Flash functions hooks (this should only run in IE and should prevent memory leaks)");for(var b in a)try{"function"===typeof a[b]&&(a[b]=null)}catch(c){}}}catch(e){}window.__flash__removeCallback=function(a,c){try{a&&(a[c]=null)}catch(b){}}};SWFUpload.prototype.fileDialogStart=function(){this.queueEvent("file_dialog_start_handler")};
SWFUpload.prototype.fileQueued=function(a){a=this.unescapeFilePostParams(a);this.queueEvent("file_queued_handler",a)};SWFUpload.prototype.fileQueueError=function(a,b,c){a=this.unescapeFilePostParams(a);this.queueEvent("file_queue_error_handler",[a,b,c])};SWFUpload.prototype.fileDialogComplete=function(a,b,c){this.queueEvent("file_dialog_complete_handler",[a,b,c])};SWFUpload.prototype.uploadStart=function(a){a=this.unescapeFilePostParams(a);this.queueEvent("return_upload_start_handler",a)};
SWFUpload.prototype.returnUploadStart=function(a){var b;if("function"===typeof this.settings.upload_start_handler)a=this.unescapeFilePostParams(a),b=this.settings.upload_start_handler.call(this,a);else if(void 0!=this.settings.upload_start_handler)throw"upload_start_handler must be a function";void 0===b&&(b=!0);this.callFlash("ReturnUploadStart",[!!b])};SWFUpload.prototype.uploadProgress=function(a,b,c){a=this.unescapeFilePostParams(a);this.queueEvent("upload_progress_handler",[a,b,c])};
SWFUpload.prototype.uploadError=function(a,b,c){a=this.unescapeFilePostParams(a);this.queueEvent("upload_error_handler",[a,b,c])};SWFUpload.prototype.uploadSuccess=function(a,b,c){a=this.unescapeFilePostParams(a);this.queueEvent("upload_success_handler",[a,b,c])};SWFUpload.prototype.uploadComplete=function(a){a=this.unescapeFilePostParams(a);this.queueEvent("upload_complete_handler",a)};SWFUpload.prototype.debug=function(a){this.queueEvent("debug_handler",a)};
SWFUpload.prototype.debugMessage=function(a){if(this.settings.debug){var b=[];if("object"===typeof a&&"string"===typeof a.name&&"string"===typeof a.message){for(var c in a)a.hasOwnProperty(c)&&b.push(c+": "+a[c]);a=b.join("\n")||"";b=a.split("\n");a="EXCEPTION: "+b.join("\nEXCEPTION: ")}SWFUpload.Console.writeLine(a)}};SWFUpload.Console={};
SWFUpload.Console.writeLine=function(a){var b,c;try{b=document.getElementById("SWFUpload_Console"),b||(c=document.createElement("form"),document.getElementsByTagName("body")[0].appendChild(c),b=document.createElement("textarea"),b.id="SWFUpload_Console",b.style.fontFamily="monospace",b.setAttribute("wrap","off"),b.wrap="off",b.style.overflow="auto",b.style.width="700px",b.style.height="350px",b.style.margin="5px",c.appendChild(b)),b.value+=a+"\n",b.scrollTop=b.scrollHeight-b.clientHeight}catch(e){alert("Exception: "+
e.name+" Message: "+e.message)}};(function(a){var b="swfupload_loaded_handler,file_queued_handler,file_queue_error_handler,file_dialog_start_handler,file_dialog_complete_handler,upload_start_handler,upload_progress_handler,upload_error_handler,upload_success_handler,upload_complete_handler,queue_complete_handler".split(","),c=[];a.fn.swfupload=function(){var e=a.makeArray(arguments);return this.each(function(){var d;if(1==e.length&&"object"==typeof e[0]){if(d=a(this).data("__swfu"),!d){var f=e[0],g=a(this);d=[];a.merge(d,b);a.merge(d,
c);a.each(d,function(c,b){var e=b.replace(/_handler$/,"").replace(/_([a-z])/g,function(a,c){return c.toUpperCase()});f[b]=function(){var c=a.Event(e);g.trigger(c,a.makeArray(arguments));return!c.isDefaultPrevented()}});a(this).data("__swfu",new SWFUpload(f))}}else if(0<e.length&&"string"==typeof e[0]){var k=e.shift();(d=a(this).data("__swfu"))&&d[k]&&d[k].apply(d,e)}})};a.swfupload={additionalHandlers:function(){if(0===arguments.length)return c.slice();a(arguments).each(function(b,d){a.merge(c,a.makeArray(d))})},
defaultHandlers:function(){return b.slice()},getInstance:function(c){return a(c).data("__swfu")}}})(jQuery);(function(a){a.fn.autogrow=function(){this.filter("textarea").each(function(){var b=a(this),c=b.height();b.css("lineHeight");var e=a("<div></div>").css({position:"absolute",top:-1E4,left:-1E4,width:a(this).width(),fontSize:b.css("fontSize"),fontFamily:b.css("fontFamily"),lineHeight:b.css("lineHeight"),resize:"none"}).appendTo(document.body),b=function(){if(e.width()){c||(c=a(this).height());var b=this.value.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/&/g,"&amp;").replace(/\n/g,"<br/>");e.html(b);
a(this).css("height",Math.max(e.height()+20,c))}else e.css("width",a(this).width())};a(this).change(b).keyup(b).keydown(b);b.apply(this)});return this}})(jQuery);(function(a){a.extend(a.fn,{clearingInput:function(b){b=a.extend({blurClass:"blur"},b);return this.each(function(){var c=a(this).addClass(b.blurClass),e=c.parents("form:first"),d,f;if(!(d=b.text))if(!(d=c.attr("title")))d=((d=e.find("label[for="+c.attr("id")+"]"))?d.css({position:"absolute",left:"-9999px"}).text():"")||c.val();if(f=d)c.val(f),c.blur(function(){""===c.val()&&c.val(f).addClass(b.blurClass)}).focus(function(){c.val()===f&&c.val("");c.removeClass(b.blurClass)}),e.submit(function(){c.hasClass(b.blurClass)&&
c.val("")}),c.blur()})}})})(jQuery);(function(a){function b(){a.fn.ajaxSubmit.debug&&window.console&&window.console.log&&window.console.log("[jquery.form] "+Array.prototype.join.call(arguments,""))}a.fn.ajaxSubmit=function(c){function e(){function b(){if(!s++){m.detachEvent?m.detachEvent("onload",b):m.removeEventListener("load",b,!1);var c=!0;try{if(t)throw"timeout";var d,f;f=m.contentWindow?m.contentWindow.document:m.contentDocument?m.contentDocument:m.document;if((null==f.body||""==f.body.innerHTML)&&!u){u=1;s--;setTimeout(b,100);
return}o.responseText=f.body?f.body.innerHTML:null;o.responseXML=f.XMLDocument?f.XMLDocument:f;o.getResponseHeader=function(a){return{"content-type":g.dataType}[a]};if("json"==g.dataType||"script"==g.dataType){var h=f.getElementsByTagName("textarea")[0];o.responseText=h?h.value:o.responseText}else"xml"==g.dataType&&!o.responseXML&&null!=o.responseText&&(o.responseXML=e(o.responseText));d=a.httpData(o,g.dataType)}catch(k){c=!1,a.handleError(g,o,"error",k)}c&&(g.success(d,"success"),r&&a.event.trigger("ajaxSuccess",
[o,g]));r&&a.event.trigger("ajaxComplete",[o,g]);r&&!--a.active&&a.event.trigger("ajaxStop");g.complete&&g.complete(o,c?"success":"error");setTimeout(function(){l.remove();o.responseXML=null},100)}}function e(a,c){window.ActiveXObject?(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(a)):c=(new DOMParser).parseFromString(a,"text/xml");return c&&c.documentElement&&"parsererror"!=c.documentElement.tagName?c:null}var d=h[0];if(a(":input[name=submit]",d).length)alert('Error: Form elements must not be named "submit".');
else{var g=a.extend({},a.ajaxSettings,c),f=jQuery.extend(!0,{},a.extend(!0,{},a.ajaxSettings),g),k="jqFormIO"+(new Date).getTime(),l=a('<iframe id="'+k+'" name="'+k+'" src="javascript:false;document.write("");" />'),m=l[0];l.css({position:"absolute",top:"-1000px",left:"-1000px"});var o={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(){this.aborted=1;l.attr("src","about:blank")}},
r=g.global;r&&!a.active++&&a.event.trigger("ajaxStart");r&&a.event.trigger("ajaxSend",[o,g]);if(f.beforeSend&&!1===f.beforeSend(o,f))f.global&&jQuery.active--;else if(!o.aborted){var s=0,t=0;if(f=d.clk){var v=f.name;v&&!f.disabled&&(c.extraData=c.extraData||{},c.extraData[v]=f.value,"image"==f.type&&(c.extraData[name+".x"]=d.clk_x,c.extraData[name+".y"]=d.clk_y))}setTimeout(function(){var e=h.attr("target"),f=h.attr("action");d.setAttribute("target",k);"POST"!=d.getAttribute("method")&&d.setAttribute("method",
"POST");d.getAttribute("action")!=g.url&&d.setAttribute("action",g.url);c.skipEncodingOverride||h.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"});g.timeout&&setTimeout(function(){t=!0;b()},g.timeout);var p=[];try{if(c.extraData)for(var o in c.extraData)p.push(a('<input type="hidden" name="'+o+'" value="'+c.extraData[o]+'" />').appendTo(d)[0]);l.appendTo("body");m.attachEvent?m.attachEvent("onload",b):m.addEventListener("load",b,!1);d.submit()}finally{d.setAttribute("action",f),
e?d.setAttribute("target",e):h.removeAttr("target"),a(p).remove()}},10);var u=0}}}if(!this.length)return b("ajaxSubmit: skipping submit process - no element selected"),this;"function"==typeof c&&(c={success:c});var c=a.extend({url:this.attr("action")||window.location.toString(),type:this.attr("method")||"GET"},c||{}),d={};this.trigger("form-pre-serialize",[this,c,d]);if(d.veto)return b("ajaxSubmit: submit vetoed via form-pre-serialize trigger"),this;if(c.beforeSerialize&&!1===c.beforeSerialize(this,
c))return b("ajaxSubmit: submit aborted via beforeSerialize callback"),this;var f=this.formToArray(c.semantic);if(c.data){c.extraData=c.data;for(var g in c.data)if(c.data[g]instanceof Array)for(var k in c.data[g])f.push({name:g,value:c.data[g][k]});else f.push({name:g,value:c.data[g]})}if(c.beforeSubmit&&!1===c.beforeSubmit(f,this,c))return b("ajaxSubmit: submit aborted via beforeSubmit callback"),this;this.trigger("form-submit-validate",[f,this,c,d]);if(d.veto)return b("ajaxSubmit: submit vetoed via form-submit-validate trigger"),
this;d=a.param(f);"GET"==c.type.toUpperCase()?(c.url+=(0<=c.url.indexOf("?")?"&":"?")+d,c.data=null):c.data=d;var h=this,l=[];c.resetForm&&l.push(function(){h.resetForm()});c.clearForm&&l.push(function(){h.clearForm()});if(!c.dataType&&c.target){var m=c.success||function(){};l.push(function(b){a(c.target).html(b).each(m,arguments)})}else c.success&&l.push(c.success);c.success=function(a,b){for(var e=0,d=l.length;e<d;e++)l[e].apply(c,[a,b,h])};d=a("input:file",this).fieldValue();f=!1;for(g=0;g<d.length;g++)d[g]&&
(f=!0);c.iframe||f?c.closeKeepAlive?a.get(c.closeKeepAlive,e):e():a.ajax(c);this.trigger("form-submit-notify",[this,c]);return this};a.fn.ajaxForm=function(c){return this.ajaxFormUnbind().bind("submit.form-plugin",function(){a(this).ajaxSubmit(c);return!1}).each(function(){a(":submit,input:image",this).bind("click.form-plugin",function(c){var b=this.form;b.clk=this;if("image"==this.type)if(void 0!=c.offsetX)b.clk_x=c.offsetX,b.clk_y=c.offsetY;else if("function"==typeof a.fn.offset){var f=a(this).offset();
b.clk_x=c.pageX-f.left;b.clk_y=c.pageY-f.top}else b.clk_x=c.pageX-this.offsetLeft,b.clk_y=c.pageY-this.offsetTop;setTimeout(function(){b.clk=b.clk_x=b.clk_y=null},10)})})};a.fn.ajaxFormUnbind=function(){this.unbind("submit.form-plugin");return this.each(function(){a(":submit,input:image",this).unbind("click.form-plugin")})};a.fn.formToArray=function(c){var b=[{name:"ajax",value:!0}];if(0==this.length)return b;var d=this[0],f=c?d.getElementsByTagName("*"):d.elements;if(!f)return b;for(var g=0,k=f.length;g<
k;g++){var h=f[g],l=h.name;if(l)if(c&&d.clk&&"image"==h.type)!h.disabled&&d.clk==h&&b.push({name:l+".x",value:d.clk_x},{name:l+".y",value:d.clk_y});else if((h=a.fieldValue(h,!0))&&h.constructor==Array)for(var m=0,n=h.length;m<n;m++)b.push({name:l,value:h[m]});else null!==h&&"undefined"!=typeof h&&b.push({name:l,value:h})}if(!c&&d.clk){c=d.getElementsByTagName("input");g=0;for(k=c.length;g<k;g++)f=c[g],(l=f.name)&&!f.disabled&&"image"==f.type&&d.clk==f&&b.push({name:l+".x",value:d.clk_x},{name:l+".y",
value:d.clk_y})}return b};a.fn.formSerialize=function(c){return a.param(this.formToArray(c))};a.fn.fieldSerialize=function(c){var b=[];this.each(function(){var d=this.name;if(d){var f=a.fieldValue(this,c);if(f&&f.constructor==Array)for(var g=0,k=f.length;g<k;g++)b.push({name:d,value:f[g]});else null!==f&&"undefined"!=typeof f&&b.push({name:this.name,value:f})}});return a.param(b)};a.fn.fieldValue=function(c){for(var b=[],d=0,f=this.length;d<f;d++){var g=a.fieldValue(this[d],c);null===g||"undefined"==
typeof g||g.constructor==Array&&!g.length||(g.constructor==Array?a.merge(b,g):b.push(g))}return b};a.fieldValue=function(a,b){var d=a.name,f=a.type,g=a.tagName.toLowerCase();"undefined"==typeof b&&(b=!0);if(b&&(!d||a.disabled||"reset"==f||"button"==f||("checkbox"==f||"radio"==f)&&!a.checked||("submit"==f||"image"==f)&&a.form&&a.form.clk!=a||"select"==g&&-1==a.selectedIndex))return null;if("select"==g){var k=a.selectedIndex;if(0>k)return null;for(var d=[],g=a.options,h=(f="select-one"==f)?k+1:g.length,
k=f?k:0;k<h;k++){var l=g[k];if(l.selected){var m=l.value;m||(m=l.attributes&&l.attributes.value&&!l.attributes.value.specified?l.text:l.value);if(f)return m;d.push(m)}}return d}return a.value};a.fn.clearForm=function(){return this.each(function(){a("input,select,textarea",this).clearFields()})};a.fn.clearFields=a.fn.clearInputs=function(){return this.each(function(){var a=this.type,b=this.tagName.toLowerCase();"text"==a||"password"==a||"textarea"==b?this.value="":"checkbox"==a||"radio"==a?this.checked=
!1:"select"==b&&(this.selectedIndex=-1)})};a.fn.resetForm=function(){return this.each(function(){("function"==typeof this.reset||"object"==typeof this.reset&&!this.reset.nodeType)&&this.reset()})};a.fn.enable=function(a){void 0==a&&(a=!0);return this.each(function(){this.disabled=!a})};a.fn.selected=function(c){void 0==c&&(c=!0);return this.each(function(){var b=this.type;"checkbox"==b||"radio"==b?this.checked=c:"option"==this.tagName.toLowerCase()&&(b=a(this).parent("select"),c&&b[0]&&"select-one"==
b[0].type&&b.find("option").selected(!1),this.selected=c)})}})(jQuery);(function(a){a.extend(a.fn,{livequery:function(c,b,d){var f=this,g;a.isFunction(c)&&(d=b,b=c,c=void 0);a.each(a.livequery.queries,function(a,h){if(f.selector==h.selector&&f.context==h.context&&c==h.type&&(!b||b.$lqguid==h.fn.$lqguid)&&(!d||d.$lqguid==h.fn2.$lqguid))return(g=h)&&!1});g=g||new a.livequery(this.selector,this.context,c,b,d);g.stopped=!1;g.run();return this},expire:function(c,b,d){var f=this;a.isFunction(c)&&(d=b,b=c,c=void 0);a.each(a.livequery.queries,function(g,k){f.selector==k.selector&&
f.context==k.context&&(!c||c==k.type)&&(!b||b.$lqguid==k.fn.$lqguid)&&(!d||d.$lqguid==k.fn2.$lqguid)&&!this.stopped&&a.livequery.stop(k.id)});return this}});a.livequery=function(c,b,d,f,g){this.selector=c;this.context=b||document;this.type=d;this.fn=f;this.fn2=g;this.elements=[];this.stopped=!1;this.id=a.livequery.queries.push(this)-1;f.$lqguid=f.$lqguid||a.livequery.guid++;g&&(g.$lqguid=g.$lqguid||a.livequery.guid++);return this};a.livequery.prototype={stop:function(){var a=this;this.type?this.elements.unbind(this.type,
this.fn):this.fn2&&this.elements.each(function(b,d){a.fn2.apply(d)});this.elements=[];this.stopped=!0},run:function(){if(!this.stopped){var c=this,b=this.elements,d=a(this.selector,this.context),f=d.not(b);this.elements=d;this.type?(f.bind(this.type,this.fn),0<b.length&&a.each(b,function(b,e){0>a.inArray(e,d)&&a.event.remove(e,c.type,c.fn)})):(f.each(function(){c.fn.apply(this)}),this.fn2&&0<b.length&&a.each(b,function(b,e){0>a.inArray(e,d)&&c.fn2.apply(e)}))}}};a.extend(a.livequery,{guid:0,queries:[],
queue:[],running:!1,timeout:null,checkQueue:function(){if(a.livequery.running&&a.livequery.queue.length)for(var c=a.livequery.queue.length;c--;)a.livequery.queries[a.livequery.queue.shift()].run()},pause:function(){a.livequery.running=!1},play:function(){a.livequery.running=!0;a.livequery.run()},registerPlugin:function(){a.each(arguments,function(c,b){if(a.fn[b]){var d=a.fn[b];a.fn[b]=function(){var c=d.apply(this,arguments);a.livequery.run();return c}}})},run:function(c){void 0!=c?0>a.inArray(c,
a.livequery.queue)&&a.livequery.queue.push(c):a.each(a.livequery.queries,function(c){0>a.inArray(c,a.livequery.queue)&&a.livequery.queue.push(c)});a.livequery.timeout&&clearTimeout(a.livequery.timeout);a.livequery.timeout=setTimeout(a.livequery.checkQueue,20)},stop:function(c){void 0!=c?a.livequery.queries[c].stop():a.each(a.livequery.queries,function(c){a.livequery.queries[c].stop()})}});a.livequery.registerPlugin("append","prepend","after","before","wrap","attr","removeAttr","addClass","removeClass",
"toggleClass","empty","remove");a(function(){a.livequery.play()});var b=a.prototype.init;a.prototype.init=function(a,e){var d=b.apply(this,arguments);a&&a.selector&&(d.context=a.context,d.selector=a.selector);"string"==typeof a&&(d.context=e||document,d.selector=a);return d};a.prototype.init.prototype=a.prototype})(jQuery);(function(a){function b(){}a.datepicker._showDatepickerOverload=a.datepicker._showDatepicker;a.datepicker._showDatepicker=function(c){a.datepicker._showDatepickerOverload(c);c=c.target||c;"input"!=c.nodeName.toLowerCase()&&(c=a("input",c.parentNode)[0]);if(!a.datepicker._isDisabledDatepicker(c)){var b=a.datepicker._getInst(c);a.datepicker._get(b,"showTime")&&a.timepicker.show(c)}};a.datepicker._checkExternalClickOverload=a.datepicker._checkExternalClick;a.datepicker._checkExternalClick=function(c){a.datepicker._curInst&&
0==a(c.target).parents("#"+a.timepicker._mainDivId).length&&a.datepicker._checkExternalClickOverload(c)};a.datepicker._hideDatepickerOverload=a.datepicker._hideDatepicker;a.datepicker._hideDatepicker=function(c,b){var d=this._curInst;if(d&&!(c&&d!=a.data(c,PROP_NAME))){var f=this._get(d,"showTime");a.datepicker._hideDatepickerOverload(c,b);f&&(d.input&&d.input.val(this._formatDate(d)),a.timepicker.hide())}};b.prototype={init:function(){this._mainDivId="ui-timepicker-div";this._inputId=null;this._colonPos=
-1;this.tpDiv=a('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all ui-helper-hidden-accessible" style="width: 100px; display: none; position: absolute;"></div>');this._generateHtml()},show:function(c){this._inputId=c.id;this._parseTime();var c=a("#"+a.datepicker._mainDivId),b=c.position(),d=a("#"+a.datepicker._mainDivId+" > div.ui-datepicker-header:first-child").height();a("#"+this._mainDivId+" > div.ui-datepicker-header:first-child").css("height",
d);this.tpDiv.css({height:c.height(),top:b.top,left:b.left+c.outerWidth()+"px"});a("#hourSlider").css("height",this.tpDiv.height()-3.5*d);a("#minuteSlider").css("height",this.tpDiv.height()-3.5*d);a("#"+this._mainDivId).show();var d=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)+a(document).scrollLeft(),f=this.tpDiv.offset().left+this.tpDiv.outerWidth();f>d&&(c.css("left",b.left-(f-d)-5),this.tpDiv.css("left",c.offset().left+c.outerWidth()+"px"))},hide:function(){var c=
a("#"+this._mainDivId+" span.fragHours").text()+":"+a("#"+this._mainDivId+" span.fragMinutes").text(),b=a("#"+this._inputId).val();-1!=this._colonPos&&(b=b.substr(0,this._colonPos-2));b=a.trim(b);a("#"+this._inputId).val(b+" "+c);a("#"+this._mainDivId).hide()},_generateHtml:function(){this.tpDiv.empty().append('<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix ui-corner-all"><div class="ui-datepicker-title" style="margin:0"><span class="fragHours">08</span><span class="delim">:</span><span class="fragMinutes">45</span></div></div><table><tr><th>Hour</th><th>Minute</th></tr><tr><td align="center"><div id="hourSlider" class="slider"></div></td><td align="center"><div id="minuteSlider" class="slider"></div></td></tr></table>');
a("body").append(this.tpDiv);var c=this;a("#hourSlider").slider({orientation:"vertical",range:"min",min:0,max:23,step:1,slide:function(a,b){c._writeTime("hour",b.value)}});a("#minuteSlider").slider({orientation:"vertical",range:"min",min:0,max:59,step:1,slide:function(a,b){c._writeTime("minute",b.value)}})},_writeTime:function(b,e){"hour"==b&&(10>e&&(e="0"+e),a("#"+this._mainDivId+" span.fragHours").text(e));"minute"==b&&(10>e&&(e="0"+e),a("#"+this._mainDivId+" span.fragMinutes").text(e))},_parseTime:function(){var b=
a("#"+this._inputId).val();this._colonPos=b.search(":");-1==this._colonPos?(this._setTime("hour",0),this._setTime("minute",0)):(this._setTime("hour",parseInt(b.substr(this._colonPos-2,2))),this._setTime("minute",parseInt(b.substr(this._colonPos+1,2))))},_setTime:function(b,e){isNaN(e)&&(e=0);0>e&&(e=0);23<e&&"hour"==b&&(e=23);59<e&&"minute"==b&&(e=59);"hour"==b&&a("#hourSlider").slider("value",e);"minute"==b&&a("#minuteSlider").slider("value",e);this._writeTime(b,e)}};a.timepicker=new b;a("document").ready(function(){a.timepicker.init()})})(jQuery);(function(a){function b(d,g){var d=a(d),e=d.clone().empty(),f;d.contents().each(function(){var a=g-e.text().length;0!=a&&(f=3==this.nodeType?c(this,a):b(this,a))&&e.append(f)});return e}function c(b,c){var d=e(b.data);g&&(d=d.replace(/^ /,""));g=!!d.match(/ $/);d=d.slice(0,c);return d=a("<div/>").text(d).html()}function e(a){return a.replace(/\s+/g," ")}function d(b){var c=a(b),e=c.children(":last");if(!e)return b;b=e.css("display");return!b||"inline"==b?c:d(e)}function f(b){var c=a(b).children(":last");
return c&&c.is("p")?c:b}var g=!0;a.fn.truncate=function(g){var h=a.extend({},a.fn.truncate.defaults,g);a(this).each(function(){if(!(a.trim(e(a(this).text())).length<=h.max_length)){var g=3==this.nodeType?c(this,h.max_length-h.more.length-3):b(this,h.max_length-h.more.length-3),k=a(this).hide();g.insertAfter(k);d(g).append(' (<a href="#show more content">'+h.more+"</a>)");f(k).append(' (<a href="#show less content">'+h.less+"</a>)");g.find("a:last").click(function(){g.hide();k.show();if(a.isFunction(h.onMore))h.onMore(k);
return!1});k.find("a:last").click(function(){g.show();k.hide();if(a.isFunction(h.onLess))h.onLess(g);return!1})}})};a.fn.truncate.defaults={max_length:100,more:"more",less:"less"}})(jQuery);jQuery.url=function(){var a={},b={},c=window.location,e="source,protocol,authority,userInfo,user,password,host,port,relative,path,directory,file,query,anchor".split(","),d=/(?:^|&)([^&=]*)=?([^&]*)/g,f={strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/},
g=function(){str=decodeURI(c);for(var a=f.loose.exec(str),b={},g=14;g--;)b[e[g]]=a[g]||"";b.queryKey={};b[e[12]].replace(d,function(a,c,d){c&&(b.queryKey[c]=d)});return b},k=function(){b=g();var c=b.path;a=[];a=1==b.path.length?{}:("/"==c.charAt(c.length-1)?c.substring(1,c.length-1):path=c.substring(1)).split("/")};return{setMode:function(a){strictMode="strict"==a?!0:!1;return this},setUrl:function(a){c=void 0===a?window.location:a;k();return this},segment:function(c){b.length||k();return void 0===
c?a.length:""===a[c]||void 0===a[c]?null:a[c]},attr:function(a){b.length||k();return"base"==a?null!==b.port&&""!==b.port?b.protocol+"://"+b.host+":"+b.port+"/":b.protocol+"://"+b.host+"/":""===b[a]?null:b[a]},param:function(a,c){c=c||!1;b.length||k();return null===b.queryKey[a]||"undefined"==typeof b.queryKey[a]?null:c?b.queryKey[a]:decodeURIComponent(b.queryKey[a])}}}();var brizzl={};(function(){jQuery.extend(brizzl,{log:function(a){"undefined"!=typeof console&&console.log(a)}})})();brizzl.auth=function(){var a=!1,b={signInUrl:null,signInCallback:null,signUpUrl:null,signUpCallback:null},c=b;return{init:function(a){var b=this;c=$.extend(c,a);$(".sign_in_form").livequery(function(){var a=$(this);$("username_fld").clearingInput({text:"oder E-Mail"});a.ajaxForm({dataType:"json",beforeSubmit:function(){brizzl.InfoPanel.progress(a,"Daten werden geprüft...");return!0},success:function(g){window.setTimeout(function(){1==g.status?(brizzl.auth.setIsAuthenticated(!0),null!=c.signInUrl?
location.href=c.signInUrl:(b.updateTopnav(),b.close(),null!=c.signInCallback&&c.signInCallback())):brizzl.InfoPanel.error(a,g.message+"<br/>\n")},1E3);return!1}})});$(".sign_up_form").livequery(function(){var a=$(this),g=a.find("input[name=username]"),e=a.find(".username_status");g.keyup(function(){var a=g.attr("value");3<a.length?$.getJSON("/api/user.usernameExist",{username:a},function(a){a.status&&!a.data?(e.text("ok"),e.addClass("f_info"),e.removeClass("f_err")):(e.html("nicht verfuegbar"),e.addClass("f_err"),
e.removeClass("f_info"))}):(e.html("nicht verfuegbar"),e.addClass("f_err"),e.removeClass("f_info"))});var h=a.find("input[name=password]"),l=a.find(".password_status");h.keyup(function(){6>h.attr("value").length?(l.html("mind. 6 Zeichen"),l.addClass("f_err"),l.removeClass("f_info")):(l.html("ok"),l.addClass("f_info"),l.removeClass("f_err"))});var m=a.find("input[name=email]"),n=a.find(".email_status");m.keyup(function(){var a=m.attr("value");brizzl.util.validateEmail(a)?(n.html("ok"),n.addClass("f_info"),
n.removeClass("f_err")):(n.html("ungueltig"),n.addClass("f_err"),n.removeClass("f_info"))});a.ajaxForm({dataType:"json",beforeSubmit:function(){brizzl.InfoPanel.progress(a,"Die Daten werden geprueft...");return!0},success:function(e){window.setTimeout(function(){var g=new brizzl.InfoPanel(a,{type:brizzl.InfoPanel.ERROR});if(1==e.status)brizzl.auth.setIsAuthenticated(!0),null!=c.signUpUrl?location.href=c.signUpUrl:(b.updateTopnav(),b.close(),null!=c.signUpCallback&&c.signUpCallback());else{if("undefined"!=
typeof e.errors)for(var h=0;h<e.errors.length;h++)g.addMessage(e.errors[h].message);else g.addMessage(e.message);g.show()}},1E3);return!1}})});$.getJSON("/api/session.isLoggedIn",function(a){1==a.status&&b.setLoggedIn(a.value)})},setSignInUrl:function(a){c.signInUrl=a},setSignUpUrl:function(a){c.signUpUrl=a},setSignInCallback:function(a){c.signInCallback=a},setSignUpCallback:function(a){c.signUpCallback=a},isLoggedIn:function(){return a},setLoggedIn:function(b){a=b},setIsAuthenticated:function(b){a=
b},hasTimeout:function(a){return"object"==typeof a&&0==a.status&&900==a.code?!0:!1},resetOptions:function(){c=b},open:function(a){a=a||null;null!=a&&this.setSignInCallback(a);this.isLoggedIn()?null!=c.signInCallback?c.signInCallback():null!=c.signInUrl&&(location.href=c.signInUrl):$("#sign_up").length?($(".contents").hide(),$("#sign_up").show()):$.get("/ajax/sign_up",{},function(a){$(".contents").hide();$(".contents").eq(0).before(a);$("#sign_up").show()})},close:function(){$(".contents").show();
$("#sign_up").hide();$("#sign_up_success").remove()},updateTopnav:function(){$.get("/ajax/topnav",{},function(a){$("#topnav").after(a).remove()})}}}();brizzl.localization=function(){var a=[];return{load:function(a,c,e){c=c||null;e=e||null;$.getJSON("/api/localization.load",{keys:a.join(","),comp:c},function(a){brizzl.localization.setDict(a,c);null!=e&&e()})},setDict:function(b,c){var c=c||null,e;if(null!=c)for(e in"undefined"==typeof a[c]&&(a[c]=[]),b)a[c][e]=b[e];else for(e in b)a[e]=b[e]},getDict:function(b){b=b||null;return null!=b&&"undefined"!=typeof a[b]?a[b]:a},get:function(b,c){c=c||null;return null!=c&&"undefined"!=typeof a[c]&&"undefined"!=
typeof a[c][b]?a[c][b]:"undefined"!=typeof a[b]?a[b]:b}}}();brizzl.messageDetail=function(){var a=null;return{init:function(){a=this;$(".hl_message_detail_back").live("click",function(){jQuery("#msg_list").length?brizzl.listView.showList():window.history.back();return!1});$('a[rel="msg_comment"]').live("click",function(){var b=brizzl.util.parseAnchor(this.href);brizzl.auth.open(function(){a.showCommentForm(b)});return!1});$('a[rel="msg_reply"]').live("click",function(){var b=brizzl.util.parseAnchor(this.href);brizzl.auth.open(function(){a.showReplyForm(b)});
return!1});$('a[rel="msg_friend"]').live("click",function(){var b=brizzl.util.parseAnchor(this.href);a.addFriend(b);return!1});$('a[rel="msg_spam"]').live("click",function(){var b=brizzl.util.parseAnchor(this.href);brizzl.auth.open(function(){a.reportSpam(b)});return!1});$("#form_private_message").livequery(function(){var a=$(".fld_private_message");a.autogrow();$(this).ajaxForm({dataType:"json",beforeSubmit:function(a){for(var b=0;b<a.length;b++)if(!a[b].value)return alert("Bitte einen Text eingeben!"),
!1;return!0},success:function(c){1==c.status?(a.val(""),brizzl.InfoPanel.info($("#msg_private_message_box"),"Die Nachricht wurde gesendet.",4,"before"),$("#msg_private_message_box").hide()):alert("error")},error:function(){alert("error")}})});$("#form_comment").livequery(function(){var b=$(".fld_comment");b.autogrow();$(this).ajaxForm({beforeSubmit:function(a){for(var b=0;b<a.length;b++)if(!a[b].value)return alert("Bitte einen Text eingeben!"),!1;return!0},success:function(c){""!=c?(b.val(""),$("#mdv_comment_box").length?
$("#mdv_comment_box").append(c):a.reload()):alert(c.message)},error:function(){alert("error")}})})},load:function(a,c){jQuery("#message_detail_container").load("/ajax/message_detail",{id:a},c)},reload:function(){var b=jQuery("#fld_mdv_message_id").val();0<b&&a.load(b)},showReplyForm:function(){$("#msg_comment_box").hide();$("#msg_private_message_box").show();return!1},showCommentForm:function(){$("#msg_private_message_box").hide();$("#msg_comment_box").show();return!1},addFriend:function(a){$("#msg"+
a).append('<div id="dialog">Kommentar</div>');$("#dialog").dialog({title:"Freund hinzufuegen",bgiframe:!0,resizable:!1,height:140,modal:!0,overlay:{backgroundColor:"#000",opacity:0.5},buttons:{"Add friend":function(){$(this).dialog("close")},Cancel:function(){$(this).dialog("close")}}})},reportSpam:function(){alert("Danke.")}}}();brizzl.InfoPanel=function(a,b){var c=b||{},e=c.type||null,d=c.pos||"prepend",f=c.margin||null,g=c.padding||"0.7em",k=[];if(null==f)if("prepend"==d||"before"==d)f="0 0 10px 0";else if("append"==d||"after"==d)f="10px 0 0 0";this.getMessages=function(){return k};this.hasMessages=function(){return 0<k.length};this.addMessage=function(a){k.push(a)};this.remove=function(){$("#info_panel").remove()};this.show=function(b){var b=b||0,c="",m="",n="";switch(e){case brizzl.InfoPanel.ERROR:m="ui-state-error";
n="ui-icon-alert";break;default:m="ui-state-highlight",n="ui-icon-info"}for(var p=0;p<k.length;p++)0<p&&(c+="<br />"),c+='<span class="ui-icon '+n+'" style="float:left; margin-right:0.3em;"></span>'+k[p];n="";null!=f&&(n+="margin:"+f+";");null!=g&&(n+="padding:"+g+";");""!=n&&(n=' style="'+n+'"');var c='<div id="info_panel" class="'+m+' ui-corner-all"'+n+">"+c+"</div>",q=$("#info_panel");0<q.size()&&q.remove();switch(d){case "after":a.after(c);break;case "before":a.before(c);break;case "append":a.append(c);
break;default:a.prepend(c)}q=$("#info_panel");q.fadeIn("slow");0<b&&window.setTimeout(function(){q.fadeOut("slow")},1E3*b)}};brizzl.InfoPanel.INFO="info";brizzl.InfoPanel.PROGRESS="progress";brizzl.InfoPanel.ERROR="error";brizzl.InfoPanel.error=function(a,b,c,e){c=c||0;a=new brizzl.InfoPanel(a,{type:brizzl.InfoPanel.ERROR,pos:e});a.addMessage(b);a.show(c)};brizzl.InfoPanel.progress=function(a,b,c,e){c=c||0;a=new brizzl.InfoPanel(a,{type:brizzl.InfoPanel.PROGRESS,pos:e});a.addMessage(b);a.show(c)};
brizzl.InfoPanel.info=function(a,b,c,e){c=c||0;a=new brizzl.InfoPanel(a,{type:brizzl.InfoPanel.INFO,pos:e});a.addMessage(b);a.show(c)};brizzl.InfoPanel.close=function(){$("#info_panel").remove()};brizzl.listView=function(){var a=null;return{init:function(){a=this;a.container=$("#list_view");a.items=[]},addItem:function(b){a.items.push(b)},clear:function(){a.items=[]},hide:function(){a.container.hide()},show:function(){a.container.fadeIn("fast")},showList:function(){jQuery("#message_detail_container").hide();jQuery("#message_list_container").show()},showDetail:function(b){a.show();brizzl.messageDetail.load(b,function(){jQuery("#message_list_container").hide();jQuery("#message_detail_container").show()})},
update:function(){$("#message_list_container").load("/ajax/message_list",function(){brizzl.map.isCollapsed()&&(a.show(),a.showList())})}}}();brizzl.Place=function(){this.idx=0;this.marker=this.lng=this.lat=this.address=this.name=this.id=null;this.messages=[]};brizzl.Place.prototype.toString=function(){return this.name+", "+this.address+", ("+this.lat+", "+this.lng+")"};brizzl.Place.prototype.getLatLng=function(){return new GLatLng(this.lat,this.lng)};brizzl.PlaceSearchMarker=function(a,b){this.place=null;google.maps.Marker.apply(this,arguments)};brizzl.PlaceSearchMarker.prototype=new google.maps.Marker(new GLatLng(0,0));brizzl.PlaceSearchMarker.prototype.getPlace=function(){return this.place};
brizzl.PlaceSearchMarker.createMarker=function(a,b){var b=b||!1,c;c=new GIcon;c.image="/img/markers/arrow.png";c.shadow="/img/markers/arrow_shadow.png";c.iconSize=new GSize(20,34);c.shadowSize=new GSize(37,34);c.iconAnchor=new GPoint(9,34);c.infoWindowAnchor=new GPoint(9,2);c.infoShadowAnchor=new GPoint(18,25);c={icon:c};c=new brizzl.PlaceSearchMarker(new GLatLng(a.lat,a.lng),c);c.place=a;var e="";b&&(e='<p><a href="#" onclick="brizzl.map.searchMessageLatLng('+a.lat+", "+a.lng+');return false;">Nachrichten zu diesem Ort suchen</a></p>');
c.bindInfoWindowHtml("<p><strong>"+a.name+"</strong></p><p>"+a.address+"</p><p>(Geo: "+a.lat+", "+a.lng+")</p>"+e,{maxWidth:300});return c};brizzl.PlaceSearch=function(a){this.searchString=a;var b=this;this.execute=function(a){var e=new google.search.LocalSearch;e.setNoHtmlGeneration();e.setCenterPoint(brizzl.map.map_);e.setAddressLookupMode(google.search.LocalSearch.ADDRESS_LOOKUP_ENABLED);e.setSearchCompleteCallback(null,function(){var d=[];if(e.results&&0<e.results.length){var f=!1;1<e.results.length&&(f=!0);var g=null,k,h;for(h=0;h<e.results.length;h++)k=e.results[h],g=new brizzl.Place,g.idx=h,g.accuracy=k.accuracy,g.name=k.titleNoFormatting,
g.address=b.extractAddress(k),g.lat=k.lat,g.lng=k.lng,g.marker=brizzl.PlaceSearchMarker.createMarker(g,f),d.push(g)}a(d)});e.execute(b.searchString);$.getJSON("/api/message.logSearch",{q:b.searchString})};this.extractAddress=function(a){if(0<a.addressLines.length)return a.addressLines.join(", ")}};brizzl.map=function(){var a,b,c=!1,e=[],d=null,f=null;return{init:function(c){a=this;a.centerMarker=null;a.existingMarkerMap={};a.container=c;b=a.container.hasClass("map_collapsed");a.initGMap();$("#btn_toggle_map").click(function(){b?a.expand():a.collapse();return!1})},initGMap:function(){a.map_=new google.maps.Map2(document.getElementById("map"));a.map_.addControl(new GLargeMapControl3D);a.map_.addControl(new GMenuMapTypeControl);a.map_.enableContinuousZoom();a.map_.disableScrollWheelZoom();google.maps.Event.addListener(a.map_,
"zoomend",function(){a.updateOnDragend(brizzl.listView.update)});google.maps.Event.addListener(a.map_,"dragend",function(){a.updateOnDragend(brizzl.listView.update)});var b=5;"undefined"!=typeof _centerCoords?("undefined"!=typeof _centerZoom&&(b=_centerZoom),a.setCenter(new google.maps.LatLng(_centerCoords[0],_centerCoords[1]),b)):a.setDefaultCenter(b);a.map_.getInfoWindow();a.enableDragSearch();a.markerManager=new MarkerManager(a.map_,2);f=new GAdsManager(a.map_,"pub-2077634818531198",{channel:"5214461849",
maxAdsOnMap:1,style:G_ADSMANAGER_STYLE_ADUNIT});f.enable()},refresh:function(){brizzl.log("refresh...");var b=!1;c&&(b=!0,a.disableDragSearch());a.markerManager.refresh();b&&a.enableDragSearch()},updateOnDragend:function(b){brizzl.log("update on dragend...");c&&(c=!1,a.clear(),a.updateSection(b),null!=d&&window.clearTimeout(d),d=window.setTimeout(function(){c=!0},2E3))},updateSection:function(b){brizzl.log("update...");var b=b||null,c=a.map_.getZoom(),d=a.map_.getBounds(),e=d.getSouthWest(),d=d.getNorthEast(),
c={zoom:c,minLat:e.lat(),maxLat:d.lat(),minLng:e.lng(),maxLng:d.lng(),centerLat:a.getCenter().lat(),centerLng:a.getCenter().lng()};a.centerMarker&&a.centerMarker.getPlace();jQuery.getJSON("/api/message.getPlacesInsideOf",c,function(c,d){"success"!=d&&alert("Oops! Ein Fehler ist aufgetreten. Bitte sp\u00e4ter nochmal probieren.");a.handleResponse(c,b)})},update:function(){jQuery.getJSON("/api/message.getPlaces",{sid:_sid},function(b,c){if("success"!=c)alert("Oops! Ein Fehler ist aufgetreten. Bitte sp\u00e4ter nochmal probieren.");
else if(b.places){var d=b.parameters,e=new brizzl.Place;e.idx=0;e.name=d.q;e.address=d.address;e.lat=d.centerLat;e.lng=d.centerLng;a.setCenterMarker(brizzl.PlaceSearchMarker.createMarker(e,!1));a.handleResponse(b)}else a.openLeaveMessageDialog()})},handleResponse:function(b,c){var c=c||null,d=b.places,e,f=[],n=[],p,q;for(p in d)e=new brizzl.Place,jQuery.extend(e,d[p]),q=brizzl.MessageMarker.createMarker(e),f.push(q),"undefined"==typeof a.existingMarkerMap[e.id]&&(n.push(q),a.existingMarkerMap[e.id]=
1);a.addMarkers(n,3);a.refresh();a.enableDragSearch();null!=c&&c(f)},searchMessages:function(){brizzl.log("search messages...");var b=brizzl.MessageSearchParameters.create();(new brizzl.PlaceSearch(b.q)).execute(function(b){brizzl.log("got "+b.length+" results");a.clearMarkers();var c;if(1==b.length)c=b[0],brizzl.messageDialog.setPlace(c),a.setCenterMarker(c.marker),a.updateSection(a.searchPlaceResponse);else if(1<b.length){brizzl.log("got multiple places");a.disableDragSearch();a.clear();for(var d=
[],e=new google.maps.LatLngBounds,g=0;g<b.length;g++)c=b[g],e.extend(c.marker.getLatLng()),a.addMarker(c.marker),d.push('<a href="#" onclick="brizzl.map.searchMessageLatLng('+c.lat+", "+c.lng+');return false;">'+c.name+", "+c.address+"</a>");a.expand(function(){var b=a.map_.getBoundsZoomLevel(e)-1;a.setCenter(e.getCenter(),b);a.refresh();a.map_.openInfoWindowHtml(e.getCenter(),"<p><strong>Info</strong></p><p>Es wurden mehrere Orte gefunden, die Ihrer Suche entsprechen:</p><p>"+d.join("<br />")+'</p><p>Waehlen Sie einen Link oder klicken Sie auf den entsprechenden Marker.</p><p><a href="javascript:brizzl.map.map_.closeInfoWindow();">Fenster schliessen</a></p>')})}else b=
new brizzl.InfoPanel($("#loc"),{type:"info",pos:"after"}),b.addMessage("Der Ort konnte nicht gefunden werden"),b.show(4)});return!1},searchPlaceResponse:function(b){b.length?a.collapse(function(){brizzl.listView.update();window.setTimeout(function(){google.maps.Event.trigger(a.centerMarker,"click")},1E3)}):a.map_.setZoom(11)},openLeaveMessageDialog:function(){brizzl.messageDialog.setCurrPage("ajax.message_new_0_2");brizzl.messageDialog.open()},searchMessageLatLng:function(b,c){a.map_.closeInfoWindow();
a.setCenter(new google.maps.LatLng(b,c),12);a.collapse(function(){a.centerMarker=a.getMarker(b,c,3);a.updateSection(a.searchPlaceResponse)})},setCenterMarker:function(b){brizzl.log("set center marker "+b);if("object"==typeof b.place){var c=14;"undefined"!=typeof b.place.accuracy&&6>b.place.accuracy&&(c=12);a.centerMarker=b;a.addMarker(b);a.setCenter(b.getLatLng(),c)}},hasCenterMarker:function(){return null!=a.centerMarker?!0:!1},getCenterMarker:function(){return a.hasCenterMarker()?a.centerMarker:
null},zoomOut:function(){a.map_.zoomOut();return!1},setCenter:function(b,d){brizzl.log("set center..."+b+", "+d);var e=!1;c&&(e=!0,a.disableDragSearch());a.map_.setCenter(b,d);e&&a.enableDragSearch()},getCenter:function(){return a.map_.getCenter()},setDefaultCenter:function(b){var b=b||12,c=google.loader.ClientLocation;brizzl.log(c);c&&c.address.country_code&&c.address.region?a.map_.setCenter(new google.maps.LatLng(c.latitude,c.longitude),b):a.map_.setCenter(new google.maps.LatLng(50.12,8.69),b)},
reverseGeocode:function(b,c){brizzl.log("reverse geocode");var d=new google.maps.ClientGeocoder;d.setViewport(a.map_.getBounds());d.getLocations(b,function(a){var b=null;200==a.Status.code?(a=a.Placemark[0],b=new brizzl.Place,b.name=a.address,b.address=a.address,b.lat=a.Point.coordinates[1],b.lng=a.Point.coordinates[0]):brizzl.log("Geocoding result: "+a.Status.code);c(b)})},isExpanded:function(){return!b},isCollapsed:function(){return b},setOnUpdateCollapse:function(){},enableDragSearch:function(){c=
!0},disableDragSearch:function(){c=!1},getMarker:function(b,c,d){return a.markerManager.getMarker(b,c,d)},getMarkerByIndex:function(a){brizzl.log("get marker by idx "+a);brizzl.log("found marker "+e[a]);return"object"==typeof e[a]?e[a]:null},addMarker:function(b){brizzl.log("add marker "+b);return a.addMarkers(Array(b))},addMarkers:function(b){e.push(b);a.markerManager.addMarkers(b,3);return e.length-1},deleteMarker:function(b){a.markerManager.removeMarker(b)},clear:function(){a.map_.closeInfoWindow();
a.clearMarkers()},clearMarkers:function(){a.markerManager.clearMarkers();a.existingMarkerMap={};a.centerMarker=null;e=[]},collapse:function(c){var c=c||null,d=a.map_.getBounds().getCenter(),e=a.map_.getZoom();b?null!=c&&c():($("#map_view").removeClass("map_expanded"),$("#map_view").addClass("map_collapsed"),$("#img_toggle_map").attr("src","/img/map_expand.gif"),a.map_.checkResize(),a.map_.setCenter(d,e),null!=c&&c(),brizzl.listView.show());b=!0},expand:function(c){var c=c||null,d=a.map_.getBounds().getCenter(),
e=a.map_.getZoom();b&&($("#img_toggle_map").attr("src","/img/map_collapse.gif"),brizzl.listView.hide(),$("#map_view").removeClass("map_collapsed"),$("#map_view").addClass("map_expanded"),a.map_.checkResize(),a.map_.setCenter(d,e));null!=c&&c();b=!1},toggleWidth:function(c){c=c||null;b?a.expand(c):a.collapse(c)}}}();brizzl.Message=function(a){jQuery.extend(this,a);this.marker=this.place=this.placeName=this.endDate=this.startDate=this.username=this.body_compact=this.body=this.subject=this.categoryId=this.id=this.idx=null;this.createListItem();this.getPeriod=function(){return this.startDate+" "+this.endDate};this.highlight=function(){this.jQueryObj.addClass("msg_item_hl")};this.unhighlight=function(){this.jQueryObj.removeClass("msg_item_hl")};this.loadAndShowDetail=function(){var a=jQuery("#message_list_container"),
c=jQuery("#message_detail_container");c.load("/ajax/message_detail",{id:this.id},function(){a.hide();c.show()})};this.hideDetail=function(){jQuery("#message_detail_container").hide();jQuery("#message_list_container").show()};this.showDetail=function(){$("#message_"+this.id).html()?(jQuery("#message_list_container").hide(),jQuery("#message_detail_container").show()):this.loadAndShowDetail()};this.toString=function(){return this.id+", "+this.subject};this.createJQueryObj=function(){this.jQueryObj=$("#msg"+
this.id);this.jQueryObj.data("message",this);$(".msg_body_compact").click(function(){this.showDetail()});$(".msg_body_compact").mouseover(function(){alert("");this.marker.openInfoWindow()});$("#msg"+this.id+" h1").mouseover(function(){this.marker.openInfoWindow()})};this.createListItem=function(){console.log("create list item")}};brizzl.messageDialog=function(){var a=function(){if(null==d.place||!$("#loc_search_results").children().size())return $("#loc_search_error_3").fadeIn("slow"),!1;d.place.name=$("#tf_address").val();if(null==d.place.name||!d.place.name.length)return $("#loc_search_error_2").fadeIn("slow"),!1;return null==d.place.address||!d.place.address.length?($("#loc_search_error_3").fadeIn("slow"),!1):!0},b=function(a){null==d.marker?d.marker=brizzl.MessageDialogMarker.createMarker(a):d.marker.setLatLng(a);brizzl.map.clear();
brizzl.map.setCenter(d.marker.getLatLng(),17);brizzl.map.addMarker(d.marker);brizzl.map.refresh();var b={};null!=d.messageId&&(b.messageId=d.messageId);brizzl.auth.isLoggedIn()&&d.setCurrPage("ajax.message_new_2");window.setTimeout(function(){google.maps.Event.trigger(d.marker,"click",{pagename:null!=d.currPage?d.currPage:"ajax.message_new_0_1",params:b})},1E3)},c=function(a){$(".md_msg_image").removeClass("md_msg_image_selected");$("#md_image_type_"+a).addClass("md_msg_image_selected")},e=function(){$(".loc_search_error").hide();
var a=$("#tf_address"),b=$("#loc_search_results");null!=d.place?(a.val(d.place.name),b.html(d.addressLink(d.place.address)),b.fadeIn("slow")):(a.val(""),b.empty(),a.focus())},d=null;return{currPage:null,marker:null,messageId:null,place:null,places:[],init:function(){d=this;$("a.message_dialog_open").live("click",function(){d.setCurrPage(null);d.setMessageId(null);d.resetMessageForm();d.open(null);return!1});$("#message_new_3").livequery(function(){var a=$("#msg_start_date");a.datepicker($.extend({showButtonPanel:!0,
showOn:"button",buttonImage:"/img/calendar.gif",buttonImageOnly:!0,duration:"",showTime:!0,constrainInput:!1,onClose:function(){var b=a.val(),c=$("#msg_end_date").datepicker("getDate"),d=a.datepicker("getDate");if(null!=c&&"00:00"==b.substr(-5)||c<d)c=d,c.setDate(d.getDate()+1),$("#msg_end_date").datepicker("setDate",c),window.setTimeout(function(){$("#msg_end_date").val($("#msg_end_date").val()+" 00:00")},200)}},$.datepicker.regional.de));$("#msg_end_date").datepicker($.extend({showButtonPanel:!0,
showOn:"button",buttonImage:"/img/calendar.gif",buttonImageOnly:!0,duration:"",showTime:!0,constrainInput:!1},$.datepicker.regional.de));$("#msg_form").ajaxForm({dataType:"json",beforeSubmit:function(){if(!$("#subject").val())return alert("Bitte geben Sie einen Betreff an."),!1;if(!$("#message").val())return alert("Bitte geben Sie eine Nachricht ein."),!1;if(!$("#msg_start_date").val())return alert("Bitte geben Sie ein Startdatum ein."),!1;return!$("#msg_end_date").val()?(alert("Bitte geben Sie ein Enddatum ein."),
!1):!0},success:function(a){1==a.status?a.messageId?(d.messageId=a.messageId,d.goto4()):alert("Error: missing message ID"):alert("Fehler beim Speichern!");return!1}})});$("#message_new_4").livequery(function(){$(".md_radio_msg_category").bind("click",function(){var a=this.value,b;$(".md_radio_subcategory").each(function(){this.checked&&(b=this.value)});5!=a?($("#md_subcategory_selection_2").hide(),$("#md_subcategory_selection_1").show(),(5<b||99!=b)&&$("#md_radio_subcategory_99").trigger("click")):
($("#md_subcategory_selection_1").hide(),$("#md_subcategory_selection_2").show(),(6>b||99!=b)&&$("#md_radio_subcategory_99").trigger("click"))});$(".md_radio_subcategory").bind("click",function(){$("#md_image_type_1").css("background-image","url(/img/msg_category/"+this.value+".jpg)");c(1)});var a=$(".md_msg_image");a.bind("mouseenter",function(){if("md_image_type_3"==this.id&&"s.gif)"==$(this).css("background-image").substr(-6))return null;$(this).addClass("md_msg_image_over")});a.bind("mouseleave",
function(){a.removeClass("md_msg_image_over")});a.bind("click",function(){if("md_image_type_3"==this.id&&"s.gif)"==$(this).css("background-image").substr(-6))return null;var a=this.id.substr(this.id.lastIndexOf("_")+1);$("#md_message_image_type").val(a);c(a)});var b=$("#md_message_options_form");b.ajaxForm({dataType:"json",beforeSubmit:function(){return!0},success:function(a){1==a.status?document.location.href="/p/my_messages":brizzl.InfoPanel.error(b,a.message);return!1}});var e=$("#md_image_type_2");
$("#md_user_upload_control").swfupload({upload_url:"/api/user.uploadImage",file_post_name:"userImg",file_size_limit:"10240",file_types:"*.gif;*.jpg;*.jpeg;*.png",file_upload_limit:"0",flash_url:"/scripts/swfupload.swf",button_width:100,button_height:20,button_placeholder_id:"md_user_upload_container",button_text:'<span class="label">hochladen...</span>',button_text_style:".label { color:#333333; font-family:Verdana,Arial,sans-serif; font-size:13px; text-decoration:underline; }",button_window_mode:SWFUpload.WINDOW_MODE.TRANSPARENT,
button_cursor:SWFUpload.CURSOR.HAND,debug:!1,post_params:{sid:_sid}}).bind("fileQueued",function(){$(this).swfupload("startUpload")}).bind("uploadStart",function(){e.css("background-image","url(/img/loader-bar.gif)")}).bind("uploadSuccess",function(a,b,c){!c.length||"{"!=c[0]?alert("Error"):(a=window.eval("("+c+")"),1!=a.status?alert(a.message):(e.css("background-image","url("+a.data+")"),e.trigger("click")))}).bind("uploadError",function(){alert("Error")});var h=$("#md_image_type_3");$("#md_msg_upload_control").swfupload({upload_url:"/api/message.uploadPreviewImage",
file_post_name:"messageImg",file_size_limit:"10240",file_types:"*.gif;*.jpg;*.jpeg;*.png",file_upload_limit:"0",flash_url:"/scripts/swfupload.swf",button_width:100,button_height:20,button_placeholder_id:"md_msg_upload_container",button_text:'<span class="label">hochladen...</span>',button_text_style:".label { color:#333333; font-family:Verdana,Arial,sans-serif; font-size:13px; text-decoration:underline; }",button_window_mode:SWFUpload.WINDOW_MODE.TRANSPARENT,button_cursor:SWFUpload.CURSOR.HAND,debug:!1,
post_params:{sid:_sid,messageId:d.messageId}}).bind("fileQueued",function(){$(this).swfupload("startUpload")}).bind("uploadStart",function(){h.css("background-image","url(/img/loader-bar.gif)")}).bind("uploadSuccess",function(a,b,c){!c.length||"{"!=c[0]?alert("Error"):(a=window.eval("("+c+")"),1!=a.status?alert(a.message):(h.css("background-image","url("+a.data+"?ts="+(new Date).getTime()+")"),h.trigger("click")))}).bind("uploadError",function(){alert("Error")});var l=$("#md_message_image_type").val();
$("#md_image_type_"+l).trigger("click")})},setCurrPage:function(a){d.currPage=a},setPlace:function(a){d.place=a;e()},setMessageId:function(a){d.messageId=a},open:function(){$(".msg_add").remove();brizzl.auth.setSignInCallback(function(){brizzl.messageDialog.next()});brizzl.auth.setSignUpCallback(function(){brizzl.messageDialog.next()});var a=brizzl.map.getCenterMarker();brizzl.map.disableDragSearch();brizzl.map.clear();brizzl.map.expand(function(){null!=d.place?b(d.place.getLatLng()):null!=a?(d.setPlace(a.place),
b(d.place.getLatLng())):brizzl.map.reverseGeocode(brizzl.map.getCenter(),function(a){null!=a?(a.name="",d.setPlace(a),b(d.place.getLatLng())):b(brizzl.map.getCenter())})})},load:function(a,b){var b=b||null,c=a.substr(a.indexOf(".")+1),e=$("#"+c),l=$("#msg_add_dialog");l.find(".msg_add").hide();e.length?e.show():jQuery.get("/ajax/"+c,b,function(a){var b=0,d=window.setInterval(function(){l=$("#msg_add_dialog");if(l.length||10<b)window.clearInterval(d),e.length||($("#loader").remove(),l.prepend(a),e=
$("#"+c),e.find(".message_dialog_next").click(brizzl.messageDialog.next),e.find(".message_dialog_close").click(brizzl.messageDialog.close));b++},200)});d.currPage=a},close:function(){d.setPlace(null);e();google.maps.Event.clearListeners(brizzl.map.map_.getInfoWindow());brizzl.map.clear();brizzl.map.updateSection();brizzl.map.enableDragSearch();return!1},next:function(){switch(d.currPage){case "ajax.message_new_0_1":case "ajax.message_new_0_2":brizzl.auth.isLoggedIn()?d.goto2():d.goto1_1();break;case "ajax.message_new_1_2_1":d.load("ajax.message_new_1_2_2");
break;case "ajax.message_new_1_1":case "ajax.message_new_1_2_2":d.goto2();break;case "ajax.message_new_2":d.goto3();break;default:d.goto0()}return!1},previous:function(){switch(d.currPage){case "ajax.message_new_1_1":d.goto0();break;case "ajax.message_new_1_2_1":d.goto1_1();break;case "ajax.message_new_2":brizzl.auth.isLoggedIn()?d.goto0():d.goto1_1();break;case "ajax.message_new_3":d.goto2();break;default:d.goto0()}return!1},goto0:function(){d.load("ajax.message_new_0_1")},goto1_1:function(){d.load("ajax.message_new_1_1")},
goto1_2:function(){d.load("ajax.message_new_1_2_1")},goto2:function(){var a={};null!=d.messageId&&(a.messageId=d.messageId);$(".loc_search_error").hide();brizzl.auth.isLoggedIn()?d.load("ajax.message_new_2",a):brizzl.messageDialog.goto1_1()},goto3:function(){if(brizzl.auth.isLoggedIn()){if(!a())return null;$("#message_new_3").length&&($("#placeName").val(d.place.name),$("#address").val(d.place.address),$("#lat").val(d.place.lat),$("#lng").val(d.place.lng));d.load("ajax.message_new_3",{placeName:d.place.name,
address:d.place.address,lat:d.place.lat,lng:d.place.lng,messageId:d.messageId})}else d.goto1_1()},goto4:function(){brizzl.auth.isLoggedIn()?d.load("ajax.message_new_4",{messageId:d.messageId}):d.goto1_1()},doAddressSearch:function(){$(".loc_search_error").hide();var a=$("#tf_address").val();if(!a)return $("#loc_search_error_1").fadeIn("slow"),null;d.places=[];(new brizzl.PlaceSearch(a)).execute(function(b){if(1==b.length)brizzl.map.clear(),b=b[0],b.name=a,d.setPlace(b),e(),b=new GLatLng(b.lat,b.lng),
brizzl.map.setCenter(b,16),d.marker.setLatLng(b),brizzl.map.addMarker(d.marker),brizzl.map.refresh(),window.setTimeout(function(){GEvent.trigger(d.marker,"click");$("#loc_search_results").html(d.addressLink(d.place.address));$("#loc_search_results").fadeIn("slow")},200);else if(1<b.length){d.places=b;$("#loc_search_results").empty();for(var b=5<b.length?5:b.length,c=0;c<b;c++)$("#loc_search_results").append(d.multiAddressLink(c,d.places[c].address));$("#loc_search_results").fadeIn("slow")}else $("#loc_search_error_1").fadeIn("slow")})},
clickedAddress:function(a){if("undefined"==typeof d.places[a])return null;brizzl.map.clear();d.setPlace(d.places[a]);e();a=new google.maps.LatLng(d.place.lat,d.place.lng);brizzl.map.setCenter(a,15);d.marker.setLatLng(a);brizzl.map.addMarker(d.marker);brizzl.map.refresh();window.setTimeout(function(){google.maps.Event.trigger(d.marker,"click")},1E3)},addressLink:function(a){return'<p><a onclick="brizzl.messageDialog.goto3();return false" href="#">'+a+"</a></p>"},multiAddressLink:function(a,b){return'<a onclick="brizzl.messageDialog.clickedAddress('+
a+');return false;" href="#">'+b+"</a><br/>"},resetMessageForm:function(){$("#message_id").val("");$("#placeName").val("");$("#address").val("");$("#lat").val("");$("#lng").val("");$("#subject").val("");$("#message").val("");$("#msg_start_date").val("");$("#msg_end_date").val("")}}}();brizzl.MessageDialogMarker=function(a,b){google.maps.Marker.apply(this,arguments)};brizzl.MessageDialogMarker.prototype=new google.maps.Marker(new GLatLng(0,0));
brizzl.MessageDialogMarker.createMarker=function(a){var b=new brizzl.MessageDialogMarker(a,{draggable:!0}),a=document.createElement("div");a.setAttribute("id","msg_add_dialog");a.innerHTML='<img id="loader" style="margin:100px 190px;" src="/img/loader.gif" alt="" />';b.bindInfoWindow(a,{maxContent:a});google.maps.Event.addListener(b,"click",function(a){var b=null,d=null,a=a||null;null!=a&&(b=a.pagename||null,d=a.params||null,brizzl.messageDialog.load(b,d));google.maps.Event.addDomListener(brizzl.map.map_.getInfoWindow(),
"closeclick",function(){brizzl.messageDialog.close()})});google.maps.Event.addListener(b,"dragstart",function(){b.closeInfoWindow()});google.maps.Event.addListener(b,"dragend",function(a){brizzl.map.reverseGeocode(a,function(a){google.maps.Event.trigger(b,"click");a.name="";brizzl.messageDialog.setPlace(a)})});return b};brizzl.MessageMarker=function(a,b){this.place=null;google.maps.Marker.apply(this,arguments)};brizzl.MessageMarker.prototype=new google.maps.Marker(new GLatLng(0,0));brizzl.MessageMarker.prototype.openInfoWindow_=function(){brizzl.map.isExpanded()?this.openInfoWindowLarge():this.openInfoWindowSmall()};
brizzl.MessageMarker.prototype.openInfoWindowSmall=function(){html="";for(var a=0;a<this.place.messages.length;a++)message=this.place.messages[a],html+='<div style="width:300px;"><p style="font-size:0.94em;">'+message.placeNameUser+'</p><p><a href="'+message.url+'"><strong>'+brizzl.util.truncate(message.subject,30)+'</strong></a></p><p style="clear:both;font-size:0.9em;"><small>(Geo: '+this.getLatLng().lat()+", "+this.getLatLng().lng()+")</small></p></div>";this.openInfoWindowHtml(html)};
brizzl.MessageMarker.prototype.openInfoWindowLarge=function(){html="";for(var a=0;a<this.place.messages.length;a++)message=this.place.messages[a],html+='<div style="width:420px;"><p style="font-size:0.94em;"><img style="float:left;margin:0 4px 4px 0;" src="'+message.imageUrl+'" alt="" />'+message.placeNameUser+'</p><p><a href="'+message.url+'"><strong>'+brizzl.util.truncate(message.subject,30)+'</strong></a></p><p style="font-size:0.94em;">'+brizzl.util.truncate(message.body,300)+'</p><p style="clear:both;font-size:0.9em;"><small>(Geo: '+
this.getLatLng().lat()+", "+this.getLatLng().lng()+")</small></p></div>";this.openInfoWindowHtml(html,{maxWidth:400})};brizzl.MessageMarker.codes="1,2,3,4,5,6,7,8,9,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z".split(",");brizzl.MessageMarker.getCode=function(a){return"undefined"==typeof brizzl.MessageMarker.codes[a]?"x":brizzl.MessageMarker.codes[a]};
brizzl.MessageMarker.createMarker=function(a){var b=new GIcon;b.image="/img/markers/marker_"+brizzl.MessageMarker.getCode(a.idx)+".png";b.shadow="/img/markers/marker_shadow.png";b.iconSize=new GSize(20,34);b.shadowSize=new GSize(37,34);b.iconAnchor=new GPoint(9,34);b.infoWindowAnchor=new GPoint(9,2);b.infoShadowAnchor=new GPoint(18,25);var b={icon:b,title:a.name},c=new GLatLng(a.lat,a.lng),b=new brizzl.MessageMarker(c,b);b.place=a;GEvent.addListener(b,"click",b.openInfoWindow_);return b};brizzl.MessageSearchParameters=function(a){this.q=null;this.type=4;this.endDate=this.startDate=null;this.radius=10;this.centerLng=this.centerLat=this.maxLng=this.maxLat=this.minLng=this.minLat=null;this.start=0;this.limit=20;jQuery.extend(this,a)};
brizzl.MessageSearchParameters.create=function(){var a=brizzl.map.map_.getBounds(),b=a.getSouthWest(),a=a.getNorthEast(),b={q:$("#q").val(),startDate:$("#start_date").val(),endDate:$("#end_date").val(),minLat:b.lat(),maxLat:a.lat(),minLng:b.lng(),maxLng:a.lng()};return new brizzl.MessageSearchParameters(b)};brizzl.teaser=function(){var a=8E3,b,c=null,e=null,d=[],f=null,g=0,k=[{lat:52.5234051,lng:13.4113999,zoom:4},{lat:48.1391265,lng:11.5801863,zoom:4},{lat:39.5694701,lng:2.6500168,zoom:4}];return{doingAnimation:!1,init:function(){b=this;brizzl.map.enableDragSearch();f=["Sch\u00f6nstes L\u00e4cheln im Caf\u00e9. Bitte melde Dich!","Ich sah Dich in der Bahn und m\u00f6chte Dich wiedersehen!","Sylvie aus dem Urlaub: Wo bist Du?"];var a;for(a=0;3>a;a++)d[a]="/img/teaser"+a+".jpg";$.get("/ajax/welcome",
function(a){e=a;b.start()})},start:function(){window.setTimeout(function(){g=0;brizzl.teaser.doAnimation();c=window.setInterval(brizzl.teaser.doAnimation,a)},1E3)},stop:function(){window.clearInterval(c)},close:function(){brizzl.map.clear();brizzl.map.enableDragSearch();brizzl.map.collapse(brizzl.map.setDefaultCenter)},doAnimation:function(){var h,l;b.doingAnimation=!0;l=null==c?new google.maps.LatLng(k[0].lat,k[0].lng):new google.maps.LatLng(k[g].lat,k[g].lng);brizzl.map.map_.panTo(l);h=$(e);h.css("background-image")!=
"url('"+d[g]+"')"&&h.css("background-image","url('"+d[g]+"')");h.find("#teaser_text").html(f[g]);brizzl.map.map_.openInfoWindowHtml(l,e,{onCloseFn:function(){b.doingAnimation||($("#q").focus(),b.stop())}});h=$("#teaser");l=$("#teaser_text");h.css("background-image","url('"+d[g]+"')");l.html(f[g]);h.fadeIn("slow");g++;2<g&&(window.clearInterval(c),a*=2,3E5<a&&(a=3E5),g=0,c=window.setInterval(brizzl.teaser.doAnimation,a));b.doingAnimation=!1}}}();brizzl.util=function(){};brizzl.util.parseAnchor=function(a){return a.substr(a.indexOf("#")+1)};brizzl.util.validateEmail=function(a){return!/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})$/.test(a)?!1:!0};brizzl.util.getPageSize=function(){var a=document.documentElement;return arrayPageSize=[window.innerWidth||self.innerWidth||a&&a.clientWidth||document.body.clientWidth,window.innerHeight||self.innerHeight||a&&a.clientHeight||document.body.clientHeight]};
brizzl.util.isFfOnMacOsX=function(){var a=navigator.userAgent.toLowerCase();if(-1!=a.indexOf("mac")&&-1!=a.indexOf("firefox"))return!0};brizzl.util.truncate=function(a,b,c){c=c||"...";return a.length>b?(a=a.substring(0,b),a=a.replace(/\w+$/,""),a+c):a};brizzl.util.trim=function(a,b){return brizzl.util.ltrim(brizzl.util.rtrim(a,b),b)};brizzl.util.ltrim=function(a,b){return a.replace(RegExp("^["+(b||"\\s")+"]+","g"),"")};
brizzl.util.rtrim=function(a,b){return a.replace(RegExp("["+(b||"\\s")+"]+$","g"),"")};
brizzl.util.numberFormat=function(a,b,c,e){a=Math.round(a*Math.pow(10,b))/Math.pow(10,b);strNumber=a+"";arrInt=strNumber.split(".");arrInt[0]||(arrInt[0]="0");arrInt[1]||(arrInt[1]="");if(arrInt[1].length<b){precision=arrInt[1];for(i=arrInt[1].length+1;i<=b;i++)precision+="0";arrInt[1]=precision}if(""!=e&&3<arrInt[0].length){val=arrInt[0];arrInt[0]="";for(j=3;j<val.length;j+=3)extract=val.slice(val.length-j,val.length-j+3),arrInt[0]=e+extract+arrInt[0]+"";strFirst=val.substr(0,0==val.length%3?3:val.length%
3);arrInt[0]=strFirst+arrInt[0]}return arrInt[0]+c+arrInt[1]};brizzl.util.getQueryVariable=function(a,b){for(var c=(null!=b?b.location.search.substring(1):window.location.search.substring(1)).split("&"),e=0;e<c.length;e++){var d=c[e].split("=");if(d[0]==a)return decodeURIComponent(d[1])}return null};
brizzl.util.parseQuery=function(a){var b={};if(!a)return b;for(var a=a.split(/[;&]/),c=0;c<a.length;c++){var e=a[c].split("=");if(e&&2==e.length){var d=unescape(e[0]),e=unescape(e[1]),e=e.replace(/\+/g," ");b[d]=e}}return b};brizzl.util.htmlEncode=function(a){return a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")};brizzl.util.fileSizeRenderer=function(a){return-1==a?"-":1073741824<a?Math.ceil(a/1048576)+" MB":1099511627776<a?Math.ceil(a/1073741824)+" GB":Math.ceil(a/1024)+" KB"};
brizzl.util.minutes2Time=function(a){var b=Math.floor(a/60),a=a%60;return(1==(b+"").length?"0"+b:b)+":"+(1==(a+"").length?"0"+a:a)};brizzl.util.utcToLocal=function(a){"string"==typeof a&&(a=Lta.Util.stringToDate(a));var b=new Date;b.setTime(a.getTime()+6E4*b.getTimezoneOffset());return b};
brizzl.util.stringToDate=function(a){var b=new Date;3<a.length&&b.setFullYear(a.substr(0,4));6<a.length&&b.setMonth(parseInt(a.substr(5,2),10)-1);9<a.length&&b.setDate(parseInt(a.substr(8,2),10));12<a.length&&b.setHours(parseInt(a.substr(11,2),10));15<a.length&&b.setMinutes(parseInt(a.substr(14,2),10));18<a.length&&b.setSeconds(parseInt(a.substr(17,2),10));return b};brizzl.validator=function(){return{validateEmail:function(a){return!/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})$/.test(a)?!1:!0},isDigit:function(a){return/^[0-9]$/.test(a)},isInteger:function(a){return/^[0-9]+$/.test(a)}}}();$(function(){function a(){var a=brizzl.util.trim(window.location.pathname,"/").split("/");return 1<a.length&&"ort"==a[0]?!0:!1}function b(){var a=brizzl.util.trim(window.location.pathname,"/").split("/");return 1<a.length&&"suche"==a[0]?!0:!1}function c(){var a=brizzl.util.trim(window.location.pathname,"/").split("/");return 1<a.length?decodeURI(a[1]):!1}function e(){var a=$.url.param("messageId");if(null==a)a:{a=brizzl.util.trim(window.location.pathname,"/").split("/");if(1<a.length&&(a=a[1].substr(a[1].lastIndexOf("-")+
1),a=a.substring(0,a.indexOf(".")),"m"==a.substr(0,1)&&(a=a.substr(1),brizzl.validator.isInteger(a))))break a;a=null}return a}brizzl.auth.init();brizzl.listView.init();brizzl.messageDetail.init();brizzl.messageDialog.init();$("#search_form").click(brizzl.teaser.stop);$("#search_form").submit(brizzl.map.searchMessages);if(google.maps){brizzl.map.init($("#map_view"));var d=e(),f=$.url.param("mode");"#compose"==location.hash?brizzl.messageDialog.open():null!=d?null!=d&&2==f?(f=new brizzl.Place,f.name=
$.url.param("placeName"),f.address=$.url.param("address"),f.lat=$.url.param("lat"),f.lng=$.url.param("lng"),brizzl.messageDialog.setCurrPage("ajax.message_new_2"),brizzl.messageDialog.setPlace(f),brizzl.messageDialog.setMessageId(d),brizzl.messageDialog.open()):null!=d&&$.getJSON("/api/message.getPlace",{messageId:d},function(a){null!=a&&"object"==typeof a&&(a=brizzl.MessageMarker.createMarker(a.place),brizzl.map.addMarker(a),brizzl.map.setCenter(a.getLatLng(),17),brizzl.map.refresh())}):b()?(d=c(),
$.getJSON("/api/message.getPlace",{path:d},function(a){null!=a&&"object"==typeof a&&(a=brizzl.MessageMarker.createMarker(a.place),brizzl.map.addMarker(a),brizzl.map.refresh())})):a()?brizzl.map.update():$("#q").val()&&$("#q").val()!=$("#q").attr("title")?brizzl.map.searchMessages():(!window.location.pathname||"/"==window.location.pathname)&&!window.location.search&&!window.location.hash&&brizzl.teaser.init();(!$("#q").val()||$("#q").val()==$("#q").attr("title"))&&$("#q").clearingInput()}$("#fb-like-button").html('<iframe id="fb-like-button-frame" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.brizzl.de%2F&amp;layout=button_count&amp;show_faces=false&amp;width=120&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" frameborder="0" style="border:0;display:none;overflow:hidden;width:120px;height:24px;" allowTransparency="true"></iframe>');
$("#fb-like-button-frame").show();$("#fb-likebox").html('<iframe src="http://www.facebook.com/plugins/fan.php?id=142989695930&width=980&height=236&connections=70&show_faces=false&stream=false&header=false" scrolling="no" frameborder="0" style="border:none;width:980px; height:236px;" allowTransparency="true"></iframe>');$(window).unload(function(){google.maps.Unload()})});
