<!-- Hide script from old browsers

//
// Last updated  12/01/2010
//

stdBrowser = (document.getElementById) ? true : false
pic = new Array
vid = new Array
currElement = 1
onerror=handleErr
var txt=""
var htmlstring=""
var imgCt=0
var NextImg=""
var CurrPicNum=0
var prevstate 
var nextstate 
var bg=1
var netscape="Netscape"
var ie="Microsoft Internet Explorer"
var browser
var b_version
var version
var currmonth=0
var currday=0
var ampm=""
var password=""

btn0n=wbpr('n0.gif');btn0o=wbpr('o0.gif');btn0c=wbpr('c0.gif')
btn1n=wbpr('n1.gif');btn1o=wbpr('o1.gif');btn1c=wbpr('c1.gif')
btn2n=wbpr('n2.gif');btn2o=wbpr('o2.gif');btn2c=wbpr('c2.gif')
btn3n=wbpr('n3.gif');btn3o=wbpr('o3.gif');btn3c=wbpr('c3.gif')
btn4n=wbpr('n4.gif');btn4o=wbpr('o4.gif');btn4c=wbpr('c4.gif')
btn5n=wbpr('n5.gif');btn5o=wbpr('o5.gif');btn5c=wbpr('c5.gif')
btn6n=wbpr('n6.gif');btn6o=wbpr('o6.gif');btn6c=wbpr('c6.gif')
btn7n=wbpr('n7.gif');btn7o=wbpr('o7.gif');btn7c=wbpr('c7.gif')
btn8n=wbpr('n8.gif');btn8o=wbpr('o8.gif');btn8c=wbpr('c8.gif')
btn9n=wbpr('n9.gif');btn9o=wbpr('o9.gif');btn9c=wbpr('c9.gif')
btn10n=wbpr('n10.gif');btn10o=wbpr('o10.gif');btn10c=wbpr('c10.gif')
btn11n=wbpr('n11.gif');btn11o=wbpr('o11.gif');btn11c=wbpr('c11.gif')


// SUB MENUS DECLARATION, YOU DONT NEED TO EDIT THIS
subInfo = new Array();
subInfo[1] = new Array();
subInfo[2] = new Array();
subInfo[3] = new Array();


//*** SET SUB MENUS TEXT LINKS AND TARGETS HERE ***//
subInfo[1][1] = new Array("All Pictures","OT",75);

subInfo[2][1] = new Array("Songkran","SO",17);
subInfo[2][2] = new Array("Video","VD",2);
subInfo[2][3] = new Array("Other","OT",35);

subInfo[3][1] = new Array("Songkran","SO",28);
subInfo[3][2] = new Array("Jan's Stag Night","JS",20);
subInfo[3][3] = new Array("Jan's Wedding","JW",52);
subInfo[3][4] = new Array("St. George's Day","SG",24);
subInfo[3][5] = new Array("Jan's Stag Night (take 2)","J2",40);
subInfo[3][6] = new Array("Other","OT",33);


function startup()
{
   detectBrowser()
 //  loadPics()
   startTime()
   document.body.background = "images/Background"+bg+".jpg"
   if (browser==ie) {
         buildpage('Home',0,0)
   } else {	
   	  buildpage('Home',0,0)
   	  buildpage('Location',0,0)
   	  buildpage('Facilities',0,0)
//   	  buildpage('Gallery 2007',0,0)
//   	  buildpage('Gallery 2008',0,0)
   	  buildpage('Reviews',0,0)
   	  buildpage('ContactUs',0,0)
   	  buildpage('News',0,0)
   	  buildpage('Comments',0,0)
   	  buildpage('ComingOver',0,0)
//   	  for (i=1;i<=subInfo.length-1;i++) {
//   	  	 for (j=1; j<=subInfo[i].length-1; j++ ) {
//   	  	 	  if (subInfo[i][j][1] != 'VD') {
//               alert(i + ',' +j)
//               buildpage('Gallery',i,j)
//            }
//         }
//      }
      buildpage('Gallery',1,1)
      buildpage('Gallery',2,1)
      buildpage('Gallery',2,3)
      buildpage('Gallery',3,1)
      buildpage('Gallery',3,2)
      buildpage('Gallery',3,3)
      buildpage('Gallery',3,4)
      buildpage('Gallery',3,5)
   	  document.getElementById('contentsBox').innerHTML=htmlstring
   }
  
}

function handleErr(msg,url,l)
{
   txt="There was an error on this page.\n\n"
   txt+="Error: " + msg + "\n"
   txt+="URL: " + url + "\n"
   txt+="Line: " + l + "\n\n"
   txt+="Click OK to continue.\n\n"
   alert(txt)
   return true
}

function detectBrowser()
{
   browser=navigator.appName
   b_version=navigator.appVersion
   version=parseFloat(b_version)
   if ((browser==netscape||browser==ie) && (version>=4)){
      if (browser==netscape) {
          alert("This website is best viewed with Internet Explorer")
      }  
   }
   else {
        alert("Your browser is very old\nIt's time to upgrade your browser!\nThis site may not work with this browser")
   }
}

function changebackground() {
   if (confirm("Change the background ?")){
      bg++
      if (bg > 6){
         bg=0
      }
      document.body.background = "images/Background"+bg+".jpg"
   }
}


function resetIt(myForm) {
   document.getElementById("myForm").reset()
   return true 
}

function submitIt(myForm) {
   var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;

   if (document.getElementById("myForm").name.value == "")
   {
      alert("Name may not be blank")
      document.getElementById("myForm").name.focus()
      document.getElementById("myForm").name.select()
      return false
   }
   if (document.getElementById("myForm").subject.value == "")
   {
      alert("Subject may not be blank")
      document.getElementById("myForm").subject.focus()
      document.getElementById("myForm").subject.select()
      return false
   }
   if (document.getElementById("myForm").email.value == "")
   {
      alert("Email may not be blank")
      document.getElementById("myForm").email.focus()
      document.getElementById("myForm").email.select()
      return false
   }
   else{
      if(!document.getElementById("myForm").email.value.match(emailExp)){
         alert("Email is invalid")
         document.getElementById("myForm").email.focus()
         document.getElementById("myForm").email.select()
         return false   
      }
   }
      
   document.getElementById("myForm").submit()
   return true 
}

function clickGallery()
{   
   if (browser==netscape) 
      alert('Not available in Netscape')
}
	
function changepage(pagename, page, subpage)
{
   if (browser==netscape) 
      alert('Not available in Netscape')
   else {
       buildpage(pagename, page, subpage)
   }
   document.getElementById("contentsBox").scrollTop=0
   
}


