/******* GLOBALS [BEGIN] *******/
var is_opera = /opera\/9/i.test(navigator.userAgent);
var is_gecko = /gecko/i.test(navigator.userAgent);
var is_ie    = /MSIE/.test(navigator.userAgent);
/******* GLOBALS [END] *******/

function $(id){
	return document.getElementById(id);
}

function $E(tagName){
	return document.createElement(tagName);
}

function $R(url){
	document.location = url;
}

function show(id){
	document.getElementById(id).style.display='block';
}
function hide(id){
	document.getElementById(id).style.display='none';
}
function popup(file,name,width,height) {
	x = (640 - width)/2, y = (480 - height)/2;
	if (screen) {
		y = (screen.availHeight - height)/2;
		x = (screen.availWidth - width)/2;
	}
	if (screen.availWidth > 1800) {
		x = ((screen.availWidth/2) - width)/2;
	}
	var newWindow = window.open(file,name,'width='+width+',height='+height+',screenX='+x+',screenY='+y+',top='+y+',left='+x+',toolbar=no,menubar=no,status=no');
	if(!newWindow){
		alert(TEXT_POPUP_BLOCKED);
	}
}
function show_photo(link){
	show('photo_div');
	$('mem_photo').src=link;

	if (is_ie || is_opera){
		var top = document.documentElement.scrollTop;
	}
	else{
		var top = window.scrollY;
	}

	$('photo_div').style.top = top + 20 + "px";
}
function hide_photo(){
	hide('photo_div');
	$('mem_photo').src='img/loading.gif';
}
function load_text(title, text){
	$('lyric_td').innerHTML = '<center><b>'+title+'</b></center><br><br>' + text;

	if (is_ie || is_opera){
		var top = document.documentElement.scrollTop;
	}
	else{
		var top = window.scrollY;
	}

	$('lyric_div').style.top = top + 50 + "px";
	show('lyric_div');
}