function heroUsage(id) {
  pagina = escape(document.location.href);
  ref = escape(document.referrer);
  if((ref == "") || (ref == "undefined")){ ref = "favorieten"; }
  screensize = screen.width + "x" + screen.height;
  screencolor = (navigator.appName.indexOf("Microsoft") > -1) ? screen.colorDepth : screen.pixelDepth;
  document.frames['hero_usage'].location="usage/statistieken_save.php?pagina="+pagina+"&referrer="+ref+"&screensize="+screensize+"&screencolor="+screencolor+"&pages_id="+id+"";
}

function mySubmit() {
	
	var fout=0;
	
	if(document.getElementById('naam').value=='') {
		fout=1;	
		document.getElementById('naam').className='red';
	} else {
		document.getElementById('naam').className='';
	}
	
	if(document.getElementById('telefoonnummer').value=='') {
		fout=1;	
		document.getElementById('telefoonnummer').className='red';
	} else {
		document.getElementById('telefoonnummer').className='';
	}
	
	if(!fout) {
		document.form1.submit();	
	}
}

function scrollFrame(direction) {
                if(direction == 'left'){
                               timer = setInterval("doScroll('left');",20);
                }
                else if(direction == 'right'){
                               timer = setInterval("doScroll('right');",20);
                }
                else if(direction == 'up'){
                               timer = setInterval("doScroll('up');",20);
                }
                else if(direction == 'down'){
                               timer = setInterval("doScroll('down');",20);
                }
}

function stopScroll(){
				clearInterval(timer);
}

function doScroll(direction){
                if(direction == 'left'){ 
                               document.getElementById('contentDiv').scrollLeft -= 4;
                }
                else if(direction == 'right'){
                               document.getElementById('contentDiv').scrollLeft += 4;
                }
                else if(direction == 'down'){
                               document.getElementById('contentDiv').scrollTop += 4;
                }
                else if(direction == 'up'){
                               document.getElementById('contentDiv').scrollTop -= 4;
                }
}

function scrollFrameProjecten(direction,aantal) {
                if(direction == 'left'){
                               timer = setInterval("doScrollProjecten('left','"+aantal+"');",20);
                }
                else if(direction == 'right'){
                               timer = setInterval("doScrollProjecten('right','"+aantal+"');",20);
                }
}
function doScrollProjecten(direction,aantal){
	
				//alert(aantal);
				var huidigeValue=parseInt(document.getElementById('position').value);
				
				if(!huidigeValue) { huidigeValue=parseInt(0); }
				
                if(direction == 'left'){ 
                               document.getElementById('contentDiv2').scrollLeft -= 4;
							   
							   if(huidigeValue>0) {
							   	document.getElementById('position').value -= 4;
							   }
                }
                else if(direction == 'right'){
                               document.getElementById('contentDiv2').scrollLeft += 4;
							  
							  	if(huidigeValue<aantal) {
							  	document.getElementById('position').value = huidigeValue+parseInt(4);
								}
				}
}
function goToProjecten(id,hoofd_id,projectId,groepId) {

	var pos = document.getElementById('position').value;
	document.location='index.php?id='+id+'&hoofd_id='+hoofd_id+'&project_id='+projectId+'&groep_id='+groepId+'&pos='+pos+'';
}
function goToGroep(id,hoofd_id,groepId) {

	var pos = document.getElementById('position').value;
	document.location='index.php?id='+id+'&hoofd_id='+hoofd_id+'&groep_id='+groepId+'&pos='+pos+'';
}
function setPosition(pos) {
		
        if(pos) {
		//alert(pos);
		document.getElementById('position').value += pos;
        document.getElementById('contentDiv2').scrollLeft += pos;
		}
}
function correctPNG(){	
	if (navigator.appName == "Microsoft Internet Explorer") {	
		for(var i=0; i<document.images.length; i++)
		{
			var img = document.images[i]
			var imgName = img.src.toUpperCase()
			
			if (imgName.substring(imgName.length-3, imgName.length) == "PNG") {
				var imgID = (img.id) ? "id='" + img.id + "' " : ""
				var imgClass = (img.className) ? "class='" + img.className + "' " : ""
				var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
				var imgStyle = "font-size: 1px; display:inline-block;" + img.style.cssText			
										
				if (img.align == "left") imgStyle = "float:left;" + imgStyle
				if (img.align == "right") imgStyle = "float:right;" + imgStyle
				if (img.parentElement.href) imgStyle = "cursor:pointer;" + imgStyle
				var strNewHTML = "<span " + imgID + imgClass + imgTitle
				+ " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
				+ "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
				+ "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
				img.outerHTML = strNewHTML
				i = i-1
			}
		}
	}
}

