function show(id){
	$('#'+id).show();
}

function hide(id){
	$('#'+id).hide();
}

$('document').ready(function(){
	$('#home').mouseover(function(){$('#home_light').css('background',"url('images/btnbg_.jpg')");});
	$('#home').mouseout(function(){$('#home_light').css('background',"url('images/btnbg.jpg')");});
	
	$('#producten').mouseover(function(){$('#prod_light').css('background',"url('images/btnbg_.jpg')");});
	$('#producten').mouseout(function(){$('#prod_light').css('background',"url('images/btnbg.jpg')");});
	
	$('#promos').mouseover(function(){$('#prom_light').css('background',"url('images/btnbg_.jpg')");});
	$('#promos').mouseout(function(){$('#prom_light').css('background',"url('images/btnbg.jpg')");});
	
	$('#contact').mouseover(function(){$('#cont_light').css('background',"url('images/btnbg_.jpg')");});
	$('#contact').mouseout(function(){$('#cont_light').css('background',"url('images/btnbg.jpg')");});
	
	$("#left img").hover(function(){$(this).stop().animate({"opacity": "0.5"},"fast");},function(){$(this).stop().animate({"opacity": "1"},"slow");});
	
	$('#left img').click(function(){$('#zoomImg').attr('src',$(this).attr('src')); getInfo($(this).attr('id'),$('.a').attr('id'))});
});

// AJAX GEDEELTE
function createRequestObject() {
   var req;
   if(window.XMLHttpRequest){
      req = new XMLHttpRequest();
   } else if(window.ActiveXObject) {
      req = new ActiveXObject("Microsoft.XMLHTTP");
   } else {
      alert('Problem creating the XMLHttpRequest object');
   }
   return req;
}

function getInfo(id,a)
{
	var http = createRequestObject();
	http.open('get', 'ajax.php?getinfo='+id+'&a='+a);
	http.onreadystatechange = 
	function handle_getInfo()
	{
		if(http.readyState == 4 && http.status == 200)
		{
			if(http.responseText)
			{
				if(http.responseText == 0)
				{
					alert("Het lukte niet om de productinformatie op te halen. Gelieve de pagina te herladen en het opnieuw te proberen.");
				}
				else if(http.responseText != 0)
				{
					$('.prodinfo').html(http.responseText);
				}
			}
			else
			{
				alert("Het lukte niet om de productinformatie op te halen. Gelieve de pagina te herladen en het opnieuw te proberen.");
			}
		}
	}
	http.send(null);
}
