﻿// JScript File
function Open_Document(aID)
{ 
    if(screen.width<=800)
    {
        window.open('/display.aspx?' + aID,'General');        
    }
    else    
    {          
        ActivateDivD();                
        document.getElementById("framAct").src="/guest/content/display.aspx?" + aID;   
    }
}
function Open_Document(aID,sTitle)
{ 
    document.getElementById("sideHead").innerText = sTitle;
    if(screen.width<=800)
    {
        window.open('/display.aspx?' + aID,'General');        
    }
    else    
    {          
        ActivateDivD();                
        document.getElementById("framAct").src="/guest/content/display.aspx?" + aID;   
    }
}
function ActivateDivD()
{  
    
      var myWidth = 0, myHeight = 0;
      if( typeof( window.innerWidth ) == 'number' ) {
        //Non-IE
        myWidth = window.innerWidth;
        myHeight = window.innerHeight;
      } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
        //IE 6+ in 'standards compliant mode'
        myWidth = document.documentElement.clientWidth;
        myHeight = document.documentElement.clientHeight;
      } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
        //IE 4 compatible
        myWidth = document.body.clientWidth;
        myHeight = document.body.clientHeight;
      }      
      var objB;
      if (document.body.scrollTop) 
        objB = document.body;
      else if(document.documentElement.scrollTop)
        objB = document.documentElement;
      else
        objB = document.body;  
      
      if(objB.scrollTop<105)
      {
         document.getElementById("divAct").style.top = 105;
         document.getElementById("divAct").style.height=460;
         document.getElementById("framAct").style.height=460;
         var sWidth = myWidth-770;
         document.getElementById("divAct").style.left="767px";
         document.getElementById("framAct").style.width=sWidth;
         if(document.getElementById("framAct").style.height=='')
         {
            var myH = myHeight-35;
            document.getElementById("divAct").style.top=  objB.scrollTop.toString() + 'px';
            document.getElementById("divAct").style.height=myH.toString() + 'px';
            document.getElementById("framAct").style.height=myH.toString() + 'px';
            sWidth = sWidth - 20;
            document.getElementById("divAct").style.width= sWidth.toString() + 'px';
            document.getElementById("framAct").style.width= sWidth.toString() + 'px';        
            document.getElementById("framAct").style.display ="visible";
            document.getElementById("divAct").style.display ="visible";
         }
         else
         {
            document.getElementById("framAct").style.visibility ="visible";
            document.getElementById("divAct").style.visibility="visible";
         }
         if(document.getElementById("framAct").style.width=='0px')
         {
            var myH = myHeight-35;
            document.getElementById("divAct").style.top=  objB.scrollTop.toString() + 'px';
            document.getElementById("divAct").style.height=myH.toString() + 'px';
            document.getElementById("framAct").style.height=myH.toString() + 'px';
            sWidth = sWidth - 20;
            document.getElementById("divAct").style.width= sWidth.toString() + 'px';
            document.getElementById("framAct").style.width= sWidth.toString() + 'px';        
            document.getElementById("framAct").style.display ="visible";
            document.getElementById("divAct").style.display ="visible";
         }              
     }
     else if(objB.scrollTop>105)
     {
         document.getElementById("divAct").style.top = objB.scrollTop.toString() + ' px';
         document.getElementById("divAct").style.height=460;
         document.getElementById("framAct").style.height=460;
         var sWidth = myWidth-770;
         document.getElementById("divAct").style.left="767px";
         document.getElementById("framAct").style.width=sWidth;
         if(document.getElementById("framAct").style.height=='')
         {
            var myH = myHeight-35;
            document.getElementById("divAct").style.top=  objB.scrollTop.toString() + 'px';
            document.getElementById("divAct").style.height=myH.toString() + 'px';
            document.getElementById("framAct").style.height=myH.toString() + 'px';
            sWidth = sWidth - 20;
            document.getElementById("divAct").style.width= sWidth.toString() + 'px';
            document.getElementById("framAct").style.width= sWidth.toString() + 'px';        
            document.getElementById("framAct").style.display ="visible";
            document.getElementById("divAct").style.display ="visible";
         }
         else
         {
            document.getElementById("framAct").style.visibility ="visible";
            document.getElementById("divAct").style.visibility="visible";
         }
         if(document.getElementById("framAct").style.width=='0px')
         {
            var myH = myHeight-35;
            document.getElementById("divAct").style.top=  objB.scrollTop.toString() + 'px';
            document.getElementById("divAct").style.height=myH.toString() + 'px';
            document.getElementById("framAct").style.height=myH.toString() + 'px';
            sWidth = sWidth - 20;
            document.getElementById("divAct").style.width= sWidth.toString() + 'px';
            document.getElementById("framAct").style.width= sWidth.toString() + 'px';        
            document.getElementById("framAct").style.display ="visible";
            document.getElementById("divAct").style.display ="visible";
         }         
     }
}
function __Close_Me()
{   
    document.getElementById("framAct").style.width="1px";
    document.getElementById("framAct").src="about:blank";
    document.getElementById("divAct").style.visibility="hidden";
}
function ActivateDiv800()
{   
    document.getElementById("divAct").style.height="200px";
    document.getElementById("framAct").style.height="200px";
    document.getElementById("divAct").style.left="400px";
    document.getElementById("framAct").style.width="300px";
     var objB;
      if (document.body.scrollTop) 
        objB = document.body;
      else if(document.documentElement.scrollTop)
        objB = document.documentElement;
      else
        objB = document.body;
    document.getElementById("divAct").style.top = objB.scrollTop + 10;
    document.getElementById("divAct").style.visibility="visible";
}
function showMenu(objDiv)
{
if(document.getElementById("divMenu"))
{
   if(objDiv.scrollTop>10)
   {
    document.getElementById("divMenu").style.visibility = 'visible';
    document.getElementById("divMenu").style.top = '93px';
    var sWidth = document.getElementById("divMasterMain").style.width;
    sWidth = sWidth.replace('px','');
    document.getElementById("divMenu").style.width = (parseInt(sWidth) - 18) + 'px';
    document.getElementById("divMenu").style.position = "absolute";
   }
   else
   {
    document.getElementById("divMenu").style.visibility = 'hidden';
   }
}        
    if(document.getElementById("divRMenu"))
    {
        document.getElementById("divRMenu").style.visibility = 'visible';
        document.getElementById("divRMenu").style.top = '98px';
        var sWidth = document.getElementById("divMasterMain").style.width;        
        sWidth = sWidth.replace('px','');
        var sLeft = document.getElementById("divMasterMain").style.left;
        sLeft = sLeft.replace('px','');
        document.getElementById("divRMenu").style.width = (parseInt(sWidth) - 18) + (sLeft) + 'px';
        document.getElementById("divRMenu").style.position = "absolute";
    }
} 
if(document.getElementById("divRMenu"))
{
    document.getElementById("divRMenu").style.visibility = 'visible';
    document.getElementById("divRMenu").style.top = '98px';
    var sWidth = document.getElementById("divMasterMain").style.width;        
    sWidth = sWidth.replace('px','');
    var sLeft = document.getElementById("divMasterMain").style.left;
    sLeft = sLeft.replace('px','');
    document.getElementById("divRMenu").style.width = (parseInt(sWidth) - 18) + (sLeft) + 'px';
    document.getElementById("divRMenu").style.position = "absolute";
}   
