$j = jQuery.noConflict();
$j(document).ready(function($){
 $('#banner-text').innerfade({ speed: 'slow', timeout: 9000, type: 'sequence' }); 
	
	
    $('#primary-nav li, #global-nav li').hover(function(){
        $(this).addClass('hover').children('ul').show();
    }, function(){
        $(this).removeClass('hover').children('ul').hide();
    });
    
    $('#search input[type=text]').clearInput({
        defaultVal: 'Search'
    });
    
    $("a[href^=mailto:]").hover(function(e){
        if (pageTracker) {
            var mAddress = $(this).attr('href').replace('mailto:', '')
       //     alert(mAddress);
            pageTracker._trackEvent('MailTo', 'click', mAddress);
        }
    });
    
    $("a[href$='.doc'],	a[href$='.docx'],a[href$='.pdf'],a[href$='.xls'],a[href$='.xlsx'],a[href$='.ppt'],a[href$='.pptx'],a[href$='.zip'],a[href$='.txt'],a[href$='.vsd'],a[href$='.vxd'],a[href$='.js'],a[href$='.css'],a[href$='.rar'],a[href$='.exe'],a[href$='.wma'],a[href$='.mov'],a[href$='.avi'],a[href$='.wmv'],a[href$='.mp3']").click(function(e){
        if (pageTracker) {
         //   alert($(this).attr('href'));
            pageTracker._trackEvent('Download', 'click', $(this).attr('href'));
        }
    });
    
    $("a[href*='http://']:not([href*='" + window.location.hostname + "'])").click(function(e){
        if (pageTracker) {
         //   alert($(this).attr('href'))
            pageTracker._trackEvent('Outbound', 'click', $(this).attr('href'));
        }
    });
});


(function($){
    $.fn.clearInput = function(options){
        settings = jQuery.extend({
            defaultVal: 'Search'
        }, options);
        
        return this.each(function(){
            if ($(this).val() == '') {
                $(this).val(settings.defaultVal);
            }
            $(this).focus(function(){
                if ($(this).val() == settings.defaultVal) {
                    $(this).val('');
                }
            });
            $(this).blur(function(){
                if ($(this).val() == '') {
                    $(this).val(settings.defaultVal);
                }
            });
        });
    };
})(jQuery);

