function alignCenter(obj) //Centrerer obj vertikalt i browservinduet. 
{	
	obj.style.position = "absolute"; //SKAL angives ellers flyttes obj ikke....
	var windowWidth = document.body.clientWidth;
	var windowHeight = document.body.clientHeight;
	obj.style.top = (windowHeight - obj.offsetHeight)/2;
	obj.style.left = (windowWidth - obj.offsetWidth)/2;
}

function submitToPopup(formref)
{
	newwin = window.open('about:blank','findOs','height=550,width=600,left=4,top=4,titlebar=no,scrollbars=no');
	formref.submit();
	newwin.focus();
}

function changeImage(imgName, imgFile)
{
	document[imgName].src = imgFile;
}

function show(obj)
{
	hideAll();
	obj.style.visibility = "visible";
}

function hide(obj)
{
	if(obj.style != null)
	obj.style.visibility = "hidden";
}

function hideAll()
{
	var count=8;
	var streng = "underMenu";
	for(var i=1; i<=count; i++)
	{
		document.all['underMenu'+i].style.visibility ="hidden"; //gemmer alle undermenuerne...
	}
}

function makePosition(n,obj,tabel)
{
	obj.style.top = n.offsetTop - document.all['linkCelle'].offsetHeight - (obj.offsetHeight/2) + tabel.offsetTop; //document.all['linkCelle'].offsetHeight angiver højden på cellen ovenover..
	obj.style.left = n.offsetLeft + n.offsetWidth + tabel.offsetLeft +10 ;
	show(obj);
	//alert("Linket har denne position: X= "+ n.offsetLeft +", Y="+n.offsetTop + " og bredden: "+ n.offsetWidth + ". Menuen har denne position: X= "+ obj.offsetLeft +", Y="+obj.offsetTop + ". Egenskaber for linkcellen: højde= " + document.all['linkCelle'].offsetHeight);
}
//----------Script til dynamisk vinduepopup starter her...-----------

var mylocation="find.html"
var winheight=250 //jo højere værdi, des mindre vindue
var winsize=550 //jo højere værdi, des mindre vindue
var x=5
var tid=10 //jo højere værdi, des langsomere åbnes vinduet...

function go()
{
	win2=window.open("","","scrollbars=no")
	if (!document.layers&&!document.all)
	{
		win2.location=mylocation
		return
	}
	win2.resizeTo(100,100)
	win2.moveTo(0,0)
	go2()
}
function go2()
{
	if (winheight>=screen.availHeight-3)
	x=0
	win2.resizeBy(5,x)
	winheight+=5
	winsize+=5
	if (winsize>=screen.width-5)
	{
		win2.location=mylocation
		winheight=250
		winsize=550
		x=5
		return
	}
	setTimeout("go2()",tid) //Bestemmer vha "tid" hvor lang tid vinduet skal være om at åbne....
}

