function blinkIt() {
  if (!document.all) return;
  else {
    for(i=0;i<document.all.tags('blink').length;i++){
      s=document.all.tags('blink')[i];
      s.style.visibility=(s.style.visibility=='visible')?'hidden':'visible';
    }
  }
}

function loadXMLDoc(dname) {
  try { //Internet Explorer
    xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
  }
  catch(e) {
    try { //Firefox, Mozilla, Opera, etc.
      xmlDoc=document.implementation.createDocument("","",null);
    }
    catch(e) {
      //alert(e.message);
      return(null);
    }
  }

  try {
    xmlDoc.async=false;
    xmlDoc.load(dname);
    return(xmlDoc);
  }
  catch(e) {
    //alert(e.message);
    return(null);
  }
}

function txtperfTable(year) {
  var txt = "<table class='ptable' cellpadding='5' cellspacing='1' border='0'>";
  var x=xmlDoc.getElementsByTagName("GIG");
  for (var i=0;i<x.length;i++) {
    var myyear=x[i].getElementsByTagName("DATE")[0].getElementsByTagName("YEAR")[0].childNodes[0].nodeValue;
    if ( myyear == year ) {
      txt = txt + "<tr>";
      var y = x[i].getElementsByTagName("DATE")[0];

      txt = txt + "<td class='contentcell'>";
      txt = txt + "<p>" + y.getElementsByTagName("DAY")[0].childNodes[0].nodeValue + " ";
      txt = txt + y.getElementsByTagName("MONTH")[0].childNodes[0].nodeValue;
      txt = txt + "</td>";

      txt = txt + "<td class='contentcell'>";
      txt = txt + "<p>" + x[i].getElementsByTagName("EVENT")[0].childNodes[0].nodeValue;
      txt = txt + "</td>";

      txt = txt + "<td class='contentcell'>";
      txt = txt + "<p>" + x[i].getElementsByTagName("VENUE")[0].childNodes[0].nodeValue;
      txt = txt + "</td>";
      txt = txt + "</tr>";
    }
  }
  txt = txt + "</table>";
  return txt;
}

function txtperfRow(year) {
  var txt = "<tr>";
  txt = txt + "  <td>";
  txt = txt + "    <table class='ptable' cellpadding=10 cellspacing=0 border=0>";
  txt = txt + "      <tr>";
  txt = txt + "        <td>";
  txt = txt + "          <p class='subheading'>" + year + "</p>";
  txt = txt + "          <p>";
  txt = txt + "            <table class='ptable' border=0 bgcolor=#3366CC cellpadding=2 cellspacing=2>";
  txt = txt + "              <tr><td>";
  txt = txt + txtperfTable(year);
  txt = txt + "              </td> </tr>";
  txt = txt + "            </table>";
  txt = txt + "          </p>";
  txt = txt + "        </td>";
  txt = txt + "      </tr>";
  txt = txt + "    </table>";
  txt = txt + "  </td>";
  txt = txt + "</tr>";
  return txt;
}

function perfTable(year) {
  document.write("<table cellpadding='10' cellspacing='1' border='0'>");
  var x=xmlDoc.getElementsByTagName("GIG");
  for (var i=0;i<x.length;i++) {
    var myyear=x[i].getElementsByTagName("DATE")[0].getElementsByTagName("YEAR")[0].childNodes[0].nodeValue;
    if ( myyear == year ) {
      document.write("<tr>");
      var y=x[i].getElementsByTagName("DATE")[0];

      document.write("<td class='contentcell'>");
      document.write("<p>" + y.getElementsByTagName("DAY")[0].childNodes[0].nodeValue + " ");
      document.write(y.getElementsByTagName("MONTH")[0].childNodes[0].nodeValue);
      document.write("</td>");

      document.write("<td class='contentcell'>");
      document.write("<p>" + x[i].getElementsByTagName("EVENT")[0].childNodes[0].nodeValue);
      document.write("</td>");

      document.write("<td class='contentcell'>");
      document.write("<p>" + x[i].getElementsByTagName("VENUE")[0].childNodes[0].nodeValue);
      document.write("</td>");
      document.write("</tr>");
    }
  }
  document.write("</table>");
}

