//master: id of div element that contains the information about master data
//details: id of div element wrapping the details grid
function showhide(master, detail)
{
    var mstr = $(master);
    if(mstr)
    {
        //First child of master div is the image
        if(mstr.getChildren().length>0)
        {
            var src = mstr.getChildren()[0].src;
            //Switch image from (+) to (-) or vice versa.
            if (src.endsWith("plus.png")){
                src = src.replace('plus.png', 'minus.png');
                }
            else{
                src = src.replace('minus.png', 'plus.png');
                }

            //Set new image
            //document.getElementById(master).children[0].src = src;
            mstr.getChildren()[0].src = src;
        }
        //Toggle expand/collapse                   
        var dtl = $(detail);
        if(dtl.style.display != 'none'){
            dtl.style.display = 'none';
            }
        else{
            dtl.style.display = '';
             }
   }
}

    //else
/*                    //document.getElementById(detail).slideToggle("normal");
//                    if(dtl.currentStyle.display != "none"){*/
            //dtl.style.setAttribute("display",'none');
             //dtl.currentStyle.display = '';
//                        dtl.style.setAttribute("display",'');

function switchMenu(obj, val) {
    var el = document.getElementById(obj);
    var newIMG = ("img_" + val);
    if (el.style.display != "none") {
        el.style.display = 'none';
        document.getElementById(newIMG).src = 'images/plus.png';
    }
    else {
        el.style.display = '';
        document.getElementById(newIMG).src = 'images/minus.png';
    }
}

//function ShowModalPopup(){var modal = document.getElementById('ModalPopupExtender1'); modal.show();}

            
            
//            //master: id of div element that contains the information about master data
//            //details: id of div element wrapping the details grid
//            function showhide(master, detail) {
//                //First child of master div is the image
//                var src = $(master).children()[0].src;
//                //Switch image from (+) to (-) or vice versa.
//                if (src.endsWith("plus.png"))
//                    src = src.replace('plus.png', 'minus.png');
//                else
//                    src = src.replace('minus.png', 'plus.png');

//                //Set new image
//                $(master).children()[0].src = src;

//                //Toggle expand/collapse                   
//                $(detail).slideToggle("normal");
//            }
