﻿// JScript File


//Div functions for tooltip DIV
function ShowToolTip(ToolTipText)
{
    var ld = window.document.getElementById("ToolTipDiv");
    if (ld==null)
    {
        /*alert(parent.id +'-' + parent.getAttribute('class'));*/
        parent.ShowToolTip(ToolTipText);
    }
    else if(ld!=null)
    {
        ld.style.display="block";
    
        ld = window.document.getElementById("ToolTipText");
        if(ld!=null)
        {
            ld.innerHTML=ToolTipText;
            
        }
    }
}

function HideToolTip()
{
   var ld = window.document.getElementById("ToolTipDiv");
    if (ld==null)
    {
        parent.HideToolTip()
    }
    else
    {
        ld.style.display="none";
        ld = window.document.getElementById("ToolTipText");
        if(ld!=null)
        {
            ld.innerHTML= "";
        }
    }
 }

function ToggleToolTip(ToolTipText, Opacity) 
{
    var winH = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight;
    var ld = document.getElementById("ToolTipDiv");
    

    if (ld==null)
    {
        parent.ToggleToolTip(ToolTipText, Opacity)
    }
    else
    {
        if (ld.style.display=="block")
        {
            ld.style.display="none";
            ld = window.document.getElementById("ToolTipText");
            if(ld!=null)
            {
                ld.innerHTML="";
            }
        }
        else
        {
            ld.style.display="block";    
            
            ld = window.document.getElementById("ToolTipText");
            
            if(ld!=null)
            {
               
                ld.innerHTML= "Uitleg:<BR/><BR/>" + ToolTipText;
                if(Opacity!="")
                {
                    ld.style.filter = "progid:DXImageTransform.Microsoft.Alpha("+ Opacity + ")";
                }
            }
        }
    }   
}
 

//Div functions for PopupDiv on default.aspx
function ShowPopup(pageURL)
{
    var ld = window.document.getElementById("PopUpDiv");
    if (ld==null)
    {
        /*alert(parent.id +'-' + parent.getAttribute('class'));*/
        parent.ShowPopup(pageURL);
    }
    else if(ld!=null)
    {
        ld.style.display="block";
    
        ld = window.document.getElementById("PopUpPage");
        if(ld!=null)
        {
            ld.src=pageURL;
            
        }
    }
}

function HidePopup()
{
   var ld = window.document.getElementById("PopUpDiv");
    if (ld==null)
    {
        parent.HidePopup()
    }
    else
    {
        ld.style.display="none";
        ld = window.document.getElementById("PopUpPage");
        if(ld!=null)
        {
            ld.src= "tmpHTMLPage.htm";
        }
    }

 }

function GetParentElement(elemID, startObject)
{
        var foundElem=null;
        var i=0;
        var par = startObject
        while(foundElem==null && par != null && i<100)
        {
            par = par.parentNode;
            if (par != null)
            {
                foundElem=par.getElementById("PopUpDiv");
            }
            i=i+1;
        }
        
        return(foundElem)
}


// Div Functions for chartpage
    /*var winW = 630, winH = 460;
    if (parseInt(navigator.appVersion)>3) {
        if (navigator.appName=="Netscape") {
            winW = window.innerWidth;
            winH = window.innerHeight;
        }
        if (navigator.appName.indexOf("Microsoft")!=-1) {
            winW = document.body.offsetWidth;
            winH = document.body.offsetHeight;
        }
        document.body.attributes.
    }
*/
    function HideDiv(divID) {
             document.getElementById(divID).style.display="none";
            
      }
   function ShowDiv(DivID, Opacity) {
    var winH = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight;

            var ld = document.getElementById(DivID);
            document.getElementById("divLoadClock").style.height=  winH;
            ld.style.display="block";
            /*if(Opacity>0)
            {
                ld.style.filter = "progid:DXImageTransform.Microsoft.Alpha( Opacity=" + Opacity +", FinishOpacity=" + 100-Opacity +", Style=2, StartX=0,  FinishX=100, StartY=0, FinishY=100)";
            }*/
        }
   function ToggleDiv(DivID, Opacity) {
        var winH = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight;

            var ld = document.getElementById(DivID);
            if (ld==null)
            {
                parent.ToggleDiv(DivID, Opacity)
            }
            else
            {
                if (ld.style.display=="block")
                {
                    ld.style.display="none";
                }
                else
                {
                    document.getElementById("divLoadClock").style.height= winH;
                    ld.style.display="block";    
                    /*if(Opacity>0)
                    {
                        ld.style.filter = "progid:DXImageTransform.Microsoft.Alpha( Opacity=0, FinishOpacity=10, Style=2, StartX=0,  FinishX=100, StartY=0, FinishY=100)";
                    }*/
                }
            }
        }
     
     function CreateBigDiv(DivID, divHeight, divWidth, innerHTML)
     {
        var theBigDiv = window.document.createElement('div');
        theBigDiv.id = DivID;
        theBigDiv.setAttribute('style', 'position:absolute; width:100%; text-align:center; z-index:10000; background-color:White;  vertical-align:middle;');
        theBigDiv.style.display="none";
        theBigDiv.innerHTML = innerHTML;
        //BigDiv = '<div id="BigDiv" style="position:absolute; width:100%; text-align:center; z-index:10000; background-color:White;  vertical-align:middle; ">';
        window.document.body.appendChild(theBigDiv);

      }