$(document).ready(function() {

$(function() {
  $("a[href^=http://govdelivery.com/]").removeAttr("target");
  $("a[href^=http://www.govdelivery.com/]").removeAttr("target");
  $("a[href^=http://service.govdelivery.com/]").removeAttr("target");
  $("a[href*=.pdf]").attr("target","_blank");
});

$("ul.sf-menu").superfish({
	autoArrows: false							  
});

$("ul.sf-menu li").addClass("sifrHover");

$('li.sfHover li a').hover(function() {  
         $('li.sfHover a').css('color', '#ffffff');
});

$("#clientCollapsible").accordion({autoHeight: false,collapsible: true,animated: 'bounceslide', header: 'h2', icons: { 'header': 'ui-icon-plus', 'headerSelected': 'ui-icon-minus' } });

$("#contact").accordion({autoHeight: false,collapsible: true,animated: 'bounceslide', header: 'h2', icons: { 'header': 'ui-icon-plus', 'headerSelected': 'ui-icon-minus' }, active: false });

$("#demoreq").accordion({autoHeight: false,collapsible: true,animated: 'bounceslide', active: false});
$("#getquote").accordion({autoHeight: false,collapsible: true,animated: 'bounceslide', active: false});
$("#poweredForm").accordion({autoHeight: false, animated: 'bounceslide'});

$("#gallery").each( function() { $(this).showcase({
	navigator: { position: "top-left",
		item: {
			css: {  
					backgroundColor: "#cbcbcc",
					borderColor:"#ffffff" },
			cssHover: {
					backgroundColor: "#C1382B",
					borderColor: "#ffffff" },
			cssSelected: {
					backgroundColor: "#C1382B",
					borderColor: "#ffffff" }
					}
		},
	titleBar: { enabled: false }
	})
});

$.preloadCssImages();
	
// choose text for the show/hide link - can contain HTML (e.g. an image)
var showText='Full Bio';
var hideText='Hide';

// initialise the visibility check
var is_visible = false;

// append show/hide links to the element directly preceding the element with a class of "toggle"
$('.showHide').append('<a href="#" class="toggleLink">'+showText+'</a>');

// hide all of the elements with a class of 'toggle'
$('.toggle').hide();

// capture clicks on the toggle links
$('a.toggleLink').click(function() {

// switch visibility
is_visible = !is_visible;

// change the link depending on whether the element is shown or hidden
$(this).html( (!is_visible) ? showText : hideText);

// toggle the display - uncomment the next line for a basic "accordion" style
//$('.toggle').hide();$('a.toggleLink').html(showText);
$(this).parent().next('.toggle').toggle('fast');

// return false so any link destination is not followed
return false;
});

$("#tweets").tweet({
  avatar_size: 32,
  count: 5,
  query: "govdelivery",
  loading_text: "searching twitter..."
});

});
