var swfobject=function(){function d(){if(!H){try{var a=i.getElementsByTagName("body")[0].appendChild(i.createElement("span"));a.parentNode.removeChild(a)}catch(b){return}H=true;a=N.length;for(var c=0;c<a;c++)N[c]()}}function v(a){if(H)a();else N[N.length]=a}function s(a){if(typeof w.addEventListener!=p)w.addEventListener("load",a,false);else if(typeof i.addEventListener!=p)i.addEventListener("load",a,false);else if(typeof w.attachEvent!=p)V(w,"onload",a);else if(typeof w.onload=="function"){var b=
w.onload;w.onload=function(){b();a()}}else w.onload=a}function n(){var a=i.getElementsByTagName("body")[0],b=i.createElement(z);b.setAttribute("type",O);var c=a.appendChild(b);if(c){var e=0;(function(){if(typeof c.GetVariable!=p){var f=c.GetVariable("$version");if(f){f=f.split(" ")[1].split(",");g.pv=[parseInt(f[0],10),parseInt(f[1],10),parseInt(f[2],10)]}}else if(e<10){e++;setTimeout(arguments.callee,10);return}a.removeChild(b);c=null;x()})()}else x()}function x(){var a=E.length;if(a>0)for(var b=
0;b<a;b++){var c=E[b].id,e=E[b].callbackFn,f={success:false,id:c};if(g.pv[0]>0){var l=u(c);if(l)if(I(E[b].swfVersion)&&!(g.wk&&g.wk<312)){y(c,true);if(e){f.success=true;f.ref=A(c);e(f)}}else if(E[b].expressInstall&&B()){f={};f.data=E[b].expressInstall;f.width=l.getAttribute("width")||"0";f.height=l.getAttribute("height")||"0";if(l.getAttribute("class"))f.styleclass=l.getAttribute("class");if(l.getAttribute("align"))f.align=l.getAttribute("align");var j={};l=l.getElementsByTagName("param");for(var q=
l.length,r=0;r<q;r++)if(l[r].getAttribute("name").toLowerCase()!="movie")j[l[r].getAttribute("name")]=l[r].getAttribute("value");h(f,j,c,e)}else{m(l);e&&e(f)}}else{y(c,true);if(e){if((c=A(c))&&typeof c.SetVariable!=p){f.success=true;f.ref=c}e(f)}}}}function A(a){var b=null;if((a=u(a))&&a.nodeName=="OBJECT")if(typeof a.SetVariable!=p)b=a;else if(a=a.getElementsByTagName(z)[0])b=a;return b}function B(){return!P&&I("6.0.65")&&(g.win||g.mac)&&!(g.wk&&g.wk<312)}function h(a,b,c,e){P=true;W=e||null;Y={success:false,
id:c};var f=u(c);if(f){if(f.nodeName=="OBJECT"){K=o(f);Q=null}else{K=f;Q=c}a.id=Z;if(typeof a.width==p||!/%$/.test(a.width)&&parseInt(a.width,10)<310)a.width="310";if(typeof a.height==p||!/%$/.test(a.height)&&parseInt(a.height,10)<137)a.height="137";i.title=i.title.slice(0,47)+" - Flash Player Installation";e=g.ie&&g.win?"ActiveX":"PlugIn";e="MMredirectURL="+w.location.toString().replace(/&/g,"%26")+"&MMplayerType="+e+"&MMdoctitle="+i.title;if(typeof b.flashvars!=p)b.flashvars+="&"+e;else b.flashvars=
e;if(g.ie&&g.win&&f.readyState!=4){e=i.createElement("div");c+="SWFObjectNew";e.setAttribute("id",c);f.parentNode.insertBefore(e,f);f.style.display="none";(function(){f.readyState==4?f.parentNode.removeChild(f):setTimeout(arguments.callee,10)})()}k(a,b,c)}}function m(a){if(g.ie&&g.win&&a.readyState!=4){var b=i.createElement("div");a.parentNode.insertBefore(b,a);b.parentNode.replaceChild(o(a),b);a.style.display="none";(function(){a.readyState==4?a.parentNode.removeChild(a):setTimeout(arguments.callee,
10)})()}else a.parentNode.replaceChild(o(a),a)}function o(a){var b=i.createElement("div");if(g.win&&g.ie)b.innerHTML=a.innerHTML;else if(a=a.getElementsByTagName(z)[0])if(a=a.childNodes)for(var c=a.length,e=0;e<c;e++)!(a[e].nodeType==1&&a[e].nodeName=="PARAM")&&a[e].nodeType!=8&&b.appendChild(a[e].cloneNode(true));return b}function k(a,b,c){var e,f=u(c);if(g.wk&&g.wk<312)return e;if(f){if(typeof a.id==p)a.id=c;if(g.ie&&g.win){var l="";for(var j in a)if(a[j]!=Object.prototype[j])if(j.toLowerCase()==
"data")b.movie=a[j];else if(j.toLowerCase()=="styleclass")l+=' class="'+a[j]+'"';else if(j.toLowerCase()!="classid")l+=" "+j+'="'+a[j]+'"';j="";for(var q in b)if(b[q]!=Object.prototype[q])j+='<param name="'+q+'" value="'+b[q]+'" />';f.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+l+">"+j+"</object>";R[R.length]=a.id;e=u(a.id)}else{q=i.createElement(z);q.setAttribute("type",O);for(var r in a)if(a[r]!=Object.prototype[r])if(r.toLowerCase()=="styleclass")q.setAttribute("class",
a[r]);else r.toLowerCase()!="classid"&&q.setAttribute(r,a[r]);for(l in b)if(b[l]!=Object.prototype[l]&&l.toLowerCase()!="movie"){a=q;j=l;r=b[l];c=i.createElement("param");c.setAttribute("name",j);c.setAttribute("value",r);a.appendChild(c)}f.parentNode.replaceChild(q,f);e=q}}return e}function t(a){var b=u(a);if(b&&b.nodeName=="OBJECT")if(g.ie&&g.win){b.style.display="none";(function(){if(b.readyState==4){var c=u(a);if(c){for(var e in c)if(typeof c[e]=="function")c[e]=null;c.parentNode.removeChild(c)}}else setTimeout(arguments.callee,
10)})()}else b.parentNode.removeChild(b)}function u(a){var b=null;try{b=i.getElementById(a)}catch(c){}return b}function V(a,b,c){a.attachEvent(b,c);J[J.length]=[a,b,c]}function I(a){var b=g.pv;a=a.split(".");a[0]=parseInt(a[0],10);a[1]=parseInt(a[1],10)||0;a[2]=parseInt(a[2],10)||0;return b[0]>a[0]||b[0]==a[0]&&b[1]>a[1]||b[0]==a[0]&&b[1]==a[1]&&b[2]>=a[2]?true:false}function L(a,b,c,e){if(!(g.ie&&g.mac)){var f=i.getElementsByTagName("head")[0];if(f){c=c&&typeof c=="string"?c:"screen";if(e)X=C=null;
if(!C||X!=c){e=i.createElement("style");e.setAttribute("type","text/css");e.setAttribute("media",c);C=f.appendChild(e);if(g.ie&&g.win&&typeof i.styleSheets!=p&&i.styleSheets.length>0)C=i.styleSheets[i.styleSheets.length-1];X=c}if(g.ie&&g.win)C&&typeof C.addRule==z&&C.addRule(a,b);else C&&typeof i.createTextNode!=p&&C.appendChild(i.createTextNode(a+" {"+b+"}"))}}}function y(a,b){if($){var c=b?"visible":"hidden";if(H&&u(a))u(a).style.visibility=c;else L("#"+a,"visibility:"+c)}}function aa(a){return/[\\\"<>\.;]/.exec(a)!=
null&&typeof encodeURIComponent!=p?encodeURIComponent(a):a}var p="undefined",z="object",O="application/x-shockwave-flash",Z="SWFObjectExprInst",w=window,i=document,F=navigator,ba=false,N=[function(){ba?n():x()}],E=[],R=[],J=[],K,Q,W,Y,H=false,P=false,C,X,$=true,g=function(){var a=typeof i.getElementById!=p&&typeof i.getElementsByTagName!=p&&typeof i.createElement!=p,b=F.userAgent.toLowerCase(),c=F.platform.toLowerCase(),e=c?/win/.test(c):/win/.test(b);c=c?/mac/.test(c):/mac/.test(b);b=/webkit/.test(b)?
parseFloat(b.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false;var f=!+"\u000b1",l=[0,0,0],j=null;if(typeof F.plugins!=p&&typeof F.plugins["Shockwave Flash"]==z){if((j=F.plugins["Shockwave Flash"].description)&&!(typeof F.mimeTypes!=p&&F.mimeTypes[O]&&!F.mimeTypes[O].enabledPlugin)){ba=true;f=false;j=j.replace(/^.*\s+(\S+\s+\S+$)/,"$1");l[0]=parseInt(j.replace(/^(.*)\..*$/,"$1"),10);l[1]=parseInt(j.replace(/^.*\.(.*)\s.*$/,"$1"),10);l[2]=/[a-zA-Z]/.test(j)?parseInt(j.replace(/^.*[a-zA-Z]+(.*)$/,
"$1"),10):0}}else if(typeof w.ActiveXObject!=p)try{var q=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");if(q)if(j=q.GetVariable("$version")){f=true;j=j.split(" ")[1].split(",");l=[parseInt(j[0],10),parseInt(j[1],10),parseInt(j[2],10)]}}catch(r){}return{w3:a,pv:l,wk:b,ie:f,win:e,mac:c}}();(function(){if(g.w3){if(typeof i.readyState!=p&&i.readyState=="complete"||typeof i.readyState==p&&(i.getElementsByTagName("body")[0]||i.body))d();if(!H){typeof i.addEventListener!=p&&i.addEventListener("DOMContentLoaded",
d,false);if(g.ie&&g.win){i.attachEvent("onreadystatechange",function(){if(i.readyState=="complete"){i.detachEvent("onreadystatechange",arguments.callee);d()}});w==top&&function(){if(!H){try{i.documentElement.doScroll("left")}catch(a){setTimeout(arguments.callee,0);return}d()}}()}g.wk&&function(){H||(/loaded|complete/.test(i.readyState)?d():setTimeout(arguments.callee,0))}();s(d)}}})();(function(){g.ie&&g.win&&window.attachEvent("onunload",function(){for(var a=J.length,b=0;b<a;b++)J[b][0].detachEvent(J[b][1],
J[b][2]);a=R.length;for(b=0;b<a;b++)t(R[b]);for(var c in g)g[c]=null;g=null;for(var e in swfobject)swfobject[e]=null;swfobject=null})})();return{registerObject:function(a,b,c,e){if(g.w3&&a&&b){var f={};f.id=a;f.swfVersion=b;f.expressInstall=c;f.callbackFn=e;E[E.length]=f;y(a,false)}else e&&e({success:false,id:a})},getObjectById:function(a){if(g.w3)return A(a)},embedSWF:function(a,b,c,e,f,l,j,q,r,M){var S={success:false,id:b};if(g.w3&&!(g.wk&&g.wk<312)&&a&&b&&c&&e&&f){y(b,false);v(function(){c+="";
e+="";var G={};if(r&&typeof r===z)for(var D in r)G[D]=r[D];G.data=a;G.width=c;G.height=e;D={};if(q&&typeof q===z)for(var T in q)D[T]=q[T];if(j&&typeof j===z)for(var U in j)if(typeof D.flashvars!=p)D.flashvars+="&"+U+"="+j[U];else D.flashvars=U+"="+j[U];if(I(f)){T=k(G,D,b);G.id==b&&y(b,true);S.success=true;S.ref=T}else if(l&&B()){G.data=l;h(G,D,b,M);return}else y(b,true);M&&M(S)})}else M&&M(S)},switchOffAutoHideShow:function(){$=false},ua:g,getFlashPlayerVersion:function(){return{major:g.pv[0],minor:g.pv[1],
release:g.pv[2]}},hasFlashPlayerVersion:I,createSWF:function(a,b,c){if(g.w3)return k(a,b,c)},showExpressInstall:function(a,b,c,e){g.w3&&B()&&h(a,b,c,e)},removeSWF:function(a){g.w3&&t(a)},createCSS:function(a,b,c,e){g.w3&&L(a,b,c,e)},addDomLoadEvent:v,addLoadEvent:s,getQueryParamValue:function(a){var b=i.location.search||i.location.hash;if(b){if(/\?/.test(b))b=b.split("?")[1];if(a==null)return aa(b);b=b.split("&");for(var c=0;c<b.length;c++)if(b[c].substring(0,b[c].indexOf("="))==a)return aa(b[c].substring(b[c].indexOf("=")+
1))}return""},expressInstallCallback:function(){if(P){var a=u(Z);if(a&&K){a.parentNode.replaceChild(K,a);if(Q){y(Q,true);if(g.ie&&g.win)K.style.display="block"}W&&W(Y)}P=false}}}}();
jQuery&&function(d){d.extend(d.fn,{uploadify:function(v){d(this).each(function(){settings=d.extend({id:d(this).attr("id"),uploader:"uploadify.swf",script:"uploadify.php",expressInstall:null,folder:"",height:30,width:110,cancelImg:"cancel.png",wmode:"opaque",scriptAccess:"sameDomain",fileDataName:"Filedata",method:"POST",queueSizeLimit:999,simUploadLimit:1,queueID:false,displayData:"percentage",onInit:function(){},onSelect:function(){},onQueueFull:function(){},onCheck:function(){},onCancel:function(){},
onError:function(){},onProgress:function(){},onComplete:function(){},onAllComplete:function(){}},v);var s=location.pathname;s=s.split("/");s.pop();s=s.join("/")+"/";var n={};n.uploadifyID=settings.id;n.pagepath=s;if(settings.buttonImg)n.buttonImg=escape(settings.buttonImg);if(settings.buttonText)n.buttonText=escape(settings.buttonText);if(settings.rollover)n.rollover=true;n.script=settings.script;n.folder=escape(settings.folder);if(settings.scriptData){var x="";for(var A in settings.scriptData)x+=
"&"+A+"="+settings.scriptData[A];n.scriptData=escape(x.substr(1))}n.width=settings.width;n.height=settings.height;n.wmode=settings.wmode;n.method=settings.method;n.queueSizeLimit=settings.queueSizeLimit;n.simUploadLimit=settings.simUploadLimit;if(settings.hideButton)n.hideButton=true;if(settings.fileDesc)n.fileDesc=settings.fileDesc;if(settings.fileExt)n.fileExt=settings.fileExt;if(settings.multi)n.multi=true;if(settings.auto)n.auto=true;if(settings.sizeLimit)n.sizeLimit=settings.sizeLimit;if(settings.checkScript)n.checkScript=
settings.checkScript;if(settings.fileDataName)n.fileDataName=settings.fileDataName;if(settings.queueID)n.queueID=settings.queueID;if(settings.onInit()!==false){d(this).css("display","none");d(this).after('<div id="'+d(this).attr("id")+'Uploader"></div>');swfobject.embedSWF(settings.uploader,settings.id+"Uploader",settings.width,settings.height,"9.0.24",settings.expressInstall,n,{quality:"high",wmode:settings.wmode,allowScriptAccess:settings.scriptAccess});settings.queueID==false&&d("#"+d(this).attr("id")+
"Uploader").after('<div id="'+d(this).attr("id")+'Queue" class="uploadifyQueue"></div>')}typeof settings.onOpen=="function"&&d(this).bind("uploadifyOpen",settings.onOpen);d(this).bind("uploadifySelect",{action:settings.onSelect,queueID:settings.queueID},function(h,m,o){if(h.data.action(h,m,o)!==false){var k=Math.round(o.size/1024*100)*0.01,t="KB";if(k>1E3){k=Math.round(k*0.001*100)*0.01;t="MB"}k=k.toString().split(".");k=k.length>1?k[0]+"."+k[1].substr(0,2):k[0];fileName=o.name.length>20?o.name.substr(0,
20)+"...":o.name;queue="#"+d(this).attr("id")+"Queue";if(h.data.queueID)queue="#"+h.data.queueID;d(queue).append('<div id="'+d(this).attr("id")+m+'" class="uploadifyQueueItem"><div class="cancel"><a href="javascript:jQuery(\'#'+d(this).attr("id")+"').uploadifyCancel('"+m+'\')"><img src="'+settings.cancelImg+'" border="0" /></a></div><span class="fileName">'+fileName+" ("+k+t+')</span><span class="percentage"></span><div class="uploadifyProgress"><div id="'+d(this).attr("id")+m+'ProgressBar" class="uploadifyProgressBar"><!--Progress Bar--\></div></div></div>')}});
typeof settings.onSelectOnce=="function"&&d(this).bind("uploadifySelectOnce",settings.onSelectOnce);d(this).bind("uploadifyQueueFull",{action:settings.onQueueFull},function(h,m){h.data.action(h,m)!==false&&alert("The queue is full.  The max size is "+m+".")});d(this).bind("uploadifyCheckExist",{action:settings.onCheck},function(h,m,o,k,t){var u={};u=o;u.folder=s+k;if(t)for(var V in o)var I=V;d.post(m,u,function(L){for(var y in L)if(h.data.action(h,m,o,k,t)!==false)confirm("Do you want to replace the file "+
L[y]+"?")||document.getElementById(d(h.target).attr("id")+"Uploader").cancelFileUpload(y,true,true);t?document.getElementById(d(h.target).attr("id")+"Uploader").startFileUpload(I,true):document.getElementById(d(h.target).attr("id")+"Uploader").startFileUpload(null,true)},"json")});d(this).bind("uploadifyCancel",{action:settings.onCancel},function(h,m,o,k,t){if(h.data.action(h,m,o,k,t)!==false){h=t==true?0:250;d("#"+d(this).attr("id")+m).fadeOut(h,function(){d(this).remove()})}});typeof settings.onClearQueue==
"function"&&d(this).bind("uploadifyClearQueue",settings.onClearQueue);var B=[];d(this).bind("uploadifyError",{action:settings.onError},function(h,m,o,k){if(h.data.action(h,m,o,k)!==false){h=Array(m,o,k);B.push(h);d("#"+d(this).attr("id")+m+" .percentage").text(" - "+k.type+" Error");d("#"+d(this).attr("id")+m).addClass("uploadifyError")}});d(this).bind("uploadifyProgress",{action:settings.onProgress,toDisplay:settings.displayData},function(h,m,o,k){if(h.data.action(h,m,o,k)!==false){d("#"+d(this).attr("id")+
m+"ProgressBar").css("width",k.percentage+"%");if(h.data.toDisplay=="percentage")displayData=" - "+k.percentage+"%";if(h.data.toDisplay=="speed")displayData=" - "+k.speed+"KB/s";if(h.data.toDisplay==null)displayData=" ";d("#"+d(this).attr("id")+m+" .percentage").text(displayData)}});d(this).bind("uploadifyComplete",{action:settings.onComplete},function(h,m,o,k,t){if(h.data.action(h,m,o,unescape(k),t)!==false){d("#"+d(this).attr("id")+m+" .percentage").text(" - Completed");d("#"+d(this).attr("id")+
m).fadeOut(250,function(){d(this).remove()})}});typeof settings.onAllComplete=="function"&&d(this).bind("uploadifyAllComplete",{action:settings.onAllComplete},function(h,m){if(h.data.action(h,m)!==false)B=[]})})},uploadifySettings:function(v,s,n){var x=false;d(this).each(function(){if(v=="scriptData"&&s!=null){var o=n?s:d.extend(settings.scriptData,s),k="";for(var t in o)k+="&"+t+"="+escape(o[t]);s=k.substr(1)}x=document.getElementById(d(this).attr("id")+"Uploader").updateSettings(v,s)});if(s==null){if(v==
"scriptData"){for(var A=unescape(x).split("&"),B={},h=0;h<A.length;h++){var m=A[h].split("=");B[m[0]]=m[1]}x=B}return x}},uploadifyUpload:function(v){d(this).each(function(){document.getElementById(d(this).attr("id")+"Uploader").startFileUpload(v,false)})},uploadifyCancel:function(v){d(this).each(function(){document.getElementById(d(this).attr("id")+"Uploader").cancelFileUpload(v,true,false)})},uploadifyClearQueue:function(){d(this).each(function(){document.getElementById(d(this).attr("id")+"Uploader").clearFileUploadQueue(false)})}})}(jQuery);
