// Simple Set Clipboard System
// Author: Joseph Huckaby

var bmi_htmlEdit=0;var bmi_ie;var bmi_ns;var bmi_safari;var bmi_imageObjSelected;var bmi_ffx_op_toolTip="Shift+R improves the quality of this image. Shift+A improves the quality of all images on this page.";var bmi_toolTip="Shift+R improves the quality of this image. CTRL+F5 reloads the whole page.";var bmi_ns_tooltip="Shift+Reload reloads the whole page.";var bmi_toolTipSeperator=" ... ";var bmi_concatStr="bmi_orig_img";var bmi_frameNotAllowed;var agt=navigator.userAgent.toLowerCase();var is_major=parseInt(navigator.appVersion);var is_minor=parseFloat(navigator.appVersion);var bmi_ns=((agt.indexOf('mozilla')!=-1)&&(agt.indexOf('spoofer')==-1)&&(agt.indexOf('compatible')==-1)&&(agt.indexOf('opera')==-1)&&(agt.indexOf('webtv')==-1)&&(agt.indexOf('hotjava')==-1));var bmi_ns2=(bmi_ns&&(is_major==2));var bmi_ns3=(bmi_ns&&(is_major==3));var bmi_ns4=(bmi_ns&&(is_major==4));var bmi_ns4up=(bmi_ns&&(is_major>=4));var bmi_nsonly=(bmi_ns&&((agt.indexOf(";nav")!=-1)||(agt.indexOf("; nav")!=-1)||(agt.indexOf("Netscape")!=-1)||(agt.indexOf("netscape")!=-1)));var bmi_ns6=(bmi_ns&&(is_major==5));var bmi_ns6up=(bmi_ns&&(is_major>=5));var is_gecko=(agt.indexOf('gecko')!=-1);var bmi_firefox=(agt.indexOf('firefox')!=-1);var bmi_safari=(agt.indexOf('applewebkit')!=-1);var bmi_ie=((agt.indexOf("msie")!=-1)&&(agt.indexOf("opera")==-1));var bmi_ie3=(bmi_ie&&(is_major<4));var bmi_ie4=(bmi_ie&&(is_major==4)&&(agt.indexOf("msie 4")!=-1));var bmi_ie4up=(bmi_ie&&(is_major>=4));var bmi_ie5=(bmi_ie&&(is_major==4)&&(agt.indexOf("msie 5.0")!=-1));var bmi_ie5_5=(bmi_ie&&(is_major==4)&&(agt.indexOf("msie 5.5")!=-1));var bmi_ie5up=(bmi_ie&&!bmi_ie3&&!bmi_ie4);var bmi_ie5_5up=(bmi_ie&&!bmi_ie3&&!bmi_ie4&&!bmi_ie5);var bmi_ie6=(bmi_ie&&(is_major==4)&&(agt.indexOf("msie 6.")!=-1));var bmi_ie6up=(bmi_ie&&!bmi_ie3&&!bmi_ie4&&!bmi_ie5&&!bmi_ie5_5);var bmi_opera=(agt.indexOf("opera")!=-1);var bmi_opera2=(agt.indexOf("opera 2")!=-1||agt.indexOf("opera/2")!=-1);var bmi_opera3=(agt.indexOf("opera 3")!=-1||agt.indexOf("opera/3")!=-1);var bmi_opera4=(agt.indexOf("opera 4")!=-1||agt.indexOf("opera/4")!=-1);var bmi_opera5=(agt.indexOf("opera 5")!=-1||agt.indexOf("opera/5")!=-1);var bmi_opera5up=(bmi_opera&&!bmi_opera2&&!bmi_opera3&&!bmi_opera4);function bmi_checkAccess(win){bmi_frameNotAllowed=0;window.bmioldOnError=window.onerror;window.onerror=null;try{var l=win.location.href;}
catch(e){bmi_frameNotAllowed=1;}
if(bmi_frameNotAllowed==1){window.onerror=window.bmioldOnError;return false;}
else{window.onerror=window.bmioldOnError;return true;}}
function bmi_ImageElement(el){if(!el)
return 0;var str=new String(el.tagName);if(str.match("IMG")){return 1;}
if(str.match("INPUT")){if(el.type&&bmi_checkInputType(el.type)){return 1;}
return 0;}
if(str.match("OBJECT")){if(el.type&&bmi_checkMIMEType(el.type)){el.bmi_objTag=1;return 1;}}
if(str.match("EMBED")){if(el.type&&bmi_checkMIMEType(el.type)){return 1;}}
if(str.match("AREA")||str.match("A")){var p=el.parentNode;if(p&&(p.tagName=="MAP")&&(p.bmi_imgObj!=null)){el.bmi_mapImage=p.bmi_imgObj;p.bmi_imgObj.bmi_areaEl=el;return 1;}}
return 0;}
function bmi_resetTitle(el){if(!el)
return;if(el.bmi_touched!=1)
return;el.title="";if(el.bmi_oldTitle){el.title=el.bmi_oldTitle;if(el.bmi_oldAlt){el.alt=el.bmi_oldAlt;}}
else if(el.bmi_oldAlt){el.alt=el.bmi_oldAlt;if(bmi_ie)
el.title=el.alt;}
if(el.bmi_gotOriginal){if(el.bmi_orig_mouseout){el.onmouseout=el.bmi_orig_mouseout;}}}
function bmi_checkElement(el){var pwindow=null;if(el.bmi_gotOriginal)
return;if(el.bmi_mapImage){if(el.bmi_mapImage.bmi_gotOriginal==1){el.bmi_gotOriginal=1;if(el.bmi_touched)
bmi_resetTitle(el);return;}}
if(el.bmi_touched!=1){bmi_setElementTitle(el);if(el.onmouseout){el.bmi_orig_mouseout=el.onmouseout;el.onmouseout=bmi_safeMouseOutEvents;}
else{el.onmouseout=bmi_safeMouseOutEvents;}}
else{el.title=el.bmi_title;el.alt=el.bmi_alt;}
if(el.bmi_mapImage)
bmi_imageObjSelected=el.bmi_mapImage;else
bmi_imageObjSelected=el;if(bmi_ie||bmi_opera)
pwindow=document.parentWindow;else if(bmi_nsonly||is_gecko)
pwindow=document.defaultView;else
pwindow=null;if(pwindow&&(pwindow!=pwindow.parent)){pwindow.focus();el.bmi_changedFocus=1;}
return;}
function bmi_setElementTitle(el){var tmpAlt="";if(el.alt){tmpAlt=el.alt;el.bmi_oldAlt=el.alt;el.bmi_alt="";el.alt="";}
if(el.title){el.bmi_oldTitle=el.title;el.title="";}
else{el.title=tmpAlt+"";}
if(bmi_opera||bmi_firefox||bmi_safari){el.title=bmi_ffx_op_toolTip;el.bmi_touched=1;el.bmi_title=el.title;}
else{el.title=el.title+bmi_toolTipSeperator+bmi_toolTip;el.bmi_touched=1;el.bmi_title=el.title;}
return;}
function bmi_checkInputType(type){if(!type)
return 0;if(type.match("image")||type.match("Image")){return 1;}
return 0;}
function bmi_checkMIMEType(type){var typeStr=new String(type);var find=/image\//gi;if(typeStr.search(find)!=-1)
return 1;return 0;}
function bmi_mouseOver(e){bmi_imageObjSelected=null;var obj;if(document.bmi_onmouseover_original!=null)
document.bmi_onmouseover_original(e);if(bmi_ie||bmi_opera){var e=window.event;obj=e.srcElement;}
else{obj=e.target;}
if(obj.bmi_gotOriginal)
return;if(bmi_ImageElement(obj)){bmi_checkElement(obj);}
return;}
function bmi_safeMouseOutEvents(e){var obj;if(bmi_ie||bmi_opera){e=window.event;obj=e.srcElement;}
else{obj=e.target;}
bmi_resetTitle(obj);if(obj.bmi_changedFocus==1){var pwindow=null;if(bmi_ie||bmi_opera)
pwindow=document.parentWindow;else if(bmi_nsonly||is_gecko)
pwindow=document.defaultView;else
pwindow=null;if(pwindow){pwindow.top.focus();obj.bmi_changedFocus=0;}}
if(obj.bmi_orig_mouseout){obj.bmi_orig_mouseout();}}
function bmi_updateImageSrc(src)
{var found=0;var find=/\?/g;var editUrl;var editIndex;var editProto;var bmiSignIndex;var bmiSign;srcString=new String(src);if(srcString.search(find)!=-1)
{found=1;srcString=srcString.concat("&"+bmi_concatStr+"=1");}
else
{var i=srcString.lastIndexOf("/");var newStr=srcString.substring(i+1);srcString=srcString.concat("/"+bmi_concatStr+"/"+newStr);}
if(bmi_htmlEdit){editIndex=srcString.indexOf("://");if(editIndex!=-1){editProto=srcString.substring(0,editIndex+3);editUrl=srcString.substring(editIndex+3);editIndex=editUrl.indexOf("/"); if(editIndex!=-1){editUrl=editUrl.substring(editIndex+1);bmiSignIndex=editUrl.indexOf("/");if(bmiSignIndex!=-1){bmiSign=editUrl.substring(0,bmiSignIndex);if(bmiSign=="bmi"){editUrl=editUrl.substring(bmiSignIndex+1);srcString=editProto+editUrl;}}}}}
return(srcString);}
function bmi_replaceImages(array){if(!array)
return;for(var i=0;i<array.length;i++){if(array[i].bmi_gotOriginal){continue;}
if(array[i].bmi_objTag){array[i].data=bmi_updateImageSrc(array[i].data);}
else{array[i].src=bmi_updateImageSrc(array[i].src);}
array[i].bmi_gotOriginal=1;if(array[i].bmi_touched){bmi_resetTitle(array[i]);}}
return;}
function bmi_replaceInputImages(array){if(!array)
return;for(var i=0;i<array.length;i++){if(array[i].bmi_gotOriginal){continue;}
if(array[i].type&&bmi_checkInputType(array[i].type)){array[i].src=bmi_updateImageSrc(array[i].src);array[i].bmi_gotOriginal=1;if(array[i].bmi_touched){bmi_resetTitle(array[i]);}}}
return;}
function bmi_NSlayers(){if(document!=null){if(!document.layers){bmi_replaceImages(document.tags.IMG);bmi_replaceInputImages(document.tags.INPUT);return;}
for(var i=0;i<document.layers.length;i++){bmi_NSlayers(document.layers[i].document);bmi_replaceImages(document.layers[i].document.tags.IMG);bmi_replaceInputImages(document.layers[i].document.tags.INPUT);}}
return;}
function bmi_downloadAllHandler(){if((true==bmi_checkAccess(parent))&&(parent.location.href!=self.location.href)){var newparent=parent;do{newparent=newparent.parent;if((false ==bmi_checkAccess(newparent.parent))||(newparent.parent.location.href==newparent.location.href)){break;}}while(newparent);var numFrames=newparent.frames.length;var index=0;var frame;for(;index<newparent.frames.length;index++){frame=newparent.frames[index];if(false==bmi_checkAccess(frame.window)){continue;}
if(frame.window.bmi_reDownloadAllImages){frame.window.bmi_reDownloadAllImages();}}
return;}
bmi_reDownloadAllImages();}
function bmi_reDownloadAllImages(){var imgArray;var inputArray;var backgroundArray;var numFrames=window.frames.length;var index=0;var frame;for(;index<numFrames;index++){frame=window.frames[index];if(false==bmi_checkAccess(frame.window)){continue;}
if(frame.window.bmi_reDownloadAllImages){frame.window.bmi_reDownloadAllImages();}}
if((bmi_ie5up||bmi_ns6up||bmi_opera5up||bmi_firefox)){imgArray=document.getElementsByTagName("IMG");inputArray=document.getElementsByTagName("INPUT");bmi_replaceImages(imgArray);bmi_replaceInputImages(inputArray);}
else if(bmi_ns&&(bmi_ns4||bmi_ns3)){var imgArray;var docLayers;docLayers=document.layers;if(docLayers&&docLayers.length){for(var layi=0;layi<0;layi++){imgArray=docLayers[layi].document.images;bmi_replaceImages(imgArray);}}
else{imgArray=document.images;bmi_replaceImages(imgArray);}}
else{imgArray=document.images;bmi_replaceImages(imgArray);}
return;}
function bmi_reDownloadSelectedImage(img){if(img.bmi_gotOriginal){return;}
if(img&&!img.bmi_gotOriginal){if(img.bmi_objTag){img.data=bmi_updateImageSrc(img.data);}
else{img.src=bmi_updateImageSrc(img.src);}
img.bmi_gotOriginal=1;if(img.bmi_touched){bmi_resetTitle(img);}
if(img.bmi_areaEl&&(img.bmi_areaEl.bmi_touched)){bmi_resetTitle(img.bmi_areaEl);
img.bmi_areaEl.bmi_gotOriginal=1;}}
return;}
function bmi_keypress(e)
{var reloadSingle=0;var reloadAll=0;var obj;if(bmi_ns){if(bmi_ns6up){if((String.fromCharCode(e.charCode)=='r')||(String.fromCharCode(e.charCode)=='R'))
reloadSingle=1;else{if((String.fromCharCode(e.charCode)=='A'))
reloadAll=1;}
obj=e.target;var str=new String(obj.tagName);if(str.match("INPUT")&&(bmi_checkInputType(obj.type)!=1)){if(bmi_imageObjSelected==obj)
reloadAll=reloadSingle=0;}}
else{if((String.fromCharCode(e.which)=='R')&&(e.modifiers==Event.SHIFT_MASK))
reloadSingle=1;else{if((String.fromCharCode(e.which)=='A')&&(e.modifiers==Event.SHIFT_MASK))
reloadAll=1;}}}
if(bmi_ie||bmi_opera){if((String.fromCharCode(window.event.keyCode)=='R')&&(window.event.shiftKey))
reloadSingle=1;else if(bmi_opera){if((String.fromCharCode(window.event.keyCode)=='A')&&(window.event.shiftKey))
reloadAll=1;}
var e=window.event;obj=e.srcElement;var str=new String(obj.tagName);if(str.match("INPUT")&&(bmi_checkInputType(obj.type)!=1)){if(bmi_imageObjSelected==obj)
reloadSingle=reloadAll=0;}}
if(reloadSingle==1){if(bmi_ns){if(bmi_ns4||bmi_ns3||bmi_ns2){return;}}
if(bmi_imageObjSelected)
bmi_reDownloadSelectedImage(bmi_imageObjSelected);}
else{if(reloadAll==1){bmi_downloadAllHandler();}}
if((document.bmi_onkeypress_original!=null)&&(document.bmi_onkeypress_original!=bmi_keypress))
{return(document.bmi_onkeypress_original(e));}
return;}
function bmi_linkMapImages(maps,objs){var linked=0;for(var i=0;i<objs.length;i++){if(linked>=maps.length){return linked;}
if(objs[i].useMap){var newStr=new String(objs[i].useMap);var mapName=newStr.substring(newStr.lastIndexOf("#")+1);if(bmi_ImageElement(objs[i])!=1)
continue;for(var j=0;j<maps.length;j++){if(maps[j].name==mapName){maps[j].bmi_imgObj=objs[i];linked++;}}}}
return linked;}
function bmi_load(){if(bmi_orig_onLoad){bmi_orig_onLoad();}
if(bmi_ns2||bmi_ns3||bmi_ns4){window.defaultStatus=bmi_ns_tooltip;return;}
if(document.onmouseover){if(document.onmouseover!=bmi_mouseOver){document.bmi_onmouseover_original=document.onmouseover;}}
document.onmouseover=bmi_mouseOver;if(document.onkeypress){if(document.onkeypress!=bmi_keypress){document.bmi_onkeypress_original=document.onkeypress;}}
else{document.bmi_onkeypress_original=null;}
document.onkeypress=bmi_keypress;var maps=document.getElementsByTagName("MAP");if((maps==null)||(maps.length==0)){return;}
var objs=null;if(bmi_ie||bmi_opera){objs=document.all;if(objs){bmi_linkMapImages(maps,objs);}}
if(bmi_ns||is_gecko){var num=0;objs=document.getElementsByTagName("IMG");if(objs){num=num+bmi_linkMapImages(maps,objs);}
if(num>=maps.length){return;}
objs=null;objs=document.getElementsByTagName("INPUT");if(objs){num+=bmi_linkMapImages(maps,objs);}
if(num>=maps.length){return;}
objs=null;objs=document.getElementsByTagName("OBJECT");if(objs){num+=bmi_linkMapImages(maps,objs);}}
return;}
var bmi_orig_onLoad;function bmi_SafeAddOnload(f,urlStr,htmlEdit)
{if(urlStr){bmi_concatStr=urlStr;}
if(htmlEdit){bmi_htmlEdit=htmlEdit;}
if(bmi_ie4){window.onload=f;}
else if(window.onload){if(window.onload!=f){bmi_orig_onLoad=window.onload;window.onload=f;}}
else{window.onload=f;}}



