var ZeroClipboard={version:"1.0.4",clients:{},moviePath:"ZeroClipboard.swf",nextId:1,$:function(a){if(typeof(a)=="string"){a=document.getElementById(a)}if(!a.addClass){a.hide=function(){this.style.display="none"};a.show=function(){this.style.display=""};a.addClass=function(b){this.removeClass(b);this.className+=" "+b};a.removeClass=function(b){this.className=this.className.replace(new RegExp("\\s*"+b+"\\s*")," ").replace(/^\s+/,"").replace(/\s+$/,"")};a.hasClass=function(b){return !!this.className.match(new RegExp("\\s*"+b+"\\s*"))}}return a},setMoviePath:function(a){this.moviePath=a},dispatch:function(d,a,b){var c=this.clients[d];if(c){c.receiveEvent(a,b)}},register:function(b,a){this.clients[b]=a},getDOMObjectPosition:function(a){var b={left:0,top:0,width:a.width?a.width:a.offsetWidth,height:a.height?a.height:a.offsetHeight};while(a){b.left+=a.offsetLeft;b.top+=a.offsetTop;a=a.offsetParent}return b},Client:function(a){this.handlers={};this.id=ZeroClipboard.nextId++;this.movieId="ZeroClipboardMovie_"+this.id;ZeroClipboard.register(this.id,this);if(a){this.glue(a)}}};ZeroClipboard.Client.prototype={id:0,ready:false,movie:null,clipText:"",handCursorEnabled:true,cssEffects:true,handlers:null,glue:function(c){this.domElement=ZeroClipboard.$(c);var a=2000;if(this.domElement.style.zIndex){a=parseInt(this.domElement.style.zIndex)+1}var d=ZeroClipboard.getDOMObjectPosition(this.domElement);this.div=document.createElement("div");var e=this.div.style;e.position="absolute";e.left=""+d.left+"px";e.top=""+d.top+"px";e.width=""+d.width+"px";e.height=""+d.height+"px";e.zIndex=a;var b=document.getElementsByTagName("body")[0];b.appendChild(this.div);this.div.innerHTML=this.getHTML(d.width,d.height)},getHTML:function(e,b){var a="";var d="id="+this.id+"&width="+e+"&height="+b;if(navigator.userAgent.match(/MSIE/)){var c=location.href.match(/^https/i)?"https://":"http://";a+='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="'+c+'download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+e+'" height="'+b+'" id="'+this.movieId+'" align="middle"><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="false" /><param name="movie" value="'+ZeroClipboard.moviePath+'" /><param name="loop" value="false" /><param name="menu" value="false" /><param name="quality" value="best" /><param name="bgcolor" value="#ffffff" /><param name="flashvars" value="'+d+'"/><param name="wmode" value="transparent"/></object>'}else{a+='<embed id="'+this.movieId+'" src="'+ZeroClipboard.moviePath+'" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="'+e+'" height="'+b+'" name="'+this.movieId+'" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="'+d+'" wmode="transparent" />'}return a},hide:function(){if(this.div){this.div.style.left="-2000px"}},show:function(){this.reposition()},destroy:function(){if(this.domElement&&this.div){this.hide();this.div.innerHTML="";var a=document.getElementsByTagName("body")[0];try{a.removeChild(this.div)}catch(b){}this.domElement=null;this.div=null}},reposition:function(b){if(b){this.domElement=ZeroClipboard.$(b);if(!this.domElement){this.hide()}}if(this.domElement&&this.div){var a=ZeroClipboard.getDOMObjectPosition(this.domElement);var c=this.div.style;c.left=""+a.left+"px";c.top=""+a.top+"px"}},setText:function(a){this.clipText=a;if(this.ready){this.movie.setText(a)}},addEventListener:function(b,a){b=b.toString().toLowerCase().replace(/^on/,"");if(!this.handlers[b]){this.handlers[b]=[]}this.handlers[b].push(a)},setHandCursor:function(a){this.handCursorEnabled=a;if(this.ready){this.movie.setHandCursor(a)}},setCSSEffects:function(a){this.cssEffects=!!a},receiveEvent:function(c,f){c=c.toString().toLowerCase().replace(/^on/,"");switch(c){case"load":this.movie=document.getElementById(this.movieId);if(!this.movie){var a=this;setTimeout(function(){a.receiveEvent("load",null)},1);return}if(!this.ready&&navigator.userAgent.match(/Firefox/)&&navigator.userAgent.match(/Windows/)){var a=this;setTimeout(function(){a.receiveEvent("load",null)},100);this.ready=true;return}this.ready=true;this.movie.setText(this.clipText);this.movie.setHandCursor(this.handCursorEnabled);break;case"mouseover":if(this.domElement&&this.cssEffects){this.domElement.addClass("hover");if(this.recoverActive){this.domElement.addClass("active")}}break;case"mouseout":if(this.domElement&&this.cssEffects){this.recoverActive=false;if(this.domElement.hasClass("active")){this.domElement.removeClass("active");this.recoverActive=true}this.domElement.removeClass("hover")}break;case"mousedown":if(this.domElement&&this.cssEffects){this.domElement.addClass("active")}break;case"mouseup":if(this.domElement&&this.cssEffects){this.domElement.removeClass("active");this.recoverActive=false}break}if(this.handlers[c]){for(var e=0,d=this.handlers[c].length;e<d;e++){var b=this.handlers[c][e];if(typeof(b)=="function"){b(this,f)}else{if((typeof(b)=="object")&&(b.length==2)){b[0][b[1]](this,f)}else{if(typeof(b)=="string"){window[b](this,f)}}}}}}};
