$(document).ready(function(){
  
  /* --------------- Sidebar Hover Behavior ----------------- */

  $("#TB_Advocacy_Opportunities").mouseover(function(){
    if(GcurrentLanguage == "sp") $(this).attr("src", "http://c1237752.cdn.cloudfiles.rackspacecloud.com/tbAdvocacyOppsHoverSP.jpg");
    else if(GcurrentLanguage == "jp") $(this).attr("src", "http://c1237752.cdn.cloudfiles.rackspacecloud.com/tbAdvocacyOppsHoverJP.jpg");
    else $(this).attr("src", "http://c1237752.cdn.cloudfiles.rackspacecloud.com/tbAdvocacyOpportunitiesHove.jpg");
  }).mouseout(function(){
    if(GcurrentLanguage == "sp") $(this).attr("src", "http://c1237752.cdn.cloudfiles.rackspacecloud.com/tbAdvocacyOppsSP.jpg");
    else if(GcurrentLanguage == "jp") $(this).attr("src", "http://c1237752.cdn.cloudfiles.rackspacecloud.com/tbAdvocacyOppsJP.jpg");
    else $(this).attr("src", "http://c1237752.cdn.cloudfiles.rackspacecloud.com/tbAdvocacyOpportunities.jpg");
  });
  
  $("#Tell_A_Friend").mouseover(function(){
    if(GcurrentLanguage == "sp") $(this).attr("src", "http://c1237752.cdn.cloudfiles.rackspacecloud.com/tellAFriendHoverSP.jpg");
    else if(GcurrentLanguage == "jp") $(this).attr("src", "http://c1237752.cdn.cloudfiles.rackspacecloud.com/tellAFriendHoverJP.jpg");
    else $(this).attr("src", "http://c1237752.cdn.cloudfiles.rackspacecloud.com/tellAFriendHover.jpg");
  }).mouseout(function(){
    if(GcurrentLanguage == "sp") $(this).attr("src", "http://c1237752.cdn.cloudfiles.rackspacecloud.com/tellAFriendSP.jpg");
    else if(GcurrentLanguage == "jp") $(this).attr("src", "http://c1237752.cdn.cloudfiles.rackspacecloud.com/tellAFriendJP.jpg");
    else $(this).attr("src", "http://c1237752.cdn.cloudfiles.rackspacecloud.com/tellAFriend.jpg");
  });
  
  $("#Donate_Now").mouseover(function(){
    if(GcurrentLanguage == "sp") $(this).attr("src", "http://c1237752.cdn.cloudfiles.rackspacecloud.com/donateNowHoverSP.jpg");
    else if(GcurrentLanguage == "jp") $(this).attr("src", "http://c1237752.cdn.cloudfiles.rackspacecloud.com/donateNowHoverJP.jpg");
    else $(this).attr("src", "http://c1237752.cdn.cloudfiles.rackspacecloud.com/donateNowHover.jpg");
  }).mouseout(function(){
    if(GcurrentLanguage == "sp") $(this).attr("src", "http://c1237752.cdn.cloudfiles.rackspacecloud.com/donateNowSP.jpg");
    else if(GcurrentLanguage == "jp") $(this).attr("src", "http://c1237752.cdn.cloudfiles.rackspacecloud.com/donateNowJP.jpg");
    else $(this).attr("src", "http://c1237752.cdn.cloudfiles.rackspacecloud.com/donateNow.jpg");
  });
  
  $("#Our_Progress").mouseover(function(){
    $(this).attr("src", "http://c1237752.cdn.cloudfiles.rackspacecloud.com/ourProgressReportButtonHover.png");
  }).mouseout(function(){
    $(this).attr("src", "http://c1237752.cdn.cloudfiles.rackspacecloud.com/ourProgressReportButton.png");
  });
  
  /* --------------- Navigation Menu Interaction ----------------- */
  
  /*$("ul#Navigation_Menu ul.root").each(function() {
    $(this).removeClass("root");
    $(this).addClass("expandable");
    $(this).css({ opacity: 0, height: "1px" });
  });*/
  
  $("ul#Navigation_Menu li#Get_Educated_Menu").each(function() {
    $(this).hover(function() {
      $(this).children("ul:first").stop().css("display","block");
    }, function(){
      $(this).children("ul:first").stop().css("display","none");
    });
  });
  
  $("ul#Navigation_Menu li#Get_Involved_Menu").each(function() {
    $(this).hover(function() {
      $(this).children("ul:first").stop().css("display","block");
    }, function(){
      $(this).children("ul:first").stop().css("display","none");
    });
  });
  
  $("ul#Navigation_Menu li#Newsroom_Menu").each(function() {
    $(this).hover(function() {
      $(this).children("ul:first").stop().css("display","block");
    }, function(){
      $(this).children("ul:first").stop().css("display","none");
    });
  });
  
  /* --------------- Print Button Hover ----------------- */
  $("#print_link").hover(function() {
    $(this).find("img").attr("src","http://www.results.org/images/printer_friendly_hover.gif");
  }, function() {
    $(this).find("img").attr("src","http://c1237752.cdn.cloudfiles.rackspacecloud.com/printer_friendly.gif");
  });
  
});