function buildpage(pagename, page, subpage)
{
   if (browser==ie) 
        htmlstring=""
   else 
        htmlstring+="<A name=\""+pagename+"\"></A>"

   if (pagename == "Picture") {
      htmlstring+="<h2 class=\"header\" style=\"border-style: outset\";>Picture: "+CurrPicNum+" of "+imgCt+"</h2>"
   } else {
      if (pagename == "Gallery") {
         htmlstring+="<h2 class=\"header\">" + pagename + ' ' + year(page) + ' ' + subInfo[page][subpage][0] + "</h2>"
      } else { 
         htmlstring+="<h2 class=\"header\">" + pagename + "</h2>"
      }
   }


   if (pagename == "Gallery") {
   	
      if (subInfo[page][subpage][1] != 'VD') {
         if (page == 3 && subpage == 5) {
            while (password.toLowerCase() != "sally") {   	
					password = prompt('The content of this gallery contains adult and poultry related material\nEnter the password\t\tClue: The chicken\'s name!', ' ');
  					if (password == null) {
  						password = ""
  						return
  					}
  				}
         }	
         loadPics(page,subpage)
         displayThumbs(page,subpage)
      } else {                         // Video
         if (confirm("The video clips you are about to see contain material that some people may find distasteful\n\nThe clips may take several minutes to download\n\nDo you wish to continue?")){
           displayVideoThumbs(page)
         }
         else {
            return
         }
      }
   } else { 
      getText(pagename,page,subpage)
   }
// }
   //prompt("HTML String for " + pagename,htmlstring)
   
   if (browser==ie) {
         document.getElementById('contentsBox').innerHTML=htmlstring
   } else { 
        htmlstring+="\n<p></p>"
   }
}

