	$(document).ready(function(){ 		
		// pullquote functionality
		$('span.pull-right').each(function(index) { 
			var $parentParagraph = $(this).parent('p'); 
			$parentParagraph.css('position', 'relative'); 
			$(this).clone() 
			  .addClass('pulled-right') 
			  .prependTo($parentParagraph); 
		}); 
		$('span.pull-left').each(function(index) { 
			var $parentParagraph = $(this).parent('p'); 
			$parentParagraph.css('position', 'relative'); 
			$(this).clone() 
			  .addClass('pulled-left') 
			  .prependTo($parentParagraph); 
		});		
		// use this to make entire LI's clickable and hoverable for news and events
		$(".full-hover li").click(function(){location.href = $(this).find("a").attr("href");}).hover(function () {$(this).addClass("hover");},function () {$(this).removeClass("hover");});
		// following swaps out inputs marked with class of swap on focus and puts back the default if nothing is entered on out focus
		// mainly being used for site wide search box
		swap_val = [];  
		$(".swap").each(function(i){  
			swap_val[i] = $(this).val();  
			orig_color = $(this).css("color"); // grab current color
			$(this).focusin(function(){  
				if ($(this).val() == swap_val[i]) {  
					$(this).val("");  
					$(this).css("color","black"); 
				}  
			}).focusout(function(){  
				if ($.trim($(this).val()) == "") {  
					$(this).val(swap_val[i]);  
					$(this).css("color", orig_color); 
				}  
			});  
		});  	
		$("table.sort-me").tablesorter(); // tables marked sort-me will allow columns to be sorted 
		$(".fancy-table tr:even").addClass("alt"); // tables marked fancy-table will have styling and alt table rows		
		$('#content-wrap img.caption').jcaption({
			copyAlignmentToClass: true
		}); //Find all images in the body and run a function on each of them		
		// quicklinks function 
		$("#quicklinks").click(function() {
			$("#quick-wrap").fadeIn('fast');
return false;
		});
		$("#quick-close").click(function() {
			$("#quick-wrap").fadeOut('fast');
return false;
		});		
		// home page carousel and slideshow functions	
		if ( $('#slides').length ) { //do something 		
			$('#slides').cycle({fx:'fade', timeout:5000, speed:1000, cleartype:  1,pager:'#slide-nav'});
			$('#slide-nav a').click(function() { 		
				$('#slides').cycle('pause'); 
						return false;
			});		
			$('#cta-slides').cycle({ 
				fx:    'scrollHorz', 
				speed:  '200', 
				timeout: 0, 
				next:   '#cta-next', 
				prev:   '#cta-prev' ,
				timeout:5000
			});			
		}
		if ( $('#news-carousel').length ) { //do something 		
			$("#news-carousel").jCarouselLite({
				btnNext: "#news-next",
				btnPrev: "#news-prev",		
				visible: 1,				
				start: 0,							
				circular: false				
			});	
			$(".arrows").click(function() { 				
				return false;
			});				
		}
		if ( $('#events-carousel').length ) { //do something 		
			$("#events-carousel").jCarouselLite({
				btnNext: "#events-next",
				btnPrev: "#events-prev",	
				visible: 1,
				start: 0,		
				circular: false
			});	
		}
	// leaving this in in case we want to go back to using this, simply adjusts appearance of widgets if more than 1 appear after another
	//	if ( $('#left-bar .widget').length ) { //do something 	
	//		var left = $("#left-bar .widget").length;			
	//		if (left>1) {
	//			$("#left-bar .widget").addClass('no-border');
	//			$("#left-bar .widget:last").removeClass('no-border');
	//		}
	//	}
	//	if ( $('#right-bar .widget').length ) { //do something 	
	//		var right = $("#right-bar .widget").length;			
	//		if (right>1) {
	//			$("#right-bar .widget").addClass('no-border');
	//			$("#right-bar .widget:last").removeClass('no-border');
	//		}
	//	}
			if ( $('#spotlight-tabs').length ) { //do something 	
				$('#spotlight-tabs div.master').hide();
				$('#spotlight-tabs div:first').show();
				$('#spotlight-tabs ul li:nth-child(2)').addClass('active'); 
				$('#spotlight-tabs ul li a').click(function(){
					$('#spotlight-tabs ul li').removeClass('active');
					$(this).parent().addClass('active');
					var currentTab = $(this).attr('href');
					$('#spotlight-tabs div.master').hide();
					$(currentTab).show();
                                        return false;					
				});
			}
				
	});	

