﻿var bGlobalAlertInternalError = true;
var bGlobalInTimer = false;
var bGlobalWantedResize = false;
var iGlobalBoxPanelStepHeight = 13;
var iGlobalBoxPanelInitialHeight = 26;
var iGlobalBoxPanelActualHeight = 0;
var iGlobalBoxPanelWantedHeight = 0;
var bGlobalBoxWindowActualVisible = false;
var bGlobalBoxWindowWantedVisible = false;
var iGlobalBoxWindowStepWidth = 50;
var iGlobalBoxWindowStepHeight = 50;
var iGlobalBoxWindowInitialWidth = 512;
var iGlobalBoxWindowInitialHeight = 384 + 25;
var iGlobalBoxWindowActualWidth = 0;
var iGlobalBoxWindowActualHeight = 0;
var iGlobalBoxWindowWantedWidth = 0;
var iGlobalBoxWindowWantedHeight = 0;
var oGlobalBoxPageOriginalBackgroung = null;
var iGlobalBoxPageActualLevel = 10;
var iGlobalBoxPageWantedLevel = 10;
var iGlobalBoxPageInitialLevel = 10;
var iGlobalBoxPageFadedLevel = 3;
var iGlobalBoxPageStepLevel = 7;
var bGlobalOnlyHorizontal = true;
var bGlobalLogoutWanted = false;
var aGlobalAjaxHttpRequests = null;
var aGlobalAjaxHttpResponses = null;

String.prototype.lpad = function(padString, length)
{
	var str = this;
    while (str.length < length)
        str = padString + str;
    return str;
}
 
String.prototype.rpad = function(padString, length)
{
	var str = this;
    while (str.length < length)
        str = str + padString;
    return str;
}

String.prototype.removezeros = function()
{
	var str = this;
   var bJeste = false;
   if (str.length > 0)
   {
      if (str.substring(0, 1) == "0")
      {
         bJeste = true;
      }
   }
   while (bJeste)
   {
      str = str.substring(1);

      bJeste = false;
      if (str.length > 0)
      {
         if (str.substring(0, 1) == "0")
         {
            bJeste = true;
         }
      }
   }
   return str;
}

Array.prototype.addItem = function(oToAdd)
{
   if (!this.contains(oToAdd))
   {
      this[this.length] = oToAdd;
   }
}

Array.prototype.removeItem = function(oToRemove)
{
   var j = 0;
   while (j < this.length)
   {
      if (this[j] == oToRemove)
      {
         this.splice(j, 1);
      }
      else
      {
         j++;
      }
   }
}

function stringVysekni(sText, sOd, sDo)
{
   var sResult = "";
   var iBegin = sText.indexOf(sOd);
   var iEnd = sText.indexOf(sDo, iBegin);
   if (iBegin != -1 && iEnd != -1)
   {
       sResult = sText.substring(iBegin + sOd.length, iEnd);
   }
   return sResult;
}

var MarkererInterestingStart = "{{{~~~TYGRIK.START~~~}}}";
var MarkererInterestingStop = "{{{~~~TYGRIK.STOP~~~}}}";


function getObjectByID(sID)
{
   var oReturn = null;
   if (oReturn == null)
   {
      try
      {
         oReturn = document.getElementById(sID);
      }
      catch (e) {}
   }
   if (oReturn == null)
   {
      try
      {
      	oReturn = document.all[sID];
      }
      catch (e) {}
   }
   if (oReturn == null && bGlobalAlertInternalError)
   {
      alert("Internal error: Object with ID=" + sID + " doesn't exist. / Interní chyba: Objekt s ID=" + sID + " neexistuje.");
   }
   return oReturn;
}

function savePageOriginalBackground()
{
   var boxMainArea = getObjectByID("BoxMainArea");
   if (boxMainArea != null)
   {
      if (boxMainArea.currentStyle) // Internet Explorer
      {
         oGlobalBoxPageOriginalBackgroung = colorConvert(boxMainArea.currentStyle.backgroundColor);
      }
      if (window.getComputedStyle) // Mozilla
      {
	      oGlobalBoxPageOriginalBackgroung = colorConvert(window.getComputedStyle(boxMainArea, null).backgroundColor);
      }   
   }
}

