	$(document).ready(function() {
	
			$(".name").focus(function() {
				if ($(".name").attr('value') == 'Name') {
					$(".name").attr('value','');
					$(".name").val('');
				}
			});
			
			$(".name").blur(function() {
				if ($(".name").attr('value') == '') {
					$(".name").attr('value','Name');
				}
			});
				
			$(".email").focus(function() {
				if ($(".email").attr('value') == 'Email') {
					$(".email").attr('value','');
					$(".email").val('');
				}
			});

			$(".email").blur(function() {
				if ($(".email").attr('value') == '') {
					$(".email").attr('value','Email');
				}
			});

			$(".city").focus(function() {
				if ($(".city").attr('value') == 'City') {
					$(".city").attr('value','');
					$(".city").val('');
				}
			});

			$(".city").blur(function() {
				if ($(".city").attr('value') == '') {
					$(".city").attr('value','City');
				}
			});

			$(".what").focus(function() {
					$(".what").attr('value','');
					$(".what").val('');
			});
			

			$("#various3").fancybox({
				autoDimensions: true,
				centerOnScroll: true,
				padding: 10,
				margin: 10,
				scrolling: 'no',
				autoScale: true,
				type: 'iframe',
				height: 400, 
				overlayOpacity: .7
			});

			$("#mini").hover(
				function() {
					$("#mini-big").fadeIn();
				},
				function() {
					$("#mini-big").fadeOut();
			});
				
			$("#right_box").load("twitter.html", function () { tweety(); });
	
            $.preloadCssImages();

			$.validator.addMethod("noname", function(value) {
		          return value.indexOf("Name") != 0;
      		}, 'You must enter a real name!');

			$.validator.addMethod("nocity", function(value) {
		          return value.indexOf("City") != 0;
      		}, 'You must enter a city!');

			$.validator.addMethod("nocountry", function(value) {
		          return value.indexOf("Country") != 0;
      		}, 'You must select a country!');

			$.validator.addMethod("nowhere", function(value) {
		          return value.indexOf("Where did you get the Masters Series Life?") != 0;
      		}, 'You must select where you got the Masters Series Life!');

			$("#contestentry").validate({
				rules: {
					email: {required:true, email:true},
					name: {required:true, noname:true},
					city: {required:true, nocity:true},
					country: {required:true, nocountry:true},
					where: {required:true, nowhere:true}
				}, 
				submitHandler: function(form) {
					$('#contestentry').ajaxSubmit(function() { 
					  $('#formarea').fadeOut("slow");
					  $('#mp3download').fadeIn("slow");
					}); 
				}
			});


			$("#twitterentry").validate({
				rules: {what: "required"}, 
				submitHandler: function(form) {
					$('#twitterentry').ajaxSubmit(function() { 
						$('#twittersubmit').fadeIn("slow");
						$('#mp3form').fadeOut("slow");
						$('#right_box').load('twitter.html', function() { tweety(); });
					}); 
				}
			});

	});
