redirectObj = new Object();
function set_session(special, date, redirect_url)
{
	if (special != '')
	{
		redirectObj.redirect = redirect_url;
		
		if(special == 'period')
		{
			array 	= date.split("|");
			date 	= array[0];
			period	= array[1];
		} else if (special == "group") {
			period 	= "";
		} else {
			period 	= "";
		}
		
		xmlhttp = GetXmlHttpObject();
		var url="http://www.heerlijkehuisjes.nl/ajax.php?special="+special+"&date="+date+"&period="+period;
		//alert(url);
		xmlhttp.onreadystatechange=redirect;
		xmlhttp.open("GET",url,true);
		xmlhttp.send(null);
	}
}

function redirect()
{
	if (xmlhttp.readyState==4)
	{
		window.location = redirectObj.redirect;
	}
}

function GetXmlHttpObject()
{
	if (window.XMLHttpRequest)
  	{
  		// code for IE7+, Firefox, Chrome, Opera, Safari
  		return new XMLHttpRequest();
  	}
	if (window.ActiveXObject)
  	{
  		// code for IE6, IE5
  		return new ActiveXObject("Microsoft.XMLHTTP");
  	}
	return null;
}