jQuery.iJTSVnav = {
    build : function(options) {
        return this.each(
            function() {
                var el = this;
                el.navCfg = {
                    items : jQuery(options.items, this)
                };
                
                $(el.navCfg.items).hover(
                    function() {
                        $(this).children('a').children('img').addClass('active');
                        $('ul.navSub').css({zIndex:2});
                        $(this).children('ul.navSub').stop();
                        $(this).children('ul.navSub').css({height:'0px', display:'block', zIndex:10});
                        var height = $(this).children('ul.navSub').children().size() * 19;
                        $(this).children('ul.navSub').animate({height: height + 'px'}, 200);
                    },
                    function() {
                        $(this).children('a').children('img').removeClass('active');
                        $(this).children('ul.navSub').stop();
                        $(this).children('ul.navSub').animate({height:'0px'}, 100, 'linear', function() {
                            $('ul.navSub').css({display:'none'});
                        });
                    }
                );
            }
        )
    }
};

jQuery.fn.JTSVnav = jQuery.iJTSVnav.build;

$(document).ready(function() {
    $('#outdoorheader').JTSVnav({
        items: 'li.navMain'
    });
    if ($('#changeColorTo').length > 0) {
        $('html').click(function(e) {
            //alert('Body-Click');
            var txt = "";
            var txt = "";
            var obj = e;
            var tag = e.target;
            var url = $('#changeColorTo').attr('url');
            if (tag.tagName == 'HTML' || tag.tagName == 'BODY' || tag.id == 'outer') {
                addwindow = window.open(url, "addwin");
                addwindow.focus();
            }
        });
        color = $('#changeColorTo').attr('bgcolor');
        $('body').css('backgroundColor',color);
        $('body').css('cursor','pointer');
        $('#divFooter').css('cursor','default');
        $('#sub').css('cursor','default');
        $('#sub').css('backgroundColor','#FFFFFF');   
        $('#divFooter').css('backgroundColor','#FFFFFF');
    }
});

