//methode om video's aan het DOM toe te voegen
	function setVideo(divId,videoPath, width, height) {
		WindowsMedia = detectWindowsMedia();
		if (WindowsMedia == true) {
			width = width?width:'250';
			height = height?height:'250';
			var myObject = document.createElement('object'); 
			obj = document.getElementById(divId);
			obj.appendChild(myObject); 
			myObject.width = width; 
			myObject.height = height; 
			myObject.stretchToFit = true;
			myObject.autoplay = true;
			myObject.classid= "clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6";  
			myObject.URL = videoPath;
			//myObject.uiMode = "mini";
		} else {
			obj = document.getElementById(divId);
			obj.innerHTML = 'You have no Windows Media plugin installed! To watch our videos, please download Windows Media Player and the free plugin from <a target="_blank" href="http://www.microsoft.com/downloads/details.aspx?FamilyID=1d224714-e238-4e45-8668-5166114010ca&DisplayLang=nl#Instructions">the Microsoft site</a>';
		}
	}

//Uitklapmenu -- Voegt de juiste classnames toe aan de LI's
	sfHover = function() {
		if (document.getElementById("nav")) {
			var sfEls = document.getElementById("nav").getElementsByTagName("LI");
			for (var i=0; i<sfEls.length; i++) {
				sfEls[i].onmouseover=function() {
					this.className+=" sfhover";
				}
				sfEls[i].onmouseout=function() {
					this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
				}
			}
		}
	}
	if (window.attachEvent)	window.attachEvent("onload", sfHover);

//Popup
	function popUp(URL) {
		day = new Date();
		id = day.getTime();
		eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=300,height=250,left = 250,top = 297');");
	}
	
//Popup
	function popUpMax(URL) {
		screenheight = screen.height;
		screenheight = screenheight - 200;
		screenwidth = screen.width;
		screenwidth = screenwidth - 20;
		day = new Date();
		id = day.getTime();
		eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=1,scrollbars=1,location=1,status=1,menubar=1,resizable=1,width='+screenwidth+',height='+screenheight+',left=0,top=0');");
	}

//Toon kleine afbeelding voor preview bouwsteen (huisstijlmanager)
	function toon_afbeelding_klein(afbeelding) {
		afbeelding.src='/images/not_available_klein.gif'
	}
	function toon_afbeelding_icon(afbeelding) {
		afbeelding.src='/images/not_available_icon.gif'
	}

//Switch van taal
	function SwitchTaal(bedrijf,taal) {
		if (bedrijf !== "-1") //bezoeker zit binnen een bedrijf
			location.href='/p3.php?lang=' + taal + '&bedrijf=' + escape(bedrijf);
		else //bezoeker zit binnen de startpagina
			location.href='/p3.php?lang=' + taal;
	}

//Switch van bedrijf
	function SwitchBedrijf(bedrijf) {
		if (bedrijf == "1627" || bedrijf == "Activated Carbon Americas") {
			popUpMax('http://www.norit-americas.com');
		}
		else if (bedrijf == "1618" || bedrijf == "Activated Carbon") {
			popUpMax('http://www.norit-ac.com');
		}
		else if (bedrijf == "1617" || bedrijf == "Norit Corporate") {
			location.href= '/?rubriekid=2622';
		}
		else {
			var bedrijf = escape(bedrijf);
			//location.href= '/' + bedrijf + '/';
			location.href= '/p3.php?rubriekid='+bedrijf;
		}
	}
	
//FAQ - dropdown
	function faqMakeDropdown(){
		var arrDivjes = document.getElementsByTagName('div');
		var dropdown = "<select name='kieseenvraag'>\n<option value=''>&nbsp;&nbsp;</option>\n";
		var menu = document.getElementById('faqDropdown');
		
		for(var i=0;i<arrDivjes.length;i++) {
			if (arrDivjes[i].name == "vraagenantwoord") {
				dropdown = dropdown + "<option>" + arrDivjes[i].id + "</option>\n";
			}
		}
		dropdown = dropdown + "</select>";
		menu.innerHTML = dropdown;
	}

//FAQ - toggle faq divjes
	function faqToggle() {
		//komt nog!
	}
	
