
function displayMessage()
{
  var el = gebyid("info_1");
  el.style.display = '';
}
    
function openPopup(url,nam,w,h)
{
	var popupwin;
	var Posleft = (screen.width - w) / 2;
	var Postop  = (screen.height - h) / 2;
	
	nam=nam+"_"+w+"_"+h;
	
	popupwin = window.open(url,nam,'left='+Posleft+',top='+Postop+',height='+h+',width='+w+',scrollbars=auto,resizable=no,status=no');
	popupwin.moveTo(Posleft,Postop);
	popupwin.focus();
}

var cookieID		= "fw_";
var cookieDomain	= "";
var cookiePath		= "";
/* -------------------------------------- */



/* -------------------------------------- */
function getcookie(name)
{
	cname = cookieID + name + '=';
	cpos  = document.cookie.indexOf( cname );
	
	if (cpos != -1)
	{
		cstart = cpos + cname.length;
		cend   = document.cookie.indexOf(";", cstart);
		
		if (cend == -1)
			cend = document.cookie.length;
		
		return unescape( document.cookie.substring(cstart, cend) );
	}
	
	return null;
}
/* -------------------------------------- */



/* -------------------------------------- */
function setcookie(name, value)
{
	expire = "";
	domain = "";
	path   = "/";
	expire = "; expires=Wed, 1 Jan 2020 00:00:00 GMT";
	
	if (cookieDomain != "")
		domain = '; domain=' + cookieDomain;
	
	if (cookiePath != "")
		path = cookiePath;
		
	document.cookie = cookieID + name + "=" + value + "; path=" + path + expire + domain + ';';
}
/* -------------------------------------- */



/* -------------------------------------- */
function ctoggle(cid,show)
{
	sto = new Array();
	tar = new Array();

	if(tmp = getcookie('collapseprefs'))
		sto = tmp.split(",");
	
	for(i = 0;i < sto.length;i++)
	{
		if(sto[i] != cid && sto[i] != "")
			tar[tar.length] = sto[i];
	}
	
	if(show)
	{
		chide(cid + '_c');
		cshow(cid + '_o');
	}
	else
	{
		tar[tar.length] = cid;
		
		cshow(cid + '_c');
		chide(cid + '_o');
	}
	
	setcookie( 'collapseprefs', tar.join(','));
}
/* -------------------------------------- */



/* -------------------------------------- */
function chide(cid)
{
	var e = gebyid(cid);
	
	if(!e)
		return;
	else
		e.style.display = "none";
}
/* -------------------------------------- */



/* -------------------------------------- */
function cshow(cid)
{
	var e = gebyid(cid);
	
	if(!e)
		return;
	else
		e.style.display = "";
}
/* -------------------------------------- */



/* -------------------------------------- */
function gebyid(id)
{
	var retVal = null;
	
	if(document.getElementById)
		retVal = document.getElementById(id);
	else if(document.layers)
		retVal = document.layers[id];
	else if(document.all)
		retVal = document.all[id];
	return retVal;
}
/* -------------------------------------- */



/* -------------------------------------- */
function openDictWord(id)
{
  openPopup("index.php?page=Lexikon_Content&amp;wordID=" + id,"lexikon",700,500);
}
/* -------------------------------------- */