function getText(pagename,page,subpage)
{
   if (pagename == "Home") {
      htmlstring+="<div class=\"transbox\">" 

      seasonalGreeting()
      
      htmlstring+="<div class=\"transboxpic\">"
      htmlstring+="\n<p>Welcome to the Black Jack Pub. An English style pub in the centre of Chaweng that has become part of Samui tradition.</p>"
      htmlstring+="</div>"
      htmlstring+="\n<p></p>"
      htmlstring+="\n<p>A Traditional English style pub with ice-cold beer, live premiership football and other sports in comfortable surroundings in the heart of the tropical paradise of Koh Samui." 
      htmlstring+="\nSituated in an open fronted unit that is not only comfortably furnished but also totally unaffected by the booming \"techno-music\" from some of the neighbouring bars."
      htmlstring+="\nEstablished over 10 years ago by Luke and Tip. Black Jack Pub was Chaweng Beach's first, and still considered now by many, only true English pub.</p>"
      htmlstring+="\n<p>Located in a small soi (side street) just 20 yards from Chaweng Beach road, next to Soi Green Mango the bar is within easy walking distance of most hotels along Chaweng Beach."
      htmlstring+="\nThe Black Jack Pub is modelled on an English style \"boozer\" where customers can comfortably chat over the in-house music system without the need to shout. "
      htmlstring+="\nThere are no bar-girls hassling you to play silly games and buy them overpriced \"cola-drinks\". Just good company, ice cold beers and lots of live sport.</p>"
      htmlstring+="\n<p>Now owned by Dave an ex-City of London worker who decided over 5 years ago to leave behind the rat-race for the sunnier climes of Southern Thailand. "
      htmlstring+="\nThe bar is always manned by either himself or his wife Thanyaporn. They are readily at hand to give out any info that can help your holiday run that much smoother.</p>"
      htmlstring+="\n<P>Set over two floors the main ground floor bar has four large TVs (Including a 42\" plasma H.D. TV) where most weekends are dominated by <SPAN style=\"color: #b40000; font-style: italic;\">LIVE</SPAN> Premier League football with full English commentary."
      htmlstring+="\nAlso available for customers is our <SPAN style=\"color: #b40000; font-style: italic;\">FREE</SPAN>  internet service to keep in touch with those at home and a modern western-style toilet to keep the ladies happy.</P>"
      htmlstring+="\n<P>The first floor terrace bar is perfect for \"people watching\" with an outdoor terrace area overlooking the bustling nightlife scene further up the soi. "
      htmlstring+="\nWith a full-sized slate-bed pool table and and an additional 2 TVs to keep up with the sport. Our terrace bar is ideal for a more relaxing evening.</P>" 
      htmlstring+="</div>"
   }

   if (pagename == "Location") {
      htmlstring+="<div class=\"transbox\">"
      htmlstring+="<div style=\"border-style: inset;\">"
      htmlstring+="<SPAN style=\"font-weight: bold; font-size: 100%; line-height: 20px;\">"
      htmlstring+="  <table style=\"margin: 10px 10px; width: 580px; height: 120px; text-align: left; vertical-align: top;\" border=\"5\" cellpadding=\"0px\" cellspacing=\"0\">"
      htmlstring+="  <tbody>"
      htmlstring+="    <tr>"
      htmlstring+="      <td style=\"height: 120px; width: 230px; vertical-align: top;\">"
      htmlstring+="<P>We are located at:"
      htmlstring+="\n<BR><BR>169/4 Moo 2,"
      htmlstring+="\n<BR>Chaweng Beach,"
      htmlstring+="\n<BR>Bophut 84320,"
      htmlstring+="\n<BR>Koh Samui,"
      htmlstring+="\n<BR>Surat Thani,"
      htmlstring+="\n<BR>Thailand<BR>"
      htmlstring+="\n<BR>Tel No: + 66 077 413214<BR>"
      htmlstring+="\n<BR>email: blackjackpub@yahoo.com<BR>"
      htmlstring+="      </td>"
      htmlstring+="      <td style=\"height: 120px; width: 270px; vertical-align: top;  padding: 0px 0px 0px 0px;\">"     
      htmlstring+="<IMG SRC=\"images/Samui.gif\" top=\"10\" WIDTH=\"310\" HEIGHT=\"350\" NAME=\"Samui Map\" ALT=\"Samui Map\">"
      htmlstring+="      </td>"
      htmlstring+="    </tr>"
      htmlstring+="    </tbody>"
      htmlstring+="  </table>"
      htmlstring+="</P></SPAN>"
      htmlstring+="<div id=\"pic\">"
      htmlstring+="<MAP NAME=\"Chaweng\">"
      htmlstring+="<AREA SHAPE=\"RECT\" COORDS=\"300,130,335,170\" "
      htmlstring+="href=\"#\" onClick=\"changebackground()\" ALT=\"Black Jack\""
      htmlstring+="</MAP>"
      htmlstring+="<IMG SRC=\"images/BlackJackLocation.jpg\" top=\"10\" WIDTH=\"570\" HEIGHT=\"375\" NAME=\"Chaweng Map\" USEMAP=\"#Chaweng\" ALT=\"Chaweng Map\">"
      htmlstring+="</div>"
      htmlstring+="</div>"
      htmlstring+="</div>"
     }      
      
   if (pagename == "Facilities") {
      htmlstring+="\n<div class=\"transbox\">"
      htmlstring+="\n<P style=\"margin-bottom: 20px;\">Black Jack Bar serves a full selection of drinks including:"
      htmlstring+="\n<SPAN class=\"author\"><ul><li>Ice-cold bottled and draught beers</li><li>Wines and spirits</li><li>Cocktails</li><li>Soft Drinks</li><li>Hot and Cold snacks</li></ul></SPAN>"
      htmlstring+="\n</p>"
      htmlstring+="\n<P style=\"margin-bottom: 20px;\">We are now open from 2 pm till Late (Happy hours 2 pm till 6 pm) every day.</P>"
      htmlstring+="\n<P style=\"margin-bottom: 20px;\">Our facilities include:"
      htmlstring+="\n<SPAN class=\"author\"><ul><li>Live Premiership Football (with English commentary)</li><li>Other major sporting events</li><li>Bars on 2 floors + terrace</li><li>6 TVs (inc 42\" Plasma)</li><li>Free Pool table</li><li>Free Internet Access</li><li>Newspapers</li></ul></SPAN>"
      htmlstring+="\n</p>"
      htmlstring+="\n</div>"
      }     

   if (pagename == "Reviews") {
      htmlstring+="\n<div class=\"transbox\">"
      htmlstring+="<P>Black Jack Pub comes casual, friendly and popular with pool table and lots of soccer on TV. It's a small and cosy place run by an ex-pat, and doesn't have girls to draw in the foreign men.</P>"
      htmlstring+="<div style=\"text-align: right;\"><SPAN class=\"author\">Lonely Planet - Thailand (10<SUP>th</SUP> Edition).</SPAN></div>"
      htmlstring+="<br><br>"
      htmlstring+="<P>An oasis amongst the mayhem. The Black Jack Pub is the perfect place to escape the noise and hassle of the surrounding girlie bars for a few beers in good company.</P>"
      htmlstring+="<div style=\"text-align: right;\"><SPAN class=\"author\">What's on in Thailand (2005 Edition).</SPAN></div>"
      htmlstring+="<br><br>"
      htmlstring+="<P>No bar girls, no techno and no hassle ......... Perfect.</P>"
      htmlstring+="<div style=\"text-align: right;\"><SPAN class=\"author\">The Essential Guide to Koh Samui.</SPAN></div>"
      htmlstring+="<br><br>"
      htmlstring+="<P>Black Jack is a typical English pub owned and run by 3 Englishmen and is a must to visit.</P>"
      htmlstring+="<div style=\"text-align: right;\"><SPAN class=\"author\">www.thebackpacker.net/worldbars.</SPAN></div>"
      htmlstring+="<br><br>"
      htmlstring+="\n</div>"
      }
      
   if (pagename == "ContactUs") {
      htmlstring+="\n<div class=\"transbox\">"
      htmlstring+="\n<P style=\"margin-bottom: 5px;\">If you have any questions for us or have had a good time in Black Jack's or simply want to let people know when you are back in Koh Samui why not send us an email and we'll post your comments on our reviews page.</P>"
      htmlstring+="\n<form id=\"myForm\" onSubmit=\"return submitIt(this)\" action=\"http://www.blackjackpubsamui.com/formsubmit/FormMail.cgi\" method=\"post\" style=\"padding: 0px 20px 0px 10px; width: 570px; height: 425px;\">"
      htmlstring+="\n<input type=\"hidden\" name=\"recipient\" value=\"mail@blackjackpubsamui.com\">"
      htmlstring+="\n<input type=\"hidden\" name=\"redirect\" value=\"http://www.blackjackpubsamui.com\">"
      htmlstring+="\n  <fieldset>"
      htmlstring+="\n  <legend>"  
      htmlstring+="E-mail"    
      htmlstring+="</legend>"
      htmlstring+="\n  <table style=\"text-align: vertical-align: top;\" border=\"0\" cellpadding=\"2px\" cellspacing=\"1\">"
      htmlstring+="\n  <tbody>"
      htmlstring+="\n  <tr style=\"margin: 0px 0px 0px 0px;\">"
      htmlstring+="\n    <tr>"
      htmlstring+="      <td style=\"height: 30px; width: 100px; vertical-align: top;\"><h3>Name</h3></td>"
      htmlstring+="      <td style=\"height: 30px; width: 400px; vertical-align: top;\"><input maxlength=\"50\" size=\"50\" name=\"name\"></td>"
      htmlstring+="    </tr>"
      htmlstring+="\n    <tr>"
      htmlstring+="      <td style=\"height: 30px; width: 100px; vertical-align: top;\"><h3>Email</h3></td>"
      htmlstring+="      <td style=\"height: 30px; width: 400px; vertical-align: top;\"><input maxlength=\"50\" size=\"50\" name=\"email\"></td>"
      htmlstring+="    </tr>"
      htmlstring+="\n    <tr>"
      htmlstring+="      <td style=\"height: 30px; width: 100px; vertical-align: top;\"><h3>Subject</h3></td>"
      htmlstring+="      <td style=\"height: 30px; width: 400px; vertical-align: top;\"><input maxlength=\"50\" size=\"50\" name=\"subject\"></td>"
      htmlstring+="    </tr>"
      htmlstring+="\n    <tr>"
      htmlstring+="      <td style=\"height: 30px; width: 100px; vertical-align: top;\"><h3>Message</h3></td>"
      htmlstring+="      <td style=\"height: 100px; width: 400px; vertical-align: top;\"><textarea cols=\"50\" rows=\"8\" font=\"italic bold 20px arial,serif\" name=\"message\"></textarea></td>"
      htmlstring+="    </tr>"
      htmlstring+="\n    </tbody>"
      htmlstring+="\n  </table>"
      htmlstring+="\n  <br>"
      htmlstring+="\n      <a href=\"#\" onclick=\"return submitIt(this)\"><img alt=\"Submit\" hspace=\"115\" height=\"30\" width=\"100\" src=\"buttons/Sendn.gif\"></a>"
      htmlstring+="\n      <a href=\"#\" onclick=\"return resetIt(this)\"><img alt=\"reset\" hspace=\"2\" height=\"30\" width=\"100\" src=\"buttons/Resetn.gif\"></a>"
   //   htmlstring+="\n<input type=\"submit\" value=\"Send\" style=\"height: 30px; width: 80px; margin: 0px 200px 0px 150px;\">"
   //   htmlstring+="\n<input type=\"reset\" value=\"Reset\" style=\"height: 30px; width: 80px; margin: 0px 0px 0px 0px;\">"
      htmlstring+="\n  <p></p>"
      htmlstring+="\n  </fieldset>"
      htmlstring+="\n</form>"
      htmlstring+="\n</div>"
   }    
   
   if (pagename == "News") {
      htmlstring+="\n<div class=\"transbox\">"
      htmlstring+="\n<P style=\"margin-bottom: 20px;\">English Premier League - When the new season starts Black Jack Pub guarantees to show a minimum of 7 <SPAN style=\"color: #b40000; font-style: italic;\">LIVE</SPAN> games every weekend.</P>"
 //     htmlstring+="\n<P style=\"margin-bottom: 20px;\">Fantasy Football - Congratulations to Lee who won both the Premiership and European competitions. Unfortunately he wasn't in the bar when either result was announced to claim his prizes. The two bottles of Chang will roll-over to next year.</P>"
 
 //     htmlstring+="\n<P style=\"margin-bottom: 20px;\">English Premier League - The new season is well under way, Black Jack Pub guarantees to show a minimum of 7 <SPAN style=\"color: #b40000; font-style: italic;\">LIVE</SPAN> games every weekend.</P>"
 //     htmlstring+="\n<P style=\"margin-bottom: 20px;\">Why not join the Black Jack Fantasy Football League. Click on the picture in the bottom right hand corner of the website</P>"
 //     It's completely free to enter and watch their progress throughout the season. Once you have created your team why not put them in the <a href=\"http://fantasyfootball.metro.co.uk/league.aspx?page=join\">Black Jack League</a><br>League Name: Black Jack Password: chaweng</P>"
      htmlstring+="\n<P style=\"margin-bottom: 20px;\">The bar has recently been fully refurbished. This includes several new televisions and new seating.</P>"
      htmlstring+="\n<P style=\"margin-bottom: 20px;\">Black Jack is now open in the afternoons during which time we have our \"happy hour\". The afternoons and early evenings is also when we show classic UK comedy.</P>"
      htmlstring+="\n<p></p>"
      htmlstring+="\n</div>"
      }

   if (pagename == "Fantasy Football") {
      htmlstring+="\n<div class=\"transbox\">"
     // htmlstring+="\n<P style=\"margin-bottom: 20px;\">If you've already joined the Black Jack Premiership Fantasy Football League (in conjunction with METRO.co.uk). Why not join the new European Fantasy Football League It's free and there are prizes.</P>"
      htmlstring+="\n<P style=\"margin-bottom: 20px;\">Create and manage your own team. To create a team click on the link below. You can change it as much as you like until the season kicks off. It will even pick one for you if you don't want to." 
      htmlstring+="\n<BR><BR><a href=\"http://fantasyfootball.metro.co.uk/\" target=\"_blank\">Fantasy Football (Home Page)</a></P>"
      htmlstring+="\n<P style=\"margin-bottom: 20px;\">Once you've created your team put them in the Black Jack mini-league and watch your progress throughout the season. After logging-in go to <i>mini-leagues</i> Just enter the mini-league details:<BR><BR>League Name:&nbsp;  <SPAN class=\"author\">Blackjackpubsamui</SPAN><BR>PIN:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <SPAN class=\"author\">8003506</SPAN>"
      htmlstring+="\n<BR><BR><a href=\"https://register.metro.co.uk/MetroRegWebApp/loginFootball?redirectPath=http%3A%2F%2Ffantasyfootball.metro.co.uk%2Flog-in%2Freturn\" target=\"_blank\">Fantasy Football (Login)</a></P>"
      htmlstring+="\n<P style=\"margin-bottom: 20px;\">Manager of the year will win a free drink off Dave if they happen to be in the bar when he annonces it.</P>"
      htmlstring+="\n<p></p>"
      htmlstring+="\n</div>"
      }
  
   if (pagename == "Comments") {
      htmlstring+="\n<div class=\"transbox\">"
      htmlstring+="\n<P>Thanks for your hospitalility at the Black Jack, I had a great time and a great holiday all round. Hope to see you soon mate.</P>"
      htmlstring+="\n<div style=\"text-align: right;\"><SPAN class=\"author\">Steve , Darren & Tatey - June 2009 </SPAN></div>"
      htmlstring+="\n<br><br>"
      htmlstring+="\n<P>Hello Sai, Dave, Porn, Adt, and Jojo. This is Gavin letting you all know I made it home safe, and while I was there I had a great time at BlackJack's. Miss you all and see you next time! Cheers!</P>"
      htmlstring+="\n<div style=\"text-align: right;\"><SPAN class=\"author\">Gavin (USA) - August 2008 </SPAN></div>"
      htmlstring+="\n<br><br>"
      htmlstring+="\n<P>As always we had a great time at Black Jacks, it's always gonna be our place to booze, relax and have fun. You and Porn were again on the best of form and it's always part of our holiday these days ! <br>My dad had a fabulous time !! He hasn't stopped talking about it since he got back and was in my earhole all the way home. I'm sure he will be back !</P>"
      htmlstring+="\n<div style=\"text-align: right;\"><SPAN class=\"author\">Steve  & Toni, Bromley - June 2008 </SPAN></div>"
      htmlstring+="\n<br><br>"
      htmlstring+="\n<P>Hi David, back safely in UK, already at work slaving away, thanks for looking after me as usual and I hope to see you again soon.</P>"
      htmlstring+="\n<div style=\"text-align: right;\"><SPAN class=\"author\">Chris, Putney - May 2008 </SPAN></div>"
      htmlstring+="\n<br><br>"
      htmlstring+="\n<P>Just wanted to thank all in the Black Jack pub for making me feel so welcome.  Looking forward to getting back</P>"
      htmlstring+="\n<div style=\"text-align: right;\"><SPAN class=\"author\">Barry, Belfast - May 2008 </SPAN></div>"
      htmlstring+="\n<br><br>"
      htmlstring+="\n<P>Thanks to all the staff for making our holiday so enjoyable.</P>"
      htmlstring+="\n<div style=\"text-align: right;\"><SPAN class=\"author\">Martin and Sla - August 2007 </SPAN></div>"
      htmlstring+="\n<br><br>"
      htmlstring+="\n<P>Any Englishman who goes to Koh Samui MUST go to Black Jacks. For the past 100 years I have visited this bar, and in February to April 2008 I will be there and on 1 night in March I will be ringing the bell for my 121st Birthday to buy drinks for my guests. So come along and you might be lucky enough to be there on my birthday.</P>"
      htmlstring+="\n<div style=\"text-align: right;\"><SPAN class=\"author\">Jonathan &quot;BOXIE&quot; Goodwin-Self  - July 2007 </SPAN></div>"
      htmlstring+="\n<br><br>"
      htmlstring+="\n<P>Black Jack\'s is a great little place with a great big atmosphere, its the ideal place to chill out and catch up on what\'s going on not only in Chaweng but also back in the UK - Dave and Porn are brilliant and always made us feel really welcome. This place is definitely worth a visit and we bet you visit more than once.</P>"
      htmlstring+="\n<div style=\"text-align: right;\"><SPAN class=\"author\">Debbie & Shaun, SE London - July 2007 </SPAN></div>"
      htmlstring+="\n<br><br>"
      htmlstring+="\n<P>Just to say we had a fantastic time whilst in Samui, the bar stalls are great for dancing on. Cant wait to return for another infamous Mac the Knife night xx.</P>"
      htmlstring+="\n<div style=\"text-align: right;\"><SPAN class=\"author\">Claire Sayer - July 2007 </SPAN></div>"
      htmlstring+="\n<br><br>"
      htmlstring+="\n</div>"
      }
   if (pagename == "ComingOver") {
      htmlstring+="\n<div class=\"transbox\">"
      htmlstring+="\n<P>Looking to catch up with old friends from a previous visit to Black Jack Pub? Then why not have a look at the page below and see whose already booked up for the coming year. Booked your tickets already? Then why not let us know which dates you're due over and maybe there could be a few re-unions in the pipe-line.</P>"
      htmlstring+="\n<div style=\"font-weight: normal;\">"
      htmlstring+="\n  <table style=\"margin: 0px 0px 0px 15px;\" cellspacing=\"5\">"
      htmlstring+="\n  <tbody>"
      htmlstring+="\n  <tr><td WIDTH=\"50%\">&nbsp</td><td WIDTH=\"50%\">&nbsp</td></tr>"
//            htmlstring+="\n  <tr><td class=\"person\" WIDTH=\"40%\">Gavin , St Albans </td><td WIDTH=\"60%\">arrives 11th October, departs 31st October</td></tr>"   


//      htmlstring+="\n  <tr></tr><tr><td style=\"width: 200px;\"><h3>AUGUST 2008</h3></td></tr>"
//      htmlstring+="\n  <tr><td class=\"person\">James (taxi), Brighton</td><td style=\"width: 350px;\">arrives 20th August, leaves 19th October</td></tr>"
//      htmlstring+="\n  <tr><td class=\"person\">G Glitter, Vietnam</td><td style=\"width: 350px;\"><strike>arrives 20th August, indefinitely </strike></td></tr>"
//      htmlstring+="\n  <tr><td></td><td style=\"text-align: right;\"><SPAN class=\"cancelled\">Cancelled&nbsp&nbsp&nbsp</SPAN></td></tr>"
//      htmlstring+="\n  <tr><td>&nbsp</td></tr><tr><td>&nbsp</td></tr>"
      
//      htmlstring+="\n  <tr></tr><tr><td style=\"width: 200px;\"><h3>FEBRUARY 2009</h3></td></tr>"       
//      htmlstring+="\n  <tr><td class=\"person\">Dennis, Tom, Popeye(Colin) </td><td style=\"width: 350px;\">arrive 1st Feb, depart late February</td></tr>"
//      htmlstring+="\n  <tr><td class=\"person\">Jonny G/Self (Boxey)</td><td style=\"width: 350px;\">arrives 11th February, departs 24th March</td></tr>"
//      htmlstring+="\n  <tr><td class=\"person\">James (taxi), Brighton </td><td style=\"width: 350px;\">here all month</td></tr>"
//      htmlstring+="\n  <tr><td class=\"person\">Ollie Boag</td><td style=\"width: 350px;\">departs 15th February</td></tr>"
//      htmlstring+="\n  <tr><td class=\"person\">Craig, Cheltenham</td><td style=\"width: 350px;\">arrives late February, departs April: (dates tbc) </td></tr>"
//      htmlstring+="\n  <tr><td>&nbsp</td></tr><tr><td>&nbsp</td></tr>"      

//      htmlstring+="\n  <tr></tr><tr><td style=\"width: 200px;\"><h3>APRIL 2009</h3></td></tr>"       
//      htmlstring+="\n  <tr><td class=\"person\">Andy, Nick and wedding party, Northants</td><td style=\"width: 350px;\">arrive 9th April for 3 weeks</td></tr>"
//      htmlstring+="\n  <tr><td class=\"person\">Jane & Hiren, North London</td><td style=\"width: 350px;\">arrive 10th April, depart 26th April</td></tr>"
//      htmlstring+="\n  <tr><td class=\"person\">Danish Jan</td><td style=\"width: 350px;\">arrives Mid April for his wedding on the 24th</td></tr>"
//      htmlstring+="\n  <tr><td class=\"person\"></td><td style=\"width: 350px;\">expected guests - Gavin, Ollie, Lee, Reggie: (dates tbc)</td></tr>"
//      htmlstring+="\n  <tr><td class=\"person\">Clive, Derby</td><td style=\"width: 350px;\">arrives 11th April, departs 1st May</td></tr>"
//      htmlstring+="\n  <tr><td class=\"person\">Lee, Charlton</td><td style=\"width: 350px;\">arrives 20th April, departs 1st May</td></tr>"
//      htmlstring+="\n  <tr><td class=\"person\">Simon, Bromley</td><td style=\"width: 350px;\">arrives 27th April</td></tr>"
//      htmlstring+="\n  <tr><td class=\"person\">Craig, Cheltenham</td><td style=\"width: 350px;\">departs: (dates tbc)</td></tr>"
//      htmlstring+="\n  <tr><td>&nbsp</td></tr><tr><td>&nbsp</td></tr>"
      
//      htmlstring+="\n  <tr></tr><tr><td style=\"width: 200px;\"><h3>JUNE 2009</h3></td></tr>"
//      htmlstring+="\n  <tr><td class=\"person\">Reggie & Niki</td><td style=\"width: 350px;\">arrive 29th June, depart 18th July</td></tr>"
//      htmlstring+="\n  <tr><td></td><td style=\"text-align: left;\"><SPAN class=\"cancelled\">(Lurv Cancelled)&nbsp&nbsp&nbsp</SPAN></td></tr>"
//      htmlstring+="\n  <tr><td>&nbsp</td></tr><tr><td>&nbsp</td></tr>"

//      htmlstring+="\n  <tr></tr><tr><td style=\"width: 200px;\"><h3>SEPTEMBER 2009</h3></td></tr>"       
//      htmlstring+="\n  <tr><td class=\"person\">Fred & Jan</td><td style=\"width: 350px;\">arrive 7th September, depart 17th September</td></tr>"
//      htmlstring+="\n  <tr><td class=\"person\">Jonny the Swede</td><td style=\"width: 350px;\">arrives 2nd September, departs 22nd Sepetmber</td></tr>"
//      htmlstring+="\n  <tr><td>&nbsp</td></tr><tr><td>&nbsp</td></tr>"

//      htmlstring+="\n  <tr></tr><tr><td style=\"width: 200px;\"><h3>OCTOBER 2009</h3></td></tr>"    
//      htmlstring+="\n  <tr><td class=\"person\">Jan (Denmark)</td><td style=\"width: 350px;\">arrives 10th October, for 4 weeks</td></tr>"   
//      htmlstring+="\n  <tr><td class=\"person\">Gavin , St Albans & Adam, Sheffield</td><td style=\"width: 350px;\">arrive 11th October, depart 31st October</td></tr>"   
//      htmlstring+="\n  <tr><td class=\"person\">Andy, Nid & Nick</td><td style=\"width: 350px;\">arrive 14th October, depart 26th October</td></tr>"
//      htmlstring+="\n  <tr><td class=\"person\">Clive, Derby</td><td style=\"width: 350px;\">arrives 16th October, departs 30th October</td></tr>"
//      htmlstring+="\n  <tr><td class=\"person\">Chris 'The Book', Putney</td><td style=\"width: 350px;\">arrives 24th October, departs 11th November</td></tr>"
//      htmlstring+="\n  <tr><td style=\"width: 380px;\"><SPAN class=\"cancelled\">DAVE WILL BE RETURNING TO THE UK TO VISIT FAMILY. BLACK JACK WILL BE OPEN AS USUAL AND IN THE CAPABLE HANDS OF THE MISSUS , PORN</SPAN></td><td class=\"cancelled\" style=\"width: 350px;\">1st - 9th October</td></tr>"
//      htmlstring+="\n  <tr><td>&nbsp</td></tr><tr><td>&nbsp</td></tr>"

//      htmlstring+="\n  <tr></tr><tr><td style=\"width: 200px;\"><h3>NOVEMBER 2009</h3></td></tr>"       
//      htmlstring+="\n  <tr><td class=\"person\">Chris 'The Book', Putney</td><td style=\"width: 350px;\">departs 11th November</td></tr>"
//      htmlstring+="\n  <tr><td class=\"person\">Simon 'The Blue' & pals , Manchester</td><td style=\"width: 350px;\">arrive 17th November, depart 2nd December</td></tr>"
//      htmlstring+="\n  <tr><td class=\"person\">Shammy, Rob & Jeff</td><td style=\"width: 350px;\">arrive 12th November, depart 23rd November</td></tr>"
//      htmlstring+="\n  <tr><td style=\"width: 380px;\"><SPAN class=\"cancelled\">DAVE's BIRTHDAY , PARTY NIGHT , ALL WELCOME</SPAN></td><td class=\"cancelled\" style=\"width: 350px;\">22nd November</td></tr>"
//      htmlstring+="\n  <tr><td>&nbsp</td></tr><tr><td>&nbsp</td></tr>"

//      htmlstring+="\n  <tr></tr><tr><td style=\"width: 200px;\"><h3>DECEMBER 2009</h3></td></tr>"       
//      htmlstring+="\n  <tr><td class=\"person\">Simon 'The Blue' & pals , Manchester</td><td style=\"width: 350px;\">depart 2nd December</td></tr>"
//      htmlstring+="\n  <tr><td class=\"person\">Tony Soundshack & Nan</td><td style=\"width: 350px;\">arrive 17th December for 4 weeks</td></tr>"
//      htmlstring+="\n  <tr><td class=\"person\">Big Rory , Tottenham Yiddo</td><td style=\"width: 350px;\">arrives 25th December, departs 10th January</td></tr>"
//      htmlstring+="\n  <tr><td>&nbsp</td></tr><tr><td>&nbsp</td></tr>"  
 
//      htmlstring+="\n  <tr></tr><tr><td style=\"width: 200px;\"><h3>JANUARY 2010</h3></td></tr>"       
//      htmlstring+="\n  <tr><td class=\"person\">Dave Wheeler, Hayes</td><td style=\"width: 350px;\">arrives 10th January, for 10 days</td></tr>"
//      htmlstring+="\n  <tr><td class=\"person\">Darren, Herts</td><td style=\"width: 350px;\">arrives 14th January, for 8 days</td></tr>"
//      htmlstring+="\n  <tr><td class=\"person\">Jonathan &quot;BOXIE&quot; Goodwin-Self, Saffron Walden</td><td style=\"width: 350px;\">arrives 16th January, for 8 weeks</td></tr>"
//      htmlstring+="\n  <tr><td class=\"person\">Dan, Hong Kong</td><td style=\"width: 350px;\">arrives 25th January, for 6 weeks</td></tr>"
//      htmlstring+="\n  <tr><td>&nbsp</td></tr><tr><td>&nbsp</td></tr>" 
 
      htmlstring+="\n  <tr></tr><tr><td style=\"width: 200px;\"><h3>FEBRUARY 2010</h3></td></tr>"       
      htmlstring+="\n  <tr><td class=\"person\">Jonathan &quot;BOXIE&quot; Goodwin-Self, Saffron Walden</td><td style=\"width: 350px;\">here all month</td></tr>"
      htmlstring+="\n  <tr><td class=\"person\">Dan, Hong Kong</td><td style=\"width: 350px;\">here all month</td></tr>"
      htmlstring+="\n  <tr><td class=\"person\">Simon, Bromley</td><td style=\"width: 350px;\">arrives 1st February, for 4 weeks</td></tr>"
      htmlstring+="\n  <tr><td class=\"person\">Craig, Cheltenham</td><td style=\"width: 350px;\">arrives 5th February, for 10 weeks</td></tr>"
      htmlstring+="\n  <tr><td class=\"person\">Janine , Chester</td><td style=\"width: 350px;\">arrives 9th February, departs 16th February</td></tr>"
      htmlstring+="\n  <tr><td class=\"person\">Dennis, Tom & PopEye, Utd Nations</td><td style=\"width: 350px;\">arrive 10th February, depart end of the month</td></tr>"
      htmlstring+="\n  <tr><td class=\"person\">Stevie 'no-sleeves', Bradford</td><td style=\"width: 350px;\">arrives mid-February for 2 weeks</td></tr>"
      htmlstring+="\n  <tr><td>&nbsp</td></tr><tr><td>&nbsp</td></tr>"      

      htmlstring+="\n  <tr></tr><tr><td style=\"width: 200px;\"><h3>MARCH 2010</h3></td></tr>"
      htmlstring+="\n  <tr><td class=\"person\">Jonathan &quot;BOXIE&quot; Goodwin-Self, Saffron Walden</td><td style=\"width: 350px;\">departs 16th March</td></tr>"
      htmlstring+="\n  <tr><td class=\"person\">Eddie, Leeds</td><td style=\"width: 350px;\">arrives 2nd March, for 2 weeks</td></tr>"
      htmlstring+="\n  <tr><td class=\"person\">James, Brighton</td><td style=\"width: 350px;\">arrives 7th March, for 8 weeks</td></tr>"
      htmlstring+="\n  <tr><td class=\"person\">Jonny the Swede</td><td style=\"width: 350px;\">arrives 25th March, departs April 19th</td></tr>"
      htmlstring+="\n  <tr><td>&nbsp</td></tr><tr><td>&nbsp</td></tr>"
      
      htmlstring+="\n  <tr></tr><tr><td style=\"width: 200px;\"><h3>APRIL 2010</h3></td></tr>"
      htmlstring+="\n  <tr><td class=\"person\">Gavin , St Albans</td><td style=\"width: 350px;\">arrives 17th April, departs 2nd May; tbc</td></tr>"   
      htmlstring+="\n  <tr><td class=\"person\">Chris 'The Book', Putney</td><td style=\"width: 350px;\">arrives 3rd April, departs 23rd April</td></tr>"
      htmlstring+="\n  <tr><td class=\"person\">Andy & Nid</td><td style=\"width: 350px;\">arrive 11th April, depart 3rd May</td></tr>"
      htmlstring+="\n  <tr><td class=\"person\">Jonny the Swede</td><td style=\"width: 350px;\">departs April 19th</td></tr>"
      htmlstring+="\n  <tr><td class=\"person\">Clive, Derby</td><td style=\"width: 350px;\">tbc</td></tr>"
      htmlstring+="\n  <tr><td class=\"person\">James, Brighton</td><td style=\"width: 350px;\">here all month</td></tr>"
      htmlstring+="\n  <tr><td>&nbsp</td></tr><tr><td>&nbsp</td></tr>"
      
      htmlstring+="\n  <tr></tr><tr><td style=\"width: 200px;\"><h3>MAY 2010</h3></td></tr>"
      htmlstring+="\n  <tr><td class=\"person\">Andy & Nid</td><td style=\"width: 350px;\">depart 3rd May</td></tr>"
      htmlstring+="\n  <tr><td class=\"person\">Jane & Hiren, North London</td><td style=\"width: 350px;\">arrive 22nd May, for 2 weeks</td></tr>"
      htmlstring+="\n  <tr><td class=\"person\">Jerry & Tracy, Nick & Co., Herts</td><td style=\"width: 350px;\">tbc , 3 weeks in May</td></tr>"
      htmlstring+="\n  <tr><td>&nbsp</td></tr><tr><td>&nbsp</td></tr>"
      
      htmlstring+="\n  <tr></tr><tr><td style=\"width: 200px;\"><h3>JUNE 2010</h3></td></tr>"
      htmlstring+="\n  <tr><td class=\"person\">Lee & chaps, Charlton</td><td style=\"width: 350px;\">arrive 2nd June, for 7 days</td></tr>"
      htmlstring+="\n  <tr><td class=\"person\">Shammy, Rob & Geoff</td><td style=\"width: 350px;\">arrive 15th June, for 2 weeks</td></tr>"
      htmlstring+="\n  <tr><td class=\"person\">Chris , Rich & Dan, Essex</td><td style=\"width: 350px;\">arrive 10th June for 4 weekss</td></tr>"
      htmlstring+="\n  <tr><td>&nbsp</td></tr><tr><td>&nbsp</td></tr>"
             
      htmlstring+="\n  </tbody>"
      htmlstring+="\n  </table>"
      htmlstring+="\n</div>"
      htmlstring+="\n</div>"
   }
   
   if (pagename == "Picture") {

      Gallery= "Gallery"
      subdir = "Gallery" + year(page) + "\/" + subInfo[page][subpage][1] + "\/"
      htmlstring+="<div class=\"transbox\">"
      htmlstring+="<div style=\"border-style: inset;\">"
      htmlstring+="<div id=\"pic\">"
      htmlstring+="<IMG SRC=\"pictures/" + subdir + NextImg + "\" left=\"10\" WIDTH=\"570\" HEIGHT=\"425\" NAME=\"Picture "+CurrPicNum+"\" ALT=\"Picture "+CurrPicNum+"\">"
      htmlstring+="</div>"
      htmlstring+="</div>"
      htmlstring+="</div>"      
      htmlstring+="<br>"
      htmlstring+="<a href=\"#\" " + prevstate + " onClick=\"javascript:displayPic(" + page + "," + subpage +  ",1)\"><img src=\"buttons/Firstn.gif\" name=\"First\" alt=\"First Picture\" border=\"0\" hspace=\"6\" height=\"30\" width=\"90\"></a>"
      htmlstring+="<a href=\"#\" " + prevstate + " onClick=\"javascript:displayPic(" + page + "," + subpage +  "," + i + ")\"><img src=\"buttons/Prevn.gif\" name=\"Prev\" alt=\"Previous Picture\" border=\"0\" hspace=\"6\" height=\"30\" width=\"90\"></a>"
      htmlstring+="<a href=\"#\" onClick=\"javascript:bigPic(" + page + "," + subpage +  "," + CurrPicNum + ")\"><img src=\"buttons/Viewn.gif\" name=\"View\" alt=\"View Picture\" border=\"0\" hspace=\"6\" height=\"30\" width=\"90\"></a>"
      htmlstring+="<a href=\"#\" onClick=\"javascript:changepage(\'Gallery\'," + page + "," + subpage + ")\"><img src=\"buttons/Galleryn.gif\" name=\"Gallery\" alt=\"Back to the Gallery\" border=\"0\" hspace=\"6\" height=\"30\" width=\"90\"></a>"
      htmlstring+="<a href=\"#\" " + nextstate + " onClick=\"javascript:displayPic(" + page + "," + subpage +  "," + k + ")\"><img src=\"buttons/Nextn.gif\" name=\"Next\" alt=\"Next Picture\" border=\"0\" hspace=\"6\" height=\"30\" width=\"90\"></a>"
      htmlstring+="<a href=\"#\" " + nextstate + " onClick=\"javascript:displayPic(" + page + "," + subpage +  "," + imgCt + ")\"><img src=\"buttons/Lastn.gif\" name=\"Last\" alt=\"Last Picture\" border=\"0\" hspace=\"6\" height=\"30\" width=\"90\"></a>"
   }

//   DebugWin.document.write(htmlstring)
//   DebugWin.document.close()
}  

