/***********************************************
* 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
***********************************************/

//Contents for menu 1
//Contents for menu 1
var menu1=new Array()
menu1[0]='<a href="http://www.lifestylesatmidbeds.co.uk/FLITWICKnbspLEISUREnbspCENTRE/Swimming/tabid/469/Default.aspx" title="25m pool @ Flitwick" tabindex="3"><img src="' + window.GlobalPath + 'images/shd/dash.gif" width="5" height="6"  border="0" alt="-"  tabindex="3" /> 25m pool @ Flitwick</a>'
menu1[1]='<a href="http://www.lifestylesatmidbeds.co.uk/SAXONnbspPOOLnbspnbspLEISUREnbspCENTRE/Swimming/tabid/433/Default.aspx" title="25m pool @ Saxon" tabindex="3"><img src="' + window.GlobalPath + 'images/shd/dash.gif" width="5" height="6"  border="0"  alt="-"  tabindex="3" /> 25m pool @ Saxon</a>'
menu1[2]='<a href="http://www.lifestylesatmidbeds.co.uk/FLITWICKnbspLEISUREnbspCENTRE/Swimming/SwimmingPools/tabid/490/Default.aspx" title="Teaching pool @ Flitwick" tabindex="3"><img src="' + window.GlobalPath + 'images/shd/dash.gif" width="5" height="6" alt="-"  tabindex="3"  border="0" /> Teaching pool @ Flitwick</a>'
menu1[3]='<a href="http://www.lifestylesatmidbeds.co.uk/SAXONnbspPOOLnbspnbspLEISUREnbspCENTRE/Swimming/SwimmingPools/tabid/473/Default.aspx" title="Teaching pool @ Saxon" tabindex="3"><img src="' + window.GlobalPath + 'images/shd/dash.gif" width="5" height="6"  alt="-"  tabindex="3" border="0" /> Teaching pool @ Saxon</a>'
menu1[3]='<a href="http://www.lifestylesatmidbeds.co.uk/FLITWICKnbspLEISUREnbspCENTRE/ChildrensActivities/AquaEdSwimschool/tabid/497/Default.aspx" title="Aqua Ed @ Flitwick" tabindex="3"><img src="' + window.GlobalPath + 'images/shd/dash.gif" width="5" height="6"  alt="-"  tabindex="3" border="0" /> Aqua Ed @ Flitwick</a>'
menu1[3]='<a href="http://www.lifestylesatmidbeds.co.uk/SAXONnbspPOOLnbspnbspLEISUREnbspCENTRE/ChildrensActivities/AquaEdSwimschool/tabid/479/Default.aspx" title="Aqua Ed @ Saxon" tabindex="3"><img src="' + window.GlobalPath + 'images/shd/dash.gif" width="5" height="6"  alt="-"  tabindex="3" border="0" /> Aqua Ed @ Saxon</a>'

