﻿// JScript File
    <!--
    if (document.images)
    {
    //This preloads all the button images.  
    //But at the bottom of this page are scripts which overrule these scripts here.
     neighborhoodsup = new Image(195,27);
     neighborhoodsup.src="/Images/buttons/neighborhoodsup.jpg";  
     neighborhoodsdown= new Image(195,27);
     neighborhoodsdown.src="/Images/buttons/neighborhoodsdown.jpg";
     
     toolsup = new Image(195,27);
     toolsup.src="/Images/buttons/tools.jpg";  
     toolsdown= new Image(195,27);
     toolsdown.src="/Images/buttons/toolsdown.jpg";
     
     firsttimebuyersup = new Image(195,27);
     firsttimebuyersup.src="/Images/buttons/firsttimebuyersup.jpg";  
     firsttimebuyersdown= new Image(195,27);
     firsttimebuyersdown.src="/Images/buttons/firsttimebuyersdown.jpg";   
     
     locallinksup = new Image(195,27);
     locallinksup.src="/Images/buttons/locallinksup.jpg";  
     locallinksdown = new Image(195,27);
     locallinksdown.src = "/Images/buttons/locallinksdown.jpg";
     
     
     tipsandadviceup = new Image(195,27);
     tipsandadviceup.src="/Images/buttons/tipsandadviceup.jpg";  
     tipsandadvicedown = new Image(195,27);
     tipsandadvicedown.src = "/Images/buttons/tipsandadvicedown.jpg";            

     theteamup = new Image(195,27);
     theteamup.src="/Images/buttons/theteamup.jpg";  
     theteamdown = new Image(195,27);
     theteamdown.src = "/Images/buttons/theteamdown.jpg";  
     }


    function PreExpandCollapse(ItemID, MenuStatus, ButtonID, UpImage, DownImage){
        //Used when the page loads, not for switching menu status.
        var switch_id = document.getElementById(ItemID);
        
        if(MenuStatus == ''){
            MenuStatus = 'show';
            setMenuStatus(ItemID, MenuStatus);
        }
        
        switch_id.classname = MenuStatus;
        menu_status[ItemID] = MenuStatus;
        document.getElementById(ItemID).className = MenuStatus;
    
        if(MenuStatus == 'show'){
            document.getElementById(ButtonID).src = DownImage;
        } else {
            document.getElementById(ButtonID).src = UpImage;
        }
    
    } 


    menu_status = new Array(); 
    function showHide(theid, ButtonID, UpImage, DownImage){
        if (document.getElementById) {
        var switch_id = document.getElementById(theid);
        var button_id = document.getElementById(ButtonID);
            
            if(menu_status[theid] != 'show') {
               switch_id.className = 'show';
               menu_status[theid] = 'show';
               button_id.src = DownImage.src;
               setMenuStatus(theid, 'show');
               
            }else{
               switch_id.className = 'hide';
               button_id.src = UpImage.src;
               menu_status[theid] = 'hide';
               setMenuStatus(theid, 'hide');
            }
        }
    }


    function setMenuStatus(c_name,value){
    document.cookie=c_name+ "=" +escape(value);
    }
    
    function getMenuStatus(c_name)
    {
    if (document.cookie.length>0)
      {
      c_start=document.cookie.indexOf(c_name + "=")
      if (c_start!=-1)
        { 
        c_start=c_start + c_name.length+1 
        c_end=document.cookie.indexOf(";",c_start)
        if (c_end==-1) c_end=document.cookie.length
        return unescape(document.cookie.substring(c_start,c_end))
        } 
      }
    return ""
    }    
    //-->
