$(function(){
// tweeter
	getTwitters('tweet', { 
		id: 'asaecenter', 
		count: 2, 
		enableLinks: true, 
		ignoreReplies: true, 
		clearContents: true,
		template: '%text%<br /><a href="http://twitter.com/%user_screen_name%/statuses/%id_str%/" target="_blank" class="tweet-link">%time%</a>'
	});
//masonary plugin settings
	$(window).load(function() {
	  	$('#content').masonry({
			columnWidth: 325,
			singleMode: true,
			itemSelector: '.news-item'
		});
	});
	
//cycle plugin settings

	$('#about-rotate').cycle();

// sidebar menu last item class
	$('ul#menu-sidebar-menu li:last').addClass('last');

// members table pagination
	if($('table.members').length > 0) {
		 $('table.members').tablePagination({
			ignoreRows : $('tr:first'),
		    optionsForRows : [25,50,100],
		    rowsPerPage : 25,
		    firstArrow : (new Image()).src="/wp-content/themes/thepowerofa/images/first.gif",
		    prevArrow : (new Image()).src="/wp-content/themes/thepowerofa/images/prev.gif",
		    lastArrow : (new Image()).src="/wp-content/themes/thepowerofa/images/last.gif",
		    nextArrow : (new Image()).src="/wp-content/themes/thepowerofa/images/next.gif"

		 });
	}

//asae members form	 
	if ($('#country').val() != 'United States') {
		$('#state').attr('disabled', 'disabled');
	}
	$('#country').change(function(){
		if ($(this).val() == 'United States') {
			$('#state').attr('disabled', '');
		} else {
			$('#state').attr('disabled', 'disabled');
			$('#state').val('0');
		}
	});
	
// privacy policy
	$('.comments-policy-link').click(function(){
		$('.comments-policy').show();
		return false;
	});
	$('html').click(function(e){
		if($(e.target).parents('.comments-policy').length == 0) {
			$('.comments-policy').hide();
		}
	})
	$('.close-btn').click(function(){
		$('.comments-policy').hide();
		return false;
	});
	 
});

