$(document).ready(function() {
	// get all the checkboxes
	var checkboxes = $("li.pop_form");

	// if any checkbox is clicked
	$(checkboxes).click(function() {
		// count how many of them are actually checked
		//var numChecked = checkboxes.is(":clicked");

		// display the form if at least one is displayed
		//if (numChecked)
		$('#hArticle').val(this.getAttribute('id'));
		$("#formInTheNewsOverlay").slideDown();
	});
	
	$("#closeOverlay").click(function() {
		$("#formInTheNewsOverlay").slideUp();
	});

	var articles_items = $("#right li");
	var displayed = false;

	$("#submit").click(function(){
		var name = $("#owners_full_name").val();
		var state = $("#owners_state").val();
		var email = $("#email").val();
		var verifyemail = $("#verifyemail").val();

		var ret = false;

		if (name == "") {
			alert('Please fill out your name.');
			$("#owners_full_name").focus();
		} else if (state == "") {
			alert('Please select your state.');
			$("#owners_state").focus();
		} else if (email == "" || email.indexOf("@") == -1) {
			alert('Please fill out your email.');
			$("#email").focus();
		} else if (email != verifyemail) {
			alert('Please verify your email is correct');
		} else {
			ret = true;
		}

		return ret;

	});
});