function perfRow(year) {
  document.write("<tr>");
  document.write("  <td>");
  document.write("    <table cellpadding='10' cellspacing='10' border='0'>");
  document.write("      <tr>");
  document.write("        <td valign='top' align='left'>");
  document.write("          <p class='subheading'>Past Performances - " + year + "</p>");
  document.write("          <p>");
  document.write("            <table bgcolor='#3366CC' cellpadding='10' cellspacing='10'>");
  document.write("              <tr><td>");
  perfTable(year);
  document.write("              </td> </tr>");
  document.write("            </table>");
  document.write("          </p>");
  document.write("        </td>");
  document.write("      </tr>");
  document.write("    </table>");
  document.write("  </td>");
  document.write("</tr>");
}

function switchMenu(obj) {
  var el = document.getElementById(obj);

  if ( el.style.display != "none" ) {
el.style.display = 'none';
  }
  else {
el.style.display = '';
  }
}

function showMe(year) {
  document.getElementById("show").innerHTML = txtperfRow(year);
}
function showPics() {
  document.getElementById("show").innerHTML = photoTable();
}
function photoTable() {
  document.write("<div id=show>");
  document.write("<table cellpadding=8 cellspacing=0 border=0>");
  document.write("  <tr>");
  document.write("    <td></td>");
  document.write("    <td>");
  document.write("      <p>");
  photoData();
  document.write("      </p>");
  document.write("    </td>");
  document.write("  </tr>");
  document.write("</table>");
//  document.write("</div>");


}
function photoData() {
//<div class="img">
//  <a target="_blank"><img src="/photos/performers/thumbs/davidh-02.jpg" alt="picture" width="105" height="70" /></a>
//  <div class="desc">David H</div>
//</div> <!-- img -->

  var x=xmlDoc.getElementsByTagName("PHOTO");
  var category;
  var pic;
  var caption;

  for (var i=0;i<x.length;i++) {
    category = x[i].getElementsByTagName("CATEGORY")[0].childNodes[0].nodeValue;
    pic = x[i].getElementsByTagName("NAME")[0].childNodes[0].nodeValue;
    caption = x[i].getElementsByTagName("CAPTION")[0].childNodes[0].nodeValue;

    document.write("<div class='img'>");
    document.write("  <a target='_new' href='/photos/" + category + "/" + pic + "'><img src='/photos/" + category + "/thumbs/" + pic + "' alt='Click to enlarge' width='100' height='150' /></a>");
    document.write("  <div class='desc'>" + caption + "</div>");
    document.write("</div>");
  }
}


function selectActive(id, pos) {
  if ( id == pos ) return 2;
  return 3;
}

function doSubMenu(activePos) {
  document.write("<div id='l1-1' class='pubmenulinks" + selectActive(1,activePos) + "'>");
  document.write(" <a class='pubmenulinks" + selectActive(1,activePos) + "' target='_top' href='/about.html'>Introduction</a> \|");
  document.write(" <a class='pubmenulinks" + selectActive(1,activePos) + "' target='_top' href='/performances.html'>Performances</a> \|");
  document.write(" <a class='pubmenulinks" + selectActive(1,activePos) + "' target='_top' href='/news.html'>News</a> \|");
  document.write(" <a class='pubmenulinks" + selectActive(1,activePos) + "' target='_top' href='/history.html'>History</a> \|");
  document.write(" <a class='pubmenulinks" + selectActive(1,activePos) + "' target='_top' href='/links.html'>Links</a>");
  document.write("</div>");

  document.write("<div id='l2-2' class='pubmenulinks" + selectActive(2,activePos) + "'>");
  document.write(" <a class='pubmenulinks" + selectActive(2,activePos) + "' target='_top' href='/performers.html'>Photos</a> \|");
  document.write(" <a class='pubmenulinks" + selectActive(2,activePos) + "' target='_top' href='/video.html'>Videos</a> \|");
  document.write(" <a class='pubmenulinks" + selectActive(2,activePos) + "' target='_top' href='/articles.html'>Articles</a> \|");
  document.write(" <a class='pubmenulinks" + selectActive(2,activePos) + "' target='_top' href='/credits.html'>Credits</a>");
  document.write("</div>");

  document.write("<div id='l3-3' class='pubmenulinks" + selectActive(3,activePos) + "'>");
/*
  document.write(" <a class='pubmenulinks" + selectActive(3,activePos) + "' target='_top' href='/workshops.html'>Workshops</a> \|");
  document.write(" <a class='pubmenulinks" + selectActive(3,activePos) + "' target='_top' href='/book.html'>Book Online</a>");
*/
  document.write("</div>");

  document.write("<div id='l4-4' class='pubmenulinks" + selectActive(4,activePos) + "'>");
  document.write(" <a class='pubmenulinks" + selectActive(4,activePos) + "' target='_top' href='/contact.html'>General Enquiries</a> \|");
  document.write(" <a class='pubmenulinks" + selectActive(4,activePos) + "' target='_top' href='/book.html'>Booking Info</a> \|");
  document.write(" <a class='pubmenulinks" + selectActive(4,activePos) + "' target='_top' href='/location.html'>Location</a>");
  document.write("</div>");
}

