﻿// JScript File
var scrollTim=1;
var current
id=window.location.href; re=/\w+\.aspx/i; rf=/\w+/i
id=re.exec(id); id=rf.exec(id)+"";
//window.location.replace("http://dsb.iniquus.com");

if ( (window.location.href.toLowerCase()=="http://dsb.iniquus.com/")||(window.location.href.toLowerCase()=="http://dsb.iniquus.com") )
{
    id="EnglishHome";
}
if(id=='null' || id=="")
{
	id="EnglishHome"
}

if(id=="EnglishHome")
{ /*If Home page*/
	menuArr = new Array()

    menuArr[1] = new Array()
    menuArr[1][0] = "165"
    menuArr[1][1] = new Array()
    menuArr[1][1][1] = "HISTORY"
    menuArr[1][1][2] = "English/History.aspx"
    menuArr[1][1][3] = "a11"
    menuArr[1][2] = new Array()
    menuArr[1][2][1] = 'LOCATION'
    menuArr[1][2][2] = 'English/AboutLocation.aspx'
    menuArr[1][2][3] = "a12"
    menuArr[1][3] = new Array()
    menuArr[1][3][1] = 'STAFF'
    menuArr[1][3][2] = 'English/AboutStaff.aspx'
    menuArr[1][3][3] = "a13"
    menuArr[1][4] = new Array()
    menuArr[1][4][1] = 'OUR COMMUNITY'
    menuArr[1][4][2] = 'English/OurCommunity.aspx'
    menuArr[1][4][3] = "a14"
    menuArr[1][5] = new Array()
    menuArr[1][5][1] = 'SCHOOL ACADEMIC CALENDAR'
    menuArr[1][5][2] = 'English/SchoolCalendar.aspx'
    menuArr[1][5][3] = "a15"
    menuArr[1][6] = new Array()
    menuArr[1][6][1] = 'EMPLOYMENT OPPORTUNITIES'
    menuArr[1][6][2] = 'English/Opportunities.aspx'
    menuArr[1][6][3] = "a16"

    menuArr[2] = new Array()
    menuArr[2][0] = "120"
    menuArr[2][1] = new Array()
    menuArr[2][1][1] = "OVERVIEW"
    menuArr[2][1][2] = "English/CurriculumOverview.aspx"
    menuArr[2][1][3] = "a21"
    menuArr[2][2] = new Array()
    menuArr[2][2][1] = "EARLY YEARS"
    menuArr[2][2][2] = "English/EarlyYears.aspx"
    menuArr[2][2][3] = "a22"
    menuArr[2][3] = new Array()
    menuArr[2][3][1] = "PRIMARY YEARS"
    menuArr[2][3][2] = "English/PrimaryYears.aspx"
    menuArr[2][3][3] = "a23"
    menuArr[2][4] = new Array()
    menuArr[2][4][1] = "SECONDARY SCHOOL"
    menuArr[2][4][2] = "English/SecondarySchool.aspx"
    menuArr[2][4][3] = "a24"
    menuArr[2][5] = new Array()
    menuArr[2][5][1] = "RESOURCES"
    menuArr[2][5][2] = "English/Resources.aspx"
    menuArr[2][5][3] = "a25"

    menuArr[3] = new Array()
    menuArr[3][0] = "120"
    menuArr[3][1] = new Array()
    menuArr[3][1][1] = "CLUBS"
    menuArr[3][1][2] = "English/Clubs.aspx"
    menuArr[3][1][3] = "a31"
    menuArr[3][2] = new Array()
    menuArr[3][2][1] = "FESTIVALS"
    menuArr[3][2][2] = 'English/Festivals.aspx'
    menuArr[3][2][3] = "a32"
    menuArr[3][3] = new Array()
    menuArr[3][3][1] = 'OUTINGS'
    menuArr[3][3][2] = 'English/Outings.aspx'
    menuArr[3][3][3] = "a33"
    menuArr[3][4] = new Array()
	menuArr[3][4][1] = 'DOMINOAKTION'
	menuArr[3][4][2] = 'English/Dominoaktion.aspx'
	menuArr[3][4][3] = "a34"
    menuArr[3][5] = new Array()
    menuArr[3][5][1] = 'VISITORS/OUTREACH'
    menuArr[3][5][2] = 'English/Visitors.aspx'
    menuArr[3][5][3] = "a35"
    

    menuArr[4] = new Array()
    menuArr[4][0] = "100"
    menuArr[4][1] = new Array()
    menuArr[4][1][1] = "OVERVIEW"
    menuArr[4][1][2] = "English/AdmissionOverview.aspx"
    menuArr[4][1][3] = "a41"
    menuArr[4][2] = new Array()
    menuArr[4][2][1] = "PROCESS"
    menuArr[4][2][2] = "English/AdmissionProcess.aspx"
    menuArr[4][2][3] = "a42"
    menuArr[4][3] = new Array()
    menuArr[4][3][1] = "FEE STRUCTURE"
    menuArr[4][3][2] = "English/FeeStructure.aspx"
    menuArr[4][3][3] = "a43"
    menuArr[4][4] = new Array()
    menuArr[4][4][1] = "FAQ"
    menuArr[4][4][2] = "English/AdmissionsFAQ.aspx"
    menuArr[4][4][3] = "a44"
}
else
{
	menuArr = new Array()
	menuArr[1] = new Array()
	menuArr[1][0] = "165"
	menuArr[1][1] = new Array()
	menuArr[1][1][1] = "HISTORY"
	menuArr[1][1][2] = "History.aspx"
	menuArr[1][1][3] = "a11"
	menuArr[1][2] = new Array()
	menuArr[1][2][1] = 'LOCATION'
	menuArr[1][2][2] = 'AboutLocation.aspx'
	menuArr[1][2][3] = "a12"
	menuArr[1][3] = new Array()
	menuArr[1][3][1] = 'STAFF'
	menuArr[1][3][2] = 'AboutStaff.aspx'
	menuArr[1][3][3] = "a13"
	menuArr[1][4] = new Array()
	menuArr[1][4][1] = 'OUR COMMUNITY'
	menuArr[1][4][2] = 'OurCommunity.aspx'
	menuArr[1][4][3] = "a14"
	menuArr[1][5] = new Array()
	menuArr[1][5][1] = 'SCHOOL ACADEMIC CALENDAR'
	menuArr[1][5][2] = 'SchoolCalendar.aspx'
	menuArr[1][5][3] = "a15"
	menuArr[1][6] = new Array()
	menuArr[1][6][1] = 'EMPLOYMENT OPPORTUNITIES'
	menuArr[1][6][2] = 'Opportunities.aspx'
	menuArr[1][6][3] = "a16"
	
	menuArr[2] = new Array()
	menuArr[2][0] = "120"
	menuArr[2][1] = new Array()
	menuArr[2][1][1] = "OVERVIEW"
	menuArr[2][1][2] = "CurriculumOverview.aspx"
	menuArr[2][1][3] = "a21"
	menuArr[2][2] = new Array()
	menuArr[2][2][1] = "EARLY YEARS"
	menuArr[2][2][2] = "EarlyYears.aspx"
	menuArr[2][2][3] = "a22"
	menuArr[2][3] = new Array()
	menuArr[2][3][1] = "PRIMARY YEARS"
	menuArr[2][3][2] = "PrimaryYears.aspx"
	menuArr[2][3][3] = "a23"
	menuArr[2][4] = new Array()
	menuArr[2][4][1] = "SECONDARY SCHOOL"
	menuArr[2][4][2] = "SecondarySchool.aspx"
	menuArr[2][4][3] = "a24"
	menuArr[2][5] = new Array()
	menuArr[2][5][1] = "RESOURCES"
	menuArr[2][5][2] = "Resources.aspx"
	menuArr[2][5][3] = "a25"
	
	menuArr[3] = new Array()
	menuArr[3][0] = "120"
	menuArr[3][1] = new Array()
	menuArr[3][1][1] = "CLUBS"
	menuArr[3][1][2] = "Clubs.aspx"
	menuArr[3][1][3] = "a31"
	menuArr[3][2] = new Array()
	menuArr[3][2][1] = "FESTIVALS"
	menuArr[3][2][2] = 'Festivals.aspx'
	menuArr[3][2][3] = "a32"
	menuArr[3][3] = new Array()
	menuArr[3][3][1] = 'OUTINGS'
	menuArr[3][3][2] = 'Outings.aspx'
	menuArr[3][3][3] = "a33"
	menuArr[3][4] = new Array()
	menuArr[3][4][1] = 'DOMINOAKTION'
	menuArr[3][4][2] = 'Dominoaktion.aspx'
	menuArr[3][4][3] = "a34"
	menuArr[3][5] = new Array()
	menuArr[3][5][1] = 'VISITORS/OUTREACH'
	menuArr[3][5][2] = 'Visitors.aspx'
	menuArr[3][5][3] = "a35"
	
	menuArr[4] = new Array()
	menuArr[4][0] = "100"
	menuArr[4][1] = new Array()
	menuArr[4][1][1] = "OVERVIEW"
	menuArr[4][1][2] = "AdmissionOverview.aspx"
	menuArr[4][1][3] = "a41"
	menuArr[4][2] = new Array()
	menuArr[4][2][1] = "PROCESS"
	menuArr[4][2][2] = "AdmissionProcess.aspx"
	menuArr[4][2][3] = "a42"
	menuArr[4][3] = new Array()
	menuArr[4][3][1] = "FEE STRUCTURE"
	menuArr[4][3][2] = "FeeStructure.aspx"
	menuArr[4][3][3] = "a43"
	menuArr[4][4] = new Array()
	menuArr[4][4][1] = "FAQ"
	menuArr[4][4][2] = "AdmissionsFAQ.aspx"
	menuArr[4][4][3] = "a44"
}
for(i=1;i<menuArr.length;i++)
{
	str = ''
	if(menuArr[i].length!=0)
	{
		
		str = str + '<div id="div'+i+'" width="' + menuArr[i][0] + '" style="display:block;position:absolute;z-index:9999; left: 0px; margin-top: 0px;visibility:hidden;" onmouseover="dontHideSlowly()">'
		str = str + '  <table class="menuBgColor" width="' + menuArr[i][0] + '" cellpadding=0 cellspacing=0 valign="center"> '
		for(j=1;j<menuArr[i].length;j++)
		{
			str = str + '     <tr> '
			str = str + '		<td class="menuTdBorder" style="display:block" valign="center"> <a href="'+menuArr[i][j][2]+'" style="display:block" valign="center" class="MenuTxtSmallBold" id="linkh'+i+''+j+'">'+menuArr[i][j][1]+'</a></td>'
			str = str + '    </tr>'
		}				
		str = str + '        </table>'
		str = str + '</div>'
		document.write(str)	
		var el = document.getElementById('div'+i);
		if (typeof el.contains == 'undefined' ||typeof el.contains == 'null')
		{
			el.contains = function(node)
			{
				if (null == node)
					return false;
				if (this == node)
					return true;
				else return this.contains(node.parentNode);
			}
		}
		el.onmouseout = handle_mouseout;
	}
	else
	{
	}
}
document.write('<iframe id="posFrame" src="blank.aspx" onmouseout="hide(current)" onmouseover="javascript:false;" scrolling="no" frameborder="0" style="position:absolute;z-index:0;margin-left:10px; visibility:hidden;"></iframe>')

