// JavaScript Document
	
	$(document).ready( function(){
								
			$("#detailsbox").hide();
$("#votelist li").hide();
$("#votelist #vote00").show();
				$("#votenav li a.introduction").addClass('selected');

			$("#name, #email").toggleVal("active");
			
			$("#votenav li a").click(function(e){
				$("#votenav li a").removeClass('selected');
				$(this).addClass('selected');
				$(this).blur();
				return false;
 			});
			
	
					
			$(".selectbutton").click(function(e){
				$(this).parent().parent().children('input').attr("checked", "checked"); 
				$("#votelist").hide();
				$("#votenav").hide();
				$("#detailsbox").fadeIn('normal', function(){
				$('#votelist').animate({scrollTop: '-=4000px'}, 'normal')} );
				$('#chosenwork').remove();
				$('\<p id=\"chosenwork\"\>\<\/p\>').insertAfter('#backtolist');
				$(this).parent().siblings('a').children('.artwork').clone().appendTo('#chosenwork');	
				$('#chosenwork').append('You are voting for: ');			
				$(this).parent().siblings('h4').children('.votename').clone().appendTo('#chosenwork');
				$("#chosenwork").show();
 			});
			
			$(".backtolist").click(function(e){
			$("#votenav").fadeIn();
				$("#votelist").fadeIn();
				$("#detailsbox").hide();
				return false;
   			});
			
			
			$("#votesubmit").click(function(e){
				emailval = $('#email').val();
				nameval = $('#name').val();
				if ((emailval == '') || (emailval == 'Email address') || (nameval == '') || (nameval == 'Your name')) {
				alert('Please make sure you have entered your name and a valid email address');
				return false;
   			}
			});


	} );