function doNewNav() {
  document.write("<ul id='sddm'>");
  document.write("<li><a href='/'>Home</a></li>");
  document.write("<li><a href='/about_waitaiko.html' onmouseover='mopen(\"m2\")' onmouseout='mclosetime()'>About Us</a>");
  document.write("<div id='m2' onmouseover='mcancelclosetime()' onmouseout='mclosetime()'>");
/*
  document.write("<a href='/about.html'>Introduction</a>");
  document.write("<a href='/history.html'>History</a>");
*/
  document.write("<a href='/about_waitaiko.html'>About Wai Taiko</a>");
  document.write("<a href='/about_what_is_taiko.html'>What is Taiko?</a>");
  document.write("<a href='/about_history_of_taiko.html'>History of Taiko</a>");
  document.write("<a href='/performances.html'>Performances</a>");
  document.write("<a href='/news2010.html'>News</a>");
  document.write("<a href='/links.html'>Links</a>");
  document.write("<a href='/credits.html'>Credits</a>");
  document.write("</div>");
  document.write("</li>");
  document.write("<li><a href='/media.html' onmouseover='mopen(\"m3\")' onmouseout='mclosetime()'>Media</a>");
  document.write("<div id='m3' onmouseover='mcancelclosetime()' onmouseout='mclosetime()'>");
  document.write("<a href='/media.html'>Photos</a>");
  document.write("<a href='/video.html'>Video</a>");
  document.write("<a href='/articles.html'>Newspaper Articles</a>");
  document.write("</div>");
  document.write("</li>");
  document.write("<li><a href='/workshops_info.html' onmouseover='mopen(\"m4\")' onmouseout='mclosetime()'>Workshops</a>");
  document.write("<div id='m4' onmouseover='mcancelclosetime()' onmouseout='mclosetime()'>");
  document.write("<a href='/workshops_info.html'>General Information</a>");
  document.write("<a href='/workshops_registration.html'>Registration</a>");
  document.write("<a href='/workshops_fliers.html'>Fliers</a>");
  document.write("</div>");
  document.write("</li>");
  document.write("<li><a href='/contact.html' onmouseover='mopen(\"m5\")' onmouseout='mclosetime()'>Contact Us</a>");
  document.write("<div id='m5' onmouseover='mcancelclosetime()' onmouseout='mclosetime()'>");
  document.write("<a href='/contact.html'>General Enquiries</a>");
  document.write("<a href='/book.html'>Booking Information</a>");
  document.write("<a href='/bs.php'>Booking Form</a>");
  document.write("<a href='/location.html'>Location</a>");
  document.write("</div>");
  document.write("</li>");
  document.write("</ul>");
  document.write("<div style='clear:both'></div>");
}

