var SWFUpload=function(settings){this.initSWFUpload(settings);};SWFUpload.prototype.initSWFUpload=function(settings){try{this.customSettings={};this.settings=settings;this.eventQueue=[];this.movieName="SWFUpload_"+SWFUpload.movieCount++;this.movieElement=null;SWFUpload.instances[this.movieName]=this;this.initSettings();this.loadFlash();this.displayDebugInfo();}catch(ex){delete SWFUpload.instances[this.movieName];throw ex;}};SWFUpload.instances={};SWFUpload.movieCount=0;SWFUpload.version="2.1.0";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.prototype.initSettings=function(){this.ensureDefault=function(settingName,defaultValue){this.settings[settingName]=(this.settings[settingName]==undefined)?defaultValue:this.settings[settingName];};this.ensureDefault("upload_url","");this.ensureDefault("file_post_name","Filedata");this.ensureDefault("post_params",{});this.ensureDefault("use_query_string",false);this.ensureDefault("requeue_on_error",false);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_f9.swf");this.ensureDefault("flash_color","#FFFFFF");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;delete this.ensureDefault;};SWFUpload.prototype.loadFlash=function(){var targetElement,container;if(document.getElementById(this.movieName)!==null){throw"ID "+this.movieName+" is already in use. The Flash Object could not be added";}
targetElement=document.getElementsByTagName("body")[0];if(targetElement==undefined){throw"Could not find the 'body' element.";}
container=document.createElement("div");container.style.width="1px";container.style.height="1px";targetElement.appendChild(container);container.innerHTML=this.getFlashHTML();};SWFUpload.prototype.getFlashHTML=function(){return['<object id="',this.movieName,'" type="application/x-shockwave-flash" data="',this.settings.flash_url,'" width="1" height="1" style="-moz-user-focus: ignore;">','<param name="movie" value="',this.settings.flash_url,'" />','<param name="bgcolor" value="',this.settings.flash_color,'" />','<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 paramString=this.buildParamString();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;params=",encodeURIComponent(paramString),"&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)].join("");};SWFUpload.prototype.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;};SWFUpload.prototype.buildParamString=function(){var postParams=this.settings.post_params;var paramStringPairs=[];if(typeof(postParams)==="object"){for(var name in postParams){if(postParams.hasOwnProperty(name)){paramStringPairs.push(encodeURIComponent(name.toString())+"="+encodeURIComponent(postParams[name].toString()));}}}
return paramStringPairs.join("&amp;");};SWFUpload.prototype.destroy=function(){try{this.stopUpload();var movieElement=null;try{movieElement=this.getMovieElement();}catch(ex){}
if(movieElement!=undefined&&movieElement.parentNode!=undefined&&typeof(movieElement.parentNode.removeChild)==="function"){var container=movieElement.parentNode;if(container!=undefined){container.removeChild(movieElement);if(container.parentNode!=undefined&&typeof(container.parentNode.removeChild)==="function"){container.parentNode.removeChild(container);}}}
SWFUpload.instances[this.movieName]=null;delete SWFUpload.instances[this.movieName];delete this.movieElement;delete this.settings;delete this.customSettings;delete this.eventQueue;delete this.movieName;return true;}catch(ex1){return false;}};SWFUpload.prototype.displayDebugInfo=function(){this.debug(["---SWFUpload Instance Info---\n","Version: ",SWFUpload.version,"\n","Movie Name: ",this.movieName,"\n","Settings:\n","\t","upload_url:             ",this.settings.upload_url,"\n","\t","use_query_string:       ",this.settings.use_query_string.toString(),"\n","\t","file_post_name:         ",this.settings.file_post_name,"\n","\t","post_params:            ",this.settings.post_params.toString(),"\n","\t","file_types:             ",this.settings.file_types,"\n","\t","file_types_description: ",this.settings.file_types_description,"\n","\t","file_size_limit:        ",this.settings.file_size_limit,"\n","\t","file_upload_limit:      ",this.settings.file_upload_limit,"\n","\t","file_queue_limit:       ",this.settings.file_queue_limit,"\n","\t","flash_url:              ",this.settings.flash_url,"\n","\t","flash_color:            ",this.settings.flash_color,"\n","\t","debug:                  ",this.settings.debug.toString(),"\n","\t","custom_settings:        ",this.settings.custom_settings.toString(),"\n","Event Handlers:\n","\t","swfupload_loaded_handler assigned:  ",(typeof(this.settings.swfupload_loaded_handler)==="function").toString(),"\n","\t","file_dialog_start_handler assigned: ",(typeof(this.settings.file_dialog_start_handler)==="function").toString(),"\n","\t","file_queued_handler assigned:       ",(typeof(this.settings.file_queued_handler)==="function").toString(),"\n","\t","file_queue_error_handler assigned:  ",(typeof(this.settings.file_queue_error_handler)==="function").toString(),"\n","\t","upload_start_handler assigned:      ",(typeof(this.settings.upload_start_handler)==="function").toString(),"\n","\t","upload_progress_handler assigned:   ",(typeof(this.settings.upload_progress_handler)==="function").toString(),"\n","\t","upload_error_handler assigned:      ",(typeof(this.settings.upload_error_handler)==="function").toString(),"\n","\t","upload_success_handler assigned:    ",(typeof(this.settings.upload_success_handler)==="function").toString(),"\n","\t","upload_complete_handler assigned:   ",(typeof(this.settings.upload_complete_handler)==="function").toString(),"\n","\t","debug_handler assigned:             ",(typeof(this.settings.debug_handler)==="function").toString(),"\n"].join(""));};SWFUpload.prototype.addSetting=function(name,value,default_value){if(value==undefined){return(this.settings[name]=default_value);}else{return(this.settings[name]=value);}};SWFUpload.prototype.getSetting=function(name){if(this.settings[name]!=undefined){return this.settings[name];}
return"";};SWFUpload.prototype.callFlash=function(functionName,argumentArray){argumentArray=argumentArray||[];var self=this;var callFunction=function(){var movieElement=self.getMovieElement();var returnValue;if(typeof(movieElement[functionName])==="function"){if(argumentArray.length===0){returnValue=movieElement[functionName]();}else if(argumentArray.length===1){returnValue=movieElement[functionName](argumentArray[0]);}else if(argumentArray.length===2){returnValue=movieElement[functionName](argumentArray[0],argumentArray[1]);}else if(argumentArray.length===3){returnValue=movieElement[functionName](argumentArray[0],argumentArray[1],argumentArray[2]);}else{throw"Too many arguments";}
if(returnValue!=undefined&&typeof(returnValue.post)==="object"){returnValue=self.unescapeFilePostParams(returnValue);}
return returnValue;}else{throw"Invalid function name";}};return callFunction();};SWFUpload.prototype.selectFile=function(){this.callFlash("SelectFile");};SWFUpload.prototype.selectFiles=function(){this.callFlash("SelectFiles");};SWFUpload.prototype.startUpload=function(fileID){this.callFlash("StartUpload",[fileID]);};SWFUpload.prototype.cancelUpload=function(fileID){this.callFlash("CancelUpload",[fileID]);};SWFUpload.prototype.stopUpload=function(){this.callFlash("StopUpload");};SWFUpload.prototype.getStats=function(){return this.callFlash("GetStats");};SWFUpload.prototype.setStats=function(statsObject){this.callFlash("SetStats",[statsObject]);};SWFUpload.prototype.getFile=function(fileID){if(typeof(fileID)==="number"){return this.callFlash("GetFileByIndex",[fileID]);}else{return this.callFlash("GetFile",[fileID]);}};SWFUpload.prototype.addFileParam=function(fileID,name,value){return this.callFlash("AddFileParam",[fileID,name,value]);};SWFUpload.prototype.removeFileParam=function(fileID,name){this.callFlash("RemoveFileParam",[fileID,name]);};SWFUpload.prototype.setUploadURL=function(url){this.settings.upload_url=url.toString();this.callFlash("SetUploadURL",[url]);};SWFUpload.prototype.setPostParams=function(paramsObject){this.settings.post_params=paramsObject;this.callFlash("SetPostParams",[paramsObject]);};SWFUpload.prototype.addPostParam=function(name,value){this.settings.post_params[name]=value;this.callFlash("SetPostParams",[this.settings.post_params]);};SWFUpload.prototype.removePostParam=function(name){delete this.settings.post_params[name];this.callFlash("SetPostParams",[this.settings.post_params]);};SWFUpload.prototype.setFileTypes=function(types,description){this.settings.file_types=types;this.settings.file_types_description=description;this.callFlash("SetFileTypes",[types,description]);};SWFUpload.prototype.setFileSizeLimit=function(fileSizeLimit){this.settings.file_size_limit=fileSizeLimit;this.callFlash("SetFileSizeLimit",[fileSizeLimit]);};SWFUpload.prototype.setFileUploadLimit=function(fileUploadLimit){this.settings.file_upload_limit=fileUploadLimit;this.callFlash("SetFileUploadLimit",[fileUploadLimit]);};SWFUpload.prototype.setFileQueueLimit=function(fileQueueLimit){this.settings.file_queue_limit=fileQueueLimit;this.callFlash("SetFileQueueLimit",[fileQueueLimit]);};SWFUpload.prototype.setFilePostName=function(filePostName){this.settings.file_post_name=filePostName;this.callFlash("SetFilePostName",[filePostName]);};SWFUpload.prototype.setUseQueryString=function(useQueryString){this.settings.use_query_string=useQueryString;this.callFlash("SetUseQueryString",[useQueryString]);};SWFUpload.prototype.setRequeueOnError=function(requeueOnError){this.settings.requeue_on_error=requeueOnError;this.callFlash("SetRequeueOnError",[requeueOnError]);};SWFUpload.prototype.setDebugEnabled=function(debugEnabled){this.settings.debug_enabled=debugEnabled;this.callFlash("SetDebugEnabled",[debugEnabled]);};SWFUpload.prototype.queueEvent=function(handlerName,argumentArray){if(argumentArray==undefined){argumentArray=[];}else if(!(argumentArray instanceof Array)){argumentArray=[argumentArray];}
var self=this;if(typeof(this.settings[handlerName])==="function"){this.eventQueue.push(function(){this.settings[handlerName].apply(this,argumentArray);});setTimeout(function(){self.executeNextEvent();},0);}else if(this.settings[handlerName]!==null){throw"Event handler "+handlerName+" is unknown or is not a function";}};SWFUpload.prototype.executeNextEvent=function(){var f=this.eventQueue?this.eventQueue.shift():null;if(typeof(f)==="function"){f.apply(this);}};SWFUpload.prototype.unescapeFilePostParams=function(file){var reg=/[$]([0-9a-f]{4})/i;var unescapedPost={};var uk;if(file!=undefined){for(var k in file.post){if(file.post.hasOwnProperty(k)){uk=k;var match;while((match=reg.exec(uk))!==null){uk=uk.replace(match[0],String.fromCharCode(parseInt("0x"+match[1],16)));}
unescapedPost[uk]=file.post[k];}}
file.post=unescapedPost;}
return file;};SWFUpload.prototype.flashReady=function(){var movieElement=this.getMovieElement();if(typeof(movieElement.StartUpload)!=="function"){throw"ExternalInterface methods failed to initialize.";}
this.queueEvent("swfupload_loaded_handler");};SWFUpload.prototype.fileDialogStart=function(){this.queueEvent("file_dialog_start_handler");};SWFUpload.prototype.fileQueued=function(file){file=this.unescapeFilePostParams(file);this.queueEvent("file_queued_handler",file);};SWFUpload.prototype.fileQueueError=function(file,errorCode,message){file=this.unescapeFilePostParams(file);this.queueEvent("file_queue_error_handler",[file,errorCode,message]);};SWFUpload.prototype.fileDialogComplete=function(numFilesSelected,numFilesQueued){this.queueEvent("file_dialog_complete_handler",[numFilesSelected,numFilesQueued]);};SWFUpload.prototype.uploadStart=function(file){file=this.unescapeFilePostParams(file);this.queueEvent("return_upload_start_handler",file);};SWFUpload.prototype.returnUploadStart=function(file){var returnValue;if(typeof(this.settings.upload_start_handler)==="function"){file=this.unescapeFilePostParams(file);returnValue=this.settings.upload_start_handler.call(this,file);}else if(this.settings.upload_start_handler!=undefined){throw"upload_start_handler must be a function";}
if(returnValue===undefined){returnValue=true;}
returnValue=!!returnValue;this.callFlash("ReturnUploadStart",[returnValue]);};SWFUpload.prototype.uploadProgress=function(file,bytesComplete,bytesTotal){file=this.unescapeFilePostParams(file);this.queueEvent("upload_progress_handler",[file,bytesComplete,bytesTotal]);};SWFUpload.prototype.uploadError=function(file,errorCode,message){file=this.unescapeFilePostParams(file);this.queueEvent("upload_error_handler",[file,errorCode,message]);};SWFUpload.prototype.uploadSuccess=function(file,serverData){file=this.unescapeFilePostParams(file);this.queueEvent("upload_success_handler",[file,serverData]);};SWFUpload.prototype.uploadComplete=function(file){file=this.unescapeFilePostParams(file);this.queueEvent("upload_complete_handler",file);};SWFUpload.prototype.debug=function(message){this.queueEvent("debug_handler",message);};SWFUpload.prototype.debugMessage=function(message){if(this.settings.debug){var exceptionMessage,exceptionValues=[];if(typeof(message)==="object"&&typeof(message.name)==="string"&&typeof(message.message)==="string"){for(var key in message){if(message.hasOwnProperty(key)){exceptionValues.push(key+": "+message[key]);}}
exceptionMessage=exceptionValues.join("\n")||"";exceptionValues=exceptionMessage.split("\n");exceptionMessage="EXCEPTION: "+exceptionValues.join("\nEXCEPTION: ");SWFUpload.Console.writeLine(exceptionMessage);}else{SWFUpload.Console.writeLine(message);}}};SWFUpload.Console={};SWFUpload.Console.writeLine=function(message){var console,documentForm;try{console=document.getElementById("SWFUpload_Console");if(!console){documentForm=document.createElement("form");document.getElementsByTagName("body")[0].appendChild(documentForm);console=document.createElement("textarea");console.id="SWFUpload_Console";console.style.fontFamily="monospace";console.setAttribute("wrap","off");console.wrap="off";console.style.overflow="auto";console.style.width="700px";console.style.height="350px";console.style.margin="5px";documentForm.appendChild(console);}
console.value+=message+"\n";console.scrollTop=console.scrollHeight-console.clientHeight;}catch(ex){alert("Exception: "+ex.name+" Message: "+ex.message);}};var swfobject=function(){var X="undefined",P="object",a="visibility:visible",e="visibility:hidden",B="Shockwave Flash",h="ShockwaveFlash.ShockwaveFlash",V="application/x-shockwave-flash",K="SWFObjectExprInst",G=window,g=document,N=navigator,f=[],H=[],Q=null,L=null,S=false,C=false;var Y=function(){var l=typeof g.getElementById!=X&&typeof g.getElementsByTagName!=X&&typeof g.createElement!=X&&typeof g.appendChild!=X&&typeof g.replaceChild!=X&&typeof g.removeChild!=X&&typeof g.cloneNode!=X,t=[0,0,0],n=null;if(typeof N.plugins!=X&&typeof N.plugins[B]==P){n=N.plugins[B].description;if(n){n=n.replace(/^.*\s+(\S+\s+\S+$)/,"$1");t[0]=parseInt(n.replace(/^(.*)\..*$/,"$1"),10);t[1]=parseInt(n.replace(/^.*\.(.*)\s.*$/,"$1"),10);t[2]=/r/.test(n)?parseInt(n.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof G.ActiveXObject!=X){var o=null,s=false;try{o=new ActiveXObject(h+".7")}catch(k){try{o=new ActiveXObject(h+".6");t=[6,0,21];o.AllowScriptAccess="always"}catch(k){if(t[0]==6){s=true}}if(!s){try{o=new ActiveXObject(h)}catch(k){}}}if(!s&&o){try{n=o.GetVariable("$version");if(n){n=n.split(" ")[1].split(",");t=[parseInt(n[0],10),parseInt(n[1],10),parseInt(n[2],10)]}}catch(k){}}}}var v=N.userAgent.toLowerCase(),j=N.platform.toLowerCase(),r=/webkit/.test(v)?parseFloat(v.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,i=false,q=j?/win/.test(j):/win/.test(v),m=j?/mac/.test(j):/mac/.test(v);return{w3cdom:l,pv:t,webkit:r,ie:i,win:q,mac:m}}();var d=function(){if(!Y.w3cdom){return}J(I);if(Y.ie&&Y.win){try{g.write("<script id=__ie_ondomload defer=true src=//:><\/script>");var i=b("__ie_ondomload");if(i){i.onreadystatechange=function(){if(this.readyState=="complete"){this.parentNode.removeChild(this);U()}}}}catch(j){}}if(Y.webkit&&typeof g.readyState!=X){Q=setInterval(function(){if(/loaded|complete/.test(g.readyState)){U()}},10)}if(typeof g.addEventListener!=X){g.addEventListener("DOMContentLoaded",U,null)}M(U)}();function U(){if(S){return}if(Y.ie&&Y.win){var m=W("span");try{var l=g.getElementsByTagName("body")[0].appendChild(m);l.parentNode.removeChild(l)}catch(n){return}}S=true;if(Q){clearInterval(Q);Q=null}var j=f.length;for(var k=0;k<j;k++){f[k]()}}function J(i){if(S){i()}else{f[f.length]=i}}function M(j){if(typeof G.addEventListener!=X){G.addEventListener("load",j,false)}else{if(typeof g.addEventListener!=X){g.addEventListener("load",j,false)}else{if(typeof G.attachEvent!=X){G.attachEvent("onload",j)}else{if(typeof G.onload=="function"){var i=G.onload;G.onload=function(){i();j()}}else{G.onload=j}}}}}function I(){var l=H.length;for(var j=0;j<l;j++){var m=H[j].id;if(Y.pv[0]>0){var k=b(m);if(k){H[j].width=k.getAttribute("width")?k.getAttribute("width"):"0";H[j].height=k.getAttribute("height")?k.getAttribute("height"):"0";if(O(H[j].swfVersion)){if(Y.webkit&&Y.webkit<312){T(k)}}else{if(H[j].expressInstall&&!C&&O("6.0.65")&&(Y.win||Y.mac)){D(H[j])}else{c(k)}}}}A("#"+m,a)}}function T(m){var k=m.getElementsByTagName(P)[0];if(k){var p=W("embed"),r=k.attributes;if(r){var o=r.length;for(var n=0;n<o;n++){if(r[n].nodeName.toLowerCase()=="data"){p.setAttribute("src",r[n].nodeValue)}else{p.setAttribute(r[n].nodeName,r[n].nodeValue)}}}var q=k.childNodes;if(q){var s=q.length;for(var l=0;l<s;l++){if(q[l].nodeType==1&&q[l].nodeName.toLowerCase()=="param"){p.setAttribute(q[l].getAttribute("name"),q[l].getAttribute("value"))}}}m.parentNode.replaceChild(p,m)}}function F(i){if(Y.ie&&Y.win&&O("8.0.0")){G.attachEvent("onunload",function(){var k=b(i);for(var j in k){if(typeof k[j]=="function"){k[j]=function(){}}}k.parentNode.removeChild(k)})}}function D(j){C=true;var o=b(j.id);if(o){if(j.altContentId){var l=b(j.altContentId);if(l){L=l}}else{L=Z(o)}if(!(/%$/.test(j.width))&&parseInt(j.width,10)<310){j.width="310"}if(!(/%$/.test(j.height))&&parseInt(j.height,10)<137){j.height="137"}g.title=g.title.slice(0,47)+" - Flash Player Installation";var n=Y.ie&&Y.win?"ActiveX":"PlugIn",k=g.title,m="MMredirectURL="+G.location+"&MMplayerType="+n+"&MMdoctitle="+k,p=j.id;if(Y.ie&&Y.win&&o.readyState!=4){var i=W("div");p+="SWFObjectNew";i.setAttribute("id",p);o.parentNode.insertBefore(i,o);o.style.display="none";G.attachEvent("onload",function(){o.parentNode.removeChild(o)})}R({data:j.expressInstall,id:K,width:j.width,height:j.height},{flashvars:m},p)}}function c(j){if(Y.ie&&Y.win&&j.readyState!=4){var i=W("div");j.parentNode.insertBefore(i,j);i.parentNode.replaceChild(Z(j),i);j.style.display="none";G.attachEvent("onload",function(){j.parentNode.removeChild(j)})}else{j.parentNode.replaceChild(Z(j),j)}}function Z(n){var m=W("div");if(Y.win&&Y.ie){m.innerHTML=n.innerHTML}else{var k=n.getElementsByTagName(P)[0];if(k){var o=k.childNodes;if(o){var j=o.length;for(var l=0;l<j;l++){if(!(o[l].nodeType==1&&o[l].nodeName.toLowerCase()=="param")&&!(o[l].nodeType==8)){m.appendChild(o[l].cloneNode(true))}}}}}return m}function R(AE,AC,q){var p,t=b(q);if(typeof AE.id==X){AE.id=q}if(Y.ie&&Y.win){var AD="";for(var z in AE){if(AE[z]!=Object.prototype[z]){if(z=="data"){AC.movie=AE[z]}else{if(z.toLowerCase()=="styleclass"){AD+=' class="'+AE[z]+'"'}else{if(z!="classid"){AD+=" "+z+'="'+AE[z]+'"'}}}}}var AB="";for(var y in AC){if(AC[y]!=Object.prototype[y]){AB+='<param name="'+y+'" value="'+AC[y]+'" />'}}t.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+AD+">"+AB+"</object>";F(AE.id);p=b(AE.id)}else{if(Y.webkit&&Y.webkit<312){var AA=W("embed");AA.setAttribute("type",V);for(var x in AE){if(AE[x]!=Object.prototype[x]){if(x=="data"){AA.setAttribute("src",AE[x])}else{if(x.toLowerCase()=="styleclass"){AA.setAttribute("class",AE[x])}else{if(x!="classid"){AA.setAttribute(x,AE[x])}}}}}for(var w in AC){if(AC[w]!=Object.prototype[w]){if(w!="movie"){AA.setAttribute(w,AC[w])}}}t.parentNode.replaceChild(AA,t);p=AA}else{var s=W(P);s.setAttribute("type",V);for(var v in AE){if(AE[v]!=Object.prototype[v]){if(v.toLowerCase()=="styleclass"){s.setAttribute("class",AE[v])}else{if(v!="classid"){s.setAttribute(v,AE[v])}}}}for(var u in AC){if(AC[u]!=Object.prototype[u]&&u!="movie"){E(s,u,AC[u])}}t.parentNode.replaceChild(s,t);p=s}}return p}function E(k,i,j){var l=W("param");l.setAttribute("name",i);l.setAttribute("value",j);k.appendChild(l)}function b(i){return g.getElementById(i)}function W(i){return g.createElement(i)}function O(k){var j=Y.pv,i=k.split(".");i[0]=parseInt(i[0],10);i[1]=parseInt(i[1],10);i[2]=parseInt(i[2],10);return(j[0]>i[0]||(j[0]==i[0]&&j[1]>i[1])||(j[0]==i[0]&&j[1]==i[1]&&j[2]>=i[2]))?true:false}function A(m,j){if(Y.ie&&Y.mac){return}var l=g.getElementsByTagName("head")[0],k=W("style");k.setAttribute("type","text/css");k.setAttribute("media","screen");if(!(Y.ie&&Y.win)&&typeof g.createTextNode!=X){k.appendChild(g.createTextNode(m+" {"+j+"}"))}l.appendChild(k);if(Y.ie&&Y.win&&typeof g.styleSheets!=X&&g.styleSheets.length>0){var i=g.styleSheets[g.styleSheets.length-1];if(typeof i.addRule==P){i.addRule(m,j)}}}return{registerObject:function(l,i,k){if(!Y.w3cdom||!l||!i){return}var j={};j.id=l;j.swfVersion=i;j.expressInstall=k?k:false;H[H.length]=j;A("#"+l,e)},getObjectById:function(l){var i=null;if(Y.w3cdom&&S){var j=b(l);if(j){var k=j.getElementsByTagName(P)[0];if(!k||(k&&typeof j.SetVariable!=X)){i=j}else{if(typeof k.SetVariable!=X){i=k}}}}return i},embedSWF:function(n,u,r,t,j,m,k,p,s){if(!Y.w3cdom||!n||!u||!r||!t||!j){return}r+="";t+="";if(O(j)){A("#"+u,e);var q=(typeof s==P)?s:{};q.data=n;q.width=r;q.height=t;var o=(typeof p==P)?p:{};if(typeof k==P){for(var l in k){if(k[l]!=Object.prototype[l]){if(typeof o.flashvars!=X){o.flashvars+="&"+l+"="+k[l]}else{o.flashvars=l+"="+k[l]}}}}J(function(){R(q,o,u);A("#"+u,a)})}else{if(m&&!C&&O("6.0.65")&&(Y.win||Y.mac)){A("#"+u,e);J(function(){var i={};i.id=i.altContentId=u;i.width=r;i.height=t;i.expressInstall=m;D(i);A("#"+u,a)})}}},getFlashPlayerVersion:function(){return{major:Y.pv[0],minor:Y.pv[1],release:Y.pv[2]}},hasFlashPlayerVersion:O,createSWF:function(k,j,i){if(Y.w3cdom&&S){return R(k,j,i)}else{return undefined}},createCSS:function(j,i){if(Y.w3cdom){A(j,i)}},addDomLoadEvent:J,addLoadEvent:M,getQueryParamValue:function(m){var l=g.location.search||g.location.hash;if(m==null){return l}if(l){var k=l.substring(1).split("&");for(var j=0;j<k.length;j++){if(k[j].substring(0,k[j].indexOf("="))==m){return k[j].substring((k[j].indexOf("=")+1))}}}return""},expressInstallCallback:function(){if(C&&L){var i=b(K);if(i){i.parentNode.replaceChild(L,i);L=null;C=false}}}}}();var SWFUpload;if(typeof(SWFUpload)==="function"){SWFUpload.onload=function(){};swfobject.addDomLoadEvent(function(){if(typeof(SWFUpload.onload)==="function"){SWFUpload.onload.call(window);}});SWFUpload.prototype.initSettings=(function(oldInitSettings){return function(){if(typeof(oldInitSettings)==="function"){oldInitSettings.call(this);}
this.ensureDefault=function(settingName,defaultValue){this.settings[settingName]=(this.settings[settingName]==undefined)?defaultValue:this.settings[settingName];};this.ensureDefault("minimum_flash_version","9.0.28");this.ensureDefault("swfupload_load_failed_handler",null);delete this.ensureDefault;};})(SWFUpload.prototype.initSettings);SWFUpload.prototype.loadFlash=function(oldLoadFlash){return function(){var hasFlash=swfobject.hasFlashPlayerVersion(this.settings.minimum_flash_version);if(hasFlash){this.queueEvent("swfupload_pre_load_handler");if(typeof(oldLoadFlash)==="function"){oldLoadFlash.call(this);}}else{this.queueEvent("swfupload_load_failed_handler");}};}(SWFUpload.prototype.loadFlash);SWFUpload.prototype.displayDebugInfo=function(oldDisplayDebugInfo){return function(){if(typeof(oldDisplayDebugInfo)==="function"){oldDisplayDebugInfo.call(this);}
this.debug(["SWFUpload.SWFObject Plugin settings:","\n","\t","minimum_flash_version:                      ",this.settings.minimum_flash_version,"\n","\t","swfupload_load_failed_handler assigned:     ",(typeof(this.settings.swfupload_load_failed_handler)==="function").toString(),"\n",].join(""));};}(SWFUpload.prototype.displayDebugInfo);}
var SWFUpload;if(typeof(SWFUpload)==="function"){SWFUpload.prototype.initSettings=function(oldInitSettings){return function(){if(typeof(oldInitSettings)==="function"){oldInitSettings.call(this);}
this.refreshCookies(false);};}(SWFUpload.prototype.initSettings);SWFUpload.prototype.refreshCookies=function(sendToFlash){if(sendToFlash===undefined){sendToFlash=true;}
sendToFlash=!!sendToFlash;var postParams=this.settings.post_params;var i,cookieArray=document.cookie.split(';'),caLength=cookieArray.length,c,eqIndex,name,value;for(i=0;i<caLength;i++){c=cookieArray[i];while(c.charAt(0)===" "){c=c.substring(1,c.length);}
eqIndex=c.indexOf("=");if(eqIndex>0){name=c.substring(0,eqIndex);value=c.substring(eqIndex+1);postParams[name]=value;}}
if(sendToFlash){this.setPostParams(postParams);}};}
(function($){window._=window._||function(s){return s;};$.browser.msie6=$.browser.msie&&$.browser.version<7;$.extend({thickbox:new function(){TB_TYPE={AJAX:'ajax',CONFIRM:'confirm',EXTERNAL:'external',IMAGE:'image',INLINE:'inline'};TB_ID={DIM:'tb-dim',LOADING:'tb-loading',MODAL:'tb-modal',TITLE:'tb-title',CLOSE:'tb-close',CONTENT:'tb-content',BROWSE:'tb-browse',NEXT:'tb-next',PREV:'tb-prev'};var dim,loading,modal,content,close;var request;var defaultValues={top:'',left:'',width:300,minWidth:250,height:340,animate:null,i18n:{close:{text:'Close',title:'Close this window'},count:{text:'Image %{image} / %{count}'},next:{text:'Next',title:'Show next image'},prev:{text:'Previous',title:'Show previous image'},confirm:{what:'Are you sure?',confirm:'Yes',cancel:'No'}}};function setup(type,builder){dim=$('#'+TB_ID.DIM);dim=dim.size()&&dim||$('<div id="'+TB_ID.DIM+'">'+($.browser.msie6?'<iframe src="about:blank" frameborder="0"></iframe>':'')+'</div>').appendTo(document.body).hide();$('iframe',dim).bind('focus',hide);loading=$('#'+TB_ID.LOADING);loading=loading.size()&&loading||$('<div id="'+TB_ID.LOADING+'"></div>').appendTo(document.body);modal=$('#'+TB_ID.MODAL);modal=modal.size()&&modal||$('<div id="'+TB_ID.MODAL+'"></div>').append('<b class="tb-tl"></b><b class="tb-tr"></b><b class="tb-br"></b><b class="tb-bl"></b>').appendTo(document.body);modal.attr('class','tb-'+type);content=$('#'+TB_ID.CONTENT);content=content.size()&&content||$('<div id="'+TB_ID.CONTENT+'"></div>').appendTo(modal);close=$('#'+TB_ID.CLOSE);close=close.size()&&close||$('<div id="'+TB_ID.CLOSE+'"><a href="#" title="'+defaultValues.i18n.close.title+'">'+defaultValues.i18n.close.text+'</a></div>').appendTo(modal);$('a',close).bind('click',hide);dim.unbind('click').one('click',hide);if(!dim.is(':visible')){dim.show();}
loading.show();builder();$(document).bind('keydown',keydown).bind('keypress',blockKeys);$(window).bind('scroll',blockScroll);}
function show(width,height,top,left,animate,callback){loading.hide();var css={width:width+'px',height:height+'px'},noUnit=/^\d+$/;if(!top){css['top']='';if(!$.browser.msie6){css['margin-top']=-parseInt(height/2)+'px';}else{dim[0].style.setExpression('height','document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + "px"');loading[0].style.setExpression('marginTop','0 - parseInt(this.offsetHeight / 2) + (document.documentElement && document.documentElement.scrollTop || document.body.scrollTop) + "px"');modal[0].style.setExpression('marginTop','0 - parseInt(this.offsetHeight / 2) + (document.documentElement && document.documentElement.scrollTop || document.body.scrollTop) + "px"');}}else{css['top']=top+((top+'').match(noUnit)?'px':'');css['margin-top']='';}
if(!left){css['left']='';css['margin-left']=-parseInt(width/2)+'px';}else{css['left']=left+((left+'').match(noUnit)?'px':'');css['margin-left']='';}
animate?modal.css(css).animate(animate.animation,animate.speed):modal.css(css).show();typeof callback=='function'&&callback(modal[0]);}
function hide(callback){if(request){request.abort();request=null;}
loading.hide();modal.hide();dim.hide();content.empty();typeof callback=='function'&&callback();$(document).unbind('keydown',keydown).unbind('keypress',blockKeys);$(window).unbind('scroll',blockScroll);next=previous=function(){};return false;}
function blockKeys(e){var allowed=$('a, button, input, select, textarea',modal);for(var i=0,k=allowed.length;i<k;i++){if(allowed[i]==e.target){return true;}}
return false;}
function blockScroll(){return false;}
var next=function(){},previous=next;function keydown(e){var key=e.which||e.keyCode||-1;switch(key){case 27:hide();break;case 37:previous();break;case 39:next();break;default:blockKeys(e);}}
function buildTitle(title){if(title){content.prepend('<h2 id="'+TB_ID.TITLE+'">'+title+'</h2>');}}
this.defaults=function(override){defaultValues=$.extend(defaultValues,override);};this.render=function(settings,callback){settings=$.extend({top:defaultValues.top,left:defaultValues.left,width:defaultValues.width,height:defaultValues.height,slideshow:false},settings);return this.each(function(){var $$=$(this),hostname=this.hostname&&this.hostname.replace(/:\d*$/,''),port=parseInt(this.port)||80,hash=this.hash&&this.hash.replace('#','')||'';var isLink=$$.is('a')&&this.href;var isImage=isLink&&this.href.match(/\.(bmp|gif|jpe?g|png)/gi);var isInline=!!hash;var isAjax=hostname==location.hostname&&port==(location.port||80)&&!isInline;var isExternal=isLink&&(hostname!=location.hostname||port!=(location.port||80));var isForm=$$.is('form');var type=isImage&&TB_TYPE.IMAGE||isInline&&TB_TYPE.INLINE||isAjax&&TB_TYPE.AJAX||isExternal&&TB_TYPE.EXTERNAL||isForm&&TB_TYPE.CONFIRM;var builder;switch(type){case TB_TYPE.IMAGE:builder=function(){var title=$$.attr('title')||'',rel=$$.attr('rel');if(rel){var group=$('a[rel="'+rel+'"]'),size=group.size(),i=group.index($$[0]);var count='<em>'+defaultValues.i18n.count.text.replace(/%\{image\}/,i+1).replace(/%\{count\}/,size)+'</em>';if(size>1){var buildShowFunc=function(el){return function(){modal.hide();content.empty();$(el).trigger('click');return false;};};var nextHtml='<strong id="'+TB_ID.NEXT+'"><a href="#" title="'+defaultValues.i18n.next.title+'">'+defaultValues.i18n.next.text+'</a></strong>';next=buildShowFunc(group[i+1]||group[0]);var previousHtml='<strong id="'+TB_ID.PREV+'"><a href="#" title="'+defaultValues.i18n.prev.title+'">'+defaultValues.i18n.prev.text+'</a></strong>';previous=buildShowFunc(group[i-1]||group[size-1]);}}
var img=new Image();img.onload=function(){img.onload=null;var subtraction=150;var viewportWidth=(self.innerWidth||$.boxModel&&document.documentElement.clientWidth||document.body.clientWidth)-subtraction;var viewportHeight=(self.innerHeight||$.boxModel&&document.documentElement.clientHeight||document.body.clientHeight)-subtraction;var imgWidth=img.width;var imgHeight=img.height;if(imgWidth>viewportWidth){imgHeight=imgHeight*viewportWidth/imgWidth;imgWidth=viewportWidth;if(imgHeight>viewportHeight){imgWidth=imgWidth*viewportHeight/imgHeight;imgHeight=viewportHeight;}}else if(imgHeight>viewportHeight){imgWidth=imgWidth*viewportHeight/imgHeight;imgHeight=viewportHeight;if(imgWidth>viewportWidth){imgHeight=imgHeight*viewportWidth/imgWidth;imgWidth=viewportWidth;}}
imgWidth=parseInt(imgWidth);imgHeight=parseInt(imgHeight);$('<img src="'+$$.attr('href')+'" alt="Image" width="'+imgWidth+'" height="'+imgHeight+'" title="'+title+'" />').appendTo(content);if(rel){$(['<p id="'+TB_ID.BROWSE+'">',(previousHtml||''),(nextHtml||''),count,'</p>'].join('')).appendTo(content);if(size>1){$('#'+TB_ID.NEXT+' a').bind('click',next);$('#'+TB_ID.PREV+' a').bind('click',previous);}}
show(Math.max(imgWidth,defaultValues.minWidth)+20,imgHeight+(rel?65:50),settings.top,settings.left,settings.animate,callback);};img.src=$$.attr('href');};break;case TB_TYPE.INLINE:var inlineContent=$($$[0].hash);builder=function(){buildTitle($$.attr('title'));inlineContent.css('display','block').appendTo(content);show(settings.width,settings.height,settings.top,settings.left,settings.animate,callback);};break;case TB_TYPE.AJAX:builder=function(){buildTitle($$.attr('title'));request=$.ajax({url:$$.attr('href'),dataType:'html',global:false,success:function(r){content.append(r);show(settings.width,settings.height,settings.top,settings.left,settings.animate,callback);}});};break;case TB_TYPE.EXTERNAL:builder=function(){buildTitle($$.attr('title'));$('<iframe id="'+TB_ID.CONTENT+'" src="'+$$.attr('href')+'" frameborder="0"></iframe>').appendTo(content);show(settings.width,settings.height,settings.top,settings.left,settings.animate,callback);};break;case TB_TYPE.CONFIRM:builder=function(){buildTitle($('*[type="submit"][title]',$$).attr('title')||defaultValues.i18n.confirm.what);$('<a id="tb-confirm" href="#">'+defaultValues.i18n.confirm.confirm+'</a>').appendTo(content).click(function(){hide(settings.onConfirm||function(){$$[0].submit();});return false;});$('<a id="tb-cancel" href="#">'+defaultValues.i18n.confirm.cancel+'</a> ').appendTo(content).click(function(){hide();return false;});show(settings.width,(settings.height==defaultValues.height?90:settings.height),settings.top,settings.left,settings.animate,callback);};break;default:alert('You can apply a Thickbox to links and forms only.');}
if(builder){$$.bind((type==TB_TYPE.CONFIRM?'submit':'click'),function(){setup(type,builder);this.blur();return false;});}});};}});$.fn.extend({thickbox:$.thickbox.render});})(jQuery);jQuery.thickbox.defaults({i18n:{close:{text:_('Close'),title:_('Close this window')},count:{text:_('Image %{image} / %{count}')},next:{text:_('Next'),title:_('Show next image')},prev:{text:_('Previous'),title:_('Show previous image')},confirm:{what:_('Are you sure?'),confirm:_('Yes'),cancel:_('No')}}});function PlazeMap(container,options){if(!(typeof GBrowserIsCompatible=='function'&&GBrowserIsCompatible()))
return;if(!options.bounds&&(isNaN(options.center.lat)&&isNaN(options.center.lng)))
return;options=options||{};options.center.lat=parseFloat(options.center.lat);options.center.lng=parseFloat(options.center.lng);options.zoom=typeof options.zoom=='number'?options.zoom:17;var ICON_BASE_PATH='/images/pins/single/';var baseIcon=new GIcon();baseIcon.iconSize=new GSize(36,46);baseIcon.iconAnchor=new GPoint(0,46);var userIcon=new GIcon();userIcon.image=ICON_BASE_PATH+'user.png';userIcon.iconSize=new GSize(31,38);userIcon.iconAnchor=new GPoint(0,38);var map,center,marker,overlays=[],controls=[new GSmallMapControl(),new GMapTypeControl()];if(document.namespaces)
document.namespaces.add('v','urn:schemas-microsoft-com:vml');var PlazesInfoWindow=function(marker,target,type){this.marker=marker;this.$target=target;this.type=type||'small';};PlazesInfoWindow.prototype=new GOverlay();PlazesInfoWindow.prototype.initialize=function(map){this.container=$('<div id="plazes-info-window" class="'+this.type+'"></div>')[0];this.yield=$('<div class="yield"></div>').appendTo(this.container)[0];this.$target.appendTo(this.yield);map.getPane(G_MAP_FLOAT_PANE).appendChild(this.container);var fromLatLngToDivPixel=map.fromLatLngToDivPixel(center);this.container.style.top=fromLatLngToDivPixel.y-this.container.offsetHeight+3+'px';this.container.style.left=fromLatLngToDivPixel.x+1+'px';var a=document.createElement('a');a.className='remove';a.href='#';a.title=_('Show on map');a.innerHTML='[x]';this.container.appendChild(a);a.onclick=enableMap;};PlazesInfoWindow.prototype.remove=function(){this.container.parentNode.removeChild(this.container);};PlazesInfoWindow.prototype.redraw=function(){};function disableMap(){for(var i=0,overlay;overlay=overlays[i];i++)
map.removeOverlay(overlay);marker.hide();map.setMapType(G_SATELLITE_MAP);map.setZoom(options.zoom);if(options.moveBy)
map.panTo(options.moveBy);for(var k=0,control;control=controls[k];k++)
map.removeControl(control);map.disableDragging();}
function enableMap(){$('#actions').hide();map.removeOverlay(marker.overlay);map.setMapType(G_NORMAL_MAP);map.panTo(center);marker.show();for(var i=0,control;control=controls[i];i++)
map.addControl(control);map.enableDragging();for(var k=0,overlay;overlay=overlays[k];k++)
map.addOverlay(overlay);return false;}
map=new GMap2(container);if(options.bounds){center=new GLatLngBounds(new GLatLng(options.bounds.swLat,options.bounds.swLng),new GLatLng(options.bounds.neLat,options.bounds.neLng)).getCenter();map.setCenter(center,options.zoom,G_SATELLITE_MAP);map.setZoom(map.getBoundsZoomLevel(bounds));}
else{center=new GLatLng(options.center.lat,options.center.lng);map.setCenter(center,options.zoom,G_SATELLITE_MAP);}
if(options.moveBy)
map.setCenter((options.moveBy=map.fromContainerPixelToLatLng(new GPoint(map.getSize().width/2-options.moveBy.x,map.getSize().height/2+options.moveBy.y))));var user=options.user&&(options.user.lat=parseFloat(options.user.lat))&&(options.user.lng=parseFloat(options.user.lng))&&new GLatLng(options.user.lat,options.user.lng)||null;if(user&&!user.equals(center)){overlays.push(new GMarker(user,{clickable:false,icon:new GIcon(userIcon,options.user.pin),title:_('You are here')}));overlays.push(new GPolyline([center,user],'#6ebdf1',1,1));}
marker=new GMarker(center,{icon:new GIcon(user&&user.equals(center)?userIcon:baseIcon,user&&user.equals(center)?options.user.pin:ICON_BASE_PATH+options.category+'.png'),title:options.markerTitle});map.addOverlay(marker);marker.hide();GEvent.addListener(marker,'click',function(){if(typeof PlazesInfoWindow!='undefined'){if(!this.overlay)
this.overlay=new PlazesInfoWindow(this,$('#data'),'large');map.addOverlay(this.overlay);disableMap();}
else
map.openInfoWindow(center,$('#data')[0]);});GEvent.addListener(map,'moveend',function(){if(marker.isHidden())
$('#actions').show();});GEvent.trigger(marker,'click');GEvent.addDomListener(window,'unload',GUnload);$('#do-map a').bind('click',function(){return enableMap();});};(function(){var $timeline=$('#timeline').delegate('click',{'a.previous':function(e,el){e.preventDefault();loadTimelinePage(el,'prepend');},'a.next':function(e,el){e.preventDefault();loadTimelinePage(el,'append');}});function loadTimelinePage(el,insertion){var href=el.href,klass=el.className;var $li=$(el).parents('li:first').html('<em class="processing '+klass+'">'+_('Loading')+'<span>&#8230;</span></em>');$.get(href,function(r){$li.remove();$timeline[insertion](r);});}
$('#do-months').click(function(){$(this.hash).toggle();this.blur();return false;});$('#schedule-filter select').fixVal().change(function(){if(this.pending)
clearTimeout(this.pending);var form=this.form;this.pending=setTimeout(function(){form.submit();},$.browser.opera?1000:0);return false;});$('#months').processing();$.ajax({url:$('#do-months-url').attr('href'),success:function(html){$('#months').html(html);var $months=$('#months td'),monthsPerPage=12;if($months.length&&$months.length>monthsPerPage){var $chart=$('#months table'),barWidth=32,animSpeed=200,$p=$('<p></p>').appendTo('#months');var computeLeft=function(){return 1+(Math.abs(parseInt($chart.css('left')))||0);};var left=computeLeft(),maxLeft=parseInt($chart.css('width'))-monthsPerPage*barWidth;var $future=$('<a class="future" href="#">&gt;</a>').css('display','none').appendTo($p).bind('click',function(){if(left<maxLeft){$chart.animate({left:'-='+Math.min(monthsPerPage*barWidth,maxLeft-computeLeft())+'px'},animSpeed,function(){left=computeLeft();$future[left<maxLeft?'blur':'hide']();});}
$past.show();return false;});var $past=$('<a class="past" href="#">&lt;</a>').css('display','none').appendTo($p).bind('click',function(){if(left){$chart.animate({left:'+='+Math.min(monthsPerPage*barWidth,computeLeft())+'px'},animSpeed,function(){left=computeLeft();$past[left-2?'blur':'hide']();});}
$future.show();return false;});if(left<maxLeft)
$future.show();if(left)
$past.show();}}})})();(function(){var slideSpeed=$.browser.msie?250:150;var $delegate=$('#schedule, #content.search, #spreadings').delegate('click',{'[href*="copy-activity"]':function(e,el){$('form.copy',$delegate).hide();$('p.copy',$delegate).show();positionCopyForm(el);$(el).parents('p.copy').hide();var $toggle=$(el.hash).show(100,function(){$('input',$toggle).focus();});return false;},'[href*="permission-activity"], [href*="comments-activity"], [href*="companions-activity"]':function(e){var $links=$('li.permission a, li.comments a, li.companions a',$(e.target).parents('ul:eq(0)'))
$bits=$links.map(function(){return $(this.hash)[0];}),$bit=$(e.target.hash);if($bit.is(':visible'))
$bit.slideUp(slideSpeed);else if($bits.filter(':visible').length)
$bits.filter(':visible').slideUp(slideSpeed,function(){$bit.slideDown(slideSpeed);});else
$bit.slideDown(slideSpeed);e.target.blur();return false;}});$delegate.delegate('submit',{'.manage':function(e){if($.plazes.confirm(e.target)){var $form=$(e.target).ajaxSubmit({success:function(){var $removable=$form.parents('li:first');if(!$removable.siblings().length)$removable=$removable.parents('li:first');$removable.remove(500);},error:function(){}});}
return false;},'.copy':function(e){var $form=$(e.target);$('div.submit-field',$form).find('button').hide().end().prepend('<em class="processing">'+_('Loading')+'<span>&#8230;</span></em>');$form.ajaxSubmit({success:function(html){$form.hide(100,function(){var $p=$('p.copy:hidden',$delegate).html('<strong>'+_('You too!')+'</strong>').show('highlight');if(!$('#timeline').is('.contacts, .user'))$(html).css('display','none').insertAfter($p.parents('li:first')).animate({opacity:'show',height:'show'},300);});},error:function(xhr){$form.hide(100,function(){$('div.submit-field',$form).find('button').show();$('p.copy:hidden',$delegate).show();});}});return false;}});$delegate.delegate('reset',{'.copy':function(e){var $target=$(e.target).hide(100,function(){$('p.copy',$delegate).show();});}});var positionCopyForm=$.browser.msie?function(el){var contextOffset=$delegate.offset(),targetOffset=$(el).offset();$(el.hash).appendTo($delegate).css('top',(targetOffset.top-contextOffset.top)+'px');}:function(){};})();(function(){$('#erase form').confirm();$('#tags div.caption a, #groups div.caption a').bind('click',function(){$(this.hash).toggle().filter(':visible').find('input[type=text]').focus();return false;});var $tagsForm=$('#add-tag').ajaxForm({beforeSubmit:function(){$('button',$tagsForm).wait();},success:function(r){$('button',$tagsForm).wait();$('input:text',$tagsForm).val('');var $ol=$('#tags ol');if(!$ol.length)$ol=$('<ol></ol>').insertBefore($tagsForm);$ol.append(r);},error:function(){}});$('#tags').delegate('submit',{'form:not(.kit)':function(e,el){var $form=$(el).ajaxSubmit({success:function(){$form.parents('li:first').remove(500);},error:function(){}});return false;}});var $groupsForm=$('#add-group').ajaxForm({beforeSubmit:function(){$('button',$groupsForm).wait();},success:function(r){$('button',$groupsForm).wait();$('option:selected',$groupsForm).remove();$('#groups ul, #groups > p').replaceWith($('<ul class="simple"></ul>').html(r));},error:function(){}});$('#pictures a[rel=plaze], #photo a').thickbox();$('#pictures form.manage').confirm();var $upload=$('#pictures div.caption a');if($upload.length){var $form=$($upload[0].hash);$upload.bind('click',function(){$form.toggle().find('input[type=file]').focus();return false;});function fileDialogComplete(files){$upload.blur();if(files){$upload.disable();$('#ajax').trigger('ajaxSend');this.startUpload();}}
function uploadSuccess(file,response){$($('#pictures ul')[0]||$('<ul></ul>').insertAfter('#pictures > .caption')[0]).prepend(response);$('#pictures a[rel=plaze]:first').thickbox();$('#pictures form.manage:first').confirm();}
function uploadComplete(){try{if(this.getStats().files_queued>0)
this.startUpload();else{$upload.enable();$('#ajax').trigger('ajaxComplete');}}catch(ex){}}
function swfuploadAvailable(){$upload.unbind('click').bind('click',function(){swfu.selectFiles();return false;});}
var swfu=new SWFUpload({upload_url:$form.attr('action'),flash_url:'/flashes/swfupload_f9.swf',file_size_limit:'10 MB',file_upload_limit:3,file_types:'*.jpg;*.jpeg;*.gif;*.png',file_types_description:_('Upload GIF, JPG and PNG images'),file_dialog_complete_handler:fileDialogComplete,upload_success_handler:uploadSuccess,upload_complete_handler:uploadComplete,swfupload_pre_load_handler:swfuploadAvailable});}})();