function colorConvert(sColor)
{ 
   if (sColor[0]=='r')
   // Handle rgb(redValue, greenValue, blueValue) format of Mozilla
   {
      var sTrimColor=sColor.substring(sColor.indexOf('(')+1, sColor.indexOf(')'));
      var oSplitColor = sTrimColor.split(',', 3);
      var oColor = new Object();
      oColor[0] = parseInt(oSplitColor[0]);
      oColor[1] = parseInt(oSplitColor[1]);
      oColor[2] = parseInt(oSplitColor[2]);		
      return oColor;
   }
   if (sColor.substring(0,1) == "#")
   // Handle the #RRGGBB' format of Internet Explorer
   {
      var oColor = new Object();
      oColor[0]=parseInt(sColor.substring(1, 3), 16);
      oColor[1]=parseInt(sColor.substring(3, 5), 16);
      oColor[2]=parseInt(sColor.substring(5, 7), 16);
      return oColor;
   }
   return null;
}

function colorHex(iColor)
{
   return ('0' + iColor.toString(16)).slice(-2);
}

function colorHashRGBText(oColor)
{
   if (oColor != null)
   {
      return "#" + colorHex(oColor[0]) + colorHex(oColor[1]) + colorHex(oColor[2]);
   }
   else
   {
      return "";
   }
}

function colorShade(oColor, iLevel)
{
   var oShade = new Object();
   var i = 0;
   for(i = 0; i < 3; i++)
   {
      oShade[i] = Math.round(oColor[i] * iLevel);
      oShade[i] = (oShade[i] > 255 ? 255 : oShade[i]);
      oShade[i] = (oShade[i] < 0 ? 0 : oShade[i]);
   }
   return oShade;
}

function switchScrollbars()
{
   var box = getObjectByID("Box");
   var boxMainArea = getObjectByID("BoxMainArea");
   if (box != null && boxMainArea != null)
   {
      boxMainArea.style.overflow = "auto";
      box.style.overflow = "hidden";
   }
}

function onClickPanelHide()
{
   iGlobalBoxPanelWantedHeight = 0;  
}

function onClickPanelShow()
{
   iGlobalBoxPanelWantedHeight = iGlobalBoxPanelInitialHeight;
}

function onClickLogout()
{
   bGlobalLogoutWanted = true;
   onClickPanelHide();
}

function doLogout()
{
   document.Panel.submit();
}

function onClickWindowHide()
{
   iGlobalBoxWindowWantedWidth = 0;
   iGlobalBoxWindowWantedHeight = 0;
   bGlobalBoxWindowWantedVisible = false;
   iGlobalBoxPageWantedLevel = iGlobalBoxPageInitialLevel; 
}

function onClickWindowShow()
{
   iGlobalBoxWindowWantedWidth = iGlobalBoxWindowInitialWidth;
   iGlobalBoxWindowWantedHeight = iGlobalBoxWindowInitialHeight;
   bGlobalBoxWindowWantedVisible = true;
   iGlobalBoxPageWantedLevel = iGlobalBoxPageFadedLevel; 
}

function onTimer()
{
   if (!bGlobalInTimer)
   {
      bGlobalInTimer = true;
	  
      doResize();
	  
	   bGlobalInTimer = false;
      setTimeout('onTimer()', 10);
   }
}

function onResize()
{
   bGlobalWantedResize = true;
}

