var a;
function MarkerManager(b,d){var c=this;c.map_=b;c.mapZoom_=b.getZoom();c.projection_=b.getCurrentMapType().getProjection();d=d||{};c.tileSize_=MarkerManager.DEFAULT_TILE_SIZE_;for(var e=b.getMapTypes(),f=e[0].getMaximumResolution(),g=0;g<e.length;g++){var l=e[g].getMaximumResolution();if(l>f)f=l}c.maxZoom_=d.maxZoom||f;c.trackMarkers_=d.trackMarkers;c.show_=d.show||true;d=typeof d.borderPadding==="number"?d.borderPadding:MarkerManager.DEFAULT_BORDER_PADDING_;c.swPadding_=new GSize(-d,d);c.nePadding_=new GSize(d,
-d);c.borderPadding_=d;c.gridWidth_=[];c.grid_=[];c.grid_[c.maxZoom_]=[];c.numMarkers_=[];c.numMarkers_[c.maxZoom_]=0;GEvent.bind(b,"moveend",c,c.onMapMoveEnd_);c.removeOverlay_=function(h){b.removeOverlay(h);c.shownMarkers_--};c.addOverlay_=function(h){if(c.show_){b.addOverlay(h);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;
a=MarkerManager.prototype;a.resetManager_=function(){for(var b=this,d=MarkerManager.MERCATOR_ZOOM_LEVEL_ZERO_RANGE,c=0;c<=b.maxZoom_;++c){b.grid_[c]=[];b.numMarkers_[c]=0;b.gridWidth_[c]=Math.ceil(d/b.tileSize_);d<<=1}};a.clearMarkers=function(){var b=this;b.processAll_(b.shownBounds_,b.removeOverlay_);b.resetManager_()};a.getTilePoint_=function(b,d,c){b=this.projection_.fromLatLngToPixel(b,d);return new GPoint(Math.floor((b.x+c.width)/this.tileSize_),Math.floor((b.y+c.height)/this.tileSize_))};
a.addMarkerBatch_=function(b,d,c){var e=b.getPoint();b.MarkerManager_minZoom=d;this.trackMarkers_&&GEvent.bind(b,"changed",this,this.onMarkerMoved_);e=this.getTilePoint_(e,c,GSize.ZERO);for(c=c;c>=d;c--){this.getGridCellCreate_(e.x,e.y,c).push(b);e.x>>=1;e.y>>=1}};a.isGridPointVisible_=function(b){var d=this,c=d.shownBounds_.minY<=b.y&&b.y<=d.shownBounds_.maxY,e=d.shownBounds_.minX,f=e<=b.x&&b.x<=d.shownBounds_.maxX;if(!f&&e<0){d=d.gridWidth_[d.shownBounds_.z];f=e+d<=b.x&&b.x<=d-1}return c&&f};
a.onMarkerMoved_=function(b,d,c){var e=this,f=e.maxZoom_,g=false;d=e.getTilePoint_(d,f,GSize.ZERO);for(c=e.getTilePoint_(c,f,GSize.ZERO);f>=0&&(d.x!==c.x||d.y!==c.y);){var l=e.getGridCellNoCreate_(d.x,d.y,f);l&&e.removeFromArray_(l,b)&&e.getGridCellCreate_(c.x,c.y,f).push(b);if(f===e.mapZoom_)if(e.isGridPointVisible_(d)){if(!e.isGridPointVisible_(c)){e.removeOverlay_(b);g=true}}else if(e.isGridPointVisible_(c)){e.addOverlay_(b);g=true}d.x>>=1;d.y>>=1;c.x>>=1;c.y>>=1;--f}g&&e.notifyListeners_()};
a.removeMarker=function(b){var d=this,c=d.maxZoom_,e=false,f=b.getPoint();for(f=d.getTilePoint_(f,c,GSize.ZERO);c>=0;){var g=d.getGridCellNoCreate_(f.x,f.y,c);g&&d.removeFromArray_(g,b);if(c===d.mapZoom_)if(d.isGridPointVisible_(f)){d.removeOverlay_(b);e=true}f.x>>=1;f.y>>=1;--c}e&&d.notifyListeners_();d.numMarkers_[b.MarkerManager_minZoom]--};a.addMarkers=function(b,d,c){c=this.getOptMaxZoom_(c);for(var e=b.length-1;e>=0;e--)this.addMarkerBatch_(b[e],d,c);this.numMarkers_[d]+=b.length};
a.getOptMaxZoom_=function(b){return b||this.maxZoom_};a.getMarkerCount=function(b){for(var d=0,c=0;c<=b;c++)d+=this.numMarkers_[c];return d};a.getMarker=function(b,d,c){var e=this,f=new GLatLng(b,d),g=e.getTilePoint_(f,c,GSize.ZERO);f=new GMarker(f);c=e.getGridCellNoCreate_(g.x,g.y,c);if(c!=undefined)for(e=0;e<c.length;e++)if(b==c[e].getLatLng().lat()&&d==c[e].getLatLng().lng())f=c[e];return f};
a.addMarker=function(b,d,c){var e=this;c=this.getOptMaxZoom_(c);e.addMarkerBatch_(b,d,c);var f=e.getTilePoint_(b.getPoint(),e.mapZoom_,GSize.ZERO);if(e.isGridPointVisible_(f)&&d<=e.shownBounds_.z&&e.shownBounds_.z<=c){e.addOverlay_(b);e.notifyListeners_()}this.numMarkers_[d]++};GBounds.prototype.containsPoint=function(b){var d=this;return d.minX<=b.x&&d.maxX>=b.x&&d.minY<=b.y&&d.maxY>=b.y};a=MarkerManager.prototype;
a.getGridCellCreate_=function(b,d,c){var e=this.grid_[c];if(b<0)b+=this.gridWidth_[c];c=e[b];if(!c){c=e[b]=[];return c[d]=[]}b=c[d];if(!b)return c[d]=[];return b};a.getGridCellNoCreate_=function(b,d,c){var e=this.grid_[c];if(b<0)b+=this.gridWidth_[c];return(b=e[b])?b[d]:undefined};
a.getGridBounds_=function(b,d,c,e){d=Math.min(d,this.maxZoom_);var f=b.getSouthWest();b=b.getNorthEast();c=this.getTilePoint_(f,d,c);e=this.getTilePoint_(b,d,e);var g=this.gridWidth_[d];if(b.lng()<f.lng()||e.x<c.x)c.x-=g;if(e.x-c.x+1>=g){c.x=0;e.x=g-1}f=new GBounds([c,e]);f.z=d;return f};a.getMapGridBounds_=function(){var b=this;return b.getGridBounds_(b.map_.getBounds(),b.mapZoom_,b.swPadding_,b.nePadding_)};a.onMapMoveEnd_=function(){this.objectSetTimeout_(this,this.updateMarkers_,0)};
a.objectSetTimeout_=function(b,d,c){return window.setTimeout(function(){d.call(b)},c)};a.visible=function(){return this.show_?true:false};a.isHidden=function(){return!this.show_};a.show=function(){this.show_=true;this.refresh()};a.hide=function(){this.show_=false;this.refresh()};a.toggle=function(){this.show_=!this.show_;this.refresh()};a.refresh=function(){var b=this;b.shownMarkers_>0&&b.processAll_(b.shownBounds_,b.removeOverlay_);b.show_&&b.processAll_(b.shownBounds_,b.addOverlay_);b.notifyListeners_()};
a.updateMarkers_=function(){var b=this;b.mapZoom_=this.map_.getZoom();var d=b.getMapGridBounds_();if(!(d.equals(b.shownBounds_)&&d.z===b.shownBounds_.z)){if(d.z!==b.shownBounds_.z){b.processAll_(b.shownBounds_,b.removeOverlay_);b.show_&&b.processAll_(d,b.addOverlay_)}else{b.rectangleDiff_(b.shownBounds_,d,b.removeCellMarkers_);b.show_&&b.rectangleDiff_(d,b.shownBounds_,b.addCellMarkers_)}b.shownBounds_=d;b.notifyListeners_()}};
a.notifyListeners_=function(){GEvent.trigger(this,"changed",this.shownBounds_,this.shownMarkers_)};a.processAll_=function(b,d){for(var c=b.minX;c<=b.maxX;c++)for(var e=b.minY;e<=b.maxY;e++)this.processCellMarkers_(c,e,b.z,d)};a.processCellMarkers_=function(b,d,c,e){if(b=this.getGridCellNoCreate_(b,d,c))for(d=b.length-1;d>=0;d--)e(b[d])};a.removeCellMarkers_=function(b,d,c){this.processCellMarkers_(b,d,c,this.removeOverlay_)};a.addCellMarkers_=function(b,d,c){this.processCellMarkers_(b,d,c,this.addOverlay_)};
a.rectangleDiff_=function(b,d,c){var e=this;e.rectangleDiffCoords_(b,d,function(f,g){c.apply(e,[f,g,b.z])})};a.rectangleDiffCoords_=function(b,d,c){var e=b.minX,f=b.minY,g=b.maxX;b=b.maxY;var l=d.minX,h=d.minY,k=d.maxX;d=d.maxY;var m,n;for(m=e;m<=g;m++){for(n=f;n<=b&&n<h;n++)c(m,n);for(n=Math.max(d+1,f);n<=b;n++)c(m,n)}for(n=Math.max(f,h);n<=Math.min(b,d);n++){for(m=Math.min(g+1,l)-1;m>=e;m--)c(m,n);for(m=Math.max(e,k+1);m<=g;m++)c(m,n)}};
a.removeFromArray_=function(b,d,c){for(var e=0,f=0;f<b.length;++f)if(b[f]===d||c&&b[f]===d){b.splice(f--,1);e++}return e};var SWFUpload;if(SWFUpload==undefined)SWFUpload=function(b){this.initSWFUpload(b)};SWFUpload.prototype.initSWFUpload=function(b){try{this.customSettings={};this.settings=b;this.eventQueue=[];this.movieName="SWFUpload_"+SWFUpload.movieCount++;this.movieElement=null;SWFUpload.instances[this.movieName]=this;this.initSettings();this.loadFlash();this.displayDebugInfo()}catch(d){delete SWFUpload.instances[this.movieName];throw d;}};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(b){if(!b||typeof b!=="string"||b.match(/^https?:\/\//i)||b.match(/^\//))return b;var d=window.location.pathname.lastIndexOf("/");path=d<=0?"/":window.location.pathname.substr(0,d)+"/";return path+b};a=SWFUpload.prototype;
a.initSettings=function(){this.ensureDefault=function(b,d){this.settings[b]=this.settings[b]==undefined?d:this.settings[b]};this.ensureDefault("upload_url","");this.ensureDefault("preserve_relative_urls",false);this.ensureDefault("file_post_name","Filedata");this.ensureDefault("post_params",{});this.ensureDefault("use_query_string",false);this.ensureDefault("requeue_on_error",false);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",true);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",false);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",false);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;if(this.settings.prevent_swf_caching)this.settings.flash_url=this.settings.flash_url+(this.settings.flash_url.indexOf("?")<0?"?":"&")+"preventswfcaching="+(new Date).getTime();if(!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};
a.loadFlash=function(){var b,d;if(document.getElementById(this.movieName)!==null)throw"ID "+this.movieName+" is already in use. The Flash Object could not be added";b=document.getElementById(this.settings.button_placeholder_id)||this.settings.button_placeholder;if(b==undefined)throw"Could not find the placeholder element: "+this.settings.button_placeholder_id;d=document.createElement("div");d.innerHTML=this.getFlashHTML();b.parentNode.replaceChild(d.firstChild,b);if(window[this.movieName]==undefined)window[this.movieName]=
this.getMovieElement()};
a.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("")};
a.getFlashVars=function(){var b=this.buildParamString(),d=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(d),"&amp;assumeSuccessTimeout=",encodeURIComponent(this.settings.assume_success_timeout),"&amp;params=",
encodeURIComponent(b),"&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("")};a.getMovieElement=function(){if(this.movieElement==undefined)this.movieElement=document.getElementById(this.movieName);if(this.movieElement===null)throw"Could not find Flash element";return this.movieElement};
a.buildParamString=function(){var b=this.settings.post_params,d=[];if(typeof b==="object")for(var c in b)b.hasOwnProperty(c)&&d.push(encodeURIComponent(c.toString())+"="+encodeURIComponent(b[c].toString()));return d.join("&amp;")};
a.destroy=function(){try{this.cancelUpload(null,false);var b=null;if((b=this.getMovieElement())&&typeof b.CallFunction==="unknown"){for(var d in b)try{if(typeof b[d]==="function")b[d]=null}catch(c){}try{b.parentNode.removeChild(b)}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 true}catch(f){return false}};
a.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:  ",
(typeof this.settings.swfupload_loaded_handler==="function").toString(),"\n\tfile_dialog_start_handler assigned: ",(typeof this.settings.file_dialog_start_handler==="function").toString(),"\n\tfile_queued_handler assigned:       ",(typeof this.settings.file_queued_handler==="function").toString(),"\n\tfile_queue_error_handler assigned:  ",(typeof this.settings.file_queue_error_handler==="function").toString(),"\n\tupload_start_handler assigned:      ",(typeof this.settings.upload_start_handler===
"function").toString(),"\n\tupload_progress_handler assigned:   ",(typeof this.settings.upload_progress_handler==="function").toString(),"\n\tupload_error_handler assigned:      ",(typeof this.settings.upload_error_handler==="function").toString(),"\n\tupload_success_handler assigned:    ",(typeof this.settings.upload_success_handler==="function").toString(),"\n\tupload_complete_handler assigned:   ",(typeof this.settings.upload_complete_handler==="function").toString(),"\n\tdebug_handler assigned:             ",
(typeof this.settings.debug_handler==="function").toString(),"\n"].join(""))};a.addSetting=function(b,d,c){return d==undefined?(this.settings[b]=c):(this.settings[b]=d)};a.getSetting=function(b){if(this.settings[b]!=undefined)return this.settings[b];return""};
a.callFlash=function(b,d){d=d||[];var c=this.getMovieElement(),e,f;try{f=c.CallFunction('<invoke name="'+b+'" returntype="javascript">'+__flash__argumentsToXML(d,0)+"</invoke>");e=eval(f)}catch(g){throw"Call to "+b+" failed";}if(e!=undefined&&typeof e.post==="object")e=this.unescapeFilePostParams(e);return e};a.selectFile=function(){this.callFlash("SelectFile")};a.selectFiles=function(){this.callFlash("SelectFiles")};a.startUpload=function(b){this.callFlash("StartUpload",[b])};
a.cancelUpload=function(b,d){if(d!==false)d=true;this.callFlash("CancelUpload",[b,d])};a.stopUpload=function(){this.callFlash("StopUpload")};a.getStats=function(){return this.callFlash("GetStats")};a.setStats=function(b){this.callFlash("SetStats",[b])};a.getFile=function(b){return typeof b==="number"?this.callFlash("GetFileByIndex",[b]):this.callFlash("GetFile",[b])};a.addFileParam=function(b,d,c){return this.callFlash("AddFileParam",[b,d,c])};
a.removeFileParam=function(b,d){this.callFlash("RemoveFileParam",[b,d])};a.setUploadURL=function(b){this.settings.upload_url=b.toString();this.callFlash("SetUploadURL",[b])};a.setPostParams=function(b){this.settings.post_params=b;this.callFlash("SetPostParams",[b])};a.addPostParam=function(b,d){this.settings.post_params[b]=d;this.callFlash("SetPostParams",[this.settings.post_params])};a.removePostParam=function(b){delete this.settings.post_params[b];this.callFlash("SetPostParams",[this.settings.post_params])};
a.setFileTypes=function(b,d){this.settings.file_types=b;this.settings.file_types_description=d;this.callFlash("SetFileTypes",[b,d])};a.setFileSizeLimit=function(b){this.settings.file_size_limit=b;this.callFlash("SetFileSizeLimit",[b])};a.setFileUploadLimit=function(b){this.settings.file_upload_limit=b;this.callFlash("SetFileUploadLimit",[b])};a.setFileQueueLimit=function(b){this.settings.file_queue_limit=b;this.callFlash("SetFileQueueLimit",[b])};
a.setFilePostName=function(b){this.settings.file_post_name=b;this.callFlash("SetFilePostName",[b])};a.setUseQueryString=function(b){this.settings.use_query_string=b;this.callFlash("SetUseQueryString",[b])};a.setRequeueOnError=function(b){this.settings.requeue_on_error=b;this.callFlash("SetRequeueOnError",[b])};a.setHTTPSuccess=function(b){if(typeof b==="string")b=b.replace(" ","").split(",");this.settings.http_success=b;this.callFlash("SetHTTPSuccess",[b])};
a.setAssumeSuccessTimeout=function(b){this.settings.assume_success_timeout=b;this.callFlash("SetAssumeSuccessTimeout",[b])};a.setDebugEnabled=function(b){this.settings.debug_enabled=b;this.callFlash("SetDebugEnabled",[b])};a.setButtonImageURL=function(b){if(b==undefined)b="";this.settings.button_image_url=b;this.callFlash("SetButtonImageURL",[b])};
a.setButtonDimensions=function(b,d){this.settings.button_width=b;this.settings.button_height=d;var c=this.getMovieElement();if(c!=undefined){c.style.width=b+"px";c.style.height=d+"px"}this.callFlash("SetButtonDimensions",[b,d])};a.setButtonText=function(b){this.settings.button_text=b;this.callFlash("SetButtonText",[b])};a.setButtonTextPadding=function(b,d){this.settings.button_text_top_padding=d;this.settings.button_text_left_padding=b;this.callFlash("SetButtonTextPadding",[b,d])};
a.setButtonTextStyle=function(b){this.settings.button_text_style=b;this.callFlash("SetButtonTextStyle",[b])};a.setButtonDisabled=function(b){this.settings.button_disabled=b;this.callFlash("SetButtonDisabled",[b])};a.setButtonAction=function(b){this.settings.button_action=b;this.callFlash("SetButtonAction",[b])};a.setButtonCursor=function(b){this.settings.button_cursor=b;this.callFlash("SetButtonCursor",[b])};
a.queueEvent=function(b,d){if(d==undefined)d=[];else d instanceof Array||(d=[d]);var c=this;if(typeof this.settings[b]==="function"){this.eventQueue.push(function(){this.settings[b].apply(this,d)});setTimeout(function(){c.executeNextEvent()},0)}else if(this.settings[b]!==null)throw"Event handler "+b+" is unknown or is not a function";};a.executeNextEvent=function(){var b=this.eventQueue?this.eventQueue.shift():null;typeof b==="function"&&b.apply(this)};
a.unescapeFilePostParams=function(b){var d=/[$]([0-9a-f]{4})/i,c={},e;if(b!=undefined){for(var f in b.post)if(b.post.hasOwnProperty(f)){e=f;for(var g;(g=d.exec(e))!==null;)e=e.replace(g[0],String.fromCharCode(parseInt("0x"+g[1],16)));c[e]=b.post[f]}b.post=c}return b};a.testExternalInterface=function(){try{return this.callFlash("TestExternalInterface")}catch(b){return false}};a.flashReady=function(){var b=this.getMovieElement();if(b){this.cleanUp(b);this.queueEvent("swfupload_loaded_handler")}else this.debug("Flash called back ready but the flash movie can't be found.")};
a.cleanUp=function(b){try{if(this.movieElement&&typeof b.CallFunction==="unknown"){this.debug("Removing Flash functions hooks (this should only run in IE and should prevent memory leaks)");for(var d in b)try{if(typeof b[d]==="function")b[d]=null}catch(c){}}}catch(e){}window.__flash__removeCallback=function(f,g){try{if(f)f[g]=null}catch(l){}}};a.fileDialogStart=function(){this.queueEvent("file_dialog_start_handler")};
a.fileQueued=function(b){b=this.unescapeFilePostParams(b);this.queueEvent("file_queued_handler",b)};a.fileQueueError=function(b,d,c){b=this.unescapeFilePostParams(b);this.queueEvent("file_queue_error_handler",[b,d,c])};a.fileDialogComplete=function(b,d,c){this.queueEvent("file_dialog_complete_handler",[b,d,c])};a.uploadStart=function(b){b=this.unescapeFilePostParams(b);this.queueEvent("return_upload_start_handler",b)};
a.returnUploadStart=function(b){var d;if(typeof this.settings.upload_start_handler==="function"){b=this.unescapeFilePostParams(b);d=this.settings.upload_start_handler.call(this,b)}else if(this.settings.upload_start_handler!=undefined)throw"upload_start_handler must be a function";if(d===undefined)d=true;d=!!d;this.callFlash("ReturnUploadStart",[d])};a.uploadProgress=function(b,d,c){b=this.unescapeFilePostParams(b);this.queueEvent("upload_progress_handler",[b,d,c])};
a.uploadError=function(b,d,c){b=this.unescapeFilePostParams(b);this.queueEvent("upload_error_handler",[b,d,c])};a.uploadSuccess=function(b,d,c){b=this.unescapeFilePostParams(b);this.queueEvent("upload_success_handler",[b,d,c])};a.uploadComplete=function(b){b=this.unescapeFilePostParams(b);this.queueEvent("upload_complete_handler",b)};a.debug=function(b){this.queueEvent("debug_handler",b)};
a.debugMessage=function(b){if(this.settings.debug){var d=[];if(typeof b==="object"&&typeof b.name==="string"&&typeof b.message==="string"){for(var c in b)b.hasOwnProperty(c)&&d.push(c+": "+b[c]);b=d.join("\n")||"";d=b.split("\n");b="EXCEPTION: "+d.join("\nEXCEPTION: ");SWFUpload.Console.writeLine(b)}else SWFUpload.Console.writeLine(b)}};SWFUpload.Console={};
SWFUpload.Console.writeLine=function(b){var d,c;try{d=document.getElementById("SWFUpload_Console");if(!d){c=document.createElement("form");document.getElementsByTagName("body")[0].appendChild(c);d=document.createElement("textarea");d.id="SWFUpload_Console";d.style.fontFamily="monospace";d.setAttribute("wrap","off");d.wrap="off";d.style.overflow="auto";d.style.width="700px";d.style.height="350px";d.style.margin="5px";c.appendChild(d)}d.value+=b+"\n";d.scrollTop=d.scrollHeight-d.clientHeight}catch(e){alert("Exception: "+
e.name+" Message: "+e.message)}};(function(b){var d=["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"],c=[];b.fn.swfupload=function(){var e=b.makeArray(arguments);return this.each(function(){var f;if(e.length==1&&typeof e[0]=="object"){f=b(this).data("__swfu");if(!f){var g=e[0],l=b(this);f=[];b.merge(f,
d);b.merge(f,c);b.each(f,function(k,m){var n=m.replace(/_handler$/,"").replace(/_([a-z])/g,function(o,p){return p.toUpperCase()});g[m]=function(){var o=b.Event(n);l.trigger(o,b.makeArray(arguments));return!o.isDefaultPrevented()}});b(this).data("__swfu",new SWFUpload(g))}}else if(e.length>0&&typeof e[0]=="string"){var h=e.shift();(f=b(this).data("__swfu"))&&f[h]&&f[h].apply(f,e)}})};b.swfupload={additionalHandlers:function(){if(arguments.length===0)return c.slice();else b(arguments).each(function(e,
f){b.merge(c,b.makeArray(f))})},defaultHandlers:function(){return d.slice()},getInstance:function(e){return b(e).data("__swfu")}}})(jQuery);(function(b){b.fn.autogrow=function(){this.filter("textarea").each(function(){var d=b(this),c=d.height();d.css("lineHeight");var e=b("<div></div>").css({position:"absolute",top:-10000,left:-10000,width:b(this).width(),fontSize:d.css("fontSize"),fontFamily:d.css("fontFamily"),lineHeight:d.css("lineHeight"),resize:"none"}).appendTo(document.body);d=function(){if(e.width()){c||(c=b(this).height());var f=this.value.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/&/g,"&amp;").replace(/\n/g,"<br/>");
e.html(f);b(this).css("height",Math.max(e.height()+20,c))}else e.css("width",b(this).width())};b(this).change(d).keyup(d).keydown(d);d.apply(this)});return this}})(jQuery);(function(b){b.extend(b.fn,{clearingInput:function(d){d=b.extend({blurClass:"blur"},d);return this.each(function(){function c(){return(l=g.find("label[for="+f.attr("id")+"]"))?l.css({position:"absolute",left:"-9999px"}).text():""}function e(){return f.attr("title")}var f=b(this).addClass(d.blurClass),g=f.parents("form:first"),l,h;if(h=d.text||e()||c()||f.val()){f.val(h);f.blur(function(){f.val()===""&&f.val(h).addClass(d.blurClass)}).focus(function(){f.val()===h&&f.val("");f.removeClass(d.blurClass)});
g.submit(function(){f.hasClass(d.blurClass)&&f.val("")});f.blur()}})}})})(jQuery);(function(b){function d(){b.fn.ajaxSubmit.debug&&window.console&&window.console.log&&window.console.log("[jquery.form] "+Array.prototype.join.call(arguments,""))}b.fn.ajaxSubmit=function(c){function e(){function o(){if(!C++){v.detachEvent?v.detachEvent("onload",o):v.removeEventListener("load",o,false);var w=true;try{if(D)throw"timeout";var t,u;u=v.contentWindow?v.contentWindow.document:v.contentDocument?v.contentDocument:v.document;if((u.body==null||u.body.innerHTML=="")&&!E){E=1;C--;setTimeout(o,
100);return}s.responseText=u.body?u.body.innerHTML:null;s.responseXML=u.XMLDocument?u.XMLDocument:u;s.getResponseHeader=function(G){return{"content-type":r.dataType}[G]};if(r.dataType=="json"||r.dataType=="script"){var y=u.getElementsByTagName("textarea")[0];s.responseText=y?y.value:s.responseText}else if(r.dataType=="xml"&&!s.responseXML&&s.responseText!=null)s.responseXML=p(s.responseText);t=b.httpData(s,r.dataType)}catch(H){w=false;b.handleError(r,s,"error",H)}if(w){r.success(t,"success");z&&b.event.trigger("ajaxSuccess",
[s,r])}z&&b.event.trigger("ajaxComplete",[s,r]);z&&!--b.active&&b.event.trigger("ajaxStop");if(r.complete)r.complete(s,w?"success":"error");setTimeout(function(){A.remove();s.responseXML=null},100)}}function p(w,t){if(window.ActiveXObject){t=new ActiveXObject("Microsoft.XMLDOM");t.async="false";t.loadXML(w)}else t=(new DOMParser).parseFromString(w,"text/xml");return t&&t.documentElement&&t.documentElement.tagName!="parsererror"?t:null}var q=k[0];if(b(":input[name=submit]",q).length)alert('Error: Form elements must not be named "submit".');
else{var r=b.extend({},b.ajaxSettings,c),x=jQuery.extend(true,{},b.extend(true,{},b.ajaxSettings),r),B="jqFormIO"+(new Date).getTime(),A=b('<iframe id="'+B+'" name="'+B+'" src="javascript:false;document.write("");" />'),v=A[0];A.css({position:"absolute",top:"-1000px",left:"-1000px"});var s={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(){this.aborted=1;A.attr("src",
"about:blank")}},z=r.global;z&&!b.active++&&b.event.trigger("ajaxStart");z&&b.event.trigger("ajaxSend",[s,r]);if(x.beforeSend&&x.beforeSend(s,x)===false)x.global&&jQuery.active--;else if(!s.aborted){var C=0,D=0;if(x=q.clk){var F=x.name;if(F&&!x.disabled){c.extraData=c.extraData||{};c.extraData[F]=x.value;if(x.type=="image"){c.extraData[name+".x"]=q.clk_x;c.extraData[name+".y"]=q.clk_y}}}setTimeout(function(){var w=k.attr("target"),t=k.attr("action");q.setAttribute("target",B);q.getAttribute("method")!=
"POST"&&q.setAttribute("method","POST");q.getAttribute("action")!=r.url&&q.setAttribute("action",r.url);c.skipEncodingOverride||k.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"});r.timeout&&setTimeout(function(){D=true;o()},r.timeout);var u=[];try{if(c.extraData)for(var y in c.extraData)u.push(b('<input type="hidden" name="'+y+'" value="'+c.extraData[y]+'" />').appendTo(q)[0]);A.appendTo("body");v.attachEvent?v.attachEvent("onload",o):v.addEventListener("load",o,false);q.submit()}finally{q.setAttribute("action",
t);w?q.setAttribute("target",w):k.removeAttr("target");b(u).remove()}},10);var E=0}}}if(!this.length){d("ajaxSubmit: skipping submit process - no element selected");return this}if(typeof c=="function")c={success:c};c=b.extend({url:this.attr("action")||window.location.toString(),type:this.attr("method")||"GET"},c||{});var f={};this.trigger("form-pre-serialize",[this,c,f]);if(f.veto){d("ajaxSubmit: submit vetoed via form-pre-serialize trigger");return this}if(c.beforeSerialize&&c.beforeSerialize(this,
c)===false){d("ajaxSubmit: submit aborted via beforeSerialize callback");return this}var g=this.formToArray(c.semantic);if(c.data){c.extraData=c.data;for(var l in c.data)if(c.data[l]instanceof Array)for(var h in c.data[l])g.push({name:l,value:c.data[l][h]});else g.push({name:l,value:c.data[l]})}if(c.beforeSubmit&&c.beforeSubmit(g,this,c)===false){d("ajaxSubmit: submit aborted via beforeSubmit callback");return this}this.trigger("form-submit-validate",[g,this,c,f]);if(f.veto){d("ajaxSubmit: submit vetoed via form-submit-validate trigger");
return this}f=b.param(g);if(c.type.toUpperCase()=="GET"){c.url+=(c.url.indexOf("?")>=0?"&":"?")+f;c.data=null}else c.data=f;var k=this,m=[];c.resetForm&&m.push(function(){k.resetForm()});c.clearForm&&m.push(function(){k.clearForm()});if(!c.dataType&&c.target){var n=c.success||function(){};m.push(function(o){b(c.target).html(o).each(n,arguments)})}else c.success&&m.push(c.success);c.success=function(o,p){for(var q=0,r=m.length;q<r;q++)m[q].apply(c,[o,p,k])};f=b("input:file",this).fieldValue();g=false;
for(l=0;l<f.length;l++)if(f[l])g=true;if(c.iframe||g)c.closeKeepAlive?b.get(c.closeKeepAlive,e):e();else b.ajax(c);this.trigger("form-submit-notify",[this,c]);return this};b.fn.ajaxForm=function(c){return this.ajaxFormUnbind().bind("submit.form-plugin",function(){b(this).ajaxSubmit(c);return false}).each(function(){b(":submit,input:image",this).bind("click.form-plugin",function(e){var f=this.form;f.clk=this;if(this.type=="image")if(e.offsetX!=undefined){f.clk_x=e.offsetX;f.clk_y=e.offsetY}else if(typeof b.fn.offset==
"function"){var g=b(this).offset();f.clk_x=e.pageX-g.left;f.clk_y=e.pageY-g.top}else{f.clk_x=e.pageX-this.offsetLeft;f.clk_y=e.pageY-this.offsetTop}setTimeout(function(){f.clk=f.clk_x=f.clk_y=null},10)})})};b.fn.ajaxFormUnbind=function(){this.unbind("submit.form-plugin");return this.each(function(){b(":submit,input:image",this).unbind("click.form-plugin")})};b.fn.formToArray=function(c){var e=[{name:"ajax",value:true}];if(this.length==0)return e;var f=this[0],g=c?f.getElementsByTagName("*"):f.elements;
if(!g)return e;for(var l=0,h=g.length;l<h;l++){var k=g[l],m=k.name;if(m)if(c&&f.clk&&k.type=="image")!k.disabled&&f.clk==k&&e.push({name:m+".x",value:f.clk_x},{name:m+".y",value:f.clk_y});else if((k=b.fieldValue(k,true))&&k.constructor==Array)for(var n=0,o=k.length;n<o;n++)e.push({name:m,value:k[n]});else k!==null&&typeof k!="undefined"&&e.push({name:m,value:k})}if(!c&&f.clk){c=f.getElementsByTagName("input");l=0;for(h=c.length;l<h;l++){g=c[l];(m=g.name)&&!g.disabled&&g.type=="image"&&f.clk==g&&e.push({name:m+
".x",value:f.clk_x},{name:m+".y",value:f.clk_y})}}return e};b.fn.formSerialize=function(c){return b.param(this.formToArray(c))};b.fn.fieldSerialize=function(c){var e=[];this.each(function(){var f=this.name;if(f){var g=b.fieldValue(this,c);if(g&&g.constructor==Array)for(var l=0,h=g.length;l<h;l++)e.push({name:f,value:g[l]});else g!==null&&typeof g!="undefined"&&e.push({name:this.name,value:g})}});return b.param(e)};b.fn.fieldValue=function(c){for(var e=[],f=0,g=this.length;f<g;f++){var l=b.fieldValue(this[f],
c);l===null||typeof l=="undefined"||l.constructor==Array&&!l.length||(l.constructor==Array?b.merge(e,l):e.push(l))}return e};b.fieldValue=function(c,e){var f=c.name,g=c.type,l=c.tagName.toLowerCase();if(typeof e=="undefined")e=true;if(e&&(!f||c.disabled||g=="reset"||g=="button"||(g=="checkbox"||g=="radio")&&!c.checked||(g=="submit"||g=="image")&&c.form&&c.form.clk!=c||l=="select"&&c.selectedIndex==-1))return null;if(l=="select"){l=c.selectedIndex;if(l<0)return null;e=[];c=c.options;f=(g=g=="select-one")?
l+1:c.length;for(l=g?l:0;l<f;l++){var h=c[l];if(h.selected){var k=h.value;k||(k=h.attributes&&h.attributes.value&&!h.attributes.value.specified?h.text:h.value);if(g)return k;e.push(k)}}return e}return c.value};b.fn.clearForm=function(){return this.each(function(){b("input,select,textarea",this).clearFields()})};b.fn.clearFields=b.fn.clearInputs=function(){return this.each(function(){var c=this.type,e=this.tagName.toLowerCase();if(c=="text"||c=="password"||e=="textarea")this.value="";else if(c=="checkbox"||
c=="radio")this.checked=false;else if(e=="select")this.selectedIndex=-1})};b.fn.resetForm=function(){return this.each(function(){if(typeof this.reset=="function"||typeof this.reset=="object"&&!this.reset.nodeType)this.reset()})};b.fn.enable=function(c){if(c==undefined)c=true;return this.each(function(){this.disabled=!c})};b.fn.selected=function(c){if(c==undefined)c=true;return this.each(function(){var e=this.type;if(e=="checkbox"||e=="radio")this.checked=c;else if(this.tagName.toLowerCase()=="option"){e=
b(this).parent("select");c&&e[0]&&e[0].type=="select-one"&&e.find("option").selected(false);this.selected=c}})}})(jQuery);(function(b){b.extend(b.fn,{livequery:function(c,e,f){var g=this,l;if(b.isFunction(c)){f=e;e=c;c=undefined}b.each(b.livequery.queries,function(h,k){if(g.selector==k.selector&&g.context==k.context&&c==k.type&&(!e||e.$lqguid==k.fn.$lqguid)&&(!f||f.$lqguid==k.fn2.$lqguid))return(l=k)&&false});l=l||new b.livequery(this.selector,this.context,c,e,f);l.stopped=false;l.run();return this},expire:function(c,e,f){var g=this;if(b.isFunction(c)){f=e;e=c;c=undefined}b.each(b.livequery.queries,function(l,h){if(g.selector==
h.selector&&g.context==h.context&&(!c||c==h.type)&&(!e||e.$lqguid==h.fn.$lqguid)&&(!f||f.$lqguid==h.fn2.$lqguid)&&!this.stopped)b.livequery.stop(h.id)});return this}});b.livequery=function(c,e,f,g,l){this.selector=c;this.context=e||document;this.type=f;this.fn=g;this.fn2=l;this.elements=[];this.stopped=false;this.id=b.livequery.queries.push(this)-1;g.$lqguid=g.$lqguid||b.livequery.guid++;if(l)l.$lqguid=l.$lqguid||b.livequery.guid++;return this};b.livequery.prototype={stop:function(){var c=this;if(this.type)this.elements.unbind(this.type,
this.fn);else this.fn2&&this.elements.each(function(e,f){c.fn2.apply(f)});this.elements=[];this.stopped=true},run:function(){if(!this.stopped){var c=this,e=this.elements,f=b(this.selector,this.context),g=f.not(e);this.elements=f;if(this.type){g.bind(this.type,this.fn);e.length>0&&b.each(e,function(l,h){b.inArray(h,f)<0&&b.event.remove(h,c.type,c.fn)})}else{g.each(function(){c.fn.apply(this)});this.fn2&&e.length>0&&b.each(e,function(l,h){b.inArray(h,f)<0&&c.fn2.apply(h)})}}}};b.extend(b.livequery,
{guid:0,queries:[],queue:[],running:false,timeout:null,checkQueue:function(){if(b.livequery.running&&b.livequery.queue.length)for(var c=b.livequery.queue.length;c--;)b.livequery.queries[b.livequery.queue.shift()].run()},pause:function(){b.livequery.running=false},play:function(){b.livequery.running=true;b.livequery.run()},registerPlugin:function(){b.each(arguments,function(c,e){if(b.fn[e]){var f=b.fn[e];b.fn[e]=function(){var g=f.apply(this,arguments);b.livequery.run();return g}}})},run:function(c){if(c!=
undefined)b.inArray(c,b.livequery.queue)<0&&b.livequery.queue.push(c);else b.each(b.livequery.queries,function(e){b.inArray(e,b.livequery.queue)<0&&b.livequery.queue.push(e)});b.livequery.timeout&&clearTimeout(b.livequery.timeout);b.livequery.timeout=setTimeout(b.livequery.checkQueue,20)},stop:function(c){c!=undefined?b.livequery.queries[c].stop():b.each(b.livequery.queries,function(e){b.livequery.queries[e].stop()})}});b.livequery.registerPlugin("append","prepend","after","before","wrap","attr",
"removeAttr","addClass","removeClass","toggleClass","empty","remove");b(function(){b.livequery.play()});var d=b.prototype.init;b.prototype.init=function(c,e){var f=d.apply(this,arguments);if(c&&c.selector){f.context=c.context;f.selector=c.selector}if(typeof c=="string"){f.context=e||document;f.selector=c}return f};b.prototype.init.prototype=b.prototype})(jQuery);(function(b){function d(){}b.datepicker._showDatepickerOverload=b.datepicker._showDatepicker;b.datepicker._showDatepicker=function(c){b.datepicker._showDatepickerOverload(c);c=c.target||c;if(c.nodeName.toLowerCase()!="input")c=b("input",c.parentNode)[0];if(!b.datepicker._isDisabledDatepicker(c)){var e=b.datepicker._getInst(c);b.datepicker._get(e,"showTime")&&b.timepicker.show(c)}};b.datepicker._checkExternalClickOverload=b.datepicker._checkExternalClick;b.datepicker._checkExternalClick=function(c){b.datepicker._curInst&&
b(c.target).parents("#"+b.timepicker._mainDivId).length==0&&b.datepicker._checkExternalClickOverload(c)};b.datepicker._hideDatepickerOverload=b.datepicker._hideDatepicker;b.datepicker._hideDatepicker=function(c,e){var f=this._curInst;if(!(!f||c&&f!=b.data(c,PROP_NAME))){var g=this._get(f,"showTime");b.datepicker._hideDatepickerOverload(c,e);if(g){f.input&&f.input.val(this._formatDate(f));b.timepicker.hide()}}};d.prototype={init:function(){this._mainDivId="ui-timepicker-div";this._inputId=null;this._colonPos=
-1;this.tpDiv=b('<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();c=b("#"+b.datepicker._mainDivId);var e=c.position(),f=b("#"+b.datepicker._mainDivId+" > div.ui-datepicker-header:first-child").height();b("#"+this._mainDivId+" > div.ui-datepicker-header:first-child").css("height",
f);this.tpDiv.css({height:c.height(),top:e.top,left:e.left+c.outerWidth()+"px"});b("#hourSlider").css("height",this.tpDiv.height()-3.5*f);b("#minuteSlider").css("height",this.tpDiv.height()-3.5*f);b("#"+this._mainDivId).show();f=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)+b(document).scrollLeft();var g=this.tpDiv.offset().left+this.tpDiv.outerWidth();if(g>f){c.css("left",e.left-(g-f)-5);this.tpDiv.css("left",c.offset().left+c.outerWidth()+"px")}},hide:function(){var c=
b("#"+this._mainDivId+" span.fragHours").text()+":"+b("#"+this._mainDivId+" span.fragMinutes").text(),e=b("#"+this._inputId).val();if(this._colonPos!=-1)e=e.substr(0,this._colonPos-2);e=b.trim(e);b("#"+this._inputId).val(e+" "+c);b("#"+this._mainDivId).hide()},_generateHtml:function(){var c="";c+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix ui-corner-all">';c+='<div class="ui-datepicker-title" style="margin:0">';c+='<span class="fragHours">08</span><span class="delim">:</span><span class="fragMinutes">45</span></div></div><table>';
c+="<tr><th>Hour</th><th>Minute</th></tr>";c+='<tr><td align="center"><div id="hourSlider" class="slider"></div></td><td align="center"><div id="minuteSlider" class="slider"></div></td></tr>';c+="</table>";this.tpDiv.empty().append(c);b("body").append(this.tpDiv);var e=this;b("#hourSlider").slider({orientation:"vertical",range:"min",min:0,max:23,step:1,slide:function(f,g){e._writeTime("hour",g.value)}});b("#minuteSlider").slider({orientation:"vertical",range:"min",min:0,max:59,step:1,slide:function(f,
g){e._writeTime("minute",g.value)}})},_writeTime:function(c,e){if(c=="hour"){if(e<10)e="0"+e;b("#"+this._mainDivId+" span.fragHours").text(e)}if(c=="minute"){if(e<10)e="0"+e;b("#"+this._mainDivId+" span.fragMinutes").text(e)}},_parseTime:function(){var c=b("#"+this._inputId).val();this._colonPos=c.search(":");if(this._colonPos==-1){this._setTime("hour",0);this._setTime("minute",0)}else{this._setTime("hour",parseInt(c.substr(this._colonPos-2,2)));this._setTime("minute",parseInt(c.substr(this._colonPos+
1,2)))}},_setTime:function(c,e){if(isNaN(e))e=0;if(e<0)e=0;if(e>23&&c=="hour")e=23;if(e>59&&c=="minute")e=59;c=="hour"&&b("#hourSlider").slider("value",e);c=="minute"&&b("#minuteSlider").slider("value",e);this._writeTime(c,e)}};b.timepicker=new d;b("document").ready(function(){b.timepicker.init()})})(jQuery);(function(b){function d(k,m){return k.nodeType==3?e(k,m):c(k,m)}function c(k,m){k=b(k);var n=k.clone().empty(),o;k.contents().each(function(){var p=m-n.text().length;if(p!=0)(o=d(this,p))&&n.append(o)});return n}function e(k,m){k=f(k.data);if(h)k=k.replace(/^ /,"");h=!!k.match(/ $/);k=k.slice(0,m);return k=b("<div/>").text(k).html()}function f(k){return k.replace(/\s+/g," ")}function g(k){var m=b(k),n=m.children(":last");if(!n)return k;k=n.css("display");if(!k||k=="inline")return m;return g(n)}function l(k){var m=
b(k).children(":last");if(m&&m.is("p"))return m;return k}var h=true;b.fn.truncate=function(k){var m=b.extend({},b.fn.truncate.defaults,k);b(this).each(function(){if(!(b.trim(f(b(this).text())).length<=m.max_length)){var n=d(this,m.max_length-m.more.length-3),o=b(this).hide();n.insertAfter(o);g(n).append(' (<a href="#show more content">'+m.more+"</a>)");l(o).append(' (<a href="#show less content">'+m.less+"</a>)");n.find("a:last").click(function(){n.hide();o.show();b.isFunction(m.onMore)&&m.onMore(o);
return false});o.find("a:last").click(function(){n.show();o.hide();b.isFunction(m.onLess)&&m.onLess(n);return false})}})};b.fn.truncate.defaults={max_length:100,more:"more",less:"less"}})(jQuery);jQuery.url=function(){var b={},d={},c={url:window.location,strictMode:false,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}},
e=function(){str=decodeURI(c.url);for(var l=c.parser[c.strictMode?"strict":"loose"].exec(str),h={},k=14;k--;)h[c.key[k]]=l[k]||"";h[c.q.name]={};h[c.key[12]].replace(c.q.parser,function(m,n,o){if(n)h[c.q.name][n]=o});return h},f=function(){d=e();g()},g=function(){var l=d.path;b=[];b=d.path.length==1?{}:(l.charAt(l.length-1)=="/"?l.substring(1,l.length-1):(path=l.substring(1))).split("/")};return{setMode:function(l){strictMode=l=="strict"?true:false;return this},setUrl:function(l){c.url=l===undefined?
window.location:l;f();return this},segment:function(l){d.length||f();if(l===undefined)return b.length;return b[l]===""||b[l]===undefined?null:b[l]},attr:function(l){d.length||f();if(l=="base")return d.port!==null&&d.port!==""?d.protocol+"://"+d.host+":"+d.port+"/":d.protocol+"://"+d.host+"/";return d[l]===""?null:d[l]},param:function(l,h){h=h||false;d.length||f();return d.queryKey[l]===null||typeof d.queryKey[l]=="undefined"?null:h?d.queryKey[l]:decodeURIComponent(d.queryKey[l])}}}();var brizzl={};(function(){jQuery.extend(brizzl,{log:function(b){typeof console!="undefined"&&console.log(b)}})})();brizzl.auth=function(){var b=false,d={signInUrl:null,signInCallback:null,signUpUrl:null,signUpCallback:null},c=d;return{init:function(e){var f=this;c=$.extend(c,e);$(".sign_in_form").livequery(function(){var g=$(this);$("username_fld").clearingInput({text:"oder E-Mail"});g.ajaxForm({dataType:"json",beforeSubmit:function(){brizzl.InfoPanel.progress(g,"Daten werden geprüft...");return true},success:function(l){window.setTimeout(function(){if(l.status==1){brizzl.auth.setIsAuthenticated(true);
if(c.signInUrl!=null)location.href=c.signInUrl;else{f.updateTopnav();f.close();c.signInCallback!=null&&c.signInCallback()}}else brizzl.InfoPanel.error(g,l.message+"<br/>\n")},1E3);return false}})});$(".sign_up_form").livequery(function(){var g=$(this),l=g.find("input[name=username]"),h=g.find(".username_status");l.keyup(function(){var p=l.attr("value");if(p.length>3)$.getJSON("/api/user.usernameExist",{username:p},function(q){if(q.status&&!q.data){h.text("ok");h.addClass("f_info");h.removeClass("f_err")}else{h.html("nicht verfuegbar");
h.addClass("f_err");h.removeClass("f_info")}});else{h.html("nicht verfuegbar");h.addClass("f_err");h.removeClass("f_info")}});var k=g.find("input[name=password]"),m=g.find(".password_status");k.keyup(function(){if(k.attr("value").length<6){m.html("mind. 6 Zeichen");m.addClass("f_err");m.removeClass("f_info")}else{m.html("ok");m.addClass("f_info");m.removeClass("f_err")}});var n=g.find("input[name=email]"),o=g.find(".email_status");n.keyup(function(){var p=n.attr("value");if(brizzl.util.validateEmail(p)){o.html("ok");
o.addClass("f_info");o.removeClass("f_err")}else{o.html("ungueltig");o.addClass("f_err");o.removeClass("f_info")}});g.ajaxForm({dataType:"json",beforeSubmit:function(){brizzl.InfoPanel.progress(g,"Die Daten werden geprueft...");return true},success:function(p){window.setTimeout(function(){var q=new brizzl.InfoPanel(g,{type:brizzl.InfoPanel.ERROR});if(p.status==1){brizzl.auth.setIsAuthenticated(true);if(c.signUpUrl!=null)location.href=c.signUpUrl;else{f.updateTopnav();f.close();c.signUpCallback!=null&&
c.signUpCallback()}}else{if(typeof p.errors!="undefined")for(var r=0;r<p.errors.length;r++)q.addMessage(p.errors[r].message);else q.addMessage(p.message);q.show()}},1E3);return false}})});$.getJSON("/api/session.isLoggedIn",function(g){g.status==1&&f.setLoggedIn(g.value)})},setSignInUrl:function(e){c.signInUrl=e},setSignUpUrl:function(e){c.signUpUrl=e},setSignInCallback:function(e){c.signInCallback=e},setSignUpCallback:function(e){c.signUpCallback=e},isLoggedIn:function(){return b},setLoggedIn:function(e){b=
e},setIsAuthenticated:function(e){b=e},hasTimeout:function(e){if(typeof e=="object"&&e.status==0&&e.code==900)return true;return false},resetOptions:function(){c=d},open:function(e){e=e||null;e!=null&&this.setSignInCallback(e);if(this.isLoggedIn())if(c.signInCallback!=null)c.signInCallback();else{if(c.signInUrl!=null)location.href=c.signInUrl}else if($("#sign_up").length){$(".contents").hide();$("#sign_up").show()}else $.get("/ajax/sign_up",{},function(f){$(".contents").hide();$(".contents").eq(0).before(f);
$("#sign_up").show()})},close:function(){$(".contents").show();$("#sign_up").hide();$("#sign_up_success").remove()},updateTopnav:function(){$.get("/ajax/topnav",{},function(e){$("#topnav").after(e).remove()})}}}();brizzl.localization=function(){var b=[];return{load:function(d,c,e){c=c||null;e=e||null;$.getJSON("/api/localization.load",{keys:d.join(","),comp:c},function(f){brizzl.localization.setDict(f,c);e!=null&&e()})},setDict:function(d,c){c=c||null;var e;if(c!=null){if(typeof b[c]=="undefined")b[c]=[];for(e in d)b[c][e]=d[e]}else for(e in d)b[e]=d[e]},getDict:function(d){d=d||null;if(d!=null&&typeof b[d]!="undefined")return b[d];return b},get:function(d,c){c=c||null;if(c!=null)if(typeof b[c]!="undefined")if(typeof b[c][d]!=
"undefined")return b[c][d];if(typeof b[d]!="undefined")return b[d];return d}}}();brizzl.messageDetail=function(){var b=null;return{init:function(){b=this;$(".hl_message_detail_back").live("click",function(){jQuery("#msg_list").length?brizzl.listView.showList():window.history.back();return false});$('a[rel="msg_comment"]').live("click",function(){var d=brizzl.util.parseAnchor(this.href);brizzl.auth.open(function(){b.showCommentForm(d)});return false});$('a[rel="msg_reply"]').live("click",function(){var d=brizzl.util.parseAnchor(this.href);brizzl.auth.open(function(){b.showReplyForm(d)});
return false});$('a[rel="msg_friend"]').live("click",function(){var d=brizzl.util.parseAnchor(this.href);b.addFriend(d);return false});$('a[rel="msg_spam"]').live("click",function(){var d=brizzl.util.parseAnchor(this.href);brizzl.auth.open(function(){b.reportSpam(d)});return false});$("#form_private_message").livequery(function(){var d=$(".fld_private_message");d.autogrow();var c={dataType:"json",beforeSubmit:function(e){for(var f=0;f<e.length;f++)if(!e[f].value){alert("Bitte einen Text eingeben!");
return false}return true},success:function(e){if(e.status==1){d.val("");brizzl.InfoPanel.info($("#msg_private_message_box"),"Die Nachricht wurde gesendet.",4,"before");$("#msg_private_message_box").hide()}else alert("error")},error:function(){alert("error")}};$(this).ajaxForm(c)});$("#form_comment").livequery(function(){var d=$(".fld_comment");d.autogrow();var c={beforeSubmit:function(e){for(var f=0;f<e.length;f++)if(!e[f].value){alert("Bitte einen Text eingeben!");return false}return true},success:function(e){if(e!=
""){d.val("");$("#mdv_comment_box").length?$("#mdv_comment_box").append(e):b.reload()}else alert(e.message)},error:function(){alert("error")}};$(this).ajaxForm(c)})},load:function(d,c){jQuery("#message_detail_container").load("/ajax/message_detail",{id:d},c)},reload:function(){var d=jQuery("#fld_mdv_message_id").val();d>0&&b.load(d)},showReplyForm:function(){$("#msg_comment_box").hide();$("#msg_private_message_box").show();return false},showCommentForm:function(){$("#msg_private_message_box").hide();
$("#msg_comment_box").show();return false},addFriend:function(d){$("#msg"+d).append('<div id="dialog">Kommentar</div>');$("#dialog").dialog({title:"Freund hinzufuegen",bgiframe:true,resizable:false,height:140,modal:true,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(b,d){d=d||{};var c=d.type||null,e=d.pos||"prepend",f=d.margin||null,g=d.padding||"0.7em",l=[];if(f==null)if(e=="prepend"||e=="before")f="0 0 10px 0";else if(e=="append"||e=="after")f="10px 0 0 0";this.getMessages=function(){return l};this.hasMessages=function(){return l.length>0};this.addMessage=function(h){l.push(h)};this.remove=function(){$("#info_panel").remove()};this.show=function(h){h=h||0;var k="",m="",n="";switch(c){case brizzl.InfoPanel.ERROR:m="ui-state-error";
n="ui-icon-alert";break;case brizzl.InfoPanel.INFO:default:m="ui-state-highlight";n="ui-icon-info";break}for(var o=0;o<l.length;o++){if(o>0)k+="<br />";k+='<span class="ui-icon '+n+'" style="float:left; margin-right:0.3em;"></span>'+l[o]}n="";if(f!=null)n+="margin:"+f+";";if(g!=null)n+="padding:"+g+";";if(n!="")n=' style="'+n+'"';k='<div id="info_panel" class="'+m+' ui-corner-all"'+n+">"+k+"</div>";var p=$("#info_panel");p.size()>0&&p.remove();switch(e){case "after":b.after(k);break;case "before":b.before(k);
break;case "append":b.append(k);break;case "prepend":default:b.prepend(k);break}p=$("#info_panel");p.fadeIn("slow");h>0&&window.setTimeout(function(){p.fadeOut("slow")},h*1E3)}};brizzl.InfoPanel.INFO="info";brizzl.InfoPanel.PROGRESS="progress";brizzl.InfoPanel.ERROR="error";brizzl.InfoPanel.error=function(b,d,c,e){c=c||0;b=new brizzl.InfoPanel(b,{type:brizzl.InfoPanel.ERROR,pos:e});b.addMessage(d);b.show(c)};
brizzl.InfoPanel.progress=function(b,d,c,e){c=c||0;b=new brizzl.InfoPanel(b,{type:brizzl.InfoPanel.PROGRESS,pos:e});b.addMessage(d);b.show(c)};brizzl.InfoPanel.info=function(b,d,c,e){c=c||0;b=new brizzl.InfoPanel(b,{type:brizzl.InfoPanel.INFO,pos:e});b.addMessage(d);b.show(c)};brizzl.InfoPanel.close=function(){$("#info_panel").remove()};brizzl.listView=function(){var b=null;return{init:function(){b=this;b.container=$("#list_view");b.items=[]},addItem:function(d){b.items.push(d)},clear:function(){b.items=[]},hide:function(){b.container.hide()},show:function(){b.container.fadeIn("fast")},showList:function(){jQuery("#message_detail_container").hide();jQuery("#message_list_container").show()},showDetail:function(d){b.show();brizzl.messageDetail.load(d,function(){jQuery("#message_list_container").hide();jQuery("#message_detail_container").show()})},
update:function(){$("#message_list_container").load("/ajax/message_list",function(){if(brizzl.map.isCollapsed()){b.show();b.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(){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(b,d){d=d||false;var 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(b.lat,b.lng),c);c.place=b;var e="";if(d)e='<p><a href="#" onclick="brizzl.map.searchMessageLatLng('+b.lat+", "+b.lng+');return false;">Nachrichten zu diesem Ort suchen</a></p>';
c.bindInfoWindowHtml("<p><strong>"+b.name+"</strong></p><p>"+b.address+"</p><p>(Geo: "+b.lat+", "+b.lng+")</p>"+e,{maxWidth:300});return c};brizzl.PlaceSearch=function(b){this.searchString=b;var d=this;this.execute=function(c){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 f=[];if(e.results&&e.results.length>0){var g=false;if(e.results.length>1)g=true;var l=null,h,k;for(k=0;k<e.results.length;k++){h=e.results[k];l=new brizzl.Place;l.idx=k;l.name=h.titleNoFormatting;l.address=
d.extractAddress(h);l.lat=h.lat;l.lng=h.lng;l.marker=brizzl.PlaceSearchMarker.createMarker(l,g);f.push(l)}}c(f)});e.execute(d.searchString)};this.extractAddress=function(c){if(c.addressLines.length>0)return c.addressLines.join(", ")}};brizzl.map=function(){var b,d,c=false,e=true,f=[],g=null,l=null;return{init:function(h){b=this;b.centerMarker=null;b.existingMarkerMap={};b.container=h;d=b.container.hasClass("map_collapsed");b.initGMap();$("#btn_toggle_map").click(function(){e=false;d?b.expand():b.collapse();return false})},initGMap:function(){b.map_=new google.maps.Map2(document.getElementById("map"));b.map_.addControl(new GLargeMapControl3D);b.map_.addControl(new GMenuMapTypeControl);b.map_.enableContinuousZoom();b.map_.disableScrollWheelZoom();
google.maps.Event.addListener(b.map_,"zoomend",function(){b.updateOnDragend(brizzl.listView.update)});google.maps.Event.addListener(b.map_,"dragend",function(){b.updateOnDragend(brizzl.listView.update)});b.setDefaultCenter(5);b.map_.getInfoWindow();b.enableDragSearch();b.markerManager=new MarkerManager(b.map_,2);l=new GAdsManager(b.map_,"pub-2077634818531198",{channel:"5214461849",maxAdsOnMap:1,style:G_ADSMANAGER_STYLE_ADUNIT});l.enable()},refresh:function(){brizzl.log("refresh...");var h=false;if(c){h=
true;b.disableDragSearch()}b.markerManager.refresh();h&&b.enableDragSearch()},updateOnDragend:function(h){brizzl.log("update on dragend...");if(c){c=false;b.clear();b.updateSection(h);g!=null&&window.clearTimeout(g);g=window.setTimeout(function(){c=true},2E3)}},updateSection:function(h){brizzl.log("update...");h=h||null;var k=b.map_.getZoom(),m=b.map_.getBounds(),n=m.getSouthWest();m=m.getNorthEast();k={zoom:k,minLat:n.lat(),maxLat:m.lat(),minLng:n.lng(),maxLng:m.lng()};b.centerMarker&&b.centerMarker.getPlace();
jQuery.getJSON("/api/message.getPlacesInsideOf",k,function(o,p){p!="success"&&alert("Oops! Ein Fehler ist aufgetreten. Bitte sp\ufffd\ufffdter nochmal probieren.");b.handleResponse(o,h)})},update:function(){jQuery.getJSON("/api/message.getPlaces",{sid:_sid},function(h,k){if(k!="success")alert("Oops! Ein Fehler ist aufgetreten. Bitte sp\ufffd\ufffdter nochmal probieren.");else if(h.places){k=h.parameters;var m=new brizzl.Place;m.idx=0;m.name=k.q;m.address=k.address;m.lat=k.centerLat;m.lng=k.centerLng;
b.setCenterMarker(brizzl.PlaceSearchMarker.createMarker(m,false));b.handleResponse(h)}else b.openLeaveMessageDialog()})},handleResponse:function(h,k){k=k||null;h=h.places;var m,n=[],o=[],p,q;for(p in h){m=new brizzl.Place;jQuery.extend(m,h[p]);q=brizzl.MessageMarker.createMarker(m);n.push(q);if(typeof b.existingMarkerMap[m.id]=="undefined"){o.push(q);b.existingMarkerMap[m.id]=1}}b.addMarkers(o,3);b.refresh();b.enableDragSearch();k!=null&&k(n)},searchMessages:function(){brizzl.log("search messages...");
var h=brizzl.MessageSearchParameters.create();(new brizzl.PlaceSearch(h.q)).execute(function(k){brizzl.log("got "+k.length+" results");b.clearMarkers();var m;if(k.length==1){m=k[0];brizzl.messageDialog.setPlace(m);b.setCenterMarker(m.marker);b.updateSection(b.searchPlaceResponse)}else if(k.length>1){brizzl.log("got multiple places");b.disableDragSearch();b.clear();for(var n=[],o=new google.maps.LatLngBounds,p=0;p<k.length;p++){m=k[p];o.extend(m.marker.getLatLng());b.addMarker(m.marker);n.push('<a href="#" onclick="brizzl.map.searchMessageLatLng('+
m.lat+", "+m.lng+');return false;">'+m.name+", "+m.address+"</a>")}b.expand(function(){var q=b.map_.getBoundsZoomLevel(o)-1;b.setCenter(o.getCenter(),q);b.refresh();b.map_.openInfoWindowHtml(o.getCenter(),"<p><strong>Info</strong></p><p>Es wurden mehrere Orte gefunden, die Ihrer Suche entsprechen:</p><p>"+n.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{k=
new brizzl.InfoPanel($("#loc"),{type:"info",pos:"after"});k.addMessage("Der Ort konnte nicht gefunden werden");k.show(4)}});return false},searchPlaceResponse:function(h){h.length?b.collapse(function(){brizzl.listView.update();window.setTimeout(function(){google.maps.Event.trigger(b.centerMarker,"click")},1E3)}):b.openLeaveMessageDialog()},openLeaveMessageDialog:function(){brizzl.messageDialog.setCurrPage("ajax.message_new_0_2");brizzl.messageDialog.open()},searchMessageLatLng:function(h,k){b.map_.closeInfoWindow();
b.setCenter(new google.maps.LatLng(h,k),12);b.collapse(function(){b.centerMarker=b.getMarker(h,k,3);b.updateSection(b.searchPlaceResponse)})},setCenterMarker:function(h){brizzl.log("set center marker "+h);if(typeof h.place=="object"){b.centerMarker=h;b.addMarker(h);b.setCenter(h.getLatLng(),13)}},hasCenterMarker:function(){if(b.centerMarker!=null)return true;return false},getCenterMarker:function(){if(b.hasCenterMarker())return b.centerMarker;return null},zoomOut:function(){b.map_.zoomOut();return false},
setCenter:function(h,k){brizzl.log("set center..."+h+", "+k);var m=false;if(c){m=true;b.disableDragSearch()}b.map_.setCenter(h,k);m&&b.enableDragSearch()},getCenter:function(){return b.map_.getCenter()},setDefaultCenter:function(h){h=h||12;var k=google.loader.ClientLocation;k&&k.address.country_code&&k.address.region?b.map_.setCenter(new google.maps.LatLng(k.latitude,k.longitude),h):b.map_.setCenter(new google.maps.LatLng(50.12,8.69),h)},reverseGeocode:function(h,k){brizzl.log("reverse geocode");
var m=new google.maps.ClientGeocoder;m.setViewport(b.map_.getBounds());m.getLocations(h,function(n){var o=null;if(n.Status.code==200){n=n.Placemark[0];o=new brizzl.Place;o.name=n.address;o.address=n.address;o.lat=n.Point.coordinates[1];o.lng=n.Point.coordinates[0]}else brizzl.log("Geocoding result: "+n.Status.code);k(o)})},isExpanded:function(){return!d},isCollapsed:function(){return d},setOnUpdateCollapse:function(h){e=h},enableDragSearch:function(){c=true},disableDragSearch:function(){c=false},
getMarker:function(h,k,m){return b.markerManager.getMarker(h,k,m)},getMarkerByIndex:function(h){brizzl.log("get marker by idx "+h);brizzl.log("found marker "+f[h]);if(typeof f[h]=="object")return f[h];return null},addMarker:function(h){brizzl.log("add marker "+h);return b.addMarkers(new Array(h))},addMarkers:function(h){f.push(h);b.markerManager.addMarkers(h,3);return f.length-1},deleteMarker:function(h){b.markerManager.removeMarker(h)},clear:function(){b.map_.closeInfoWindow();b.clearMarkers()},
clearMarkers:function(){b.markerManager.clearMarkers();b.existingMarkerMap={};b.centerMarker=null;f=[]},collapse:function(h){h=h||null;var k=b.map_.getBounds().getCenter(),m=b.map_.getZoom();if(d)h!=null&&h();else{$("#map_view").removeClass("map_expanded");$("#map_view").addClass("map_collapsed");$("#img_toggle_map").attr("src","/img/map_expand.gif");b.map_.checkResize();b.map_.setCenter(k,m);h!=null&&h();brizzl.listView.show()}d=true},expand:function(h){h=h||null;var k=b.map_.getBounds().getCenter(),
m=b.map_.getZoom();if(d){$("#img_toggle_map").attr("src","/img/map_collapse.gif");brizzl.listView.hide();$("#map_view").removeClass("map_collapsed");$("#map_view").addClass("map_expanded");b.map_.checkResize();b.map_.setCenter(k,m)}h!=null&&h();d=false},toggleWidth:function(h){h=h||null;d?b.expand(h):b.collapse(h)}}}();brizzl.Message=function(b){jQuery.extend(this,b);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 d=jQuery("#message_list_container"),
c=jQuery("#message_detail_container");c.load("/ajax/message_detail",{id:this.id},function(){d.hide();c.show()})};this.hideDetail=function(){jQuery("#message_detail_container").hide();jQuery("#message_list_container").show()};this.showDetail=function(){if($("#message_"+this.id).html()){jQuery("#message_list_container").hide();jQuery("#message_detail_container").show()}else 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 b=function(){if(g.place==null){$("#loc_search_error_3").fadeIn("slow");return false}g.place.name=$("#tf_address").val();if(g.place.name==null||!g.place.name.length){$("#loc_search_error_2").fadeIn("slow");return false}if(g.place.address==null||!g.place.address.length){$("#loc_search_error_3").fadeIn("slow");return false}return true},d=function(){if(g.currPage!=null)return g.currPage;return"ajax.message_new_0_1"},c=function(l){if(g.marker==null)g.marker=brizzl.MessageDialogMarker.createMarker(l);
else g.marker.setLatLng(l);brizzl.map.clear();brizzl.map.addMarker(g.marker);brizzl.map.refresh();l={};if(g.messageId!=null)l.messageId=g.messageId;google.maps.Event.trigger(g.marker,"click",{pagename:d(),params:l})},e=function(l){$(".md_msg_image").removeClass("md_msg_image_selected");$("#md_image_type_"+l).addClass("md_msg_image_selected")},f=function(){$(".loc_search_error").hide();var l=$("#tf_address"),h=$("#loc_search_results");if(g.place!=null){l.val(g.place.name);h.html(g.addressLink(g.place.address));
h.fadeIn("slow")}else{l.val("");h.empty();l.focus()}},g=null;return{currPage:null,marker:null,messageId:null,place:null,places:[],init:function(){g=this;$("a.message_dialog_open").live("click",function(){g.setCurrPage(null);g.setMessageId(null);g.resetMessageForm();g.open(null);return false});$("#message_new_2").livequery(f);$("#message_new_3").livequery(function(){var l=$("#msg_start_date");l.datepicker($.extend({showButtonPanel:true,showOn:"button",buttonImage:"/img/calendar.gif",buttonImageOnly:true,
duration:"",showTime:true,constrainInput:false,onClose:function(){var h=l.val(),k=$("#msg_end_date").datepicker("getDate"),m=l.datepicker("getDate");if(k!=null&&h.substr(-5)=="00:00"||k<m){k=m;k.setDate(m.getDate()+1);$("#msg_end_date").datepicker("setDate",k);window.setTimeout(function(){$("#msg_end_date").val($("#msg_end_date").val()+" 00:00")},200)}}},$.datepicker.regional.de));$("#msg_end_date").datepicker($.extend({showButtonPanel:true,showOn:"button",buttonImage:"/img/calendar.gif",buttonImageOnly:true,
duration:"",showTime:true,constrainInput:false},$.datepicker.regional.de));$("#msg_form").ajaxForm({dataType:"json",beforeSubmit:function(){if(!$("#subject").val()){alert("Bitte geben Sie einen Betreff an.");return false}if(!$("#message").val()){alert("Bitte geben Sie eine Nachricht ein.");return false}if(!$("#msg_start_date").val()){alert("Bitte geben Sie ein Startdatum ein.");return false}if(!$("#msg_end_date").val()){alert("Bitte geben Sie ein Enddatum ein.");return false}return true},success:function(h){if(h.status==
1)if(h.messageId){g.messageId=h.messageId;g.goto4()}else alert("Error: missing message ID");else alert("Fehler beim Speichern!");return false}})});$("#message_new_4").livequery(function(){$(".md_radio_msg_category").bind("click",function(){var o=this.value,p;$(".md_radio_subcategory").each(function(){if(this.checked)p=this.value});if(o!=5){$("#md_subcategory_selection_2").hide();$("#md_subcategory_selection_1").show();if(p>5||p!=99)$("#md_radio_subcategory_99").trigger("click")}else{$("#md_subcategory_selection_1").hide();
$("#md_subcategory_selection_2").show();if(p<6||p!=99)$("#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)");e(1)});var l=$(".md_msg_image");l.bind("mouseenter",function(){if(this.id=="md_image_type_3"&&$(this).css("background-image").substr(-6)=="s.gif)")return null;$(this).addClass("md_msg_image_over")});l.bind("mouseleave",function(){l.removeClass("md_msg_image_over")});
l.bind("click",function(){if(this.id=="md_image_type_3"&&$(this).css("background-image").substr(-6)=="s.gif)")return null;var o=this.id.substr(this.id.lastIndexOf("_")+1);$("#md_message_image_type").val(o);e(o)});var h=$("#md_message_options_form");h.ajaxForm({dataType:"json",beforeSubmit:function(){return true},success:function(o){if(o.status==1)document.location.href="/p/my_messages";else brizzl.InfoPanel.error(h,o.message);return false}});var k=$("#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:false,
post_params:{sid:_sid}}).bind("fileQueued",function(){$(this).swfupload("startUpload")}).bind("uploadStart",function(){k.css("background-image","url(/img/loader-bar.gif)")}).bind("uploadSuccess",function(o,p,q){if(!q.length||q[0]!="{")alert("Error");else{o=window.eval("("+q+")");if(o.status!=1)alert(o.message);else{k.css("background-image","url("+o.data+")");k.trigger("click")}}}).bind("uploadError",function(){alert("Error")});var m=$("#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:false,
post_params:{sid:_sid,messageId:g.messageId}}).bind("fileQueued",function(){$(this).swfupload("startUpload")}).bind("uploadStart",function(){m.css("background-image","url(/img/loader-bar.gif)")}).bind("uploadSuccess",function(o,p,q){if(!q.length||q[0]!="{")alert("Error");else{o=window.eval("("+q+")");if(o.status!=1)alert(o.message);else{m.css("background-image","url("+o.data+"?ts="+(new Date).getTime()+")");m.trigger("click")}}}).bind("uploadError",function(){alert("Error")});var n=$("#md_message_image_type").val();
$("#md_image_type_"+n).trigger("click")})},setCurrPage:function(l){g.currPage=l},setPlace:function(l){g.place=l;f()},setMessageId:function(l){g.messageId=l},open:function(){brizzl.auth.setSignInCallback(function(){brizzl.messageDialog.next()});brizzl.auth.setSignUpCallback(function(){brizzl.messageDialog.next()});var l=brizzl.map.getCenterMarker();brizzl.map.disableDragSearch();brizzl.map.clear();brizzl.map.expand(function(){if(g.place!=null)c(g.place.getLatLng());else if(l!=null){g.setPlace(l.place);
c(g.place.getLatLng())}else brizzl.map.reverseGeocode(brizzl.map.getCenter(),function(h){if(h!=null){h.name="";g.setPlace(h);c(g.place.getLatLng())}else c(brizzl.map.getCenter())})})},load:function(l,h){h=h||null;var k=l.substr(l.indexOf(".")+1),m=$("#"+k),n=$("#msg_add_dialog");n.find(".msg_add").hide();m.length?m.show():jQuery.get("/ajax/"+k,h,function(o){var p=0,q=window.setInterval(function(){n=$("#msg_add_dialog");if(n.length||p>10){window.clearInterval(q);if(!m.length){$("#loader").remove();
n.prepend(o);m=$("#"+k);m.find(".message_dialog_next").click(brizzl.messageDialog.next);m.find(".message_dialog_close").click(brizzl.messageDialog.close)}}p++},200)});g.currPage=l},close:function(){g.setPlace(null);google.maps.Event.clearListeners(brizzl.map.map_.getInfoWindow());brizzl.map.clear();brizzl.map.updateSection();brizzl.map.enableDragSearch();return false},next:function(){switch(g.currPage){case "ajax.message_new_0_1":case "ajax.message_new_0_2":brizzl.auth.isLoggedIn()?g.goto2():g.goto1_1();
break;case "ajax.message_new_1_2_1":g.load("ajax.message_new_1_2_2");break;case "ajax.message_new_1_1":case "ajax.message_new_1_2_2":g.goto2();break;case "ajax.message_new_2":g.goto3();break;default:g.goto0();break}return false},previous:function(){switch(g.currPage){case "ajax.message_new_1_1":g.goto0();break;case "ajax.message_new_1_2_1":g.goto1_1();break;case "ajax.message_new_2":brizzl.auth.isLoggedIn()?g.goto0():g.goto1_1();break;case "ajax.message_new_3":g.goto2();break;default:g.goto0();break}return false},
goto0:function(){g.load("ajax.message_new_0_1")},goto1_1:function(){g.load("ajax.message_new_1_1")},goto1_2:function(){g.load("ajax.message_new_1_2_1")},goto2:function(){var l={};if(g.messageId!=null)l.messageId=g.messageId;$(".loc_search_error").hide();brizzl.auth.isLoggedIn()?g.load("ajax.message_new_2",l):brizzl.messageDialog.goto1_1()},goto3:function(){if(brizzl.auth.isLoggedIn()){if(!b())return null;g.load("ajax.message_new_3",{placeName:g.place.name,address:g.place.address,lat:g.place.lat,lng:g.place.lng,
messageId:g.messageId})}else g.goto1_1()},goto4:function(){brizzl.auth.isLoggedIn()?g.load("ajax.message_new_4",{messageId:g.messageId}):g.goto1_1()},doAddressSearch:function(){$(".loc_search_error").hide();var l=$("#tf_address").val();if(!l){$("#loc_search_error_1").fadeIn("slow");return null}g.places=[];(new brizzl.PlaceSearch(l)).execute(function(h){if(h.length==1){brizzl.map.clear();h=h[0];h.name=l;g.setPlace(h);h=new GLatLng(h.lat,h.lng);brizzl.map.setCenter(h,16);g.marker.setLatLng(h);brizzl.map.addMarker(g.marker);
brizzl.map.refresh();window.setTimeout(function(){GEvent.trigger(g.marker,"click");$("#loc_search_results").html(g.addressLink(g.place.address));$("#loc_search_results").fadeIn("slow")},200)}else if(h.length>1){g.places=h;$("#loc_search_results").empty();h=h.length>5?5:h.length;for(var k=0;k<h;k++)$("#loc_search_results").append(g.multiAddressLink(k,g.places[k].address));$("#loc_search_results").fadeIn("slow")}else $("#loc_search_error_1").fadeIn("slow")})},clickedAddress:function(l){if(typeof g.places[l]==
"undefined")return null;brizzl.map.clear();g.setPlace(g.places[l]);l=new google.maps.LatLng(g.place.lat,g.place.lng);brizzl.map.setCenter(l,15);g.marker.setLatLng(l);brizzl.map.addMarker(g.marker);brizzl.map.refresh();window.setTimeout(function(){google.maps.Event.trigger(g.marker,"click")},1E3)},addressLink:function(l){return'<p><a onclick="brizzl.messageDialog.goto3();return false" href="#">'+l+"</a></p>"},multiAddressLink:function(l,h){return'<a onclick="brizzl.messageDialog.clickedAddress('+l+
');return false;" href="#">'+h+"</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(){google.maps.Marker.apply(this,arguments)};brizzl.MessageDialogMarker.prototype=new google.maps.Marker(new GLatLng(0,0));
brizzl.MessageDialogMarker.createMarker=function(b){var d=new brizzl.MessageDialogMarker(b,{draggable:true});b=document.createElement("div");b.setAttribute("id","msg_add_dialog");b.innerHTML='<img id="loader" style="margin:100px 190px;" src="/img/loader.gif" alt="" />';d.bindInfoWindow(b,{maxContent:b});google.maps.Event.addListener(d,"click",function(c){var e=null,f=null;c=c||null;if(c!=null){e=c.pagename||null;f=c.params||null;brizzl.messageDialog.load(e,f)}google.maps.Event.addDomListener(brizzl.map.map_.getInfoWindow(),
"closeclick",function(){brizzl.messageDialog.close()})});google.maps.Event.addListener(d,"dragstart",function(){d.closeInfoWindow()});google.maps.Event.addListener(d,"dragend",function(c){brizzl.map.reverseGeocode(c,function(e){google.maps.Event.trigger(d,"click");e.name="";brizzl.messageDialog.setPlace(e)})});return d};brizzl.MessageMarker=function(){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 b=0;b<this.place.messages.length;b++){message=this.place.messages[b];html+="<p>"+message.placeNameUser+" (Entfernung "+this.place.distance+' km)</p><p><strong><img style="float:left;margin:0 4px 4px 0;" src="'+message.imageUrl+'" alt="" />'+brizzl.util.truncate(message.subject,30)+'</strong></p><p style="clear:both;">(Geo: '+this.getLatLng().lat()+", "+this.getLatLng().lng()+")</p>"}this.openInfoWindowHtml(html)};
brizzl.MessageMarker.prototype.openInfoWindowLarge=function(){html="";for(var b=0;b<this.place.messages.length;b++){message=this.place.messages[b];html+="<p>"+message.placeNameUser+'</p><p><img style="float:left;margin:0 4px 4px 0;" src="'+message.imageUrl+'" alt="" /><strong>'+brizzl.util.truncate(message.subject,30)+"</strong></p><p>"+brizzl.util.truncate(message.body,300)+'</p><p style="clear:both;">(Geo: '+this.getLatLng().lat()+", "+this.getLatLng().lng()+")</p>"}this.openInfoWindowHtml(html,
{maxWidth:400})};brizzl.MessageMarker.codes=new Array("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");brizzl.MessageMarker.getCode=function(b){if(typeof brizzl.MessageMarker.codes[b]=="undefined")return"x";return brizzl.MessageMarker.codes[b]};
brizzl.MessageMarker.createMarker=function(b){var d=new GIcon;d.image="/img/markers/marker_"+brizzl.MessageMarker.getCode(b.idx)+".png";d.shadow="/img/markers/marker_shadow.png";d.iconSize=new GSize(20,34);d.shadowSize=new GSize(37,34);d.iconAnchor=new GPoint(9,34);d.infoWindowAnchor=new GPoint(9,2);d.infoShadowAnchor=new GPoint(18,25);d={icon:d,title:b.name};var c=new GLatLng(b.lat,b.lng);d=new brizzl.MessageMarker(c,d);d.place=b;GEvent.addListener(d,"click",d.openInfoWindow_);return d};brizzl.MessageSearchParameters=function(b){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,b)};
brizzl.MessageSearchParameters.create=function(){var b=brizzl.map.map_.getBounds(),d=b.getSouthWest();b=b.getNorthEast();d={q:$("#q").val(),startDate:$("#start_date").val(),endDate:$("#end_date").val(),minLat:d.lat(),maxLat:b.lat(),minLng:d.lng(),maxLng:b.lng()};return new brizzl.MessageSearchParameters(d)};brizzl.teaser=function(){var b=8E3,d,c=null,e=null,f=[],g=null,l=0,h=[{lat:48.1391265,lng:11.5801863,zoom:3},{lat:52.5234051,lng:13.4113999,zoom:5},{lat:39.5694701,lng:2.6500168,zoom:4}];return{doingAnimation:false,init:function(){d=this;brizzl.map.enableDragSearch();brizzl.localization.load(new Array("teaser."),"main",function(){g=new Array(brizzl.localization.get("teaser.text0","main"),brizzl.localization.get("teaser.text1","main"),brizzl.localization.get("teaser.text2","main"))});var k;for(k=0;k<
3;k++){f[k]=new Image;f[k].src="/img/teaser"+k+".jpg"}$.get("/ajax/welcome",function(m){e=m})},start:function(){if(g==null||!brizzl.map.map_.isLoaded())window.setTimeout(brizzl.teaser.start,1500);else{l=0;brizzl.teaser.doAnimation();c=window.setInterval(brizzl.teaser.doAnimation,b)}},stop:function(){window.clearInterval(c)},close:function(){brizzl.map.clear();brizzl.map.enableDragSearch();brizzl.map.collapse(brizzl.map.setDefaultCenter)},doAnimation:function(){var k,m;d.doingAnimation=true;if(c==
null)k=brizzl.map.getCenter();else{k=new google.maps.LatLng(h[l].lat,h[l].lng);brizzl.map.map_.panTo(k)}brizzl.map.map_.openInfoWindowHtml(k,e,{onCloseFn:function(){if(!d.doingAnimation){$("#q").focus();d.stop()}}});k=$("#teaser");m=$("#teaser_text");k.css("background-image","url("+f[l].src+")");m.html(g[l]);k.fadeIn("slow");l++;if(l>2){window.clearInterval(c);b*=2;if(b>3E5)b=3E5;l=0;c=window.setInterval(brizzl.teaser.doAnimation,b)}d.doingAnimation=false}}}();brizzl.util=function(){};brizzl.util.parseAnchor=function(b){return b.substr(b.indexOf("#")+1)};brizzl.util.validateEmail=function(b){if(!/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})$/.test(b))return false;return true};brizzl.util.getPageSize=function(){var b=document.documentElement;return arrayPageSize=[window.innerWidth||self.innerWidth||b&&b.clientWidth||document.body.clientWidth,window.innerHeight||self.innerHeight||b&&b.clientHeight||document.body.clientHeight]};
brizzl.util.isFfOnMacOsX=function(){var b=navigator.userAgent.toLowerCase();if(b.indexOf("mac")!=-1&&b.indexOf("firefox")!=-1)return true};brizzl.util.truncate=function(b,d,c){c=c||"...";if(b.length>d){b=b.substring(0,d);b=b.replace(/\w+$/,"");return b+c}return b};brizzl.util.trim=function(b,d){return brizzl.util.ltrim(brizzl.util.rtrim(b,d),d)};brizzl.util.ltrim=function(b,d){d=d||"\\s";return b.replace(new RegExp("^["+d+"]+","g"),"")};
brizzl.util.rtrim=function(b,d){d=d||"\\s";return b.replace(new RegExp("["+d+"]+$","g"),"")};
brizzl.util.numberFormat=function(b,d,c,e){b=Math.round(b*Math.pow(10,d))/Math.pow(10,d);strNumber=b+"";arrInt=strNumber.split(".");arrInt[0]||(arrInt[0]="0");arrInt[1]||(arrInt[1]="");if(arrInt[1].length<d){precision=arrInt[1];for(i=arrInt[1].length+1;i<=d;i++)precision+="0";arrInt[1]=precision}if(e!=""&&arrInt[0].length>3){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,val.length%3==0?3:
val.length%3);arrInt[0]=strFirst+arrInt[0]}return arrInt[0]+c+arrInt[1]};brizzl.util.getQueryVariable=function(b,d){d=(d!=null?d.location.search.substring(1):window.location.search.substring(1)).split("&");for(var c=0;c<d.length;c++){var e=d[c].split("=");if(e[0]==b)return decodeURIComponent(e[1])}return null};
brizzl.util.parseQuery=function(b){var d={};if(!b)return d;b=b.split(/[;&]/);for(var c=0;c<b.length;c++){var e=b[c].split("=");if(!(!e||e.length!=2)){var f=unescape(e[0]);e=unescape(e[1]);e=e.replace(/\+/g," ");d[f]=e}}return d};brizzl.util.htmlEncode=function(b){return b.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")};brizzl.util.fileSizeRenderer=function(b){return b==-1?"-":b>1073741824?Math.ceil(b/1048576)+" MB":b>1099511627776?Math.ceil(b/1073741824)+" GB":Math.ceil(b/1024)+" KB"};
brizzl.util.minutes2Time=function(b){var d=Math.floor(b/60);b=b%60;return((d+"").length==1?"0"+d:d)+":"+((b+"").length==1?"0"+b:b)};brizzl.util.utcToLocal=function(b){if(typeof b=="string")b=Lta.Util.stringToDate(b);var d=new Date;d.setTime(b.getTime()+d.getTimezoneOffset()*60*1E3);return d};
brizzl.util.stringToDate=function(b){var d=new Date;b.length>3&&d.setFullYear(b.substr(0,4));b.length>6&&d.setMonth(parseInt(b.substr(5,2),10)-1);b.length>9&&d.setDate(parseInt(b.substr(8,2),10));b.length>12&&d.setHours(parseInt(b.substr(11,2),10));b.length>15&&d.setMinutes(parseInt(b.substr(14,2),10));b.length>18&&d.setSeconds(parseInt(b.substr(17,2),10));return d};brizzl.validator=function(){return{validateEmail:function(b){if(!/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})$/.test(b))return false;return true},isDigit:function(b){return/^[0-9]$/.test(b)},isInteger:function(b){return/^[0-9]+$/.test(b)}}}();$(function(){function b(){$("#search_form").click(brizzl.teaser.stop);$("#search_form").submit(brizzl.map.searchMessages)}function d(){var k=brizzl.util.trim(window.location.pathname,"/").split("/");if(k.length>1&&k[0]=="ort")return true;return false}function c(){var k=brizzl.util.trim(window.location.pathname,"/").split("/");if(k.length>1&&k[0]=="personensuche")return true;return false}function e(){var k=brizzl.util.trim(window.location.pathname,"/").split("/");if(k.length>1)return decodeURI(k[1]);
return false}function f(k){var m=brizzl.util.trim(window.location.pathname,"/").split("/");if(m.length>1){m=m[1].substr(m[1].lastIndexOf("-")+1);m=m.substring(0,m.indexOf("."));if(m.substr(0,1)==k){m=m.substr(1);if(brizzl.validator.isInteger(m))return m}}return null}function g(){var k=$.url.param("messageId");if(k==null)return f("m");return k}brizzl.auth.init();brizzl.listView.init();brizzl.messageDetail.init();brizzl.messageDialog.init();b();if(google.maps){brizzl.map.init($("#map_view"));var l=
g(),h=$.url.param("mode");if(location.hash=="#compose")brizzl.messageDialog.open();else if(l!=null)if(l!=null&&h==2){h=new brizzl.Place;h.name=$.url.param("placeName");h.address=$.url.param("address");h.lat=$.url.param("lat");h.lng=$.url.param("lng");brizzl.messageDialog.setCurrPage("ajax.message_new_2");brizzl.messageDialog.setPlace(h);brizzl.messageDialog.setMessageId(l);brizzl.messageDialog.open()}else l!=null&&$.getJSON("/api/message.getPlace",{messageId:l},function(k){if(k!=null&&typeof k=="object"){k=
brizzl.MessageMarker.createMarker(k.place);brizzl.map.addMarker(k);brizzl.map.setCenter(k.getLatLng(),17);brizzl.map.refresh()}});else if(c()){l=e();$.getJSON("/api/message.getPlace",{path:l},function(k){if(k!=null&&typeof k=="object"){k=brizzl.MessageMarker.createMarker(k.place);brizzl.map.addMarker(k);brizzl.map.setCenter(k.getLatLng(),17);brizzl.map.refresh()}})}else if(d())brizzl.map.update();else if($("#q").val())brizzl.map.searchMessages();else if(!window.location.pathname||window.location.pathname==
"/"){brizzl.teaser.init();brizzl.teaser.start()}$("#q").val()||$("#q").clearingInput()}$(window).unload(function(){google.maps.Unload()})});