/*----------------------------------------
NYSCHP Javascript
Author: Marcus Ellis
Last Updated: Jun 20, 2011
(c) 2011 Affiniscape, Inc.
All Rights Reserved. This JavaScript file must not be reproduced without the express written permission of Affiniscape, Inc.
For questions regarding licensing or setup please contact Affiniscape, projects @ affiniscape dot com
----------------------------------------*/

var j = jQuery.noConflict();
j(document).ready(function($){
		
	// Sponsor Carousel
	$('#sponsors img').each(function(){
		var caption = $(this).attr('alt');
		$(this).before('<span class="caption">'+ caption +'</span>');
	});
	$('#sponsors ul').incSponsorCarousel({
		items: 4,
		width: 536
	});
	
	// Banner
	$('#banner ul').incMarketingBanner({
		showButtons: true,
		showPager: false
	});
	
	// Events
	$('#events-widget').new360events({
		url: 'http://m360.nyschp.org/viewcalendar.aspx',
		items: 4,
		style: 'compact',
		showLink: true,
		linkText: 'All events &raquo;'
	});
	
	// Login
	$('#login-widget').incLoginWidget({
		showLabels: false,
		showForgotUser: false,
		showForgotPass: true,
		showAutoLogout: false,
		forgotPassText: 'Forgot your Password?',
		buttonImage: '/associations/8780/imgs/btn-login.png',
		hoverImage: '/associations/8780/imgs/btn-login-hover.png'
	});
	
	// Search
	$('#search-widget').incSearchWidget({
		formAction: 'http://www.nyschp.org/searchsite.cfm',
		showLabel: false,
		buttonImage: '/associations/8780/imgs/btn-search.png',
		hoverImage: '/associations/8780/imgs/btn-search-hover.png'
	});
	
	// Left Nav
	$('#leftnavcell').addNavAccordion();
	
	// Footer
	$('body').addMegaFooter();
	$('#assnfooter').wrapInner('<div id="assnfooter-inner"></div>');
	
	// Benefit Calculator Modal
	$('.modal').fancybox({
		height: 505,
		href: $(this).attr('href'),
		overlayColor: '#000',
		overlayOpacity: 0.6,
		type: 'iframe',
		width: 680
	});
	
	// Feed Widget
	$('#feed-widget').incFeedWidget({
		url: 'http://www.ashp.org/rss/news/',
		items: 4
	});

	// Clickable Logo
    $('body').addClickableLogo({
        name: 'New York State Council of Health-System Pharmacists',
        url: 'http://www.nyschp.org'
    });

});

