jQuery(function( $ ){
	// To one
	$('#contentOne').click(function(){
		$('div.mediaPreview').stop().scrollTo({top:0, left:0}, 800, {axis:'x'} );
		reset();
		active("#contentOne");
	});
	// To two
	$('#contentTwo').click(function(){
		$('div.mediaPreview').stop().scrollTo({top:0, left:616}, 800, {axis:'x'} );
		reset();
		active("#contentTwo");
	});
	// To three
	$('#contentThree').click(function(){
		$('div.mediaPreview').stop().scrollTo({top:0, left:1232}, 800, {axis:'x'} );
		reset();
		active("#contentThree");
	});
});

function reset()
{
	$("#contentOne").css('backgroundImage', "url('/template/snnv2/images/tabInactive.gif')");
	$("#contentTwo").css('backgroundImage', "url('/template/snnv2/images/tabInactive.gif')");
	$("#contentThree").css('backgroundImage', "url('/template/snnv2/images/tabInactive.gif')");
}

function active(object)
{
	$(object).css('backgroundImage', "url('/template/snnv2/images/tabActive.gif')");
}

function setDefault()
{
	jQuery(function( $ ){
		$('div.mediaPreview').stop().scrollTo({top:0, left:0}, 800, {axis:'x'} );
		active("#contentOne");
	});
}

window.onload = setDefault;