
String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"");}
String.prototype.ltrim=function(){return this.replace(/^\s+/,"");}
String.prototype.rtrim=function(){return this.replace(/\s+$/,"");}
var eop={action:"profile",objects:{},activeController:{},tabManager:{},bind:function(){var _func=arguments[0]||null;var _obj=arguments[1]||this;var _arg=arguments[2]||undefined;return function(){if(_arg!=undefined)arguments=[_arg];return _func.apply(_obj,arguments);};},sendRequest:function(action,controller,params,method,b){jQuery.ajax({type:method,data:params,url:eop.i18n.applicationserver+controller+'/'+action,success:function(data,textStatus){if(typeof b=="string"){$('#'+b).html(data);}else{if(b)
$('#bodycontent').html(data);else
jQuery('#xhr_response').html(data);}},error:function(XMLHttpRequest,textStatus,errorThrown){eop.errMng.req(XMLHttpRequest);},complete:function(XMLHttpRequest,textStatus){if(controller=="set")controller="album";eop.createTab(controller,action);}});},fckUpdateEditorFormValue:function()
{for(i=0;i<parent.frames.length;++i)
if(parent.frames[i].FCK)
parent.frames[i].FCK.UpdateLinkedField();},load:function(controller){this.log("debug","[LOAD] Init Search Engine done");$("#maintabs").tabs();$('#maintabs').bind('tabsselect',function(event,ui){eop.swichActions(ui.tab.hash.substring(4));});eop.search.init();if(controller==""){controller="profile";}
this.log("debug","[LOAD] first Controller:"+controller);if(controller!="search")
eop.start(controller);eop.hideSpinner();},start:function(controller,action,args){this.log("debug","[START] Controller:"+controller+" Action:"+action);if(!eop.errMng.hasError()){try{var code="";var cont=this.getControllerObject(controller);if(cont&&cont.init){cont.init(action,args,code);eop.updateGA(controller,action);}}catch(e){eop.log("error","[load] init failed for controller:eop."+controller,e);}}
eop.hideSpinner();},getControllerObject:function(controller){var cont=undefined;if(controller=='set')controller="album";if(controller in this.objects){cont=this.objects[controller];}
if(cont==undefined){cont=eval("eop."+controller);this.objects[controller]=cont;}
return cont;},callControllerDestroy:function(controller,action){var cont=this.getControllerObject(controller);if(cont&&cont.destroy)
cont.destroy(action);},parseMessage:function(){var errors=$("#xhr_response>div#errors");if(errors.html()!=null&&errors.html()!=""){eop.addMessage(errors.html());eop.showMessage("errors");}
var flash=$("#xhr_response>div#flash");if(flash.html()!=null&&flash.html()!=""){eop.addMessage(flash.html());eop.showMessage("info");}
return $("#xhr_response>span#return_code").html();},createTab:function(controller,action){if(!eop.errMng.hasError()){if(this.activeController[controller]!=undefined){this.callControllerDestroy(controller,this.activeController[controller])}
this.activeController[controller]=action;var code=this.parseMessage();var h1=$("#xhr_response>div#content>h1");var content=$("#xhr_response>div#content>div");if(h1.length!=0&&content.length!=0){var title="Eop";var id='tab'+controller;var closebutton=id+"close";if(h1.length>0){title=h1.html()+"<span class=\"closetab\" id=\""+closebutton+"\">&nbsp;</span>";}
if($('#'+id).length>0){$("#"+closebutton).unbind('click');$('#'+closebutton).parent().html(title);$('#'+id).html(content);index=this.tabManager[id];}else{$("#maintabs").tabs('add',"#"+id,title);$('#'+id).html(content);var index=$("#maintabs").tabs('length')-1;this.tabManager[id]=index;}
$("#"+closebutton).click(function(){$("#maintabs").tabs('remove',index);});$("#maintabs").tabs('select',index);}
$("#xhr_response").html("");eop.start(controller,action,code);}},updateGA:function(controller,action){if(window._trackEvent!=undefined){_trackEvent("ACTIONS",controller,"Controller",action);}},swichActions:function(controller){$('#'+eop.action+'_actions').hide();eop.action=controller;var r=$('#'+eop.action+'_actions');if(r.length==0){eop.action='generic';$('#'+eop.action+'_actions').show();}else{r.show();}},AjaxMngr:function(controller,action){eop.errMng.display(""+controller+"/"+action);},showSpinner:function(s){s=s==undefined?"spinnerContainer":s;eop.currspinner=s
eop.cleanMessage();$('#'+s).show();},hideSpinner:function(s){s=s==undefined?"spinnerContainer":s;eop.currspinner=eop.currspinner==undefined?s:eop.currspinner;$('#'+eop.currspinner).hide();eop.currspinner=undefined;},updateBody:function(data,controller,action){$('#bodycontent')[0].innerHTML=data;eop.start(controller,action);},showAlert:function(title,message,btnok,btncanc,cbok,cbcanc){eop.dialog.destroy();$("#dialog")[0].innerHTML="<p class=\"alert\">"+message+"</p>";$("#dialog")[0].setAttribute("title",title);eop.dialog.input(btnok,btncanc,cbok,cbcanc)},log:function(lvl,message,e){if(window.console){window.console[lvl](message);if(e)
window.console['error'](e);}},messageShown:false,showMessage:function(style){$('#errormessage').addClass(style);if(!eop.messageShown){$('#errormessage').fadeIn("slow");eop.messageShown=true;}
var ret=$('#return_code');setTimeout(eop.hideMessage,7000);if(ret&&ret[0])
return parseInt(ret[0].innerHTML);else
return 0;},cleanMessage:function(){if(eop.messageShown)
this.hideMessage();if($('#errormessage').length>0)
$('#errormessage')[0].innerHTML="";},addMessage:function(txt){eop.messageShown=false;$('#errormessage').html(txt);},hasMessage:function(){if($('#errormessage').length>0)
return $('#errormessage')[0].innerHTML!="";else
return false;},getMessage:function(){if($('#errormessage').length>0)
return $('#errormessage')[0].innerHTML;else
return"";},hideMessage:function(){if(eop.messageShown){$('#errormessage').fadeOut("slow");eop.messageShown=false;}},alert:function(txt){eop.addMessage("<div class=\"msgcontainer warning\">"+txt+"</div>");eop.showMessage();},checkForm:function(formName){var ret=true;ret=ret&&eop.checkFieldType(formName,'input');ret=ret&&eop.checkFieldType(formName,'select');ret=ret&&eop.checkFieldType(formName,'textarea');return ret;},checkFieldType:function(formName,type){var ipts=$('#'+formName+" :"+type);for(var i=0;i<ipts.length;i++){var ipt=$("#"+ipts[i].id);if(ipt.hasClass("mandatory")&&ipt.val()==""){ipt.addClass("error");ret=false;}else{ipt.removeClass("error");}}}};eop.dialog={setTitle:function(){$("#dialog").dialog('destroy');$("#dialog")[0].setAttribute("title",$("#dialog>h1")[0].innerHTML);$("#dialog>h1").remove();},open:function(){$("#dialog").dialog('open');$(".ui-icon-closethick").html("&nbsp;");},modal:function(){this.setTitle();$("#dialog").dialog({bgiframe:true,height:300,modal:true,overlay:{backgroundColor:'#87B3D8',opacity:0.5}});this.open();},popup:function(onopen,onclose){this.setTitle();$("#dialog").dialog({bgiframe:true,closeOnEscape:true,draggable:true,modal:false,open:onopen,close:onclose});this.open();},slideshow:function(blog){var height=1105;var width=1150;if(blog){height=850;width=650;}
this.setTitle();$("#dialog").dialog({bgiframe:true,height:height,width:width,modal:true,closeOnEscape:true,overlay:{backgroundColor:'#87B3D8',opacity:0.5}});this.open();},input:function(btnok,btncanc,cbok,cbcanc){var btn={};btn[btnok]=function(){cbok.call();eop.dialog.destroy();};btn[btncanc]=function(){cbcanc.call();eop.dialog.destroy();};$("#dialog").dialog({bgiframe:true,height:100,modal:true,overlay:{backgroundColor:'#87B3D8',opacity:0.5},buttons:btn});this.open();},close:function(b){$("#dialog").dialog('close');if(!b)
eop.dialog.destroy();},destroy:function(){$("#dialog").dialog('destroy');}};eop.errMng={current:null,req:function(Xhr,controller,action){var r=Xhr.responseText;var message=r.substring(r.indexOf("errors\">")+8,r.indexOf("</div>"));if(message=="")message="No response from the server";eop.addMessage(message);current=eop.showMessage('errors');eop.log('error',"Error "+Xhr.status+" "+message);},display:function(message){var html="<ul>";for(var field in message){html+="<li>"+message[field]+"</li>";}
html+="</ul>";eop.addMessage(html);current=eop.showMessage("warning");},hasError:function(){var b=this.current!=null;this.current=null;return b;}};eop.map={startUp:function(id,type){if(GBrowserIsCompatible()){if(true){var mapholder=$('#'+id)[0];if(mapholder){this.gg_map=new GMap2(mapholder);this.setCenter();this.gg_map.geocoder=new GClientGeocoder();var customUI=this.gg_map.getDefaultUI();customUI.maptypes.hybrid=true;customUI.maptypes.normal=false;customUI.maptypes.physical=false;customUI.maptypes.satellite=false;this.gg_map.setUI(customUI);}}
if(true){var mapholder=$('#small'+id)[0];if(mapholder){this.gg_smap=new GMap2(mapholder);this.setCenter(undefined,undefined,"small");this.gg_smap.addControl(new GSmallMapControl());this.gg_smap.geocoder=new GClientGeocoder();}}}},eventHandlers:[],addMapEvent:function(event,callback,o){if(!(event in this.eventHandlers)){this.eventHandlers[event]=[]}
this.eventHandlers[event][callback]=this.eventHandlers[event]=GEvent.addListener(this.gg_map,event,callback,o);},remMarkerEvent:function(marker,event,callback){try{GEvent.removeListener(this.eventHandlers[marker][event][callback]);}catch(e){eop.log('error',"[MAP] triing to remove an unset event and callback",e);}},addMarkerEvent:function(marker,event,callback,o){if(!(marker in this.eventHandlers)){this.eventHandlers[marker]=[]}
if(!(event in this.eventHandlers[marker])){this.eventHandlers[marker][event]=[]}
this.eventHandlers[marker][event][callback]=GEvent.addListener(marker,event,callback,o);},getZoom:function(type){if(type=="small")
return this.gg_smap.getZoom();else
return this.gg_map.getZoom();},markers:[],pois:[],poicb:null,poio:null,gg_map:null,gg_smap:null,setCenter:function(point,zoom,map){if(point==undefined)point=new GLatLng(37.4419,-122.1419);if(zoom==undefined)zoom=2;if(map==undefined)map="normal";if(map=="small")
this.gg_smap.setCenter(point,zoom);else
this.gg_map.setCenter(point,zoom);},poidisplay:function(poicb,poio,type,mapid,poilistid){this.poicb=poicb;this.poio=poio;this.mapid=mapid==undefined?"mappoimngt":mapid;this.poilistid=poilistid==undefined?"poilist":poilistid;this.type=type==undefined?"":type;if(this.gg_map==null){setTimeout(eop.bind(this._poidisplay,this),1000);}else{eop.map._poidisplay();}},_poidisplay:function(){this.startUp(this.mapid,this.type);if($('#'+this.poilistid).length>0){this.loadData();this.removeMarkers();var lastpoi;for(var i in this.datapois){if(i!='end'){this.pois[i]=this.datapois[i];var marker=this.addPoint(this.pois[i].latt,this.pois[i].longitude,this.pois[i].type,false,this.type,this.pois[i].name);if(this.poicb){this.addMarkerEvent(marker,'click',eop.bind(this.poicb,this.poio,{i:i.split('_')[1],p:this.pois[i],m:marker}));}
lastpoi=this.datapois[i];this.markers[i]=marker;}}
if(lastpoi){this.gg_map.setCenter(new GLatLng(lastpoi.latt,lastpoi.longitude));}}else{console.log("no poi to display")}},loadData:function(){var data=$('#poilist')[0].innerHTML;data=this.poicleanData(data);try{eval("var pois = "+data);this.datapois=pois;}catch(e){eop.log('error','[POI] init failed data are corrupted',e)}},removeMarker:function(mker){this.gg_map.removeOverlay(mker);},removeMarkers:function(){for(var i in this.markers){this.removeMarker(this.markers[i]);}},hideAll:function(){for(var i in this.markers){this.markers[i].hide();}},showAll:function(){for(var i in this.markers){this.markers[i].show();}},hidePoint:function(poiid){try{poiid=this.checkPoiId(poiid);this.markers[poiid].closeInfoWindow();this.markers[poiid].hide();return this.markers[poiid];}catch(e){eop.log('error',"Poi doesn't exist "+poiid);}},showPoint:function(poiid,map,center){try{poiid=this.checkPoiId(poiid);this.markers[poiid].show();if(center)
eop.map.setCenter(this.markers[poiid].getLatLng(),5,map)}catch(e){eop.log('error',"Poi doesn't exist "+poiid);}},checkPoiId:function(poiid){if(poiid.indexOf("poi")==-1){return"poi_"+poiid;}else{return poiid;}},poicleanData:function(data){data=data.replace(/\n/g,"");data=data.replace(/\t/g,"");data=data.replace(/  /g,"");return data;},addPoint:function(x,y,type,drag,map,name){if(x!=undefined&&y!=undefined)
var point=new GLatLng(x,y);else
var point=this.gg_map.getCenter();if(type==undefined)type='poi';var baseIcon=new GIcon();baseIcon.image=eop.i18n.http_server+'/images/standard/'+type+".png";baseIcon.iconSize=new GSize(28,66);baseIcon.shadowSize=new GSize(47,63);baseIcon.iconAnchor=new GPoint(0,66);baseIcon.infoWindowAnchor=new GPoint(9,2);baseIcon.infoShadowAnchor=new GPoint(18,25);var icon=new GIcon(baseIcon);var marker=new GMarker(point,{icon:icon,draggable:drag});var tooltip=new Tooltip(marker,name,4);marker.tooltip=tooltip;if(map=="small"){this.gg_smap.addOverlay(marker);}else{this.gg_map.addOverlay(marker);this.gg_map.addOverlay(tooltip);}
GEvent.addListener(marker,'mouseover',function(){this.tooltip.show();});GEvent.addListener(marker,'mouseout',function(){this.tooltip.hide();});return marker;},movePoint:function(marker,x,y){if(x!=undefined&&y!=undefined)
var point=new GLatLng(x,y);else
var point=this.gg_map.getCenter();marker.setLatLng(point);return marker;},geolocAddress:function(address,callback){if(this.gg_map.geocoder){this.gg_map.geocoder.getLatLng(address,callback);}}};function Tooltip(marker,text,padding){this.marker_=marker;this.text_=text;this.padding_=padding;}
Tooltip.prototype=new GOverlay();Tooltip.prototype={initialize:function(map){var div=document.createElement("div");div.appendChild(document.createTextNode(this.text_));div.className='tooltip';div.style.position='absolute';div.style.visibility='hidden';map.getPane(G_MAP_FLOAT_PANE).appendChild(div);this.map_=map;this.div_=div;},remove:function(){this.div_.parentNode.removeChild(this.div_);},copy:function(){return new Tooltip(this.marker_,this.text_,this.padding_);},redraw:function(force){if(!force)return;var markerPos=this.map_.fromLatLngToDivPixel(this.marker_.getPoint());var iconAnchor=this.marker_.getIcon().iconAnchor;var xPos=Math.round(markerPos.x-this.div_.clientWidth/2);var yPos=markerPos.y-iconAnchor.y-this.div_.clientHeight-this.padding_;this.div_.style.top=yPos+'px';this.div_.style.left=xPos+'px';},show:function(){this.div_.style.visibility='visible';},hide:function(){this.div_.style.visibility='hidden';}}
if(!eop)var eop={};eop.profile={init:function(act){if(act==undefined){this.common();}
if(act=='xhome'){this.common();}
if(act=='xsignup'||act=='signup'){$('#signuplogin').focus();}
if(act=='edit'){$("#tabs").tabs();this.updateDoB();$("#dateofbirth_day").bind('change',this.updateDoB);$("#dateofbirth_month").bind('change',this.updateDoB);$("#dateofbirth_year").bind('change',this.updateDoB);$("#editForm").submit(eop.bind(this.checkForm,this))}},checkForm:function(){return eop.checkForm("editForm");},updateDoB:function(){var d,m,y;y=$("#dateofbirth_year").val();m=$("#dateofbirth_month").val();d=$("#dateofbirth_day").val();if(m.length==1){m="0"+m;}
if(d.length==1){d="0"+d;}
$("#dateofbirth > input").val(y+m+d);},common:function(){$('#profilCredId').change(this.changestate);eop.map.poidisplay(eop.profile.display,this);},changestate:function(){var cred=$('#profilCredId').val();for(var i in eop.map.pois){if(eop.map.pois[i].cred==cred||cred==0)
eop.map.showPoint(i);else
eop.map.hidePoint(i);}},display:function(e){if($('#sethash').length>0)
e.i=$('#sethash')[0].innerHTML;eop.poi.getPoiContent(e);}};
if(!eop)var eop={};eop.image={init:function(act,p,code){if(act==undefined||act=='list'){$("#imagespinnerContainer").hide();if($("#xhr_response_data").html()!="")
$("#list_container").html($("#xhr_response_data").html());else{var arr=$(".imagesettitle");this.currentSet=arr[0].id;arr[0].className+=" selected";arr.bind("click",eop.bind(this.displaySetImage,this))}}
if(act=='create'){this.settings={flash_url:eop.i18n.http_server+"swf/swfupload.swf",upload_url:eop.i18n.applicationserver+"image/upload/",post_params:{"JSESSIONID":eop.i18n.jsessionid},file_size_limit:"2 MB",file_types:"*.jpg",file_types_description:eop.i18n.filetype,file_upload_limit:15,file_queue_limit:0,custom_settings:{progressTarget:"fsUploadProgress",cancelButtonId:"btnCancel"},debug:false,button_image_url:eop.i18n.http_server+"images/standard/uploadbutton.png",button_width:"65",button_height:"23",button_placeholder_id:"spanButtonPlaceHolder",button_text:eop.i18n.upload_btn_choice,button_text_style:".theFont { font-size: 16; }",button_text_left_padding:2,button_text_top_padding:3,file_queued_handler:this.fileQueued,file_queue_error_handler:this.fileQueueError,file_dialog_complete_handler:this.fileDialogComplete,upload_start_handler:this.uploadStart,upload_progress_handler:this.uploadProgress,upload_error_handler:this.uploadError,upload_success_handler:this.uploadSuccess,upload_complete_handler:this.uploadComplete,queue_complete_handler:this.queueComplete};this.swfu=new SWFUpload(this.settings);$.eventBus.bind("albumdeleted",function(e,data){var list=$("#setId")[0].options;var index=0;for(var i=0;i<list.length;i++){if(list[index++].value==data){break;}}
$("#setId")[0].remove(index-1);});$.eventBus.bind("albumsaved",function(e,data){if($("#setId").length>0){var label=data.split(":")[0];var value=data.split(":")[1];var list=$("#setId")[0].add(new Option(label,value),null);$("#setId")[0].selectedIndex=$("#setId")[0].options.length-1;}});}
if(act=='edit'||act=='next'||act=='previous'){this.trans=false;$("#imageholder").bind("mouseover",this.displayExtra)
$("#imageholder").bind("mouseout",this.hideExtra)
$("#nextimage").bind("click",eop.bind(this.nextImage,this));$("#previousimage").bind("click",eop.bind(this.previousImage,this));}
if(act=='slide'||act=='xdisplay'){var fo=new SWFObject(eop.i18n.http_server+"/viewer/autoviewer.swf","slideshowcontainer","790px","600px","8","#181818");fo.addVariable("xmlURL",eop.i18n.applicationserver+"image/gallery/"+$('#flashcontent').attr("albumid"));fo.write("flashcontent");eop.hideSpinner();}
if(act=='delete'){if(code==1001){$("#image_"+p).remove();}}},nextImage:function(){this.destroy();eop.sendRequest("next","image","id="+$("#imageid").val()+"&setid="+$("#setId").val(),"GET");},previousImage:function(){this.destroy();eop.sendRequest("previous","image","id="+$("#imageid").val()+"&setid="+$("#setId").val(),"GET");},destroy:function(){$("#nextimage").unbind("click");$("#previousimage").unbind("click");$("#imageholder").unbind("mouseover");$("#imageholder").unbind("mouseout");},displaySetImage:function(e){var s=e.currentTarget.id;if(this.currentSet){$("#"+this.currentSet).removeClass("selected");}
this.currentSet=s;var id=s.replace("_title","");$("#imagespinnerContainer").show();eop.sendRequest("list","image","id="+id,"GET","xhr_response_data");$("#list_container").html("");$("#"+s).addClass("selected");},clickonmovie:function(e){if(e.screenY-$('#slideshowcontainer').offset().top>400)
{this.stopRating();}else{if(e.clientX>600)
this.currentIndex=this.currentIndex>pic_list.length-1?0:this.currentIndex--;else
this.currentIndex=this.currentIndex<0?pic_list.length-1:this.currentIndex--;this.initRate();this.updateRate();}},rater:function(){$('#starcontainer').bind('mouseout',eop.bind(this.resetrate,this));this.resetValues=[];for(var i=1;i<6;i++){$('#star'+i).bind('mouseover',eop.bind(this.changerate,{id:i,that:this}));$('#star'+i).bind('click',eop.bind(this.validaterate,{id:i,that:this}));}},stopRating:function(){this.initRate();$('#starsoverlay').show();for(var i=1;i<6;i++){$('#star'+i).unbind('mouseover');$('#star'+i).unbind('click');}
$('#starcontainer').unbind('mouseout');},initRate:function(){for(var i=1;i<6;i++){$('#star'+i).removeClass("star").removeClass("halfstar");}},updateRate:function(){var r=pic_list[this.currentIndex].rate;for(var i=1;i<6;i++){if(r>1)
this.resetValues[i]=$('#star'+i).addClass("star");else
if(r>0){this.resetValues[i]=$('#star'+i).addClass("halfstar");}
this.resetValues[i]=$('#star'+i)[0].className;r--;}
$('#shotdate').html(pic_list[this.currentIndex].shotdate);$('#picname').html(pic_list[this.currentIndex].name);$('#author').html(pic_list[this.currentIndex].author);},resetrate:function(){for(var i=1;i<6;i++){$('#star'+i)[0].className=this.resetValues[i];}},changerate:function(e){this.that.initRate();for(var i=1;i<this.id+1;i++){$('#star'+i).addClass("star");}},validaterate:function(){eop.sendRequest('rate','image','id='+pic_list[this.that.currentIndex].split('|')[0]+'&rate='+this.id,'GET',true);},displayExtra:function(){if(!this.trans){var h=$('#extrainfodata').html();var d="";try{eval("var o="+h);}catch(e){return;}
for(var i in o){d+=i+" : "+o[i]+"<br />";}
this.trans=true;$('#extrainfodata').html(d);}
$('#extrainfo').show();},hideExtra:function(){$('#extrainfo').hide();},fileQueued:function(file){try{if($("#setId").val()==""||$("#title").val()==""){eop.alert(eop.i18n.imagemandatoryfield);this.cancelQueue();return false;}else{this.addPostParam("setId",$("#setId").val());this.addPostParam("title",$("#title").val());this.addPostParam("shotdate",$("#shotdate").val());this.addPostParam("description",$("#description").val());this.addPostParam("tags",$("#tags").val());}
var progress=new FileProgress(file,this.customSettings.progressTarget);progress.setStatus("Pending...");progress.toggleCancel(true,this);}catch(ex){eop.log("error","Queueing failed... ",ex);}},fileQueueError:function(file,errorCode,message){try{if(errorCode===SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED){alert("You have attempted to queue too many files.\n"+(message===0?"You have reached the upload limit.":"You may select "+(message>1?"up to "+message+" files.":"one file.")));return;}
var progress=new FileProgress(file,this.customSettings.progressTarget);progress.setError();progress.toggleCancel(false);switch(errorCode){case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT:progress.setStatus(eop.i18n.filetoobig);eop.log("debug","Error Code: File too big, File name: "+file.name+", File size: "+file.size+", Message: "+message);break;case SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE:progress.setStatus(eop.i18n.zerokbfile);eop.log("debug","Error Code: Zero byte file, File name: "+file.name+", File size: "+file.size+", Message: "+message);break;case SWFUpload.QUEUE_ERROR.INVALID_FILETYPE:progress.setStatus(eop.i18n.wrongfiletype);eop.log("debug","Error Code: Invalid File Type, File name: "+file.name+", File size: "+file.size+", Message: "+message);break;default:if(file!==null){progress.setStatus(eop.i18n.unhandleerror);eop.log("debug","Error Code: "+errorCode+", File name: "+file.name+", File size: "+file.size+", Message: "+message);}else
{eop.log("debug","Can't load file");}
break;}}catch(ex){eop.log("error","Queue error... ",ex);}},fileDialogComplete:function(numFilesSelected,numFilesQueued){try{if(numFilesSelected>0){document.getElementById(this.customSettings.cancelButtonId).disabled=false;}
this.startUpload();}catch(ex){eop.log("error","Upload startup failed... ",ex);}},uploadStart:function(file){try{var progress=new FileProgress(file,this.customSettings.progressTarget);progress.setStatus(eop.i18n.uploading);progress.toggleCancel(true,this);}
catch(ex){eop.log("error","Erreur during upload file... ",ex);}
return true;},uploadProgress:function(file,bytesLoaded,bytesTotal){try{var percent=Math.ceil((bytesLoaded/bytesTotal)*100);var progress=new FileProgress(file,this.customSettings.progressTarget);progress.setProgress(percent);progress.setStatus(eop.i18n.uploading);}catch(ex){eop.log("error","Erreur during progress update... ",ex);}},uploadError:function(file,errorCode,message){try{var progress=new FileProgress(file,this.customSettings.progressTarget);progress.setError();progress.toggleCancel(false);switch(errorCode){case SWFUpload.UPLOAD_ERROR.HTTP_ERROR:progress.setStatus("Upload Error: "+message);eop.log("debug","Error Code: HTTP Error, File name: "+file.name+", Message: "+message);break;case SWFUpload.UPLOAD_ERROR.UPLOAD_FAILED:progress.setStatus(eop.i18n.uploadfailed);eop.log("debug","Error Code: Upload Failed, File name: "+file.name+", File size: "+file.size+", Message: "+message);break;case SWFUpload.UPLOAD_ERROR.IO_ERROR:progress.setStatus("Server (IO) Error");eop.log("debug","Error Code: IO Error, File name: "+file.name+", Message: "+message);break;case SWFUpload.UPLOAD_ERROR.SECURITY_ERROR:progress.setStatus("Security Error");eop.log("debug","Error Code: Security Error, File name: "+file.name+", Message: "+message);break;case SWFUpload.UPLOAD_ERROR.UPLOAD_LIMIT_EXCEEDED:progress.setStatus(eop.i18n.exceeduploadlim);eop.log("debug","Error Code: Upload Limit Exceeded, File name: "+file.name+", File size: "+file.size+", Message: "+message);break;case SWFUpload.UPLOAD_ERROR.FILE_VALIDATION_FAILED:progress.setStatus("Failed Validation.  Upload skipped.");eop.log("debug","Error Code: File Validation Failed, File name: "+file.name+", File size: "+file.size+", Message: "+message);break;case SWFUpload.UPLOAD_ERROR.FILE_CANCELLED:if(this.getStats().files_queued===0){document.getElementById(this.customSettings.cancelButtonId).disabled=true;}
progress.setStatus(eop.i18n.uploadcanceled);progress.setCancelled();break;case SWFUpload.UPLOAD_ERROR.UPLOAD_STOPPED:progress.setStatus(eop.i18n.uploadstopped);break;default:progress.setStatus(eop.i18n.unhandleerror+errorCode);eop.log("debug","Error Code: "+errorCode+", File name: "+file.name+", File size: "+file.size+", Message: "+message);break;}}catch(ex){eop.log("error","Erreur during upload... ",ex);}},uploadSuccess:function(file,serverData){try{eop.addMessage(serverData);eop.showMessage('info');var progress=new FileProgress(file,this.customSettings.progressTarget);progress.setComplete();progress.setStatus(eop.i18n.uploadcomplet);progress.toggleCancel(false);}catch(ex){eop.log("error","Erreur during uploadSuccess... ",ex);}},uploadComplete:function(file){if(this.getStats().files_queued===0){document.getElementById(this.customSettings.cancelButtonId).disabled=true;}},queueComplete:function(numFilesUploaded){var status=document.getElementById("divStatus");status.innerHTML=numFilesUploaded+" file"+(numFilesUploaded===1?" ":" s ")+eop.i18n.uploaded;}}
if(!eop)var eop={};eop.album={init:function(act,p,code){if(act=='edit'){$('#createpoi').click(this.createPoi);$('#trashset').click(eop.bind(this.remove,this));$('#setcredid').change(this.changestate);$("#setcontentlnk").click(this.toggleContent);this.commonEdt();}
if(act=='remimg'){if(code==1001){$("#image_"+p).remove();}}
if(act=='slide'){}
if(act==undefined||act=='list'){$('#albumfilterbycred').change(this.filterByCred);$('#albumfilterbypoi').change(this.filterByPoi);$('#albumsortbydate').change(this.sortByDate);$('#albumsortbyname').change(this.sortByName);}
if(act=='filter'){eop.hideSpinner();}
if(act=='create'){this.commonEdt();}
if(act=='delete'){$.eventBus.trigger("albumdeleted",p);}
if(act=='save'){$.eventBus.trigger("albumsaved",p);}},destroy:function(action){if(action=='edit'){$('#createpoi').unbind('click');$('#trashset').unbind('click');$('#setcredid').unbind('change');$("#setcontentlnk").unbind('click');$('.submitbutton').unbind('click');$('#poi_id').unbind('change');}
if(action=='list'){$('#albumfilterbycred').unbind('change');$('#albumfilterbypoi').unbind('change');$('#albumsortbydate').unbind('change');$('#albumsortbyname').unbind('change');}},sortByDate:function(){eop.showSpinner();eop.sendRequest('list','set','sort=date&order='+$('#albumsortbydate').val(),'GET',"albumcontainer");},sortByName:function(){eop.showSpinner();eop.sendRequest('list','set','sort=name&order='+$('#albumsortbyname').val(),'GET',"albumcontainer");},filterByCred:function(){eop.showSpinner();eop.sendRequest('list','set','filter=credential&credential='+$('#albumfilterbycred').val(),'GET',"albumcontainer");},filterByPoi:function(){eop.showSpinner();eop.sendRequest('list','set','filter=poi&poi='+$('#albumfilterbypoi').val(),'GET',"albumcontainer");},commonEdt:function(){eop.hideSpinner();eop.map.poidisplay(this.poidisplay,eop.set,"small");$('.submitbutton').click(this.submitForm);$('#poi_id').change(this.changePoi);},submitForm:function(){if(validateForm($('#albumForm')[0])){$('#albumForm')[0].onsubmit();}},poidisplay:function(){},changePoi:function(){},changestate:function(){if($('#setcredid').val()==2)
var url=eop.i18n.applicationserver+'set/shared/'+$('#setid').val();else
var url=eop.i18n.applicationserver+'set/unshared/'+$('#setid').val();$.ajax({type:"POST",url:url,success:function(data){$('#sharedurl')[0].innerHTML=data;},error:function(data){eop.errMng.req(data,'set','shared');}});},cbChangestate:function(){},toggleContent:function(){$('#setcontent').toggleClass('open').toggleClass('close');},remove:function(){eop.showSpinner();eop.showAlert(eop.i18n.confirm,eop.i18n.setareyousure,eop.i18n.confirm,eop.i18n.cancel,this.cbremove,this.cbcancel);},cbremove:function(){var id=$('#setid').val();eop.sendRequest('delete','set','id='+id,'POST');},cbcancel:function(){eop.hideSpinner();},createPoi:function(){this.isValid=false;eop.dialog.popup(eop.bind(this.popupopen,this),eop.bind(this.popupclose,this));},popupopen:function(){$('#target_btn').click(eop.bind(this.addPoint,this));$('#poiname').blur(eop.bind(this.addressLookup,this));$('#poibtncreate').click(eop.bind(this.checkform,this));},popupclose:function(){eop.dialog.destroy();},addPoint:function(x,y){eop.map.hideAll();if(this.m){x=$('#lattitude').val();y=$('#longitude').val();eop.map.movePoint(this.m,x!=""?x:undefined,y!=""?y:undefined);}else{if(x!=undefined)
this.m=eop.map.addPoint(y,x,"set",true,"small",$('#poiname').val());else
this.m=eop.map.addPoint(undefined,undefined,type,true,"small",$('#poiname').val());eop.map.addMarkerEvent(this.m,"dragend",this.updateData,this);eop.map.addMapEvent("zoomend",this.updateData,this);}
return this.m;},updateData:function(point){if(typeof point=='number')
$('#zoom').val(point);else{$('#longitude').val(point.x);$('#lattitude').val(point.y);$('#zoom').val(eop.map.getZoom("small"));}},addressLookup:function(){var add=$('#poiname').val();if(add!="")
eop.map.geolocAddress(add,eop.bind(this.geoloc,this));},geoloc:function(point){if(!point){eop.errMng.display(eop.i18n.poinotlocalized,$('#poiname').val());this.activPoi=this.addPoint();}else{eop.map.setCenter(point,8,"small");this.updateData(point);this.activPoi=this.addPoint(point.x,point.y);}},xhrSetList:function(e){var url=eop.i18n.applicationserver+'poi/setlist/'+e.i;this.activPoi=e.m;$.ajax({type:"POST",url:url,success:function(data){eop.map.addMarkerEvent(e.m,"infowindowopen",this.openPoi,eop.poi);e.m.openInfoWindowHtml(data);},error:function(data){eop.errMng.req(data,'poi','setlist');}});},openPoi:function(){eop.start('set','slide');}};
if(!eop)var eop={};eop.poi={activPoi:null,init:function(act,args){this.args=args;if(act==undefined||act=='list'){eop.map.poidisplay(this.xhrEdit,this,undefined,"mappoilist","listpoilist");}
if(act=='create'){this.isValid=false;eop.dialog.popup(eop.bind(this.popupopen,this),eop.bind(this.popupclose,this));}
if(act=='edit'){eop.map.addMarkerEvent(this.activPoi,"infowindowclose",this.unbind,this);eop.map.addMarkerEvent(this.activPoi,"dragend",this.updateData,this);}
if(act=='update'||act=='save'){eop.map.showAll();}
if(act=='delete'){var m=eop.map.hidePoint(args);eop.map.removeMarker(m);eop.map.showAll();}
if(act=='save'){this.m.disableDragging();if(this.args!=undefined&&this.args.openMarker)
eop.map.addMarkerEvent(this.m,'click',eop.bind(this.args.openMarker,this.args.obj,{m:this.m,poiid:$('#createdpoiid')[0].innerHTML}));}},popupopen:function(){$('#target_btn').click(eop.bind(this.addPoint,this));$('#poiname').blur(eop.bind(this.addressLookup,this));$('#poibtncreate').click(eop.bind(this.checkform,this));},popupclose:function(){eop.dialog.destroy();},checkform:function(){this.isValid=true;eop.dialog.close();},unbind:function(){eop.map.remMarkerEvent(this.activPoi,"dragend",this.updateData);eop.map.remMarkerEvent(this.activPoi,"infowindowclose",this.unbind);},xhrEdit:function(e){var url=eop.i18n.applicationserver+'poi/show/'+e.i;this.activPoi=e.m;$.ajax({type:"POST",url:url,success:function(data){eop.map.addMarkerEvent(e.m,"infowindowopen",this.openEdit,this);e.m.openInfoWindowHtml(data);},error:function(){eop.AjaxMngr('poi','edit',arguments);}});},openEdit:function(){eop.start('poi','edit');},mapClicked:function(e){e.openInfoWindowHtml("this is a test ");},addPoint:function(x,y){eop.map.hideAll();var type='poi';if(this.args!=undefined)type=this.args.type;if(this.m){x=$('#lattitude').val();y=$('#longitude').val();eop.map.movePoint(this.m,x!=""?x:undefined,y!=""?y:undefined);}else{if(x!=undefined)
this.m=eop.map.addPoint(y,x,type,true);else
this.m=eop.map.addPoint(undefined,undefined,type,true);eop.map.addMarkerEvent(this.m,"dragend",this.updateData,this);eop.map.addMapEvent("zoomend",this.updateData,this);}
return this.m;},updateData:function(point){if(typeof point=='number')
$('#zoom').val(point);else{$('#longitude').val(point.x);$('#lattitude').val(point.y);$('#zoom').val(eop.map.getZoom());}},addressLookup:function(){var add=$('#poiname').val();if(add!="")
eop.map.geolocAddress(add,eop.bind(this.geoloc,this));},geoloc:function(point){if(!point){eop.errMng.display(eop.i18n.poinotlocalized,$('#poiname').val());this.activPoi=this.addPoint();}else{eop.map.setCenter(point,8);this.updateData(point);this.activPoi=this.addPoint(point.x,point.y);}},getPoiContent:function(e){var url=eop.i18n.applicationserver+'poi/setlist/'+e.i;this.activPoi=e.m;$.ajax({type:"POST",url:url,success:function(data){eop.map.addMarkerEvent(e.m,"infowindowopen",this.openPoi,eop.poi);e.m.openInfoWindowHtml(data);},error:function(data){eop.errMng.req(data,'poi','setlist');}});}}
if(!eop)var eop={};eop.search={init:function(act){if(act==undefined){$('#q').bind('click',eop.bind(this.hlptxttgl,this));$('#q').bind('blur',eop.bind(this.hlptxttgl,this));$('#q').bind('keypress',eop.bind(this.keySearch,this));$('#btnsearch').bind('click',eop.bind(this.search,this));$('#moreoptionslnk').bind('click',this.moreoptions);eop.map.poidisplay(eop.profile.display,eop.profile);$('#tagcloud').bind('click',this.tagclick)
this.val=null;$('#loginlnk').bind('click',this.displayloginform);$('#adminlnk').bind('click',this.displayadminlink);$('.language').bind('click',this.switchlang);$('.speclink').bind('click',this.requestLastChange);}
if(act=='tag'||act=='query'){var poilist=eop.getMessage();var end=poilist.indexOf('</div>')
if(end!=-1)
poilist=poilist.substring(poilist.indexOf('{'),poilist.indexOf('</div>'));if(poilist.trim()!=""){$('#poilist').html(poilist);eop.map.poidisplay(eop.profile.display,eop.profile);}}},requestLastChange:function(e){eop.showSpinner();var parameter=e.currentTarget.getAttribute("_href");eop.sendRequest("xdisplay",parameter.split("|")[0],"id="+parameter.split("|")[1],"GET","xhr_response");return false},switchlang:function(e){var loc=window.location;window.location.href=loc.protocol+"//"+loc.host+loc.pathname+"?lang="+e.currentTarget.id;},displayadminlink:function(){$('#adminlink').toggleClass("hidden");},displayloginform:function(){$('#loginform').toggleClass("hidden");$('#login').focus();},keySearch:function(e){if(e.which==13){this.search();}},search:function(){if(this.val==null){return;}
var q=$('#q').val();if($('#geoloc')[0].checked){eop.map.geolocAddress(q,eop.bind(this.geoloc,this));}
if($('#desc')[0].checked){var req="&desc=true";if($('#geoblog')[0].checked)req+="&blog=true";eop.sendRequest("query","search","q="+q+req,'GET');}},geoloc:function(point){if(point){eop.map.setCenter(point,8);}else{eop.map.setCenter();}},moreoptions:function(){$('#moreoptions').toggleClass("hidden");},hlptxttgl:function(){if(this.val!=null){if($('#q').val()==""){$('#q').val(this.val);this.val=null;}}else{this.val=$('#q').val();$('#q').val('');}},tagclick:function(e){eop.showSpinner();var tag=e.originalTarget.innerHTML;eop.sendRequest("tag","search","id="+tag,'GET');}};
eop.geoblog={init:function(act,p,code){if(act=='list'||act==undefined){$('#credential_id').change(this.filterCredential);$('#blog_type').change(this.filterBlogType);$('#bypoi').change(this.filterPoi);$('#bydate').change(this.sortByDate);}
if(act=='display'||act=='xdisplay'){eop.hideSpinner();$(".submitbutton").bind('click',this.addComment);}
if(act=='create'||act=='edit'){eop.map.poidisplay(eop.geoblog.poidisplay,eop.geoblog,"small");$("#poi_id").bind("change",eop.bind(this.updateMap,this));$("#sets").bind("change",eop.bind(this.updateImageList,this));$("#trashblog").bind("click",eop.bind(this.deleteBlog,this));$(".submitbutton").bind('click',this.submitform);}
if(act=='images'){eop.dialog.popup(eop.bind(this.openImageList,this),eop.bind(this.closeImageList,this));}
if(act=='comment'){this.cleanFields();eop.sendRequest('updated','geoblog','id='+$("#messageid").val(),'GET',"messagecomment");}},destroy:function(action){if(action=='list'||action==undefined){$('#credential_id').unbind('change');$('#blog_type').unbind('change');}
if(action=='create'||action=='edit'){$("#poi_id").unbind("change");$("#sets").unbind("change");$("#trashblog").unbind('click');}},submitform:function(){eop.fckUpdateEditorFormValue();if(validateForm($('#geoblogform')[0])){$('#geoblogform')[0].onsubmit();}},sortByDate:function(){eop.showSpinner();eop.sendRequest('list','geoblog','sort=date&order='+$('#bydate').val(),'GET',"blogcontainer");},filterCredential:function(){eop.showSpinner();eop.sendRequest('list','geoblog','filter=credential&credential='+$('#credential_id').val(),'GET',"blogcontainer");},filterBlogType:function(){eop.showSpinner();eop.sendRequest('list','geoblog','filter=type&type='+$('#blog_type').val(),'GET',"blogcontainer");},filterPoi:function(){eop.showSpinner();eop.sendRequest('list','geoblog','filter=poi&poi='+$('#bypoi').val(),'GET',"blogcontainer");},cleanFields:function(){$('#commentName').val('');$('#commentEmail').val('');$('#comment').val('');},addComment:function(){if(validateForm($('#commentForm')[0])){$('#commentForm')[0].onsubmit();}},deleteBlog:function(){eop.showSpinner();eop.showAlert(eop.i18n.confirm,eop.i18n.blogareyousure,eop.i18n.confirm,eop.i18n.cancel,this.cbremove,this.cbcancel);},cbremove:function(){var id=$('#blogid').val();eop.sendRequest('delete','geoblog','id='+id,'POST');},cbcancel:function(){eop.hideSpinner();},updateMap:function(){var id=$("#poi_id").val();eop.map.hideAll();eop.map.showPoint(id,"small",true);},pinpoint:function(){},close:function(){this.activMark.closeInfoWindow();},createPoi:function(){eop.start('poi','create',{type:'geoblog',openMarker:this.createMessage,obj:this});}};
if(!eop)var eop={};eop.param={};eop.param.init=function(act,p){if(act=='list'){eop.swichActions("param");}}
if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return"";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;
var SWFUpload;if(SWFUpload==undefined){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.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(url){if(typeof(url)!=="string"||url.match(/^https?:\/\//i)||url.match(/^\//)){return url;}
var currentURL=window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"");var indexSlash=window.location.pathname.lastIndexOf("/");if(indexSlash<=0){path="/";}else{path=window.location.pathname.substr(0,indexSlash)+"/";}
return path+url;};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("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;};SWFUpload.prototype.loadFlash=function(){var targetElement,tempParent;if(document.getElementById(this.movieName)!==null){throw"ID "+this.movieName+" is already in use. The Flash Object could not be added";}
targetElement=document.getElementById(this.settings.button_placeholder_id)||this.settings.button_placeholder;if(targetElement==undefined){throw"Could not find the placeholder element: "+this.settings.button_placeholder_id;}
tempParent=document.createElement("div");tempParent.innerHTML=this.getFlashHTML();targetElement.parentNode.replaceChild(tempParent.firstChild,targetElement);if(window[this.movieName]==undefined){window[this.movieName]=this.getMovieElement();}};SWFUpload.prototype.getFlashHTML=function(){return['<object id="',this.movieName,'" type="application/x-shockwave-flash" data="',this.settings.flash_url,'" width="',this.settings.button_width,'" height="',this.settings.button_height,'" class="swfupload">','<param name="wmode" value="',this.settings.button_window_mode,'" />','<param name="movie" value="',this.settings.flash_url,'" />','<param name="quality" value="high" />','<param name="menu" value="false" />','<param name="allowScriptAccess" value="always" />','<param name="flashvars" value="'+this.getFlashVars()+'" />','</object>'].join("");};SWFUpload.prototype.getFlashVars=function(){var paramString=this.buildParamString();var httpSuccessString=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(httpSuccessString),"&amp;assumeSuccessTimeout=",encodeURIComponent(this.settings.assume_success_timeout),"&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),"&amp;buttonImageURL=",encodeURIComponent(this.settings.button_image_url),"&amp;buttonWidth=",encodeURIComponent(this.settings.button_width),"&amp;buttonHeight=",encodeURIComponent(this.settings.button_height),"&amp;buttonText=",encodeURIComponent(this.settings.button_text),"&amp;buttonTextTopPadding=",encodeURIComponent(this.settings.button_text_top_padding),"&amp;buttonTextLeftPadding=",encodeURIComponent(this.settings.button_text_left_padding),"&amp;buttonTextStyle=",encodeURIComponent(this.settings.button_text_style),"&amp;buttonAction=",encodeURIComponent(this.settings.button_action),"&amp;buttonDisabled=",encodeURIComponent(this.settings.button_disabled),"&amp;buttonCursor=",encodeURIComponent(this.settings.button_cursor)].join("");};SWFUpload.prototype.getMovieElement=function(){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.cancelUpload(null,false);var movieElement=null;movieElement=this.getMovieElement();if(movieElement&&typeof(movieElement.CallFunction)==="unknown"){for(var i in movieElement){try{if(typeof(movieElement[i])==="function"){movieElement[i]=null;}}catch(ex1){}}
try{movieElement.parentNode.removeChild(movieElement);}catch(ex){}}
window[this.movieName]=null;SWFUpload.instances[this.movieName]=null;delete SWFUpload.instances[this.movieName];this.movieElement=null;this.settings=null;this.customSettings=null;this.eventQueue=null;this.movieName=null;return true;}catch(ex2){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","flash_url:                ",this.settings.flash_url,"\n","\t","use_query_string:         ",this.settings.use_query_string.toString(),"\n","\t","requeue_on_error:         ",this.settings.requeue_on_error.toString(),"\n","\t","http_success:             ",this.settings.http_success.join(", "),"\n","\t","assume_success_timeout:   ",this.settings.assume_success_timeout,"\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","debug:                    ",this.settings.debug.toString(),"\n","\t","prevent_swf_caching:      ",this.settings.prevent_swf_caching.toString(),"\n","\t","button_placeholder_id:    ",this.settings.button_placeholder_id.toString(),"\n","\t","button_placeholder:       ",(this.settings.button_placeholder?"Set":"Not Set"),"\n","\t","button_image_url:         ",this.settings.button_image_url.toString(),"\n","\t","button_width:             ",this.settings.button_width.toString(),"\n","\t","button_height:            ",this.settings.button_height.toString(),"\n","\t","button_text:              ",this.settings.button_text.toString(),"\n","\t","button_text_style:        ",this.settings.button_text_style.toString(),"\n","\t","button_text_top_padding:  ",this.settings.button_text_top_padding.toString(),"\n","\t","button_text_left_padding: ",this.settings.button_text_left_padding.toString(),"\n","\t","button_action:            ",this.settings.button_action.toString(),"\n","\t","button_disabled:          ",this.settings.button_disabled.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 movieElement=this.getMovieElement();var returnValue,returnString;try{returnString=movieElement.CallFunction('<invoke name="'+functionName+'" returntype="javascript">'+__flash__argumentsToXML(argumentArray,0)+'</invoke>');returnValue=eval(returnString);}catch(ex){throw"Call to "+functionName+" failed";}
if(returnValue!=undefined&&typeof returnValue.post==="object"){returnValue=this.unescapeFilePostParams(returnValue);}
return returnValue;};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,triggerErrorEvent){if(triggerErrorEvent!==false){triggerErrorEvent=true;}
this.callFlash("CancelUpload",[fileID,triggerErrorEvent]);};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.setHTTPSuccess=function(http_status_codes){if(typeof http_status_codes==="string"){http_status_codes=http_status_codes.replace(" ","").split(",");}
this.settings.http_success=http_status_codes;this.callFlash("SetHTTPSuccess",[http_status_codes]);};SWFUpload.prototype.setAssumeSuccessTimeout=function(timeout_seconds){this.settings.assume_success_timeout=timeout_seconds;this.callFlash("SetAssumeSuccessTimeout",[timeout_seconds]);};SWFUpload.prototype.setDebugEnabled=function(debugEnabled){this.settings.debug_enabled=debugEnabled;this.callFlash("SetDebugEnabled",[debugEnabled]);};SWFUpload.prototype.setButtonImageURL=function(buttonImageURL){if(buttonImageURL==undefined){buttonImageURL="";}
this.settings.button_image_url=buttonImageURL;this.callFlash("SetButtonImageURL",[buttonImageURL]);};SWFUpload.prototype.setButtonDimensions=function(width,height){this.settings.button_width=width;this.settings.button_height=height;var movie=this.getMovieElement();if(movie!=undefined){movie.style.width=width+"px";movie.style.height=height+"px";}
this.callFlash("SetButtonDimensions",[width,height]);};SWFUpload.prototype.setButtonText=function(html){this.settings.button_text=html;this.callFlash("SetButtonText",[html]);};SWFUpload.prototype.setButtonTextPadding=function(left,top){this.settings.button_text_top_padding=top;this.settings.button_text_left_padding=left;this.callFlash("SetButtonTextPadding",[left,top]);};SWFUpload.prototype.setButtonTextStyle=function(css){this.settings.button_text_style=css;this.callFlash("SetButtonTextStyle",[css]);};SWFUpload.prototype.setButtonDisabled=function(isDisabled){this.settings.button_disabled=isDisabled;this.callFlash("SetButtonDisabled",[isDisabled]);};SWFUpload.prototype.setButtonAction=function(buttonAction){this.settings.button_action=buttonAction;this.callFlash("SetButtonAction",[buttonAction]);};SWFUpload.prototype.setButtonCursor=function(cursor){this.settings.button_cursor=cursor;this.callFlash("SetButtonCursor",[cursor]);};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.testExternalInterface=function(){try{return this.callFlash("TestExternalInterface");}catch(ex){return false;}};SWFUpload.prototype.flashReady=function(){var movieElement=this.getMovieElement();if(!movieElement){this.debug("Flash called back ready but the flash movie can't be found.");return;}
this.cleanUp(movieElement);this.queueEvent("swfupload_loaded_handler");};SWFUpload.prototype.cleanUp=function(movieElement){try{if(this.movieElement&&typeof(movieElement.CallFunction)==="unknown"){this.debug("Removing Flash functions hooks (this should only run in IE and should prevent memory leaks)");for(var key in movieElement){try{if(typeof(movieElement[key])==="function"){movieElement[key]=null;}}catch(ex){}}}}catch(ex1){}
window["__flash__removeCallback"]=function(instance,name){try{if(instance){instance[name]=null;}}catch(flashEx){}};};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,numFilesInQueue){this.queueEvent("file_dialog_complete_handler",[numFilesSelected,numFilesQueued,numFilesInQueue]);};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,responseReceived){file=this.unescapeFilePostParams(file);this.queueEvent("upload_success_handler",[file,serverData,responseReceived]);};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 SWFUpload;if(typeof(SWFUpload)==="function"){SWFUpload.queue={};SWFUpload.prototype.initSettings=(function(oldInitSettings){return function(){if(typeof(oldInitSettings)==="function"){oldInitSettings.call(this);}
this.queueSettings={};this.queueSettings.queue_cancelled_flag=false;this.queueSettings.queue_upload_count=0;this.queueSettings.user_upload_complete_handler=this.settings.upload_complete_handler;this.queueSettings.user_upload_start_handler=this.settings.upload_start_handler;this.settings.upload_complete_handler=SWFUpload.queue.uploadCompleteHandler;this.settings.upload_start_handler=SWFUpload.queue.uploadStartHandler;this.settings.queue_complete_handler=this.settings.queue_complete_handler||null;};})(SWFUpload.prototype.initSettings);SWFUpload.prototype.startUpload=function(fileID){this.queueSettings.queue_cancelled_flag=false;this.callFlash("StartUpload",[fileID]);};SWFUpload.prototype.cancelQueue=function(){this.queueSettings.queue_cancelled_flag=true;this.stopUpload();var stats=this.getStats();while(stats.files_queued>0){this.cancelUpload();stats=this.getStats();}};SWFUpload.queue.uploadStartHandler=function(file){var returnValue;if(typeof(this.queueSettings.user_upload_start_handler)==="function"){returnValue=this.queueSettings.user_upload_start_handler.call(this,file);}
returnValue=(returnValue===false)?false:true;this.queueSettings.queue_cancelled_flag=!returnValue;return returnValue;};SWFUpload.queue.uploadCompleteHandler=function(file){var user_upload_complete_handler=this.queueSettings.user_upload_complete_handler;var continueUpload;if(file.filestatus===SWFUpload.FILE_STATUS.COMPLETE){this.queueSettings.queue_upload_count++;}
if(typeof(user_upload_complete_handler)==="function"){continueUpload=(user_upload_complete_handler.call(this,file)===false)?false:true;}else if(file.filestatus===SWFUpload.FILE_STATUS.QUEUED){continueUpload=false;}else{continueUpload=true;}
if(continueUpload){var stats=this.getStats();if(stats.files_queued>0&&this.queueSettings.queue_cancelled_flag===false){this.startUpload();}else if(this.queueSettings.queue_cancelled_flag===false){this.queueEvent("queue_complete_handler",[this.queueSettings.queue_upload_count]);this.queueSettings.queue_upload_count=0;}else{this.queueSettings.queue_cancelled_flag=false;this.queueSettings.queue_upload_count=0;}}};}
function FileProgress(file,targetID){this.fileProgressID=file.id;this.opacity=100;this.height=0;this.fileProgressWrapper=document.getElementById(this.fileProgressID);if(!this.fileProgressWrapper){this.fileProgressWrapper=document.createElement("div");this.fileProgressWrapper.className="progressWrapper";this.fileProgressWrapper.id=this.fileProgressID;this.fileProgressElement=document.createElement("div");this.fileProgressElement.className="progressContainer";var progressCancel=document.createElement("a");progressCancel.className="progressCancel";progressCancel.href="#";progressCancel.style.visibility="hidden";progressCancel.appendChild(document.createTextNode(" "));var progressText=document.createElement("div");progressText.className="progressName";progressText.appendChild(document.createTextNode(file.name));var progressBar=document.createElement("div");progressBar.className="progressBarInProgress";var progressStatus=document.createElement("div");progressStatus.className="progressBarStatus";progressStatus.innerHTML="&nbsp;";this.fileProgressElement.appendChild(progressCancel);this.fileProgressElement.appendChild(progressText);this.fileProgressElement.appendChild(progressStatus);this.fileProgressElement.appendChild(progressBar);this.fileProgressWrapper.appendChild(this.fileProgressElement);document.getElementById(targetID).appendChild(this.fileProgressWrapper);}else{this.fileProgressElement=this.fileProgressWrapper.firstChild;this.reset();}
this.height=this.fileProgressWrapper.offsetHeight;this.setTimer(null);}
FileProgress.prototype.setTimer=function(timer){this.fileProgressElement["FP_TIMER"]=timer;};FileProgress.prototype.getTimer=function(timer){return this.fileProgressElement["FP_TIMER"]||null;};FileProgress.prototype.reset=function(){this.fileProgressElement.className="progressContainer";this.fileProgressElement.childNodes[2].innerHTML="&nbsp;";this.fileProgressElement.childNodes[2].className="progressBarStatus";this.fileProgressElement.childNodes[3].className="progressBarInProgress";this.fileProgressElement.childNodes[3].style.width="0%";this.appear();};FileProgress.prototype.setProgress=function(percentage){this.fileProgressElement.className="progressContainer green";this.fileProgressElement.childNodes[3].className="progressBarInProgress";this.fileProgressElement.childNodes[3].style.width=percentage+"%";this.appear();};FileProgress.prototype.setComplete=function(){this.fileProgressElement.className="progressContainer blue";this.fileProgressElement.childNodes[3].className="progressBarComplete";this.fileProgressElement.childNodes[3].style.width="";var oSelf=this;this.setTimer(setTimeout(function(){oSelf.disappear();},10000));};FileProgress.prototype.setError=function(){this.fileProgressElement.className="progressContainer red";this.fileProgressElement.childNodes[3].className="progressBarError";this.fileProgressElement.childNodes[3].style.width="";var oSelf=this;this.setTimer(setTimeout(function(){oSelf.disappear();},5000));};FileProgress.prototype.setCancelled=function(){this.fileProgressElement.className="progressContainer";this.fileProgressElement.childNodes[3].className="progressBarError";this.fileProgressElement.childNodes[3].style.width="";var oSelf=this;this.setTimer(setTimeout(function(){oSelf.disappear();},2000));};FileProgress.prototype.setStatus=function(status){this.fileProgressElement.childNodes[2].innerHTML=status;};FileProgress.prototype.toggleCancel=function(show,swfUploadInstance){this.fileProgressElement.childNodes[0].style.visibility=show?"visible":"hidden";if(swfUploadInstance){var fileID=this.fileProgressID;this.fileProgressElement.childNodes[0].onclick=function(){swfUploadInstance.cancelUpload(fileID);return false;};}};FileProgress.prototype.appear=function(){if(this.getTimer()!==null){clearTimeout(this.getTimer());this.setTimer(null);}
if(this.fileProgressWrapper.filters){try{this.fileProgressWrapper.filters.item("DXImageTransform.Microsoft.Alpha").opacity=100;}catch(e){this.fileProgressWrapper.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity=100)";}}else{this.fileProgressWrapper.style.opacity=1;}
this.fileProgressWrapper.style.height="";this.height=this.fileProgressWrapper.offsetHeight;this.opacity=100;this.fileProgressWrapper.style.display="";};FileProgress.prototype.disappear=function(){var reduceOpacityBy=15;var reduceHeightBy=4;var rate=30;if(this.opacity>0){this.opacity-=reduceOpacityBy;if(this.opacity<0){this.opacity=0;}
if(this.fileProgressWrapper.filters){try{this.fileProgressWrapper.filters.item("DXImageTransform.Microsoft.Alpha").opacity=this.opacity;}catch(e){this.fileProgressWrapper.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity="+this.opacity+")";}}else{this.fileProgressWrapper.style.opacity=this.opacity/100;}}
if(this.height>0){this.height-=reduceHeightBy;if(this.height<0){this.height=0;}
this.fileProgressWrapper.style.height=this.height+"px";}
if(this.height>0||this.opacity>0){var oSelf=this;this.setTimer(setTimeout(function(){oSelf.disappear();},rate));}else{this.fileProgressWrapper.style.display="none";this.setTimer(null);}};