/***************************************************************************
*********
This script is a "foldout" menu script, all the "foldouts" will
stay outfolded in older browsers. Works in ie4+ and ns4+.

To change where the menu appears change the left and top values of the
divCont
in the stylesheets, it's currently placed relative so you can
place this menu in tables or similar if you want. Change the 
text colors and size in the A.clMain and A.clSubb classes.
****************************************************************************
********/

/***************************************************************************
*********
Change this to false if you want all the submenus to get unfold when you
foldout a new one.
****************************************************************************
********/
var stayFolded=false

/***************************************************************************
*********
Browsercheck
****************************************************************************
********/
var n = (document.layers) ? 1:0;
var ie = (document.all) ? 1:0;
var browser=((n || ie) && parseInt(navigator.appVersion)>=4)  

/***************************************************************************
*********
Making cross-browser objects
****************************************************************************
********/
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function makeMenu(obj,nest){
nest=(!nest) ? '':'document.'+nest+'.'

this.css=(n) ?
eval(nest+'document.'+obj):eval('document.all.'+obj+'.style')

   this.ref=(n) ?
eval(nest+'document.'+obj+'.document'):eval('document'); 
this.height=(n)?this.ref.height:eval(obj+'.offsetHeight')
this.x=(n)? this.css.left:this.css.pixelLeft;
this.y=(n)? this.css.top:this.css.pixelTop;

this.moveIt=b_moveIt
this.showIt=b_showIt;
this.hideIt=b_hideIt; 
this.vis=b_vis;

return this
}
function b_showIt(){this.css.visibility="visible"}
function b_hideIt(){this.css.visibility="hidden"}
function b_vis(){if(this.css.visibility=="hidden" ||
this.css.visibility=="hide") return true;}
function b_moveIt(x,y){this.x=x; this.y=y; this.css.left=this.x;
this.css.top=this.y}
/***************************************************************************
*********
Initiating the page. Just add to the arrays here to get more menuitems
and add divs in the page
****************************************************************************
********/
function init(){
oTop=new Array()
oTop[0]=new makeMenu('divTop1','divCont')
oTop[1]=new makeMenu('divTop2','divCont')
oTop[2]=new makeMenu('divTop3','divCont')
oTop[3]=new makeMenu('divTop4','divCont')
oTop[4]=new makeMenu('divTop5','divCont')
oTop[5]=new makeMenu('divTop6','divCont')
oTop[6]=new makeMenu('divTop7','divCont')
oTop[7]=new makeMenu('divTop8','divCont')

oSub=new Array()
oSub[0]=new makeMenu('divSub1','divCont.document.divTop1')
oSub[1]=new makeMenu('divSub2','divCont.document.divTop2')
oSub[2]=new makeMenu('divSub3','divCont.document.divTop3')
oSub[3]=new makeMenu('divSub4','divCont.document.divTop4')
oSub[4]=new makeMenu('divSub5','divCont.document.divTop5')
oSub[5]=new makeMenu('divSub6','divCont.document.divTop6')
oSub[6]=new makeMenu('divSub7','divCont.document.divTop7')
oSub[7]=new makeMenu('divSub8','divCont.document.divTop8')

for(i=0;i<oSub.length;i++){ oSub[i].hideIt() }
for(i=1;i<oTop.length;i++){
oTop[i].moveIt(0,oTop[i-1].y+oTop[i-1].height) }
for(i=0;i<oTop.length;i++){ oTop[i].showIt() }


}


/***************************************************************************
*********
This is the function that changes the sub menus to folded or unfolded state.
****************************************************************************
********/

function menu(num){
if(browser){
if(!stayFolded){
for(i=0;i<oSub.length;i++){
if(i!=num) oSub[i].hideIt()
}
for(i=1;i<oTop.length;i++){

oTop[i].moveIt(0,oTop[i-1].y+oTop[i-1].height)
}
}

oSub[num].vis()?oSub[num].showIt():oSub[num].hideIt()
for(i=1;i<oTop.length;i++){ 
if(!oSub[i-1].vis())
oTop[i].moveIt(0,oTop[i-1].y+oTop[i-1].height+oSub[i-1].height) 
else oTop[i].moveIt(0,oTop[i-1].y+oTop[i-1].height)
}
}
}
//Initiating the menus onload, if it's a 4.x+ browser.
if(browser) onload=init;
/**
 * This height variable is for netscape.
 * So it won't cut the bottom off of the menus... Adjust as needed
 */
var height;
var leftnav;
if(n){
  height=" height:200;";
  left="left:0;"}
else{
  height="";
    left="left:0;"}
var barString= "  <style> "+
" <!-- "+
" DIV.clTop{position:absolute; visibility:hidden;  width:170} "+
" DIV.clSub{position:absolute; left:0;"+height+" width:170;visibility:hidden} "+
" #divCont{position:absolute;"+left+" top:0; } "+
" #divMain{position:absolute} "+
" Text{font-family:Arial, Verdana, Helvetica, Helv; font-size:12px; line-height: 12 pt; color:000000}"+
" P.Text{font-family:Arial, Verdana, Helvetica, Helv; font-size:12px; line-height: 12 pt; color:000000}"+
" P.SubHeader{font-family:Arial, Verdana, Helvetica, Helv; font-size:16px; line-height: 10 pt; color:Red}"+
" A.Link{font-family:Arial, Verdana, Helvetica, Helv; font-size:12px; line-height: 12 pt; color:#1173D4}"+
" //--> "+
" </style> "+
"<br>"+
" <div id=\"divCont\"> "+

