
ids = new Array( "all", "info", "info2", "stat", "fail", "cal", "star", "ranges", "limits", "showquery");
statarr = new Array( 1, 0, 0, 0, 0, 0, 0, 0, 0, 0);

function setdisplays ()
{
    var blub="";
    for (var i = 0 ; i < ids.length ; i++)
    {
        var d = document.getElementById(ids[i]);
        if (d)
            d.style.display == 'none' ? statarr[i]=0 : statarr[i]=1;
        if (i==0)
            statarr[i]=0;
        blub=blub+statarr[i];
    }
    return blub;
}

function show(el,img)
{
    el.style.display="none";
    if (img)
        img.src='../plus.png';
}

function hide(el,img)
{
    el.style.display="block";
    if (img)
        img.src='../minus.png';
}

function showhide (id)
{
    var el = document.getElementById(id);
    var img = document.getElementById(id+"button");
    el.style.display == 'block' ? show(el,img) : hide(el,img);
    var soso = document.getElementById("sh");
    soso.value = setdisplays();
}

function getdisplay()
{
    var stat = document.getElementById("sh");
    statvalue=stat.value;
    for (var i = 0 ; i < ids.length ; i++)
    {
        var status = statvalue.slice(i,i+1);
        var el = document.getElementById(ids[i]);
        var img = document.getElementById(ids[i]+"button");
        if (!el)
            continue;
        status==0 ? show(el,img) : hide(el,img);
    }
}
