

var curVisRegion = null;
var curTog = "showHome";

/********************************************************************************
********************************************************************************/
function togDisp( elm)  {  try {
    //alert("togDisp") ;
     if(!elm ) return;
     var s = elm.style;
    s.display = ( !s.display || s.display == "") ? "block" :
                s.display == "block" ? "" : "block" ;

} catch(ex) { alert("togDisp error" ) ; } }

/********************************************************************************
********************************************************************************/
function getElm(id) {  try {
    //alert("getElm");
    if(!id) return null;
    return document.getElementById( id );

} catch(ex) { alert("getElm error" ) ; }}

/********************************************************************************
********************************************************************************/
function hideShow( ctrl ) {  try {

     //alert("hideShow");

    if(!ctrl ) return;

    var rgId = ctrl.getAttribute("regionId");
    if( !rgId ) return;
    if( !curVisRegion ) {
        curVisRegion = getElm("home");
    }

    var region = getElm( rgId ) ;
    if (!region) return;
    if (curVisRegion) {
        togDisp(curVisRegion);
    }
    togDisp(region);
    if (region.style.display == "block") {
        ctrl.style.color = navHil;
        curTog = curTog.style ? curTog : getElm(curTog);
        if (curTog != ctrl) {
            curTog.style.color = "";
            // should be able to set to null - ie issue ?
        }
        curTog = ctrl;
    }
    curVisRegion = region;
    curTog = ctrl;
} catch(ex) { alert("hideShow error" ) ; } }