//Contents for menu 2
var menu2=new Array()
menu2[0]='<a href="javascript: void(0)" onclick="expandcontent(\'sc2\', event)" style="cursor:hand; cursor:pointer" title="Parties" tabindex="3"><img src="' + window.GlobalPath + 'images/shd/plus.gif" width="5" height="6" alt="+"  tabindex="3" border="0" /> Parties</a><ul id="sc2" class="switchcontent"><li><a href="http://www.lifestylesatmidbeds.co.uk/FLITWICKnbspLEISUREnbspCENTRE/ChildrensActivities/ChildrensParties/tabid/494/Default.aspx" title="Parties @ Flitwick" tabindex="3"><img src="' + window.GlobalPath + 'images/shd/dash.gif" width="5" height="6" alt="-"  tabindex="3" border="0" /> @ Flitwick</a></li><li><a href="http://www.lifestylesatmidbeds.co.uk/SANDYnbspSPORTSnbspCENTRE/ChildrensActivities/tabid/513/Default.aspx" title="Parties @ Sandy" tabindex="3"><img src="' + window.GlobalPath + 'images/shd/dash.gif" width="5" height="6" alt="-"  tabindex="3" border="0" /> @ Sandy</a></li><li><a href="http://www.lifestylesatmidbeds.co.uk/SAXONnbspPOOLnbspnbspLEISUREnbspCENTRE/ChildrensActivities/ChildrensParties/tabid/475/Default.aspx" title="Parties @ Saxon" tabindex="3"><img src="' + window.GlobalPath + 'images/shd/dash.gif" width="5" height="6" alt="-"  tabindex="3" border="0" /> @ Saxon</a></li></ul>'
menu2[1]='<a href="javascript: void(0)" onclick="expandcontent(\'sc3\', event)" style="cursor:hand; cursor:pointer" title="Holiday Activities" tabindex="3"><img src="' + window.GlobalPath + 'images/shd/plus.gif" width="5" height="6" alt="+"  tabindex="3" border="0" /> Holiday Activities</a><ul id="sc3" class="switchcontent"><li><a href="http://www.lifestylesatmidbeds.co.uk/FLITWICKnbspLEISUREnbspCENTRE/ChildrensActivities/ChildrensHolidayActivities/tabid/495/Default.aspx" title="Activities @ Flitwick" tabindex="3"><img src="' + window.GlobalPath + 'images/shd/dash.gif" width="5" height="6" alt="-"  tabindex="3" border="0" /> @ Flitwick</a></li><li><a href="http://www.lifestylesatmidbeds.co.uk/SANDYnbspSPORTSnbspCENTRE/ChildrensActivities/tabid/513/Default.aspx" title="Activities @ Sandy" tabindex="3"><img src="' + window.GlobalPath + 'images/shd/dash.gif" width="5" height="6"  alt="-"  tabindex="3" border="0" /> @ Sandy</a></li><li><a href="http://www.lifestylesatmidbeds.co.uk/SAXONnbspPOOLnbspnbspLEISUREnbspCENTRE/ChildrensActivities/ChildrensHolidayActivities/tabid/476/Default.aspx" title="Activities @ Saxon" tabindex="3"><img src="' + window.GlobalPath + 'images/shd/dash.gif" width="5" height="6" alt="-"  tabindex="3" border="0" /> @ Saxon</a></li></ul>'
menu2[2]='<a href="javascript: void(0)" onclick="expandcontent(\'sc4\', event)" style="cursor:hand; cursor:pointer" title="Aqua Ed" tabindex="3"><img src="' + window.GlobalPath + 'images/shd/plus.gif" width="5" height="6" alt="+"  tabindex="3" border="0" /> Aqua Ed</a><ul id="sc4" class="switchcontent"><li><a href="http://www.lifestylesatmidbeds.co.uk/FLITWICKnbspLEISUREnbspCENTRE/ChildrensActivities/AquaEdSwimschool/tabid/497/Default.aspx" title="Aqua Ed @ Flitwick" tabindex="3"><img src="' + window.GlobalPath + 'images/shd/dash.gif" width="5" height="6" alt="-"  tabindex="3" border="0" /> @ Flitwick</a></li><li><a href="http://www.lifestylesatmidbeds.co.uk/SAXONnbspPOOLnbspnbspLEISUREnbspCENTRE/ChildrensActivities/AquaEdSwimschool/tabid/479/Default.aspx" title="Aqua Ed @ Saxon" tabindex="3"><img src="' + window.GlobalPath + 'images/shd/dash.gif" width="5" height="6"  alt="-"  tabindex="3" border="0" /> @ Saxon</a></li></ul>'