function seasonalGreeting() {
   
// alert(currday + "       " +currmonth)
   if (currmonth==12 && currday>=18 && currday<=30){
      htmlstring+="<a href=\"#\"><IMG SRC=\"images/santa.gif\"    width=100 HEIGHT=100 border=0 ALT=\"santa.gif\"></a>"            
        htmlstring+="<a href=\"#\"><IMG SRC=\"images/merryXmas.gif\"    width=400 HEIGHT=80 border=0 ALT=\"merryXmas.gif\"></a> "          
        htmlstring+="<a href=\"#\"><IMG SRC=\"images/snowman.gif\" width=100 HEIGHT=100 border=0 ALT=\"snowman.gif\"></a>"    
        htmlstring+="<BR>"
   }
   if ((currmonth==12 && currday==31) || (currmonth==1 && currday<=3)){   
      htmlstring+="<a href=\"#\"><IMG SRC=\"images/glasses.gif\"        WIDTH=100 HEIGHT=100 border=0 ALT=\"glasses.gif\"></a>"
      htmlstring+="<a href=\"#\"><IMG SRC=\"images/NewYear.gif\"     WIDTH=400 HEIGHT=80 border=0  ALT=\"NewYear.gif\"></a>"       
        htmlstring+="<a href=\"#\"><IMG SRC=\"images/champagneballoons.gif\"  WIDTH=100 HEIGHT=100 border=0 ALT=\"champagneballoons.gif\"></a>"
      htmlstring+="<BR>"      
   }
   if ((currmonth==2 && currday==14)){   
        htmlstring+="<a href=\"#\"><IMG SRC=\"images/valentineheart2.gif\"    WIDTH=100 HEIGHT=100 border=0 ALT=\"valentineheart2.gif\"></a>"
      htmlstring+="<a href=\"#\"><IMG SRC=\"images/valdayban.gif\"      WIDTH=400 HEIGHT=80 border=0  ALT=\"valdayban.gif\"></a>"       
      htmlstring+="<a href=\"#\"><IMG SRC=\"images/man-in-love.gif\"          WIDTH=100 HEIGHT=100 border=0 ALT=\"man-in-love.gif\"></a>"
      htmlstring+="<BR>"      
   }
   if ((currmonth==3 && (currday==6 || (currday==7 && ampm=="am")))){   
      htmlstring+="<a href=\"#\"><IMG SRC=\"images/glasses.gif\"        WIDTH=100 HEIGHT=100 border=0 ALT=\"glasses.gif\"></a>"
      htmlstring+="<a href=\"#\"><IMG SRC=\"images/Boxie.jpg\"       WIDTH=400 HEIGHT=80 border=0  ALT=\"Old Git\"></a>"       
        htmlstring+="<a href=\"#\"><IMG SRC=\"images/champagneballoons.gif\"  WIDTH=100 HEIGHT=100 border=0 ALT=\"champagneballoons.gif\"></a>"
      htmlstring+="<BR>"      
   }
   if ((currmonth==4 && currday>=12 && currday<=15)){   
      htmlstring+="<a href=\"#\"><IMG SRC=\"images/songkran1.jpg\"      WIDTH=600 HEIGHT=100 border=0    ALT=\"Happy Songkran (Thai New Year)\"></a>"
//       htmlstring+="<a href=\"#\"><IMG SRC=\"images/songkran2.jpg\"      WIDTH=600 HEIGHT=100 border=0    ALT=\"Happy new Year\"></a>"       

   }
}