function doResize()
{	
   if (bGlobalWantedResize || 
       iGlobalBoxPanelActualHeight != iGlobalBoxPanelWantedHeight || 
       iGlobalBoxWindowActualWidth != iGlobalBoxWindowWantedWidth || 
       iGlobalBoxWindowActualHeight != iGlobalBoxWindowWantedHeight)
   {
      if (iGlobalBoxPanelActualHeight != iGlobalBoxPanelWantedHeight)
      {
         if (iGlobalBoxPanelActualHeight > iGlobalBoxPanelWantedHeight)
         {
            iGlobalBoxPanelActualHeight = iGlobalBoxPanelActualHeight - iGlobalBoxPanelStepHeight;
         }     
         if (iGlobalBoxPanelActualHeight < iGlobalBoxPanelWantedHeight)
         {
            iGlobalBoxPanelActualHeight = iGlobalBoxPanelActualHeight + iGlobalBoxPanelStepHeight;
         }
	   }
        
      if (iGlobalBoxWindowActualHeight != iGlobalBoxWindowWantedHeight)
      {
         if (iGlobalBoxWindowActualHeight > iGlobalBoxWindowWantedHeight)
         {
            if (iGlobalBoxWindowActualHeight - iGlobalBoxWindowStepHeight > iGlobalBoxWindowWantedHeight)
            {
               iGlobalBoxWindowActualHeight = iGlobalBoxWindowActualHeight - iGlobalBoxWindowStepHeight;
            }
            else
            {
               iGlobalBoxWindowActualHeight = iGlobalBoxWindowWantedHeight;
            }
         }     
         if (iGlobalBoxWindowActualHeight < iGlobalBoxWindowWantedHeight)
         {
            if (iGlobalBoxWindowActualHeight + iGlobalBoxWindowStepHeight < iGlobalBoxWindowWantedHeight)
            {
               iGlobalBoxWindowActualHeight = iGlobalBoxWindowActualHeight + iGlobalBoxWindowStepHeight;
            }
            else
            {
               iGlobalBoxWindowActualHeight = iGlobalBoxWindowWantedHeight;
            }
         }
	   }

      if (iGlobalBoxWindowActualWidth != iGlobalBoxWindowWantedWidth)
      {
         if (bGlobalOnlyHorizontal)
         {
            if (iGlobalBoxWindowActualHeight != iGlobalBoxWindowWantedHeight)
            {
               iGlobalBoxWindowActualWidth = (iGlobalBoxWindowActualWidth > iGlobalBoxWindowWantedWidth ? iGlobalBoxWindowActualWidth : iGlobalBoxWindowWantedWidth);
            }
            else
            {
               iGlobalBoxWindowActualWidth = iGlobalBoxWindowWantedWidth;
            }
         }
         else
         {
            if (iGlobalBoxWindowActualWidth > iGlobalBoxWindowWantedWidth)
            {
               if (iGlobalBoxWindowActualWidth - iGlobalBoxWindowStepWidth > iGlobalBoxWindowWantedWidth)
               {
                  iGlobalBoxWindowActualWidth = iGlobalBoxWindowActualWidth - iGlobalBoxWindowStepWidth;
               }
               else
               {
                  iGlobalBoxWindowActualWidth = iGlobalBoxWindowWantedWidth;
               }
            }     
            if (iGlobalBoxWindowActualWidth < iGlobalBoxWindowWantedWidth)
            {
               if (iGlobalBoxWindowActualWidth + iGlobalBoxWindowStepWidth < iGlobalBoxWindowWantedWidth)
               {
                  iGlobalBoxWindowActualWidth = iGlobalBoxWindowActualWidth + iGlobalBoxWindowStepWidth;
               }
               else
               {
                  iGlobalBoxWindowActualWidth = iGlobalBoxWindowWantedWidth;
               }
            }
         }
	   }

      var bShadeNow = false;
      if (iGlobalBoxPageActualLevel != iGlobalBoxPageWantedLevel)
      {
         if (iGlobalBoxPageActualLevel > iGlobalBoxPageWantedLevel)
         {
            iGlobalBoxPageActualLevel = iGlobalBoxPageActualLevel - iGlobalBoxPageStepLevel;
            bShadeNow = true;
         }     
         if (iGlobalBoxPageActualLevel < iGlobalBoxPageWantedLevel)
         {
            iGlobalBoxPageActualLevel = iGlobalBoxPageActualLevel + iGlobalBoxPageStepLevel;
            bShadeNow = true;
         }
	   }

      var box = getObjectByID("Box");
      if (box != null)
      {
           var iBoxMainHeight = box.clientHeight - iGlobalBoxPanelActualHeight;
           var iBoxMainWidth = box.clientWidth;
      
           var boxPanel = getObjectByID("BoxPanel");
           var boxMain = getObjectByID("BoxMain");
           boxPanel.style.height = ((iGlobalBoxPanelActualHeight) + 'px');
           boxMain.style.height = ((iBoxMainHeight) + 'px');

           var boxWindow = getObjectByID("BoxWindow");
           boxWindow.style.left = ((iBoxMainWidth / 2) - (iGlobalBoxWindowActualWidth / 2)) + 'px';
           boxWindow.style.top = ((iBoxMainHeight / 2) - (iGlobalBoxWindowActualHeight / 2)) + 'px';
           boxWindow.style.width = ((iGlobalBoxWindowActualWidth) + 'px');
           boxWindow.style.height = ((iGlobalBoxWindowActualHeight) + 'px');
           window.defaultStatus = iGlobalBoxWindowActualHeight;

           if (bShadeNow)
           {
              var boxMainArea = getObjectByID("BoxMainArea");
              boxMainArea.style.backgroundColor = colorHashRGBText(colorShade(oGlobalBoxPageOriginalBackgroung, iGlobalBoxPageActualLevel * 0.1));
              boxMainArea.style.opacity = iGlobalBoxPageActualLevel * 0.1;
              boxMainArea.style.filter = 'alpha(opacity=' + iGlobalBoxPageActualLevel * 10 + ')';
           }
           
           if (bGlobalBoxWindowActualVisible != bGlobalBoxWindowWantedVisible)
           {
              if (bGlobalBoxWindowWantedVisible)
              {
                 if (iGlobalBoxWindowActualWidth != 0 ||                
                     iGlobalBoxWindowActualHeight != 0)
                 {
                    bGlobalBoxWindowActualVisible = true;
                    boxWindow.style.visibility = 'visible';
                    boxWindow.style.zIndex = 1;
                 }
              }
              else
              {
                 if (iGlobalBoxWindowActualWidth == iGlobalBoxWindowWantedWidth && 
                     iGlobalBoxWindowActualWidth == 0 && 
                     iGlobalBoxWindowActualHeight == iGlobalBoxWindowWantedHeight &&                
                     iGlobalBoxWindowActualHeight == 0)
                 {
                    bGlobalBoxWindowActualVisible = false;
                    boxWindow.style.visibility = 'hidden';
                    boxWindow.style.zIndex = -1;
                 }
              }
           }

           var boxWindowArea = getObjectByID("BoxWindowArea");
           if (iGlobalBoxWindowActualWidth == iGlobalBoxWindowWantedWidth &&                
              iGlobalBoxWindowActualHeight == iGlobalBoxWindowWantedHeight &&
              (boxWindowArea.scrollWidth - 2 > boxWindowArea.clientWidth ||
              boxWindowArea.scrollHeight - 2 > boxWindowArea.clientHeight))
              {
                 boxWindowArea.style.overflow = 'auto';
              }
              else
              {
                 boxWindowArea.style.overflow = 'hidden';
              }

           var boxWindowAreaPlaceArea = getObjectByID("BoxWindowAreaPlaceArea");
           if (iGlobalBoxWindowActualWidth == iGlobalBoxWindowWantedWidth &&                
              iGlobalBoxWindowActualHeight == iGlobalBoxWindowWantedHeight &&
              (boxWindowAreaPlaceArea.scrollWidth - 2 > boxWindowAreaPlaceArea.clientWidth ||
              boxWindowAreaPlaceArea.scrollHeight - 2 > boxWindowAreaPlaceArea.clientHeight))
              {
                 boxWindowAreaPlaceArea.style.overflow = 'auto';
              }
              else
              {
                 boxWindowAreaPlaceArea.style.overflow = 'hidden';
              }

	        bGlobalWantedResize = false;
           
           if (iGlobalBoxPanelActualHeight == iGlobalBoxPanelWantedHeight &&
               iGlobalBoxPanelActualHeight == 0 && 
               bGlobalLogoutWanted)
               {
                  bGlobalLogoutWanted = false;
                  doLogout();                
               }
               
           if (iGlobalBoxWindowActualHeight == iGlobalBoxWindowWantedHeight &&
               iGlobalBoxWindowActualWidth == iGlobalBoxWindowWantedWidth &&
               iGlobalBoxWindowActualHeight == 0 && iGlobalBoxWindowActualWidth == 0)
           {
              doGarbageWindow();
           }              
      }
   }
}
function doOpenWindow(sPage, sFire, sTitle, sClass, iWidth, iHeight)
{
   var oBoxWindowAreaTitle = getObjectByID("BoxWindowAreaTitle");
   if (oBoxWindowAreaTitle != null)
   {
      oBoxWindowAreaTitle.className = "ClassDivBoxWindowAreaTitle" + sClass;
   }
   
   var oBoxWindowAreaTitleAreaTitle = getObjectByID("BoxWindowAreaTitleAreaTitle");
   if (oBoxWindowAreaTitleAreaTitle != null)
   {
      oBoxWindowAreaTitleAreaTitle.innerHTML = sTitle;
   }

   var oBoxWindowAreaPlaceRezervace = getObjectByID("BoxWindowAreaPlace");
   if (oBoxWindowAreaPlaceRezervace != null)
   {
      oBoxWindowAreaPlaceRezervace.className = "ClassDivBoxWindowAreaPlace" + sClass;
   }

   var oBoxWindowAreaPlaceAreaRezervace = getObjectByID("BoxWindowAreaPlaceArea");
   if (oBoxWindowAreaPlaceAreaRezervace != null)
   {
      oBoxWindowAreaPlaceAreaRezervace.className = "ClassDivBoxWindowAreaPlaceArea" + sClass;
   }

   iGlobalBoxWindowInitialWidth = iWidth;
   iGlobalBoxWindowInitialHeight = iHeight + 25;
   onClickWindowShow();
  
   eval('doAjaxRequest("' + sPage + ',Random=' + useRandomString() + '.htm", "' + sFire + '")');  
//   setTimeout('doAjaxRequest("' + sPage + ',Random=' + useRandomString() + '.htm", "' + sFire + '")', 10);  
}

