/*
Filnamn:				javascript.js
Författare och datum :  Novitell AB 
						Anders Jonasson 2007-09-14
Syfte:					Används för att skriva ut dropdownmenyn anropas via topmenu.tpl.			
Variabler:				Se nedan. 
*/
//DROPDOWN MENU (UNDERSIDOR)
function show_dropdown(node){
	//Hämtar absolut vänster-position för aktuellt lager
	xPos = document.getElementById('idTopMenu_'+node).offsetLeft;
	tempEl = document.getElementById('idTopMenu_'+node).offsetParent;
	while (tempEl != null) {
		xPos += tempEl.offsetLeft;
		tempEl = tempEl.offsetParent;
	}
	
	//Hämtar absolut topp-position för aktuellt lager
	yPos = document.getElementById('idTopMenu_'+node).offsetTop;
	tempEl = document.getElementById('idTopMenu_'+node).offsetParent;
	while (tempEl != null) {
		yPos += tempEl.offsetTop;
		tempEl = tempEl.offsetParent;
	}
	
	//Justerar dropdown-lagrets position (i förhållande till länken)
	yPos = yPos+13+"px";
	xPos = xPos-8+"px";
	
	//Bestämmer dropdown-lagrets position
	document.getElementById("idDropdownMenu_"+node).style.left = xPos;
	document.getElementById("idDropdownMenu_"+node).style.top = yPos;
	
	//Visar dropdown-lager
	document.getElementById("idDropdownMenu_"+node).style.display = "block";
	
}
function hide_dropdown(node){
	//Gömmer dropdown-lager
	document.getElementById("idDropdownMenu_"+node).style.display = "none";
}

//kod för att ändra alpha -- HOVER EFFEKT PÅ LAGER
function hover(id){
	document.getElementById(id).style.opacity = 0.85;//FF
	document.getElementById(id).style.filter='alpha(opacity=85)';//IE
}

function hoverOut(id){
	document.getElementById(id).style.opacity = 1.0;//FF
	document.getElementById(id).style.filter='alpha(opacity=100)';//IE
}

//javascrpit för kartan under jobb
function showAreaJob(id)
{
	document.getElementById(id).style.visibility = "visible";
}

function hideAreaJob(id)
{
	document.getElementById(id).style.visibility = "hidden";
}