// Contains a number of default scripts for the website


	/* -------------------------------------------------- *
	 * ToggleVal Plugin for jQuery                        *
	 * Version 1.0                                        *
	 * -------------------------------------------------- *
	 * Author:   Aaron Kuzemchak                          *
	 * URL:      http://kuzemchak.net/                    *
	 * E-mail:   afkuzemchak@gmail.com                    *
	 * Date:     8/18/2007                                *
	 * -------------------------------------------------- */
	
	jQuery.fn.toggleVal = function(focusClass) {
		this.each(function() {
			$(this).focus(function() {
				// clear value if current value is the default
				if($(this).val() == this.defaultValue) { $(this).val(""); }
				
				// if focusClass is set, add the class
				if(focusClass) { $(this).addClass(focusClass); }
			}).blur(function() {
				// restore to the default value if current value is empty
				if($(this).val() == "") { $(this).val(this.defaultValue); }
				
				// if focusClass is set, remove class
				if(focusClass) { $(this).removeClass(focusClass); }
			});
		});
	}
	


$(document).ready(function() {

	$(".inputToggle").toggleVal();

	$('#slideshow').cycle({
		cleartype: true,
		fx:     'scrollHorz', 
		timeout: 8000,
		pause: true,
		prev:   '#slideshowPrev', 
		next:   '#slideshowNext', 
		before: function() {
		$('#slideshow span').css('display','none');
		},
		after: function() {
		$('span', this).slideDown();
		}
	});

//	$("ul.tabs").tabs("div.panes > div");
	
//	$("#subSlider").scrollable();

//	$('#content a').filter(function() {
//		return this.hostname && this.hostname !== location.hostname;
//	}).after(' <img src="/common/images/linkicons/external.png" alt="external link" title="external link" />');

	$('#content a').filter(function() {
		$('a[href$=".pdf"]').not('a:has(img)').attr('class','pdflink').attr('title','Click to download file in PDF format');
		$('a[href$=".doc"]').not('a:has(img)').attr('class','doclink').attr('title','Click to download file in MS Word format');
		$('a[href$=".rtf"]').not('a:has(img)').attr('class','doclink');
		$('a[href$=".ppt"]').not('a:has(img)').attr('class','pptlink');
		$('a[href$=".xls"]').not('a:has(img)').attr('class','xlslink');
	});

//	$("p.qrcode a").tooltip();
//	$("#socialnetworks a").tooltip({ effect: 'slide'});

});


$(document).ready(function() {
	$('#content,#sidebar,#footer').corner("8px");
	$('#primaryNav li a span').corner("5px");
	$('#secondaryNav li.first a').corner("bl 5px");
	$('#secondaryNav li.last a').corner("br 5px");
	$('.findWrapper').corner("5px");
});

