var xmlhttp;

function loadContent(page)
{
	xmlhttp=null;
	if (window.XMLHttpRequest)
	{
		xmlhttp=new XMLHttpRequest();
	}
	else if (window.ActiveXObject)
	{
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	if (xmlhttp!=null)
	{
		xmlhttp.onreadystatechange=state_Change;
		xmlhttp.open("GET", "http://www.barpepper.nl/index.php?request="+page, true);
		xmlhttp.send(null);
	}
	else
	{
		alert("Your browser does not support XMLHTTP.");
	}
}

function state_Change()
{
	if (xmlhttp.readyState==4)
	{
		if (xmlhttp.status==200)
	    {
			document.getElementById('website').innerHTML=xmlhttp.responseText;
		}
		else
		{
			alert("Problem retrieving XML data");
		}
	}
}



function menuOver(image_id)
{
	document.getElementById('menu' + image_id).src = '/website/images/menu/menu_' + image_id + '_over.png';
}

function menuOut(image_id)
{
	document.getElementById('menu' + image_id).src = '/website/images/menu/menu_' + image_id + '.png';
}


var play = 1;

function playerPP()
{
		if (play == 1)
		{
			playerStop();
		}
		else if (play == 0)
		{
			playerPlay();
		}
}

function playerPlay()
{
	url = 'bestanden/music.mp3';
	if (navigator.appName == "Microsoft Internet Explorer")
	{
		// option 1: IE
		player = document.getElementById('MediaPlayer');
		player.play();
	}
	else
	{
		// option 2: Firefox
		player = document.getElementById('MediaPlayer2');
		player.autostart = true;
		player.data = url;
	}
	play = 1;
}

function playerStop()
{
	url = '/bestanden/music.mp3';
	if (navigator.appName == "Microsoft Internet Explorer")
	{
		// option 1: IE
		player = document.getElementById('MediaPlayer');
		player.stop();
	}
	else
	{
		// option 2: Firefox
		player = document.getElementById('MediaPlayer2');
		player.autostart = false;
		player.data = url;
	}
	play = 0;
}

function showPopup()
{
	height = document.body.scrollHeight;
	width = document.body.scrollWidth;
	// popup - height = 300    width = 350
	document.getElementById('popup').style.left = ((width / 2) - 385) + 'px';
	document.getElementById('popup').style.top = ((height / 2) - 125) + 'px';
	
	document.getElementById('bg_popup').style.height = (document.body.scrollHeight + 200) + 'px';
	//document.getElementById('bg_popup').style.display = 'block';
	//document.getElementById('popup').style.display = 'block';

	//var text = '<p><strong>Bar Pepper is vanaf heden weer elke maandag geopend voor lunch, diner en borrels.</strong></p>';

	//win = new Window({className: "window", title: "popup", width:600, height:125, destroyOnClose: true, recenterAuto:true}); 
	//win.getContent().update(text); 
	//win.showCenter();
}

function closePopup()
{
	document.getElementById('bg_popup').style.display = 'none';
	document.getElementById('popup').style.display = 'none';
}
