﻿// JScript File

function parentCheckBoxOnclick(parentForm, status, subCheckBoxName)
{          
    for(var i=0; i<parentForm.elements.length; i++)
    {            
        if(parentForm.elements[i].type == "checkbox" && parentForm.elements[i].name == subCheckBoxName) 
        {
            parentForm.elements[i].checked = status;
        }
    }
}

function subCheckBoxOnClick(status, parentCheckBox)
{
    if (status == false)
        parentCheckBox.checked = false;
}

var status = false;
function checkAll(parentForm, subCheckBoxName)
{          
    status = !status;
    for(var i=0; i<parentForm.elements.length; i++)
    {            
        if(parentForm.elements[i].type == "checkbox" && parentForm.elements[i].name == subCheckBoxName) 
        {
            parentForm.elements[i].checked = status;
        }
    }
}
//Display: none or inline an HTML Item (div, table v.v...)
function ColapseExpand(ItemId)
{
    if (document.getElementById(ItemId) != null)
    {
        if (document.getElementById(ItemId).style.display == "none")
            document.getElementById(ItemId).style.display = "inline";
        else
            document.getElementById(ItemId).style.display = "none";
    }
}

window.onload = function() {ColapseExpandOnload('divTransaction');}
function ColapseExpandOnload(ItemId)
{
    if (document.getElementById(ItemId) != null)
    {
        if (location.href.indexOf("page")>=0)
            document.getElementById(ItemId).style.display = "inline";
        else
            document.getElementById(ItemId).style.display = "none";
    }

}


