/**
* On document content loading, use jQuery framework.
*/
$(document).ready(function(){
	/**
	* Any anchor with the class "external" is to be opened in a new window.
	* This is to ensure that the markup is XHTML 1.0 Strict compliant.
	*/
	$("a.external").attr("target", "_blank");

	/* Rounded corners */
	$("#splash").corner("20px");
	$("#footer").corner();
	$(".post").corner();
	$(".wp-caption").corner();
	$(".searchpage .page").corner();

	/* Search field */
	$("input#s")
		.focus (function(){this.value = '';})
		.blur  (function(){if(this.value == '') {this.value = 'Search';}})
		.val   ("Search");

	/* Rotating header */
	numberOfImages = 10;
	splashNumber = Math.floor(Math.random()*numberOfImages);
	$("#splash").css({ backgroundImage : "url(http://www.canameq\
uipment.com/images/header/splash" + (splashNumber++) + ".jpg)"});
	$(document).everyTime(8000, function() {	
		splashNumber %= numberOfImages;
		$("#splash").fadeOut("fast", function () {
			$(this).css({ backgroundImage : "url(http://www.canamequipment.com/images/header/splash" + (splashNumber++) + ".jpg)"});
			$(this).fadeIn("fast");
		});
	});
		
	/* Stripped table */
	$('tr:even').addClass('alternate');

});
