
var element_name;

function flash_copied_element(element) {	
	element_name = element;
	document.getElementById(element).style.backgroundColor = '#316ac5';
	document.getElementById(element).style.color = 'white';

	function ref_function(){
		revert_copied_element_color(element);
	}
	
	setTimeout("revert_copied_element_color(element_name)", 500);

}

function revert_copied_element_color(element) {	
	document.getElementById(element).style.backgroundColor = 'white';
	document.getElementById(element).style.color = '#932B32';
}




function setClipboardFF(text) {
	var url = [
		'data:text/html;charset=utf-8;base64,PGJvZHk+PC9ib2',
		'R5PjxzY3JpcHQgdHlwZT0idGV4dC9qYXZhc2NyaXB0Ij4KKGZ1',
		'bmN0aW9uKGVuY29kZWQpe3ZhciBzd2ZfZGF0YSA9IFsKICdkYX',
		'RhOmFwcGxpY2F0aW9uL3gtc2hvY2t3YXZlLWZsYXNoO2Jhc2U2',

		'NCxRMWRUQjJ3JywKICdBQUFCNG5EUGdZbGpBd01qSTRNejAlMk',
		'YlMkY5JTJGZTJaZkJnYUdhV3dNRE1uNUthJywKICdrTU10TjRH',
		'ZGdaZ1NJTXdaWEZKYW01UUFFJTJCQm9iaTFCTG5uTXlDcFB6RW',
		'9oU0dJJywKICdQRnAlMkZBeHNEREJRa3BGWkRGUUZGQ2d1eVM4',

		'QXlqSTRBRVVCaXkwVndBJTNEJTNEJwpdLmpvaW4oIiIpOwpkb2',
		'N1bWVudC5ib2R5LmlubmVySFRNTCA9IFsKICc8ZW1iZWQgc3Jj',
		'PSInLHN3Zl9kYXRhLCciICcsCiAnRmxhc2hWYXJzPSJjb2RlPS',
		'csZW5jb2RlZCwnIj4nLAogJzwvZW1iZWQ+JwpdLmpvaW4oIiIp',
		'Owp9KSgi',btoa(encodeURIComponent(text)+'")</'+'script>')
		].join("");
	var tmp = document.createElement("div");
	tmp.innerHTML = '<iframe src="'+url+'" width="0" height="0"></iframe>';
	with(tmp.style){
		position ="absolute";
		left = "-10px";
		top  = "-10px";
		visibility = "hidden";
	};
	document.body.appendChild(tmp);
	setTimeout(function(){
	document.body.removeChild(tmp)},1000);
}

function setClipboardIE(text) {
	var holdtext = document.createElement("textarea");
	holdtext.innerText = text;
	Copied = holdtext.createTextRange();
	Copied.execCommand("RemoveFormat");
	Copied.execCommand("Copy");	
}

function setClipboard(text) {
	if (window.event) {
		setClipboardIE(text);
	} else{
		setClipboardFF(text);
	}
}

function setClipboardFlash(inElement){
	if(!FlashDetect.installed) {
		setClipboard(inElement);   	
	} else { 
  	  	var flashcopier = 'flashcopier';
  		if(!document.getElementById(flashcopier)) {
  		   var divholder = document.createElement('div');
  		   divholder.id = flashcopier;
  		   document.body.appendChild(divholder);
    	}
    	document.getElementById(flashcopier).innerHTML = '';
    	var divinfo = '<embed src="/cms_js/_clipboard.swf" FlashVars="clipboard='+encodeURIComponent(inElement)+'" width="0" height="0" type="application/x-shockwave-flash"></embed>';
    	document.getElementById(flashcopier).innerHTML = divinfo;
	}
}

function setClipboardFlash2(inElement){
	if(!FlashDetect.installed) {
		setClipboard(inElement);   	
	} else { 
  	  	var flashcopier = 'flashcopier';
  		if(!document.getElementById(flashcopier)) {
  		   var divholder = document.createElement('div');
  		   divholder.id = flashcopier;
  		   document.body.appendChild(divholder);
    	}
    	document.getElementById(flashcopier).innerHTML = '';
    	var divinfo = '<embed src="/cms_js/_clipboard.swf" FlashVars="clipboard='+encodeURIComponent(inElement)+'" width="0" height="0" type="application/x-shockwave-flash"></embed>';
    	document.getElementById(flashcopier).innerHTML = divinfo;
	}
}
//http://www.featureblend.com/license.txt
var FlashDetect=new function(){var self=this;self.installed=false;self.raw="";self.major=-1;self.minor=-1;self.revision=-1;self.revisionStr="";var activeXDetectRules=[{"name":"ShockwaveFlash.ShockwaveFlash.7","version":function(obj){return getActiveXVersion(obj);}},{"name":"ShockwaveFlash.ShockwaveFlash.6","version":function(obj){var version="6,0,21";try{obj.AllowScriptAccess="always";version=getActiveXVersion(obj);}catch(err){}
return version;}},{"name":"ShockwaveFlash.ShockwaveFlash","version":function(obj){return getActiveXVersion(obj);}}];var getActiveXVersion=function(activeXObj){var version=-1;try{version=activeXObj.GetVariable("$version");}catch(err){}
return version;};var getActiveXObject=function(name){var obj=-1;try{obj=new ActiveXObject(name);}catch(err){}
return obj;};var parseActiveXVersion=function(str){var versionArray=str.split(",");return{"raw":str,"major":parseInt(versionArray[0].split(" ")[1],10),"minor":parseInt(versionArray[1],10),"revision":parseInt(versionArray[2],10),"revisionStr":versionArray[2]};};var parseStandardVersion=function(str){var descParts=str.split(/ +/);var majorMinor=descParts[2].split(/\./);var revisionStr=descParts[3];return{"raw":str,"major":parseInt(majorMinor[0],10),"minor":parseInt(majorMinor[1],10),"revisionStr":revisionStr,"revision":parseRevisionStrToInt(revisionStr)};};var parseRevisionStrToInt=function(str){return parseInt(str.replace(/[a-zA-Z]/g,""),10)||self.revision;};self.majorAtLeast=function(version){return self.major>=version;};self.FlashDetect=function(){if(navigator.plugins&&navigator.plugins.length>0){var type='application/x-shockwave-flash';var mimeTypes=navigator.mimeTypes;if(mimeTypes&&mimeTypes[type]&&mimeTypes[type].enabledPlugin&&mimeTypes[type].enabledPlugin.description){var version=mimeTypes[type].enabledPlugin.description;var versionObj=parseStandardVersion(version);self.raw=versionObj.raw;self.major=versionObj.major;self.minor=versionObj.minor;self.revisionStr=versionObj.revisionStr;self.revision=versionObj.revision;self.installed=true;}}else if(navigator.appVersion.indexOf("Mac")==-1&&window.execScript){var version=-1;for(var i=0;i<activeXDetectRules.length&&version==-1;i++){var obj=getActiveXObject(activeXDetectRules[i].name);if(typeof obj=="object"){self.installed=true;version=activeXDetectRules[i].version(obj);if(version!=-1){var versionObj=parseActiveXVersion(version);self.raw=versionObj.raw;self.major=versionObj.major;self.minor=versionObj.minor;self.revision=versionObj.revision;self.revisionStr=versionObj.revisionStr;}}}}}();};FlashDetect.release="1.0.3";

