// initialise plugins
$(function(){
		   
	// rotator
	//fade, scrollUp, scrollDown, scrollLeft, scrollRight, shuffle  
    $('#home-rotator').cycle({
		fx: 'fade',
		timeout: 4000
		});
	
	// show site map
	$('#showSiteMap').click(function(){
		$('#siteMap').slideToggle("fast");
		return false;
	});
	
	// make sure root menu items function:
	
	$("#btn-faq").click(function(){
	 var link = $("#btn-faq a").attr("href");
	 self.location.href=link;
	});
	
	$("#btn-news-resources").click(function(){
	 var link = $("#btn-news-resources a").attr("href");
	 self.location.href=link;
	});
	
	$("#btn-seminars").click(function(){
	 var link = $("#btn-seminars a").attr("href");
	 self.location.href=link;
	});
	
	$("#btn-contact").click(function(){
	 var link = $("#btn-contact a").attr("href");
	 self.location.href=link;
	});   
		   
	/* use of superfish the jQuery suckerfish */
	$('ul.sf-menu').superfish({
		animation:   {opacity:'show',height:'show'},  // fade-in and slide-down animation 
	    speed:       'fast',
		autoArrows	: true
	});

	/* these functions handle making sure the 'over' image sticks while sub nav is rockin */

	// About
	$("#btn-about").hover(function(){
	  $(this).addClass("about-over");
	},function(){
	  $(this).removeClass("about-over");
	});

	// Investors & Lenders
	$("#btn-investors-lenders").hover(function(){
	  $(this).addClass("investors-lenders-over");
	},function(){
	  $(this).removeClass("investors-lenders-over");
	});

	// Borrowers & Equity Partners
	$("#btn-borrowers-equity-partners").hover(function(){
	  $(this).addClass("borrowers-equity-partners-over");
	},function(){
	  $(this).removeClass("borrowers-equity-partners-over");
	});

	// IRA Education
	$("#btn-ira-education").hover(function(){
	  $(this).addClass("ira-education-over");
	},function(){
	  $(this).removeClass("ira-education-over");
	});

	// News & Resources
	$("#btn-news-resources").hover(function(){
	  $(this).addClass("nav-news-resources-over");
	},function(){
	  $(this).removeClass("nav-news-resources-over");
	});

	// Seminars
	$("#btn-seminars").hover(function(){
	  $(this).addClass("nav-seminars-over");
	},function(){
	  $(this).removeClass("nav-seminars-over");
	});

	// faq
	$("#btn-faq").hover(function(){
	  $(this).addClass("nav-faq-over");
	},function(){
	  $(this).removeClass("nav-faq-over");
	});

	// contact
	$("#btn-contact").hover(function(){
	  $(this).addClass("nav-contact-over");
	},function(){
	  $(this).removeClass("nav-contact-over");
	});
	
	// yank bottom border on bottom or single choices
	//$(".botty").css("border-bottom","0px");

});
