<!-- JAVASCRIPT APPLICATION FOR http://members.fortunecity.com/zyenweb -->
<!-- 26th October 2003 -->

<!-- Variables -->
dateLast = "2nd September 2004"
datePrevious = "26th April 2004"

website = "http://members.fortunecity.com/zyenwebb"
webmail = "zyenhoo@catcha.com"


<!-- Menu Type constants -->
ctr=0
home = ctr++
fame = ctr++
achievement = ctr++
elegance = ctr++
companion = ctr++
exploration = ctr++
humour = ctr++
special = ctr++

numMajorLinks = ctr

majorLinks = new Array (numMajorLinks)
majorLinks[home] = "index.html"
majorLinks[fame] = "fame.html"
majorLinks[achievement] = "achievement.html"
majorLinks[elegance] = "elegance.html"
majorLinks[companion] = "companion.html"
majorLinks[exploration] = "exploration.html"
majorLinks[humour] = "humour.html"
majorLinks[special] = "special.html"

majorLinksName = new Array (numMajorLinks)
majorLinksName[home] = "Home"
majorLinksName[fame] = "Hall of Fame"
majorLinksName[achievement] = "Hall of Achievement"
majorLinksName[elegance] = "Hall of Elegance"
majorLinksName[companion] = "Hall of Companionship"
majorLinksName[exploration] = "Hall of Exploration"
majorLinksName[humour] = "Hall of Humour"
majorLinksName[special] = "Special Exhibits"


function preLoadImgs() {
   menuImg = new Array (numMajorLinks)
   menuOverImg = new Array (numMajorLinks)
   menuCurrImg = new Array (numMajorLinks)

   ctr = 0
   for (var i=0; i<numMajorLinks; i++) {
      menuImg[i] = new Image();
      menuOverImg[i] = new Image();
      menuCurrImg[i] = new Image();
      if (i<9) { menuImg[i].src = "_img/menu_0" + i + ".gif" 
                 menuImg[i].src = "_img/menu_0" + i + "c.gif" 
                 menuImg[i].src = "_img/menu_0" + i + "o.gif" }
      else { menuImg[i].src = "_img/menu_" + i + ".gif" 
             menuImg[i].src = "_img/menu_" + i + "c.gif" 
             menuImg[i].src = "_img/menu_" + i + "o.gif" }
   }      
}

<!-- Page header including banner and side menu -->
function pgHeader(pageType) {
   detPageType(pageType)

// Start the Body part
   document.write("<BODY LINK='#001FFF' VLINK='#001FFF' ALINK='#00BFFF' onLoad='preLoadImgs()'>")


// Force a marginless page
   document.write("<DIV STYLE='Position:Absolute;Left:0;Top:250;Width:103%'>")

// Banner
   document.write("<TABLE BACKGROUND='_img/zyenwebb_banner.jpg' BORDER=0 WIDTH=100% CELLPADDING=0 CELLSPACING=0>")
   document.write("<TR><TD HEIGHT=66></TD></TR></TABLE>")

// Table to put menu at the side
   document.write("<TABLE BORDER=0 WIDTH=100% CELLSPACING=0 CELLPADDING=0>")
   document.write("<TR VALIGN=TOP ALIGN=LEFT><TD WIDTH=200 BACKGROUND='_img/menu_bg.jpg'>")

// Side menu
   for (var i=0;i<numMajorLinks;i++) {

    if (i==menuType && i!=0) { 
         document.write("<IMG SRC='_img/menu_")
         if (i<10) { document.write("0") }
         document.write(i + "c.gif' ALT='[" + majorLinksName[i] + "]' BORDER=0><BR>")
    }
    else {
      document.write("<A HREF='" + majorLinks[i] + "'>")
      document.write("<IMG SRC='_img/menu_")
      if (i<10) { document.write("0") }
      document.write(i + ".gif'")

      // onMouseOver
      document.write(" onMouseOver='this.src=\"_img/menu_")
      if (i<10) { document.write("0") }
      document.write(i + "o.gif\"'")

      // onMouseOut
      document.write(" onMouseOut='this.src=\"_img/menu_")
      if (i<10) { document.write("0") }
      document.write(i + ".gif\"'")

      document.write(" ALT='[" + majorLinksName[i] + "]' BORDER=0></A><BR>")
    }
   }

   // Link to Zyen's Webyrinth
   document.write("<A HREF='http://members.fortunecity.com/zyenweb'>")
   document.write("<IMG SRC='_img/menu_zy.gif'")
   document.write(" onMouseOver='this.src=\"_img/menu_zyo.gif\"'")
   document.write(" onMouseOut='this.src=\"_img/menu_zy.gif\"'")
   document.write(" ALT='[Zyen&prime;s Webyrinth]' BORDER=0></A>")

   document.write("</TD><TD>")
}


