$(function(){
   
    $('#nav li ul').addClass('sub');
   
    if (document.all) {
    	$("#nav li").hoverClass("sfHover");
    }    
    $("#nav li").hover(
    	function(){ $("ul", this).show(); }, 
		function() { } 
    ); 
    
    var img_array = [
        //'caseih_images/banner_01.jpg',
        'caseih_images/banner_02.jpg',
        'caseih_images/banner_03.jpg'
    ];    
    var ran_image = Math.floor(Math.random()*img_array.length);
    //$('div.image').attr('style', 'background: transparent url('+img_array[ran_image]+') 0 0 no-repeat');  
    // IE just didn't seem to want to handle replacing the style attribute only, so lets do the whole thing...
    $('div#header').html('<div class="image" style="background: transparent url('+img_array[ran_image]+') 0 0 no-repeat"><h1>Case IH</h1></div>');

});

$.fn.hoverClass = function(c) {
    return this.each(function(){
        $(this).hover( 
            function() { $(this).addClass(c);  },
            function() { $(this).removeClass(c); }
        );
    });
};