/*** TOGGLE ****************************************************************/

function toggleDiv(id){
	if(document.getElementById(id).style.display == "none"){
	document.getElementById(id).style.display = "block";
	}else{
	document.getElementById(id).style.display = "none";
	}
}

function slideDiv(id){
	if(document.getElementById(id).style.display == 'none'){
		new Effect.SlideDown(id, {duration:0.5});
		new Effect.Opacity(id, {duration:1.0, from:0.0, to:1.0});
	}else{
		new Effect.Opacity(id, {duration:0.6, from:1.0, to:0.0});
		new Effect.SlideUp(document.getElementById(id, {duration:0.5}));
	}
}

/*** OPEN PLAYER ****************************************************************/

function openPlayer(playlist){
	var w = 420;
	var h = 190;
	myleft=(screen.width)?(screen.width-w)/2:100;mytop=(screen.height)?(screen.height-h)/2:100;
	settings="width=" + w + ",height=" + h + ",top=" + mytop + ",left=" + myleft + ",scrollbars=no,location=no,directories=no,statusbar=no,menubar=no,toolbar=no,resizable=no";
	win=window.open('player/player.php?playlist=' + playlist,'player',settings);
}

function openVideo(vid){
	var w = 500;
	var h = 400;
	myleft=(screen.width)?(screen.width-w)/2:100;mytop=(screen.height)?(screen.height-h)/2:100;
	settings="width=" + w + ",height=" + h + ",top=" + mytop + ",left=" + myleft + ",scrollbars=no,location=no,directories=no,statusbar=no,menubar=no,toolbar=no,resizable=no";
	win=window.open('pages/video.php?vid=' + vid,'video',settings);
}

/*** MAILTO ****************************************************************/

function mailTo(name, web){
		location.href = "mailto:" + name + "@" + web;
}