function doRefreshWindow(sPage, sFire)
{
   eval('doAjaxRequest("' + sPage + ',Random=' + useRandomString() + '.htm", "' + sFire + '")');  
//   setTimeout('doAjaxRequest("' + sPage + ',Random=' + useRandomString() + '.htm", "' + sFire + '")', 10);  
}

function doCloseWindow()
{
   onClickWindowHide(); 

   var oBoxWindowAreaTitleAreaTitle = getObjectByID("BoxWindowAreaTitleAreaTitle");
   if (oBoxWindowAreaTitleAreaTitle != null)
   {
      oBoxWindowAreaTitleAreaTitle.innerHTML = "Moment prosím...";
   }

   var oBoxWindowAreaPlaceArea = getObjectByID("BoxWindowAreaPlaceArea");
   if (oBoxWindowAreaPlaceArea != null)
   {
      oBoxWindowAreaPlaceArea.innerHTML = "<img src=\"Images/Window_Wait.gif\" alt=\"Moment prosím...\" class=\"ClassImgWindowWait\" />";
   } 
}

function doGarbageWindow()
{
   var oBoxWindowAreaTitleAreaTitle = getObjectByID("BoxWindowAreaTitleAreaTitle");
   if (oBoxWindowAreaTitleAreaTitle != null)
   {
      oBoxWindowAreaTitleAreaTitle.innerHTML = "Moment prosím...";
   }

   var oBoxWindowAreaPlaceArea = getObjectByID("BoxWindowAreaPlaceArea");
   if (oBoxWindowAreaPlaceArea != null)
   {
      oBoxWindowAreaPlaceArea.innerHTML = "<img src=\"Images/Window_Wait.gif\" alt=\"Moment prosím...\" class=\"ClassImgWindowWait\" />";
   } 

   var oBoxWindowAreaTitle = getObjectByID("BoxWindowAreaTitle");
   if (oBoxWindowAreaTitle != null)
   {
      oBoxWindowAreaTitle.className = "ClassDivBoxWindowAreaTitle";
   }
   
   var oBoxWindowAreaPlaceRezervace = getObjectByID("BoxWindowAreaPlace");
   if (oBoxWindowAreaPlaceRezervace != null)
   {
      oBoxWindowAreaPlaceRezervace.className = "ClassDivBoxWindowAreaPlace";
   }

   var oBoxWindowAreaPlaceAreaRezervace = getObjectByID("BoxWindowAreaPlaceArea");
   if (oBoxWindowAreaPlaceAreaRezervace != null)
   {
      oBoxWindowAreaPlaceAreaRezervace.className = "ClassDivBoxWindowAreaPlaceArea";
   }

   iGlobalBoxWindowInitialWidth = 512;
   iGlobalBoxWindowInitialHeight = 384 + 25;  
}

