try{var swfobject=function(){function P(){if(l){i();}else{m();}}var O="undefined",j="object",g="Shockwave Flash",H="ShockwaveFlash.ShockwaveFlash",R="application/x-shockwave-flash",a="SWFObjectExprInst",D="onreadystatechange",J=window,W=document,p=navigator,l=false,B=[P],S=[],K=[],X=[],h,u,r,o,q=false,w=false,E,U,d=true,Q=function(){var Ad=typeof W.getElementById!=O&&typeof W.getElementsByTagName!=O&&typeof W.createElement!=O,Ag=p.userAgent.toLowerCase(),Ae=p.platform.toLowerCase(),Ah=Ae?/win/.test(Ae):/win/.test(Ag),x=Ae?/mac/.test(Ae):/mac/.test(Ag),y=/webkit/.test(Ag)?parseFloat(Ag.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,Ab=!+"\v1",Af=[0,0,0],Ac=null;if(typeof p.plugins!=O&&typeof p.plugins[g]==j){Ac=p.plugins[g].description;if(Ac&&!(typeof p.mimeTypes!=O&&p.mimeTypes[R]&&!p.mimeTypes[R].enabledPlugin)){l=true;Ab=false;Ac=Ac.replace(/^.*\s+(\S+\s+\S+$)/,"$1");Af[0]=parseInt(Ac.replace(/^(.*)\..*$/,"$1"),10);Af[1]=parseInt(Ac.replace(/^.*\.(.*)\s.*$/,"$1"),10);Af[2]=/[a-zA-Z]/.test(Ac)?parseInt(Ac.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0;}}else{if(typeof J.ActiveXObject!=O){try{var Aa=new ActiveXObject(H);if(Aa){Ac=Aa.GetVariable("$version");if(Ac){Ab=true;Ac=Ac.split(" ")[1].split(",");Af=[parseInt(Ac[0],10),parseInt(Ac[1],10),parseInt(Ac[2],10)];}}}catch(z){}}}return{w3:Ad,pv:Af,wk:y,ie:Ab,win:Ah,mac:x};}(),e=function(){if(!Q.w3){return;}if((typeof W.readyState!=O&&W.readyState=="complete")||(typeof W.readyState==O&&(W.getElementsByTagName("body")[0]||W.body))){c();}if(!q){if(typeof W.addEventListener!=O){W.addEventListener("DOMContentLoaded",c,false);}if(Q.ie&&Q.win){W.attachEvent(D,function(){if(W.readyState=="complete"){W.detachEvent(D,arguments.callee);c();}});if(J==top){(function(){if(q){return;}try{W.documentElement.doScroll("left");}catch(x){setTimeout(arguments.callee,0);return;}c();})();}}if(Q.wk){(function(){if(q){return;}if(!/loaded|complete/.test(W.readyState)){setTimeout(arguments.callee,0);return;}c();})();}Z(c);}}();function c(){if(q){return;}try{var y=W.getElementsByTagName("body")[0].appendChild(b("span"));y.parentNode.removeChild(y);}catch(Aa){return;}q=true;var x=B.length;for(var z=0;z<x;z++){B[z]();}}function C(x){if(q){x();}else{B[B.length]=x;}}function Z(x){if(typeof J.addEventListener!=O){J.addEventListener("load",x,false);}else{if(typeof W.addEventListener!=O){W.addEventListener("load",x,false);}else{if(typeof J.attachEvent!=O){F(J,"onload",x);}else{if(typeof J.onload=="function"){var y=J.onload;J.onload=function(){y();x();};}else{J.onload=x;}}}}}function i(){var z=W.getElementsByTagName("body")[0];var y=b(j);y.setAttribute("type",R);var Aa=z.appendChild(y);if(Aa){var x=0;(function(){if(typeof Aa.GetVariable!=O){var Ab=Aa.GetVariable("$version");if(Ab){Ab=Ab.split(" ")[1].split(",");Q.pv=[parseInt(Ab[0],10),parseInt(Ab[1],10),parseInt(Ab[2],10)];}}else{if(x<10){x++;setTimeout(arguments.callee,10);return;}}z.removeChild(y);Aa=null;m();})();}else{m();}}function m(){var Af=S.length;if(Af>0){for(var Ah=0;Ah<Af;Ah++){var y=S[Ah].id;var Ag=S[Ah].callbackFn;var Ae={success:false,id:y};if(Q.pv[0]>0){var x=G(y);if(x){if(L(S[Ah].swfVersion)&&!(Q.wk&&Q.wk<312)){v(y,true);if(Ag){Ae.success=true;Ae.ref=T(y);Ag(Ae);}}else{if(S[Ah].expressInstall&&k()){var z={};z.data=S[Ah].expressInstall;z.width=x.getAttribute("width")||"0";z.height=x.getAttribute("height")||"0";if(x.getAttribute("class")){z.styleclass=x.getAttribute("class");}if(x.getAttribute("align")){z.align=x.getAttribute("align");}var Ac={};var Ab=x.getElementsByTagName("param");var Ad=Ab.length;for(var Ai=0;Ai<Ad;Ai++){if(Ab[Ai].getAttribute("name").toLowerCase()!="movie"){Ac[Ab[Ai].getAttribute("name")]=Ab[Ai].getAttribute("value");}}A(z,Ac,y,Ag);}else{f(x);if(Ag){Ag(Ae);}}}}}else{v(y,true);if(Ag){var Aa=T(y);if(Aa&&typeof Aa.SetVariable!=O){Ae.success=true;Ae.ref=Aa;}Ag(Ae);}}}}}function T(Aa){var x=null;var z=G(Aa);if(z&&z.nodeName=="OBJECT"){if(typeof z.SetVariable!=O){x=z;}else{var y=z.getElementsByTagName(j)[0];if(y){x=y;}}}return x;}function k(){return !w&&L("6.0.65")&&(Q.win||Q.mac)&&!(Q.wk&&Q.wk<312);}function A(Ac,Ab,Ad,Ae){w=true;r=Ae||null;o={success:false,id:Ad};var x=G(Ad);if(x){if(x.nodeName=="OBJECT"){h=s(x);u=null;}else{h=x;u=Ad;}Ac.id=a;if(typeof Ac.width==O||(!/%$/.test(Ac.width)&&parseInt(Ac.width,10)<310)){Ac.width="310";}if(typeof Ac.height==O||(!/%$/.test(Ac.height)&&parseInt(Ac.height,10)<137)){Ac.height="137";}W.title=W.title.slice(0,47)+" - Flash Player Installation";var Aa=Q.ie&&Q.win?"ActiveX":"PlugIn",z="MMredirectURL="+J.location.toString().replace(/&/g,"%26")+"&MMplayerType="+Aa+"&MMdoctitle="+W.title;if(typeof Ab.flashvars!=O){Ab.flashvars+="&"+z;}else{Ab.flashvars=z;}if(Q.ie&&Q.win&&x.readyState!=4){var y=b("div");Ad+="SWFObjectNew";y.setAttribute("id",Ad);x.parentNode.insertBefore(y,x);x.style.display="none";(function(){if(x.readyState==4){x.parentNode.removeChild(x);}else{setTimeout(arguments.callee,10);}})();}Y(Ac,Ab,Ad);}}function f(y){if(Q.ie&&Q.win&&y.readyState!=4){var x=b("div");y.parentNode.insertBefore(x,y);x.parentNode.replaceChild(s(y),x);y.style.display="none";(function(){if(y.readyState==4){y.parentNode.removeChild(y);}else{setTimeout(arguments.callee,10);}})();}else{y.parentNode.replaceChild(s(y),y);}}function s(Ac){var Ab=b("div");if(Q.win&&Q.ie){Ab.innerHTML=Ac.innerHTML;}else{var z=Ac.getElementsByTagName(j)[0];if(z){var Aa=z.childNodes;if(Aa){var x=Aa.length;for(var y=0;y<x;y++){if(!(Aa[y].nodeType==1&&Aa[y].nodeName=="PARAM")&&!(Aa[y].nodeType==8)){Ab.appendChild(Aa[y].cloneNode(true));}}}}}return Ab;}function Y(Ai,Ac,y){var Ag,Ad=G(y);if(Q.wk&&Q.wk<312){return Ag;}if(Ad){if(typeof Ai.id==O){Ai.id=y;}if(Q.ie&&Q.win){var z="";for(var x in Ai){if(Ai[x]!=Object.prototype[x]){if(x.toLowerCase()=="data"){Ac.movie=Ai[x];}else{if(x.toLowerCase()=="styleclass"){z+=' class="'+Ai[x]+'"';}else{if(x.toLowerCase()!="classid"){z+=" "+x+'="'+Ai[x]+'"';}}}}}var Ae="";for(var Af in Ac){if(Ac[Af]!=Object.prototype[Af]){Ae+='<param name="'+Af+'" value="'+Ac[Af]+'" />';}}Ad.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+z+">"+Ae+"</object>";K[K.length]=Ai.id;Ag=G(Ai.id);}else{var Ah=b(j);Ah.setAttribute("type",R);for(var Aa in Ai){if(Ai[Aa]!=Object.prototype[Aa]){if(Aa.toLowerCase()=="styleclass"){Ah.setAttribute("class",Ai[Aa]);}else{if(Aa.toLowerCase()!="classid"){Ah.setAttribute(Aa,Ai[Aa]);}}}}for(var Ab in Ac){if(Ac[Ab]!=Object.prototype[Ab]&&Ab.toLowerCase()!="movie"){n(Ah,Ab,Ac[Ab]);}}Ad.parentNode.replaceChild(Ah,Ad);Ag=Ah;}}return Ag;}function n(x,z,y){var Aa=b("param");Aa.setAttribute("name",z);Aa.setAttribute("value",y);x.appendChild(Aa);}function t(x){var y=G(x);if(y&&y.nodeName=="OBJECT"){if(Q.ie&&Q.win){y.style.display="none";(function(){if(y.readyState==4){M(x);}else{setTimeout(arguments.callee,10);}})();}else{y.parentNode.removeChild(y);}}}function M(y){var z=G(y);if(z){for(var x in z){if(typeof z[x]=="function"){z[x]=null;}}z.parentNode.removeChild(z);}}function G(z){var x=null;try{x=W.getElementById(z);}catch(y){}return x;}function b(x){return W.createElement(x);}function F(z,y,x){z.attachEvent(y,x);X[X.length]=[z,y,x];}function L(z){var y=Q.pv,x=z.split(".");x[0]=parseInt(x[0],10);x[1]=parseInt(x[1],10)||0;x[2]=parseInt(x[2],10)||0;return(y[0]>x[0]||(y[0]==x[0]&&y[1]>x[1])||(y[0]==x[0]&&y[1]==x[1]&&y[2]>=x[2]))?true:false;}function I(Ac,Ab,z,Ad){if(Q.ie&&Q.mac){return;}var Aa=W.getElementsByTagName("head")[0];if(!Aa){return;}var x=(z&&typeof z=="string")?z:"screen";if(Ad){E=null;U=null;}if(!E||U!=x){var y=b("style");y.setAttribute("type","text/css");y.setAttribute("media",x);E=Aa.appendChild(y);if(Q.ie&&Q.win&&typeof W.styleSheets!=O&&W.styleSheets.length>0){E=W.styleSheets[W.styleSheets.length-1];}U=x;}if(Q.ie&&Q.win){if(E&&typeof E.addRule==j){E.addRule(Ac,Ab);}}else{if(E&&typeof W.createTextNode!=O){E.appendChild(W.createTextNode(Ac+" {"+Ab+"}"));}}}function v(z,x){if(!d){return;}var y=x?"visible":"hidden";if(q&&G(z)){G(z).style.visibility=y;}else{I("#"+z,"visibility:"+y);}}function N(x){var z=/[\\\"<>\.;]/;var y=z.exec(x)!==null;return y&&typeof encodeURIComponent!=O?encodeURIComponent(x):x;}var V=function(){if(Q.ie&&Q.win){window.attachEvent("onunload",function(){var y=X.length;for(var z=0;z<y;z++){X[z][0].detachEvent(X[z][1],X[z][2]);}var x=K.length;for(var Aa=0;Aa<x;Aa++){t(K[Aa]);}for(var Ab in Q){if(Q.hasOwnProperty(Ab)){Q[Ab]=null;}}Q=null;for(var Ac in swfobject){if(swfobject.hasOwnProperty(Ac)){swfobject[Ac]=null;}}swfobject=null;});}}();return{registerObject:function(Ab,z,Aa,y){if(Q.w3&&Ab&&z){var x={};x.id=Ab;x.swfVersion=z;x.expressInstall=Aa;x.callbackFn=y;S[S.length]=x;v(Ab,false);}else{if(y){y({success:false,id:Ab});}}},getObjectById:function(x){if(Q.w3){return T(x);}},embedSWF:function(Ac,Ad,Ae,Af,Aa,Ah,x,y,z,Ag){var Ab={success:false,id:Ad};if(Q.w3&&!(Q.wk&&Q.wk<312)&&Ac&&Ad&&Ae&&Af&&Aa){v(Ad,false);C(function(){Ae+="";Af+="";var Aj={};if(z&&typeof z===j){for(var Ak in z){if(z.hasOwnProperty(Ak)){Aj[Ak]=z[Ak];}}}Aj.data=Ac;Aj.width=Ae;Aj.height=Af;var An={};if(y&&typeof y===j){for(var Al in y){if(y.hasOwnProperty(Al)){An[Al]=y[Al];}}}if(x&&typeof x===j){for(var Am in x){if(typeof An.flashvars!=O){An.flashvars+="&"+Am+"="+x[Am];}else{An.flashvars=Am+"="+x[Am];}}}if(L(Aa)){var Ai=Y(Aj,An,Ad);if(Aj.id==Ad){v(Ad,true);}Ab.success=true;Ab.ref=Ai;}else{if(Ah&&k()){Aj.data=Ah;A(Aj,An,Ad,Ag);return;}else{v(Ad,true);}}if(Ag){Ag(Ab);}});}else{if(Ag){Ag(Ab);}}},switchOffAutoHideShow:function(){d=false;},ua:Q,getFlashPlayerVersion:function(){return{major:Q.pv[0],minor:Q.pv[1],release:Q.pv[2]};},hasFlashPlayerVersion:L,createSWF:function(z,x,y){if(Q.w3){return Y(z,x,y);}else{return undefined;}},showExpressInstall:function(z,Aa,y,x){if(Q.w3&&k()){A(z,Aa,y,x);}},removeSWF:function(x){if(Q.w3){t(x);}},createCSS:function(Aa,x,z,y){if(Q.w3){I(Aa,x,z,y);}},addDomLoadEvent:C,addLoadEvent:Z,getQueryParamValue:function(y){var Aa=W.location.search||W.location.hash;if(Aa){if(/\?/.test(Aa)){Aa=Aa.split("?")[1];}if(y===null){return N(Aa);}var x=Aa.split("&");for(var z=0;z<x.length;z++){if(x[z].substring(0,x[z].indexOf("="))==y){return N(x[z].substring((x[z].indexOf("=")+1)));}}}return"";},expressInstallCallback:function(){if(w){var x=G(a);if(x&&h){x.parentNode.replaceChild(h,x);if(u){v(u,true);if(Q.ie&&Q.win){h.style.display="block";}}if(r){r(o);}}w=false;}}};}();}catch(ex){}try{var SWFUpload;if(SWFUpload==undefined){SWFUpload=function(A){this.initSWFUpload(A);};}SWFUpload.prototype.initSWFUpload=function(A){try{this.customSettings={};this.settings={};this.eventQueue=[];this.movieName="SWFUpload_"+SWFUpload.movieCount++;this.movieElement=null;SWFUpload.instances[this.movieName]=this;this.initSettings(A);this.loadFlash();this.displayDebugInfo();}catch(B){delete SWFUpload.instances[this.movieName];throw B;}};SWFUpload.instances={};SWFUpload.movieCount=0;SWFUpload.version="2.2.1 2009-03-30";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,JAVASCRIPT:-130};SWFUpload.CURSOR={ARROW:-1,HAND:-2};SWFUpload.WINDOW_MODE={WINDOW:"window",TRANSPARENT:"transparent",OPAQUE:"opaque"};SWFUpload.completeURL=function(B){var C="";if(typeof(B)!=="string"||B.match(/^https?:\/\//i)||B.match(/^\//)||B===""){return B;}var A=document.location.pathname.lastIndexOf("/");if(A<=0){C="/";}else{C=document.location.pathname.substr(0,A)+"/";}return C+B;};SWFUpload.prototype.initSettings=function(A){this.ensureDefault=function(C,B){this.settings[C]=(A[C]==undefined)?B:A[C];};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","/Flash/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("button_action_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 B,A;if(document.getElementById(this.movieName)!==null){throw"ID "+this.movieName+" is already in use. The Flash Object could not be added";}B=document.getElementById(this.settings.button_placeholder_id)||this.settings.button_placeholder;if(B==undefined){throw"Could not find the placeholder element: "+this.settings.button_placeholder_id;}A=document.createElement("div");A.innerHTML=this.getFlashHTML();B.parentNode.replaceChild(A.firstChild,B);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 A=this.buildParamString();var B=this.settings.http_success.join(",");return["movieName=",encodeURIComponent(this.movieName),"&amp;uploadURL=",encodeURIComponent(this.settings.upload_url),"&amp;useQueryString=",encodeURIComponent(this.settings.use_query_string),"&amp;requeueOnError=",encodeURIComponent(this.settings.requeue_on_error),"&amp;httpSuccess=",encodeURIComponent(B),"&amp;assumeSuccessTimeout=",encodeURIComponent(this.settings.assume_success_timeout),"&amp;params=",encodeURIComponent(A),"&amp;filePostName=",encodeURIComponent(this.settings.file_post_name),"&amp;fileTypes=",encodeURIComponent(this.settings.file_types),"&amp;fileTypesDescription=",encodeURIComponent(this.settings.file_types_description),"&amp;fileSizeLimit=",encodeURIComponent(this.settings.file_size_limit),"&amp;fileUploadLimit=",encodeURIComponent(this.settings.file_upload_limit),"&amp;fileQueueLimit=",encodeURIComponent(this.settings.file_queue_limit),"&amp;debugEnabled=",encodeURIComponent(this.settings.debug_enabled),"&amp;buttonImageURL=",encodeURIComponent(this.settings.button_image_url),"&amp;buttonWidth=",encodeURIComponent(this.settings.button_width),"&amp;buttonHeight=",encodeURIComponent(this.settings.button_height),"&amp;buttonText=",encodeURIComponent(this.settings.button_text),"&amp;buttonTextTopPadding=",encodeURIComponent(this.settings.button_text_top_padding),"&amp;buttonTextLeftPadding=",encodeURIComponent(this.settings.button_text_left_padding),"&amp;buttonTextStyle=",encodeURIComponent(this.settings.button_text_style),"&amp;buttonAction=",encodeURIComponent(this.settings.button_action),"&amp;buttonDisabled=",encodeURIComponent(this.settings.button_disabled),"&amp;buttonCursor=",encodeURIComponent(this.settings.button_cursor)].join("");};SWFUpload.prototype.getMovieElement=function(){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 B=this.settings.post_params;var C=[];if(typeof(B)==="object"){for(var A in B){if(B.hasOwnProperty(A)){C.push(encodeURIComponent(A.toString())+"="+encodeURIComponent(B[A].toString()));}}}return C.join("&amp;");};SWFUpload.prototype.destroy=function(){try{this.cancelUpload(null,false);var B=null;B=this.getMovieElement();if(B&&typeof(B.CallFunction)==="unknown"){for(var C in B){try{if(typeof(B[C])==="function"){B[C]=null;}}catch(E){}}try{B.parentNode.removeChild(B);}catch(D){}}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(A){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(A,C,B){if(C==undefined){return(this.settings[A]=B);}else{return(this.settings[A]=C);}};SWFUpload.prototype.getSetting=function(A){if(this.settings[A]!=undefined){return this.settings[A];}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(A){this.callFlash("StartUpload",[A]);};SWFUpload.prototype.cancelUpload=function(A,B){if(B!==false){B=true;}this.callFlash("CancelUpload",[A,B]);};SWFUpload.prototype.stopUpload=function(){this.callFlash("StopUpload");};SWFUpload.prototype.requeueUpload=function(A){return this.callFlash("RequeueUpload",[A]);};SWFUpload.prototype.getStats=function(){return this.callFlash("GetStats");};SWFUpload.prototype.setStats=function(A){this.callFlash("SetStats",[A]);};SWFUpload.prototype.getFile=function(A){if(typeof(A)==="number"){return this.callFlash("GetFileByIndex",[A]);}else{return this.callFlash("GetFile",[A]);}};SWFUpload.prototype.addFileParam=function(A,B,C){return this.callFlash("AddFileParam",[A,B,C]);};SWFUpload.prototype.removeFileParam=function(A,B){this.callFlash("RemoveFileParam",[A,B]);};SWFUpload.prototype.setUploadURL=function(A){this.settings.upload_url=A.toString();this.callFlash("SetUploadURL",[A]);};SWFUpload.prototype.setPostParams=function(A){this.settings.post_params=A;this.callFlash("SetPostParams",[A]);};SWFUpload.prototype.addPostParam=function(A,B){this.settings.post_params[A]=B;this.callFlash("SetPostParams",[this.settings.post_params]);};SWFUpload.prototype.removePostParam=function(A){delete this.settings.post_params[A];this.callFlash("SetPostParams",[this.settings.post_params]);};SWFUpload.prototype.setFileTypes=function(B,A){this.settings.file_types=B;this.settings.file_types_description=A;this.callFlash("SetFileTypes",[B,A]);};SWFUpload.prototype.setFileSizeLimit=function(A){this.settings.file_size_limit=A;this.callFlash("SetFileSizeLimit",[A]);};SWFUpload.prototype.setFileUploadLimit=function(A){this.settings.file_upload_limit=A;this.callFlash("SetFileUploadLimit",[A]);};SWFUpload.prototype.setFileQueueLimit=function(A){this.settings.file_queue_limit=A;this.callFlash("SetFileQueueLimit",[A]);};SWFUpload.prototype.setFilePostName=function(A){this.settings.file_post_name=A;this.callFlash("SetFilePostName",[A]);};SWFUpload.prototype.setUseQueryString=function(A){this.settings.use_query_string=A;this.callFlash("SetUseQueryString",[A]);};SWFUpload.prototype.setRequeueOnError=function(A){this.settings.requeue_on_error=A;this.callFlash("SetRequeueOnError",[A]);};SWFUpload.prototype.setHTTPSuccess=function(A){if(typeof A==="string"){A=A.replace(" ","").split(",");}this.settings.http_success=A;this.callFlash("SetHTTPSuccess",[A]);};SWFUpload.prototype.setAssumeSuccessTimeout=function(A){this.settings.assume_success_timeout=A;this.callFlash("SetAssumeSuccessTimeout",[A]);};SWFUpload.prototype.setDebugEnabled=function(A){this.settings.debug_enabled=A;this.callFlash("SetDebugEnabled",[A]);};SWFUpload.prototype.setButtonImageURL=function(A){if(A==undefined){A="";}this.settings.button_image_url=A;this.callFlash("SetButtonImageURL",[A]);};SWFUpload.prototype.setButtonDimensions=function(B,A){this.settings.button_width=B;this.settings.button_height=A;var C=this.getMovieElement();if(C!=undefined){C.style.width=B+"px";C.style.height=A+"px";}this.callFlash("SetButtonDimensions",[B,A]);};SWFUpload.prototype.setButtonText=function(A){this.settings.button_text=A;this.callFlash("SetButtonText",[A]);};SWFUpload.prototype.setButtonTextPadding=function(B,A){this.settings.button_text_top_padding=A;this.settings.button_text_left_padding=B;this.callFlash("SetButtonTextPadding",[B,A]);};SWFUpload.prototype.setButtonTextStyle=function(A){this.settings.button_text_style=A;this.callFlash("SetButtonTextStyle",[A]);};SWFUpload.prototype.setButtonDisabled=function(A){this.settings.button_disabled=A;this.callFlash("SetButtonDisabled",[A]);};SWFUpload.prototype.setButtonAction=function(A){this.settings.button_action=A;this.callFlash("SetButtonAction",[A]);};SWFUpload.prototype.setButtonCursor=function(A){this.settings.button_cursor=A;this.callFlash("SetButtonCursor",[A]);};SWFUpload.prototype.queueEvent=function(A,B){if(B==undefined){B=[];}else{if(!(B instanceof Array)){B=[B];}}var C=this;if(typeof this.settings[A]==="function"){this.eventQueue.push(function(){this.settings[A].apply(this,B);});setTimeout(function(){C.executeNextEvent();},0);}else{if(this.settings[A]!==null){throw"Event handler "+A+" is unknown or is not a function";}}};SWFUpload.prototype.executeNextEvent=function(){var A=this.eventQueue?this.eventQueue.shift():null;if(typeof(A)==="function"){A.apply(this);}};SWFUpload.prototype.unescapeFilePostParams=function(F){var B=/[$]([0-9a-f]{4})/i;var E={};var A;if(F!=undefined){for(var D in F.post){if(F.post.hasOwnProperty(D)){A=D;var C;while((C=B.exec(A))!==null){A=A.replace(C[0],String.fromCharCode(parseInt("0x"+C[1],16)));}E[A]=F.post[D];}}F.post=E;}return F;};SWFUpload.prototype.testExternalInterface=function(){try{return this.callFlash("TestExternalInterface");}catch(A){return false;}};SWFUpload.prototype.flashReady=function(){var A=this.getMovieElement();if(!A){this.debug("Flash called back ready but the flash movie can't be found.");return;}this.cleanUp(A);this.queueEvent("swfupload_loaded_handler");};SWFUpload.prototype.cleanUp=function(B){try{if(this.movieElement&&typeof(B.CallFunction)==="unknown"){this.debug("Removing Flash functions hooks (this should only run in IE and should prevent memory leaks)");for(var A in B){try{if(typeof(B[A])==="function"){B[A]=null;}}catch(D){}}}}catch(C){}window["__flash__removeCallback"]=function(G,E){try{if(G){G[E]=null;}}catch(F){}};};SWFUpload.prototype.buttonAction=function(){this.queueEvent("button_action_handler");};SWFUpload.prototype.fileDialogStart=function(){this.queueEvent("file_dialog_start_handler");};SWFUpload.prototype.fileQueued=function(A){A=this.unescapeFilePostParams(A);this.queueEvent("file_queued_handler",A);};SWFUpload.prototype.fileQueueError=function(C,B,A){C=this.unescapeFilePostParams(C);this.queueEvent("file_queue_error_handler",[C,B,A]);};SWFUpload.prototype.fileDialogComplete=function(B,A,C){this.queueEvent("file_dialog_complete_handler",[B,A,C]);};SWFUpload.prototype.uploadStart=function(A){A=this.unescapeFilePostParams(A);this.queueEvent("return_upload_start_handler",A);};SWFUpload.prototype.returnUploadStart=function(B){var A;if(typeof this.settings.upload_start_handler==="function"){B=this.unescapeFilePostParams(B);A=this.settings.upload_start_handler.call(this,B);}else{if(this.settings.upload_start_handler!=undefined){throw"upload_start_handler must be a function";}}if(A===undefined){A=true;}A=!!A;this.callFlash("ReturnUploadStart",[A]);};SWFUpload.prototype.uploadProgress=function(C,A,B){C=this.unescapeFilePostParams(C);this.queueEvent("upload_progress_handler",[C,A,B]);};SWFUpload.prototype.uploadError=function(C,B,A){C=this.unescapeFilePostParams(C);this.queueEvent("upload_error_handler",[C,B,A]);};SWFUpload.prototype.uploadSuccess=function(C,A,B){C=this.unescapeFilePostParams(C);this.queueEvent("upload_success_handler",[C,A,B]);};SWFUpload.prototype.uploadComplete=function(A){A=this.unescapeFilePostParams(A);this.queueEvent("upload_complete_handler",A);};SWFUpload.prototype.debug=function(A){this.queueEvent("debug_handler",A);};SWFUpload.prototype.debugMessage=function(C){if(this.settings.debug){var A,D=[];if(typeof C==="object"&&typeof C.name==="string"&&typeof C.message==="string"){for(var B in C){if(C.hasOwnProperty(B)){D.push(B+": "+C[B]);}}A=D.join("\n")||"";D=A.split("\n");A="EXCEPTION: "+D.join("\nEXCEPTION: ");SWFUpload.Console.writeLine(A);}else{SWFUpload.Console.writeLine(C);}}};SWFUpload.Console={};SWFUpload.Console.writeLine=function(B){var C,A;try{C=document.getElementById("SWFUpload_Console");if(!C){A=document.createElement("form");document.getElementsByTagName("body")[0].appendChild(A);C=document.createElement("textarea");C.id="SWFUpload_Console";C.style.fontFamily="monospace";C.setAttribute("wrap","off");C.wrap="off";C.style.overflow="auto";C.style.width="700px";C.style.height="350px";C.style.margin="5px";A.appendChild(C);}C.value+=B+"\n";C.scrollTop=C.scrollHeight-C.clientHeight;}catch(D){alert("Exception: "+D.name+" Message: "+D.message);}};}catch(ex){}try{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(A){return function(B){if(typeof(A)==="function"){A.call(this,B);}this.ensureDefault=function(D,C){this.settings[D]=(B[D]==undefined)?C:B[D];};this.ensureDefault("minimum_flash_version","9.0.28");this.ensureDefault("swfupload_pre_load_handler",null);this.ensureDefault("swfupload_load_failed_handler",null);delete this.ensureDefault;};})(SWFUpload.prototype.initSettings);SWFUpload.prototype.loadFlash=function(A){return function(){var B=swfobject.hasFlashPlayerVersion(this.settings.minimum_flash_version);if(B){this.queueEvent("swfupload_pre_load_handler");if(typeof(A)==="function"){A.call(this);}}else{this.queueEvent("swfupload_load_failed_handler");}};}(SWFUpload.prototype.loadFlash);SWFUpload.prototype.displayDebugInfo=function(A){return function(){if(typeof(A)==="function"){A.call(this);}this.debug(["SWFUpload.SWFObject Plugin settings:","\n","\t","minimum_flash_version:                      ",this.settings.minimum_flash_version,"\n","\t","swfupload_pre_load_handler assigned:     ",(typeof(this.settings.swfupload_pre_load_handler)==="function").toString(),"\n","\t","swfupload_load_failed_handler assigned:     ",(typeof(this.settings.swfupload_load_failed_handler)==="function").toString(),"\n",].join(""));};}(SWFUpload.prototype.displayDebugInfo);}}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.Service=new JsonFx.IO.Service("/Features/Media/MediaService.jrpc");MF.Media.Service.addToAlbum=function(albumId,mediaIdList,opt){this.invoke("addToAlbum",[albumId,mediaIdList],opt);};MF.Media.Service.addContentToAlbums=function(contentID,albumIDList,opt){this.invoke("addContentToAlbums",[contentID,albumIDList],opt);};MF.Media.Service.getAlbumList=function(start,count,opt){this.invoke("getAlbumList",[start,count],opt);};MF.Media.Service.getAlbumMedia=function(albumId,start,count,opt){this.invoke("getAlbumMedia",[albumId,start,count],opt);};MF.Media.Service.getArrangeableAlbumMedia=function(albumId,start,count,opt){this.invoke("getArrangeableAlbumMedia",[albumId,start,count],opt);};MF.Media.Service.getAlbums=function(start,count,searchQuery,sortColIdx,sortAscending,userIDs,opt){this.invoke("getAlbums",[start,count,searchQuery,sortColIdx,sortAscending,userIDs],opt);};MF.Media.Service.getRecentAlbums=function(start,count,opt){this.invoke("getRecentAlbums",[start,count],opt);};MF.Media.Service.getEditableMedia=function(start,count,strSourceID,type,opt){this.invoke("getEditableMedia",[start,count,strSourceID,type],opt);};MF.Media.Service.getMedia=function(realStartIdx,count,contentType,searchQuery,sortColIdx,sortAscending,displayedStartIdx,userIDs,opt){this.invoke("getMedia",[realStartIdx,count,contentType,searchQuery,sortColIdx,sortAscending,displayedStartIdx,userIDs],opt);};MF.Media.Service.getMediaNotInAlbum=function(albumId,start,count,opt){this.invoke("getMediaNotInAlbum",[albumId,start,count],opt);};MF.Media.Service.getPrevNextSlide=function(contentId,albumId,shareId,opt){this.invoke("getPrevNextSlide",[contentId,albumId,shareId],opt);};MF.Media.Service.getPrevNextMedia=function(contentId,albumId,shareId,opt){this.invoke("getPrevNextMedia",[contentId,albumId,shareId],opt);};MF.Media.Service.createAlbum=function(title,description,opt){this.invoke("createAlbum",[title,description],opt);};MF.Media.Service.deleteMedia=function(contentID,opt){this.invoke("deleteMedia",[contentID],opt);};MF.Media.Service.pinContent=function(contentID,pin,opt){this.invoke("pinContent",[contentID,pin],opt);};MF.Media.Service.removeFromAlbum=function(albumID,contentID,opt){this.invoke("removeFromAlbum",[albumID,contentID],opt);};MF.Media.Service.saveMedia=function(images,videos,albumIDs,albumName,opt){this.invoke("saveMedia",[images,videos,albumIDs,albumName],opt);};MF.Media.Service.saveAlbumOrder=function(albumID,pages,opt){this.invoke("saveAlbumOrder",[albumID,pages],opt);};MF.Media.Service.updateMedia=function(sourceID,sourceType,media,opt){this.invoke("updateMedia",[sourceID,sourceType,media],opt);};MF.Media.Service.saveRotate=function(contentID,orientation,displayGuid,authHash,opt){this.invoke("saveRotate",[contentID,orientation,displayGuid,authHash],opt);};}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.AlbumPicker=JsonML.BST(["ul",{"class":"add-album-list js-AlbumPicker",style:function(){return(this.data.items||[]).length?null:"display:none";}}," ",function(){return JsonML.BST([""," ",["li",function(){return this.data.label;}," ",["a",{"class":"negative",href:"#remove",onclick:function(){return MF.Media.AlbumPicker.deleteClosure(this.data.id);}},["span","[x]"]]]," "]).dataBind((this.data.items||[]),this.index,this.count);}," ",["li",{"class":"choose-more"}," ",["a",{href:"#more",onclick:function(){return this.pickAlbums;}},"Choose more"]," "]," "]);(function(){var E=100,K,H,I,M,L,B,G;function J(){if(K===2&&!I.length){$("select[name=album-destination]").val(0);}var O=MF.Media.AlbumPicker.bind({items:M});$(".js-AlbumPicker").eq(0).replaceWith(O);}function C(O){I=[];M=[];while(O.length){var P=O.shift();I.push(Number(P.id));M.push({id:Number(P.id),label:String(P.label)});}setTimeout(J,0);}function A(R){var Q={};for(var P=0;P<I.length;P++){Q[String(I[P])]=true;}var O=MF.Dialog.ListSelect.bind({callback:C,count:R.count,items:R.items,moreCallback:N,selected:Q,start:R.start,total:R.total});if(O){document.body.appendChild(O);}}function F(P){P=Number(P);for(var O=I.length-1;O>=0;O--){if(I[O]===P){I.splice(O,1);M.splice(O,1);}}J();}function D(O,P){O=O||[];P=P||[];for(var Q=O.length-1;Q>=0;Q--){for(var R=P.length-1;R>=0;R--){if(O[Q].id===P[R].id){P.splice(Q,1);}}}return O.concat(P);}function N(P,O,Q){E=O;MF.Media.Service.getAlbumList(P,E,{onSuccess:function(R){G=R.total;H=D(H,R.items);Q(R);}});}this.resetAlbums=function(){K=0;G=-1;I=[];M=[];L=null;B=null;if(MF.Media.selectedAlbums&&MF.Media.selectedAlbums.length){H=D(H,MF.Media.selectedAlbums);C(MF.Media.selectedAlbums);K=2;}};this.setupDest=function(){var O=false;var P=false;K=Number($(this).val());switch(K){case 0:break;case 1:O=true;break;case 2:P=true;MF.Media.AlbumPicker.pickAlbums();break;}if(!P){M=[];I=[];J();}$(this).parents(".js-UploadSteps").toggleClass("new-album",O);};this.setAlbumDestFld=function(){B=this;if(K){$(B).val(K);}};this.setAlbumNameFld=function(){L=this;};this.getAlbumName=function(){if(K!==1){return null;}return(L&&L.value)||new Date().toString(MF.ShortDateFormat);};this.getSelectedAlbums=function(){if(K!==2){return null;}return I;};this.pickAlbums=function(){if(G>=0&&H&&H.length){var O=Math.max(0,H.length-E);A({start:O,count:E,total:G,items:H});}else{N(0,E,function(){A({start:0,count:E,total:G,items:H});});}return false;};this.deleteClosure=function(O){if(!O){return null;}return function(){F(O);return false;};};}).call(MF.Media.AlbumPicker);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Photo){MF.Photo={};}MF.Photo.Publisher=JsonML.BST([""," ",function(){this.resetState();MF.Media.AlbumPicker.resetAlbums();}," ",["div",{"class":"add-panel add-photos add-media add-media-new js-add-panel js-PhotoPublisher"}," ",["div",{"class":"js-UploadStatus",style:"display:none"}," ",function(){MF.Publisher.UploadStatus.close=this.close;}," "]," ",["h3","Add Photos"]," ",["div",{"class":"upload-steps js-UploadSteps"}," ",["p",["strong","Step 1."]," Place photos in an album? ",["select",{name:"album-destination",onchange:function(){return MF.Media.AlbumPicker.setupDest;},"jbst:oninit":function(){return MF.Media.AlbumPicker.setAlbumDestFld;}}," ",["option",{value:"0"},"No album"]," ",["option",{value:"1"},"Create new album"]," ",["option",{value:"2"},"Add to existing album(s)"]," "]," "]," ",["p",{"class":"new-album-name"}," ",["label",{"class":"album-name"},"New album: "]," ",["input",{type:"text",name:"album-name",title:function(){return"By "+MF.user.name+" - "+new Date().toString(MF.ShortDateFormat);},"class":"text album-name js-InlineInstruction",onfocus:"this.select();","jbst:oninit":function(){return MF.Media.AlbumPicker.setAlbumNameFld;}}]," "]," ",function(){return JsonML.BST(MF.Media.AlbumPicker).dataBind({},this.index,this.count);}," ",function(){return JsonML.BST(MF.Publisher.UploadQueue).dataBind({},this.index,this.count);}," ",["p",{"class":"submit js-ChooseStep"},["strong","Step 2."]," ",function(){return JsonML.BST(MF.Publisher.Uploader).dataBind({buttonWidth:"127",formUrl:MF.Publisher.uploadUrl,fileTypes:"*.jpg;*.jpeg;*.jpe;*.png;*.gif;*.tif",fileLabel:"Image Files",queueSize:200,queueMessage:"200 photos",fileSize:"50 MB"},this.index,this.count);}," ",["a",{href:"#choose","class":"positive choose",onclick:"return false;"},"Choose ",["span",{"class":"choose-media"},"photos"],["span",{"class":"choose-more"},"more"]]," ",["span",{"class":"choose-more"},"or"]," ",["a",{href:"#upload","class":"positive choose-more toggle-target-nohide",onclick:function(){return this.beginUpload;}},"Start upload now"]," "]," "]," ",function(){return JsonML.BST(MF.Publisher.UploadMeter).dataBind({bytesLeft:MF.Publisher.BytesLeft,bytesMax:MF.Publisher.BytesMax,upgradeUrl:MF.Publisher.UpgradeUrl},this.index,this.count);}," "]," "]);(function(){var A;function C(F,E){var D={DateTaken:E.dateTaken,DisplayAuth:E.remasteredAuth||null,DisplayGuid:E.remasteredID||null,Description:E.description,FileLength:F.size,MIMEType:E.mimeType,Orientation:E.orientation,OriginalFileName:F.name,OriginalAuth:E.originalAuth||null,OriginalGuid:E.originalID||null,Title:E.title||F.name};A.push(D);}function B(){if(!A||!A.length){MF.UnsavedData.markClean("MF.Photo.Publisher");MF.Photo.Publisher.close();return;}var D=MF.Media.AlbumPicker.getSelectedAlbums(),E=MF.Media.AlbumPicker.getAlbumName();MF.Media.Service.saveMedia(A,[],D,E,{onSuccess:function(F){MF.Publisher.BytesLeft=F.bytesLeft;MF.Publisher.BytesMax=F.bytesMax;MF.Activities.List.display(F.activity);MF.Publisher.UploadStatus.refresh(F);MF.Message.clear(null,MF.Message.Scope.Column);},onFailure:function(H,F,G){MF.Message.showError(null,"Error saving photos. Please try again.",MF.Message.Scope.Column);if(MF.isDebug){;}$(".js-PhotoPublisher").replaceWith(MF.Photo.Publisher.bind());},onComplete:function(){MF.UnsavedData.markClean("MF.Photo.Publisher");}});}this.close=function(){MF.UnsavedData.markClean("MF.Photo.Publisher");MF.Publisher.Module.reset.call(this);return false;};this.resetState=function(){A=[];};this.beginUpload=function(){MF.UnsavedData.markDirty("MF.Photo.Publisher","You are still uploading. If you leave this page your upload will be cancelled.");MF.Publisher.Uploader.beginUpload(C,B);return false;};}).call(MF.Photo.Publisher);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Video){MF.Video={};}MF.Video.Publisher=JsonML.BST([""," ",function(){this.resetState();MF.Media.AlbumPicker.resetAlbums();}," ",["div",{"class":"add-panel add-video add-media add-media-new js-add-panel js-VideoPublisher"}," ",["div",{"class":"js-UploadStatus",style:"display:none"}," ",function(){MF.Publisher.UploadStatus.close=this.close;}," "]," ",["h3","Add Videos"]," ",["div",{"class":"upload-steps js-UploadSteps"}," ",["p",["strong","Step 1."]," Place videos in an album? ",["select",{name:"album-destination",onchange:function(){return MF.Media.AlbumPicker.setupDest;},"jbst:oninit":function(){return MF.Media.AlbumPicker.setAlbumDestFld;}}," ",["option",{value:"0"},"No album"]," ",["option",{value:"1"},"Create new album"]," ",["option",{value:"2"},"Add to existing album(s)"]," "]," "]," ",["p",{"class":"new-album-name"}," ",["label",{"class":"album-name"},"New album: "]," ",["input",{type:"text",name:"album-name",title:function(){return"By "+MF.user.name+" - "+new Date().toString(MF.ShortDateFormat);},"class":"text album-name js-InlineInstruction",onfocus:"this.select();","jbst:oninit":function(){return MF.Media.AlbumPicker.setAlbumNameFld;}}]," "]," ",function(){return JsonML.BST(MF.Media.AlbumPicker).dataBind({},this.index,this.count);}," ",function(){return JsonML.BST(MF.Publisher.UploadQueue).dataBind({},this.index,this.count);}," ",["p",{"class":"submit js-ChooseStep"},["strong","Step 2."]," ",function(){return JsonML.BST(MF.Publisher.Uploader).dataBind({buttonWidth:"125",formUrl:MF.Publisher.uploadUrl,fileTypes:"*.asf;*.avi;*.flv;*.mp4;*.mpg;*.mpeg;*.mov;*.rm;*.wmv",fileLabel:"Video Files",queueSize:10,queueMessage:"10 videos",fileSize:"1 GB"},this.index,this.count);}," ",["a",{href:"#choose","class":"positive choose",onclick:"return false;"},"Choose ",["span",{"class":"choose-media"},"videos"],["span",{"class":"choose-more"},"more"]]," ",["span",{"class":"choose-more"},"or"]," ",["a",{href:"#upload","class":"positive choose-more toggle-target-nohide",onclick:function(){return this.beginUpload;}},"Start upload now"]," "]," "]," ",function(){return JsonML.BST(MF.Publisher.UploadMeter).dataBind({bytesLeft:MF.Publisher.BytesLeft,bytesMax:MF.Publisher.BytesMax,upgradeUrl:MF.Publisher.UpgradeUrl},this.index,this.count);}," "]," "]);(function(){var A;function C(F,E){var D={Description:E.description,DisplayAuth:E.previewAuth||null,DisplayGuid:E.previewID||null,Duration:E.duration,FileLength:F.size,Height:E.height,MIMEType:E.mimeType,OriginalFileName:F.name,Title:E.title||F.name,OriginalAuth:E.originalAuth||null,OriginalGuid:E.originalID||null,Width:E.width};A.push(D);}function B(){if(!A||!A.length){MF.UnsavedData.markClean("MF.Video.Publisher");MF.Video.Publisher.close();return;}var D=MF.Media.AlbumPicker.getSelectedAlbums(),E=MF.Media.AlbumPicker.getAlbumName();MF.Media.Service.saveMedia([],A,D,E,{onSuccess:function(F){MF.Publisher.BytesLeft=F.bytesLeft;MF.Publisher.BytesMax=F.bytesMax;MF.Activities.List.display(F.activity);MF.Publisher.UploadStatus.refresh(F);MF.Message.clear(null,MF.Message.Scope.Column);},onFailure:function(H,F,G){MF.Message.showError(null,"Error saving videos. Please try again.",MF.Message.Scope.Column);if(MF.isDebug){;}$(".js-VideoPublisher").replaceWith(MF.Video.Publisher.bind());},onComplete:function(){MF.UnsavedData.markClean("MF.Video.Publisher");}});}this.close=function(){MF.UnsavedData.markClean("MF.Video.Publisher");MF.Publisher.Module.reset.call(this);return false;};this.resetState=function(){A=[];};this.beginUpload=function(){MF.UnsavedData.markDirty("MF.Video.Publisher","You are still uploading. If you leave this page your upload will be cancelled.");MF.Publisher.Uploader.beginUpload(C,B);return false;};}).call(MF.Video.Publisher);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.Publisher=JsonML.BST([""," ",function(){this.resetState();MF.Media.AlbumPicker.resetAlbums();}," ",["div",{"class":"add-panel add-photos add-media add-media-new js-add-panel js-MediaPublisher"}," ",["div",{"class":"js-UploadStatus",style:"display:none"}," ",function(){MF.Publisher.UploadStatus.close=this.close;}," "]," ",["div",{"class":"upload-steps js-UploadSteps"}," ",["p",["strong","Step 1."]," Place in an album? ",["select",{name:"album-destination",onchange:function(){return MF.Media.AlbumPicker.setupDest;},"jbst:oninit":function(){return MF.Media.AlbumPicker.setAlbumDestFld;}}," ",["option",{value:"0"},"No album"]," ",["option",{value:"1"},"Create new album"]," ",["option",{value:"2"},"Add to existing album(s)"]," "]," "]," ",["p",{"class":"new-album-name"}," ",["label",{"class":"album-name"},"New album: "]," ",["input",{type:"text",name:"album-name",title:function(){return"By "+MF.user.name+" - "+new Date().toString(MF.ShortDateFormat);},"class":"text album-name js-InlineInstruction",onfocus:"this.select();","jbst:oninit":function(){return MF.Media.AlbumPicker.setAlbumNameFld;}}]," "]," ",function(){return JsonML.BST(MF.Media.AlbumPicker).dataBind({},this.index,this.count);}," ",function(){return JsonML.BST(MF.Publisher.UploadQueue).dataBind({},this.index,this.count);}," ",["p",{"class":"submit js-ChooseStep"},["strong","Step 2."]," ",function(){return JsonML.BST(MF.Publisher.Uploader).dataBind({onQueued:this.onQueued,formUrl:MF.Publisher.uploadUrl,fileTypes:"*.jpg;*.jpeg;*.jpe;*.png;*.gif;*.tif;*.asf;*.avi;*.flv;*.mp4;*.mpg;*.mpeg;*.mov;*.rm;*.wmv",fileLabel:"Image and Video Files",queueSize:200,queueMessage:"200 photos or videos",fileSize:"1 GB"},this.index,this.count);}," ",["a",{href:"#choose","class":"positive choose",onclick:"return false;"},"Choose ",["span",{"class":"choose-media"},"files"],["span",{"class":"choose-more"},"more"]]," ",["span",{"class":"choose-more"},"or"]," ",["a",{href:"#upload","class":"positive choose-more toggle-target-nohide",onclick:function(){return this.beginUpload;}},"Start upload now"]," "]," "]," ",function(){return JsonML.BST(MF.Publisher.UploadMeter).dataBind({bytesLeft:MF.Publisher.BytesLeft,bytesMax:MF.Publisher.BytesMax,upgradeUrl:MF.Publisher.UpgradeUrl},this.index,this.count);}," "]," "]);(function(){var C,F,E,B;function A(J,I){return{DateTaken:I.dateTaken,DisplayAuth:I.remasteredAuth||null,DisplayGuid:I.remasteredID||null,Description:I.description,FileLength:J.size,MIMEType:I.mimeType,Orientation:I.orientation,OriginalFileName:J.name,OriginalAuth:I.originalAuth||null,OriginalGuid:I.originalID||null,Title:I.title||J.name};}function G(J,I){return{Description:I.description,DisplayAuth:I.previewAuth||null,DisplayGuid:I.previewID||null,Duration:I.duration,FileLength:J.size,Height:I.height,MIMEType:I.mimeType,OriginalFileName:J.name,OriginalAuth:I.originalAuth||null,OriginalGuid:I.originalID||null,Title:I.title||J.name,Width:I.width};}function D(K,J){var I=(String(J&&J.mimeCategory)||"").toLowerCase();switch(I){case"video":C.push(G(K,J));break;default:case"image":F.push(A(K,J));break;}}function H(){if(!F){F=[];}if(!C){C=[];}if(!F.length&&!C.length){MF.UnsavedData.markClean("MF.Media.Publisher");MF.Media.Publisher.close();return;}var I=MF.Media.AlbumPicker.getSelectedAlbums(),J=MF.Media.AlbumPicker.getAlbumName();MF.Media.Service.saveMedia(F,C,I,J,{onSuccess:function(K){MF.Publisher.BytesLeft=K.bytesLeft;MF.Publisher.BytesMax=K.bytesMax;MF.Publisher.UploadStatus.refresh(K);MF.Message.clear(null,MF.Message.Scope.Column);},onFailure:function(M,K,L){MF.Message.showError(null,"Error saving photos or videos. Please try again.",MF.Message.Scope.Column);if(MF.isDebug){;}$(".js-MediaPublisher").replaceWith(MF.Media.Publisher.bind());},onComplete:function(){MF.UnsavedData.markClean("MF.Media.Publisher");}});}this.close=function(){MF.UnsavedData.markClean("MF.Media.Publisher");window.location.href=MF.Media.cancelUrl;return false;};this.resetState=function(){F=[];C=[];E=0;B=0;};this.onQueued=function(L){if(MF.isDebug&&"undefined"!==typeof console&&console.log){console.log("SWF File Queued:\n"+JSON.stringify(L,null,"  "));}var I;try{I=L.name.split(".").pop().toLowerCase();}catch(K){try{I=L.type.toLowerCase();}catch(K){}}switch(I){case"jpg":case"jpeg":case"jpe":case"png":case"gif":case"tif":if(L.size>52428800){this.cancelUpload(L.id,true);var J='"'+L.name+'" is larger than the allowed size.';MF.Log.info("Upload Queue ("+J+"):\n"+JSON.stringify(L,null,"  "));MF.Message.showWarning(null,J,MF.Message.Scope.Column,10000);}else{if(E>=200){this.cancelUpload(L.id,true);var J=String.format("Only {0} may be uploaded at a time. You may need to upload in multiple batches.","200 photos");MF.Log.info("Upload Queue ("+J+"):\n"+JSON.stringify(L,null,"  "));MF.Message.showWarning(null,J,MF.Message.Scope.Column,10000);}else{E++;}}break;case"asf":case"avi":case"flv":case"mp4":case"mpg":case"mpeg":case"mov":case"rm":case"wmv":if(L.size>1073741824){this.cancelUpload(L.id,true);var J='"'+L.name+'" is larger than the allowed size.';MF.Log.info("Upload Queue ("+J+"):\n"+JSON.stringify(L,null,"  "));MF.Message.showWarning(null,J,MF.Message.Scope.Column,10000);}else{if(B>=10){this.cancelUpload(L.id,true);var J=String.format("Only {0} may be uploaded at a time. You may need to upload in multiple batches.","10 videos");MF.Log.info("Upload Queue ("+J+"):\n"+JSON.stringify(L,null,"  "));MF.Message.showWarning(null,J,MF.Message.Scope.Column,10000);}else{B++;}}break;default:this.cancelUpload(L.id,true);var J='"'+L.name+'" is an unrecognized extension.';MF.Log.info("Upload Queue ("+J+"):\n"+JSON.stringify(L,null,"  "));MF.Message.showWarning(null,J,MF.Message.Scope.Column);break;}};this.beginUpload=function(){MF.UnsavedData.markDirty("MF.Media.Publisher","You are still uploading. If you leave this page your upload will be cancelled.");MF.Publisher.Uploader.beginUpload(D,H);return false;};}).call(MF.Media.Publisher);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.PinnedContent=JsonML.BST([""," ",["a",{id:"pinned-slideshow",href:"http://www.adobe.com/go/getflashplayer","jbst:onload":function(){return this.flashClosure(this.data.slideshow);},"jbst:visible":function(){return !this.data.single;}},["img",{src:"http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif",alt:"Get Adobe Flash player"}]]," ",["a",{href:function(){return this.data.singleUrl;},"jbst:visible":function(){return !!this.data.singleUrl;}}," ",["img",{"class":"pinned",src:function(){return this.data.single;}}]," "]," "]);(function(){this.flashClosure=function(A){return function(){swfobject.embedSWF("/Flash/SlideShowPro/mfSmall.swf","pinned-slideshow","300","320","9","/Flash/SWFObject/expressInstall.swf",{xmlfile:String(A),xmlfiletype:"Default"},{allowfullscreen:"true",allowscriptaccess:"always",wmode:"transparent"});};};}).call(MF.Media.PinnedContent);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.Rotate=JsonML.BST(["div",{"jbst:visible":function(){return this.canRotate(this.data);},style:"display:none"}," ",["iframe",{id:"CreateImageFrame",name:"CreateImageFrame"}]," ",["form",{method:"post",action:function(){return this.data.saveUrl;},target:"CreateImageFrame","class":"js-CreateImageForm"}," ",["input",{type:"hidden",name:"Transforms",value:function(){return this.data.transforms;},defaultValue:function(){return this.data.transforms;}}]," "]," "]);(function(){var I,B,D,H,J=false;var E=[0,0,0,2,2,1,1,3,3];var C=[1,6,3,8];function G(K,L){H=D=null;MF.Message.showInfo(null,"Rotation successfully saved.",MF.Message.Scope.Column,10000);$(".js-SaveRotate").hide();}function F(K,L,M){MF.Message.showError(null,"Rotation failed. Please try again.",MF.Message.Scope.Column);}function A(){J=false;MF.Loading.hide();}this.canRotate=function(K){if(!K.rotateUrl){return false;}switch(K.type){case"Image":return true;default:return false;}};this.rotate=function(L,K){return function(){if(J){return false;}var M=$("img.item-main");if(!M.length){return false;}MF.Message.clear(null,MF.Message.Scope.Column);if(!H){H=M.attr("src");D=B;}B=(C.length+B+K)%C.length;if(B!==D){MF.Loading.show(50);M[0].onload=function(){MF.Loading.hide();this.onload=null;};M.attr("src",String.format(L,C[B]||0)).removeAttr("height").removeAttr("width");}else{M.attr("src",H).removeAttr("height").removeAttr("width");}$(".js-SaveRotate").toggle(B!==D);return false;};};this.jsonp=function(K){var N=K&&K.result;if(!N||(!N.remasteredID&&!N.originalID)){F(K,null,K&&K.error);return;}var L=N.remasteredAuth||N.originalAuth||null;var M=N.remasteredID||N.originalID||null;MF.Media.Service.saveRotate(I,C[B]||0,M,L,{onSuccess:G,onFailure:F,onComplete:A});};this.saveRotate=function(K,N,L){B=E[L]||0;I=N;var M=K;return function(){if(J){return false;}J=true;MF.Message.clear(null,MF.Message.Scope.Column);MF.Loading.show(100);var O=$("iframe#CreateImageFrame")[0];if(O&&O.contentWindow){O.contentWindow.name=O.name;}var P=$("form.js-CreateImageForm");P.attr("action",String.format(M,C[B]||0));P[0].submit();return false;};};}).call(MF.Media.Rotate);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.ActionLinks=JsonML.BST(["ul",{"class":"item-actions"}," ",["li",{"class":function(){return this.getFavoriteCss(this.data.favorite);},"jbst:visible":function(){return this.data.canComment;}},["a",{"class":"action-link",href:"#favorite",onclick:function(){return this.markFavorite(this.data.id,this.data.favorite,this.data.type);}},function(){return this.getFavoriteText(this.data.favorite);}]]," ",["li",{"class":"action-share","jbst:visible":function(){return this.data.canShare;}},["a",{onclick:function(){return this.showShareDialog(this.data.id);},href:"#share","class":"action-link item-share"},["span","Share this ",function(){return this.getFriendlyName(this.data.type);}]," ",["img",{src:"/Images/serviceIcons/link.png"}]]]," ",["li",{"class":"action-copy","jbst:visible":function(){return this.data.canCopy;}},["a",{onclick:function(){return this.showCopyToDialog(this.data.id);},href:"#copy","class":"action-link"},"Copy to another family group"]]," "]);(function(){this.showShareDialog=function(A){return function(){MF.Share.ShareDialog.showDlg(A);return false;};};this.showCopyToDialog=function(A){return function(){MF.SiteCopy.SitePickerDialog.show(A);return false;};};this.getFriendlyName=function(A){if(A==="Image"){return"photo";}else{if(A==="VoiceDiscussion"){return"voice discussion";}else{return A.toLowerCase();}}};this.getFavoriteText=function(A){if(A){return"You love this";}else{return"Love this";}};this.getFavoriteCss=function(A){if(A){return"action-fave active";}else{return"action-fave";}};this.markFavorite=function(C,B,A){return function(){var D=$(this);MF.Favorite.Service.markFavorite(C,!B,A,{onSuccess:function(E){B=E.isFavorite;D.parents("li").toggleClass("active");$(D).html(MF.Media.ActionLinks.getFavoriteText(B));$(".js-favoritesList").replaceWith(MF.Favorite.FavoriteList.bind(E.favoritesList));}});return false;};};}).call(MF.Media.ActionLinks);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.AdminLinks=JsonML.BST([""," ",["ul",{"class":"item-actions"}," ",["li",{"class":"action-rotate","jbst:visible":function(){return MF.Media.Rotate.canRotate(this.data);}}," ",["a",{href:"#rotate-left","class":"action-link item-rotate-left",onclick:function(){return MF.Media.Rotate.rotate(this.data.rotateUrl,-1);}},"Rotate left"]," ",["a",{href:"#rotate-right","class":"action-link item-rotate-right",onclick:function(){return MF.Media.Rotate.rotate(this.data.rotateUrl,+1);}},"Rotate right"]," ",["a",{href:"#save-rotate","class":"positive item-rotate-save js-SaveRotate",onclick:function(){return MF.Media.Rotate.saveRotate(this.data.saveUrl,this.data.id,this.data.orient);},style:"display:none"},["span","Save rotate"]]," "]," ",["li",{"class":"action-download","jbst:visible":function(){return !!this.data.download;}},["a",{href:function(){return this.data.download;},"class":"action-link item-download"},"Download this ",function(){return this.getFriendlyName(this.data.type);}]]," ",["li",{"class":"action-pin","jbst:visible":function(){return this.data.canPin;}},["a",{onclick:function(){return this.pin(this.data.id,this.data.pinned);},href:"#pin","class":"action-link item-pin"},function(){return this.getPinnedText(this.data.pinned);}]]," "]," ",function(){return JsonML.BST(MF.Media.Rotate).dataBind(this.data,this.index,this.count);}]);(function(){this.getFriendlyName=function(A){if(A==="Image"){return"photo";}else{if(A==="VoiceDiscussion"){return"voice discussion";}else{return A.toLowerCase();}}};this.getPinnedText=function(A){if(A){return"Unpin photo from homepage";}else{return"Pin photo to homepage";}};this.pin=function(B,A){return function(){var C=this;MF.Media.Service.pinContent(B,!A,{onSuccess:function(D){A=D.pinned;$(C).html(MF.Media.AdminLinks.getPinnedText(A));}});return false;};};}).call(MF.Media.AdminLinks);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.MediaDetail=JsonML.BST(["div"," ",function(){this.editPage=this.data.editUrl;}," ",function(){return JsonML.BST(this.switchContentType).dataBind(this.data,this.index,this.count);}," ",["div",{"class":"page-title","jbst:visible":function(){return this.data.title.length>0;}}," ",["h2",function(){return this.data.title;}]," "]," ",["div",{"class":"discussion-content js-DiscussionContent","jbst:visible":function(){return this.data.description.length>0;}}," ",function(){return JsonML.raw(this.data.description);}," "]," "]);(function(){this.deleteMedia=function(B,A,C){MF.Media.Service.deleteMedia(B,{onSuccess:function(D){C();if("undefined"!==typeof MF.Media.nextMediaUrl){window.location=MF.Media.nextMediaUrl;}else{window.location=D.url;}}});};this.editMedia=function(B,A){window.location=MF.Media.MediaDetail.editPage;};this.switchContentType=function(){switch(this.data.contentType){case"Album":return MF.Media.MediaDetail.Album;case"Slideshow":return MF.Media.MediaDetail.Slideshow;case"Video":return MF.Media.MediaDetail.Video;case"Image":return MF.Media.MediaDetail.Image;default:return null;}};}).call(MF.Media.MediaDetail);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}if("undefined"===typeof MF.Media.MediaDetail){MF.Media.MediaDetail={};}MF.Media.MediaDetail.Album=JsonML.BST(["img",{"class":"item-main",src:function(){return this.data.imageUrl;}}]);null;}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}if("undefined"===typeof MF.Media.MediaDetail){MF.Media.MediaDetail={};}MF.Media.MediaDetail.Image=JsonML.BST(["img",{ondblclick:function(){return this.viewFullscreen(this.data.contentId);},"class":"item-main",src:function(){return this.data.imageUrl;}}]);(function(){this.viewFullscreen=function(A){return function(B){B=B||event;if(MF.Media.MediaNavThumbs&&MF.Media.MediaNavThumbs.viewFullscreen){MF.Media.MediaNavThumbs.viewFullscreen(A,null,false);}};};}).call(MF.Media.MediaDetail.Image);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.Fullscreen=JsonML.BST([""," ",function(){$(document).bind("keyup",this.handleArrowNav);$(window).bind("resize",this.handleBrowserResize);}," ",["iframe",{"class":"TB_HideSelect","jbst:visible":function(){return"undefined"===typeof document.body.style.maxHeight;}}]," ",["div",{"class":"TB_overlay full-slideshow",onclick:function(){return this.closeSlideshow;},onmouseover:function(){return MF.Media.Fullscreen.showControls;},onmouseout:function(){return MF.Media.Fullscreen.hideControls;}}]," ",["div",{"class":"TB_slideshow"}," ",["div",{"class":"transport controls js-onhover",id:"ss-transport",onmouseover:function(){return MF.Media.Fullscreen.showControls;},onmouseout:function(){return MF.Media.Fullscreen.hideControls;}}," ",["a",{onclick:function(){return this.navigate(false);},id:"ss-prev",title:"Go to previous slide"},["img",{src:"/Images/fs_skipb_24.png"}]]," ",["a",{onclick:function(){return this.toggleSlideshow;},id:"ss-play",title:"Start Slideshow"},["img",{src:"/Images/fs_play_24.png"}]]," ",["a",{onclick:function(){return this.toggleSlideshow;},id:"ss-stop",title:"Stop Slideshow"},["img",{src:"/Images/fs_pause_24.png"}]]," ",["a",{onclick:function(){return this.navigate(true);},id:"ss-next",title:"Go to next slide"},["img",{src:"/Images/fs_skipf_24.png"}]]," "]," ",["div",{"class":"close js-onhover",onmouseover:function(){return MF.Media.Fullscreen.showControls;},onmouseout:function(){return MF.Media.Fullscreen.hideControls;}}," ",["p",["a",{href:"#",onclick:function(){return this.closeSlideshow;}},"Close slideshow"]]," "]," ",["div",{"class":"TB_window full-slideshow"}," ",["div",{style:"text-align:center"}," ",["a",{href:"#view",onclick:function(){return this.imageClicked;}},["img",{onmouseover:function(){return MF.Media.Fullscreen.showControls;},onmouseout:function(){return MF.Media.Fullscreen.hideControls;},id:"ss-curImg",src:"/images/loadingIndicators/small.gif"}]]," ",["div",{"class":"title",onmouseover:function(){return MF.Media.Fullscreen.showControls;},onmouseout:function(){return MF.Media.Fullscreen.hideControls;},style:"display:none"}," ",["span",{id:"ss-title"}]," "]," "]," "]," "]]);(function(){var B=3000,A=1500,L=30000,S=500;var I=null,W=null,C=true,O={},K=null,D=false,H=null;function G(){U(W.image,W.imageTitle);if(W.hasPrev){$("#ss-prev").fadeTo("fast",0.6);}else{$("#ss-prev").fadeTo("fast",0.1);}if(W.hasNext){$("#ss-next").fadeTo("fast",0.6);}else{$("#ss-next").fadeTo("fast",0.1);}if(C&&W.hasNext){R(W.nextFull);N(W.nextId,W.albumId,false);}else{if(!C&&W.hasPrev){R(W.prevFull);N(W.prevId,W.albumId,false);}}}function N(c,Z,b){var a=c.toString()+"_"+Z;if(O.hasOwnProperty(a)){if(b){W=O[a];G();}}else{MF.Media.Service.getPrevNextSlide(c,Z,MF.Media.ShareID,{onSuccess:function(d){O[a]=d;if(b){W=d;G();}}});}}function F(a){var c=1050;var Z=c-200;var b=$(window);if(b.width()>Z&&b.height()>Z){return a.replace("MaxSide=640",("MaxSide="+c));}return a;}function R(Z){if(Z){var a=new Image();a.src=F(Z);}}function U(b,a){if(MF.isDebug){a+=(" (slideshow delay: "+B+")");}b=F(b);var Z=new Image();Z.onload=function(){var e=$("#ss-curImg")[0];e.src=b;var c=P(Z.height,Z.width);e.height=c.height;e.width=c.width;$("#ss-title").text(a);var d=$("div.title");if(!d.is(":visible")){d.show();}};Z.src=b;}function P(g,b){var l=$(window);var m=4,h=30;var f=l.height()-(m*2)-(h*2);var k=l.width()-(m*2);if(g>f||b>k){var Z;if(g>f&&b>k){var d=f/g;var c=k/b;if(d<c){Z=d;}else{Z=c;}}else{if(g>f){Z=f/g;}else{Z=k/b;}}g=g*Z;b=b*Z;}var e=$(".TB_window");var a=g*0.1;var j=Math.floor(Math.abs(g/2-(a-m)));var i=Math.floor(b/2+m);e.height(g);e.width(b);e.css("margin-top","-"+j+"px");e.css("margin-left","-"+i+"px");return{width:b,height:g};}function T(){C=true;if(W.hasNext){N(W.nextId,W.albumId,true);}else{J();}}function V(){C=false;if(W.hasPrev){N(W.prevId,W.albumId,true);}else{J();}}function Q(){if(C){T();}else{V();}K=setTimeout(Q,B);}function X(){if(K){J();}else{M();}}function M(){if(K){return false;}C=true;K=setTimeout(Q,B);$("#ss-play").hide();$("#ss-stop").show();}function J(){if(K){clearTimeout(K);K=null;$("#ss-stop").hide();$("#ss-play").show();}}function Y(){B-=S;if(B<A){B=A;}}function E(){B+=S;if(B>L){B=L;}}this.show=function(b,Z,c){I=c;var a=MF.Media.Fullscreen.bind({});if(a){document.body.appendChild(a);if(JsonFx.userAgent.ie<7){document.body.scrollIntoView(true);}C=true;N(b,Z,true);}};this.handleBrowserResize=function(Z){U(W.image,W.imageTitle);};this.handleArrowNav=function(c){var Z=false;var b=c||window.event;var a=b.srcElement||b.target;if(b.keyCode===27){MF.Media.Fullscreen.closeSlideshow();}if(a&&a.form){return;}if(b.keyCode===39||b.keyCode===176){J();T();Z=true;}else{if(b.keyCode===37||b.keyCode===177){J();V();Z=true;}else{if(b.keyCode===32||b.keyCode===19||b.keyCode===80||b.keyCode===190||b.keyCode===179){X();Z=true;}else{if(b.keyCode===178){J();Z=true;}else{if(b.keyCode===109){Y();Z=true;}else{if(b.keyCode===107){E();Z=true;}else{if(b.keyCode===13){MF.Media.Fullscreen.imageClicked();Z=true;}}}}}}}if(Z){return MF.clearEvent(b);}};this.closeSlideshow=function(){J();C=true;$(document).unbind("keyup",this.handleArrowNav);$(window).unbind("resize",this.handleBrowserResize);MF.Dialog.remove();if(I){I();}};this.imageClicked=function(){MF.Media.Fullscreen.closeSlideshow();if(W&&W.imageUrl&&window.location.pathname!==W.imageUrl){window.location.href=W.imageUrl;}return false;};this.navigate=function(Z){return function(){J();if(Z){T();}else{V();}};};this.playSlideshow=function(){M();};this.toggleSlideshow=function(){X();};this.showControls=function(){if(H){clearTimeout(H);H=null;}if(!D){D=true;$("div.js-onhover").fadeIn("fast");}};this.hideControls=function(){if(D&&H==null){H=setTimeout(function(){D=false;H=null;$("div.js-onhover").fadeOut();},500);}};}).call(MF.Media.Fullscreen);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}if("undefined"===typeof MF.Media.MediaDetail){MF.Media.MediaDetail={};}MF.Media.MediaDetail.Slideshow=JsonML.BST([""," ",["div",{"class":"item-main","jbst:onload":function(){return this.flashClosure(this.data.videoUrl,this.data.showId);}}," ",["a",{id:"slideshow-player",href:"http://www.adobe.com/go/getflashplayer"}," ",["img",{src:function(){return this.data.imageUrl;}}]," ",["img",{src:"http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif",alt:"Get Adobe Flash player"}]],"\n"],"\n"]);(function(){this.flashClosure=function(A,B){return function(){var E=A.replace(/&/g,"%26").replace(/=/g,"%3D").replace(/\?/g,"%3F");var D=499;var C=550;swfobject.embedSWF("/Flash/viewer.swf","slideshow-player",D,C,"9","/Flash/SWFObject/expressInstall.swf",{showid:B,showurl:E,loadingurl:"blank",slideDimension:480},{allowfullscreen:"true",allowscriptaccess:"always",bgcolor:"#000000",loop:"false",menu:"false",quality:"high",wmode:"transparent"});};};}).call(MF.Media.MediaDetail.Slideshow);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}if("undefined"===typeof MF.Media.MediaDetail){MF.Media.MediaDetail={};}MF.Media.MediaDetail.Video=JsonML.BST([""," ",["div",{"class":"item-main","jbst:onload":function(){return this.flashClosure(this.data.videoUrl,this.data.imageUrl,this.data.contentId);}}," ",["a",{id:function(){return"video-player-"+this.data.contentId;},href:"http://www.adobe.com/go/getflashplayer"}," ",["img",{src:function(){return this.data.imageUrl;}}]," ",["img",{src:"http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif",alt:"Get Adobe Flash player"}]],"\n"],"\n"]);(function(){this.flashClosure=function(C,A,B){return function(){var E=625;var D=480;swfobject.embedSWF("/Flash/mediaplayer.swf","video-player-"+B,E,D,"9","/Flash/SWFObject/expressInstall.swf",{file:C,image:A,width:E,height:D,bufferlength:10},{allowfullscreen:"true",allowscriptaccess:"always",wmode:"transparent"});};};}).call(MF.Media.MediaDetail.Video);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.AlbumLightbox=JsonML.BST(["div"," ",["div",{"class":"section-title"}," ",["h3","Photos & Videos in this album"]," "],""," ",["div",{"class":"thumbnails"}," ",["ul"," ",function(){return JsonML.BST(MF.Media.AlbumLightboxItem).dataBind(this.data.items,this.index,this.count);}," "]," ",["div",{"jbst:visible":function(){return this.data.total===0;}}," ",["p",{"class":"no-content"},"There are no photos or videos in this album."]," ",["br"]," "]," "],""," "]);null;}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.AlbumLightboxItem=JsonML.BST(["li",["a",{href:function(){return this.data.url;}},["img",{src:function(){return this.data.imageUrl;},width:"64",height:"64"}]]]);null;}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.MediaModule=JsonML.BST([""," ",function(){this.contentType=this.data.contentType;}," ",["div",{"class":"js-MediaModule"}," ",function(){return JsonML.BST(MF.Toolbars.FilterBar).dataBind(this.getSortBarData(this.data),this.index,this.count);}," ",["div",{"class":function(){return"pvdisplay"+(this.data.contentType==="Video"||this.data.contentType==="Slideshow"?" videos":"");}}," ",function(){return JsonML.BST(MF.Media.MediaRow).dataBind(MF.splitArray(this.data.items,MF.Media.NumColumns),this.index,this.count);}," "]," ",""," ",["div",{"class":function(){return this.getNoResultsCss(this.data);},"jbst:visible":function(){return this.data.total===0;}}," ",["p",{"class":"no-content"},"No results match that criteria."]," "]," ",function(){return JsonML.BST(MF.Paging.Pager).dataBind(MF.Paging.Pager.buildData(this.data.start,this.getCount(),this.getTotal(),MF.Media.MediaModule.getMedia),this.index,this.count);}," "]]);(function(){this.getMedia=function(N,M){window.location.href=MF.Media.ThisUrl+H(N);};this.getCount=function(){if(this.data.start===0&&this.data.contentType==="Unknown"){return 60;}return this.data.count;};this.getTotal=function(){if(this.data.total>40&&this.data.contentType==="Unknown"){return this.data.total+20;}return this.data.total;};function H(M){var N="";if(M!==0){N="?start="+M;}var O=F.getSelectedAsString();if(O.length>0){if(N.length===0){N+="?";}else{N+="&";}N+="u="+O;}return N;}function J(M){window.location.href=M+H(0);}function E(){MF.Media.MediaModule.getMedia(0);}function K(P,M,O){if(O.selectedIdx===M){P.asc=!P.asc;}var N=MF.getQueryParam("start",true,0);MF.Media.Service.getMedia(B,L,MF.Media.MediaModule.contentType,null,M,P.asc,N,F.getSelectedUsers(),{onSuccess:function(Q){Q=MF.Media.MediaModule.bind(Q);$("div.js-MediaModule").replaceWith(Q);document.body.scrollIntoView(true);}});return true;}var L,B;var A=null;var G=null;var C;var F=new MF.Toolbars.FilterBarPeopleMenu.Menu(E);var I=new MF.Toolbars.FilterBarMenu.Menu("Sort",[{label:"Recent activity",asc:false},{label:"Date added",asc:false},{label:"Title",asc:true},{label:"Created by",asc:true},{label:"Date taken",asc:false}],K);var D=false;this.getSortBarData=function(M){if(!D){B=M.sortData.realStartIdx;L=M.count;if(M.canAdd&&M.contentType!=="Slideshow"){A=new MF.Toolbars.FilterBarButton.Button("Add more",MF.Media.UploadUrl);}C=new MF.Media.MediaToolbarMenu.Menu(M.contentType,MF.Media.MediaModule.hasSlideshows,J);I.setSelection(M.sortData.colIdx).asc=M.sortData.asc;D=true;}return{items:[A,C,F,I]};};this.getNoResultsCss=function(N){if(F.getSelectionType()>0){return"";}var M;if(this.data.contentType==="Video"){M="videos-empty";}else{if(this.data.contentType==="Image"){M="photos-empty";}else{if(this.data.contentType==="Slideshow"){M="slideshows-empty";}else{M="media-empty";}}}if(!this.data.canAdd){M+=" nopermission";}return M;};}).call(MF.Media.MediaModule);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.MediaItem=JsonML.BST(["div",{"class":"box"}," ",["table",{cellpadding:"0",cellspacing:"0"},["tr"," ",["td",{"class":function(){return"thumbnail"+(this.data.contentType==="Video"||this.data.contentType==="Slideshow"?" videothumb":"");}}," ",["div",{"class":"vidcontain"},["a",{href:function(){return this.data.url;}},["img",{src:function(){return this.data.imageUrl;}}],["span",{"class":"overlay"},"\u00A0"]]]," "]," "],["tr"," ",["td",{"class":"info"}," ",["p",{"class":"title"},["a",{href:function(){return this.data.url;}},function(){return this.data.title;}]]," ",["p",{"class":"date"},function(){return this.data.date;}]," ",["p",{"class":"meta","jbst:visible":function(){return this.data.viewCount>=0;}},function(){return this.data.viewCount;}," Views \u2022 ",["a",{href:function(){return this.data.url+"#comments";}},function(){return this.data.commentCount;}," Comments"]]," "]," "]]," "]);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.MediaRow=JsonML.BST(["div",{"class":"pvrow clearfix"}," ",function(){return JsonML.BST(MF.Media.MediaItem).dataBind(this.data,this.index,this.count);}," "]);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.MediaToolbarMenu=JsonML.BST([""," ",function(){this.bindTimeData=this.data;}," ",["p",{"class":"actions js-FilterMenuMedia"}," ",["a",{onclick:function(){return this.showColumnMenu;},href:"#","class":"smallbox"},"Show: ",["span",{"class":"current-filter"},function(){return this.data.items[this.data.selectedIdx].label;}]," ",["span","+"]]," ",["span",{"class":"content-filter-drop js-menumedia",style:"display:none"}," ",function(){return JsonML.BST([""," ",["a",{onclick:function(){return MF.Media.MediaToolbarMenu.itemClicked(MF.Media.MediaToolbarMenu.bindTimeData,this.index);},href:function(){return this.data.url;}},function(){return this.data.label;}]," "]).dataBind(this.data.items,this.index,this.count);}," "]," "]," "]);(function(){this.Menu=function(A,B,D){this.callback=D;this.type="mediamenu";this.jbst=MF.Media.MediaToolbarMenu;this.items=[];this.selectedIdx=0;this.items.push({label:"All media",url:MF.Media.MediaUrl,contentType:"Unknown"});this.items.push({label:"Photos",url:MF.Media.PhotosUrl,contentType:"Image"});this.items.push({label:"Videos",url:MF.Media.VideosUrl,contentType:"Video"});if(B){this.items.push({label:"Slideshows",url:MF.Media.SlideshowsUrl,contentType:"Slideshow"});}this.items.push({label:"Albums",url:MF.Media.AlbumsUrl,contentType:"Album"});for(var C=0;C<this.items.length;C++){if(this.items[C].contentType===A){this.selectedIdx=C;break;}}this.getSelection=function(){return this.items[this.selectedIdx];};this.setSelection=function(G){var E=Number(G);if(isNaN(E)){for(var F=0;F<this.items.length;F++){if(this.items[F]===G){this.selectedIdx=F;break;}}}else{this.selectedIdx=E;}return this.getSelection();};};this.showColumnMenu=function(B){B=B||window.event;var C=$(".js-menumedia");var A=!C.is(":visible");$("span.content-filter-drop").hide();if(A){C.toggle();$(document).one("click",function(){C.hide();});}MF.clearEvent(B);};this.itemClicked=function(B,A){return function(){if(B.selectedIdx!=A&&B.callback){B.callback(B.items[A].url);}return false;};};}).call(MF.Media.MediaToolbarMenu);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.EditMedia=JsonML.BST([""," ",function(){(function(){if(!MF.Media.EditMedia.unloadRegistered){MF.Media.EditMedia.unloadRegistered=true;if(window.addEventListener){window.addEventListener("beforeunload",MF.Media.EditMedia.onbeforeunload,false);}else{if(window.attachEvent){window.attachEvent("onbeforeunload",MF.Media.EditMedia.onbeforeunload);}else{var A=window.onbeforeunload;window.onbeforeunload=("function"===typeof A)?function(B){MF.Media.EditMedia.onbeforeunload(B);return A(B);}:MF.Media.EditMedia.onbeforeunload;}}}})();this.theData=this.data;}," ",["form",{"class":"js-EditMedia",id:"EditForm",onsubmit:"return false;"}," ",["div",{"class":"section-title","jbst:visible":function(){return this.isEditingAlbum();}}," ",["h3","Batch edit details"]," "]," ",["div",{"class":"twocol1wide","jbst:visible":function(){return this.isEditingAlbum();}}," ",["div",{"class":"column1"}," ",["label",{"for":""},"Album title"]," ",["input",{"class":"active",type:"text",name:"",value:function(){return this.getAlbumTitle(this.data);},onblur:function(){return this.updateAlbumTitle(this.data);}}]," ",["label",{"for":""},"Album description"]," ",["textarea",{"class":"active js-expand",onblur:function(){return this.updateAlbumDesc(this.data);}},function(){return this.getAlbumDesc(this.data);}]," ",function(){return JsonML.BST(MF.Help.FormatGuide).dataBind(this.data,this.index,this.count);}," "]," "]," ",["div",{"class":"section-title","jbst:visible":function(){return this.data.total>0;}}," ",["h3","Edit individual details"]," "],""," ",["div",{"class":"pvdisplay edit"}," ",function(){return JsonML.BST(MF.Media.EditMediaRow).dataBind(MF.splitArray(this.data.items,4),this.index,this.count);}," "]," ",function(){return JsonML.BST(MF.Paging.Pager).dataBind(MF.Paging.Pager.buildData(this.data.start,this.data.count,this.data.total,MF.Media.EditMedia.pageMedia(this.data.sourceId,this.data.sourceType)),this.index,this.count);}," ",["p",{"class":"submit"},["a",{"class":"positive",onclick:"MF.Media.EditMedia.saveChanges(this);return false;"},"Save all changes"]," or ",["a",{href:function(){return MF.Media.ReturnUrl;}},["strong",function(){return JsonFx.Lang.get("Global,Cancel");}]]]," "]]);(function(){this.AlbumMediaType=0;this.ActivityMediaType=1;this.SingleMediaType=2;var C="NOTSET";var A=C;var D=C;var B={};this.setDirty=function(E){var F=E.contentId.toString();B[F]=E;};this.getDataItem=function(E){var F=E.contentId.toString();if(B.hasOwnProperty(F)){return B[F];}return E;};this.pageMedia=function(F,E){return function(H,G){MF.Media.EditMedia.getMedia(H,G,F,E);};};this.getMedia=function(G,E,F,H){MF.Media.Service.getEditableMedia(G,E,F,H,{onSuccess:function(I){I=MF.Media.EditMedia.bind(I);$("form.js-EditMedia").replaceWith(I);document.body.scrollIntoView(true);}});};this.getDirtyItems=function(){var F=new Array();if(D!=C||A!=C){F.push({contentId:Number(MF.Media.EditMedia.theData.sourceId),contentType:"Album",dateTaken:new Date(),description:MF.Media.EditMedia.getAlbumDesc(MF.Media.EditMedia.theData),tags:MF.Media.EditMedia.theData.atags,title:MF.Media.EditMedia.getAlbumTitle(MF.Media.EditMedia.theData)});}for(var E in B){if(B.hasOwnProperty(E)){F.push(B[E]);}}return F;};this.saveChanges=function(F){var G=F.form;var E=MF.Media.EditMedia.getDirtyItems();if(E.length===0){window.location.href=MF.Media.ReturnUrl;}else{MF.Forms.disableSubmit(G);MF.Media.Service.updateMedia(MF.Media.EditMedia.theData.sourceId,MF.Media.EditMedia.theData.sourceType,E,{onSuccess:function(H){B={};D=C;A=C;if(G.markClean){G.markClean();}window.location.href=MF.Media.ReturnUrl;},onFailure:function(J,H,I){MF.Message.showError(G,"Error saving changes.",MF.Message.Scope.Column);if(MF.isDebug){;}},onComplete:function(){MF.Forms.enableSubmit(G);}});}};this.updateAlbumTitle=function(E){return function(){var F=this.value;if(E.atitle===F){A=C;}else{A=F;}};};this.updateAlbumDesc=function(E){return function(){var F=this.value;if(E.adesc===F){D=C;}else{D=F;}};};this.getAlbumTitle=function(E){if(A===C){return E.atitle;}return A;};this.getAlbumDesc=function(E){if(D===C){return E.adesc;}return D;};this.isEditingAlbum=function(){return this.theData.sourceType===this.AlbumMediaType;};this.onbeforeunload=function(E){E=E||window.event;var F=MF.Media.EditMedia.getDirtyItems();if(F.length>0){var G="You have unsaved changes. Are you sure you want to leave this page without saving?";if(E){E.returnValue=G;}return G;}};}).call(MF.Media.EditMedia);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.EditMediaRow=JsonML.BST(["div",{"class":"pvrow clearfix"}," ",function(){return JsonML.BST(MF.Media.EditMediaItem).dataBind(this.data,this.index,this.count);}," "]);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.EditMediaItem=JsonML.BST([""," ",function(){this.mydata=MF.Media.EditMedia.getDataItem(this.data);}," ",["div",{"class":function(){return"box"+(this.mydata.deleted?" deleted":"");},id:function(){return this.getName("box");}}," ",["p",{"class":"delete","jbst:visible":function(){return MF.Media.EditMedia.isEditingAlbum();}},["a",{onclick:function(){return this.toggleDeleted(this.mydata);},href:"#delete"},function(){return this.mydata.deleted?"Add back to":"Remove from";}," this album"]]," ",["table",{id:function(){return this.getName("table");},style:function(){return"opacity: "+(this.mydata.deleted?"0.2;":"1;");},cellpadding:"0",cellspacing:"0"},["tr",["td",{"class":function(){return"thumbnail"+(this.data.contentType==="Video"?" videothumb":"");}}," ",function(){return JsonML.BST(this.switchContentType).dataBind(this.mydata,this.index,this.count);}," "]]," ",["tr",["td",{"class":"info"}," ",["p",{"class":"title"},["input",{"class":"active",type:"text",name:function(){return this.getName("title");},value:function(){return this.mydata.title;},onblur:function(){return this.updateTitle(this.mydata);}}]]," ",["p",{"class":"desc"},["textarea",{name:function(){return this.getName("description");},"class":"js-InlineInstruction",title:"Add a description",onblur:function(){return this.updateDesc(this.mydata);}},function(){return this.mydata.description;}]]," ",["p",{"class":"date clearfix"},["label",{"for":""},"Date Taken:"]," ",["input",{"class":"active",type:"text",name:function(){return this.getName("datetaken");},value:function(){return this.formatDate(this.mydata.dateTaken);},onblur:function(){return this.updateDate(this.mydata);}}]]," ",["p",{"class":"tags clearfix"},["label",{"for":""},"Tags:"]," ",["input",{"class":"active",type:"text",name:function(){return this.getName("addtag");},value:"",onkeyup:function(){return this.keyDetect(this.mydata);}}]," ",["a",{"class":"positive",onclick:function(){return this.addTag(this.mydata);}},"Add"]]," ",["p",{"class":function(){return this.getName("tags-added js-TagList");}}," ",function(){return JsonML.BST(MF.Media.EditMediaItemTag).dataBind(this.getTagData(),this.index,this.count);}," "]," "]]]," "]," "]);(function(){this.updateTitle=function(A){return function(){var B=this.value;if(A.title!=B){A.title=B;MF.Media.EditMedia.setDirty(A);}};};this.updateDesc=function(A){return function(){var B=this.value;if(A.description!=B){A.description=B;MF.Media.EditMedia.setDirty(A);}};};this.updateDate=function(A){return function(){var C=MF.Media.EditMediaItem.formatDate(Date.parse(this.value));var B=MF.Media.EditMediaItem.formatDate(A.dateTaken);if(C.length===0&&this.value.length>0){this.value=B;}else{this.value=C;if(B!=C){A.dateTaken=Date.parse(C);MF.Media.EditMedia.setDirty(A);}}};};this.addTag=function(A){return function(){var G=document.forms[0][MF.Media.EditMediaItem.createElemName("addtag",A.contentId)];var D=G.value;var I=false;if(D.length>0){var J=D.split(",");for(var B=0;B<J.length;B++){var E=J[B].trim();if(E.length>0&&!MF.Media.EditMediaItem.doesTagExist(A,E)){I=true;var F=A.tags.push(E);F--;var C=MF.Media.EditMediaItemTag.bind(MF.Media.EditMediaItem.createTagData(A,F));var H=MF.Media.EditMediaItem.createElemName("p.js-TagList",A.contentId);$(C).appendTo(H);}}if(I){MF.Media.EditMedia.setDirty(A);G.value="";}}return false;};};this.doesTagExist=function(C,A){A=A.toLowerCase();for(var B=0;B<C.tags.length;B++){if(C.tags[B].toLowerCase()==A){return true;}}return false;};this.deleteTag=function(B,A){B.tags.splice(A,1);MF.Media.EditMedia.setDirty(B);};this.createElemName=function(A,B){return A+"_"+B;};this.createTagData=function(B,A){return{item:B,tagIdx:A};};this.keyDetect=function(A){return function(C){C=C?C:window.event;var B=Number(C.keyCode||C.charCode);switch(B){case 27:this.blur();return false;case 13:MF.Media.EditMediaItem.addTag(A)();return false;default:return true;}};};this.formatDate=function(A){if(A instanceof Date&&A.getUTCFullYear()>=1753){return A.toString(MF.ShortDateFormat);}return"";};this.getName=function(A){return this.createElemName(A,this.mydata.contentId);};this.getTagData=function(){var A=[];for(var B=0;B<this.mydata.tags.length;B++){A.push(this.createTagData(this.mydata,B));}return A;};this.toggleDeleted=function(A){return function(){A.deleted=!A.deleted;MF.Media.EditMedia.setDirty(A);var C=$("#"+MF.Media.EditMediaItem.createElemName("box",A.contentId));var B=$("#"+MF.Media.EditMediaItem.createElemName("table",A.contentId));if(A.deleted){C.addClass("deleted");B.fadeTo("fast",0.2);$(this).html("Add back to this album");}else{C.removeClass("deleted");B.fadeTo("fast",1);$(this).html("Remove from this album");}return false;};};this.switchContentType=function(){switch(this.data.contentType){case"Album":return MF.Media.MediaDetail.Album;case"Video":return MF.Media.EditMediaVideoItem;case"Image":default:return MF.Media.MediaDetail.Image;}};}).call(MF.Media.EditMediaItem);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.EditMediaVideoItem=JsonML.BST(["div",{"class":"vidcontain"}," ",["img",{src:function(){return this.data.imageUrl;}}]," ",["span",{"class":"overlay"}," "]," "]);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.EditMediaItemTag=JsonML.BST([""," ",function(){this.getTag=function(){return this.data.item.tags[this.data.tagIdx];};}," ",["span",{"class":"js-TagItem"},function(){return this.getTag();}," ",["a",{"class":"delete",href:"#",onclick:function(){return this.onDeleteClick(this.data);}},"Delete Tag"]]]);(function(){this.onDeleteClick=function(A){return function(){MF.Media.EditMediaItem.deleteTag(A.item,A.tagIdx);var B=$(this).parents(".js-TagItem");B.hide("fast",function(){B.remove();});return false;};};}).call(MF.Media.EditMediaItemTag);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.MediaNav=JsonML.BST([""," ",function(){this.lastAlbumId=this.data.albumId;}," ",["ul",{"class":"item-nav"}," ",function(){return JsonML.BST(MF.Media.MediaNavItem).dataBind(this.data.items,this.index,this.count);}," ",["li",{"class":"add-album js-addToAlbum","jbst:visible":function(){return this.data.canEdit;}},["a",{"class":"toggle-target",onclick:function(){return this.addToAlbum(this.data.id,this.data.items,this.data.type);},href:"#add"},"Add to another album"]]," "]," "]);(function(){var H=null,J=null,C,F,I,E=100;function B(N){var M={};for(var L=0;L<J.length;L++){M[String(J[L])]=true;}var K=MF.Dialog.ListSelect.bind({callback:D,count:N.count,hideSelected:true,items:N.items,moreCallback:G,selected:M,start:N.start,total:N.total});if(K){document.body.appendChild(K);}}function D(M){if(M.length===0){return;}var K=[];var L="";while(M.length){var N=M.shift();var O=Number(N.id);L+=N.label;K.push(O);J.push(O);if(L.length>0){L+=", ";}}MF.Media.Service.addContentToAlbums(F,K,{onSuccess:function(P){P=MF.Media.MediaNavItem.bind(P.items);P=$(P);$("li.js-addToAlbum").before(P).hide().show("slow");MF.Message.showInfo(null,I+" successfully added to "+L+".",MF.Message.Scope.Page,5000);}});}function G(L,K,M){E=K;MF.Media.Service.getAlbumList(L,E,{onSuccess:function(N){C=N.total;if(H){H=H.concat(N.items);}else{H=N.items;}M(N);}});}function A(K){if(K==="Image"){I="Photo";}else{I=K;}}this.addToAlbum=function(N,K,L){F=N;J=[];A(L);for(var M=0;M<K.length;M++){J.push(K[M].albumId);}return function(){F=N;if(H){var O=Math.max(0,H.length-E);B({start:O,count:E,total:C,items:H});}else{G(0,E,B);}return false;};};}).call(MF.Media.MediaNav);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.MediaNavItem=JsonML.BST(["li",{"class":function(){return this.getAlbumCss(this.data.albumId);}}," ",["a",{"class":"toggle-target",onclick:function(){return this.onOpenBrowse(this.data.contentId,this.data.albumId);},href:"#","jbst:onload":function(){return this.maybeOpenBrowse(this.data.contentId,this.data.albumId);}},function(){return this.data.title;}]," ",["div",{"class":"item-nav js-BrowseDiv"}," ",["p",{"class":"item-nav-heading"}," ",["a",{"class":"album-title",onclick:function(){return this.closeOpenedBrowse;},href:"#"},"Browse: ",function(){return this.data.title;}]," "]," ",["table",{"class":"newer",cellspacing:"0"},["tr",["td"," ",["span",{"class":"end"},"\u00A0"]," "]]]," ",["table",{"class":"older",cellspacing:"0"},["tr",["td"," ",["span",{"class":"end"},"\u00A0"]," "]]]," ",["p",{"class":"goto"},["a",{href:function(){return this.data.url;}},function(){return this.getGotoText(this.data.albumId,this.data.title);}]]," "]," "]);(function(){var B,A;function C(E,F,D){MF.Media.MediaNavItem.closeOpenedBrowse();E.addClass("js-OpenedNavItem");var G=E.next("div.js-BrowseDiv");E.hide();G.show();MF.Media.Service.getPrevNextMedia(F,D,MF.Media.ShareID,{onSuccess:function(H){var K,J;if(I){K=I.nextFull;J=I.prevFull;}E.addClass("js-OpenedNavItem");var L=E.next("div.js-BrowseDiv");E.hide();L.show();MF.Media.nextMediaUrl=H.nextUrl;var I=MF.Media.MediaNavThumbs.bind(H);L.html(I);if(K){A=new Image();A.src=K;}if(J){B=new Image();B.src=J;}}});}this.AllPhotostream=-1;this.UserPhotostream=0;this.onOpenBrowse=function(E,D){return function(){C(jQuery(this),E,D);return false;};};this.maybeOpenBrowse=function(E,D){return function(){if(D==MF.Media.MediaNav.lastAlbumId){C(jQuery(this),E,D);}};};this.closeOpenedBrowse=function(){$("div.js-BrowseDiv").hide();var D=$("a.js-OpenedNavItem");D.removeClass("js-OpenedNavItem");D.show();};this.getGotoText=function(D,E){if(D===MF.Media.MediaNavItem.AllPhotostream){return"Go to all photos & videos »";}else{if(D===MF.Media.MediaNavItem.UserPhotostream){return"Go to all items from member »";}else{if(E){return"Go to album »";}else{return"Go to items »";}}}};this.getAlbumCss=function(D){var E;if(D===this.AllPhotostream){E="all ";}else{if(D===this.UserPhotostream){E="all-person ";}else{E="";}}return E+"js-browse"+D;};}).call(MF.Media.MediaNavItem);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.MediaNavThumbs=JsonML.BST([""," ",function(){if(!this.keypressRegistered){this.keypressRegistered=true;$().keyup(this.handleArrowNav);}this.prevStyle="background: url("+this.data.prev+") no-repeat 50% 50%;";this.nextStyle="background: url("+this.data.next+") no-repeat 50% 50%;";this.nextUrl=this.data.hasNext?this.data.nextUrl:null;this.prevUrl=this.data.hasPrev?this.data.prevUrl:null;this.curAlbumId=this.data.albumId;this.curContentId=this.data.contentId;}," ",["p",{"class":"item-nav-heading"}," ",["a",{onclick:function(){return this.clickSlideshow(this.data.contentId);},href:"#slideshow","class":"item-slideshow"},"Play slideshow"]," ",["a",{"class":"album-title",href:"#",onclick:function(){return this.data.title?MF.Media.MediaNavItem.closeOpenedBrowse:function(){return false;};}},"Browse: ",function(){return this.data.title;}]," ",["a",{"class":"negative",onclick:function(){return this.promptDelete(this.data.albumId,this.data.title,this.data.contentId);},"jbst:visible":function(){return this.data.canEA;},href:"#",title:"Remove from Album"},"Remove from Album"]," "]," ",["table",{"class":"newer",cellspacing:"0"},["tr"," ",["td",{"class":function(){return this.data.prevIsVideo?" videothumb":null;}}," ",["div",{"class":"vidcontain","jbst:visible":function(){return this.data.hasPrev;}}," ",["a",{"class":"overlay",href:function(){return this.data.prevUrl;},style:function(){return this.prevStyle;}}," ",["span",{"class":"overlay"},"\u00A0"]," ",["span","\u00AB ",function(){return(this.data.albumId>0)?"Previous":"Newer";}]," "]," "]," ",["span",{"class":"end","jbst:visible":function(){return !this.data.hasPrev;}},"You are at the ",function(){return(this.data.albumId>0)?"first":"newest";}," item"]," "]," "]]," ",["table",{"class":"older",cellspacing:"0"},["tr"," ",["td",{"class":function(){return this.data.nextIsVideo?" videothumb":null;}}," ",["div",{"class":"vidcontain","jbst:visible":function(){return this.data.hasNext;}}," ",["a",{"class":"overlay",href:function(){return this.data.nextUrl;},style:function(){return this.nextStyle;}}," ",["span",{"class":"overlay"},"\u00A0"]," ",["span",function(){return this.data.albumId>0?"Next":"Older";}," \u00BB"]," "]," "]," ",["span",{"jbst:visible":function(){return !this.data.hasNext;},"class":"end"},"You are at the ",function(){return this.data.albumId>0?"last":"oldest";}," item"]," "]," "]]," ",["p",{"class":"goto"},["a",{href:function(){return this.data.url;}}," ",function(){return MF.Media.MediaNavItem.getGotoText(this.data.albumId,this.data.title);}]]," "]);(function(){var A=false;this.handleArrowNav=function(D){if(A){return;}var C=D||window.event;var B=C.srcElement||C.target;if(B&&B.form){return;}if(C.keyCode==39){if(MF.Media.MediaNavThumbs.nextUrl&&MF.Media.MediaNavThumbs.nextUrl.length>0){window.location.href=MF.Media.MediaNavThumbs.nextUrl;}}else{if(C.keyCode==37){if(MF.Media.MediaNavThumbs.prevUrl&&MF.Media.MediaNavThumbs.prevUrl.length>0){window.location.href=MF.Media.MediaNavThumbs.prevUrl;}}else{if(C.keyCode===179){MF.Media.MediaNavThumbs.viewFullscreen(MF.Media.MediaNavThumbs.curContentId);return MF.clearEvent(C);}}}};this.promptDelete=function(B,D,C){return function(){MF.Dialogs.ConfirmDeleteDialog.showDlg(B,this,"Are you sure you want to remove this item from the album '"+D+"'? This item will not be deleted, it will just not appear in the album any longer.",function(F,E,G){MF.Media.Service.removeFromAlbum(B,C,{onSuccess:function(H){MF.Message.showInfo(E,"Removed from album",MF.Message.Scope.Page,5000);$("li.js-browse"+B).hide("slow");},onComplete:function(){G();}});},"Remove Item","Don't Remove");return false;};};this.viewFullscreen=function(D,B,C){A=true;if("undefined"===typeof B||B===null){if("undefined"===typeof MF.Media.MediaNavThumbs.curAlbumId){if("undefined"===typeof MF.Media.ShareID){B=-1;}else{B=-10;}}else{B=MF.Media.MediaNavThumbs.curAlbumId;}}MF.Media.Fullscreen.show(D,B,function(){A=false;});if("undefined"===typeof C||C){MF.Media.Fullscreen.playSlideshow();}};this.clickSlideshow=function(B){return function(){MF.Media.MediaNavThumbs.viewFullscreen(B);return false;};};}).call(MF.Media.MediaNavThumbs);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.SelectMedia=JsonML.BST([""," ",function(){this.albumId=this.data.albumId;}," ",["form",{"class":"js-UnsavedData",id:"SelectForm",method:"post",title:"You have unsaved changes. Are you sure you want to leave this page?",action:function(){return this.data.returnUrl;}}," ",["div",{"class":"admin"}," ",["p",["a",{href:"http://#",onclick:"MF.Media.SelectMedia.selectPage(true);return false;","class":"pv-select-all"},"Select All on Page"]]," ",["p",["a",{href:"http://#",onclick:"MF.Media.SelectMedia.selectPage(false);return false;","class":"pv-deselect-all"},"Deselect All on Page"]]," "]," ",["div",{"class":"js-SelectMediaThumbs pvdisplay select"}," ",function(){return JsonML.BST(MF.Media.SelectMediaRow).dataBind(MF.splitArray(this.data.items,7),this.index,this.count);}," "]," ",function(){return JsonML.BST(MF.Paging.Pager).dataBind(MF.Paging.Pager.buildData(this.data.start,this.data.count,this.data.total,this.pageMedia(this.data.albumId)),this.index,this.count);}," ",["p",{"class":"submit"},["a",{"class":"positive",onclick:"MF.Media.SelectMedia.addToAlbum(this);return false;"},"Add To Album"]," or ",["a",{href:function(){return this.data.returnUrl;}},["strong",function(){return JsonFx.Lang.get("Global,Cancel");}]]]," "]]);(function(){this.albumId=0;this.media=[];this.addSelectedMedia=function(A){if(!MF.Media.SelectMedia.isSelectedMedia(A)){MF.Media.SelectMedia.media.push(A);}};this.addToAlbum=function(A){var B=A.form;if(MF.Media.SelectMedia.media.length===0){window.location.href=B.action;}else{MF.Forms.disableSubmit(B);MF.Media.Service.addToAlbum(MF.Media.SelectMedia.albumId,MF.Media.SelectMedia.media,{onSuccess:function(C){MF.Media.SelectMedia.media=[];if(B.markClean){B.markClean();}window.location.href=C;},onFailure:function(E,C,D){MF.Message.showError(B,"Error saving changes: "+D.message,MF.Message.Scope.Column);if(MF.isDebug){;}},onComplete:function(){MF.Forms.enableSubmit(B);}});}};this.ensureSelectedMedia=function(){$(".js-SelectMediaThumbs table").each(function(){var A=$(this).find("input[type=checkbox]");if(A&&MF.Media.SelectMedia.isSelectedMedia(parseInt(A.attr("value"),10))){MF.Media.SelectMediaItem.select(this);MF.Media.SelectMediaItem.highlight(this,true);}});};this.getMedia=function(A,B,C){MF.Media.Service.getMediaNotInAlbum(A,B,C,{onSuccess:function(D){$("div.js-Pagination").replaceWith(MF.Paging.Pager.bind(MF.Paging.Pager.buildData(D.start,D.count,D.total,MF.Media.SelectMedia.pageMedia(D.albumId))));D=MF.Media.SelectMediaRow.bind(MF.splitArray(D.items,7));$("div.js-SelectMediaThumbs").empty().append(D);MF.Media.SelectMedia.ensureSelectedMedia();document.body.scrollIntoView(true);}});};this.isSelectedMedia=function(A){return jQuery.inArray(A,MF.Media.SelectMedia.media)>=0;};this.pageMedia=function(A){return function(C,B){MF.Media.SelectMedia.getMedia(A,C,B);};};this.removeSelectedMedia=function(A){var B=jQuery.inArray(A,MF.Media.SelectMedia.media);if(B>=0){MF.Media.SelectMedia.media.splice(B,1);}};this.selectPage=function(A){$(".js-SelectMediaThumbs table").each(function(){if(A){var B=$(this).find("input[type=checkbox]");if(B&&!B.is(":checked")){B.attr("checked","checked");MF.Media.SelectMedia.addSelectedMedia(parseInt(B.attr("value"),10));}MF.Media.SelectMediaItem.highlight(this,true);}else{var B=$(this).find("input[type=checkbox]");if(B&&B.is(":checked")){B.removeAttr("checked");MF.Media.SelectMedia.removeSelectedMedia(parseInt(B.attr("value"),10));}MF.Media.SelectMediaItem.highlight(this,false);}});};}).call(MF.Media.SelectMedia);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.SelectMediaRow=JsonML.BST(["div",{"class":"pvrow clearfix"}," ",function(){return JsonML.BST(MF.Media.SelectMediaItem).dataBind(this.data,this.index,this.count);}," "]);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.SelectMediaItem=JsonML.BST(["div",{"class":"box"}," ",["table",{cellpadding:"0",cellspacing:"0",onclick:"MF.Media.SelectMediaItem.select(this);",onmouseover:"MF.Media.SelectMediaItem.highlight(this, true);",onmouseout:"MF.Media.SelectMediaItem.highlight(this, false);"}," ",["tr",["td",{"class":function(){return"thumbnail"+(this.data.contentType==="Video"||this.data.contentType==="Slideshow"?" videothumb":"");}}," ",["div",{"class":"vidcontain"},["img",{src:function(){return this.data.imageUrl;}}],["span",{"class":"overlay"},"\u00A0"]]," "]]," ",["tr",["td",{"class":"info"}," ",["input",{type:"checkbox",value:function(){return this.data.contentId;},onmouseup:"MF.Media.SelectMediaItem.select(this);"}]," ",["p",{"class":"title"},function(){return this.data.title;}]," "]]]," "]);(function(){this.highlight=function(A,B){var C=$(A).find("td");if(C){if(B){C.addClass("active");}else{if(!$(C).find("input[type=checkbox]").is(":checked")){C.removeClass("active");}}}};this.select=function(B){A=$(B);if(B.tagName.toLowerCase()!=="input"){var A=$(B).find("input[type=checkbox]");}if(!A.is(":checked")){A.attr("checked","checked");MF.Media.SelectMedia.addSelectedMedia(parseInt(A.attr("value"),10));}else{A.removeAttr("checked");MF.Media.SelectMedia.removeSelectedMedia(parseInt(A.attr("value"),10));}};}).call(MF.Media.SelectMediaItem);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.RecentAlbums=JsonML.BST(["div",{"jbst:visible":function(){return this.data.total>0;}}," ",["div",{"class":"section-title"}," ",["h3","Latest albums ",["em","(",function(){return this.data.items.length;}," of ",function(){return this.data.total;}," total)"]],["a",{"class":"viewall",href:function(){return this.data.albumsUrl;}},"View all"]," "],""," ",["div",{"class":"pvdisplay albums albums-sidebar"}," ",function(){return JsonML.BST(MF.Media.AlbumItem).dataBind(this.data.items,this.index,this.count);}," "]," ",["div",{"jbst:visible":function(){return this.data.total===0;}}," ",["p",{"class":"no-content"},"There are no albums to display."]," ",["br"]," "]," ",["p",{"class":"extra","jbst:visible":function(){return this.data.total>3;}},["a",{href:function(){return this.data.albumsUrl;}},"View all albums \u00BB"]]," "]);null;}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.AlbumsModule=JsonML.BST(["div",{"class":"js-AlbumModule"}," ",function(){return JsonML.BST(MF.Toolbars.FilterBar).dataBind(this.getSortBarData(this.data),this.index,this.count);}," ",["div",{"class":"pvdisplay albums albums-full"}," ",function(){return JsonML.BST(MF.Media.AlbumRow).dataBind(MF.splitArray(this.data.items,5),this.index,this.count);}," "]," ",["div",{"class":function(){return this.getNoResultsCss(this.data);},"jbst:visible":function(){return this.data.total===0;}}," ",["p",{"class":"no-content"},"No results match that criteria."]," "]," ",function(){return JsonML.BST(MF.Paging.Pager).dataBind(MF.Paging.Pager.buildData(this.data.start,this.data.count,this.data.total,MF.Media.AlbumsModule.getAlbums),this.index,this.count);}," "]);(function(){function H(L){var M="";if(L!==0){M="?start="+L;}var N=F.getSelectedAsString();if(N.length>0){if(M.length===0){M+="?";}else{M+="&";}M+="u="+N;}return M;}function J(L){window.location.href=L+H(0);}function E(){MF.Media.AlbumsModule.getAlbums(0);}function B(O,L,N){if(N.selectedIdx===L){O.asc=!O.asc;}var M=MF.getQueryParam("start",true,0);MF.Media.Service.getAlbums(M,K,null,L,O.asc,F.getSelectedUsers(),{onSuccess:function(P){P=MF.Media.AlbumsModule.bind(P);$("div.js-AlbumModule").replaceWith(P);document.body.scrollIntoView(true);}});return true;}var K;var A=null;var G=null;var C;var F=new MF.Toolbars.FilterBarPeopleMenu.Menu(E);var I=new MF.Toolbars.FilterBarMenu.Menu("Sort",[{label:"Recent activity",asc:false},{label:"Date added",asc:false},{label:"Title",asc:true},{label:"Author",asc:true}],B);var D=false;this.getSortBarData=function(L){if(!D){K=L.count;if(L.canAdd){A=new MF.Toolbars.FilterBarButton.Button("Create new album",MF.Media.CreateAlbumUrl);}C=new MF.Media.MediaToolbarMenu.Menu("Album",MF.Media.AlbumsModule.hasSlideshows,J);I.setSelection(L.sortData.colIdx).asc=L.sortData.asc;D=true;}return{items:[A,C,F,I]};};this.getAlbums=function(M,L){window.location.href=MF.Media.ThisUrl+H(M);};this.getNoResultsCss=function(L){if(F.getSelectionType()>0){return"";}else{return("albums-empty"+(L.canAdd?"":" nopermission"));}};}).call(MF.Media.AlbumsModule);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.AlbumItem=JsonML.BST([""," ",["div",{"class":"box"}," ",["div",{"class":"album"}," ",["img",{src:function(){return this.data.imageUrls[0];},"jbst:visible":function(){return this.data.imageUrls.length>0;}}],["img",{src:function(){return this.data.imageUrls[1];},"jbst:visible":function(){return this.data.imageUrls.length>1;}}],["img",{src:function(){return this.data.imageUrls[2];},"jbst:visible":function(){return this.data.imageUrls.length>2;}}],["img",{src:function(){return this.data.imageUrls[3];},"jbst:visible":function(){return this.data.imageUrls.length>3;}}],["img",{src:function(){return this.data.imageUrls[4];},"jbst:visible":function(){return this.data.imageUrls.length>4;}}],["img",{src:function(){return this.data.imageUrls[5];},"jbst:visible":function(){return this.data.imageUrls.length>5;}}]," "]," ",["a",{href:function(){return this.data.url;},"class":"album-link"},"\u00A0"]," ",["div",{"class":"info"}," ",["p",{"class":"title"},["a",{href:function(){return this.data.url;}},function(){return this.data.title;}]]," ",["p",{"class":"date"},"Added ",function(){return this.data.date;}]," ",["p",{"class":"date"},"Created by ",["a",{href:function(){return this.data.authorUrl;}},function(){return this.data.authorName;}]]," ",["p",{"class":"meta"},function(){return this.data.viewCount;}," Views \u2022 ",["a",{href:function(){return this.data.url+"#comments";}},function(){return this.data.commentCount;}," Comments"]]," "]," "]," ",""," "]);null;}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.AlbumRow=JsonML.BST(["div",{"class":"pvrow clearfix"}," ",function(){return JsonML.BST(MF.Media.AlbumItem).dataBind(this.data,this.index,this.count);}," "]);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.AlbumName=JsonML.BST([""," ",["div",{"class":"page-title"}," ",["h2",["a",{href:function(){return this.data.albumsUrl;}},"Albums"]," \u00BB ",["span",{ondblclick:function(){return this.viewFullscreen(this.data.contentId);}},["strong",function(){return this.data.title;}]]]," "]," ",["p",{"class":"meta album-single"},"Created ",function(){return this.data.date;}," by ",["a",{href:function(){return this.data.authorUrl;}},["strong",function(){return this.data.authorName;}]]," ",["span","\u2022"]," ",function(){return this.data.imageCount;}," Photos & ",function(){return this.data.videoCount;}," Videos ",["span","\u2022"]," ",function(){return this.data.viewCount;}," Views ",["span","\u2022"]," ",["a",{href:"#comments"},function(){return this.data.commentCount;}," Comments"]," ",["span",{"jbst:visible":function(){return this.data.canDelete;}},"\u2022"],["span",{"jbst:visible":function(){return this.data.canDelete;}},["a",{"class":"edit",href:function(){return this.data.editUrl;}},"Edit album"]," or ",["a",{"class":"delete",onclick:function(){return MF.Dialogs.ConfirmDeleteDialog.confirm(this.data.contentId,this.deleteAlbum);},href:"#"},"delete album"]]]," "]);(function(){this.deleteAlbum=function(B,A,C){MF.Media.Service.deleteMedia(B,{onSuccess:function(D){if("function"===typeof C){C();}window.location=D.url;}});};this.viewFullscreen=function(A){return function(B){if(MF.Media.AlbumMediaModule&&MF.Media.AlbumMediaModule.firstId&&MF.Media.MediaNavThumbs&&MF.Media.MediaNavThumbs.viewFullscreen){MF.Media.MediaNavThumbs.viewFullscreen(MF.Media.AlbumMediaModule.firstId,A);}};};}).call(MF.Media.AlbumName);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.AlbumMediaModule=JsonML.BST([""," ",function(){this.setPinned(this.data.pinned);this.albumId=this.data.contentId;if(this.data.items&&this.data.items.length>0){this.firstId=this.data.items[0].id;}}," ",["div",{"class":"js-AlbumMediaModule"}," ",["div",{"class":"admin","jbst:visible":function(){return this.data.canAdd||this.data.canShare||this.data.canCopy;}}," ",["p",{"class":"add create-media","jbst:visible":function(){return this.data.canAdd;}},["a",{"class":"thickbox add-to-existing-album",onclick:function(){return MF.Media.AddToAlbumDialog.show(MF.Media.AddUrl,MF.Media.UploadUrl);},href:"#add"},"Add to Album"]]," ",["p",{"jbst:visible":function(){return this.data.total>0;}},["a",{onclick:function(){return this.viewFullscreen(this.data.contentId);},href:"#slideshow","class":"item-slideshow"},"Play slideshow"]]," ",["p",{"jbst:visible":function(){return this.data.total>0&&this.data.arrangeUrl.length>0;}},["a",{href:function(){return this.data.arrangeUrl;}},"Arrange album"]]," ",["p",{"jbst:visible":function(){return this.data.total>0&&this.data.canAdd;}},["a",{onclick:function(){return this.pinAlbum(this.data.contentId);},href:"#pin"},function(){return this.getPinnedText(this.data.pinned);}]]," ",["p",{"jbst:visible":function(){return this.data.total>0&&this.data.canShare;}},["a",{onclick:function(){return this.showShareDialog(this.data.contentId);},href:"#share","class":"item-share"},"Share album"]]," ",["p",{"jbst:visible":function(){return this.data.total>0&&this.data.canCopy;}},["a",{onclick:function(){return this.showCopyToDialog(this.data.contentId);},href:"#copy","class":"item-copy"},"Copy album to another group"]]," ",["p",{"jbst:visible":function(){return this.data.canAdd;}},["a",{"class":function(){return this.getFavoriteCss(this.data.isFavorite);},href:"#love",onclick:function(){return this.markFavorite(this.data.contentId,this.data.isFavorite);}},function(){return this.getFavoriteText(this.data.isFavorite);}]]," "]," ",["div",{"class":"pvdisplay album","jbst:visible":function(){return this.data.total>0;}}," ",function(){return JsonML.BST(MF.Media.MediaRow).dataBind(MF.splitArray(this.data.items,5),this.index,this.count);}," "]," ",["div",{"class":function(){return this.data.canAdd?"album-empty":"no-content";},"jbst:visible":function(){return this.data.total===0;}}," ",["p",{"class":"no-content"},"This album is empty"]," ",["p",{"jbst:visible":function(){return !this.data.canAdd;}},["br"]]," "]," ",function(){return JsonML.BST(MF.Paging.Pager).dataBind(MF.Paging.Pager.buildData(this.data.start,this.data.count,this.data.total,this.pageMedia(this.data.contentId)),this.index,this.count);}," "]," "]);(function(){var A=false;this.pageMedia=function(B){return function(D,C){if(MF.Media.AlbumMediaModule.ajaxPaging){MF.Media.Service.getAlbumMedia(B,D,C,{onSuccess:function(F){F=MF.Media.AlbumMediaModule.bind(F);$("div.js-AlbumMediaModule").replaceWith(F);document.body.scrollIntoView(true);}});}else{if(D===0){window.location.href=MF.Media.ThisUrl;}else{var E=MF.Media.ThisUrl;if(E.indexOf("?")!=-1){E+="&";}else{E+="?";}E+="start="+D;window.location.href=E;}}};};this.setPinned=function(B){A=B;};this.arrangeAlbum=function(){alert("TODO: Implement arrange album functionality");return false;};this.getPinnedText=function(B){if(B){return"Unpin album from homepage";}else{return"Pin album to homepage";}};this.pinAlbum=function(B){return function(){var C=this;MF.Media.Service.pinContent(B,!A,{onSuccess:function(D){A=D.pinned;$(C).html(MF.Media.AlbumMediaModule.getPinnedText(A));}});return false;};};this.showShareDialog=function(B){return function(){MF.Share.ShareDialog.showDlg(B);return false;};};this.getFavoriteText=function(B){if(B){return"You love this";}else{return"Love this";}};this.getFavoriteCss=function(B){if(B){return"item-fave active";}else{return"item-fave";}};this.markFavorite=function(C,B){return function(){var D=$(this);MF.Favorite.Service.markFavorite(C,!B,"Album",{onSuccess:function(E){B=E.isFavorite;D.toggleClass("active");$(D).html(MF.Media.ActionLinks.getFavoriteText(B));$(".js-favoritesList").replaceWith(MF.Favorite.FavoriteList.bind(E.favoritesList));}});};};this.showCopyToDialog=function(B){return function(){MF.SiteCopy.SitePickerDialog.show(B);return false;};};this.viewFullscreen=function(B){return function(C){if(MF.Media.AlbumMediaModule&&MF.Media.AlbumMediaModule.firstId&&MF.Media.MediaNavThumbs&&MF.Media.MediaNavThumbs.viewFullscreen){MF.Media.MediaNavThumbs.viewFullscreen(MF.Media.AlbumMediaModule.firstId,B);}return false;};};}).call(MF.Media.AlbumMediaModule);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.AlbumEdit=JsonML.BST(["form",{"class":"js-UnsavedData",id:"AlbumEdit",method:"post",title:"You haven't saved your album yet. Are you sure you want to navigate away from this page?",onsubmit:"return false;"}," ",["div",{"class":"section-title"}," ",["h3","Album Details"]," "]," ",["div",{"class":"twocol1wide"}," ",["div",{"class":"column1"}," ",["label",{"for":""},"Album Title"]," ",["input",{"class":"active",type:"text",name:"atitle",value:"","jbst:onload":"this.focus()"}]," ",["label",{"for":""},"Album Description"]," ",["textarea",{name:"adesc","class":"active js-expand"}]," ",function(){return JsonML.BST(MF.Help.FormatGuide).dataBind(this.data,this.index,this.count);}," "]," "]," ",["p",{"class":"submit"},["a",{"class":"positive",onclick:"MF.Media.AlbumEdit.saveChanges(this);return false;"},function(){return JsonFx.Lang.get("Global,SaveChanges");}]," or ",["a",{href:function(){return MF.Media.AlbumsUrl;}},["strong",function(){return JsonFx.Lang.get("Global,Cancel");}]]]," "]);(function(){this.saveChanges=function(A){var B=A.form;MF.Message.clear(B,MF.Message.Scope.Column);var C=MF.Forms.getFormData(B);if(!C.atitle){MF.Message.showError(B,"Please enter a title.",MF.Message.Scope.Column);return false;}MF.Forms.disableSubmit(B);MF.Media.Service.createAlbum(C.atitle,C.adesc,{onSuccess:function(D){if(B.markClean){B.markClean();}window.location.pathname=D.url;},onComplete:function(){MF.Forms.enableSubmit(B);}});};}).call(MF.Media.AlbumEdit);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.AddToAlbumDialog=JsonML.BST(function(){var A=JsonML.BST([""," ",["p",{"class":"submit"}," ",["a",{"class":"positive",href:function(){return this.data.uploadUrl;}},"Upload from Computer"]," or ",["a",{"class":"positive",href:function(){return this.data.addUrl;}},"Choose from this family group"]," "]," "]);A.prototype=this;return JsonML.BST(MF.Dialog).dataBind({height:100,width:350,modal:false,data:this.data},this.index,this.count,A);});(function(){this.show=function(A,B){return function(){var C=MF.Media.AddToAlbumDialog.bind({addUrl:A,uploadUrl:B});if(C){document.body.appendChild(C);}if(JsonFx.userAgent.ie<7){document.body.scrollIntoView(true);}return false;};};}).call(MF.Media.AddToAlbumDialog);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.Arrange=JsonML.BST([""," ",function(){this.updateCurrentData(this.data);}," ",["form",{"class":"js-UnsavedData js-Arrange",id:"ArrangeForm",onsubmit:"return false;",title:"You have unsaved changes. Are you sure you want to leave this page?"}," ",function(){return JsonML.BST(MF.Toolbars.SortToolbar).dataBind(this.getSortBarData(),this.index,this.count);}," ",["p",{"class":"submit first","jbst:visible":function(){return this.data.total>60;}},["a",{onclick:"MF.Media.Arrange.saveArrangement(this);return false;","class":"positive"},"Save arrangement"]," or ",["a",{href:function(){return this.cancelUrl;}},function(){return JsonFx.Lang.get("Global,Cancel");}]]," ",["div",{id:"sortable","class":"pvdisplay album","jbst:onload":function(){return this.enableSort;}}," ",function(){return JsonML.BST(MF.Media.ArrangeItem).dataBind(this.data.items,this.index,this.count);}," "]," ",function(){return JsonML.BST(MF.Paging.Pager).dataBind(MF.Paging.Pager.buildData(this.data.start,this.data.count,this.data.total,this.pageMedia(this.data.albumId)),this.index,this.count);}," ",["p",{"class":"submit"},["a",{"class":"positive",onclick:"MF.Media.Arrange.saveArrangement(this);return false;"},"Save arrangement"]," or ",["a",{href:function(){return this.cancelUrl;}},["strong",function(){return JsonFx.Lang.get("Global,Cancel");}]]]," "]," "]);(function(){var G={},H=null,F=false,C=false;function B(N){var M=MF.Media.Arrange.bind(N);$("form.js-Arrange").replaceWith(M);document.body.scrollIntoView(true);}function D(N){var O=N.length;if(O==0){return false;}while(--O){var P=Math.floor(Math.random()*(O+1));var M=N[O];var Q=N[P];N[O]=Q;N[P]=M;}}function A(){if(F){var M={};for(var Q=0;Q<H.items.length;Q++){var R=H.items[Q];M[R.contentId.toString()]=R;}var P=[];var O=$("#sortable div:first");while(O.length>0){var N=O.data("contentId");var R=M[N.toString()];P.push(R);O=O.next();}H.items=P;F=false;}}function L(){C=true;H.modified=true;}function J(M,O,N){if(O===N){return 0;}else{if(O>N){return M?1:-1;}else{return M?-1:1;}}}function I(){if(H.sortColumnIdx>=0){H.sortColumnIdx=-1;MF.Toolbars.SortToolbar.rebindToolbar(MF.Media.Arrange.getSortBarData(H));}}this.pageMedia=function(M){return function(P,N){A();var O=P.toString();if(G.hasOwnProperty(O)){B(G[O]);}else{MF.Media.Service.getArrangeableAlbumMedia(M,P,N,{onSuccess:B});}};};this.saveArrangement=function(O){A();if(C){pages=[];for(var N in G){var R=G[N];if(R.modified){var M={};pages.push(M);M["start"]=R.start;var P=[];for(var Q=0;Q<R.items.length;Q++){P.push(R.items[Q].contentId);}M["items"]=P;}}MF.Media.Service.saveAlbumOrder(H.albumId,pages,{onSuccess:function(S){window.location.href=S.url;}});}else{window.location.href=MF.Media.Arrange.cancelUrl;}};this.enableSort=function(){$("#sortable").sortable({update:function(){F=true;L();I();}});};this.randomize=function(){L();H.sortColumnIdx=-1;D(H.items);B(H);return false;};this.updateCurrentData=function(N){H=N;var M=N.start.toString();if(!G.hasOwnProperty(N.start.toString())){G[M]=N;}};this.sortItems=function(O,M){H.sortColumnIdx=MF.Toolbars.SortToolbar.getSortIdx();var P=MF.Toolbars.SortToolbar.isSortAsc();var N=null;switch(H.sortColumnIdx){case 0:N=function(Q,R){return J(P,Q.title,R.title);};break;case 1:N=function(Q,R){return J(P,Q.dateCreated,R.dateCreated);};break;case 2:N=function(Q,R){return J(P,Q.dateTaken,R.dateTaken);};break;}H.items.sort(N);L();B(H);};var E=new Array("Title","Date created","Date taken");var K=new Array(true,true,true);this.getSortBarData=function(){return{columns:E,custom2:{jbst:MF.Media.ArrangeActions,data:{}},displayMode:0,initialColSortAsc:K,isListMode:false,newBtnText:"",sortCallback:MF.Media.Arrange.sortItems,sortIdx:H&&"undefined"!==typeof H.sortColumnIdx?H.sortColumnIdx:-1,showListModeBtns:false};};}).call(MF.Media.Arrange);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.ArrangeItem=JsonML.BST(["div",{"class":function(){return"ui-state-default thumbnail square"+(this.data.contentType==="Video"||this.data.contentType==="Slideshow"?" videothumb":"");},"jbst:onload":function(){return this.setData(this.data);}},["div",{"class":"vidcontain"},["img",{src:function(){return this.data.square;},width:"90",height:"90",title:function(){return this.data.title?this.data.title.replace(/\"/g,"'"):"";}}],["span",{"class":"overlay"},"\u00A0"]]," "]);(function(){this.setData=function(A){return function(){$(this).data("contentId",A.contentId);};};}).call(MF.Media.ArrangeItem);}catch(ex){}try{var MF;if("undefined"===typeof MF){MF={};}if("undefined"===typeof MF.Media){MF.Media={};}MF.Media.ArrangeActions=JsonML.BST(["p",{"class":"sort shuffle"},["a",{onclick:function(){return MF.Media.Arrange.randomize;},href:"#randomize","class":"last"},"Shuffle"]]);}catch(ex){}