var booltest = 0;

function toggleBox(szDivID, iState) // 1 visible, 0 hidden
{
    // Test to stop multiple layers being opened at any one time
    // Test bool value and the incoming request
    if(booltest == 1 && iState == 1){}
    
    // If the test is false ie. No other layers are currently open, open a layer
    else{
    
    if(document.layers)	   //NN4+
    {
       document.layers[szDivID].visibility = iState ? "show" : "hide";
    }
    else if(document.getElementById)	  //gecko(NN6) + IE 5+
    {
        var obj = document.getElementById(szDivID);
        obj.style.visibility = iState ? "visible" : "hidden";
    }
    else if(document.all)	// IE 4
    {
        document.all[szDivID].style.visibility = iState ? "visible" : "hidden";
    }

	// If a layer was just opened set the test bool to true
	if(iState == 1){booltest = 1;}
	
	// If a layer was just closed set the bool to false
	else if(iState == "0"){booltest = 0;}
	}
}


