function RefreshWikiLink (inputid, linkid)
{
	//<small>check 'blabla'</small><img border=0 src='images/externblank.png'>
	v=document.getElementById(inputid).value;
	document.getElementById(linkid).href=FormatWikiLinkFromDBToURL(v);
	document.getElementById(linkid).innerHTML="<small>"+CHECK_JS+" '"+v+"'</small><img border=0 src='images/externblank.png'>";;
}

function CopyToClipboard(inhalt)
{
   
    zwischenspeicher.innerText = inhalt;
    if (!zwischenspeicher.createTextRange) 
    	alert(FUNCTION_IN_IE_ONLY_JS);
    ablage = zwischenspeicher.createTextRange();
    ablage.execCommand("Copy");
  }

function CopyAuthorToEditor()
// copy the content of the author field to the editor field (when adding a reference etc.)
{
	// "authors" is the value of the php constant FAuthors
	document.getElementsByName ("editors")[0].value = document.getElementsByName ("authors")[0].value;
	document.getElementsByName ("authors")[0].value = '';
}

function RefreshURLLink (inputid, linkid)
{
	v=document.getElementById(inputid).value;
	document.getElementById(linkid).href=v;
	document.getElementById(linkid).innerHTML="<small>"+CHECK_JS+" '"+v+"'</small><img border=0 src='images/externblank.png'>";;
}

function FormatWikiLinkFromDBToURL (dbwikilink) // this function is supposed to do the same as the PHP function with the same name
{
	if (dbwikilink=='')
		return '';
	pos=dbwikilink.indexOf(':');
	if (pos==-1) // if there should be no language specification, it will be English by default
	{
		lang='en';
		url=dbwikilink;
	}
	else
	{
		lang=dbwikilink.substring(0,pos);
		url=dbwikilink.substring(pos+1,dbwikilink.length);
	}
	return 'http://'+lang+'.wikipedia.org/wiki/'+url;
}