function displayThumbs(page,subpage) {
    var clickproc = ""
    if (browser==netscape)
       clickproc = "bigPic"
   else
     clickproc = "displayPic"
   subdir = "Gallery" + year(page) + "\/" + subInfo[page][subpage][1] + "\/"
   for (k=1;k<=imgCt;k++) {
      htmlstring+="<a href=\"#\"><img align=\"center\" onClick=\""+clickproc+"(" + page + "," + subpage +  "," + k + ")\" src=\"thumbnails/"+subdir+pic[k].toLowerCase()+"\" width=\"155\" height=\"115\" title=\""+k+"\" border=\"0\"></a>"
   }
}

function displayVideoThumbs(page) {
   var clickproc = ""
   if (browser==netscape)
      clickproc = "bigPic"
  else
     clickproc = "displayPic"
      
   vid[0] = "clip01"
   vid[1] = "clip02"
   for (k=0;k<=vid.length-1;k++) {
      htmlstring+="<a href=\"media/"+vid[k]+".wmv\"><img align=\"center\" src=\"thumbnails/Gallery"+year(page)+"/"+vid[k]+".jpg\" width=\"155\" height=\"115\" title=\""+vid[k]+"\" border=\"5\"></a>"
   }
}

function bigPic(page,subpage,j) {
   if (browser==netscape)
      picture = "pictures/Gallery" + year(page) + "\/" + subInfo[page][subpage][1] + "\/" + + year(page) + "_" + subInfo[page][subpage][1] + "_"+ ImgChar(j) + '.JPG'
   else
      picture = "pictures/Gallery" + year(page) + "\/" + subInfo[page][subpage][1] + "\/" + pic[j]
   picWindow = window.open(picture,"PicWin", "width=900,height=675,left=10,scrollbars=auto") 
   picWindow.focus()
}

