$(function(){
	// Accordion
	$(".accordion").accordion({ header: "h3" });
				$( ".accordion" ).accordion({ 
					collapsible: true, 
					autoHeight: false, 
					active: false 
				});
 
				$( ".accordion" ).accordion({ clearStyle: true });

	
	// Tabs
	$('#tabs').tabs();

	//Legislative Bill Detail
	$('#showFullSummary').click(function() {
		$('#partial-summary').hide();
		$('#full-summary').show();
		return false;
	});
	
	$('#showPartialSummary').click(function() {
		$('#full-summary').hide();
		$('#partial-summary').show();
		return false;			
	});
	
	$('#showAllCosponsors').click(function() {
		$('#partial-cosponsors').hide();
		$('#all-cosponsors').show();
		return false;
	});
	
	$('#showPartialCosponsors').click(function() {
		$('#all-cosponsors').hide();
		$('#partial-cosponsors').show();
		return false;			
	});
	
	//Scroll
	
	if (jQuery().jScrollPane) {
		//Scroll 
		$('.custom-scroll').jScrollPane({
			autoReinitialise: true,
			verticalGutter : 10
		});
	}

	//Header Signup Forms
   $('.header-link').css("cursor","pointer");
   $('.header-link').click(function () {
	  location.href='/?';
	  return false;
   });
   
   $('.box-subscribe').css("cursor","default");
   $('.box-subscribe').click(function () {
	  return false;
   });
   
   $('#form-subscribe-submit').click(function () {
	  $('#form-subscribe').submit();
   });
   
   
   $('#show-poll-question').click(function () {
		$('#poll-result').fadeOut('slow', function() {
			$('#poll-question').fadeIn('slow');										   
		});
   });
   
   $('#show-poll-result').click(function () {
		$('#poll-question').fadeOut('slow', function() {
			$('#poll-result').fadeIn('slow');										   
		});
   });
	
});   

function openWindow(linkUrl,target) {
	if (target == '_blank')
		window.open(linkUrl,'mywindow','width=800,height=500,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes,resizable=yes');
	else
		window.location = linkUrl;
	
	return;
}

function goBack() {
	window.location.href = document.referrer;
}
