function confirmSubmit()
{
	return confirmSubmit( 'continue' );
}

function confirmSubmit( action )
{
var agree=confirm("Are you sure you wish to " + action + "?" );
if (agree)
	return true ;
else
	return false ;
}

function showClipboard()
{
	var pars = '';
	new Ajax.Updater( 'clipboardList', 'ajax_clipboard.jsp', { method: 'get', parameters: pars } );
	$( 'clipboard' ).style.display = 'inline';
}


/*
function addToClipboard( id, jap )
{
	$( 'clipboard' ).style.display = 'inline';
	
	var pars = 'action=add&id=' + id + '&jap=' + jap;
	var myupdater = new Ajax.Updater( 'clipboardList', 'ajax_clipboard.jsp', { method: 'get', parameters: pars } );
	
}
*/

function addToClipboard( id )
{
	$( 'clipboard' ).style.display = 'inline';
	
	var pars = 'action=add&id=' + id;
	var myupdater = new Ajax.Updater( 'clipboardList', 'ajax_clipboard.jsp', { method: 'get', parameters: pars } );
	
}


function showMenu( el )
{
	$( 'm'+el.id ).style.display = 'inline';
} 

function hideMenu( el )
{
	$( 'm'+el.id ).style.display = 'none';
}	

function removeClipboardItem( id )
{
	var pars = 'action=del&id=' + id;
	new Ajax.Updater( 'clipboardList', 'ajax_clipboard.jsp', { method: 'get', parameters: pars } );
}

function mytest( xid )
{
	alert( xid );
	$( ''+xid ).style.display = 'none';
}

function crossClipItem( xid )
{
	$( 'j'+xid ).style.textDecoration = 'line-through';
}

function normalClipItem( xid )
{
	$( 'j'+xid ).style.textDecoration = 'none';
}

function popUp( url ) {
 fenster = window.open(url, "fenster1", "width=600,height=400,status=yes,scrollbars=yes,resizable=yes");
 fenster.focus();
}

var refnr = 0;

function newReferenceInput( phrase ) {
	refnr++;
	
	var pars = 'phrase=' + phrase + '&refnr=' + refnr;
	new Ajax.Updater( 'references', 'ajax_referenceInput.jsp', { parameters: pars, insertion: Insertion.Bottom } );

}

function addReferenceInput( reftype, ref, refid ) {
	refnr++;
	var pars = 'phrase=' + ref + '&refnr=' + refnr + '&refid=' + refid + "&ref=" + ref + "&reftype=" + reftype;
	new Ajax.Updater( 'references', 'ajax_referenceInput.jsp', { parameters: pars, insertion: Insertion.Bottom } );
}	

function removeReferenceInput( ele )
{	
	Element.remove( ele.parentNode.parentNode );
}

function openFinder( id, phrase )
{
	var fv = $( 'inputreference'+id ).value;
	if( fv.length > 0 ) phrase = fv;
	popUp( 'entry_finder.jsp?phrase=' + phrase + '&refnr=' + id );
}
