//********************************************************************************************
//*******			FUNCTION DECLARATION SECTION				**************************
//********************************************************************************************	

function currentFileName(){
	thisPath=window.location.href.split("/");
	fileName=thisPath[thisPath.length-1];
	pos1=fileName.indexOf("?");
	pos2=fileName.indexOf("#");
	if (pos1>pos2) pos=pos1; else pos=pos2;
	if (pos>0) fileName=fileName.substring(0,8);
	return fileName;
}

function displayBanner(){
	document.write('<a name="top"></a>');
	document.write('<center>');
	document.write('<img src="images/HauleyMusicBanner.gif" border="0">')
	document.write('</center>');
}

function displayMenu(){
	document.write('<table class="menu" align="center"><td align="center" width="700">');
	numMenuItems=Menu.length;
	for (i=0; i<=numMenuItems-1; ++i){
		Menu[i].display();
		if (i<numMenuItems-1) document.write(" | ");
	}
	document.write('</td></table><br />');
}

function displayHeader(title){
	displayBanner();
	displayMenu();
	if (title.length>0){
		document.write('<h1 align="center">');
		document.write(title);
		document.write('</h1>');
	}
}

function displayFooter(){
	document.write('<br>');
	displayMenu();
	document.write('<center>');
	document.write('<table class="top"><td><a href="#top">top<img src="images/ThumbsUp.gif" border="0"></a></td></table>');
	document.write('</center>');
}
	
function getParameter(paramName){
	argList=window.location.href.split("?")[1].split("&");
	numArgs=argList.length;
	found=true;
	param="";
	for (i=0;i<=numArgs+1&&!found;i++){
		arg=argList[i].split("=");
		if (arg[0]==paramName){
			found=true;
			param=arg[1];
		}
	}
	return param;
}

function oPhotoAlbum(ID,Title,SubTitle,Count){
	this.ID=ID;
	this.Title=Title;
	this.SubTitle=SubTitle;
	this.Count=Count;
}
	
function displayPhotos(){};

function dateValue(inDate){
	YYYY=inDate.getYear()+1900;
	MM=inDate.getMonth()+1;
	DD=inDate.getDate();
	outDate=(YYYY*10000)+(MM*100)+DD;
	return outDate;
}

function displayEventStatus(eventYear, eventMonth, eventDay){
	currentDate=new Date();
	// When eventYear is -1, this is a flag that the event was cancelled
	if (eventYear==-1) document.write('<div align="center"><font color="#FF0000" size="+2">X</font>');
	else	{
		var eventDate=new Date(eventYear,eventMonth-1,eventDay);
		if (dateValue(eventDate)<dateValue(currentDate))
			document.write('<img src="images/check_mark.gif" width="15" height="20">');
	}	
}

//********************************************************************************************
//*******			MENU DECLARATION				**************************
//********************************************************************************************	

function oMenuItem(id,href){
	this.ID=id;
	this.href=href;
	if (this.href==globalFileName) this.linkFlag=false;
	else this.linkFlag=true;
}

function displayMenuItem(){
	if (this.linkFlag) document.write('<a href="'+this.href+'">'+this.ID+'</a>');
	else document.write(this.ID);
}

globalFileName=currentFileName();
oMenuItem.prototype.display=displayMenuItem;

var Menu=new Array;
// oMenuItem parameters: (MenuName, linkAddress, currentFileName)
i=0;
Menu[i++]=new oMenuItem("Home","home.php");
Menu[i++]=new oMenuItem("About Us","aboutus.php");
Menu[i++]=new oMenuItem("Products","products.php");
Menu[i++]=new oMenuItem("Schedule","schedule.php");
Menu[i++]=new oMenuItem("Monthly Article","monthly.php");
Menu[i++]=new oMenuItem("Photos","photos.php");
Menu[i++]=new oMenuItem("Links","links.php");
Menu[i++]=new oMenuItem("Contact Us","contactus.php");