function displayPic(page,subpage,j) {
            
   i=j-1
   k=j+1
   CurrPicNum=j
   NextImg=pic[j]
   prevstate =''
   nextstate =''
   
   if (j < 1 || j > imgCt){
      return   
   }
         
   if (j <= 1) {
      prevstate ='disabled'
   }  
   if (j >= imgCt) {
      nextstate ='disabled'
   }  
      
   buildpage('Picture',page,subpage)
}


function loadPics(page,subpage) {
   pic.splice(0,imgCt)           // empty array
   currElement = 1

   for ( i=1; i<=subInfo[page][subpage][2]; i++ ) {
      pic_name=page+2006+'_'+subInfo[page][subpage][1]+'_'+ImgChar(i)+'.JPG'
      pic[i] = pic_name
   }
   imgCt = pic.length - 1
}

function open_win(clip)
{
   popup_window = window.open(clip+".html","_blank","toolbar=yes, location=yes, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=no, copyhistory=yes, width=670, height=550");
}

function wbpr(im)
{  var i=new Image();
   i.src='buttons/img'+im;
   return i;
}

function wbe(id)
{  x=id.substring(0,id.length-1);
   document['btn'+x].src=eval('btn'+id+'.src');
}

function startTime()
{
   var today=new Date()
   var h=today.getUTCHours()
   today.setHours(h+7)
   var h=today.getHours()
   var m=today.getMinutes()
   var s=today.getSeconds()
   currday=today.getDate()
   currmonth=today.getMonth()+1
   m=checkTime(m)
   s=checkTime(s)
   if (h > 12) {
      ampm="pm"
      h=h-12
   } else {
      ampm="am"
   }
   document.getElementById('time').innerHTML="<h3>Time:</h3>\n&nbsp;&nbsp;"+h+":"+m+":"+s+" "+ampm
   t=setTimeout('startTime()',500)
}

