﻿
function toggle( id, dirID ) {
    if (document.getElementById) {
    if(document.getElementById(id) != null)
    {
		if(document.getElementById(id).style.visibility == "visible") {
	        document.getElementById(id).style.visibility = "hidden";
            removeDirectory ( dirID );
		} else {
	        document.getElementById(id).style.visibility = "visible";
            addDirectory ( dirID );
            }
		}
    } else {
        if (document.layers) {
			if (document.layers[id].visibility == "visible" ) {
	            document.layers[id].visibility = "hidden";
                removeDirectory ( dirID );
			} else {
				document.layers[id].visibility = "show";
                addDirectory ( dirID );
			}			
        } else {
            if (document.all) {
                eval("document.all." + id + ".style.visibility = \"" + IEtype + "\"");
            }
        }
    }
}

function addDirectory ( dirID ){
    var hidField = document.getElementById("expand");
    hidField.value = hidField.value + dirID + ',';
}

function removeDirectory ( dirID ){
   var hidField = document.getElementById("expand");
   if ( hidField.value.indexOf( dirID ) != -1) {
        hidField.value = hidField.value.replace( dirID + ',', ' ');
   }
}

function highlight ( id ){
    document.getElementById(id).style.border='3px';
}


function ClearSessionForMap()
{
   var hidField = document.getElementById("expand");
   if(hidField != null)
      hidField.value = hidField.value.replace('');
   
}