//Contents for menu 3
var menu3=new Array()
menu3[0]='<a href="#" title="Sports Hall" tabindex="3"><img src="' + window.GlobalPath + 'images/shd/dash.gif" width="5" height="6"  alt="-"  tabindex="3" border="0" /> Sports Hall</a>'
menu3[1]='<a href="#" title="Food &amp; Drink" tabindex="3"><img src="' + window.GlobalPath + 'images/shd/dash.gif" width="5" height="6"  alt="-"  tabindex="3" border="0" /> Food &amp; Drink</a>'
menu3[2]='<a href="#" title="Athletics facilities" tabindex="3"><img src="' + window.GlobalPath + 'images/shd/dash.gif" width="5" height="6"  alt="-"  tabindex="3" border="0" /> Athletics facilities</a>'
menu3[3]='<a href="#" title="Function rooms" tabindex="3"><img src="' + window.GlobalPath + 'images/shd/dash.gif" width="5" height="6" alt="-"  tabindex="3"  border="0" /> Function rooms</a>'
menu3[4]='<a href="#" title="Personal training" tabindex="3"><img src="' + window.GlobalPath + 'images/shd/dash.gif" width="5" height="6"  alt="-"  tabindex="3" border="0" /> Personal training</a>'
menu3[5]='<a href="#" title="Sports massage" tabindex="3"><img src="' + window.GlobalPath + 'images/shd/dash.gif" width="5" height="6"  alt="-"  tabindex="3" border="0" /> Sports massage</a>'
menu3[6]='<a href="#" title="Creche" tabindex="3"><img src="' + window.GlobalPath + 'images/shd/dash.gif" width="5" height="6"  alt="-"  tabindex="3" border="0" /> Creche</a>'

//Contents for menu 4
var menu4=new Array()
menu4[0]='<a href="javascript: void(0)" onclick="expandcontent(\'sc5\', event)" style="cursor:hand; cursor:pointer" title="Badminton" tabindex="3"><img src="' + window.GlobalPath + 'images/shd/plus.gif" width="5" height="6" alt="+"  tabindex="3" border="0" /> Badminton</a><ul id="sc5" class="switchcontent"><li><a href="http://www.lifestylesatmidbeds.co.uk/FLITWICKnbspLEISUREnbspCENTRE/IndoorSports/tabid/498/Default.aspx" title="@ Flitwick" tabindex="3"><img src="' + window.GlobalPath + 'images/shd/dash.gif" width="5" height="6"  alt="-"  tabindex="3" border="0" /> @ Flitwick</a></li><li><a href="http://www.lifestylesatmidbeds.co.uk/SANDYnbspSPORTSnbspCENTRE/IndoorSports/tabid/514/Default.aspx" title="@ Sandy" tabindex="3"><img src="' + window.GlobalPath + 'images/shd/dash.gif" width="5" height="6" alt="-"  tabindex="3" border="0" /> @ Sandy</a></li></ul>'
menu4[1]='<a href="javascript: void(0)" onclick="expandcontent(\'sc6\', event)" style="cursor:hand; cursor:pointer" title="Squash" tabindex="3"><img src="' + window.GlobalPath + 'images/shd/plus.gif" width="5" height="6" alt="+"  tabindex="3" border="0" /> Squash</a><ul id="sc6" class="switchcontent"><li><a href="http://www.lifestylesatmidbeds.co.uk/FLITWICKnbspLEISUREnbspCENTRE/IndoorSports/tabid/498/Default.aspx" title="@ Flitwick" tabindex="3"><img src="' + window.GlobalPath + 'images/shd/dash.gif" width="5" height="6"  alt="-"  tabindex="3" border="0" /> @ Flitwick</a></li><li><a href="http://www.lifestylesatmidbeds.co.uk/SANDYnbspSPORTSnbspCENTRE/IndoorSports/tabid/514/Default.aspx" title="@ Sandy" tabindex="3"><img src="' + window.GlobalPath + 'images/shd/dash.gif" width="5" height="6" alt="-"  tabindex="3" border="0" /> @ Sandy</a></li></ul>'
menu4[2]='<a href="javascript: void(0)" onclick="expandcontent(\'sc7\', event)" style="cursor:hand; cursor:pointer" title="Football" tabindex="3"><img src="' + window.GlobalPath + 'images/shd/plus.gif" width="5" height="6" alt="+"  tabindex="3" border="0" /> Football</a><ul id="sc7" class="switchcontent"><li><a href="http://www.lifestylesatmidbeds.co.uk/FLITWICKnbspLEISUREnbspCENTRE/IndoorSports/tabid/498/Default.aspx" title="@ Flitwick" tabindex="3"><img src="' + window.GlobalPath + 'images/shd/dash.gif" width="5" height="6"  alt="-"  tabindex="3" border="0" /> @ Flitwick</a></li><li><a href="http://www.lifestylesatmidbeds.co.uk/SANDYnbspSPORTSnbspCENTRE/IndoorSports/tabid/514/Default.aspx" title="@ Sandy" tabindex="3"><img src="' + window.GlobalPath + 'images/shd/dash.gif" width="5" height="6" alt="-"  tabindex="3" border="0" /> @ Sandy</a></li></ul>'
menu4[3]='<a href="javascript: void(0)" onclick="expandcontent(\'sc8\', event)" style="cursor:hand; cursor:pointer" title="Athletics" tabindex="3"><img src="' + window.GlobalPath + 'images/shd/plus.gif" width="5" height="6" alt="+"  tabindex="3" border="0" /> Athletics</a><ul id="sc8" class="switchcontent"><li><a href="http://www.lifestylesatmidbeds.co.uk/FLITWICKnbspLEISUREnbspCENTRE/OutdoorSports/tabid/499/Default.aspx" title="@ Flitwick" tabindex="3"><img src="' + window.GlobalPath + 'images/shd/dash.gif" width="5" height="6"  alt="-"  tabindex="3" border="0" /> @ Flitwick</a></li><li><a href="http://www.lifestylesatmidbeds.co.uk/SANDYnbspSPORTSnbspCENTRE/OutdoorSports/tabid/515/Default.aspx" title="@ Sandy" tabindex="3"><img src="' + window.GlobalPath + 'images/shd/dash.gif" width="5" height="6" alt="-"  tabindex="3" border="0" /> @ Sandy</a></li></ul>'
menu4[4]='<a href="javascript: void(0)" onclick="expandcontent(\'sc1\', event)" style="cursor:hand; cursor:pointer" title="Tennis" tabindex="3"><img src="' + window.GlobalPath + 'images/shd/plus.gif" width="5" height="6" alt="+"  tabindex="3" border="0" /> Tennis</a><ul id="sc1" class="switchcontent"><li><a href="http://www.lifestylesatmidbeds.co.uk/FLITWICKnbspLEISUREnbspCENTRE/OutdoorSports/tabid/499/Default.aspx" title="Tennis @ Flitwick" tabindex="3"><img src="' + window.GlobalPath + 'images/shd/dash.gif" width="5" height="6" alt="-"  tabindex="3"  border="0" /> @ Flitwick</a></li><li><a href="http://www.lifestylesatmidbeds.co.uk/SANDYnbspSPORTSnbspCENTRE/OutdoorSports/tabid/515/Default.aspx" title="Tennis @ Sandy" tabindex="3"><img src="' + window.GlobalPath + 'images/shd/dash.gif" width="5" height="6" alt="-"  tabindex="3" border="0" /> @ Sandy</a></li></ul>'

