var hintwindow;
var prevwindow;
var timer;
  
function dictionaryWordIn( id, event ) {
	var windowy=0;
	var windowx=0;

	window.clearTimeout(timer);

	if (prevwindow) {
		prevwindow.style.display = "none";
	}
		
	hintwindow = document.getElementById("dictionary" + id);

	if (hintwindow) {
		windowy = event.clientY + document.body.scrollTop;
		windowx = event.clientX + document.body.scrollLeft;
		    
		hintwindow.style.top  = windowy + 5;
		hintwindow.style.left = windowx + 5;
		hintwindow.style.position = "absolute";
		hintwindow.style.display = "block";
	}
	    
	timer = window.setTimeout("dictionaryOut(" + id + ")",9999);
	prevwindow = hintwindow;
}

function dictionaryDescriptionIn( id ) {
	window.clearTimeout(timer);
}

function dictionaryOut( id ) {
	hintwindow = document.getElementById("dictionary" + id);
	window.clearTimeout(timer);
	timer = window.setTimeout("hide()",1500);
}
  
function hide() {
	hintwindow.style.display = "none";
	prevwindow = false;
}

function openWin( url, height, width ) {
	xpos = window.screenLeft+40;
	ypos = window.screenTop+40;
	if (!width)
	  width = 452;
	window.open(url,"_blank","fullscreen=0,width=" + width + ",height=" + height +",left=" + xpos + ",top=" + ypos + ",toolbar=0,resizable=0,directories=0,status=0,menubar=0,scrollbars=1,location=0");
}

function insertEmailLinkText( address, text )
{
	document.write("<a href=\"mailto:" + address.replace("[a]","@") + "\">" + text + "</a>");
}

function insertEmailLink( address )
{
	insertEmailLinkText(address,address.replace("[a]","@"));	
}

function showHelp( id, height, width ) {
	xpos = window.screenLeft+40;
	ypos = window.screenTop+40;
	if (!width) {
		width = 420;
	}
	if (!height) {
		height = 300;
	}
	window.open("/WebModules/ShowHelp.aspx?ID=" + id,"_blank","fullscreen=0,width=" + width + ",height=" + height +",left=" + xpos + ",top=" + ypos + ",toolbar=0,resizable=0,directories=0,status=0,menubar=0,scrollbars=1,location=0");
}


function swap(io,id,host,btn) {
	document.getElementById(id).setAttribute("src","../images/buttons/"+btn+io+"_"+host+".gif");		
}

function SearchText(io,id) {
	if (io=="focus") {
		document.getElementById(id).setAttribute("value","");
	}
	if (io=="blur") {
		if (document.getElementById(id).value.length < 1) {
			document.getElementById(id).setAttribute("value","Søgeord...");
		}
	}
}
