// JavaScript Document
/*  
Script made by Martial Boissonneault © 2001-2003 http://getElementById.com/
This script may be used and changed freely as long as this msg is intact
Visit http://getElementById.com/ for more free scripts and tutorials.
Script featured at SimplytheBest.net http://simplythebest.net/scripts/
*/
// Courtesy of SimplytheBest.net - http://simplythebest.net/scripts/

function SwitchMenu(obj){
	if(document.getElementById){
	var el = document.getElementById(obj);
	var ar = document.getElementById("cont").getElementsByTagName("DIV");
		if(el.style.display == "none"){
			for (var i=0; i<ar.length; i++){
				ar[i].style.display = "none";
			}
			el.style.display = "block";
		}else{
			el.style.display = "none";
		}
	}
}
function ChangeClass(menu, newClass) { 
	 if (document.getElementById) { 
	 	document.getElementById(menu).className = newClass;
	 } 
} 
document.onselectstart = new Function("return true");

//Contents for menu 1
var menu1=new Array()
menu1[0]='<a href="http://www.nationalvisas.com.au/skilled/skilledvisas.htm">Skilled Visas</a><br>'
menu1[1]='<a href="http://www.nationalvisas.com.au/assess/index.php?assessment_type=skilled&assessment_version=2005-05-06">Skilled FREE Online Assessment</a><br>'
menu1[2]='<a href="http://www.nationalvisas.com.au/skilled/skilledvisarequirements.htm">Skilled Visa Requirements</a><br>'
menu1[3]='<a href="http://www.nationalvisas.com.au/skilled/pointstest.htm">Points Test</a><br>'
menu1[4]='<a href="http://www.nationalvisas.com.au/skilled/visaentitlements.htm">Visa Entitlements</a><br>'
menu1[5]='<a href="http://www.nationalvisas.com.au/skilled/visapplicationcosts.htm">Visa Application Costs</a><br>'
menu1[6]='<a href="http://www.nationalvisas.com.au/skilled/visaprocessingtime.htm">Visa Processing Time</a><br>'
menu1[7]='<a href="http://www.nationalvisas.com.au/skilled/eligibleskilledoccupations.htm">Eligible Skilled Occupations (SOL)</a><br>'
menu1[8]='<a href="http://www.nationalvisas.com.au/skilled/bonuspointoccupations.htm">Bonus Point Occupations (MODL)</a><br>'

//Contents for menu 2, and so on
var menu2=new Array()
menu2[0]='<a href="http://www.nationalvisas.com.au/business/businessvisas.htm">Business Visas</a><br>'
menu2[1]='<a href="http://www.nationalvisas.com.au/assess/index.php?assessment_type=business&assessment_version=0.1">Business FREE Online Assessment</a><br>'
menu2[2]='<a href="http://www.nationalvisas.com.au/business/visarequirementsbusinessowner.htm">Visa Requirements - Business Owner</a><br>'
menu2[3]='<a href="http://www.nationalvisas.com.au/business/visarequirementsseniorexecutive.htm">Visa Requirements - Senior Executive</a><br>'
menu2[4]='<a href="http://www.nationalvisas.com.au/business/visarequirementsinvestor.htm">Visa Requirements - Investor</a><br>'
menu2[6]='<a href="http://www.nationalvisas.com.au/business/visaentitlements.htm">Visa Entitlements</a><br>'
menu2[7]='<a href="http://www.nationalvisas.com.au/business/visapplicationcosts.htm">Visa Application Costs</a><br>'
menu2[8]='<a href="http://www.nationalvisas.com.au/business/visaprocessingtime.htm">Visa Processing Time</a><br>'

var menu3=new Array()
menu3[0]='<a href="http://www.nationalvisas.com.au/employer/employervisas.htm">Employer Sponsored Visas</a><br>'
menu3[1]='<a href="http://www.nationalvisas.com.au/assess/index.php?assessment_type=employersponsored&assessment_version=0.1">Employer Sponsored FREE Online Assessment</a><br>'
menu3[2]='<a href="http://www.nationalvisas.com.au/employer/visarequirements457.htm">Visa Requirements - 457</a><br>'
menu3[3]='<a href="http://www.nationalvisas.com.au/employer/visarequirementsens.htm">Visa Requirements - ENS</a><br>'
menu3[4]='<a href="http://www.nationalvisas.com.au/employer/visaentitlements.htm">Visa Entitlements</a><br>'
menu3[5]='<a href="http://www.nationalvisas.com.au/employer/visaapplicationcosts.htm">Visa Application Costs</a><br>'
menu3[6]='<a href="http://www.nationalvisas.com.au/employer/visaprocessingtime.htm">Visa Processing Time</a><br>'
menu3[7]='<a href="http://www.nationalvisas.com.au/employer/eligible457visaoccupations.htm">Eligible 457 Visa Occupations</a><br>'

