function slideSwitch() {
    
    var $active = $('#slideshow IMG.active');

    if ( $active.length == 0 ) $active = $('#slideshow IMG:last');

    // use this to pull the images in the order they appear in the markup
    var $next =  $active.next().length ? $active.next() : $('#slideshow IMG:first');

    // uncomment the 3 lines below to pull the images in random order
    // var $sibs  = $active.siblings();
    // var rndNum = Math.floor(Math.random() * $sibs.length );
    // var $next  = $( $sibs[ rndNum ] );

    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 3000, function() {
            $active.removeClass('active last-active');
        });
}

sfHover = function() {
	var sfEls =  $('UL.nav LI'); // document.getElementById("dmn01").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}

var _sel = null;

function SubMenuToggle(obj, id) {

    if ( _sel == obj ) return false;
    
    if ( _sel ) {
        $(_sel).parent().children('SPAN').fadeIn();
        $(_sel).append(' >');
    }

    _sel = obj;
    
    $(obj).html( $(_sel).attr('_title') );
    $(obj).parent().children('SPAN').hide();
    $('UL.product-sub').slideUp().fadeOut();
    $('#'+id).slideDown().fadeIn();
    
    return false;
}

$(function(){
    
    sfHover();

    $('.nav LI UL LI').hover(function() {
        $(this).css('background', '#1D5F3F');
        $(this).find('A:first').css('color', '#FFFFFF');
        $(this).find('A:first').css('text-decoration', 'none');
    }, function() {
        $(this).css('background', '');
        $(this).find('A:first').css('color', '#FFFFFF');
        $(this).find('A:first').css('text-decoration', 'none');
    });
})

