$(document).ready(function(){
	initMenu();
	$("a[rel*=facebox]").facebox();
	$(".video").click(function() {
		// Remove existing borders and add new border
		$("#videoThumbs li a").removeClass('playing');
		$(this).addClass('playing');
		// Change the title to reflect the current video
        title = $(this).attr('alt');
		$(".currVideo").html(title);
		// Hide all video's, then show our new selection
       	showvid = $(this).attr('rel');
		$(".videobubble").hide();
		$("#"+showvid+"").show();
		// Move the pointer to the new thumbnail
		$("#vidpointer").removeClass().addClass(showvid);
		return false;
	});
	$("a[rel*=facebox]").click(function() {
		$("#prevue").fadeTo('fast', 0.2);
	});
	$("#email").toggleVal({
		focusClass: "focused",
		changedClass: "changed"
	});
	$("form#request").submit(function() {
		$("#button").hide();						   
		var email = $("input#email").val();
		var dataString = 'email='+ email;
		  $.ajax({
			type: "POST",
			url: "lib/request.php",
			data: dataString,
			success: function(html){
				$("#message").html("");
				$("#request").delay(500).fadeOut(500);
				$("#message").append(html).delay(1500).fadeIn(500);
			}
		  });
	  return false;
	});
});