" <div id=\"divTop1\" class=\"clTop\"><a href=\"#\" onclick=\"menu(0); return false\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('Image1','','../images/mouseAllThings.gif',1)\"><img name=\"Image1\" border=\"0\" src=\"../images/AllThings.gif\" width=\"154\" height=\"24\"></a><br> "+
" <div id=\"divSub1\" class=\"clSub\"> "+
" <a href=\"PolPartyLinks.htm\" target=\"_blank\"><img src=\"../images/SidebarSubNav_PolPartyLinks.gif\" width=\"153\" height=\"18\" alt=\"\" border=\"0\"></a><br> "+
" <a href=\"http://www.sbe.state.va.us/\" target=\"_blank\"><img src=\"../images/SidebarSubNav_StateBoard.gif\" width=\"153\" height=\"18\" alt=\"\" border=\"0\"></a><br> "+
" <a href=\"../RPD/VA_Candidates.htm\" target=\"_blank\"><img src=\"../images/SidebarSubNav_CandidateContact.gif\" width=\"153\" height=\"18\" alt=\"\" border=\"0\"></a><br> "+
" <a href=\"http://www.sbe.virginia.gov/cms/Election_Information/Cidate_Lists_Ballot_Issues/Proposed_Amendments_Nov_2007.html\" target=\"_blank\"><img src=\"../images/SidebarSubNav_BallotInt.gif\" width=\"153\" height=\"18\" alt=\"\" border=\"0\"></a><br> "+
" <a href=\"http://www.StatePulse.com/RPD/VA_Fundraising.htm\" target=\"_blank\"><img src=\"../images/SidebarSubNav_Event.gif\" width=\"153\" height=\"18\" alt=\"\" border=\"0\"></a><br> "+
" <a href=\"http://www.vpap.org/\" target=\"_blank\"><img src=\"../images/SidebarSubNav_CampaignFin.gif\" width=\"153\" height=\"18\" alt=\"\" border=\"0\"></a><br> "+
" </div>"+
" </div> "+
" <div id=\"divTop2\" class=\"clTop\"><a href=\"http://www.Virginia.gov\" target=\"_blank\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('Image81','','../images/mouseStateHome.gif',1)\"><img name=\"Image81\" border=\"0\" src=\"../images/StateHome.gif\" width=\"154\" height=\"24\"></a><br> "+
" <div id=\"divSub2\"  class=\"clSub\"> "+ 
" </div>"+
" </div> "+
" <div id=\"divTop3\"  class=\"clTop\"><a href=\"#\" onclick=\"menu(2); return false\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('Image2','','../images/mouseexec.gif',1)\"><img name=\"Image2\" border=\"0\" src=\"../images/exec.gif\" width=\"154\" height=\"24\"></a><br> "+
" <div id=\"divSub3\" class=\"clSub\"> "+
" <a href=\"http://www.governor.virginia.gov/\" target=\"_blank\"><img src=\"../images/SidebarSubNav_Governor.gif\" width=\"153\" height=\"18\" alt=\"\" border=\"0\"></a><br> "+
" <a href=\"govscabinet.htm\" target=\"_blank\"><img src=\"../images/SidebarSubNav_GovCabinet.gif\" width=\"153\" height=\"18\" alt=\"\" border=\"0\"></a><br> "+
" <a href=\"http://www.ltgov.virginia.gov/\" target=\"_blank\"><img src=\"../images/SidebarSubNav_LtGov.gif\" width=\"153\" height=\"18\" alt=\"\" border=\"0\"></a><br> "+
" <a href=\"http://www.soc.state.va.us/\" target=\"_blank\"><img src=\"../images/SidebarSubNav_SecofState.gif\" width=\"153\" height=\"18\" alt=\"\" border=\"0\"></a><br> "+
" <a href=\"http://www.oag.state.va.us/\" target=\"_blank\"><img src=\"../images/SidebarSubNav_AtGeneral.gif\" width=\"153\" height=\"18\" alt=\"\" border=\"0\"></a><br> "+
" <a href=\"http://www.trs.state.va.us/\"target=\"_blank\"target=\"_blank\"><img src=\"../images/SidebarSubNav_Tres.gif\" width=\"153\" height=\"18\" alt=\"\" border=\"0\"></a><br> "+
" <a href=\"http://www.virginia.gov/cmsportal2/cgi-bin/calendar.cgi\"target=\"_blank\"><img src=\"../images/SidebarSubNav_Meetings.gif\" width=\"153\" height=\"18\" alt=\"\" border=\"0\"></a><br> "+
" <a href=\"http://www.vipnet.org/portal/government/state_website_list.htm\"target=\"_blank\"><img src=\"../images/SidebarSubNav_StateLegList.gif\" width=\"153\" height=\"18\" alt=\"\" border=\"0\"></a><br> "+
" <a href=\"http://www.vipnet.org/vipnet/search.html\"target=\"_blank\"><img src=\"../images/SidebarSubNav_StateSearch.gif\" width=\"153\" height=\"18\" alt=\"\" border=\"0\"></a><br> "+
" </div>"+
" </div> "+
" <div id=\"divTop4\" class=\"clTop\"><a href=\"#\" onclick=\"menu(3); return false\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('Image3','','../images/mouselegislate.gif',1)\"><img name=\"Image3\" border=\"0\" src=\"../images/legislate.gif\" width=\"154\" height=\"24\"></a><br>"+
" <div id=\"divSub4\"  class=\"clSub\"> "+
" <a href=\"http://leg1.state.va.us/071/lis.htm\"target=\"_blank\"><img src=\"../images/SidebarSubNav_LegislativeInfoSys.gif\" width=\"153\" height=\"18\" alt=\"\" border=\"0\"></a><br> "+
" <a href=\"http://dls.state.va.us/pubs/calendar/cal2007_2.pdf\" target=\"_blank\"><img src=\"../images/SidebarSubNav_SessionDates.gif\" width=\"153\" height=\"18\" alt=\"\" border=\"0\"></a><br> "+
" <a href=\"http://leg1.state.va.us/071/com/COM.HTM\"target=\"_blank\"><img src=\"../images/SidebarSubNav_CommitteeInfo.gif\" width=\"153\" height=\"18\" alt=\"\" border=\"0\"></a><br> "+
" <a href=\"http://leg1.state.va.us/cgi-bin/legp504.exe?071+oth+MTG\"target=\"_blank\"><img src=\"../images/SidebarSubNav_Meetings.gif\" width=\"153\" height=\"18\" alt=\"\" border=\"0\"></a><br> "+
" <a href=\"http://leg1.state.va.us/cgi-bin/legp504.exe?071+cal+CAL\" target=\"_blank\"><img src=\"../images/SidebarSubNav_FloorCalendar.gif\" width=\"153\" height=\"18\" alt=\"\" border=\"0\"></a><br> "+
" <a href=\"http://leg1.state.va.us/cgi-bin/legp504.exe?071+men+BIL\" target=\"_blank\"><img src=\"../images/SidebarSubNav_BillStatus.gif\" width=\"153\" height=\"18\" alt=\"\" border=\"0\"></a><br> "+
" <a href=\"http://leg2.state.va.us/MoneyWeb.NSF/sb2007\"target=\"_blank\"><img src=\"../images/SidebarSubNav_Budget.gif\" width=\"153\" height=\"18\" alt=\"\" border=\"0\"></a><br> "+
" <a href=\"http://leg1.state.va.us/071/mbr/MBR.HTM\"target=\"_blank\"><img src=\"../images/SidebarSubNav_MemberInfo.gif\" width=\"153\" height=\"18\" alt=\"\" border=\"0\"></a><br> "+
" <a href=\"http://conview.state.va.us/whosmy.nsf/main?openform\"target=\"_blank\"><img src=\"../images/SidebarSubNav_Whois.gif\" width=\"153\" height=\"18\" alt=\"\" border=\"0\"></a><br> "+
" </div>"+
" </div> "+
" <div id=\"divTop5\" class=\"clTop\"><a href=\"judicial.htm\" target=\"_blank\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('Image4','','../images/mousejudical.gif',1)\"><img name=\"Image4\" border=\"0\" src=\"../images/judical.gif\" width=\"154\" height=\"24\"></a><br> "+
" <div id=\"divSub5\"  class=\"clSub\"> "+ 
" </div>"+
" </div> "+
" <div id=\"divTop6\" class=\"clTop\"><a href=\"SCC.htm\" target=\"_blank\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('Image85','','../images/mouseCorporationCommision.gif',1)\"><img name=\"Image85\" border=\"0\" src=\"../images/CorporationCommission.gif\" width=\"154\" height=\"24\"></a><br> "+
" <div id=\"divSub6\"  class=\"clSub\"> "+ 
" </div>"+
" </div> "+
" <div id=\"divTop7\" class=\"clTop\"><a href=\"CongressionalLinks.htm\" target=\"_blank\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('Image45','','../images/mouseCongressional.gif',1)\"><img name=\"Image45\" border=\"0\" src=\"../images/Congressional.gif\" width=\"154\" height=\"24\"></a><br> "+
" <div id=\"divSub7\"  class=\"clSub\"> "+ 
" </div>"+
" </div> "+
" <div id=\"divTop8\" class=\"clTop\"><a href=\"Press.htm\" target=\"_blank\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('Image6','','../images/mousePress.gif',1)\"><img name=\"Image6\" border=\"0\" src=\"../images/Press.gif\" width=\"154\" height=\"24\"></a><br> "+
" <div id=\"divSub8\"  class=\"clSub\"> "+
" </div> "+
" </div> "+
" </div> "
document.write(barString);