function doNav(activePos) {
  var nav = new Array();
  nav[0] = "/index.html";
  nav[1] = "/about.html";
  nav[2] = "/media.html";
  nav[3] = "/workshops.html";
  nav[4] = "/contact.html";

  document.write(" <div id='logoWrapper'> ");
  document.write(" <div id='logo'><a href='http://www.waitaiko.com/'><img src='/images/Logo.png' alt='Wai Taiko' title='Wai Taiko' width='155' height='45' /></a></div> ");
  document.write(" <div id='navWrapper'> ");
  document.write(" <div id='Table_01'> ");

  for (i=0; i < nav.length; i++) {
    j=i+1;
    if ( i == activePos ) {
      document.write(" <div id='navlinks" + i + "'><a target='_top'><img src='/images/menuSelected_0" + j + ".png' width='142' height='30' /></a></div> ");
    }
    else {
      document.write(" <div id='navlinks" + i + "'><a href='" + nav[i] + "' onmouseover=\"setVisible('l" + i + "-" + i + "');\" onfocus='if(this.blur)this.blur()' onmouseout=\"setVisible('l" + activePos + "-" + activePos + "');\"><img src='/images/menuUnselected_0" + j + ".png' width='142' height='30' id='Image" + j + "' onmouseover=\"MM_swapImage('Image" + j + "','','/images/menuMouse_0" + j + ".png',1)\" onmouseout='MM_swapImgRestore()' /></a></div> ");
    }
  }

  document.write(" </div> ");
  document.write(" </div> ");

  doSubMenu(activePos);

  document.write(" <div id='l0-0'></div> ");
  document.write(" </div> ");
}

function doFooter() {
  document.write("<div id='myFooter'>");
  document.write("  <p class='style5'>Copyright &#169;2009 Wai Taiko Drummers.  All rights reserved.</p>");
  document.write("</div>");
}

function doPerfList() {
  document.write("<div id='upcomingList'>");
  document.write("  <p class='style3'>Wai Taiko Concerts</p>");
  document.write("  <p class='style5'> <a href='12DaysXmas.html'>12 Days of Christmas</a></p>");
  document.write("  <p class='style5'> <a href='IGI.html'>Ichi Go Ichie</a></p>");
  document.write("  <p class='style5'> <a href='taiko_festival.html'>Taiko Festival</a></p>");
  document.write("  <p class='style5'> <a href='taste_of_japan.html'>A Taste of Japan</a></p>");
  document.write("</div> <!-- upcomingList -->");
}

