function openPlayer(id)
{
 	musicPlayer= window.open("player.php?songNr=" + id, "musicPlayer", "width=300, height=180, left=800, top=40, scrollbars=no,toolbar=no,location=no"); 
 	return false;
  	if (!musicPlayer.opener)
   	musicPlayer.opener = self; 	
}

function openVraag()
{
 	vraag= window.open("vraag.php", "musicPlayer", "width=400, height=560, left=700, top=40, scrollbars=no,toolbar=no,location=no"); 
 	return false;
  	if (!vraag.opener)
   	vraag.opener = self; 	
}

function createXMLHttpRequest()
{
	if (window.XMLHttpRequest) 
	{ 
		XMLHttp = new XMLHttpRequest();
		XMLHttp = new XMLHttpRequest();  
	} else if (window.ActiveXObject) { 
		XMLHttp = new ActiveXObject('Microsoft.XMLHTTP'); 
	} 
}


function generalFlash(pageId, url, adminId)
{
	var flashvars = { page: pageId, admin:adminId };
	var params = { wmode: "transparent" };
	var attributes = { id: "foto", name: "foto" };
	swfobject.embedSWF(url + "/foto/foto.swf", "foto", "390", "555", "9.0.0","expressInstall.swf", flashvars, params, attributes);
	
	var flashvars = { admin:adminId };
	var params = { wmode: "transparent" };
	var attributes = { id: "nieuws", name: "nieuws" };
	swfobject.embedSWF(url + "/nieuws/nieuws.swf", "nieuws", "290", "380", "9.0.0","expressInstall.swf", "", params, attributes);
}

function setCSS()
{
	var ie=document.all && !window.opera // 
	var iebody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body; 
	
	var docwidth =(ie)? iebody.clientWidth : window.innerWidth;
	var docheight=(ie)? iebody.clientHeight : window.innerHeight;
	
	document.getElementById("content").style['height'] = docheight - 280 + "px";
}

function videoplayer(start)
{
	var flashvars = { startVid:start};
	var params = { wmode: "transparent"};
	var attributes = { id: videoplayer, name: videoplayer };
	swfobject.embedSWF("flash/video/videoplayer.swf", "videoplayer", "440", "365", "9.0.0","expressInstall.swf", flashvars, params, attributes);
}

function changeBackOver(id)
{
	document.getElementById("songName"+id).className = 'songOver';
	document.getElementById("tekst"+id).className = 'songOver';
	document.getElementById("koop"+id).className = 'songOver';
}


function changeBackOut(id)
{
	document.getElementById("songName"+id).className = 'songOut';
	document.getElementById("tekst"+id).className = 'songOut';
	document.getElementById("koop"+id).className = 'songOut';
}

function playSong(song)
{
	openPlayer();
}

function showTekst(id, single)
{
	liedTeksten = window.open("teksten.php?id=" + id + "&single=" + single , "liedTeksten", "width=350, height=700, left=800, top=40, scrollbars=no,toolbar=no,location=no"); 
 	return false;
  	if (!liedTeksten.opener)
   	liedTeksten.opener = self; 	
}

function loadTekst(id, single)
{
	createXMLHttpRequest();
	var url = "ajax/songTekst.php?id=" + id + "&single=" + single; 
	
	if(XMLHttp) 
	{ 
	XMLHttp.open('GET', url, true); 
	XMLHttp.onreadystatechange = function() 
		{ 
		if (XMLHttp.readyState == 4 && XMLHttp.status == 200) 
			{ 
			document.getElementById("songTekst").innerHTML = XMLHttp.responseText; 
			} 
		} 
	XMLHttp.send(null); 
	} 
}


function zendNieuwsBrief()
{
	createXMLHttpRequest();
	
	var naam = document.getElementById("naam").value; 
	var email = document.getElementById("email").value; 
	var url = "ajax/nieuwsbrief.php"; 
	
	if(email == "")
	{
		alert("gelieve uw email-adres in te vullen.");
	}else if(naam == ""){
		alert("gelieve uw naam in te vullen.");
	}else{

		var params = "naam=" + naam + "&email=" +email;
		XMLHttp.open("POST", url, true);
	
		//Send the proper header information along with the request
		XMLHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		XMLHttp.setRequestHeader("Content-length", params.length);
		XMLHttp.setRequestHeader("Connection", "close");
		
		XMLHttp.onreadystatechange = function() 
		{
			if(XMLHttp.readyState == 4 && XMLHttp.status == 200) 
			{
				alert ("We hebben uw gegevens goed ontvangen!");
				document.getElementById("naam").value = ""; 
				document.getElementById("email").value = ""; 
			}
		}
		XMLHttp.send(params);
	}
} 


