// JavaScript Document
function image_popup(url) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(url, '" + id + "', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=800,height=600');");
}
//function video_popup(url) {
	//day = new Date();
	//id = day.getTime();
	//eval("page" + id + " = window.open(url, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=320,height=278');");
//}
function stats_popup(url) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(url, '" + id + "', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=1000,height=650');");
}
function open_popup(page, height, width) {
    var size = "height=" + height + ",width=" + width;
    window_handle = window.open(page,"fp_filter_test","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no," + size);
}
function show(showme) {
	document.getElementById(showme).style.display = "block";
}
function hide(hideme) {
	document.getElementById(hideme).style.display = "none";	
}
function showhide(element,togglelink,changetext) {
	if ("block" == document.getElementById(element).style.display) {
		document.getElementById(element).style.display = "none";
		document.getElementById(togglelink).style.background = "url(/images/expand.gif) right center no-repeat";
		document.getElementById(changetext).childNodes[0].data = "(Click to Show)";
	}
	else {
		document.getElementById(element).style.display = "block";
		document.getElementById(togglelink).style.background = "url(/images/collapse.gif) right center no-repeat";
		document.getElementById(changetext).childNodes[0].data = "(Click to Hide)";
	}
}
function showhidesimple(element) {
	if ("block" == document.getElementById(element).style.display) {
		document.getElementById(element).style.display = "none";
	}
	else {
		document.getElementById(element).style.display = "block";
	}
}
// this function makes sure there is only one pop-up at a time.
function music_popup(playlist) {
	var playwindow = '';
	var url = "/music/play.php?pls=" + playlist;
	if (!playwindow.closed && playwindow.location) {
		playwindow.location.href = url;
	}
	else {
		playwindow=window.open(url,'play','height=300,width=300');
		if (!playwindow.opener) playwindow.opener = self;
	}
	if (window.focus) {playwindow.focus()}
	return false;
}
// this function makes sure there is only one pop-up at a time - for videos.
function video_popup(url) {
	var playwindow = '';
	if (!playwindow.closed && playwindow.location) {
		playwindow.location.href = url;
	}
	else {
		playwindow=window.open(url,'play','height=278,width=320');
		if (!playwindow.opener) playwindow.opener = self;
	}
	if (window.focus) {playwindow.focus()}
	//return false;
}
// keep track of video watching progress
function trackOpened(element) {
	document.getElementById(element).style.backgroundColor = "#CCCCCC";
	document.getElementById(element).style.color = "#333333";
}
// confirm form submission
function confirmSubmit() {
	var agree = confirm("Are you sure?");
	if (agree) {
		return true;
	}
	else {
		return false;
	}
}