function doAjaxRequest(sURL, sFire)
{

   if (aGlobalAjaxHttpRequests == null)
   {
      aGlobalAjaxHttpRequests = new Array();
      aGlobalAjaxHttpResponses = new Array();
   }

   var oAjaxHttpRequest = null;   
   if (oAjaxHttpRequest == null)
   {
      try
      {
         if (window.XMLHttpRequest)
         { // Mozilla, Safari,...
            oAjaxHttpRequest = new XMLHttpRequest();
            if (oAjaxHttpRequest.overrideMimeType)
            {
               oAjaxHttpRequest.overrideMimeType('text/html');
            }
         }
      }
      catch (e) {}
   }

   if (oAjaxHttpRequest == null)
   {
      try
      {
         if (window.ActiveXObject)
         { // IE
            oAjaxHttpRequest = new ActiveXObject("Msxml2.XMLHTTP");
         }
      }
      catch (e) {}
   }
   
   if (oAjaxHttpRequest == null)
   {
      try
      {
         if (window.ActiveXObject)
         { // IE
               oAjaxHttpRequest = new ActiveXObject("Microsoft.XMLHTTP");
         }
      }
      catch (e) {}
   }
 
   if (oAjaxHttpRequest == null)
   {
      alert("Browser error: Cannot create XMLHTTP instance for ajax operation. / Chyba prohlížeče: Nelze vytvořit XMLHTTP ");
      return;
   }

   var iAjaxes = aGlobalAjaxHttpRequests.length;
   aGlobalAjaxHttpRequests[iAjaxes] = oAjaxHttpRequest;
   aGlobalAjaxHttpResponses[iAjaxes] = sFire;

//   eval("function onAjaxHandlerFireNumber() { onAjaxHandler(" + iAjaxes + "); }");

   var sAjaxHandler = "onAjaxHandler(" + iAjaxes + ")";

   oAjaxHttpRequest.onreadystatechange = function() { onAjaxHandler(iAjaxes); };
   oAjaxHttpRequest.open('GET', sURL, true);
//   oAjaxHttpRequest.setRequestHeader("Connection", "close");
//   oAjaxHttpRequest.setRequestHeader("Cache-Control", "no-store, no-cache, must-revalidate");
//   oAjaxHttpRequest.setRequestHeader("Pragma", "no-cache");
   oAjaxHttpRequest.send(null);
}

