/******************************** EDIT MENU HERE */

//Contents for menu 1
var menu1=new Array()
//Menu Items
//menu1[0]='<a href="?pg=uc">:: What\'s it all about?</a>'
menu1[0]='<a onMouseover="L2Menu(this, event, dummy, \'0px\')" onMouseout="delayhidemenuL2()" href="driving-whats%20it%20all%20about.shtml">:: What\'s it all about?</a>'
menu1[1]='<a onMouseover="L2Menu(this, event, menuL1, \'150px\')" onMouseout="delayhidemenuL2()" >:: The Lessons</a>'
menu1[2]='<a onMouseover="L2Menu(this, event, menuL2, \'150px\')" onMouseout="delayhidemenuL2()" >:: The Tests</a>'
menu1[3]='<a onMouseover="L2Menu(this, event, menuL3, \'150px\')" onMouseout="delayhidemenuL2()">:: Safe Motorists</a>'
menu1[4]='<a href="under%20construction_beta-drive.shtml">:: Gifts & Certificates</a>'

//Contents for dummy menu
var dummy=new Array()
//Menu Items
dummy[0]=''

//Contents for sub-level menu 1
var menuL1=new Array()
//Menu Items
menuL1[0]='<a href="driving%20lessons-our%20cars_driving%20school.shtml">:: Our Cars</a>'
menuL1[1]='<a href="lessons_driving%20school%20discounts.shtml">:: Our Discounts</a>'
menuL1[2]='<a href="lessons_driving%20school%20packages.shtml">:: Our Packages</a>'
menuL1[3]='<a href="lessons_summary%20of%20prices.shtml">:: Summary of Prices</a>'

//Contents for sub-level menu 2
var menuL2=new Array()
//Menu Items
menuL2[0]='<a href="theory%20test-driving%20school.shtml">:: Theory Test</a>'
menuL2[1]='<a href="practical%20test-driving%20school.shtml">:: Practical Test</a>'

//Contents for sub-level menu 3
var menuL3=new Array()
//Menu Items
menuL3[0]='<a href="pass%20plus_driving%20school.shtml">:: Pass Plus</a>'
menuL3[1]='<a href="safe%20motorists-top%2010%20tips_driving%20school.shtml">:: Top 10 Tips</a>'



//Contents for menu 2
var menu2=new Array()
//Menu Items
menu2[0]='<a href="mailto:admin@beta-drive.co.uk?subject=Website Enquiry: Book Lessons">:: Submit E-mail</a>'

//Contents for menu 3
var menu3=new Array()
//Menu Items
menu3[0]='<a href="mailto:admin@beta-drive.co.uk?subject=Website Enquiry: Instructor College">:: Submit E-mail</a>'
menu3[1]='<a href="under%20construction_beta-drive.shtml">:: What does it take?</a>'
menu3[2]='<a href="under%20construction_beta-drive.shtml">:: Requirements</a>'
menu3[3]='<a href="under%20construction_beta-drive.shtml">:: Rewarding Career</a>'
menu3[4]='<a href="under%20construction_beta-drive.shtml">:: T\'s and C\'s</a>'

//Contents for menu 4
var menu4=new Array()
//Menu Items
menu4[0]='<a href="beta-drive_mission-statement.shtml">:: Mission Statement</a>'
menu4[1]='<a href="terms_beta-drive.shtml">:: T\'s and C\'s</a>'

//Contents for menu 5
var menu5=new Array()
//Menu Items
menu5[0]='<a href="under%20construction_beta-drive.shtml">:: Customer Care</a>'
menu5[1]='<a href="mailto:admin@beta-drive.co.uk?subject=Website Enquiry: General Enquiry">:: Submit E-mail</a>'





		
var menuwidth='165px' //default menu width
var menubgcolor='#ffffff'  //menu bgcolor
var disappeardelay=300  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="no" //hide menu when user clicks within menu?
var hidemenuL2_onclick="no" //hide menu when user clicks within menu?

/******************************** END OF MENU EDIT */
/////No further editting required


var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6) {
	document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>');
	document.write('<div id="dropmenudivL2" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearhidemenuL2()" onMouseout="dynamichideL2(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 (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top=-500
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 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 up?
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
}
}
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")-60
	dropmenuobj.y=getposOffset(obj, "top")-(dropmenuobj.clientHeight+23)


dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"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){
			dropmenuobjL2=document.getElementById? document.getElementById("dropmenudivL2") : dropmenudiv

			if (dropmenuobjL2.style.visibility=="hidden")
			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

if (hidemenuL2_onclick=="yes")
document.onclick=hidemenuL2

/***********************************************
* AnyLink Drop Down Menu- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

function L2Menu(obj, f, menucontents, menuwidth){
	
	if (window.event) event.cancelBubble=true
	else if (f.stopPropagation) f.stopPropagation()
	clearhidemenuL2()

	dropmenuobjL2=document.getElementById? document.getElementById("dropmenudivL2") : dropmenudivL2
	populatemenuL2(menucontents)
//alert('we');
	
	if (ie4||ns6){
	showhideL2(dropmenuobjL2.style, f, "visible", "hidden", menuwidth)
	dropmenuobjL2.x=getposOffset(obj, "left")+150
	dropmenuobjL2.y=getposOffset(obj, "top")-20
	
	
	dropmenuobjL2.style.left=dropmenuobjL2.x-clearbrowseredge(obj, "rightedge")+"px"
	dropmenuobjL2.style.top=dropmenuobjL2.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
	}
}

function showhideL2(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobjL2.style.left=dropmenuobjL2.style.top=-500
if (menuwidth!=""){
dropmenuobjL2.widthobj=dropmenuobjL2.style
dropmenuobjL2.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 hidemenuL2(e){
	if (typeof dropmenuobjL2!="undefined"){
		if (ie4||ns6)
		dropmenuobj.style.visibility="hidden"
		dropmenuobjL2.style.visibility="hidden"
	}
}

function populatemenuL2(what){
	if (ie4||ns6)
	dropmenuobjL2.innerHTML=what.join("")
}

function dynamichideL2(e){
	if (ie4&&!dropmenuobjL2.contains(e.toElement))
	delayhidemenuL2()
	else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
	delayhidemenuL2()
}

function delayhidemenuL2(){
	if (ie4||ns6)
		delayhideL2=setTimeout("hidemenuL2()",disappeardelay)
}

function clearhidemenuL2(){
	if (typeof delayhideL2!="undefined")
	clearTimeout(delayhideL2)
}
