var ZeroClipboard={Implements:[Options,Events],options:{version:"1.0.4",clients:{},moviePath:"ZeroClipboard.swf",nextId:1},initialize:function(b,a){this.setOptions(a);this.handlers={};this.id=this.options.nextId++;this.movieId="ZeroClipboardMovie_"+this.id;this.register(this.id,this);if(b){this.glue(b)}},dispatch:function(d,b,c){var a=this.options.clients[d];if(a){a.receiveEvent(b,c)}},register:function(b,a){this.options.clients[b]=a}};ZeroClipboard.Client=new Class({id:0,ready:false,movie:null,clipText:"",handCursorEnabled:true,cssEffects:true,handlers:null,path:"./",initialize:function(a){this.handlers={};this.id=ZeroClipboard.options.nextId++;this.movieId="ZeroClipboardMovie_"+this.id;ZeroClipboard.register(this.id,this);if(a){this.glue(a)}},setPath:function(a){this.path=a},glue:function(d){this.domElement=d;var f=99;if(this.domElement.style.zIndex){f=parseInt(this.domElement.style.zIndex)+1}var c=this.domElement.getSize();var e=this.domElement.getPosition();this.div=new Element("div",{title:"Click to copy to clipboard"});var b=this.div.style;b.position="absolute";b.left=""+e.x+"px";b.top=""+e.y+"px";b.width=""+c.x+"px";b.height=""+c.y+"px";b.zIndex=f;var a=document.getElementsByTagName("body")[0];a.appendChild(this.div);this.div.innerHTML=this.getHTML(c.x,c.y)},getHTML:function(d,a){var c="";var b="id="+this.id+"&width="+d+"&height="+a;if(navigator.userAgent.match(/MSIE/)){var e=location.href.match(/^https/i)?"https://":"http://";c+='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="'+e+'download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+d+'" height="'+a+'" id="'+this.movieId+'" align="middle"><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="false" /><param name="movie" value="'+this.path+ZeroClipboard.options.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="'+b+'"/><param name="wmode" value="transparent"/></object>'}else{c+='<embed id="'+this.movieId+'" src="'+this.path+ZeroClipboard.options.moviePath+'" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="'+d+'" height="'+a+'" name="'+this.movieId+'" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="'+b+'" wmode="transparent" />'}return c},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=b;if(!this.domElement){this.hide()}}if(this.domElement&&this.div){var c=this.domElement.getPosition();var a=this.div.style;a.left=""+c.x+"px";a.top=""+c.y+"px"}},setText:function(a){this.clipText=a;if(this.ready){this.movie.setText(a)}},addEventListener:function(a,b){a=a.toString().toLowerCase().replace(/^on/,"");if(!this.handlers[a]){this.handlers[a]=[]}this.handlers[a].push(b)},setHandCursor:function(a){this.handCursorEnabled=a;if(this.ready){this.movie.setHandCursor(a)}},setCSSEffects:function(a){this.cssEffects=!!a},receiveEvent:function(d,e){d=d.toString().toLowerCase().replace(/^on/,"");switch(d){case"load":this.movie=$(this.movieId);if(!this.movie){var c=this;setTimeout(function(){c.receiveEvent("load",null)},1);return}if(!this.ready&&navigator.userAgent.match(/Firefox/)&&navigator.userAgent.match(/Windows/)){var c=this;setTimeout(function(){c.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[d]){for(var b=0,a=this.handlers[d].length;b<a;b++){var f=this.handlers[d][b];if(typeof(f)=="function"){f(this,e)}else{if((typeof(f)=="object")&&(f.length==2)){f[0][f[1]](this,e)}else{if(typeof(f)=="string"){window[f](this,e)}}}}}}});