//-*- js2 -*-

function hideIntroAnim() {
    var self = hideIntroAnim;
    if (self.height == undefined) {
        self.height = jQuery('#introbox').height();
    }
    self.step = (self.step==undefined) ? 0 : self.step+0.2;
    self.offset = (self.offset == undefined) ? self.step : self.step+self.offset;
    jQuery('#introflashbox').css('top', -self.offset+'px');
    jQuery('#introbox').css('height',''+Math.max(0,(self.height-self.offset))+'px');

    if (self.height-self.offset>0) {
        setTimeout(hideIntroAnim,10);}
    else {
        jQuery('#introbox').css('display','none');
    }
}

function hideSWFIntroCallback() {
    jQuery('#introbox').height(Math.max(900,jQuery('#introbox').height()));
    jQuery('#watermark_back').css('display','block');
    jQuery('#pageholder1').css('display','block');
    if (jQuery('#pageholder1').height()<jQuery(window).height()) {
        jQuery('#watermark_back').css('bottom',(jQuery(window).height()-jQuery('#pageholder1').height()+11)+'px');
        jQuery('#pageholder1').height(jQuery(window).height()-89);
    }
    window.scroll(0,0);
    jQuery('#intro_flash_placeholder').css('display','none');
    setTimeout(hideIntroAnim,300);
}

function hideIntro(e) {
    e.stopPropagation();
    hideSWFIntroCallback();
    jQuery('#toggle-intro').css('display','none');
    return false;
}

jQuery(document).ready(
    function() {
        jQuery('#introbox').height(jQuery(window).height()+1);

        jQuery('#toggle-intro').bind('click',hideIntro);
    });

