// JavaScript Document

/*function lukkUnder(meny){
	
	var undermeny = meny;
	
	if(meny == "3"){
	document.getElementById("pro_under_drilling").style.height = "12px";
	document.getElementById("pro_under_drilling").innerHTML = "<div id=\"pro_under_well\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></div>";
	}
	
	if(meny == "2"){
	document.getElementById("pro_under_well").style.visibility = "hidden";
	document.getElementById("pro_under_well").style.height = "0px";
	document.getElementById("pro_under_well").innerHTML = "<img src=\"images/spacer.gif\" width=\"1\" height=\"1\">";
	}


}*/

function lukkAlle(){
	
	/*lukkUnder('3');
	lukkUnder('2');*/
	
	document.getElementById("news_under").style.visibility = "hidden";
	document.getElementById("news_under").style.height = "1px";
	document.getElementById("news_under").innerHTML = "<img src=\"images/spacer.gif\" width=\"1\" height=\"1\">";
	
	
	document.getElementById("pro_under").style.visibility = "hidden";
	document.getElementById("pro_under").style.height = "1px";
	document.getElementById("pro_under").innerHTML = "<img src=\"images/spacer.gif\" width=\"1\" height=\"1\">";
	
	
	document.getElementById("kon_under").style.visibility = "hidden";
	document.getElementById("kon_under").style.height = "1px";
	document.getElementById("kon_under").innerHTML = "<img src=\"images/spacer.gif\" width=\"1\" height=\"1\">";
}



function apneUndermeny(element, height){

var elementet = element;
var hoyde = height + "px";
var innhold = null;

if(elementet == "news_under"){
	innhold = "<div class=\"menyitem1\" onClick=\"document.location.href='index.php?1=news&2=2011';\">2011</div><div class=\"menyitem1\" onClick=\"document.location.href='index.php?1=news&2=2010';\">2010</div><div class=\"menyitem1\" onClick=\"document.location.href='index.php?1=news&2=2009';\">2009</div><div class=\"menyitem1\" onClick=\"document.location.href='index.php?1=news&2=2008';\">2008</div><div class=\"menyitem1\" onClick=\"document.location.href='index.php?1=news&2=2007';\">2007</div><div class=\"menyitem1\" onClick=\"document.location.href='index.php?1=news&2=2006';\" style=\"margin-right:0px;\">Archive</div>";
}

if(elementet == "pro_under"){
	innhold = "<div class=\"menyitem1\" onClick=\"document.location.href='index.php?1=products&2=drilling';\">Drilling</div><div class=\"menyitem1\" onClick=\"document.location.href='index.php?1=products&2=well';\" style=\"margin-right:0px;\">Well Intervention</div>";
}

/*if(elementet == "pro_under"){
	innhold = "<div class=\"menyitem1\" onClick=\"document.location.href='index.php?1=products&2=drilling'; lukkUnder(2); apneUndermeny('pro_under_drilling', '12');\">Drilling</div><div class=\"menyitem1\" onClick=\"document.location.href='index.php?1=products&2=well'; lukkUnder(3); apneUndermeny('pro_under_well', '12');\">Well Intervention</div>";
}

if(elementet == "pro_under_drilling"){
	innhold = "<div class=\"menyitem2\" onClick=\"document.location.href='index.php?1=products&2=case_histories';\">Case Histories</div><div class=\"menyitem2\" onClick=\"document.location.href='index.php?1=products&2=datasheets';\">Datasheets</div><div class=\"menyitem2\" onClick=\"document.location.href='index.php?1=products&2=user_manual';\">User manual</div><div class=\"menyitem2\" onClick=\"document.location.href='index.php?1=products&2=technical_documents';\">Technical Documents</div>";
}

if(elementet == "pro_under_well"){
	innhold = "<div class=\"menyitem2\" onClick=\"document.location.href='index.php?1=products&2=case_histories2';\">Case Histories </div><div class=\"menyitem2\" onClick=\"document.location.href='index.php?1=products&2=datasheet2';\">Datasheet</div><div class=\"menyitem2\" onClick=\"document.location.href='index.php?1=products&2=user_manual2';\">User Manual</div><div class=\"menyitem2\" onClick=\"document.location.href='index.php?1=products&2=technical_documents2';\">Technical Documents</div>";
}*/

if(elementet == "kon_under"){
	innhold = "<div class=\"menyitem1\" onClick=\"document.location.href='index.php?1=contact&2=norway';\">Norway</div><div class=\"menyitem1\" onClick=\"document.location.href='index.php?1=contact&2=uk';\">UK</div><div class=\"menyitem1\" onClick=\"document.location.href='index.php?1=contact&2=usa';\" style=\"margin-right:0px;\">North America</div>";
}


document.getElementById(elementet).style.visibility = "visible";
document.getElementById(elementet).style.height = hoyde;
document.getElementById(elementet).innerHTML = innhold;
}

function menyer(type){
	var menyen = type;
	
	if(menyen == "news"){	
	apneUndermeny('news_under', '15');
	}
	
	if(menyen == "products"){	
	apneUndermeny('pro_under', '15');
	}
	
	if(menyen == "contact"){	
	apneUndermeny('kon_under', '15');
	}
}

/*function undermenyer(art){
	var undermenyen = art;
	
	if(undermenyen == "drilling"){	
	apneUndermeny('pro_under', '12');
	apneUndermeny('pro_under_drilling', '12');
	}
	
	if(undermenyen == "case_histories"){	
	apneUndermeny('pro_under', '12');
	apneUndermeny('pro_under_drilling', '12');
	}
	
	if(undermenyen == "datasheets"){	
	apneUndermeny('pro_under', '12');
	apneUndermeny('pro_under_drilling', '12');
	}
	
	if(undermenyen == "user_manual"){	
	apneUndermeny('pro_under', '12');
	apneUndermeny('pro_under_drilling', '12');
	}
	
	if(undermenyen == "technical_documents"){	
	apneUndermeny('pro_under', '12');
	apneUndermeny('pro_under_drilling', '12');
	}
	
	if(undermenyen == "well"){	
	apneUndermeny('pro_under', '12');
	apneUndermeny('pro_under_well', '12');
	}
	
	if(undermenyen == "case_histories2"){	
	apneUndermeny('pro_under', '12');
	apneUndermeny('pro_under_well', '12');
	}
	
	if(undermenyen == "datasheet2"){	
	apneUndermeny('pro_under', '12');
	apneUndermeny('pro_under_well', '12');
	}
	
	if(undermenyen == "user_manual2"){	
	apneUndermeny('pro_under', '12');
	apneUndermeny('pro_under_well', '12');
	}
	
	if(undermenyen == "technical_documents2"){	
	apneUndermeny('pro_under', '12');
	apneUndermeny('pro_under_well', '12');
	}
	
	
}*/