function handle_mouseout(e)
{
	e = (e) ? e : window.event;
	if (!this.contains(e.relatedTarget || e.toElement))
		hideSlowly();
}
function show(subMenu, mainMenu)
{
	try
	{
		clearTimeout(scrollTim)
	}
	catch(error){}
	current=subMenu
	var p=fGetXY(mainMenu);   
	try
	{
		if(document.all)
		{
			document.getElementById(subMenu).style.left= p[0]-1; 
			var h=document.getElementById(subMenu).style.left= p[0]-1; 
			document.getElementById(subMenu).style.top = p[1]+27;
			document.getElementById(subMenu).style.visibility="visible"
		}
		else
		{
			document.getElementById(subMenu).style.left=p[0]+'px';
			document.getElementById(subMenu).style.top = p[1]+27+'px';
			document.getElementById(subMenu).style.visibility="visible"
		}
		
	}
	catch(error){}

}
function hide(subMenu)
{
	try
	{
		document.getElementById("posFrame").style.visibility="hidden"
		document.getElementById(subMenu).style.visibility="hidden"
		document.getElementById(subMenu).style.top=0
		document.getElementById(subMenu).style.left=0
	}
	catch(error){}
}
function hideSlowly()
{
	scrollTim = setTimeout("hideAll()", 200);
}
function dontHideSlowly()
{
	try
	{
		clearTimeout(scrollTim)
	}
	catch(error){}
}


function hideAll()
{
	document.getElementById("posFrame").style.visibility="hidden"
	for(i=1;i<=(4+1);i++)
	{
		try
		{
			document.getElementById("div"+i).style.visibility="hidden"
			document.getElementById("div"+i).style.top=0
			document.getElementById("div"+i).style.left=0
			//Now reset the flash sequence at home page also.
			resetFlash();
		}
		catch(error){}
	}
}

function fGetXY(aTag)
{
 var p=[0,0];
 while(aTag!=null)
 {
	  p[0]+=aTag.offsetLeft;
	  p[1]+=aTag.offsetTop;
	  aTag=aTag.offsetParent;
 }
 return p;
}
