﻿// JScript File


  function ShowModalPopup(DomainName)
            {
                var parentcolor = window.document.body.style.backgroundColor;
                GetAllDivElement();
                //seperately change the footer color as it is not contained within main div
                changecolor("footer","#d0cece");
                window.document.body.style.backgroundColor = "#d0cece";
                window.showModalDialog(DomainName + "/Public/pages/ImageUpload.aspx"); 
                window.document.body.style.backgroundColor = parentcolor;
                window.location.reload();
            }
            
         
        function changecolor(id, color) 
        { 
            element = document.getElementById(id); 
            event.cancelBubble = true; 
            //oldcolor = element.currentStyle.background; 
            element.style.background = color; 
        } 
        
        function GetAllDivElement()
        {
            var MasterDiv = document.getElementById("mainDiv");
            // run through all contained div elements:
            var allContainedElements = MasterDiv.getElementsByTagName("div");
            for (var i = 0; i < allContainedElements.length; i++) 
            {
                var elem = allContainedElements[i];
                if(elem.id != "")
                {
                    //alert(document.getElementById(elem.id).style.color);
                    changecolor(elem.id,"#d0cece");
                    //document.getElementById(elem.id).style.visibility = "hidden";
                }
            }

          }