function scrollme(){
	alert('Fout: niet alle verplichte velden zijn ingevuld');
	//location.href = '#onerror';
	//window.scrollTo(0,1000);
}

function update(url) {

 
  xmlhttp.open("GET",url,true);
  xmlhttp.onreadystatechange=function() {
   if (xmlhttp.readyState==4) {
    //alert(xmlhttp.responseText);
   }
  }
 xmlhttp.setRequestHeader("Content-Type", "text/plain;charset=UTF-8")
 xmlhttp.send(null)
 return false
}

function spamcheck(){
	//alert(document.getElementById('isleeg').value);
	if(document.getElementById('isleeg').value != ""){
		document.getElementById('ovform').action = "";
	}
}


// SIFR -------------------------------<<
onload = function(){
	initSifr();
}

// sIFR
function initSifr(){
	
	if(typeof sIFR == "function")
		{
		//sIFR.replaceElement(named({sSelector:"h2", sWmode: "transparent", sFlashSrc:"sifr/sifr.swf", sColor:"#005089", sLinkColor:"#005089", sBgColor:"#fff"}));
		sIFR.replaceElement(named({sSelector:"span.sideTitle", sWmode: "transparent", sFlashSrc:"sifr/sifr.swf", sColor:"#005089", sLinkColor:"#005089", sBgColor:"#fff"}));
		}

}


// scroller
var current_slide = 0;
var headline_count;
var headline_interval;
var old_headline = 0;
var current_headline = 0;


$(document).ready(function()
	{
	headline_count = $("div.headline").size();
	$("div.headline:eq("+current_headline+")").css('top','5px');
	headline_interval = setInterval(headline_rotate,10000); //time in milliseconds
	$("#box_nieuws_btn").mouseup(function(){
		headline_rotate();
	}).mousedown(function(){
		clearInterval(headline_interval);
		headline_interval = setInterval(headline_rotate,10000);
	});
	$('#slideshow1').cycle();
	
	$.preload( '#menu_js' );
	$(document).pngFix();
});


function headline_rotate() 
	{

	//current_headline = (old_headline + 1) % headline_count; 
	//$("div.headline:eq(" + old_headline + ")").animate({top: -135},"slow", function() {
	// $(this).css('top','140px');
	//});
	//$("div.headline:eq(" + current_headline + ")").show().animate({top: 5},"slow");  
	//old_headline = current_headline;
	
	//set current message in session
	//document.getElementById('status').src = './Pages/setstatus.php?msg=' + current_headline;
	//update('./Pages/setstatus.php?msg=' + current_headline);
}


function hoverItem(id) 
	{	
	if(id == 'home'){
		document.getElementById("menuOverlay").style.display = 'block';
		document.getElementById("menuOverlay").style.margin = '0 0 0 30px';
	}
	if(id == 'nieuws'){
		document.getElementById("menuOverlay").style.display = 'block';
		document.getElementById("menuOverlay").style.margin = '0 0 0 132px';
	}
	if(id == 'portfolio'){
		document.getElementById("menuOverlay").style.display = 'block';
		document.getElementById("menuOverlay").style.margin = '0 0 0 234px';
	}
	if(id == 'projecten'){
		document.getElementById("menuOverlay").style.display = 'block';
		document.getElementById("menuOverlay").style.margin = '0 0 0 336px';
	}
	if(id == 'persoonlijk'){
		document.getElementById("menuOverlay").style.display = 'block';
		document.getElementById("menuOverlay").style.margin = '0 0 0 438px';
	}
	if(id == 'profiel'){
		document.getElementById("menuOverlay").style.display = 'block';
		document.getElementById("menuOverlay").style.margin = '0 0 0 540px';
	}
	if(id == 'contact'){
		document.getElementById("menuOverlay").style.display = 'block';
		document.getElementById("menuOverlay").style.margin = '0 0 0 642px';
	}
	
}
function hoverOutItem() {	
	document.getElementById("menuOverlay").style.display = 'none';
}


