var ZeroClipboard={contextPath:"",version:"1.0.7",clients:{},moviePath:"/scripts/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(D){var E=this.className.split(/\s+/);
|
var B=-1;
|
for(var C=0;
|
C<E.length;
|
C++){if(E[C]==D){B=C;
|
C=E.length
|
}}if(B>-1){E.splice(B,1);
|
this.className=E.join(" ")
|
}return this
|
};
|
A.hasClass=function(B){return !!this.className.match(new RegExp("\\s*"+B+"\\s*"))
|
}
|
}return A
|
},setContextPath:function(A){this.contextPath=A
|
},setMoviePath:function(A){this.moviePath=A
|
},dispatch:function(D,B,C){var A=this.clients[D];
|
if(A){A.receiveEvent(B,C)
|
}},register:function(B,A){this.clients[B]=A
|
},getDOMObjectPosition:function(C,A){var B={left:0,top:0,width:C.width?C.width:C.offsetWidth,height:C.height?C.height:C.offsetHeight};
|
while(C&&(C!=A)){B.left+=C.offsetLeft;
|
B.top+=C.offsetTop;
|
C=C.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(D,B,E){this.domElement=ZeroClipboard.$(D);
|
var F=99;
|
if(this.domElement.style.zIndex){F=parseInt(this.domElement.style.zIndex,10)+1
|
}if(typeof (B)=="string"){B=ZeroClipboard.$(B)
|
}else{if(typeof (B)=="undefined"){B=document.getElementsByTagName("body")[0]
|
}}var C=ZeroClipboard.getDOMObjectPosition(this.domElement,B);
|
this.div=document.createElement("div");
|
var A=this.div.style;
|
A.position="absolute";
|
A.left=""+C.left+"px";
|
A.top=""+C.top+"px";
|
A.width=""+C.width+"px";
|
A.height=""+C.height+"px";
|
A.zIndex=F;
|
if(typeof (E)=="object"){for(addedStyle in E){A[addedStyle]=E[addedStyle]
|
}}B.appendChild(this.div);
|
this.div.innerHTML=this.getHTML(C.width,C.height)
|
},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="'+ZeroClipboard.contextPath+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="'+B+'"/><param name="wmode" value="transparent"/></object>'
|
}else{C+='<embed id="'+this.movieId+'" src="'+ZeroClipboard.contextPath+ZeroClipboard.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(C){if(C){this.domElement=ZeroClipboard.$(C);
|
if(!this.domElement){this.hide()
|
}}if(this.domElement&&this.div){var B=ZeroClipboard.getDOMObjectPosition(this.domElement);
|
var A=this.div.style;
|
A.left=""+B.left+"px";
|
A.top=""+B.top+"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=document.getElementById(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)
|
}}}}}}};
|