
var $J = jQuery.noConflict();	

$J(function() {
	
	/* search */
	$J('#header form input').focus(function() { if($J(this).val() == 'Search') $J(this).val(''); }).blur(function() { if($J(this).val() == '') $J(this).val('Search'); });
							
	/* scroll */
	tee = 1;
		tees = Math.ceil($J('.scroller .one').length / 3);
			$J('.scroller').width(tees * 819); 
					
	$J('.next').click(function() { 
		$J('.scroll').removeClass('first last');
		if(tee < tees) { $J('.scroller').animate({ marginLeft: '-=819px' },1000,'easeOutBack'); tee++; }
		if(tee == tees) { $J('.next').addClass('last'); }
	return false; 	
	});
	
	$J('.prev').click(function() { 
		$J('.scroll').removeClass('first last');
			if(tee > 1) { $J('.scroller').animate({ marginLeft: '+=819px' },1000,'easeOutBack'); tee--; }
				if(tee == 1) { $J('.prev').addClass('first'); }
					return false; 	
	});
	
	/* fix hovers for IE6 */
	$J('.image').hover(
		function() { $J(this).addClass('imagehover'); },
			function() { $J(this).removeClass('imagehover'); }
	);
	
	$J('.prev').hover(
		function() { $J(this).addClass('prevhover'); },
			function() { $J(this).removeClass('prevhover'); }
	);
	
	$J('.next').hover(
		function() { $J(this).addClass('nexthover'); },
			function() { $J(this).removeClass('nexthover'); }
	);
	
	/* Get browser for browser-specific hacks */
	B = (function x(){})[-5]=='x'?'FF3':(function x(){})[-6]=='x'?'FF2':/a/[-1]=='a'?'FF':'\v'=='v'?'IE':/a/.__proto__=='//'?'Safari':/s/.test(/a/.toString)?'Chrome':/^function \(/.test([].sort)?'Opera':'Unknown';
	
	/* Firefox hacks */
	if(B == 'FF3') { $J('body').css('background-position','49.99% 0'); }
	if(B == 'FF2' || B == 'FF3') { $J('#header form input').css('padding-top','1px'); }
	
});