
function nuevoAjax(){
	var xmlhttp=false;
 	try {
 		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
 	} catch (e) {
 		try {
 			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
 		} catch (E) {
 			xmlhttp = false;
 		}
  	}

	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
 		xmlhttp = new XMLHttpRequest();
	}
	return xmlhttp;
}

function eliminarFila(idRegistro){

	if (confirm("Quieres eliminar este registro?")){
		contenidoPrincipal = document.getElementById('interior');
		ajax=nuevoAjax();	
		ajax.onreadystatechange=function() {
			if (ajax.readyState==4) { //todo OK
				contenidoPrincipal.innerHTML = ajax.responseText;
			}
		}

		ajax.open("GET", "../modulos/noticias/ajaxRequests.php?func=delRow&delFrom=tblnews&colName=newsId&rowId="+idRegistro);
		ajax.send(null);
	}

}

function valUserForm(){

	var newsTitle, newsIntro;
	
	newsTitle = document.getElementById('newsTitle');
	newsIntro = document.getElementById('newsIntro');
	displayMensaje = document.getElementById('displayMensaje');
	displayMensaje.innerHTML = ""; //limpiamos el div de mensajes de error
	
	if (newsTitle.value==""){
		mostrarMensajesError(displayMensaje, "10px", "5px 0px 5px 0px", "bold", "14px", "1px dashed red", "90%", newsTitle, "#FF0000", "#FFFFFF", "Por favor ingrese el Titulo de las noticias");
		return false;
	}
	
	if (newsIntro.value==""){
		mostrarMensajesError(displayMensaje, "10px", "5px 0px 5px 0px", "bold", "14px", "1px dashed red", "90%", newsIntro, "#FF0000", "#FFFFFF", "Por favor ingrese la Introduccion de las noticias");
		return false;
	}	
	
}



