function $() {
	var elements = new Array();

	for (var i = 0; i < arguments.length; i++) {
		var element = arguments[i];
		if (typeof element == 'string')
		element = document.getElementById(element);

		if (arguments.length == 1)
		return element;

		elements.push(element);
	}

	return elements;
}

var chatWnd;
function popChat() {
	chatWnd=window.open('?m=psChat&nf=1','chatWindow','height=560,width=330,left=100,top=100,resizable=yes,scrollbars=yes,toolbar=no,menubar=no,status=no');
	chatWnd.focus();
}

var helpWnd;
function popHelp() {
	helpWnd=window.open('?m=psHelpInfo&nf=1','helpWindow','height=560,width=330,left=100,top=100,resizable=yes,scrollbars=yes,toolbar=no,menubar=no,status=no');
	helpWnd.focus();
}



function scensel(chk) {

	// toggle automatic
	if (chk.id == 'scen_a') {

		var chks = document.getElementsByTagName('input');

		for(i=0; i<chks.length; i++) {
			if(chks[i].id.indexOf('scen_') == 0 && chks[i].id != 'scen_a') {
				chks[i].checked  = chk.checked ? 'checked'  : '';
				chks[i].readonly = chk.checked ? 'readonly' : '';
			}
		}

	}

}

function switchTab(nr) {

	for (var x=1;x<4;x++) {
		var tab=document.getElementById('tabhead' + x);
		var div=document.getElementById('tab' + x);
		if (tab) {
			if (x==nr) {
				tab.className='player_tab now_playing';
				div.style.display='block';
			}
			else {
				tab.className='player_tab';
				div.style.display='none';
			}
		}
	}

}

