////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
//added by Hoa 27Sep2007
function SetClip(text2copy) {
	if (window.clipboardData) {	//IE
	  window.clipboardData.setData("Text",text2copy);
	  //alert('IE');
	} 
	else {	//none IE
	  //alert('Non IE');
	  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="_clipboard.swf" FlashVars="clipboard='+escape(text2copy)+'" width="0" height="0" type="application/x-shockwave-flash"></embed>';
	  document.getElementById(flashcopier).innerHTML = divinfo;
	}
}
//ended by Hoa 27Sep2007
//copy embed code
function SetEmbed(text2copy) {
	var embedcode =unescape('%3Cobject%20width%3D%27400%27%20height%3D%27261%27%3E%3Cparam%20name%3D%27movie%27%20value%3D%27http%3A%2F%2Fwww%2Eno%2Devil%2Enet%2Fflash%2FEmbedPlayer%2Eswf%3Fvideo%3D')+text2copy+unescape('%27%3E%3C%2Fparam%3E%3Cparam%20name%3D%27wmode%27%20value%3D%27transparent%27%3E%3C%2Fparam%3E%3Cembed%20src%3D%27http%3A%2F%2Fwww%2Eno%2Devil%2Enet%2Fflash%2FEmbedPlayer%2Eswf%3Fvideo%3D')+text2copy+unescape('%27%20type%3D%27application%2Fx%2Dshockwave%2Dflash%27%20wmode%3D%27transparent%27%20width%3D%27400%27%20height%3D%27261%27%3E%3C%2Fembed%3E%3C%2Fobject%3E');
	if (window.clipboardData) {	//IE
	  window.clipboardData.setData("Text",embedcode);
	  //alert('IE');
	} 
	else {	//none IE
	  //alert('Non IE');
	  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="_clipboard.swf" FlashVars="clipboard='+escape(embedcode)+'" width="0" height="0" type="application/x-shockwave-flash"></embed>';
	  document.getElementById(flashcopier).innerHTML = divinfo;
	}
}
//end copy embed code

function SetClip_old (sData) {
//var data = document.getElementById("Data").value;
bResult = window.clipboardData.setData("Text",sData);
//alert(sData);

//window.clipboardData.setData("Text", sData);
}
function GetClip () {
//var data = document.getElementById("Data").value;
var data = window.clipboardData.getData("Text");
return(data);
}
var bResult;
// Select the text to be cut. Trailing spaces in a text
// selection in cut events cause the Cut shortcut menu item to
// remain disabled.
function fnLoad() {
    var r = document.body.createTextRange();
    r.findText(oSource.innerText);
    r.select();
}
// Enable the Cut shortcut menu item over the DIV. Cut is disabled by default.
// Once Cut is enabled, Internet Explorer automatically copies the data to the
// clipboard and removes the selected text from the document.
function fnBeforeCut() {
    event.returnValue = false;
}
//Assign data in text format to the window.clipboardData object.
//Display the result (Boolean) from the setData method in the input box below.
function fnCut(){
	event.returnValue = false;
	bResult = window.clipboardData.setData("Text",oSource.innerText);
	//alert(bResult)
	oSource.innerText = "";
	tText.innerText += bResult;
}
// Enable the Paste shortcut menu item over the DIV. Paste is disabled by default.
function fnBeforePaste() {
    event.returnValue = false;
}
// Cancel the returnValue in onpaste for the text input, which
// has a default behavior.
function fnPaste() {
    event.returnValue = false;
	oTarget.innerText = window.clipboardData.getData("Text");
}

////////////////////////////////////////////////////////////