<!-- Page footer including text menu, border, credits and disclaimer -->
function pgFooter(pageType) {
   detPageType(pageType)

// Close off the table from pgHeader()
   document.write("</TD></TR></TABLE>")

// Text menu
   document.write("<P ALIGN=CENTER>")
   for (var i=0; i<numMajorLinks; i++) {
      if (i!=0) { document.write(" | ") }
      document.write("<A HREF='" + majorLinks[i] + "'>" + majorLinksName[i] + "</A>")
   }
   document.write("</P>")

// Purple horizontal border
   document.write("<HR COLOR=#410056 WIDTH=100%>")

// Feedback
   document.write("<P ALIGN=CENTER>")
   document.write("You are viewing a page on <A HREF='" + website + "'>" + website + "</A>.<BR>")
   document.write("Email me at <A HREF='mailto:" + webmail + "'>" + webmail + "</A>.")
   document.write("</P>")

// Image credits
   document.write("<P CLASS='Small' ALIGN=CENTER><FONT COLOR='#FF0000'>")
   document.write("N.B. All images here were painstakingly designed by myself, including but not limited to animated gifs, photos with special effects, and title bars, except for images taken from other sites including but not limited to Fortunecities, Geocities, Guestpage, and other links, and where stated.")
   document.write("</FONT></P>")

// Site update information
   document.write("<P ALIGN=CENTER CLASS='Small'>")
   document.write("This site was last updated<BR>")
   document.write("<FONT COLOR='#FF0055'><B>" + dateLast + "</B></FONT><BR>")
   document.write("The previous update<BR>") 
   document.write("<FONT COLOR='#0055FF'><B>" + datePrevious + "</B></FONT>")
   document.write("</P>")

   document.write("</DIV>")
   document.write("</BODY>")
}

function detPageType(pageType) {
//Determine page type
   switch (pageType) {
      case ("fame") : menuType = fame;
      break;
      case ("achievement") : menuType = achievement;
      break;
      case ("elegance") : menuType = elegance;
      break;
      case ("companion") : menuType = companion;
      break;
      case ("exploration") : menuType = exploration;
      break;
      case ("humour") : menuType = humour;
      break;
      case ("special") : menuType = special;
      break;
      default : menuType = home;
   }
}