//Contents for menu 5
var menu5=new Array()
menu5[0]='<a href="http://www.lifestylesatmidbeds.co.uk/SAXONnbspPOOLnbspnbspLEISUREnbspCENTRE/Gym/tabid/450/Default.aspx" title="@ Saxon" tabindex="3"><img src="' + window.GlobalPath + 'images/shd/dash.gif" width="5" height="6"  alt="-"  tabindex="3" border="0" /> @ Saxon</a>'
menu5[1]='<a href="http://www.lifestylesatmidbeds.co.uk/FLITWICKnbspLEISUREnbspCENTRE/Gym/tabid/492/Default.aspx" title="@ Flitwick" tabindex="3"><img src="' + window.GlobalPath + 'images/shd/dash.gif" width="5" height="6"  alt="-"  tabindex="3" border="0" /> @ Flitwick</a>'
menu5[2]='<a href="http://www.lifestylesatmidbeds.co.uk/SANDYnbspSPORTSnbspCENTRE/Gym/tabid/512/Default.aspx" title="@ Sandy" tabindex="3"><img src="' + window.GlobalPath + 'images/shd/dash.gif" width="5" height="6"  alt="-"  tabindex="3" border="0" /> @ Sandy</a>'

//Contents for menu 6
var menu6=new Array()
menu6[0]='<a href="http://www.lifestylesatmidbeds.co.uk/FLITWICKnbspLEISUREnbspCENTRE/ClassesProgrammes/ClassDescriptions/tabid/468/Default.aspx" title="Classes @ Flitwick" tabindex="3"><img src="' + window.GlobalPath + 'images/shd/dash.gif" width="5" height="6"  alt="-"  tabindex="3" border="0" /> Classes @ Flitwick</a>'
menu6[1]='<a href="http://www.lifestylesatmidbeds.co.uk/SANDYnbspSPORTSnbspCENTRE/ClassesProgrammmes/ClassDescriptions/tabid/510/Default.aspx" title="Classes @ Sandy" tabindex="3"><img src="' + window.GlobalPath + 'images/shd/dash.gif" width="5" height="6"  alt="-"  tabindex="3" border="0" /> Classes @ Sandy</a>'
menu6[2]='<a href="http://www.lifestylesatmidbeds.co.uk/SAXONnbspPOOLnbspnbspLEISUREnbspCENTRE/ClassesProgrammes/ClassDescriptions/tabid/459/Default.aspx" title="Classes @ Saxon" tabindex="3"><img src="' + window.GlobalPath + 'images/shd/dash.gif" width="5" height="6"  alt="-"  tabindex="3" border="0" /> Classes @ Saxon</a>'

		
var menuwidth='165px' //default menu width
var menubgcolor=''  //menu bgcolor
var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="no" //hide menu when user clicks within menu?

