var contact //Contact details as shown below
contact = "<p align=center><table border=0 cellpadding=2 cellspacing=0 bgcolor=#990000><tr><td valign=top>"
contact += "<table border=0 cellpadding=4 cellspacing=0 bgcolor=#E7D6B5><tr><td valign=top>"
contact += "<p><span class=bb>Kokoro Ryu Centre</span><br>"
contact += "<span class=standard>3/210 Queen Street Campbelltown<br>NSW Australia 2560</p></td>"
contact += "<td align=right valign=top>"
contact += "<span class=bb>Tel: </span><span class=standard>(02) 4628 8628</span><br>"
contact += "<span class=bb>Mobile: </span><span class=standard>0417 414 249</span><br>"
contact += "<nobr><span class=bb>Email: </span><span class=standard><a class=a1 href=\"mailto:kokororyu@ozemail.com.au\">kokororyu@ozemail.com.au</a></span></nobr>"
contact += "</td></tr></table></td></tr></table></p>"

var menuover='#AAFFAA';
var menuoff='#EEEECC';

ns4 = (document.layers)? true:false
ie4 = (document.all)? true:false

function showObject(obj) {
	if (ns4) obj.visibility = "show"
	else if (ie4) obj.visibility = "visible"
}

function hideObject(obj) {
	if (ns4) obj.visibility = "hide"
	else if (ie4) obj.visibility = "hidden"
}

function layerWrite(id,nestref,text) {
	if (ns4) {
		var lyr = (nestref)? eval('document.'+nestref+'.document.'+id+'.document') : document.layers[id].document
		lyr.open()
		lyr.write(text)
		lyr.close()
	}
	else if (ie4) document.all[id].innerHTML = text
}


