/*=========================================================================================*/
//This is the main header to the Druga Noc website located @ the top of each page.           
// It is used as an external script and will be called by each page.                       
// When linking this script externally, you must also link the master stylesheet.          
// The master stylesheet is located in the directory /css/master.css.                                                                                          
/*=========================================================================================*/
/*=====================================================*/
// Call the main function to display the header.
/*=====================================================*/
displayHeader ()

/*=====================================================*/
// Object - Main Menu 
// This object is constructed to hold the values      
// of the main menu ie. descriptions & urls
/*=====================================================*/
function MainMenu (mm_descr,mm_url,mm_image ) {
this.mm_descr = mm_descr
this.mm_url = mm_url
this.mm_image = mm_image
}

/*=====================================================*/
// Main Function - displayHeader
// This function is used to contruct the template 
// for the main menu.                                     
/*=====================================================*/
function displayHeader () {

/*Declare variables*/
var isMSIE = (navigator.appName=="Microsoft Internet Explorer");
var isDHTML = (parseInt(navigator.appVersion) > 3);
var isNS = (navigator.appName=="Netscape");
var myHeader = " "
/**************************/
// Set variables to use to determine what page is loaded
var pgHome = "\/index.htm"
var pgHome1 = "\/"
var pgBio = "\/bio.htm"
var pgBioBV = "\/bv.htm"
var pgBioWV = "\/wv.htm"
var pgBioJP = "\/jp.htm"
var pgBioRB = "\/rb.htm"
var pgBioJM = "\/jm.htm"
var pgBioJK = "\/jk.htm"
var pgAlbums = "\/albums.htm"
var pgEvents = "\/events.htm"
var pgContact = "\/contact.htm"
var pgPhotos = "\/photos.htm"
var pgPhotos1 = "\/photos_misc.htm"
var pgPhotos2 = "\/photos_cdparty02222003.htm"
var pgPhotos3 = "\/photos_vdance02142003.htm"
var pgPhotos4 = "\/photos_pgraso02082003.htm"
var pgPhotos5 = "\/photos_croclub06152003.htm"
var pgPhotos6 = "\/photos_beachbash07122003.htm"
var pgPhotos7 = "\/photos_joleconcert09112003.htm"
var pgPhotos8 = "\/photos_edance04112004.htm"
var pgPhotos9 = "\/photos_magazin05012004.htm"
var pgPhotos10 = "\/photos_domdance10152004.htm"
var pgPhotos11 = "\/photos_domdance02252005.htm"
var pgPhotos12 = "\/photos_marchmadness03182005.htm"
var pgPhotos13 = "\/photos_tgiving10222005.htm"
var pgPhotos14 = "\/photos_domdance03242006.htm"
var pgPhotos15 = "\/photos_festdance05192006.htm"
var pgPhotos16 = "\/photos_xmas12252005.htm"
var pgPhotos17 = "\/photos_croatia08312006.htm"
var pgPhotos18 = "\/photos_festsat05202006.htm"
var pgPhotos19 = "\/photos_beachbash09152006.htm"
var pgGuestbook = "\/guestbook.htm"
var pgOthersites = "\/othersites.htm"
var pgCurrent = window.location.pathname

/* Date */ 
// Get the system date and convert to the current date in words
// get today's date from the Date object
var date = new Date ()

var today = date.getDate()
var day = date.getDay()
var month = date.getMonth()+1


// Determine what day and month it is in words
var WordDay
var WordMonth
var currentdate

// determine the Day
if (day==0){ WordDay="Sunday";}
if (day==1){ WordDay="Monday";}
if (day==2){ WordDay="Tuesday";}
if (day==3){ WordDay="Wednesday";}
if (day==4){ WordDay="Thursday";}
if (day==5){ WordDay="Friday";}
if (day==6){ WordDay="Saturday";}

			
// determine the Month Day
if (month==1){ WordMonth="January";}
if (month==2){ WordMonth="February";}
if (month==3){ WordMonth="March";}
if (month==4){ WordMonth="April";}
if (month==5){ WordMonth="May";}
if (month==6){ WordMonth="June";}
if (month==7){ WordMonth="July";}
if (month==8){ WordMonth="August";}
if (month==9){ WordMonth="September";}
if (month==10){ WordMonth="October";}
if (month==11){ WordMonth="November";}
if (month==12){ WordMonth="December";}

currentdate=(WordDay+", "+WordMonth+" "+today+".")

// End Date script


/* Declare array - menu */
menu = new Array (5)
menu[0] = new MainMenu ("Home", "index.htm", "images/top_nav_home.gif")
//menu[x] = new MainMenu ("Bio", "bio.htm", "images/top_nav_bio.gif")
menu[1] = new MainMenu ("Albums", "albums.htm", "images/top_nav_albums.gif")
menu[2] = new MainMenu ("Events", "events.htm", "images/top_nav_events.gif")
//menu[x] = new MainMenu ("Photos", "photos.htm", "images/top_nav_photos.gif")
//menu[x] = new MainMenu ("Guestbook", "guestbook.htm", "images/top_nav_guestbook.gif")
menu[3] = new MainMenu ("Other Sites", "othersites.htm", "images/top_nav_othersites.gif")
menu[4] = new MainMenu ("Contact", "contact.htm", "images/top_nav_contact.gif")

/* Draw the table for the header according to the type of browser to the variable myHeader. */
myHeader +="<table border='0' width='772' height='0' bgcolor='#ffffff' cellspacing='0' cellpadding='0' summary='This is the main menu bar of the Druga Noc Website.'>"
myHeader +="<tr>"
myHeader +="<td colspan='3'><img src='images/inside_spacer.gif' width='1' height='3' alt='' /></td>"
myHeader +="</tr>"
myHeader +="<tr>"
myHeader +="<td width='3'><img src='images/inside_spacer.gif' width='3' height='1' alt='' /></td>"
myHeader +="<td bgcolor='#000000' width='766'>"

/* Draw the main menu options refering to the object-Main Menu and array-menu*/
for ( var i=0; i <= menu.length - 1; i++) 
		{
		myHeader +="<a href='" + menu[i].mm_url + "'><img src='" + menu[i].mm_image + "' border='0' alt='" + menu[i].mm_descr + "' /></a>" 
		}
		
myHeader +="</td>"
myHeader +="<td width='3'><img src='images/inside_spacer.gif' width='3' height='1' alt='' /></td>"
myHeader +="</tr>"
myHeader +="<tr>"
myHeader +="<td colspan='3'><img src='images/inside_spacer.gif' width='1' height='3' alt='' /></td>"
myHeader +="</tr>"
myHeader +="</table>"

/* Draw the main logo*/
myHeader +="<table border='0' width='772' bgcolor='#ffffff' cellpadding='0' cellspacing='0' summary=''>"
myHeader +="<tr>"
myHeader +="<td width='3'><img src='images/inside_spacer.gif' width='3' height='1' alt='' /></td>"
/* BEGIN LEFT Header */
myHeader +="<td width='405'>"
myHeader +="<table border='0' width='405' cellpadding='0' cellspacing='0' summary=''>"
myHeader +="<tr>"
myHeader +="<td bgcolor='#000000'>"
myHeader +="<img src='images/bot_header.gif' width='405' height='32' alt='Welcome to Druga Noc OnLine - www.druganoc.com' />"
myHeader +="</td>"
myHeader +="</tr>"
myHeader +="</table>"
myHeader +="</td>"
/* END LEFT Header */
myHeader +="<td width='3'><img src='images/inside_spacer.gif' width='3' height='1' alt='' /></td>"
/* BEGIN RIGHT Header */
myHeader +="<td width='358'>"
myHeader +="<table border='0' width='358' cellpadding='0' cellspacing='0' summary=''>"
myHeader +="<tr>"
myHeader +="<td bgcolor='#980101'>"
if (pgCurrent == pgHome){myHeader +="<img src='images/hdr_welcome.gif' width='358' height='32' alt='Welcome' />";}
if (pgCurrent == pgHome1){myHeader +="<img src='images/hdr_welcome.gif' width='358' height='32' alt='Welcome' />";}
if (pgCurrent == pgBio){myHeader +="<img src='images/hdr_bio.gif' width='358' height='32' alt='Bio' />";}
if (pgCurrent == pgBioBV){myHeader +="<img src='images/hdr_bio.gif' width='358' height='32' alt='Bio' />";}
if (pgCurrent == pgBioWV){myHeader +="<img src='images/hdr_bio.gif' width='358' height='32' alt='Bio' />";}
if (pgCurrent == pgBioJP){myHeader +="<img src='images/hdr_bio.gif' width='358' height='32' alt='Bio' />";}
if (pgCurrent == pgBioRB){myHeader +="<img src='images/hdr_bio.gif' width='358' height='32' alt='Bio' />";}
if (pgCurrent == pgBioJM){myHeader +="<img src='images/hdr_bio.gif' width='358' height='32' alt='Bio' />";}
if (pgCurrent == pgBioJK){myHeader +="<img src='images/hdr_bio.gif' width='358' height='32' alt='Bio' />";}
if (pgCurrent == pgAlbums){myHeader +="<img src='images/hdr_albums.gif' width='358' height='32' alt='Albums' />";}
if (pgCurrent == pgEvents){myHeader +="<img src='images/hdr_events.gif' width='358' height='32' alt='Events' />";}
if (pgCurrent == pgContact){myHeader +="<img src='images/hdr_contact.gif' width='358' height='32' alt='Contact' />";}
if (pgCurrent == pgPhotos){myHeader +="<img src='images/hdr_photos.gif' width='358' height='32' alt='Photos' />";}
if (pgCurrent == pgPhotos1){myHeader +="<img src='images/hdr_photos.gif' width='358' height='32' alt='Photos' />";}
if (pgCurrent == pgPhotos2){myHeader +="<img src='images/hdr_photos.gif' width='358' height='32' alt='Photos' />";}
if (pgCurrent == pgPhotos3){myHeader +="<img src='images/hdr_photos.gif' width='358' height='32' alt='Photos' />";}
if (pgCurrent == pgPhotos4){myHeader +="<img src='images/hdr_photos.gif' width='358' height='32' alt='Photos' />";}
if (pgCurrent == pgPhotos5){myHeader +="<img src='images/hdr_photos.gif' width='358' height='32' alt='Photos' />";}
if (pgCurrent == pgPhotos6){myHeader +="<img src='images/hdr_photos.gif' width='358' height='32' alt='Photos' />";}
if (pgCurrent == pgPhotos7){myHeader +="<img src='images/hdr_photos.gif' width='358' height='32' alt='Photos' />";}
if (pgCurrent == pgPhotos8){myHeader +="<img src='images/hdr_photos.gif' width='358' height='32' alt='Photos' />";}
if (pgCurrent == pgPhotos9){myHeader +="<img src='images/hdr_photos.gif' width='358' height='32' alt='Photos' />";}
if (pgCurrent == pgPhotos10){myHeader +="<img src='images/hdr_photos.gif' width='358' height='32' alt='Photos' />";}
if (pgCurrent == pgPhotos11){myHeader +="<img src='images/hdr_photos.gif' width='358' height='32' alt='Photos' />";}
if (pgCurrent == pgPhotos12){myHeader +="<img src='images/hdr_photos.gif' width='358' height='32' alt='Photos' />";}
if (pgCurrent == pgPhotos13){myHeader +="<img src='images/hdr_photos.gif' width='358' height='32' alt='Photos' />";}
if (pgCurrent == pgPhotos14){myHeader +="<img src='images/hdr_photos.gif' width='358' height='32' alt='Photos' />";}
if (pgCurrent == pgPhotos15){myHeader +="<img src='images/hdr_photos.gif' width='358' height='32' alt='Photos' />";}
if (pgCurrent == pgPhotos16){myHeader +="<img src='images/hdr_photos.gif' width='358' height='32' alt='Photos' />";}
if (pgCurrent == pgPhotos17){myHeader +="<img src='images/hdr_photos.gif' width='358' height='32' alt='Photos' />";}
if (pgCurrent == pgPhotos18){myHeader +="<img src='images/hdr_photos.gif' width='358' height='32' alt='Photos' />";}
if (pgCurrent == pgPhotos19){myHeader +="<img src='images/hdr_photos.gif' width='358' height='32' alt='Photos' />";}
if (pgCurrent == pgGuestbook){myHeader +="<img src='images/hdr_guestbook.gif' width='358' height='32' alt='Guestbook' />";}
if (pgCurrent == pgOthersites){myHeader +="<img src='images/hdr_othersites.gif' width='358' height='32' alt='Other Sites' />";}
myHeader +="</td>"
myHeader +="</tr>"
myHeader +="</table>"
myHeader +="</td>"
/* END RIGHT Header */
myHeader +="<td width='3'><img src='images/inside_spacer.gif' width='3' height='1' alt='' /></td>"
myHeader +="</tr>"
myHeader +="</table>"

/* Write the contents of myHeader to the screen */
document.write(myHeader)

}