function toggle_display(id, value) {
	if (value) {
		document.getElementById(id).style.display = "inline";
	}
	else {
		document.getElementById(id).style.display = "none";
	}
}

function play_swf(data) {
	if (typeof data != 'object' || typeof data['id'] == 'undefined' || typeof data['src'] == 'undefined') {
		return 0;
	}
	if (typeof data['width'] == 'undefined' || typeof data['height'] == 'undefined') {
		data['width']  = '631';
		data['height'] = '452';
	}
	var content = '';
	content += '<object id="flash'+data['id']+'" classid="CLSID:D27CDB6E-AE6D-11CF-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,47,0" width="'+data['width']+'" height="'+data['height']+'">';
	content += '<param name="movie" value="'+data['src']+'" />';
	content += '<param name="wmode" value="transparent" />';
	content += '<param name="menu" value="false" />';
	content += '<embed name="flash'+data['id']+'" type="application/x-shockwave-flash" src="'+data['src']+'" width="'+data['width']+'" height="'+data['height']+'" wmode="transparent" menu="false" pluginspage="http://www.adobe.com/go/getflashplayer"></embed>';
	content += '</object>';
	document.getElementById(data['id']).innerHTML = content;
}

function new_window(url, popup, width, height, left, top) {
	var today = new Date();
	var milliseconds = today.getTime();
	var win_id = 'win'+milliseconds;
	var attr = 'status=1,directories=0,copyhistory=0,';
	if (popup) {
		if (width)  attr += 'width='+width+',';
		if (height) attr += 'height='+height+',';
		if (left)   attr += 'left='+left+',screenX='+left+',';
		if (top)    attr += 'top='+top+',screenY='+top+',';
		attr += "toolbar=0,menubar=0,location=0,scrollbars=0,resizable=0";
	}
	else {
		attr += "toolbar=1,menubar=1,location=1,scrollbars=1,resizable=1";
	}
	var win_h = window.open(url, win_id, attr);
	win_h.focus();
}
