function setLocation(strUrl) {
	location.href = strUrl;
}

function redirectToProject(strPage, intProjectID) {
	if(intProjectID > 0) {
		var s;
		s = setTimeout("setLocation('"+strPage+"?action=viewproject&project_id="+intProjectID+"');", 100);
	}
}

// INSTELLINGEN

var id_van_menu_div = "menu";
var id_van_menu_link = "menulink";
var menuidson = new Array(7);
var menuidsoff = new Array(7);

menuidson[0] = 'button_profiel-over.gif';
menuidson[1] = 'button_actueel-over.gif';
menuidson[2] = 'button_projecten-over.gif';
menuidson[3] = 'button_turnkey-over.gif';
menuidson[4] = 'button_referenties-over.gif';
menuidson[5] = 'home_b_home.gif';
menuidson[6] = 'home_b_contact.gif';

menuidsoff[0] = 'button_profiel.gif';
menuidsoff[1] = 'button_actueel.gif';
menuidsoff[2] = 'button_projecten.gif';
menuidsoff[3] = 'button_turnkey.gif';
menuidsoff[4] = 'button_referenties.gif';
menuidsoff[5] = 'home_b_home-over.gif';
menuidsoff[6] = 'home_b_contact-over.gif';

// ************

var pl, pm, tijd;

function findPosX(obj) {
  var curleft = 0;
  if (obj.offsetParent) {
    while (obj.offsetParent) {
      curleft += obj.offsetLeft;
      obj = obj.offsetParent;
    }
  } else if (obj.x) {
    curleft += obj.x;
  }
  return curleft;
}

function findPosY(obj) {
  var curtop = 0;
  if (obj.offsetParent) {
    while (obj.offsetParent) {
      curtop += obj.offsetTop
      obj = obj.offsetParent;
    }
  } else if (obj.y) {
    curtop += obj.y;
  }
  return curtop;
}

function initPopup() {
  pl = document.getElementById(id_van_menu_link);
  pm = document.getElementById(id_van_menu_div);

  pl.onclick = function(evt)   {
    if (tijd) { clearTimeout(tijd); }
    if (!evt) { evt = event; }

    srcObj = evt.srcElement ? evt.srcElement : evt.target;

    var y = findPosY(srcObj) + 20;
    if (pm.offsetHeight + y + 10 > document.body.scrollHeight) { y = y - pm.offsetHeight - 20; }

    var x = findPosX(srcObj) + 20;
    if (pm.offsetWidth + x + 10 > document.body.clientWidth) { x = x - pm.offsetWidth; }

    pm.style.left = x + "px";
    pm.style.top  = y + "px";
    pm.style.visibility = "visible";
    tijd = setTimeout("closePopup()", 5000);
  }

  pm.onmouseout = function() { tijd = setTimeout("closePopup()", 500); }
  pm.onmouseover = function() { clearTimeout(tijd); }
}

function closePopup() {
  pm.style.visibility = "hidden";
  pm.style.left = "0px";
  pm.style.top = "0px";
}

function checkPopup() {
  if (document.getElementById(id_van_menu_link)) { initPopup(); }
  else { setTimeout("checkPopup()", 100); }
}
checkPopup();

function menuToggle(el,id,bo) {
	if (bo == 'on') {
		el.src = 'images/' + menuidson[id];
	} else {
		el.src = 'images/' + menuidsoff[id];
	}
}

function goSelectBox() {
	//box = document.forms[0].select_links;
	box = document.getElementById('select_links');
	destination = box.options[box.selectedIndex].value;
	if (destination) location.href = destination;
}

var pUrl = escape(document.location);
var pRef;
try {  pRef = escape(document.referrer);} catch (er) {pRef = '';}
var t = new Date();
var im = new Image();
im.src = "http://195.35.183.132/hit?pageUrl=" + pUrl + "&websiteId=71&referrer=" + pRef + "&dummy=" + t.getTime();


function init() {
	// Zet de display waarden voor de elementen van CSS Combobox
	if(document.getElementById('combox-list01')) {
		document.getElementById('combox-list01').style.display = 'none';
	}
}
window.onload = init;

function toggleCombobox(sElementId) {
	oElement = document.getElementById(sElementId);
	
	if (oElement.style.display == 'none' || oElement.style.display == null) {
		oElement.style.display = 'block';
	}
	else {
		oElement.style.display = 'none';
	}
}