// JavaScript Document
function submitsearchit() {
	if (document.forms['searchit'].searchString.value.length <= 2) {
		document.getElementById('content').innerHTML = '<span style="color:red;">søgeordet skal mindst bestå af tre bogstaver, forsøg igen</span>';
		return false;
		}
	else  {
		document.getElementById('content').innerHTML = 'Søger...';

		return true;
		}
	}

function submitsearchitsubmit()
	{
	if (document.forms['searchit'].searchString.value.length <= 2) {
		document.getElementById('content').innerHTML = '<span style="color:red;">søgeordet skal mindst bestå af tre bogstaver, forsøg igen</span>';
		return false;
		}
	else  {
		document.getElementById('content').innerHTML = 'Søger...';
		document.forms['searchit'].submit();
		return true;
		}
	}


function lockunlock() {
	if (document.getElementById('bottombarlock').style.backgroundImage == 'url(images/bottombarunlocked.gif)') {
	counter = 2;}
	else {
	counter = 1;}
	if (counter==1)  {
		document.getElementById('bottombarlock').style.backgroundImage = 'url(images/bottombarunlocked.gif)';
		document.getElementById('maincontent').style.overflow = 'visible';
		document.getElementById('maincontent').style.height = '';
		document.getElementById("mainmore").innerHTML = '';



	}
	else  {
		document.getElementById('bottombarlock').style.backgroundImage = 'url(images/bottombarlocked.gif)';
		document.getElementById('maincontent').style.overflow = 'hidden';
		document.getElementById('maincontent').style.height = '160px';
		stringlength = document.getElementById("maincontent").innerHTML.length;
			if (stringlength>2000) {

			document.getElementById("mainmore").innerHTML = '<a href="#" onClick="lockunlock();">Læs mere</a><img src="images/gotoarrows.gif" />' ;

			}
			else {
			document.getElementById("mainmore").innerHTML = '';
			}



	}
}

function lock() {
		document.getElementById('bottombarlock').style.backgroundImage = 'url(images/bottombarlocked.gif)';
		document.getElementById('maincontent').style.overflow = 'hidden';
		document.getElementById('maincontent').style.height = '160px';

}
function unlock() {
		document.getElementById('bottombarlock').style.backgroundImage = 'url(images/bottombarunlocked.gif)';
		document.getElementById('maincontent').style.overflow = 'visible';
		document.getElementById('maincontent').style.height = '';
		document.getElementById("mainmore").innerHTML = '';

}


function hidedropdownnow() {
				document.getElementById('dropdown').style.visibility = 'hidden';
				}

function dropdownnow(menu, id) {



				function hidedropdownnow() {
				document.getElementById('dropdown').style.visibility = 'hidden';
				}
				function showdropdownnow() {
				document.getElementById('dropdown').style.visibility = 'visible';

				}



if (menu.length > 0)  {

document.getElementById('dropdown').style.marginLeft = document.getElementById(id).offsetParent.offsetLeft-465+'px';
document.getElementById('dropdown').style.visibility = 'visible';

document.getElementById('dropdown').innerHTML =	menu.join('<br />');

document.getElementById('dropdown').onmouseout = hidedropdownnow;

document.onmouseup = hidedropdownnow;

document.getElementById('dropdown').onmouseover = showdropdownnow;


} else if (menu.length == 0){
	document.getElementById('dropdown').style.visibility = 'hidden';
	}


}


function hidedropdownnow2() {
				document.getElementById('dropdown2').style.visibility = 'hidden';
				document.getElementById('dropdown').style.visibility = 'visible';
				}

function dropdownnow2(menu2, id2) {



				function hidedropdownnow2() {
				document.getElementById('dropdown2').style.visibility = 'hidden';
				document.getElementById('dropdown').style.visibility = 'hidden';
				}
				function showdropdownnow2() {
				document.getElementById('dropdown2').style.visibility = 'visible';
				document.getElementById('dropdown').style.visibility = 'visible';
				}




if (menu2.length > 0)  {


tempsize = document.getElementById(id2).offsetWidth;
document.getElementById('dropdown2').style.marginLeft = document.getElementById(id2).offsetParent.offsetLeft+tempsize+9+'px';
document.getElementById('dropdown2').style.marginTop = document.getElementById(id2).offsetTop+4+'px';
document.getElementById('dropdown2').style.visibility = 'visible';

document.getElementById('dropdown2').innerHTML =	menu2.join('<br />');

document.getElementById('dropdown2').onmouseout = hidedropdownnow2;

document.onmouseup = hidedropdownnow2;
document.getElementById('dropdown2').onmouseover = showdropdownnow2;



} else if (menu2.length == 0){
	document.getElementById('dropdown2').style.visibility = 'hidden';
	}


}

function showJobApp(jobname) {

document.getElementById('jobapp').style.visibility='visible';
document.getElementById('jobappHeading').innerHTML= '<h2>Ansøgning: '+jobname+'<h2>';
document.getElementById('job').value=jobname;
}
function drop() {
	document.getElementById('dropdown').style.visibility = 'visible';
	}
