/*----------------------------------------
HCAF Javascript
Author: Mitch Dunaway
Last Updated: October 5, 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($){
	
	// Clickable Logo
    $('body').addClickableLogo({
        name: 'Home Care Association of Association',
        url: 'http://www.homecarefla.org'
    });	
	
	// Feed Widget
	$('#feed-widget').incFeedWidget({
		url: 'http://hcaf.wordpress.com/feed/',
		items: 20,
		callback: function(){
			// Headlines
			$('.home .rss-list').incNewsWidget({
				time: 8,
				charLimit: 55
			});			
		}
	});
	
	

	// Footer
	var ftr = $('#footertablecell').html();
	$('#footertable').remove();
	$('body').append('<div id="assnfooter"></div>');
	$('#assnfooter').html(ftr);
    $('#assnfooter ul').makeacolumnlists({
		cols: 2,
		colWidth: 160,
		equalHeight: true
	});
	
	// Search
	$('#navtop1').wrap('<div id="navtop1div"></div>');
	$('#navtop1div').append('<div id="search-widget"></div>');
	$('#search-widget').incSearchWidget({
		formAction: 'http://www.homecarefla.org/searchsite.cfm',
		showLabel: false,
		buttonType: 'image',
		buttonImage: '/associations/1885/imgs/btn-search.png',
		hoverImage: '/associations/1885/imgs/btn-search-hover.png'
	});
	
	// Marketing Banner
	$('#marketing-banner').after('<div id="pager"></div>').addClass('imageRotation').cycle({
		time: 8000,
		fx: 'fade',
		random: 0,
		pager: '#pager'
	});
	
	// Sponsors
	$('#sponsors').incSponsorBox({
		time: 9
	});
	
	
	
	// Translate
	$('#navtop1 > li:eq(2) > a').attr('id','translate_link');
	$('#navtop1div').append('<div id="translate-widget"></div>');
	$('#translate-widget').incTranslationWidget();
	$('#translate-button').hover(function(){
		$('#translate_link').mouseover();
	}, function(){
		$('#translate_link').mouseout();
	});
	
	// Events
	$('#events-widget').new360events({
		url: 'http://m360.homecarefla.org/calendar.aspx',
		items: 3,
		style: 'compact'
	});

});

