/*
Tabs Menu (mouseover)- By Dynamic Drive
For full source code and more DHTML scripts, visit http://www.dynamicdrive.com
This credit MUST stay intact for use
*/

/*
Modified for use on ncplatin.org by Kavinda Wewegama
*/

// Links used to initiate the sub menus. Pass in the desired submenu index numbers (ie: 0, 1)
var submenu=new Array()

// Following code is based on a snippet from http://www.codingforums.com/archive/index.php?t-13594.html
/* Begin code */
// Split the string into part [0] and part [1]
var isMS = (navigator.appName == "Microsoft Internet Explorer")?1:0;
var temp=navigator.appVersion.split('MSIE');

// Parse the string for the "6" in 6.0
var ieVer=parseInt(temp[1]);

// Is it greater than 6?
var isIE7down=(ieVer <= 7)?1:0;
/* End code */

var current_page=window.location.href + ""
if ((isMS) && (isIE7down) && (current_page.charAt(current_page.length - 1) == '/'))
{
	current_page += "index.php";
}
else if (current_page[current_page.length - 1] == '/')
{
	current_page += "index.php";
}

// current_page="http://www.ncplatin.org/index.php"
//Set submenu contents. Expand as needed. For each content, make sure everything exists on ONE LINE. Otherwise, there will be JS errors.
 
submenu[0]='<a href="http://www.ncplatin.org/index.php">Updates</a><a href="http://www.ncplatin.org/news/">News Archive</a><a href="http://www.ncplatin.org/sitemap.php">Site Map</a><a href="http://www.ncplatin.org/calnews.php">Calendar</a><a href="http://www.ncplatin.org/gallery/">Photo Gallery</a>'
submenu[1]='<a href="http://www.ncplatin.org/class/index.php">Class Descriptions</a><a href="http://www.ncplatin.org/class/homework.php">Homework</a><a href="http://www.ncplatin.org/class/summerhw.php">Summer Assignments</a><a href="http://www.ncplatin.org/class/lhs.php">LHS</a><a href="http://www.ncplatin.org/class/tutoring/index.php">Tutoring</a>'
submenu[2]='<a href="http://www.ncplatin.org/club/constitution.php">Constitution</a><a href="http://www.ncplatin.org/club/current_officers.php">Current Officers</a><a href="http://www.ncplatin.org/club/past_officers/index.php">Past Officers</a><a href="http://www.ncplatin.org/club/minutes/index.php">Minutes</a><a href="http://www.ncplatin.org/club/sponsor.php">Sponsor</a><a href="http://www.ncplatin.org/club/bucephalus/index.php">Bucephalus</a><a href="http://www.ncplatin.org/work/club/IJCL/index.php">IJCL</a>'
submenu[3]='<a href="http://www.ncplatin.org/events/archive.php">Previous Years</a><a href="http://www.ncplatin.org/events/2002-03/index.php">2002-03</a><a href="http://www.ncplatin.org/events/2003-04/index.php">2003-04</a><a href="http://www.ncplatin.org/events/2004-05/index.php">2004-05</a><a href="http://www.ncplatin.org/events/2005-06/index.php">2005-06</a><a href="http://www.ncplatin.org/events/2006-07/index.php">2006-07</a><a href="http://www.ncplatin.org/aeolus/client/search.php">Search</a>'
submenu[4]='<a href="http://www.ncplatin.org/guides/study_guides/index.php">Study Guides</a><a href="http://www.ncplatin.org/guides/tips/index.php">Tips</a><a href="http://certamenwiki.ncplatin.org/" target="_new">CertamenWiki</a>'
submenu[5]='<a href="http://www.ncplatin.org/other/index.php#Contact">Contact</a><a href="http://www.ncplatin.org/other/index.php#Resources">Resources Links</a><a href="http://www.ncplatin.org/other/index.php#Competitions">Competition Links</a>'
submenu[6]='<a href="http://picasaweb.google.com/NCPHSLatinClub">Picasa Gallery</a>'
for (var i = 0; i < submenu.length; i++)
{
	if (!(submenu[i].indexOf(current_page) == -1))
	{
		//document.write(submenu[i].replace('<a href="' + current_page + '">', '<a style="text-decoration: underline;" href="' + current_page + '">moo'))
		submenu[i] = submenu[i].replace('<a href="' + current_page + '">', '<a style="text-decoration: underline;" href="' + window.location.href + '">')
	}
}

//Set delay before submenu disappears after mouse moves out of it (in milliseconds)
var delay_hide=500

/////No need to edit beyond here

var menuobj=document.getElementById? document.getElementById("SubmenuArea") : document.all? document.all.SubmenuArea : document.layers? document.dep1.document.dep2 : ""

function showit(which){
clear_delayhide()
thecontent=(which==-1)? "" : submenu[which]
if (document.getElementById||document.all)
menuobj.innerHTML=thecontent
else if (document.layers){
menuobj.document.write(thecontent)
menuobj.document.close()
}
}

function resetit(e){
if (document.all&&!menuobj.contains(e.toElement))
delayhide=setTimeout("showit(-1)",delay_hide)
else if (document.getElementById&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhide=setTimeout("showit(-1)",delay_hide)
}

function clear_delayhide(){
if (window.delayhide)
clearTimeout(delayhide)
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}