function openWin(url,n,w,h) {
	window.open(url,n,'width='+w+',height='+h+',location=no,menubar=no,scrollbars=no,status=no,toolbar=no,resizable=yes');
}

function addJs() {
	if (arguments.length>0) files=arguments;
	if (typeof files!="undefined"){
		for(var i=0;i<files.length;i++){
			document.writeln("<script src='/includes/js/"+files[i]+".js' type='text/javascript'></script>");
		}
	}
}

// additional scripts
addJs("common", "fullstory", "calendar", "objects", "ads");

function getHpPlayer() {
	strPlayerHTML =  "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='360' height='270' id='hp_player' align='top' VIEWASTEXT>";
	strPlayerHTML += "<param name='allowScriptAccess' value='sameDomain' />";
	strPlayerHTML += "<param name='movie' value='/flash/hp_player.swf' />";
	strPlayerHTML += "<param name='quality' value='high' />";
	strPlayerHTML += "<param name='bgcolor' value='#ffffff' />";
	strPlayerHTML += "<param name='wmode' value='transparent' />";
	strPlayerHTML += "<embed src='/flash/hp_player.swf' quality='high' width='360' height='270' id='hp_player' align='top' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' /></object>";
	document.write(strPlayerHTML);
}

function playSong() {
	window.open('/audio/default.sps','fwd_song','width=180,height=65,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,resizable=no');
}


function ShowImage(page, tag)
{
    var i = 1;
    var el;
    while (el = document.getElementById(tag + i)) {
        if (i == page)
            el.style.display = 'block';
        else
            el.style.display = 'none';
        i++;
    }
}

var popupWin
function openNewWindow(wfile,wtitle,wwidth,wheight){
	popupWin = window.open(wfile,wtitle,"toolbar=no,leftmargin=0,topmargin=0,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=" + wwidth + ",height=" + wheight);
	popupWin.focus();

}

// CROSS BROWSER GET ELEMENT BY ID FUNCTION
function getElement(id) {
	var element=document.getElementById?document.getElementById(id):(document.all?document.all(id):null)
	return element;
}

function openScoring() {
	openNewWindow('/scoring.htm','Scoring',324,274);
}