//Instellen van de hoogte van de div maintable
	var isNav4, isNav6, isIE
	var isBrand = navigator.appName
	var agt = navigator.userAgent.toLowerCase()
	var navVer = parseInt(navigator.appVersion)
	var isNav4 = (isBrand == "Netscape" && navVer < 5) ? true : false
	var isNav6 = (isBrand == "Netscape" && navVer >= 5) ? true : false
	var isNav46 = ((isBrand == "Netscape") && (parseFloat(navigator.appVersion) >= parseFloat(4.6)) && (parseFloat(navigator.appVersion) < parseFloat(4.7))) ? true : false
	var isNav47 = ((isBrand == "Netscape") && (parseFloat(navigator.appVersion) >= parseFloat(4.7))) ? true : false
	var isIE = ((agt.indexOf("msie") != -1) && (parseInt(navVer) >= 4)) ? true : false
	var mac = (agt.indexOf("mac")!= -1);
	
	//haal hoogte window binnen
	function getInsideWindowHeight()
	{
		if (isNav4 || isNav6)
			return window.innerHeight
		else 
	 		return document.body.clientHeight
	}
	
	//resize de div
	function zetScrollHoogte()
	{
		schermhoogte = getInsideWindowHeight();
		obj = document.getElementById('divMaintable');
		objdrie = document.getElementById('Vervolgpagina2kolomsRechts_1_3');
		objvier = document.getElementById('VervolgpaginaHaffmans2kolomsRechts_1_3');
		objvijf = document.getElementById('NieuwsbriefOnder_1_1');
				
		objtwee = document.getElementById('mainsite');
		objLinkerbalk = document.getElementById('linkerbalk');
		if (objLinkerbalk)
			var Linkerbalkhoogte = objLinkerbalk.offsetHeight;
		
		if (obj) {
			var hoogte = obj.offsetHeight; //hoogte maintable
			hoogte = hoogte + 36;  //hoogte maintable + header
			
			if (hoogte < schermhoogte) { 
				hoogte = schermhoogte;
				if (objvijf) {
					//obj.style.height = hoogte - 85;
				} else {
					obj.style.height = hoogte - 36;
				}
				if (objdrie)
					objdrie.style.height = hoogte - 127;
				if (objvier)
					objvier.style.height = hoogte - 127;
			}
			
			if ((Linkerbalkhoogte > hoogte) && (Linkerbalkhoogte > schermhoogte)) {
				if (objtwee)
					objtwee.style.height = Linkerbalkhoogte;
					
				obj.style.height = Linkerbalkhoogte - 36;
			} else {
				if (objtwee)
					objtwee.style.height = hoogte;
			}
			
		}

	}

window.onresize = zetScrollHoogte;

function openSudmoEcomEng() {
   if (screen) {
      var topPos = 0;
      var leftPos = screen.width /2 -505;
   }
   var newWin = window.open('http://195.245.9.166/index.jsp?LangISO=en','ecomenglisch','scrollbars,toolbar,width=1010,height=680,left='+leftPos+',top='+topPos+'');
   newWin.focus();
}

function toggleVisibility(id,actie) {
	if (obj = document.getElementById(id)) {
		obj.style.display = actie;
	}
}

//Uitklapmenu Norit
	var norittable = false;
	var norithiddenspan = false;
	var noritnavdiv = false;
	var noritinnertable =false;
	var noritinnertabletd =false;
	
	var hoofdnavover = function (el, nr) {
		if (/\/admin\//.test(document.location))
			return false;
		
		var hiddendiv = nodes.childNodeBy (el, 'nodeName=DIV');
		if (!hiddendiv)
			return false
	
		if (hiddendiv.hasChildNodes()) {
			hiddendiv.style.display = 'block';
			hiddendiv.style.width = 130;
			// checken op IE: nou ja;
			if (window.event) { 
				hiddendiv.style.marginTop = el.offsetHeight - 1;
				hiddendiv.style.marginLeft = 0-el.offsetWidth + 3;
			}
		}
	}
	
	var hidemenu = function () {
		norittable = false;
		norithiddenspan = false;
		noritnavdiv = false;
		var navdiv = document.getElementById('navdiv0');
		if (navdiv) 
			navdiv.style.display = 'none';
	}
	
	var hoofdnavout = function (el, nr) {
		var hiddendiv = nodes.childNodeBy (el, 'nodeName=DIV');
		if (hiddendiv)
			hiddendiv.style.display = 'none';
	}
	
	var subnavdivover  = function (el) {
		//window.status = el.innerHTML.replace(/^\&nbsp;/,'');
	}
	
	var subnavdivout  = function (el) {
		//window.status = '';
	}
	
	var subnavclick = function (url) {
		document.location ='/p3.php' + url;
		if (window.event)
			window.event.cancelBubble = true;
	}