function getWindowHeight() {
	var windowHeight = 0;
	if (typeof(window.innerHeight) == 'number'){windowHeight = window.innerHeight;} 
	else {
		if (document.documentElement && document.documentElement.clientHeight){windowHeight = document.documentElement.clientHeight;} 
		else {
			if (document.body && document.body.clientHeight){windowHeight = document.body.clientHeight;}
		}
	}
	return windowHeight;
}
var DEFAULTCONTENTHEIGHT = 0;

function setFooter() {
	if (document.getElementById) {
		var windowHeight = getWindowHeight();
		var footerElement = document.getElementById('con_footer');
		var footerHeight = footerElement.offsetHeight;
		if (windowHeight > 0) {
			DEFAULTCONTENTHEIGHT = document.getElementById('con').offsetHeight;
			if (windowHeight - (DEFAULTCONTENTHEIGHT + footerHeight) >= 0) {footerElement.style.position = 'absolute';footerElement.style.top = (windowHeight - footerHeight) + 'px';}
			else {footerElement.style.position = 'absolute';footerElement.style.top = (DEFAULTCONTENTHEIGHT) + 'px';}
		}
	}
}

function setPages(){
	var entries = document.getElementsByTagName('a');
	var image, hrefChar,totalChar, imageChar, imageName, path;
	var g2, g3, g4;
						
	for (var i=0; i < entries.length; i++){
		if (entries[i].className == 'PAGE'){
			entries[i].onmouseover = function (){
				var lokatie = this.id + ".html";
				
				oldTotal = document.location.href;  //  http://localhost:88/Essent/Internet/static/img/nav_producten_n_tcm6-3440.gif
				totalChar = oldTotal.length; //  76
				hrefChar = document.location.href.lastIndexOf('/');
				path = document.location.href.substr(0, hrefChar + 1);
				image = document.location.href.slice(hrefChar + 1); // + 1 is voor de / resultaat ::::: nav_producten_n_tcm6-3440.gif
						
				if(image != lokatie){
					document.location.href = lokatie;
				}
			}
		}
	}
}

function setCYC(){
	var entries = document.getElementsByTagName('area');
	for (var i=0; i < entries.length; i++) {
		entries[i].onmouseover = function (){
			if(this.id.indexOf('map')==-1){hidePops();}
			else{hidePops();document.getElementById('pop' + this.id).style.display = "block";}
		}
	}
}

function hidePages(){
	var entries = document.getElementsByTagName('div');
	for (var i=0; i < entries.length; i++){
		if (entries[i].className == 'main'){entries[i].style.display = "none";}
	}
}

function hidePops(){
	var entries = document.getElementsByTagName('div');
	for (var i=0; i < entries.length; i++){
		if (entries[i].className == 'pop'){entries[i].style.display = "none";}
	}
}

function rndmIMG(){
	images = new Array(6);
	images[0] = "static/img/Milupa.jpg";
	images[1] = "static/img/pku3.jpg";
	images[2] = "static/img/Aptamil.jpg";
	images[3] = "static/img/Wachstumsmilch.jpg";
	images[4] = "static/img/GrowingUpMilk.jpg";
	images[5] = "static/img/MilupaMilumil.jpg";
	txt = new Array(6);
	txt[0] = "<strong>Milupa</strong><br />Germany<br />Market leader in <br /> milk cereals";
	txt[1] = "<strong>Milupa</strong><br />Specialised solutions,<br /> paediatric";
	txt[2] = "<strong>Milupa Aptamil</strong><br />Germany and Turkey<br />Number one premium brand";
	txt[3] = "<strong>Milupa Milumil<br />Wachstumsmilch</strong><br />Austria<br />Toddler milk,<br />introduced 2004";
	txt[4] = "<strong>Milupa Growing Up Milk</strong><br />Ireland<br />Toddler milk,<br />introduced 2004";
	txt[5] = "<strong>Milupa Milumil</strong><br />Germany<br />Liquid format infant milk";
	index = Math.floor(Math.random() * images.length);
	document.getElementById('rndmImg').src = images[index];
	document.getElementById('rndmTxt').innerHTML = txt[index];
}

function rndmIMGmc(){
	images = new Array(1);
	images[0] = "static/img/pku3.jpg";
	txt = new Array(1);
	txt[0] = "<strong>Milupa</strong><br />Specialised solutions,<br /> paediatric";
	index = Math.floor(Math.random() * images.length);
	document.getElementById('rndmImg').src = images[index];
	document.getElementById('rndmTxt').innerHTML = txt[index];
}