/*
	Javascript content for corporate blue HTML site template
	Consult documentation for advanced help
*/


// configuration options
var opacity = 0.7;   // opacity of 'fadeimg' images onload/on mouse out 
var timeout = 5000;  // time each slide shows on frontpage - in milliseconds, 1000 = 1 second


// don't edit below here unless you know what to do
$(document).ready(function(){
	
	// this handles fading images on hover
	$('.fadeimg').hover(function(){
		$(this).fadeTo('fast', 1.0); 
	},function(){
		$(this).fadeTo('fast', opacity); 
	});
	
	// sets inital opacity of fade images
	$('.fadeimg').fadeTo('fast', opacity);

	// handles text in search 
	if($("#searchq").length > 0)
	{
		var text = $("#searchq").val();

		$("#searchq").focus( function(){
			if( $.trim($("#searchq").val()) == text ){ $("#searchq").val(''); }
		});
	   
		$("#searchq").blur( function(){
			if( $.trim($("#searchq").val()) == '' ){ $("#searchq").val(text); }
		});
	}

	// handles front page slider 
	if($("#slider").length > 0) 
	{
			$('#slider').s3Slider({
				timeOut: timeout
			});
		
	}
});