function checkTime(i)
{
if (i<10) 
  {i="0" + i}
  return i
}

function ImgChar(i)
{
   if (i<100) {r="0" + i}  
   if (i<10)  {r="00" + i}
   return r
}

function year(page)
{
   return page+2006
}

//---------------------------------------------------------------
// SUB MENU scripts
//---------------------------------------------------------------


//*** SET SUB MENU POSITION ( RELATIVE TO BUTTON ) ***//
var xSubOffset = 150;
var ySubOffset = 0;



//*** NO MORE SETTINGS BEYOND THIS POINT ***//
var overSub = false;
var delay = 800;
totalButtons = subInfo.length-1;

// GENERATE SUB MENUS
for ( x=1; x<=totalButtons; x++) {
   // SET EMPTY DIV FOR BUTTONS WITHOUT SUBMENU
   if ( subInfo[x].length <= 1 ) { 
      document.write('<div id="submenu' + (x) + '">');
   // SET DIV FOR BUTTONS WITH SUBMENU
   } else {
   
      document.write('<div id="submenu' + (x) + '" class="dropmenu" ');
      document.write('onMouseOver="overSub=true;"');
      document.write('onMouseOut="overSub=false;');
      document.write('setTimeout(\'hideSubMenu(\\\'submenu' + (x) + '\\\')\',delay);');
      document.write('">');
      document.write('<ul>');
      for ( k=1; k<=subInfo[x].length-1; k++ ) {
//       alert('<a href=\"#\" onclick="changepage(\'Gallery\',' + x + ',' + k + ');" ');
         document.write('<li>');
         document.write('<a href=\"#\" onclick="changepage(\'Gallery\',' + x + ',' + k + ');" '); 
         document.write('target="">');
         document.write( subInfo[x][k][0] + ' </a>');
         document.write('</li>');
      }
      document.write('</ul>');
   }
   document.write('</div>');
}


