/* BROWSER UPDATE */

var $buoop = {
    vs: {i:6,f:2,o:9.63,s:2,n:10},  // browser versions to notify
    reminder: 0,                   // atfer how many hours should the message reappear
    test: false,                    // true = always show the bar (for testing)
    text: "",                       // custom notification html text
    newwindow: false                // open link in new window/tab
}
$buoop.ol = window.onload; 
window.onload=function(){
	if ($buoop.ol) $buoop.ol(); 
	var e = document.createElement("script"); 
	e.setAttribute("type", "text/javascript"); 
	e.setAttribute("src", "http://browser-update.org/update.js"); 
	document.body.appendChild(e); 
}
/* END BROWSER UPDATE */

	// Palletways POD image code
	function openImage(ImgUrl) {
		var WinOpts = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=800,height=600';
		var imagewin = window.open(ImgUrl,'ImgWindow',WinOpts);
		imagewin.focus();
	}

jQuery.noConflict();

(function($) {
	/* Dom is loaded... */
	preloadImages("/img/throbber.gif");
		
	$("#trackForm").submit(function(event){			
		$("#trackSubmit").after('<img src="/img/throbber.gif" alt="Loading..." title="" style="vertical-align:middle;" />');
	})
	/* progressively enhance - show the Slider as JS is enabled */
	$("#slide-container").show();
	/* ... and hide the js-warning div */
	$("#js-warning").hide();
	
	/* search box value  - on get focus */
	$('#s').focus(function() {
		var s = $(this).val();
		
		if (s == 'Type some terms...') {
			$(this).val('');
		}
	})
	
	/* search box value - on lose focus */
	$('#s').blur(function() {
		var s = $(this).val();
		
		if (s == '') {
			$(this).val('Type some terms...');
		}
	})
	
	/* navigation */
	$("ul#nav li").hover( function() {
		$(this).addClass('active');
	}, function() {
		$(this).removeClass('active');
	})
	
	/* browser support for :last-child hack on navigation element. so for the do-it-online link, this happens to the style : */
	$("ul#nav > li:last-child > a").addClass('more_nav');
	
	$("ul#nav li:last-child ul")
		.css("-webkit-border-radius" ,"5px")
		.css("-moz-border-radius", "5px")
		.css("left", "-40px")
		.css("text-align", "right");
		
		/*
		#primary-nav-wrap ul#nav li:last-child ul {
			-webkit-border-radius: 5px;
			-moz-border-radius: 5px;
			left: -40px;
			text-align: right;
		}*/
		
	$("ul#footer-pages li:last-child")
		.css("border", "0");
	
	/* homepage slider */
	$("#slider").easySlider({
		speed: 200,
		auto: true,
		continuous: true,
		pause: 4000,
		allControls: true,
		hoverPause: true
	});
	
	function preloadImages() {
		for ( var i=0; i<arguments.length; i++) {
			$("<img>").attr("src", arguments[i]);
		}
	}
})(jQuery)