
$(function(){
    
    //Nav Menu
    $(".submenu").hide();
    $(".rootmenu").mouseenter(function() {							   
       $(this).children('.submenu').stop(true, true).delay(200).slideDown("fast");
    });
    $(".rootmenu").mouseleave(function() {
       $(this).children('.submenu').stop(true, true).delay(200).slideUp("fast");
    });
    $(".uibutton").button();
    
    
    //do fade rollover effect on social media icons
    //as long as it's not IE
    if(!$.browser.msie) {
        $("#social_links a img").fadeTo(0, .5);
        $("#social_links a").hover(
            function() {
                $(this).children("img").fadeTo(250, 1);
            },
            function() {
                $(this).children("img").fadeTo(250, .5);
            }
        );
    }
    
    //buttonchange rollovers
    $(".buttonchange").hover(
        function() {
            $(this).attr("src",$(this).attr("src").replace('_btn','_over'));
        },
        function() {
            $(this).attr("src",$(this).attr("src").replace('_over','_btn'));
        }
    );
    
    //tag footer links for analytics site overlay....
    $("#footer_wrapper a").each(function() {$(this).attr("href", $(this).attr("href")+"?linkid=footer")})
    
    //tag navigation links for analytics site overlay....
    $("#navigation a").each(function() {$(this).attr("href", $(this).attr("href")+"?linkid=navigation")})
    
    //tag top bar links for analytics site overlay....
    $("#header_links a").each(function() {$(this).attr("href", $(this).attr("href")+"?linkid=topbar")})
    
       
    //uibutton
    //$(".uibutton").button();
            
    //

   //track pdf downloads in google analytics
  $("a").each(function(count, elem) {	
    try {
    if (/.pdf$/.test($(elem).attr('href').substring(-3).toLowerCase())) { 
      $(elem).click(function() {  
        _gaq.push(['_trackPageview', $(this).attr('href')]);  
      }); 
    }  
    } catch (err) {

    }
  });
});