//*** SUB MENU FUNCTIONS ***//
// GET ELEMENT ID MULTI BROWSER
function getElement(id) {
   return document.getElementById ? document.getElementById(id) : document.all ? document.all(id) : null; 
}

// GET X COORDINATE
function getRealLeft(id) { 
   var el = getElement(id);
   if (el) { 
      xPos = el.offsetLeft;
      tempEl = el.offsetParent;
      while (tempEl != null) {
         xPos += tempEl.offsetLeft;
         tempEl = tempEl.offsetParent;
      } 
      return xPos;
   }
   else {
      return 1
   } 
} 

// GET Y COORDINATE
function getRealTop(id) {
   var el = getElement(id);
   if (el) { 
      yPos = el.offsetTop;
      tempEl = el.offsetParent;
      while (tempEl != null) {
         yPos += tempEl.offsetTop;
         tempEl = tempEl.offsetParent;
      }
      return yPos;
   }
   else {
   	  return 400
   }
}

// MOVE OBJECT TO COORDINATE
function moveObjectTo(objectID,x,y) {
   //alert(objectID)
   var el = getElement(objectID);
   el.style.left = x;
   el.style.top = y;
}

// MOVE SUBMENU TO CORRESPONDING BUTTON
function showSubMenu(subID, buttonID) {
   hideAllSubMenus();
   butX = getRealLeft(buttonID);
   butY = getRealTop(buttonID);
   moveObjectTo(subID,butX+xSubOffset, butY+ySubOffset);
}

// HIDE ALL SUB MENUS
function hideAllSubMenus() {
   for ( x=0; x<totalButtons; x++) {
      moveObjectTo("submenu" + (x+1) + "",-500, -500 );
   }
}

// HIDE ONE SUB MENU
function hideSubMenu(subID) {
   if ( overSub == false ) {
      moveObjectTo(subID,-500, -500);
   }
}