/***********************************************
* AnyLink Vertical Menu- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//Contents for menu 1
var menu1=new Array()
menu1[0]='<a href="http://www.mathspower.com.au/2004/WhatTeachersAreSaying.asp">Teachers & Principals </a>'
menu1[1]='<a href="http://www.mathspower.com.au/2004/WhatParentsAreSaying.asp">Parents</a>'
menu1[2]='<a href="http://www.mathspower.com.au/2004/WhatStudentsAreSaying.asp">Students</a>'
menu1[3]='<a href="http://www.mathspower.com.au/2004/WhatOthersAreSaying.asp">Psychologists</a>'
menu1[4]='<a href="http://www.mathspower.com.au/2004/WhatHSersAreSaying.asp">Homeschoolers</a>'
menu1[5]='<a href="http://www.mathspower.com.au/2004/WhatSoftExpertsAreSaying.asp">Software Experts</a>'
menu1[6]='<a href="http://www.mathspower.com.au/guestbook/read.asp">Guest Book Comments</a>'



//Contents for menu 2
var menu2=new Array()
menu2[0]='<a href="http://www.mathspower.com.au/2004/StudentsStruggle.asp">Students struggle because...</a>'
menu2[1]='<a href="http://www.mathspower.com.au/2004/LookFor.asp">Warning signs for parents</a>'
menu2[2]='<a href="http://www.mathspower.com.au/2004/WorksBecause.asp">Our system works because...</a>'
menu2[3]='<a href="http://www.mathspower.com.au/2004/KnowItWorksBecause.asp">We know it works because...</a>'
menu2[4]='<a href="http://www.mathspower.com.au/2004/RoleAsParent.asp">Your role as a parent</a>'
menu2[5]='<a href="http://www.mathspower.com.au/2004/newsletter/Register.asp">Register for the KidPOWER Learning Tips Newsletter</a>'
menu2[6]='<a href="http://www.mathspower.com.au/2004/usefulLinks.asp">Useful Links</a>'
menu2[7]='<a href="http://www.mathspower.com.au/survey/TakeSurvey.asp?SurveyID=100">Take Our Education Survey</a>'

//Contents for menu 3
var menu3=new Array()
menu3[0]='<a href="http://www.mathspower.com.au/2004/pricing.asp"> Pricing </a>'
menu3[1]='<a href="http://www.mathspower.com.au/pages/SampleLessons.asp"> Sample Lessons/Lesson Lists </a>'
menu3[2]='<a href="http://www.mathspower.com.au/2004/InfantsPrimaryInfo.asp"> MathsPOWER for Infants and Primary Students </a>'
menu3[3]='<a href="http://www.mathspower.com.au/highschoolmaths/mathematics/info.asp"> MathsPOWER for High School Students </a>'
menu3[4]='<a href="http://www.mathspower.com.au/2004/MathsPowerGuarantee.asp"> Money Back Guarantee </a>'
menu3[5]='<a href="http://www.mathspower.com.au/2004/ProgramComparison.asp"> Compare with other programs </a>'
menu3[6]='<a href="http://www.mathspower.com.au/2004/requirements.asp"> Program Requirements </a>'


//Contents for menu 4
var menu4=new Array()
menu4[0]='<a href="https://www.btfeducation.com/ssl/2004/Login.asp">Existing Customer</a>'
menu4[1]='<a href="https://www.btfeducation.com/ssl/2004/Pricing.asp">New Customer</a>'



var disappeardelay=100  //menu disappear speed onMouseout (in miliseconds)
var horizontaloffset=0 //horizontal offset of menu from default location. (0-5 is a good value)

/////////////////////////////////////////////////////////////////////////////////////////////////
var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;width: 160px" 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 changeFontColorOver(obj){
  obj.style.color='#ffffff';
}

function changeFontColorOut(obj){
  obj.style.color='#000000';
}


function showhide(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top=-500
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-obj.offsetWidth < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure+obj.offsetWidth
}
else{
var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
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){ //move menu up?
edgeoffset=dropmenuobj.contentmeasure-obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either? (position at top of viewable window then)
edgeoffset=dropmenuobj.y
}
}
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") : dropmenudiv
populatemenu(menucontents)

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+obj.offsetWidth+horizontaloffset+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+"px"
}

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)
}

function load(directory){
    if(document.images){
        names=load.arguments
        pictures=new Array;
        for (z=1;z<names.length;z++){
            pictures[z]=new Image;
            pictures[z].src=directory+names[z];
        }
    }    
}

function loadjpgs(directory){
    if(document.images){
        names=load.arguments.slice(1);
        pictures=new Array;
        for (z=0;z<names.length;z++){
            pictures[z]=new Image;
            pictures[z].src=directory+names[z]+".jpg";
        }
    }    
    
}

function loadgifs(directory){
    if(document.images){
        names=load.arguments.slice(1);
        pictures=new Array;
        for (z=0;z<names.length;z++){
            pictures[z]=new Image;
            pictures[z].src=directory+names[z]+".gif";
        }
    }    
}

function load_on_offs(directory){
    if(document.images){
        names=load.arguments.slice(1);
        pictures=new Array;
        for (z=0;z<names.length;z++){
            pictures[z]=new Image;
            pictures[z].src=directory+names[z]+"on.gif";
            pictures[z].src=directory+names[z]+"off.gif";
        }
    }    
}

 



function toggle(imagename,src1,src2){      
    if(document.images && document.images[imagename]){
        image1=new Image;
        image1.src=src1;
        if(document.images[imagename].src != image1.src){
            document.images[imagename].src = image1.src
        }
        else{
            document.images[imagename].src=src2
        }
    }
}


function show(imagename,source){
    if(document.images && document.images[imagename]){
        document.images[imagename].src=source
    }
}


function LessonQualAlert(){
  alert('Please Note:\n The audio/video quality and tutorial length of the following sample lesson have been reduced to allow quicker download times.\n\n Download Times: \n- Up to 4 minutes if you are on a dial-up connection.\n - Up to a minute if you are on a broad-band internet connection.')
}


//good to hide emails from crawlers

function drawEmail(email, emailHost){
  
  document.write("<a href=" + "mail" + "to:" + email + "@" + emailHost+ ">" + email + "&#64;" + emailHost + "</a>" + ".")

}

function tabOver(text,leftImg,rightImg,leftCol,centreCol,rightCol){
  document.getElementById(leftCol).className="sideColOver"
  document.getElementById(centreCol).className="midColOver"
  document.getElementById(rightCol).className="sideColOver"
  document.getElementById(leftImg).src="/sciencepower/images/TabLeftOver.jpg"
  document.getElementById(rightImg).src="/sciencepower/images/TabRightOver.jpg"
  text.style.color="#876FBD"
}

function tabOut(text,leftImg,rightImg,leftCol,centreCol,rightCol){
  document.getElementById(leftCol).className="sideColOut"
  document.getElementById(centreCol).className="midColOut"
  document.getElementById(rightCol).className="sideColOut"
  document.getElementById(leftImg).src="/sciencepower/images/TabLeft.jpg"
  document.getElementById(rightImg).src="/sciencepower/images/TabRight.jpg"
  text.style.color="white"
}