function load_module(page) {

	document.getElementById('content_right').style.display = 'none';

	new Ajax.Updater(
		{success: 'content_right'},
		'site/'+page,
		{
			method: 'post',
			requestHeaders: ['Expires', 'Thu, 17 May 2001 10:17:17 GMT', 'Cache-Control', 'no-cache, must-revalidate', 'Pragma', 'no-cache'],
			evalScripts:true,
			onComplete: function () {
				Effect.Appear('content_right');
			}
			
		});
	
}

function load_categories(cat_id) {
	cat_id	= $(cat_id); 
	if (cat_id == 1)
	{
		new Ajax.Updater(
			'content_right',
			'site/home.php',
			{
				method: 'post',
				parameters: 'cid='+cat_id,
				requestHeaders: ['Expires', 'Thu, 17 May 2001 10:17:17 GMT', 'Cache-Control', 'no-cache, must-revalidate', 'Pragma', 'no-cache']
			});
		}
	else{	
		new Ajax.Updater(
			'content_right',
			'site/categorien.php',
			{
				method: 'post',
				parameters: 'cid='+cat_id,
				requestHeaders: ['Expires', 'Thu, 17 May 2001 10:17:17 GMT', 'Cache-Control', 'no-cache, must-revalidate', 'Pragma', 'no-cache']
			});
	}
}
function load_categories_sub(mid) {
	mid	= $(mid); 

	
		new Ajax.Updater(
			'submenu',
			'site/subcategorien.php',
			{
				method: 'post',
				parameters: 'mid='+mid,
				requestHeaders: ['Expires', 'Thu, 17 May 2001 10:17:17 GMT', 'Cache-Control', 'no-cache, must-revalidate', 'Pragma', 'no-cache']
			});
		}
	


function load_merken(id) {
	
	new Ajax.Updater(
		'content_right',
		'site/merken.php',
		{
			method: 'post',
			parameters: 'id='+id,
			requestHeaders: ['Expires', 'Thu, 17 May 2001 10:17:17 GMT', 'Cache-Control', 'no-cache, must-revalidate', 'Pragma', 'no-cache']
		});
}	
	
function load_accesoires_left(mid) {
	mid	= $(mid); 
	new Ajax.Updater(

		'content_left',
		'site/accessoires.php',
		{
			method: 'post',
			parameters: 'mid='+mid,
			requestHeaders: ['Expires', 'Thu, 17 May 2001 10:17:17 GMT', 'Cache-Control', 'no-cache, must-revalidate', 'Pragma', 'no-cache']
		});
}

function load_menu(pic_id) {
	new Ajax.Updater(

		'menumain',
		'site/menu.php',
		{
			method: 'post',
			parameters: 'pic_id='+pic_id,
			requestHeaders: ['Expires', 'Thu, 17 May 2001 10:17:17 GMT', 'Cache-Control', 'no-cache, must-revalidate', 'Pragma', 'no-cache']
		});
}

function show_aanbieding(id) {
		
	new Ajax.Updater(
		'content_right',
		'site/aanbieding.php',
		{
			method: 'post',
			parameters: 'id='+id,
			requestHeaders: ['Expires', 'Thu, 17 May 2001 10:17:17 GMT', 'Cache-Control', 'no-cache, must-revalidate', 'Pragma', 'no-cache']
		});
}

function show_news(id) {
	
	new Ajax.Updater(
		'content_right',
		'site/nieuws.php',
		{
			method: 'post',
			parameters: 'id='+id,
			requestHeaders: ['Expires', 'Thu, 17 May 2001 10:17:17 GMT', 'Cache-Control', 'no-cache, must-revalidate', 'Pragma', 'no-cache']
		});
}

function show_accessoires(id) {
		
	new Ajax.Updater(
		'content_right',
		'site/show_accessoires.php',
		{
			method: 'post',
			parameters: 'id='+id,
			requestHeaders: ['Expires', 'Thu, 17 May 2001 10:17:17 GMT', 'Cache-Control', 'no-cache, must-revalidate', 'Pragma', 'no-cache']
		});
}

function load_entry(id,cid){
	new Ajax.Updater(
		'content_right',
		'site/show_entry.php',
		{
			method: 'post',
			parameters: 'cid='+cid+'&id='+id,
			requestHeaders: ['Expires', 'Thu, 17 May 2001 10:17:17 GMT', 'Cache-Control', 'no-cache, must-revalidate', 'Pragma', 'no-cache']
		});
}

function makecontact(){

	form_values = Form.serialize('contactversturen');
	
	new Ajax.Updater(
		'',
		'site/mailto.php',
		{
			method: 'post',
			parameters: form_values,
			requestHeaders: ['Expires', 'Thu, 17 May 2001 10:17:17 GMT', 'Cache-Control', 'no-cache, must-revalidate', 'Pragma', 'no-cache'],
			onComplete: function () {
				load_module('bedankt.php');
			}
		});
}

var arVersion = navigator.appVersion.split("MSIE")
var version = parseFloat(arVersion[1])

	function fixPNG(myImage) 
	{
	    if ((version >= 5.5) && (version < 7) && (document.body.filters)) 
	    {
	       var imgID = (myImage.id) ? "id='" + myImage.id + "' " : ""
		   var imgClass = (myImage.className) ? "class='" + myImage.className + "' " : ""
		   var imgTitle = (myImage.title) ? 
			             "title='" + myImage.title  + "' " : "title='" + myImage.alt + "' "
		   var imgStyle = "display:inline-block;" + myImage.style.cssText
		   var strNewHTML = "<span " + imgID + imgClass + imgTitle
	                  + " style=\"" + "width:" + myImage.width 
	                  + "px; height:" + myImage.height 
	                  + "px;" + imgStyle + ";"
	                  + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
	                  + "(src=\'" + myImage.src + "\', sizingMethod='scale');\"></span>"
		   myImage.outerHTML = strNewHTML	  
	    }
	}

	// If NS -- that is, !IE -- then set up for mouse capture
var IE = document.all?true:false
if (!IE) document.captureEvents(Event.MOUSEMOVE)
// Set-up to use getMouseXY function onMouseMove
document.onmousemove = getMouseXY;

// Temporary variables to hold mouse x-y pos.s
var tempX = 0
var tempY = 0
// Main function to retrieve mouse x-y pos.s
function getMouseXY(e) {
  if (IE) { // grab the x-y pos.s if browser is IE
    tempX = event.clientX + document.body.scrollLeft
    tempY = event.clientY + document.body.scrollTop
  } else {  // grab the x-y pos.s if browser is NS
    tempX = e.pageX
    tempY = e.pageY
  }  
  // catch possible negative values in NS4
  if (tempX < 0){tempX = 0}
  if (tempY < 0){tempY = 0}  
}

function showMsg(txt) {
	new Effect.Opacity('feeback_msg', {duration:0.3, to:1.0});
	$('feeback_msg').style.left = tempX - 60;
	$('feeback_msg').style.top = tempY + 20;
	$('feeback_msg').style.display = '';
	$('feeback_msg').innerHTML = txt;
	setTimeout("Effect.Appear('feeback_msg', { from: 1.0, to: 0.0, duration: 1.0 });", 2000);
}



function toggleDisplay(me){
		if (me.style.display=="block"){
			me.style.display="inline";
			alert("Text is now 'inline'.");
			}
		else {
			if (me.style.display=="inline"){
				me.style.display="none";
				alert("Text is now 'none'. It will reappear in three seconds.");
				window.setTimeout("blueText.style.display='block';",3000,"JavaScript");
				}
			else {
				me.style.display="block";
				alert("Text is now 'block'.");
				}
			}
		}