function menuWrite(sel) {

var x, txt

//Items in the navigation bar
var menulist = new Array()

menulist[1] = "Home"
menulist[2] = "About"
menulist[3] = "Dojo"
menulist[4] = "FAQ"
menulist[5] = "Photo Gallery"
menulist[6] = "Links"
menulist[7] = "Timetable"
menulist[8] = "Event Calendar"
menulist[9] = "News"
menulist[10] = "Enquiry Form"
menulist[11] = "Shop"
menulist[12] = "View Cart"
menulist[13] = "Check Out"
menulist[14] = "Our Sensei"
menulist[15] = "Video Gallery"

var numitems = menulist.length

//Descriptions of items in the navigation bar
var desc = new Array()

desc[1] = "KokoroRyu.com: The Home Page of Kokoro Ryu Martial Arts"
desc[2] = "KokoroRyu.com: About Kokoro Ryu Martial Arts"
desc[3] = "KokoroRyu.com: The Honbu Dojo (Training Centre)"
desc[4] = "KokoroRyu.com: Frequently Asked Questions"
desc[5] = "KokoroRyu.com: Photo Gallery"
desc[6] = "KokoroRyu.com: Links to Other Martial Arts Websites"
desc[7] = "KokoroRyu.com: Timetable"
desc[8] = "KokoroRyu.com: Message Board"
desc[9] = "KokoroRyu.com: Newsletter"
desc[10] = "KokoroRyu.com: Enquiry Form"
desc[11] = "KokoroRyu.com: Shop"
desc[12] = "KokoroRyu.com: View Shopping Cart"
desc[13] = "KokoroRyu.com: Check Out"
desc[14] = "KokoroRyu.com: About Our Sensei"
desc[15] = "KokoroRyu.com: Video Gallery"

//Files that the navigation bar points to
var menulistf = new Array()

/*
menulistf[1] = "http://www.kokororyu.com/index.html"
menulistf[2] = "http://www.kokororyu.com/about.php"
menulistf[3] = "http://www.kokororyu.com/dojo.html"
menulistf[4] = "http://www.kokororyu.com/faq.php"
menulistf[5] = "http://www.kokororyu.com/photo.html"
menulistf[6] = "http://www.kokororyu.com/links.php"
menulistf[7] = "http://www.kokororyu.com/timetable.html"
menulistf[8] = "http://www.kokororyu.com/messages.php"
menulistf[9] = "http://www.kokororyu.com/news.php"
menulistf[10] = "http://www.kokororyu.com/enquiry.html"
menulistf[11] = "http://www.kokororyu.com/shop.php"
//menulistf[11] = "https://www.hostingji.net/~kokoro/shop.php"
menulistf[12] = "https://www.hostingji.net/~kokoro/cart.php"
//menulistf[12] = "http://www.kokororyu.com/cart.php"
menulistf[13] = "https://www.hostingji.net/~kokoro/checkout.php"
menulistf[14] = "http://www.kokororyu.com/sensei.php"
//menulistf[15] = "http://www.kokororyu.com/video_gallery.php"
menulistf[15] = "http://www.kokororyu.com/video_gallery.php"
*/

// FOR LOCAL TESTING
menulistf[1] = "index.html"
menulistf[2] = "about.php"
menulistf[3] = "dojo.html"
menulistf[4] = "faq.php"
menulistf[5] = "photo.html"
menulistf[6] = "links.php"
menulistf[7] = "timetable.html"
menulistf[8] = "messages.php"
menulistf[9] = "news.php"
menulistf[10] = "enquiry.html"
menulistf[11] = "shop.php"
menulistf[12] = "cart.php"
menulistf[13] = "checkout.php"
menulistf[14] = "sensei.php"
menulistf[15] = "video_gallery.php"



txt = "<table cellpadding=0 cellspacing=0><tr><td class=bktbl>"
txt += "<table border=0 cellpadding=1 cellspacing=0 class=tbl><tr>"

for(x = 1; x < numitems; x++) {
  if(x == sel) {
    txt += "<td class=tblclicked><span class=clicked><nobr>" + menulist[x] + "\&nbsp; </span></nobr>"
  }
  else {
    txt += "<td><ilayer><layer onMouseover=\"this.bgColor=menuover;\" "
    txt += "onMouseout=\"this.bgColor=menuoff\"><a class=a1 href=\"" + menulistf[x] + "\" onMouseover=\"window.status=\'" + desc[x] + "\'; return true;\">"
    txt += "<span class=mnu><nobr>" + menulist[x] + "\&nbsp; </span></a></nobr></layer></ilayer>"
  }
  txt += "</td>"
  if (!(x % 5)) {
    txt += "</tr><tr>"
  }
}
txt += "</tr></table>"
txt += "</td></tr></table>"
document.write(txt)

} //end function

//The following function checks the form and updates the values in the shopping cart
function go_update(index) {
//   document.frmItem.update_id.value = index;
   document.frmItem.submit();
}

//The following function stops and re-starts the music on the pages
var toplay = 0
function ToggleMusic() {
  if(toplay) {
    document.frmMusic.audMain.play()
    document.frmMusic.btnToggle.value = "Stop Music"
    toplay = 0
  } else {
    document.frmMusic.audMain.stop()
    toplay = 1
    document.frmMusic.btnToggle.value = "Play Music"
  }
}

function play_tune(tune) {
  txt = "<div style=\"position:absolute; left:0; top:5;\">"
  txt += "<form name=frmMusic>"
  txt += "<NOEMBED>"
  txt += "<BGSOUND SRC=\"/music/"+tune+"\" LOOP=0>"
  txt += "</NOEMBED>"
  txt += "<EMBED SRC=\"/music/"+tune+"\" AUTOSTART=\"True\" HIDDEN=\"True\" LOOP=\"true\" name=audMain>"
  txt += "<input type=button value=\"Stop Music\" onclick=\"ToggleMusic()\" name=btnToggle>"
  txt += "</form>"
  txt += "</div>"
  document.write(txt)
}

//The following function displays the designer of the website
function credits() {
  txt = "<p class=contact align=center>Website By:<br><a class=a2 href=http://www.shopalot.com.au/>Shopalot.com.au</a>"
  document.write(txt)
}