//	General scripts...
//	show & hide block & switch
function showBlock(elementId,elementSwitch) {
	var myObject;
	if (myObject=document.getElementById(elementId+'_block')) myObject.style.display=elementSwitch?'block':'none';
	if (myObject=document.getElementById(elementId+'_switchOFF')) myObject.style.display=elementSwitch?'block':'none';
	if (myObject=document.getElementById(elementId+'_switchON')) myObject.style.display=elementSwitch?'none':'block';
}
//	show & hide element
function showElement(elementId,elementSwitch) {
	var myObject;
	if (myObject=document.getElementById(elementId)) myObject.style.display=elementSwitch?'block':'none';
}
//	show & hide more element
function showElements(elementArray) {
	for(var keyVar in elementArray) showElement(keyVar,elementArray[keyVar]);
}

//	focus control
function setFocus(elementId) {
	var myObject;
	if (myObject=document.getElementById(elementId)) myObject.focus();
}

//	cookie functions
function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}
function readCookie(name) {
	var nameEQ=name+"=";
	var ca=document.cookie.split(';');
	for(var i=0;i<ca.length;i++) {
		var c=ca[i];
		while (c.charAt(0)==' ') c=c.substring(1,c.length);
		if (c.indexOf(nameEQ)==0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}
function eraseCookie(name) {
	createCookie(name,"",-1);
}

//	H.a.l.a.t.t. icons
var activeIcon;
function initIcon(iconId) {
	activeIcon=document.getElementById(iconId);
}
function growIcon(icon) {
	if (activeIcon!=icon) {
		activeIcon.style.width='30px';
		icon.style.width='128px'
		activeIcon=icon;
	}
}
//	Toplist items
var activeItem=Array();
function initItem(mode,itemId) {
	activeItem[mode]=document.getElementById(itemId);
}
function growItem(mode,item) {
	if (activeItem[mode]!=item) {
		activeItem[mode].style.height='16px';
		item.style.height='64px'
		activeItem[mode]=item;
	}
}


// ...General scripts
