$(function(){

	$(".error_msg").hide()

	$("#subscribe_form").bind("submit", function(){
	
		$(".error").removeClass("error")
		cb_valid = false
		valid = true
		
		$('.valid_cb').each(function(i){
			if($(this+':checked').size() != 0){
				cb_valid = true
			}
		})
		if(!cb_valid){
			$(".error_msg").slideDown()
			valid = false
		}
		$('.valid').each(function(i){
			if($(this).val().length == 0){
				valid = false
				$(this).addClass("error")
			}
		})
		
		if(!valid){
			alert("Please fill in all the mandatory fields")
			return false
		}
		else{
			return true
		}
	
		
	})
})
