$(document).ready(function() {	
	
	$(".fade").fadeIn(2000);
	
	/*$('a.submit').click(function() {
		if($('input[name="NAME"]').val()!="" && $('input[name="EMAIL"]').val()!="") {						 
			$('form').submit();
		} else {
			alert("Please enter your name and email.");
		}
	});
	
	$('form').submit(function() {
		$.ajax({
			type: "POST",
			url: $(this).attr("action"),
			data: $(this).serialize(),
			success: function() {
				//window.location.href="?p=thankyou"
			}
		});
		return false;
	});*/
		
	$jScroller.add("#marquee","#marqueecont","up",1);
	$jScroller.config.refresh = 75;
	$jScroller.start();
	
	$('.scroll-pane').jScrollPane({showArrows:true, verticalDragMaxHeight: 0, clickOnTrack:false});
	
	$("a.pressinfo").click(function() {
		src=$(this).attr("title");
		$("<img>").attr("src", "images/press/" + $(this).attr("title") + ".jpg").load(function() {
			$("#left img").fadeOut("medium", function() {
				$(this).remove();
				$("#left").html("<img src='images/press/" + src + ".jpg'>");
				$("#left img").fadeIn("medium");
			});
		});
	});
	
	$("#left img").show();
	
	$("a.fancybox").fancybox({
		padding:0
	});
		
	$("a.gallswitch").click(function() {
		var gall=$(this).attr("data-nav");
		var nowshowing=$("div.nav:visible").attr("class");
		if(gall != nowshowing) {
			$("div.nav:visible").hide();
			$("div.nav." + gall).show();
			$("a.gallswitch").each(function() {
				$(this).html($(this).attr("data-text"));
			});
			$(this).html("&raquo;" + $(this).text())
		}
	});
		
});