function doEventList() {
  document.write("<div id='upcomingWrapper'>");
  document.write("<p class='style3'>Upcoming Events</p>");

  document.write("  <!-- <p class='style5'><a href='upcomingEvents.html#1'>11 April 2010: Buddha's Birthday</a></p> -->");
  document.write("  <!-- private <p class='style5'><a href='upcomingEvents.html#2'>7 May 2010: PCO evening</a></p> -->");
  document.write("  <!-- <p class='style5'><a href='upcomingEvents.html#1'>8 May 2010: Fair Trade week street performance</a></p> -->");
  document.write("  <!-- <p class='style5'><a href='upcomingEvents.html#2'>22 May 2010: Tirau Weekend of Workshops</a></p> -->");
  document.write("  <!-- <p class='style5'><a href='upcomingEvents.html#3'>5 Jun 2010: Trifle Bazaar Concert, Folk Dancing Festival</a></p> -->");
  document.write("  <!-- <p class='style5'><a href='upcomingEvents.html#4'>6 Jun 2010: Happy Haiku 10th Birthday Celebration</a></p> -->");
  document.write("  <!-- <p class='style5'><a href='upcomingEvents.html#5'>18 Jun 2010: Ignition - RhythmFest</a></p> -->");
  document.write("  <!-- <p class='style5'><a href='upcomingEvents.html#6'>10 Jul 2010: Wai Taiko 10th Anniversary Concert</a></p> -->");
  document.write("  <!-- <p class='style5'><a href='upcomingEvents.html#1'>14 Aug 2010: Miroku Natsumatsuri (Miroku Summer Festival)</a></p> -->");
  document.write("  <!-- <p class='style5'><a href='upcomingEvents.html#2'>17 Aug 2010: Kyoto Taiko Festival</a></p> -->");
  document.write("  <!-- <p class='style5'><a href='upcomingEvents.html#3'>25 Aug 2010: Megane Live'10</a></p> -->");
  document.write("  <!-- <p class='style5'><a href='upcomingEvents.html#1'>16 Sep 2010: Rugby: Waikato vs Southland</a></p> -->");
  document.write("  <!-- <p class='style5'><a href='upcomingEvents.html#1'>15 Oct 2010: Bonsai Conference</a></p> -->");
  document.write("  <!-- <p class='style5'><a href='upcomingEvents.html#2'>23 Oct 2010: Thames Battle of the Bands</a></p> -->");
  document.write("  <!-- <p class='style5'><a href='upcomingEvents.html#3'>28 Oct 2010: Hamilton Pink Walk for Breast Cancer</a></p> -->");
  document.write("  <!-- <p class='style5'><a href='upcomingEvents.html#4'>20 Nov 2010: Tauwhare Sculpture Park Exhibition Opening</a></p> -->");
  document.write("  <!-- <p class='style5'><a href='upcomingEvents.html#5'>25 Nov 2010: St. Andrews Middle School Cultural Week</a></p> -->");
  document.write("  <!-- <p class='style5'><a href='upcomingEvents.html#6'>8 Jan 2011: Waihi Summer Arts Festival</a></p> -->");
  document.write("  <!-- <p class='style5'><a href='upcomingEvents.html#7'>9 Jan 2011: Mural Town Twilight Concert</a></p> -->");
  document.write("  <!-- <p class='style5'><a href='upcomingEvents.html#8'>6 Mar 2011: Children's Day</a></p> -->");
  document.write("  <!-- <p class='style5'><a href='upcomingEvents.html#9'>13 Mar 2011: Japan Day</a></p> -->");

  document.write("  <!-- <p class='style5'><a href='upcomingEvents.html#10'>19 Mar 2011: Paeroa Wild Food, Wine & Art Festival</a></p> -->");
  document.write("  <!-- <p class='style5'><a href='upcomingEvents.html#11'>17 Apr 2011: Buddha's Day</a></p> -->");
  document.write("  <!-- <p class='style5'><a href='upcomingEvents.html#12'>30 Apr 2011: Showtime 2011</a></p> -->");
  document.write("  <!-- <p class='style5'><a href='upcomingEvents.html#13'>1 May 2011: Showtime 2011</a></p> -->");
  document.write("  <!-- <p class='style5'><a href='upcomingEvents.html#14'>1 May 2011: Cambridge Autumn Festival</a></p> -->");
  document.write("  <!-- <p class='style5'><a href='upcomingEvents.html#15'>27 May 2011: NZICA Annual Awards Evening</a></p> -->");
  document.write("  <!-- <p class='style5'><a href='upcomingEvents.html#16'>28 May 2011: Tauranga Boys College</a></p> -->");
  document.write("  <!-- <p class='style5'><a href='upcomingEvents.html#17'>7 Jul 2011: Communication Conference</a></p> -->");
  document.write("  <!-- <p class='style5'><a href='upcomingEvents.html#18'>9 Jul 2011: Hillcrest Park</a></p> -->");
  document.write("  <!-- <p class='style5'><a href='upcomingEvents.html#19'>23 Jul 2011: RWC</a></p> -->");
  document.write("  <!-- <p class='style5'><a href='upcomingEvents.html#20'>26 Jul 2011: APA 10yr Anniversary</a></p> -->");
  document.write("  <!-- <p class='style5'><a href='upcomingEvents.html#21'>28 Jul 2011: HCC dinner</a></p> -->");
  document.write("  <!-- <p class='style5'><a href='upcomingEvents.html#22'>13 Aug 2011: Morrinsville Arts Festival</a></p> -->");
  document.write("  <!-- <p class='style5'><a href='upcomingEvents.html#23'>11 Sep 2011: Gallagher Great Race</a></p> -->");
  document.write("  <!-- <p class='style5'><a href='upcomingEvents.html#24'>16 Sep 2011: RWC 2011</a></p> -->");
  document.write("  <!-- <p class='style5'><a href='upcomingEvents.html#24'>17 Sep 2011: Style Pasifika Showcase</a></p> -->");
  document.write("  <!-- <p class='style5'><a href='upcomingEvents.html#24'>24 Sep 2011: Greerton Cherry Blossom Festival</a></p> -->");
  document.write("  <!-- <p class='style5'><a href='upcomingEvents.html#25'>25 Sep 2011: Hamilton Fringe Festival - Matsuri</a></p> -->");
  document.write("  <!-- <p class='style5'><a href='upcomingEvents.html#25'>1 Oct 2011: Iris 21st</a></p> -->");
  document.write("  <!-- <p class='style5'><a href='upcomingEvents.html#26'>2 Oct 2011: Ethnic Soccer Festival</a></p> -->");
  document.write("  <!-- <p class='style5'><a href='upcomingEvents.html#27'>19 Oct 2011: Wallace Gallery 1st Birthday</a></p> -->");
  document.write("  <!-- <p class='style5'><a href='upcomingEvents.html#28'>22 Oct 2011: Thames Corporate Battle of the Bands</a></p> -->");
  document.write("  <!-- <p class='style5'><a href='upcomingEvents.html#28'>30 Oct 2011: Pink Walk</a></p> -->");
  document.write("  <!-- <p class='style5'><a href='upcomingEvents.html#30'>8 Nov 2011: St. Andrews Middle School Cultural Week</a></p> -->");
  document.write("  <!-- <p class='style5'><a href='upcomingEvents.html#30'>9 Nov 2011: Waikato Service Awards, The Base Hoyts</a></p> -->");
  document.write("  <!-- <p class='style5'><a href='upcomingEvents.html#27'>12 Nov 2011: Hukanui School Gala</a></p> -->");
  document.write("  <!-- <p class='style5'><a href='upcomingEvents.html#28'>13 Nov 2011: Round the Bridges</a></p> -->");
  document.write("  <!-- <p class='style5'><a href='upcomingEvents.html#30'>26 Nov 2011: Thames Wearable Arts Competition</a></p> -->");
  document.write("  <!-- <p class='style5'><a href='upcomingEvents.html#30'>19 Nov 2011: Summer Exhibition Opening</a></p> -->");
  document.write("  <!-- <p class='style5'><a href='upcomingEvents.html#31'>2 Jan 2012: Coromandel Keltic Fair</a></p> -->");
  document.write("  <p class='style5'><a href='upcomingEvents.html#32'>19 Feb 2012: Hamilton Gardens Arts Festival</a></p>");
  document.write("  <!-- <p class='style5'><a href='upcomingEvents.html#32'>25 Feb 2012: Pinnacle Conference</a></p> -->");
  document.write("  <p class='style5'><a href='upcomingEvents.html#32'>26 Feb 2012: Japan Day</a></p>");
  document.write("  <p class='style5'><a href='upcomingEvents.html#33'>3 Mar 2012: Taupo Ironman</a></p>");
  document.write("  <p class='style5'><a href='upcomingEvents.html#33'>24 Mar 2012: Raukawa Trust 25th Anniversary</a></p>");
  document.write("  <!-- <p class='style5'><a href='upcomingEvents.html#33'>25 Apr 2012: Arts Walton</a></p> -->");
  document.write("</div> <!-- upcomingWrapper -->");
}

