menuitem = "";

function popup(url, pagename, w, h) {
 var width = w;
 var height = h;
 var left = (screen.width - width)/2;
 var top = (screen.height - height)/2;
 var params = 'width='+width+', height='+height;
 params += ', top='+top+', left='+left;
 params += ', directories=no';
 params += ', location=no';
 params += ', menubar=no';
 params += ', resizable=no';
 params += ', scrollbars=no';
 params += ', status=no';
 params += ', toolbar=no';
 newwin=window.open(url,'Liveplayer',params);
 if (window.focus) {newwin.focus()}
}

function play_sound(song, title)
{
//	thisMovie("sampleplayer").start_song(song, title);
	//document.getElementById("sampleplayer").start_song(song, title);
	MM_findObj("bandjeflash").play_sound(song, title);
}

function thisMovie(movieName) {
	if (navigator.appName.indexOf("Microsoft") != -1) {
		return window[movieName]
	}
	else {
		return document[movieName]
	}
}

highlighted_title = "";
function playAudio(src, useplayer, usetitle) {
	
	if(useplayer == undefined) { useplayer = 'audioplayer'; }
	
	var obj = {type: "sound", file: src, title: "liedje" };
	thisMovie(useplayer).sendEvent( "LOAD" , obj );
	realPlayAudio(useplayer);

	if(highlighted_title != "") {
		highlighted_title = document.getElementById(highlighted_title);
		highlighted_title.style.color = "#000000";
	}
	
	highlighted_title = usetitle;

	usetitle = document.getElementById(usetitle);
	usetitle.style.color = "#DF1636";
	
//	return false;
}

function realPlayAudio(useplayer) {
	thisMovie(useplayer).sendEvent( "PLAY" , 'true' );
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

/////////////////////////////////////////////////////////////////////

function create_screen(page) {
	var newdiv = document.createElement("div");
	newdiv.setAttribute("id", "divloader");
	document.body.appendChild(newdiv);
	
	scrollbar(false);
	getContents(page, "divloader");
	scroll(0,0);
}

function remove_screen(divname) {
	var d = document.getElementById(divname);
	d.parentNode.removeChild(d);
	scrollbar(true);
}

function load_album(id) {
	var newdiv = document.createElement("div");
	newdiv.setAttribute("id", "divloader");
	
	appendto = document.getElementById("albumloader");
	appendto.appendChild(newdiv);
	
	swidth = get_sz("width");
	sheight = get_sz("height");
	getContents("/page/showalbum/" + id + "/" + swidth + "/" + sheight, "divloader");
	scrollbar(false);
}

function load_flvplayer(title, filename, currenttime) {
	var newdiv = document.createElement("div");
	newdiv.setAttribute("id", "divloader");
	document.body.appendChild(newdiv);
	
	getContents("/page/showflvplayer/" + title + "/" + filename + "/" + currenttime, "divloader");
}

function scrollbar(show)
{
	if(show == false) {
		document.body.style.overflow = "hidden";
		document.body.parentNode.style.overflow = "hidden";
	} else {
		//document.body.style.overflow = "auto";
		document.body.parentNode.style.overflow = "auto";
	}
}

function get_sz(verhor) {
	if (parseInt(navigator.appVersion)>3) {
	 if (navigator.appName=="Netscape") {
	  winW = window.innerWidth;
	  winH = window.innerHeight;
	 }
	 if (navigator.appName.indexOf("Microsoft")!=-1) {
	  winW = document.body.offsetWidth;
	  winH = document.body.offsetHeight;
	 }
	}
	
	if(verhor == "width") { return winW; } else { return winH; }
}