var timer

function pageHit(){
  p = escape(document.location.href);
  rfr = escape(document.referrer);
  if (rfr == "undefined"){ rfr = "";}
  sx = screen.width;
  sy = screen.height;
  sc = (navigator.appName.indexOf("Microsoft") > -1) ? screen.colorDepth : screen.pixelDepth;
  src = 'stats.php?p=' + p + '&rfr=' + rfr + '&sx=' + sx + '&sy=' + sy + '&sc=' + sc;
  src = '<img style="position:absolute;left:-10px;top:-10px;" src="' + src + '" width="1" height="1" border="0" alt="" />';
  document.getElementById('counter').innerHTML = src;  
  
}


startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("dropdown");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
  }
  node.onmouseout=function() {

  this.className=this.className.replace(" over", "");
   }
   }
  }
 }
}


function clearSearch(oobj){
	if(oobj.value == "trefwoord..."){
		oobj.value = "";
	}
}

function setSearchTerm(oobj){
	if(oobj.value == ""){
		oobj.value = "trefwoord...";
	}
}

function foldArchive(oobj){

	if(oobj.className == "archiefRightFolded"){
		for (i=0; i<oobj.childNodes.length; i++) {
			node = oobj.childNodes[i];
			if (node.nodeName=="UL") {
			 node.className = "";
			 oobj.className = "archiefRightUnfolded";
			}
		}
	}
	else{
 			for (i=0; i<oobj.childNodes.length; i++) {
				node = oobj.childNodes[i];
				if (node.nodeName=="UL") {
					 node.className = "archiefRightSubFolded";
					 oobj.className = "archiefRightFolded";
			}
		}
	}
}

function tableHover(){
    if (document.getElementById('vacatureOverzicht')){
        var oTable = document.getElementById('vacatureOverzicht');
        var aRows = oTable.getElementsByTagName('tr');
        var i = aRows.length;
        while(i--){        
            aRows[i].onmouseover = function(){
                var aHref = this.getElementsByTagName('a');
                if (aHref.length > 0){
                    this.className += ' rowHover';
                    aHref[0].style.textDecoration = 'underline';
                }
            }
            aRows[i].onmouseout = function(){
            
                var aHref = this.getElementsByTagName('a');
                if (aHref.length > 0){
                    aHref[0].style.textDecoration = 'none';
                }
            
                this.className = this.className.replace(/rowHover/g, '');
            }
            aRows[i].onclick = function(){
                var aHref = this.getElementsByTagName('a');
                if (aHref.length > 0){
                    document.location.href = aHref[0].href;
                }
            }    
                
        }
    }
}

function toggle(id){

    if (document.getElementById(id)){
        var elem = document.getElementById(id);
        if (elem.style.display == 'none'){    
            elem.style.display = '';
        } else {
            elem.style.display = 'none';
        }
    } 
}

function loadUp(){   
pageHit(); 
startList(); 
tableHover();
}

 function $(oObj){
 
        return document.getElementById(oObj);
 }

onload = loadUp; 