var ZeroClipboard = {
	
	version: "1.0.7",
	clients: {}, // registered upload clients on page, indexed by id
	moviePath: 'ZeroClipboard.swf', // URL to movie
	nextId: 1, // ID of next movie
	
	$: function(thingy) {
		// simple DOM lookup utility function
		if (typeof(thingy) == 'string') thingy = document.getElementById(thingy);
		if (!thingy.addClass) {
			// extend element with a few useful methods
			thingy.hide = function() { this.style.display = 'none'; };
			thingy.show = function() { this.style.display = ''; };
			thingy.addClass = function(name) { this.removeClass(name); this.className += ' ' + name; };
			thingy.removeClass = function(name) {
				var classes = this.className.split(/\s+/);
				var idx = -1;
				for (var k = 0; k < classes.length; k++) {
					if (classes[k] == name) { idx = k; k = classes.length; }
				}
				if (idx > -1) {
					classes.splice( idx, 1 );
					this.className = classes.join(' ');
				}
				return this;
			};
			thingy.hasClass = function(name) {
				return !!this.className.match( new RegExp("\\s*" + name + "\\s*") );
			};
		}
		return thingy;
	},
	
	setMoviePath: function(path) {
		// set path to ZeroClipboard.swf
		this.moviePath = path;
	},
	
	dispatch: function(id, eventName, args) {
		// receive event from flash movie, send to client		
		var client = this.clients[id];
		if (client) {
			client.receiveEvent(eventName, args);
		}
	},
	
	register: function(id, client) {
		// register new client to receive events
		this.clients[id] = client;
	},
	
	getDOMObjectPosition: function(obj, stopObj) {
		// get absolute coordinates for dom element
		var info = {
			left: 0, 
			top: 0, 
			width: obj.width ? obj.width : obj.offsetWidth, 
			height: obj.height ? obj.height : obj.offsetHeight
		};

		while (obj && (obj != stopObj)) {
			info.left += obj.offsetLeft;
			info.top += obj.offsetTop;
			obj = obj.offsetParent;
		}

		return info;
	},
	
	Client: function(elem) {
		// constructor for new simple upload client
		this.handlers = {};
		
		// unique ID
		this.id = ZeroClipboard.nextId++;
		this.movieId = 'ZeroClipboardMovie_' + this.id;
		
		// register client with singleton to receive flash events
		ZeroClipboard.register(this.id, this);
		
		// create movie
		if (elem) this.glue(elem);
	}
};

