$(document).ready(function(){
	$('#submit-public').click(function() {
		bar = 0;
		$('div.required .required').each(function(i){
			if($(this).val() == '') {
				bar = 1;
				$(this).css("border-color","red");	
				var foo = $(this).parent();
				$(foo).css("color","#990000");	
				$(foo).css("font-weight","bold");	
			} else {
				$(this).css("color","#333333");
				$(this).css("border-color","#000000");	
				var foo = $(this).parent();
				$(foo).css("color","#333333");
			}
		});
		if(bar == 1) {
			$('html').attr('lang') == 'en' ? alt = "It seems that you missed some mandatory fields. \nPlease ensure that all of the fields in red have been filled out.":alt = "Parece que no has rellenado algunos de los campos obligatorios.\nAsegúarate de introducir la información en todos los campos en rojo.";
			alert(alt);
			return false;					 
		}
	});
	$('#submit-forms').click(function() {
		bar = 0;
		$('div.required .required').each(function(i){
			if($(this).val() == '') {
				bar = 1;
				$(this).css("border-color","red");	
				var foo = $(this).parent();
				$(foo).css("color","#990000");	
				$(foo).css("font-weight","bold");	
			} else {
				$(this).css("color","#333333");
				$(this).css("border-color","#000000");	
				var foo = $(this).parent();
				$(foo).css("color","#333333");
			}
		});
		if(bar == 1) {
			$('html').attr('lang') == 'en' ? alt = "It seems that you missed some mandatory fields. \nPlease ensure that all of the fields in red have been filled out.":alt = "Parece que no has rellenado algunos de los campos obligatorios.\nAsegúarate de introducir la información en todos los campos en rojo.";
			alert(alt);
			return false;					 
		}
	});

});