function useRandomString()
{
	var sChars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
	var iLength = 32;
	var sResult = "";
	for (var i = 0; i<  iLength; i++)
   {
		var iNum = Math.floor(Math.random() * sChars.length);
		sResult += sChars.substring(iNum, iNum + 1);
	}
	return sResult;
}

function onAjaxHandler(iAjaxes)
{
   if (iAjaxes >= 0 && iAjaxes < aGlobalAjaxHttpRequests.length)
   {
      var oAjaxHttpRequest = aGlobalAjaxHttpRequests[iAjaxes];
      var sFire = aGlobalAjaxHttpResponses[iAjaxes];

      if (oAjaxHttpRequest.readyState == 4)
      {
         if (oAjaxHttpRequest.status == 200)
         {
            var sResult = stringVysekni(oAjaxHttpRequest.responseText, MarkererInterestingStart, MarkererInterestingStop);
            var sFunctionFireHandler = sFire + "(sResult)";
            eval(sFunctionFireHandler);
         }
         else
         {
            alert('Comunication error: There was a problem with the AJAX request. / Komunikační chyba: Došlo k problému při AJAX požadavku.');
         }
      }
   }
}

function PanelInitialShowen()
{
   iGlobalBoxPanelActualHeight = iGlobalBoxPanelInitialHeight;
   iGlobalBoxPanelWantedHeight = iGlobalBoxPanelInitialHeight;
}

function PanelInitialHidden()
{
   iGlobalBoxPanelActualHeight = 0;
   iGlobalBoxPanelWantedHeight = 0;
}

function onLoadBase()
{
   switchScrollbars();
   onResize();
   window.onresize = onResize;
   savePageOriginalBackground();
   setTimeout('onTimer()', 10);
}

function onLoadPrint()
{
   window.print();
   window.close();
}

function onClickInformation()
{
   doOpenWindow("Tygrik-Ajax,Face=Work,Menu=Informace", "onFireUInformation",  "Vítejte v administračním rozhraní", "Info", 700, 400);
}

function onFireUInformation(sResult)
{
   var oBoxWindowAreaPlaceArea = getObjectByID("BoxWindowAreaPlaceArea");
   if (oBoxWindowAreaPlaceArea != null)
   {
      oBoxWindowAreaPlaceArea.innerHTML = sResult;
      oBoxWindowAreaPlaceArea.style.overflow = "auto";
   }
}
