
function openSWFLayer(id, h) {
    hh = h || 0;
    iw_layer.init(hh);
    
}


var iw_layer = {

    intv: null,
    loghtml     : null,
    logbody     : null,
    
    init: function(hh) {
    
        //alert("init");
        
        /*** scrollbars ***/
        this.loghtml = document.getElementsByTagName('html')[0]
        this.logbody = document.getElementsByTagName('body')[0];
        this.loghtml.style.height = "100%";
        this.loghtml.style.width  = "100%";
        this.logbody.style.height = "100%";
        this.logbody.style.width  = "100%";
        /* 
        this.loghtml.style.overflow = "hidden";
         */
        /*** scrollbars ***/
        
        if ((/mac/i.test(navigator.platform))) {
             $('ovl').style.display = 'block';
             $('swflayer').style.display = 'block';
             return false;
        }
        
        
        this.setOpacity($('ovl_flash'), 0);
        
        
        $('ovl').style.height = document.getElementsByTagName('html')[0].scrollHeight + 'px';
        $('ovl').style.display = 'block';
        
        this.fadeIn($('ovl_flash'), 0, hh);
        
        return false;
    },
    
    setOpacity: function(el, op) {
        if ((document.all) && (!window.opera))
            el.style.filter  = "alpha(opacity="+ op + ")"; 
        else
            el.style.opacity = op/100;
    },
    
    fadeIn: function(el, op, hh) {
        
        if (op >= 70) {
            clearTimeout(this.intv);
             $('swflayer').style.height  = '0px';
            $('swflayer').style.display  = 'block';

             this.openForm($('swflayer'), 0, hh);
            return;
        }
        
        _self = this;
        
        op = op + 15;
        this.setOpacity(el, op);
        this.intv = setTimeout(function() {
            _self.fadeIn(el, op, hh);
        }, 2);
    },
    
    openForm: function(el, h, hh) {
        
        //alert("openform");
        var check = (hh === 0)? 600 : hh;
        
        if (h >= check) {
            clearTimeout(this.intv);
            return;
        }
        
        _self = this;
        
        h += ((document.all) && (!window.opera))? 60:60;
        
        el.style.height = h + 'px';        
        this.intv = setTimeout(function() {
            _self.openForm(el, h, hh);
        }, 15);
    
    },
    
    
    destroy: function() {
        $('ovl').style.display = 'none';
        $('swflayer').style.display = 'none';
        
        /*** scrollbars ***/
        this.loghtml.style.height = "auto";
        this.loghtml.style.width  = "auto";
        this.logbody.style.height = "auto";
        this.logbody.style.width  = "auto";  
        

        return false;

    }
    
    
}