var player;

$(document).ready(function(){

var videouploadbox = $('#uploadform_popup,#uploadform_overlay');

//videouploadbox.hide();

	$('#uploadlink').click(function(event){
		event.preventDefault();
		videouploadbox.show();
		
	
	});


	$('#close').click(function(event){
		event.preventDefault();
		videouploadbox.hide();
	})


	$('#uploadform').submit(function(){
		var errors = [];
		var nameval = $(this).find('#name').val();
		var emailval = $(this).find('#email').val();
		var fileval = $(this).find('#videoupload').val();
		
		if(fileval == ''){
			errors.push('Please select a file before continuing.');
		}
		if(nameval == ''){
			errors.push('Please enter your name.');
		}
		if(emailval == ''){
			errors.push('Please enter your email address.');
		}
		
		if(errors.length == 0){
			$(this).find('ul').hide();
			$('.directions').html('Your upload has started.<br/>Please do not leave this page.')
			return true;
		}else{
			alert(errors.join('\n'));
			return false;
		}
	
	})
})