function SetNewVideo2() {
  var form = document.forms[0];
  var ChosenVideo = getSelectedValue(form.elements.PodSelect);

  if (ChosenVideo == "Vid1") {
displayCode = '<iframe width="420" height="315" src="http://www.youtube.com/embed/SwPwNk5VKlk" frameborder="0" allowfullscreen></iframe>';
  }
  else if (ChosenVideo == "Vid2") {
displayCode = '<iframe width="420" height="315" src="http://www.youtube.com/embed/WlYiYddH7yM" frameborder="0" allowfullscreen></iframe>';
  }
  else if (ChosenVideo == "Vid3") {
displayCode = '<iframe width="420" height="315" src="http://www.youtube.com/embed/3hrkBbK5cWA" frameborder="0" allowfullscreen></iframe>';
  }
  else if (ChosenVideo == "Vid4") {
displayCode = '<iframe width="420" height="315" src="http://www.youtube.com/embed/S2Ge25TFZ4U" frameborder="0" allowfullscreen></iframe>';
  }
  else if (ChosenVideo == "Vid5") {
displayCode = '<iframe width="560" height="315" src="http://www.youtube.com/embed/sQyKccXktvM" frameborder="0" allowfullscreen></iframe>';
  }

  document.getElementById("videoWrapper").innerHTML=displayCode;
}

function getSelectedValue(flds) {
  var i = 0;
  var len = flds.length;

  while (i < len) {
    if (flds[i].checked) {
      return flds[i].value;
    }
    i++;
  }
  return "";
}


