function popUp(URL) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=2,location=0,statusbar=0,menubar=0,resizable=1,width=600,height=450,left = 476,top = 307');");
}

function popUpCalendar(nInMonth) {
var sPath = "http://www.moshopoulos.com/calendar/"
var months = new Array(13);
months[0]  = "January";
months[1]  = "February";
months[2]  = "March";
months[3]  = "April";
months[4]  = "May";
months[5]  = "June";
months[6]  = "July";
months[7]  = "August";
months[8]  = "September";
months[9]  = "October";
months[10] = "November";
months[11] = "December";

	day = new Date();
	nMonth = day.getMonth();
	sMonth = months[nMonth + nInMonth];
	URL = sPath + sMonth + ".htm";
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=no,scrollbars=no,statusbar=no,menubar=no,resizable=no,width=600,height=650,left=476,top=307');"); 
	

}

function popUpVideo(URL) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=no,scrollbars=no,statusbar=no,menubar=no,resizable=no,width=900,height=500,left=476,top=307');"); 
	

}

/* HORIZONTAL MENU */
sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}

if (window.attachEvent) window.attachEvent("onload", sfHover);
/* VERTICAL MENU */
activateMenu = function(nav) {
	if (document.all && document.getElementById(nav).currentStyle) {  
		var navroot = document.getElementById(nav);
		var lis=navroot.getElementsByTagName("LI");  
		for (i=0; i<lis.length; i++) {
			if(lis[i].lastChild.tagName=="UL"){
				lis[i].onmouseover=function() {	
					this.lastChild.style.display="block";
				}
				lis[i].onmouseout=function() {                       
					this.lastChild.style.display="none";
				}
			}
		}
	}
}
window.onload= function(){
	activateMenu('nav'); 
	activateMenu('vertnav'); 	
}


/* AUDIO FUNCTIONS  */
var ap_instances = new Array();

function ap_stopAll(playerID) {
	for(var i = 0;i<ap_instances.length;i++) {
		try {
			if(ap_instances[i] != playerID) document.getElementById("audioplayer" + ap_instances[i].toString()).SetVariable("closePlayer", 1);
			else document.getElementById("audioplayer" + ap_instances[i].toString()).SetVariable("closePlayer", 0);
		} catch( errorObject ) {
			// stop any errors
		}
	}
}

function ap_registerPlayers() {
	var objectID;
	var objectTags = document.getElementsByTagName("object");
	for(var i=0;i<objectTags.length;i++) {
		objectID = objectTags[i].id;
		if(objectID.indexOf("audioplayer") == 0) {
			ap_instances[i] = objectID.substring(11, objectID.length);
		}
	}
}

var ap_clearID = setInterval( ap_registerPlayers, 100 );


function playAudio(fileName) {

	alert(fileName);

}

function playWinAudio(fileName) {

	alert(fileName);


}

function playFlashAudio(fileName) {

	alert(fileName);
	var txtTest = "playerID=1&amp;autostart=yes&amp;soundFile=" + fileName;

	var audPlay = document.getElementById("audioplayer1");

	var myElement1 = document.getElementById("movie1");
	var myElement2 = document.getElementById("FlashVars1");
	var myElement3 = document.getElementById("quality1");
	var myElement4 = document.getElementById("menu1");
	var myElement5 = document.getElementById("autostart1");
	var myElement6 = document.getElementById("wmode1");

	alert("txtTest: " + txtTest);
	alert("myElement1: " + myElement1.getAttribute("value"));
	alert("myElement2: " + myElement2.getAttribute("value"));
	alert("myElement3: " + myElement3.getAttribute("value"));
	alert("myElement4: " + myElement4.getAttribute("value"));
	alert("myElement5: " + myElement5.getAttribute("value"));
	alert("myElement6: " + myElement6.getAttribute("value"));

	myElement2.setAttribute("value", txtTest);
	myElement5.setAttribute("value", "yes");

	alert("New myElement2: " + myElement2.getAttribute("value"));
	alert("New myElement5: " + myElement5.getAttribute("value"));
	
	document.repaint();
		
	
//<object type="application/x-shockwave-flash" data="http://www.fallingunder.ca/audio/player.swf" id="audioplayer1" height="24" width="290">
//<param name="movie" value="../audio/player.swf">
//<param name="FlashVars" value="playerID=1&amp;autostart=no&amp;soundFile=http://www.fallingunder.ca/audio/FU Coulda Been a Lady.mp3">
//<param name="quality" value="high">
//<param name="menu" value="true">
//<param name="autostart" value="no">
//<param name="wmode" value="transparent">	

}
