<!--
var nn = !!document.layers;
var ie = !!document.all;
/** check if XPCOM is supported */
var mozilla = !!window.Components;

var textArr = null;

function initCl()
{
    window.clipboard = new Clipboard();
	textArr = document.getElementById('text');
	if(textArr) {
		textArr.focus();
	}
}

function clipboard_html()
{
    if (BrowserDetect.browser == 'Explorer')
       document.write(' \
		 <img src="/images/a/online/toolbar.gif" width="138" height="22" border="0" usemap="#Map" /> \
			<map name="Map" id="Map"> \
			<area shape="rect" coords="5,2,25,20" href="#" alt="Kopieren" onclick="window.clipboard.copy();"/> \
			<area shape="rect" coords="25,2,45,20" href="#" alt="Einfügen" onclick="window.clipboard.paste();"/> \
			<area shape="rect" coords="46,2,66,20" href="#" alt="Löschen" onclick="window.clipboard.clear();"/> \
			<area shape="rect" coords="90,2,111,20" href="#" alt="E-Mail" onclick="sendMail();"/> \
		  </map> \
        ');
    //else
//       document.write(' \
		 //<img src="/images/a/online/toolbar_short.gif" width="58" height="22" border="0" usemap="#Map" /> \
	//		<map name="Map" id="Map"> \
		//	<area shape="rect" coords="49,5,67,18" href="#" alt="E-Mail" onclick="sendMail();"/> \
//		  </map> \
  //      ');
}

/**
 * A clipboard that can write and read from the system clipboard.
 */
function Clipboard()
{
    if ( nn )
    {
        netscape.security.PrivilegeManager.enablePrivilege( 'UniversalSystemClipboardAccess' );
        var tmp = new java.awt.Frame();
        this.clipboard = fr.getToolkit().getSystemClipboard();
    }
    else if ( ie )
    {
	
	  	this.clipboard = document.createElement( 'INPUT' );
        with ( this.clipboard.style )
        {
            position = 'absolute';
            left = '0px';
            top = '0px';
            visibility = 'hidden';
        }
        document.body.appendChild( this.clipboard );
       
    }
    else if ( mozilla )
    {
        netscape.security.PrivilegeManager.enablePrivilege( 'UniversalXPConnect' );
        this.clipboardid = Components.interfaces.nsIClipboard;
        this.clipboard = Components.classes['@mozilla.org/widget/clipboard;1'].getService( this.clipboardid );
        this.clipboardstring = Components.classes['@mozilla.org/supports-string;1'].createInstance( Components.interfaces.nsISupportsString );
    }

    this.copy = Clipboard_copy;
    this.paste = Clipboard_paste;
	this.clear = Clipboard_clear;
}



/**
 * Copies a text to the system clipboard. Priveleges are necessary.
 * @param text the text
 */
function Clipboard_clear(){
	if(!textArr)
		return;

     textArr.value='';
	 textArr.focus();
	 
}


/**
 * Copies a text to the system clipboard. Priveleges are necessary.
 * @param text the text
 */
function Clipboard_copy()
{

	if(!textArr)
		return;
		
	text = textArr.value;

    if ( nn )
    {
        field.select();
        this.clipboard.setContents( new java.awt.datatransfer.StringSelection( text ), null );
    }
    else if ( ie )
    {
        this.clipboard.value = text;
        this.clipboard.select();
        var textRange = this.clipboard.createTextRange();
        textRange.execCommand( 'copy' );
    }
    else if ( mozilla )
    {
        netscape.security.PrivilegeManager.enablePrivilege( 'UniversalXPConnect' );
        this.clipboardstring.data = text;
        var transfer = Components.classes['@mozilla.org/widget/transferable;1'].createInstance( Components.interfaces.nsITransferable );
        transfer.setTransferData( 'text/unicode', this.clipboardstring, text.length*2 );
        this.clipboard.setData( transfer, null, this.clipboardid.kGlobalClipboard );
    }
	textArr.focus();
}

/**
 * Gets the current text in the system clipboard.
 * @return the text
 */
function Clipboard_paste(){

	if(!textArr)
		return;

    if ( nn )
    {
        var content = this.clipboard.getContents( null );

        if ( content != null )
        {
            textArr.value = content.getTransferData( java.awt.datatransfer.DataFlavor.stringFlavor );
        }
    }
    else if ( ie )
    {
        this.clipboard.value = '';
        var textRange = this.clipboard.createTextRange();
        textRange.execCommand( 'paste' );

        textArr.value = this.clipboard.value;
    }
    else if ( mozilla )
    {
        netscape.security.PrivilegeManager.enablePrivilege( 'UniversalXPConnect' );
        var transfer = Components.classes['@mozilla.org/widget/transferable;1'].createInstance( Components.interfaces.nsITransferable );
        transfer.addDataFlavor( 'text/unicode' );
        this.clipboard.getData( transfer, this.clipboardid.kGlobalClipboard );
        var str = new Object();
        var strLength = new Object();
        transfer.getTransferData( 'text/unicode', str, strLength );
        str = str.value.QueryInterface( Components.interfaces.nsISupportsString );
        textArr.value = str.data.substring( 0, strLength.value / 2 );
    }
	
	textArr.focus();
	
}


function sendMail() {

	if(textArr==null)
		return;

	var actionField		= "mailto:";
	var addressField	= "";
	var subject			= "?subject=Personal Translator Online"
	var body			= "&body="+textArr.value;
	var doAction		= actionField + addressField + subject + body;
	location=doAction;
}

function sendMailVR() {

	if(textArr==null)
		return;

	var actionField		= "mailto:";
	var addressField	= "";
	var subject			= "?subject=Voice Reader Online"
	var body			= "&body="+textArr.value;
	var doAction		= actionField + addressField + subject + body;
	location=doAction;
}

function sendMailLD() {

	if(textArr==null)
		return;

	var actionField		= "mailto:";
	var addressField	= "";
	var subject			= "?subject=LinguaDict"
	var body			= "&body="+textArr.value;
	var doAction		= actionField + addressField + subject + body;
	location=doAction;
}


//-->