    if (top != self) top.location.href = location.href;
    deleteCookie("from_url");

    var gTimeout=null;
    var gSlideIdx=0;
    var gOpacity=0;

    function bec_SetOpacityEx(a, id) {
        gOpacity=a;
        obj=document.getElementById(id).style;
        obj.opacity = gOpacity/100;                 // Safari 1.2, newer Firefox and Mozilla, CSS3
        obj.KHTMLOpacity = gOpacity/100;            // older Safari, Konqueror
        obj.MozOpacity = gOpacity/100;              // older Firefox and Mozilla
        // IE/Win
        try {
            if(a<99) obj.filter = "alpha(opacity:"+gOpacity+")"; 
            else obj.removeAttribute('filter');     // fix IE/ClearType interaction
        } catch(err) {
        }
    }

    function bec_SetOpacity(a) {
        bec_SetOpacityEx(a, 'HomeContent');
        bec_SetOpacityEx(a, 'newsLeft');
    }

    function bec_ShowOneEx(a, opa) {
      clearTimeout(gTimeout);
      bec_SetOpacity(opa);
      //
      document.body.style.cursor = 'pointer';
      for(i=0; document.getElementById('a'+i); i++){
          content=document.getElementById('a'+i);
          tab=document.getElementById('b'+i);
           
          if(a=='a'+i) {
              gSlideIdx=i;
              content.style.display='';
              tab.style.backgroundColor='#d0d0d0';
              tab.style.color='#444444';
          } else {
              content.style.display='none';
              tab.style.backgroundColor='';
              tab.style.color='';
          }
      }
      // news scroller
      gNewsIdx = gSlideIdx%8;
      try
      {
          anchor=frames['newsLeft'].document.anchors[gNewsIdx];   // IE
      }
      catch(err)
      {
          frame=document.getElementById('newsLeft');
          anchor=frame.contentDocument.anchors[gNewsIdx];   // firefox
      }
      anchor.scrollIntoView(true);
    }

    function bec_ShowOne(a) {
      bec_ShowOneEx(a, 99);
    }

    function bec_Freeze() {
      clearTimeout(gTimeout);
      bec_SetOpacity(99);
    }

    function bec_Animate(next) {
      clearTimeout(gTimeout);
      if(next) {
        gSlideIdx = (gSlideIdx+1) % 10;
        bec_ShowOneEx('a'+gSlideIdx, 5);
      }
      document.body.style.cursor = 'default';
      bec_FadeIn();
    }

    function bec_FadeIn() {
      if(gOpacity < 95) {
          bec_SetOpacity(gOpacity+5);
          gTimeout=setTimeout(function(){bec_FadeIn()}, 20);
      } else {
          bec_SetOpacity(99);
          gTimeout=setTimeout(function(){bec_Animate(true)}, 5000);
      }
    }

    window.onload=function(){
        bec_ShowOne('a0');    
        bec_Animate(false);
    }

