	$(document).ready(function(){ 	
		// open related documents in new window
		/*$('#related-widg a[rel="file"]').click(function(){
		  this.target = "_blank";
		});*/	
		// 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");});
		// use this to make entire table rows clickable and hoverable for news and events
		//$(".table-click tbody tr").click(function(){location.href = $(this).find("a").attr("href");}).hover(function () {$(this).addClass("hover");},function () {$(this).removeClass("hover");});
		$(".table-click tbody tr a").click(function(){
			window.location.href = $(this).attr("href");
		}).hover(function () {
			$(this).parents('tr:first').addClass("hover");},
			function () {
			$(this).parents('tr:first').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			
		// faq show hide code 
		$('ul#faqs .answer').hide(); // hide answers by default			
			$('a.question').click(function() {		
				$(this).next().slideToggle('fast');				
				$(this).toggleClass("close"); //toggle class on click to change icon if desired
				return false; 
			});

		$(".tweet").tweet({
			username: "mohavecc",
			join_text: "auto",
			avatar_size: 0,
			count: 2,
			auto_join_text_default: "we said:",
			//auto_join_text_ed: "we",
			auto_join_text_ed: "",
			auto_join_text_ing: "we said:",
			auto_join_text_reply: "we replied to",
			auto_join_text_url: "we were checking out",
			loading_text: "loading tweets..."
		});
	});	