function imageViewer() {

   document.write("<TABLE BORDER=1 ALIGN=CENTER CELLPADDING=10 CELLSPACING=0>")
   document.write("<TR VALIGN=TOP><TD WIDTH=20% ALIGN=LEFT>")

   // List of photos go here
   photoList()

   document.write("</TD><TD ALIGN=CENTER ROWSPAN=2>")

   // Scrolling arrows
   arrow_prev = "<IMG SRC='_img/arrow_prev.gif' WIDTH=20 HEIGHT=20 BORDER=0> Previous"
   arrow_next = "Next <IMG SRC='_img/arrow_next.gif' WIDTH=20 HEIGHT=20 BORDER=0>"
   
   document.write("<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0><TR>")
   document.write("<TD ALIGN=LEFT WIDTH=20%>")
   
   // Top arrows + link descriptions
   document.write("<DIV ID='viewPrev'><FONT CLASS='Disabled'>" + arrow_prev + "</FONT></DIV>")
   document.write("</TD><TD ALIGN=CENTER>")
   document.write("<DIV ID='imgName' STYLE='font-weight:bold'> </DIV>")
   document.write("</TD><TD ALIGN=RIGHT WIDTH=20%>")
   document.write("<DIV ID='viewNext'><FONT CLASS='Disabled'>" + arrow_next + "</FONT></DIV>")
   document.write("</TD></TR><TR ALIGN=CENTER VALIGN=CENTER><TD COLSPAN=3 WIDTH=400 HEIGHT=400>")

   // Image placeholder
   document.write("<DIV ID='defaultText'>")
   document.write("Click on the links on the left to view the images.")
   document.write("</DIV>")
   document.write("<IMG NAME='imgViewer' style='visibility:Hidden' ALT='Loading...' onMouseDown='javascript:alert(\"Please don&prime;t download any photos! If you wish to have a copy, email me instead. Thank you.\")'><BR>")
   
   // Bottom arrows + image descriptions
   document.write("</TD></TR><TR><TD>")
   document.write("<DIV ID='viewPrev1'><FONT CLASS='Disabled'>" + arrow_prev + "</FONT></DIV>")
   document.write("</TD><TD ALIGN=CENTER WIDTH=60%>")
   document.write("<DIV ID='imgDesc'> </DIV>")
   document.write("</TD><TD ALIGN=RIGHT>")
   document.write("<DIV ID='viewNext1'><FONT CLASS='Disabled'>" + arrow_next + "</FONT></DIV>")
   
   document.write("</TD></TR></TABLE>")

   // Instructions on using the photo album
   document.write("<TR><TD VALIGN=BOTTOM ALIGN=CENTER>")
   document.write("<FONT CLASS='Tiny'>Click on the photo album to view the list of photos; double-click to collapse the list.</FONT>")

   document.write("</TD></TR></TABLE>")
}

function viewImage(imgNo) {
   startLink = imageLinks(imgNo)
   document.write(startLink + linkDesc[imgNo] + "</A>")
}

function mouseClick(imgNo) {
   imgViewer.src = photoLink[imgNo]
   imgViewer.alt = photoDesc[imgNo]
   imgViewer.style.visibility = "visible"
   defaultText.style.visibility = "hidden"
   imgName.innerHTML = photoName[imgNo]
   imgDesc.innerHTML = photoDesc[imgNo]
   if (imgNo != 0) { viewPrev.innerHTML = imageLinks(imgNo-1) + arrow_prev + "</A>" }
   else { viewPrev.innerHTML = "<FONT CLASS='Disabled'>" + arrow_prev + "</FONT>" }
   if (photoLink[imgNo+1] != null) { viewNext.innerHTML = imageLinks(imgNo+1) + arrow_next + "</A>" }
   else { viewNext.innerHTML = "<FONT CLASS='Disabled'>" + arrow_next + "</FONT>" }
   viewPrev1.innerHTML = viewPrev.innerHTML
   viewNext1.innerHTML = viewNext.innerHTML
}

function imageLinks(imgNo) {
   return ("<A HREF='#1' onClick='javascript:mouseClick(" + imgNo + ")'>")
}

function toggleAlbum(num) {
   return ("<A HREF='#1' CLASS='Bold' onClick='javascript:openAlbum(PA" +  num + "," + num + ")' onDblClick='javascript:closeAlbum(PA" + num + ")'>" + photoAlbum[num] + "</A><BR>")
}

function openAlbum(name, num) {
   name.innerHTML = listAlbum[num]
}

function closeAlbum(name) {
   name.innerHTML = "&nbsp;"
}


<!-- Image in normal text. To prevent people from saving the file -->
function photoPlace(pageType, imgName, align, alt, wth, ht) {
   if (pageType==null) { imgLoc = "_img/" + imgName }
   else if (pageType=="main") { imgLoc = "../_img/" + imgName }
   else { imgLoc = "../_img/" + pageType + "/" + imgName }
   writeLn = "<IMG SRC='" + imgLoc + "'"
   if (align!=null) { writeLn = writeLn + " ALIGN=" + align}
   if (alt!=null) { writeLn = writeLn + " ALT='[" + alt + "]'"}
   if (wth!=null) { writeLn = writeLn + " WIDTH=" + wth }
   if (ht!=null) { writeLn = writeLn + " HEIGHT=" + ht }
   writeLn = writeLn + " BORDER=0 onMouseDown='javascript:alert(\"Please don&prime;t download any photos! If you wish to have a copy, email me instead. Thank you.\")'>"
   document.write(writeLn)
}