    var currentLightboxId="LightBox";
	 
	function ResizeBox()
    {
       var lb = document.getElementById(currentLightboxId);
       if(lb != null){
           if(lb.style.display!="none")
           {
               document.getElementById("divBg").style.width=document.documentElement.clientWidth+document.documentElement.scrollLeft+"px";
               document.getElementById("divBg").style.left="0px";
               var position=findPosition(document.getElementById("dvInsight"));
                                
               document.getElementById(currentLightboxId).style.left=position[0]+235+"px";
           }
       }
    }
    
    window.onscroll=ResizeBox;
    window.onresize=ResizeBox;
    
    //**************************************************************************************
    //
    //
    
        function DisplayStoreHomeBox(divId,lightBoxId)
    {   
        var scrollHeight = document.documentElement.scrollTop;
        if(navigator.userAgent.toLowerCase().indexOf('chrome') > -1)
        {
            scrollHeight = document.body.scrollTop;
        }
        
        currentLightboxId=divId;
        //alert(currentLightboxId);
        document.getElementById("divBg").style.width=document.documentElement.clientWidth+document.documentElement.scrollLeft+"px";
        //document.getElementById("divBg").style.left="0px";
        var pFooter=document.getElementById("divfooter"); 
        var position=findPosition(pFooter);
        document.getElementById("divBg").style.height=position[1]+40+"px";  
          
        document.getElementById("divBg").style.display="";
        
        document.getElementById(currentLightboxId).style.display="";
            
        position=findPosition(document.getElementById("dvInsight"));
        document.getElementById(currentLightboxId).style.top= position[1] + scrollHeight + 80 + "px";
        
        //position=findPosition(document.getElementById("dvInsight"));
        var width= document.getElementById("dvInsight").offsetWidth;
                         
        document.getElementById(currentLightboxId).style.left=position[0]+280+"px";
    }

    function DisplayBox(divId,lightBoxId)
    {        

        
        currentLightboxId=divId;
        //alert(currentLightboxId);
        document.getElementById("divBg").style.width=document.documentElement.clientWidth+document.documentElement.scrollLeft+"px";
        //document.getElementById("divBg").style.left="0px";
        
        var pElement=document.getElementById("divfooter");     
        var position=findPosition(pElement);

  
        document.getElementById("divBg").style.height=position[1]+40+"px";  
          
        document.getElementById("divBg").style.display="";
        
        document.getElementById(currentLightboxId).style.display="";
            
        position=findPosition(document.getElementById("dvInsight"));
        document.getElementById(currentLightboxId).style.top= position[1] + 50 + "px";
        
        //position=findPosition(document.getElementById("dvInsight"));
        var width= document.getElementById("dvInsight").offsetWidth;
                         
        document.getElementById(currentLightboxId).style.left=position[0]+235+"px";

        var pindex = stepcarousel.configholder["mygallery"].currentpanel;
        stepcarousel.stepTo(lightBoxId,pindex+1);
    }
    
    function findPosition(pElement) 
    {
        var curleft = curtop = 0;
        if (pElement.offsetParent) 
        {
            curleft = pElement.offsetLeft
            curtop = pElement.offsetTop
            while (pElement = pElement.offsetParent) 
            {
                curleft += pElement.offsetLeft
                curtop += pElement.offsetTop
            }
        }
        return [curleft,curtop];
    }
    
    //hidden
    function HidBox()
    {
        document.getElementById("divBg").style.width="1px";    
        document.getElementById("divBg").style.height="1px"; 
        
        document.getElementById(currentLightboxId).style.display="none";
    }
