function recomendar(ida) {
	w = 402;
	h = 424;
	LeftPosition = (screen.width) ? (screen.width - w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height - h)/2 : 0;
	settings = 'height=' + h  + ',width=' + w+ ',top=' + TopPosition + ',left=' + LeftPosition + ',scrollbars=' + scroll
    window.open('../gremiales/noticias_gremiales_recomendar.php?ida=' + ida ,"_blank",settings);
}

function multimedia(mult) {
	w = 402;
	h = 424;
	LeftPosition = (screen.width) ? (screen.width - w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height - h)/2 : 0;
	settings = 'height=' + h  + ',width=' + w+ ',top=' + TopPosition + ',left=' + LeftPosition + ',scrollbars=' + scroll
    window.open('../gremiales/noticias_gremiales_multimedia.php?ida=' + mult ,"_blank",settings);
}

function controlar(){
	oDe = document.getElementById("email");
	oPara = document.getElementById("para");
	
	cad = "";
	
	if((oDe.value == "") || (oPara.value == "")){
		cad += "Su email y el de destinatario no deben estar vacios"	
		alert(cad);
		return false;
	}
	else {
		bool = false
		if(!validarEmail(oDe.value)) {
			cad += "Su mail no posee un formato valido \n\n";
			bool = true
		}
		
		if(!validarEmail(oPara.value)) {
			cad += "El formato de email de destinatario no es valido \n\n";
			bool = true
		}

		if(bool) {
			alert(cad);
			return false;
		}
		else return true;
	}
}

function validarEmail(valor){
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(valor)){
    	return true;
	}
	else{
		return false;
	}
}

