﻿// JScript File
function reSizeMWindow()
{
      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;
      }
      if(myWidth>1024)
        myWidth = 1024;
      var sWidth;
      try
      {   
         if(myWidth<800)
          {
            document.getElementById("divMaster").style.width=(myWidth-30) + 'px';
            document.getElementById("divMasterMain").style.width = (myWidth-220) + 'px';
            document.body.attributes.item(0).value="yes";
          }
          else
          {
            document.getElementById("divMaster").style.width=(myWidth-25) + 'px';
            sWidth = myWidth-25;
            document.getElementById("divMasterMain").style.width=(sWidth-195) + 'px';
          }              
          document.getElementById("divLeft").style.width = 160 + 'px';
          document.getElementById("divMaster").style.height=(myHeight-20) + 'px';
          document.getElementById("divLeft").style.height=(myHeight-110) + 'px';
          document.getElementById("divMasterMain").style.height=(myHeight-126) + 'px';
          document.getElementById("divMasterMain").style.overflowX='hidden';	          
        }	        
        catch(e){};
}
function __open_hideMenu(sID,objTD)
{
    //document.getElementByID(sID).style   
    if(document.getElementById(sID).className=='IMenuContainerClose')
        {
            document.getElementById(sID).className='IMenuContainerOpen';
            if(screen.width<=800)
            {
                document.getElementById(sID).style.height='100px';
            }
        }
    else
        document.getElementById(sID).className='IMenuContainerClose';

    for(var i=1;i<20;i++)
        if(document.getElementById('IMnu' + i))
            if('IMnu' + i!=sID)
                document.getElementById('IMnu' + i).className='IMenuContainerClose';                
    reSizeMWindow();             
}
for(var i=1;i<20;i++)
    if(document.getElementById('IMnu' + i))
        for(var j=0;j<document.getElementById('IMnu' + i).childNodes.length;j++)
        {
            sUrl = document.getElementById('IMnu' + i).childNodes[j].childNodes[0].href;
            var sPos = sUrl.indexOf('?');
            if(sPos<0)sPos=sUrl.length;
            sUrl = sUrl.substr(0, sPos);
            if(sUrl.substr(sUrl.length-1,1)=='/')sUrl = sUrl.substr(0,sUrl.length-1);
            sHref = window.location.href;
            sPos = sHref.indexOf('?');
            if(sPos<0)sPos=sHref.length;
            sHref = sHref.substr(0,sUrl.length);
            if(sHref.substr(sHref.length-1,1)=='/')sHref = sHref.substr(0,sHref.length-1);
            if(sHref==sUrl){                
                __open_hideMenu('IMnu' + i);
                break;
            }
        }