/*
 * Copyright 2006 OST-SYSTEMS. All rights reserved.
 */

  function MyWindow(frameName) {
    var _self = this;
    this.param = 5;
    this.frame = frameName;
    this.prototype = window;
    
    this.resizeTo = function(width, height) {
      _self.prototype._resizeTo(_self, width, height);
    }

    this.resizeBy = function(width, height) {
      _self.prototype._resizeBy(_self, width, height);
    }
    
    this.alert = function(msg) {
      if (parent.location.hostname != "localhost") {
        parent.addError("Alert: " + msg);
      }
      else {
        parent.alert(msg);
      }  
    }
  }

  MyWindow.prototype = window;

  MyWindow.prototype._resizeTo = function(_self, width, height) {
      var element = document.getElementById(_self.frame);
      if (width != undefined && width != null) {
        element.setAttribute('width', parseInt(width));
      }
      if (height != undefined && height != null) {  
        element.setAttribute('height', parseInt(height));
      }
      if (myBrowser.isIE) {
        window.innerWidth = parseInt(element.getAttribute('width'));
        window.innerHeight = parseInt(element.getAttribute('height'));
      }  
      widgetResized(element);
  }
  
  MyWindow.prototype._resizeBy = function(_self, width, height) {
      if (width == undefined) {
        width = 0;
      }
      if (height == undefined) {
        height = 0;
      }
      var element = document.getElementById(_self.frame);
      element.setAttribute('width', parseInt(element.getAttribute('width')) + parseInt(width));
      element.setAttribute('height', parseInt(element.getAttribute('height')) + parseInt(height));
      if (myBrowser.isIE) {
        window.innerWidth = parseInt(element.getAttribute('width'));
        window.innerHeight = parseInt(element.getAttribute('height'));
      }  
      widgetResized(element);
  }
  
    

