// LCDScript Vr 1.0
// Scripts created by the IT Dept of LCDisability for the Suitability website

// Sid Shah - 12/02/2009


// used by a few pages to show/hide div tags
// when called, this function accepts a div tag id, loops thru all the div tags in the page, checks if the first 6 characters of the div tag id is 'lcddiv'
// if so, it checks if the name meets the name of the div tag being called & shows it - if not then it hides it.
// else it is not a lcddiv tag - so ignores it and moves to the next div tag
// Sid Shah - 12/02/2009

// renamed the function below from 'showhide' to 'lcddivshowhide'
// Sid Shah - 17/02/2009

function lcddivshowhide(pass) 
{ 
    var divs = document.getElementsByTagName('div'); // gets all the div tags within the page and stores it in an array
    for(i=0;i<divs.length;i++)  // loops thru all the div tags
    { 
        if(divs[i].id.substr(0,6).match('lcddiv'))  // checks if the current div tag is a LCD div tag, if not ignores it & moves to next div tag
        {
            if(divs[i].id.match(pass))  // checks if the current LCD div tag is the div we want to show - SHOWS IT
            {
                if (document.getElementById) // DOM3 = IE5, NS6 
                    divs[i].style.display="block";
                else 
                if (document.layers) // Netscape 4 
                    document.layers[divs[i]].display="block"; 
                else // IE 4 
                    document.all.divs[i].display="block"; 
            } 
            else    // not the LCD div tag we wanna show - HIDE IT
            { 
                if (document.getElementById) 
                    divs[i].style.display="none"; 
                else 
                if (document.layers) // Netscape 4 
                    document.divs[i].display="none"; 
                else // IE 4 
                    document.all.divs[i].display="none"; 
            }
        }
    } 
}