var menu4=new Array()
menu4[0]='<a href="http://www.nationalvisas.com.au/student/studentvisas.htm">Student Visas</a><br>'
menu4[1]='<a href="http://www.nationalvisas.com.au/assess/index.php?assessment_type=student&assessment_version=0.1">Student FREE Online Assessment</a><br>'
menu4[2]='<a href="http://www.nationalvisas.com.au/student/visarequirements.htm">Visa Requirements</a><br>'
menu4[3]='<a href="http://www.nationalvisas.com.au/student/assessmentlevels.htm">Assessment Levels</a><br>'
menu4[4]='<a href="http://www.nationalvisas.com.au/student/visaentitlements.htm">Visa Entitlements</a><br>'
menu4[5]='<a href="http://www.nationalvisas.com.au/student/visaapplicationcosts.htm">Visa Application Costs</a><br>'
menu4[6]='<a href="http://www.nationalvisas.com.au/student/visaprocessingtime.htm">Visa Processing Time</a><br>'

var menu5=new Array()
menu5[0]='<a href="http://www.nationalvisas.com.au/partner/partnervisas.htm">Partner Visas</a><br>'
menu5[1]='<a href="http://www.nationalvisas.com.au/assess/index.php?assessment_type=partner&assessment_version=0.1">Partner FREE Online Assessment</a><br>'
menu5[2]='<a href="http://www.nationalvisas.com.au/partner/visarequirements-spousedefacto.htm">Visa Requirements - Spouse / De Facto</a><br>'
menu5[3]='<a href="http://www.nationalvisas.com.au/partner/visarequirements-interdependent.htm">Visa Requirements - Interdependant</a><br>'
menu5[4]='<a href="http://www.nationalvisas.com.au/partner/visarequirements-prospectivespouse.htm">Visa Requirements - Prospective Spouse (Fiancée)</a><br>'
menu5[5]='<a href="http://www.nationalvisas.com.au/partner/visaentitlements.htm">Visa Entitlements</a><br>'
menu5[6]='<a href="http://www.nationalvisas.com.au/partner/visaapplicationcosts.htm">Visa Application Costs</a><br>'
menu5[7]='<a href="http://www.nationalvisas.com.au/partner/visaprocessingtime.htm">Visa Processing Time</a><br>'

var menu6=new Array()
menu6[0]='<a href="http://www.nationalvisas.com.au/parent/parentvisas.htm">Parent Visas</a><br>'
menu6[1]='<a href="http://www.nationalvisas.com.au/assess/index.php?assessment_type=parent&assessment_version=0.1">Parent FREE Online Assessment</a><br>'
menu6[2]='<a href="http://www.nationalvisas.com.au/parent/visarequirementsworkingagedparent.htm">Visa Requirements - Parent</a><br>'
menu6[3]='<a href="http://www.nationalvisas.com.au/parent/visarequirementscontributoryparent.htm">Visa Requirements - Contributory Parent</a><br>'
menu6[4]='<a href="http://www.nationalvisas.com.au/parent/visarequirementsagedparent.htm">Visa Requirements - Aged Parent</a><br>'
menu6[6]='<a href="http://www.nationalvisas.com.au/parent/visaentitlements.htm">Visa Entitlements</a><br>'
menu6[7]='<a href="http://www.nationalvisas.com.au/parent/visaapplicationcosts.htm">Visa Application Costs</a><br>'
menu6[8]='<a href="http://www.nationalvisas.com.au/parent/visaprocessingtime.htm">Visa Processing Time</a><br>'

var menu7=new Array()
menu7[0]='<a href="http://www.nationalvisas.com.au/retirement/retirementvisas.htm">Retirement Visas</a><br>'
menu7[1]='<a href="http://www.nationalvisas.com.au/assess/index.php?assessment_type=retirement&assessment_version=0.1">Retirement FREE Online Assessment</a><br>'
menu7[2]='<a href="http://www.nationalvisas.com.au/retirement/visarequirements.htm">Visa Requirements</a><br>'
menu7[3]='<a href="http://www.nationalvisas.com.au/retirement/visaentitlements.htm">Visa Entitlements</a><br>'
menu7[4]='<a href="http://www.nationalvisas.com.au/retirement/visaapplicationcosts.htm">Visa Application Costs</a><br>'
menu7[5]='<a href="http://www.nationalvisas.com.au/retirement/visaprocessingtime.htm">Visa Processing Time</a><br>'