/////No further editting needed

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>')

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="-500px"
if (menuwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover" || e.type=="focus" && obj.visibility==hidden)
obj.visibility=visible
else if (e.type=="click" || e.type=="blur")
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")
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"
}

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


/***********************************************
* Contractible Headers script- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for legal use. Last updated Mar 23rd, 2004.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

var enablepersist="on" //Enable saving state of content structure using session cookies? (on/off)
var collapseprevious="no" //Collapse previously open content when opening present? (yes/no)

if (document.getElementById){
document.write('<style type="text/css">')
document.write('.switchcontent{display:none;}')
document.write('</style>')
}

function getElementbyClass(classname){
ccollect=new Array()
var inc=0
var alltags=document.all? document.all : document.getElementsByTagName("*")
for (i=0; i<alltags.length; i++){
if (alltags[i].className==classname)
ccollect[inc++]=alltags[i]
}
}

function contractcontent(omit){
var inc=0
while (ccollect[inc]){
if (ccollect[inc].id!=omit)
ccollect[inc].style.display="none"
inc++
}
}

function expandcontent(cid, e){
if (typeof ccollect!="undefined"){
if (collapseprevious=="yes")
contractcontent(cid)
document.getElementById(cid).style.display=(document.getElementById(cid).style.display!="block")? "block" : "none"
}
if (window.event){
	event.cancelBubble=true
} else {
	if (e.stopPropagation){
		e.stopPropagation()
	}
}
}

function revivecontent(){
contractcontent("omitnothing")
selectedItem=getselectedItem()
selectedComponents=selectedItem.split("|")
for (i=0; i<selectedComponents.length-1; i++)
document.getElementById(selectedComponents[i]).style.display="block"
}

function get_cookie(Name) { 
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) { 
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function getselectedItem(){
if (get_cookie(window.location.pathname) != ""){
selectedItem=get_cookie(window.location.pathname)
return selectedItem
}
else
return ""
}

function saveswitchstate(){
var inc=0, selectedItem=""
while (ccollect[inc]){
if (ccollect[inc].style.display=="block")
selectedItem+=ccollect[inc].id+"|"
inc++
}

document.cookie=window.location.pathname+"="+selectedItem
}

function do_onload(){
uniqueidn=window.location.pathname+"firsttimeload"
getElementbyClass("switchcontent")
if (enablepersist=="on" && typeof ccollect!="undefined"){
document.cookie=(get_cookie(uniqueidn)=="")? uniqueidn+"=1" : uniqueidn+"=0" 
firsttimeload=(get_cookie(uniqueidn)==1)? 1 : 0 //check if this is 1st page load
if (!firsttimeload)
revivecontent()
}
}


if (window.addEventListener)
window.addEventListener("load", do_onload, false)
else if (window.attachEvent)
window.attachEvent("onload", do_onload)
else if (document.getElementById)
window.onload=do_onload

if (enablepersist=="on" && document.getElementById)
window.onunload=saveswitchstate