ZeroClipboard.Client.prototype = {
	
	id: 0, // unique ID for us
	ready: false, // whether movie is ready to receive events or not
	movie: null, // reference to movie object
	clipText: '', // text to copy to clipboard
	handCursorEnabled: true, // whether to show hand cursor, or default pointer cursor
	cssEffects: true, // enable CSS mouse effects on dom container
	handlers: null, // user event handlers
	
	glue: function(elem, appendElem, stylesToAdd) {
		// glue to DOM element
		// elem can be ID or actual DOM element object
		this.domElement = ZeroClipboard.$(elem);
		
		// float just above object, or zIndex 99 if dom element isn't set
		var zIndex = 99;
		if (this.domElement.style.zIndex) {
			zIndex = parseInt(this.domElement.style.zIndex, 10) + 1;
		}
		
		if (typeof(appendElem) == 'string') {
			appendElem = ZeroClipboard.$(appendElem);
		}
		else if (typeof(appendElem) == 'undefined') {
			appendElem = document.getElementsByTagName('body')[0];
		}
		
		// find X/Y position of domElement
		var box = ZeroClipboard.getDOMObjectPosition(this.domElement, appendElem);
		
		// create floating DIV above element
		this.div = document.createElement('div');
		var style = this.div.style;
		style.position = 'absolute';
		style.left = '' + box.left + 'px';
		style.top = '' + box.top + 'px';
		style.width = '' + box.width + 'px';
		style.height = '' + box.height + 'px';
		style.zIndex = zIndex;
		
		if (typeof(stylesToAdd) == 'object') {
			for (addedStyle in stylesToAdd) {
				style[addedStyle] = stylesToAdd[addedStyle];
			}
		}
		
		// style.backgroundColor = '#f00'; // debug
		
		appendElem.appendChild(this.div);
		
		this.div.innerHTML = this.getHTML( box.width, box.height );
	},
	
	getHTML: function(width, height) {
		// return HTML for movie
		var html = '';
		var flashvars = 'id=' + this.id + 
			'&width=' + width + 
			'&height=' + height;
			
		if (navigator.userAgent.match(/MSIE/)) {
			// IE gets an OBJECT tag
			var protocol = location.href.match(/^https/i) ? 'https://' : 'http://';
			html += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="'+protocol+'download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+width+'" height="'+height+'" 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="'+flashvars+'"/><param name="wmode" value="transparent"/></object>';
		}
		else {
			// all other browsers get an EMBED tag
			html += '<embed id="'+this.movieId+'" src="'+ZeroClipboard.moviePath+'" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="'+width+'" height="'+height+'" name="'+this.movieId+'" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="'+flashvars+'" wmode="transparent" />';
		}
		return html;
	},
	
	hide: function() {
		// temporarily hide floater offscreen
		if (this.div) {
			this.div.style.left = '-2000px';
		}
	},
	
	show: function() {
		// show ourselves after a call to hide()
		this.reposition();
	},
	
	destroy: function() {
		// destroy control and floater
		if (this.domElement && this.div) {
			this.hide();
			this.div.innerHTML = '';
			
			var body = document.getElementsByTagName('body')[0];
			try { body.removeChild( this.div ); } catch(e) {;}
			
			this.domElement = null;
			this.div = null;
		}
	},
	
	reposition: function(elem) {
		// reposition our floating div, optionally to new container
		// warning: container CANNOT change size, only position
		if (elem) {
			this.domElement = ZeroClipboard.$(elem);
			if (!this.domElement) this.hide();
		}
		
		if (this.domElement && this.div) {
			var box = ZeroClipboard.getDOMObjectPosition(this.domElement);
			var style = this.div.style;
			style.left = '' + box.left + 'px';
			style.top = '' + box.top + 'px';
		}
	},
	
	setText: function(newText) {
		// set text to be copied to clipboard
		this.clipText = newText;
		if (this.ready) this.movie.setText(newText);
	},
	
	addEventListener: function(eventName, func) {
		// add user event listener for event
		// event types: load, queueStart, fileStart, fileComplete, queueComplete, progress, error, cancel
		eventName = eventName.toString().toLowerCase().replace(/^on/, '');
		if (!this.handlers[eventName]) this.handlers[eventName] = [];
		this.handlers[eventName].push(func);
	},
	
	setHandCursor: function(enabled) {
		// enable hand cursor (true), or default arrow cursor (false)
		this.handCursorEnabled = enabled;
		if (this.ready) this.movie.setHandCursor(enabled);
	},
	
	setCSSEffects: function(enabled) {
		// enable or disable CSS effects on DOM container
		this.cssEffects = !!enabled;
	},
	
	receiveEvent: function(eventName, args) {
		// receive event from flash
		eventName = eventName.toString().toLowerCase().replace(/^on/, '');
				
		// special behavior for certain events
		switch (eventName) {
			case 'load':
				// movie claims it is ready, but in IE this isn't always the case...
				// bug fix: Cannot extend EMBED DOM elements in Firefox, must use traditional function
				this.movie = document.getElementById(this.movieId);
				if (!this.movie) {
					var self = this;
					setTimeout( function() { self.receiveEvent('load', null); }, 1 );
					return;
				}
				
				// firefox on pc needs a "kick" in order to set these in certain cases
				if (!this.ready && navigator.userAgent.match(/Firefox/) && navigator.userAgent.match(/Windows/)) {
					var self = this;
					setTimeout( function() { self.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;
		} // switch eventName
		
		if (this.handlers[eventName]) {
			for (var idx = 0, len = this.handlers[eventName].length; idx < len; idx++) {
				var func = this.handlers[eventName][idx];
			
				if (typeof(func) == 'function') {
					// actual function reference
					func(this, args);
				}
				else if ((typeof(func) == 'object') && (func.length == 2)) {
					// PHP style object + method, i.e. [myObject, 'myMethod']
					func[0][ func[1] ](this, args);
				}
				else if (typeof(func) == 'string') {
					// name of function
					window[func](this, args);
				}
			} // foreach event handler defined
		} // user defined handler for event
	}
	
};


var clip = null;

var clip1 = null;

var clip2 = null;

var clip3 = null;

                function $(id){return document.getElementById(id);}
                
                function init() {
                        clip = new ZeroClipboard.Client();
                        clip.setHandCursor( true );
                        
                        clip.addEventListener('mouseOver', my_mouse_over);
                        
                        clip.glue( 'd_clip_button' );
                        
                }
                

                
                function my_mouse_over(client) {
                        // we can cheat a little here -- update the text on mouse over
                        clip.setText( $('fe_text').value );
                      
                }
                

                
                 function init1() {
                        clip1 = new ZeroClipboard.Client();
                        clip1.setHandCursor( true );
                        clip1.addEventListener('mouseOver', my_mouse_over1);
                        
                        clip1.glue( 'd_clip_button1' );
                        
                }
                

                
                function my_mouse_over1(client) {
                        // we can cheat a little here -- update the text on mouse over
                        clip1.setText( $('fe_text1').value );
                      
                }
                

                

                
                
                 function init2() {
                        clip2 = new ZeroClipboard.Client();
                        clip2.setHandCursor( true );
                        
                        clip2.addEventListener('mouseOver', my_mouse_over2);
                        
                        clip2.glue( 'd_clip_button2' );
                        
                }
                

                
                function my_mouse_over2(client) {
                        // we can cheat a little here -- update the text on mouse over
                        clip2.setText( $('fe_text2').value );
                      
                }
                
                
                 function init3() {
                        clip3 = new ZeroClipboard.Client();
                        clip3.setHandCursor( true );
                        
                        clip3.addEventListener('mouseOver', my_mouse_over3);
                        
                        clip3.glue( 'd_clip_button3' );
                        
                }
                

                
                function my_mouse_over3(client) {
                        // we can cheat a little here -- update the text on mouse over
                        clip3.setText( $('fe_text3').value );
                      
                }                
                
             
          
                
             