var menu8=new Array()
menu8[0]='<a href="http://www.nationalvisas.com.au/working/workingholidayvisas.htm">Working Holiday Visas</a><br>'
menu8[1]='<a href="http://www.nationalvisas.com.au/assess/index.php?assessment_type=workingholiday&assessment_version=0.1">Working Holiday FREE Online Assessment</a><br>'
menu8[2]='<a href="http://www.nationalvisas.com.au/working/visarequirements.htm">Visa Requirements</a><br>'
menu8[3]='<a href="http://www.nationalvisas.com.au/working/visaentitlements.htm">Visa Entitlements</a><br>'
menu8[4]='<a href="http://www.nationalvisas.com.au/working/visaapplicationcosts.htm">Visa Application Costs</a><br>'
menu8[5]='<a href="http://www.nationalvisas.com.au/working/visaprocessingtime.htm">Visa Processing Time</a><br>'

var menu9=new Array()
menu9[0]='<a href="http://www.nationalvisas.com.au/visitor/visitorvisas.htm">Visitor Visas</a><br>'
menu9[1]='<a href="http://www.nationalvisas.com.au/preassessment_on_visitor_visa.htm">Visitor FREE Online Assessment</a><br>'
menu9[2]='<a href="http://www.nationalvisas.com.au/visitor/visarequirements.htm">Visa Requirements</a><br>'
menu9[3]='<a href="http://www.nationalvisas.com.au/visitor/visaentitlements.htm">Visa Entitlements</a><br>'
menu9[4]='<a href="http://www.nationalvisas.com.au/visitor/visaapplicationcosts.htm">Visa Application Costs</a><br>'
menu9[5]='<a href="http://www.nationalvisas.com.au/visitor/visaprocessingtime.htm">Visa Processing Time</a><br>'

		
var menuwidth='165px' //default menu width
var menubgcolor='#5689A4'  //menu bgcolor
var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?

/////No further editing needed

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
{
	document.write(
		'<div id="dropmenudiv" style="position: absolute; visibility:hidden; background-color:'+menubgcolor+
		'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>'
	)
}

function getposOffset(what, offsettype)
{
	var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
	var parentEl=what.offsetParent;
	while (parentEl!=null)
	{
		totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
		parentEl=parentEl.offsetParent;
	}
	return totaloffset;
}

function showhide(obj, e, visible, hidden, menuwidth)
{
	//if (menuwidth!="") {
	//	dropmenuobj.widthobj=dropmenuobj.style
	//	dropmenuobj.widthobj.width=menuwidth
	//}
	
	if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
		obj.visibility=visible
	else if (e.type=="click")
		obj.visibility=hidden
}
/*
function iecompattest(){
	return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
	var edgeoffset=0
	if (whichedge=="rightedge") {
		var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
		dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
		if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
			edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
	}
	else{
		var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
		dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
		if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure)
			edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
	}
	return edgeoffset
}
*/

function populatemenu(what){
	if (ie4||ns6)
		dropmenuobj.innerHTML=what.join("")
}

function dropdownmenu(obj, e, menucontents, menuwidth){

	if (window.event)
		event.cancelBubble=true
	else if (e.stopPropagation)
		e.stopPropagation()

	clearhidemenu()

	dropmenuobj = document.getElementById ? document.getElementById("dropmenudiv") : document.all["dropmenudiv"]

	populatemenu(menucontents)

	if (ie4||ns6) {

		//dropmenuobj.x = getposOffset(obj, "left")
		//dropmenuobj.y = getposOffset(obj, "top")
		//dropmenuobj.style.left = dropmenuobj.x - clearbrowseredge(obj, "rightedge") + "px"
		//dropmenuobj.style.top = dropmenuobj.y - clearbrowseredge(obj, "bottomedge") + obj.offsetHeight + "px"

		dropmenuobj.style.left = getposOffset(obj, "left")+1
		dropmenuobj.style.top = getposOffset(obj, "top")+32
		dropmenuobj.style.width=menuwidth
		dropmenuobj.style.right = getposOffset(obj, "left")+menuwidth

		//alert(getposOffset(obj, "left")+', '+getposOffset(obj, "top")+' -- '+
		//	(dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px")+', '+(dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"));

		showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
	}

	return clickreturnvalue()
}

function clickreturnvalue(){
	if (ie4||ns6)
		return false
	else
		return true
}

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

function dynamichide(e) {
	if (ie4&&!dropmenuobj.contains(e.toElement))
		delayhidemenu()
	else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
		delayhidemenu()
}

function hidemenu(e) {
	if (typeof dropmenuobj!="undefined") {
		if (ie4||ns6)
			dropmenuobj.style.visibility="hidden"
	}
}

function delayhidemenu(){
	if (ie4||ns6)
		delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu(){
	if (typeof delayhide!="undefined")
		clearTimeout(delayhide)
}

if (hidemenu_onclick=="yes")
	document.onclick=hidemenu

