/* common.js */
function move(layerID,x,y){
	xpos=parseInt(window.document.getElementById(layerID).style.left);
	ypos=parseInt(window.document.getElementById(layerID).style.top);
	window.document.getElementById(layerID).style.left=eval(xpos+x);
	window.document.getElementById(layerID).style.top=eval(ypos+y);
}
function hide(layerID){
	window.document.getElementById(layerID).style.visibility='hidden';
}
function show(layerID){
	window.document.getElementById(layerID).style.visibility='visible';
}
function alignDiv(layerID){
	var height=window.document.body.clientHeight;
	var width=window.document.body.clientWidth;
	xWidth=parseInt(window.document.getElementById(layerID).style.width);
	xCenter=eval(eval(width/2)-eval(xWidth/2));
	move(layerID,xCenter,0);
}
function moveRel(srcID,destID,x,y){
	var srcTop=parseInt(window.document.getElementByID(srcID).style.top);
	var srcLeft=parseInt(window.document.getElementByID(srcID).style.left);
	newX=eval(srcLeft+x);
	newY=eval(srcTop+y);
	move(destID,newX,newY);
}
function swapImage(imgName,newImg){
	if ((navigator.appName == 'Netscape' && parseFloat(navigator.appVersion) >= 3) || (parseFloat(navigator.appVersion) >= 4)){
		eval('document.' + imgName + '.src = "' + newImg + '"');
	}
}
function playSong(track){
	var playerCode='<OBJECT ID="MediaPlayer" WIDTH=0 HEIGHT=0 CLASSID="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95" STANDBY="Loading Windows Media Player components..." TYPE="application/x-oleobject" CODEBASE="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112"><PARAM name="autoStart" value="True"><PARAM name="filename" value="files/audio' + track + '.asx"><PARAM name="BufferingTime" value="2"><PARAM name="showstatusbar" value="1"><param name="Showcontrols" value="False"><EMBED TYPE="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" SRC="files/audio' + track + '.asx" Autostart="True" BufferingTime=2 ShowStatusBar=1 NAME="MediaPlayer" ShowControls=0 WIDTH=0 HEIGHT=0></EMBED></OBJECT>';
	document.getElementById('aPlayer').innerHTML = playerCode;
}
