function blog_redireccionar(url){	document.location.href=url;	}function getXMLHttpRequest(){	var xmlhttp=false;	try{		// Crea objeto AJAX para navegadores diferentes a Internet Explorer		xmlhttp=new ActiveXObject("Msxml12.XMLHTTP");		}catch(e){		try{			// Crea objeto AJAX para navegadores de Internet Explorer			xmlhttp=new ActiveXObject("Microsoft:XMLHTTP");			}catch(E){			if(!xmlhttp && typeof XMLHttpRequest!='undefined'){				xmlhttp=new XMLHttpRequest();				}		}	}	return xmlhttp;}function enviarCorreo(idnombre,idcorreo){	var nombre=document.getElementById(idnombre);	var correo=document.getElementById(idcorreo);	var minombre=simularTrim(nombre.value);	var micorreo=simularTrim(correo.value);	if(minombre!="" && micorreo!="" && valEmail(micorreo) && minombre!="Tu nombre"){		var param="nombre="+minombre+"&correo="+micorreo;		var ajax=getXMLHttpRequest();		ajax.open("POST","http://localhost/carreras/httpdocs/enviarcorreo.php",true);		ajax.onreadystatechange=function(){			if(ajax.readyState==4){				alert("Correo enviado");				//jQuery.facebox({ ajax: 'http://localhost/carreras/httpdocs/validarmicorreo.php' });			}		}		ajax.setRequestHeader('Content-Type','application/x-www-form-urlencoded');		ajax.send(param);				nombre.value="";		correo.value="";	}else{		if(minombre=="" || minombre=="Tu nombre"){			alert("Complete su nombre");				nombre.focus();			nombre.value="";		}else if(micorreo=="" || !valEmail(micorreo)){			alert("Complete bien su correo");			correo.focus();			correo.value="";		}	}}function simularTrim(parametro){	var texto=parametro.replace(/^\s+|\s+$/gi, "");	return texto;}function valEmail(valor){    // Cortesa de http://www.ejemplode.com    re=/^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]+)*(.[a-z]{2,3})$/    if(!re.exec(valor))    {        return false;    }else{        return true;    }}function validarformulariocomentario(){	var comentario=document.getElementById('comment');	var autor=document.getElementById('author');	var correo=document.getElementById('email');	var captcha = document.getElementById('captcha_input');	var scomentario=comentario.value;	var sautor=autor.value;	var scorreo=correo.value;	var scaptcha = captcha.value;	if(simularTrim(scomentario)=="Tu comentario..." || simularTrim(scomentario)==""){		alert("Coloque un comentario");		comentario.focus();		return false;	}else if(simularTrim(sautor)=="Tu nombre..." || simularTrim(sautor)==""){		alert("Indique quien es");		autor.focus();		return false;	}else if(simularTrim(scorreo)=="Tu e-mail..." ||simularTrim(sautor)=="" || !valEmail(simularTrim(scorreo))){		alert("Coloque bien su correo");		correo.focus();		return false;	}else if(simularTrim(scaptcha)=="Código de arriba..." || simularTrim(scaptcha)==""){		alert("Ingrese el código de la imagen");		captcha.focus();		return false;	}else{				/*				alert ('llega');				var ajax=nuevoAjax();				ajax.open("POST", "procesar_captcha.php", true);				ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");				ajax.send("captcha_input="+escape(scaptcha)						  );				alert('procesa');				ajax.onreadystatechange=function(){						if (ajax.readyState==4)						{							var confirmacion = ajax.responseText;							alert(confirmacion);									}					}		alert('llegó');		return false;				if(){}		else{		return true;	}*/		return true;	}}
