function ifzBehavior(){
   this.styleSheetName = "";
   this.actualItem=null;

   this.browserWidth = 0;
   this.browserHeight = 0;

   this.winHeight = 0;
   this.winWidth = 0;
   this.winTop = 0;
   this.winLeft = 0;

   this.selectItem = function(item, cssStyle, cssId){
      var ruletas = null;
      this.actualItem=item;
      this.normalItem(item);

      if (!(cssId) && cssStyle){
         item.style.cssText = cssStyle;
      }   
      else{  
         if (cssId && !(cssStyle)){
            ruletas = document.styleSheets.item(this.styleSheetName).rules;
            if (!(ruletas)){
               ruletas = document.styleSheets.item(this.styleSheetName).cssRules;
            }
            for (cont=0; cont < ruletas.length; cont++){
               expReg = new RegExp(cssId, "g");
               if (ruletas[cont].selectorText.match(expReg) != null){
                  item.style.cssText = ruletas[cont].style.cssText; 
               }
            }
         }   
      }
   }

   this.normalItem = function(item){
      itemType = item.tagName;
      itemName = item.name;
      items = document.getElementsByTagName(itemType);
      for (cont=0; cont<items.length; cont++){
         if (items[cont].name == itemName && items[cont] != this.actualItem){
            items[cont].style.cssText="";
         }
      }
   }
   
   this.toggleDisplayByID = function(idElem){
      if (document.getElementById(idElem).style.display == "" || document.getElementById(idElem).style.display == "none"){
         document.getElementById(idElem).style.display = "block";
      }
      else{
         document.getElementById(idElem).style.display = "none";
      }   
   }

   this.setWinDimension = function(width, height){
      if (parseInt(navigator.appVersion)>3) {
         if (navigator.appName=="Netscape") {
            this.browserWidth = window.innerWidth;
            this.browserHeight = window.innerHeight;
         }
         if (navigator.appName.indexOf("Microsoft")!=-1) {
            this.browserWidth = document.body.offsetWidth;
            this.browserHeight = document.body.offsetHeight;
         }
         this.winHeight = height;
         this.winWidth = width;
         this.winTop = this.browserHeight/2-100
         this.winLeft = this.browserWidth/2-200
      }
   }

   this.winDisplay = function(winNumber, winTitle, winContents){
      var oGen = new genBehavior();
      var contenidoWin = "strWin";
      
      strEval = contenidoWin + " = new Window('" + winNumber + 
        "', {className: " + String.fromCharCode(34) + "alphacube" + String.fromCharCode(34) +
        ", title: " + String.fromCharCode(34) + "<span style='font-family:verdana;font-weight:bold;'>" + winTitle + "</span>" + String.fromCharCode(34) +
        ", width:" + this.winWidth + ", height:" + this.winHeight + ", top:" + this.winTop + ", left:" + this.winLeft + "});"; 
      oGen.doEval(strEval);

      strEval = contenidoWin + ".getContent().innerHTML=" + winContents + ";";
      oGen.doEval(strEval);

      strEval = contenidoWin + ".setDestroyOnClose(true);";
      oGen.doEval(strEval);

      strEval = contenidoWin + ".show();";
      oGen.doEval(strEval);
      
      oGen = null;
   }

   this.fixCss = function(browser, ruleName, arrFixes){
      if (parseInt(navigator.appVersion)>3) {

         if (navigator.appName.toLowerCase().indexOf(browser.toLowerCase())!=-1) {

            ruletas = document.styleSheets.item("cssDefault").rules;
            if (!(ruletas)){
               ruletas = document.styleSheets.item("cssDefault").cssRules;
            }

            expReg = new RegExp(ruleName, "g");

            for (cont2=0; cont2 < ruletas.length; cont2++){

               if (ruletas[cont2].selectorText.match(expReg) != null){

                  cssText = ruletas[cont2].style.cssText.toLowerCase();

               for (cont = 0; cont < arrFixes.length; cont++){

                     expReg2 = new RegExp(arrFixes[cont][0], "g");

                     cssText = cssText.replace(expReg2, arrFixes[cont][1]);
  
                     ruletas[cont2].style.cssText = cssText;
                  }
               }
               
            }
         }
      }
   }
}
