﻿function reSizeFlash () {

    if (document.getElementById('flashcontent')) {
    
        var flash_gallery = document.getElementById('flashcontent');
        var main_wrapper = document.getElementById('main_wrapper');
        var windowHeight;
        
        if (self.innerHeight) 
        {
            // all except Explorer
            windowHeight = self.innerHeight;
        } 
        else if (document.documentElement && document.documentElement.clientHeight) 
        {
            // Explorer 6 Strict Mode
            windowHeight = document.documentElement.clientHeight;
        } 
        else if (document.body) 
        {
            // other Explorers
            windowHeight = document.body.clientHeight;
        }
        
        windowHeight = windowHeight - 81;
        
        if (navigator.appVersion.indexOf("MSIE") != -1) 
        {
            version = parseFloat(navigator.appVersion.split("MSIE")[1]);
            if (version == 6)
            {
                flash_gallery.style.height = windowHeight + 'px';
                main_wrapper.style.height = windowHeight + 'px';
                return;
            }
        }
        flash_gallery.style.height = windowHeight + 'px';
    }
    return;
}

addNewEvent(window,'resize',reSizeFlash);
addNewEvent(window,'load',reSizeFlash);
addNewEvent(window,'load',function () {
            var searchBox = document.getElementById('gallery_search');
            if (searchBox) {
                searchBox.className = 'showing';
            } else {
                return false;
            }
        });

