function updateMenu(){
	var postID = $('body').attr("id");
	var pathname = window.location.pathname;

	if(pathname.search("learn") > 0 
	   || pathname.search("partnerships") > 0
	   || pathname.search("faq") > 0
	   || pathname.search("jobs") > 0
	   || pathname.search("team") > 0
	   || pathname.search("about") > 0) { $("#menu-learn").addClass("learn-on"); }
	else if(pathname.search("loan") > 0 || pathname.search("lend") > 0 || pathname.search("producer") > 0 ) { $("#menu-lend").addClass("lend-on"); }
	else if(pathname.search("promotion") > 0 || pathname.search("bundles") > 0) { $("#menu-enjoy").addClass("enjoy-on"); }
	else if(pathname.search("stories") > 0) { $("#menu-blog").addClass("blog-on"); }
	else if(pathname.search("myprofile") > 0 || pathname.search("editaccount") > 0 || pathname.search("transactionhistory") > 0) { $("#menu-profile").addClass("profile-on"); }
	else if(pathname.search("brand") > 0 || pathname.search("shop") > 0) { $("#menu-enjoy").addClass("enjoy-on"); }	
	
}

// $.fn.captionUp = function() { 
//	var capHeight = '+='+$(".widget_sp_image-description",this).height();
//	$(".widget_sp_image-description",this).show();
//	$("h2", this).animate({'padding-bottom': capHeight}, 100);
//}
//
//$.fn.captionDown = function() { 
//	$(".widget_sp_image-description",this).hide();
//	$("h2", this).animate({'padding-bottom': 3}, 100);
//}




$(document).ready(function() {	
	updateMenu();
	
	//$("#user-password, #user-email").one("focus", function() { $(this).val(""); });
	
	
	// $("#user-login").click(function(){ $(this).parent().submit(); })
	
	
	// Add onclick handler to checkbox w/id giftcheck
       $("#giftcheck").bind('change',function(){
       
         $(".gift-details").toggle(this.checked);
         $(".gift-details #gift-name").val("");
         $(".gift-details #gift-email").val("");
                      
      });
		
	
	
	    $('#content .featured-bundle .right-panel .image').cycle({
	        fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
	        pager:  '#fnav',
	        slideExpr: 'img' 
	    });


	
	$(".home-box:first h2").css("background", "#54B948");
	$(".home-box:last h2").css("background", "#8A1F03");
		
	$(".loan-button").click(function(){ $(this).parent().submit();});
	
	//box rollover reveals caption box
	//$(".widget_sp_image-image-link").parent().hover(
	//	function(){
			//slide up caption
	//		$(this).stop().captionUp();
	//	}, function () {
	//		$(this).stop().captionDown();
	//	}
	//);
	
        $("#rssfeed").rssfeed("http://www.jointhehoop.com/feed/", {
        limit: 10,
        header: false,
        content: true,
        date: true,
        snippet: true
        });
        
        $("#rssfeedplain").rssfeed("http://www.jointhehoop.com/feed/", {
        limit: 5,
        header: false,
        content: false,
        date: false,
        snippet: false,
        titletag:'p'
        });
        
        
        
	
});

function searchUsers()
{
    var url="manageusers.webui?";
    if ($("#searchbyemail").val().length>0)
    {
        url=url+"&email="+escape($("#searchbyemail").val());
    }    
    url=url+"&action=resetPaginator";
    window.location.href=url;
}
