/* DHTML expand/contract
* Created: 28th January 2010
* Visit http://www.activepresentation.com
*/

// Old functions - not working in FF but OK in IE and Chrome

function showSection (divID){
//display the section if it's not displayed; hide it if it is displayed
if (divID.style.display=="none"){divID.style.display="inline"}
else{divID.style.display="none"}
}

function hideSection (divID){
//remove the section when user clicks in the opened DIV

// the following line produces an error in the .chm file but not in a browser so is commented out, preventing the div from being collapsed when clicked on

//if (divID.style.display=="inline"){divID.style.display="none"}

}
// HTML code for each <DIV> to show/hide:
// <a onclick="showSection(UID002)" href="javascript:hideSection('UID002')">Show me</a>
// <div style="DISPLAY: none" id="UID002" onclick="hideSection(UID002)">This is the content</div>


//New functions added based on http://www.webmasterworld.com/forum91/441.htm on 16NOV2010

function showhide(layer_ref) {
if (document.all) { // IE 4 onwards 
//alert('Browser 1');
if (eval("document.all." + layer_ref + ".style.display") == 'none') {
eval("document.all." + layer_ref + ".style.display = 'inline'"); 
}
else {
eval("document.all." + layer_ref + ".style.display = 'none'"); 
}
}
// NETSCAPE 
if (document.layers) { // Netscape 4 or below
//alert('Browser 2');
document.layers[layer_ref].display = state;
if (document.layers[layer_ref].display == 'none') {
document.layers[layer_ref].display = 'inline';
}
else {
document.layers[layer_ref].display = 'none';
}
}
// CHROME AND FIREFOX
if (document.getElementById &&!document.all) { // Chrome or FireFox
//alert('Browser 3');
hza = document.getElementById(layer_ref); 
if (hza.style.display == 'none') {
hza.style.display = 'inline';
}
else {
hza.style.display = 'none';
}
}
} 

// HTML code for each <DIV> to show/hide:
// <p><a href="#" onclick="showhide('div1');">show/hide me</a></p> 
// <div id="div1" style="display: none;">This is the content</div>
