$(document).ready(function() {

			$(function(){
				$("area[rel^='prettyPhoto']").prettyPhoto();
				
				$(".gallery:first a[rel^='prettyPhoto']").prettyPhoto({animation_speed:'normal',theme:'facebook',slideshow:3000, autoplay_slideshow: true});
				$(".gallery:gt(0) a[rel^='prettyPhoto']").prettyPhoto({animation_speed:'fast',slideshow:10000, hideflash: true});
		
				$("#custom_content a[rel^='prettyPhoto']:first").prettyPhoto({
					custom_markup: '<div id="map_canvas" style="width:260px; height:265px"></div>',
					changepicturecallback: function(){initialize();}
				});

				$("#custom_content a[rel^='prettyPhoto']:last").prettyPhoto({
					custom_markup: '<div id="bsap_1259344" class="bsarocks bsap_d49a0984d0f377271ccbf01a33f2b6d6"></div><div id="bsap_1237859" class="bsarocks bsap_d49a0984d0f377271ccbf01a33f2b6d6" style="height:260px"></div><div id="bsap_1251710" class="bsarocks bsap_d49a0984d0f377271ccbf01a33f2b6d6"></div>',
					changepicturecallback: function(){_bsap.exec();}
				});
			});

		$(function(){
			$(".gallery a[rel^='prettyPhoto']").prettyPhoto({theme:'facebook'});
		});
$(function() {
  $("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..."
});

});
