function objetus() { try { objetus = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { objetus= new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { objetus= false; } } if (!objetus && typeof XMLHttpRequest!='undefined') { objetus = new XMLHttpRequest(); } return objetus } function sendmsg(msg,profile) { //alert (profile); function objetus() { try { objetus = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { objetus= new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { objetus= false; } } if (!objetus && typeof XMLHttpRequest!='undefined') { objetus = new XMLHttpRequest(); } return objetus } _objetus=objetus() //cargamos una varible con las variables que vamos a enviar _values_send="msg="+msg+"&user="+profile; _URL_="chatear.php?"; _objetus.open("GET",_URL_+""+_values_send,true); //alert (_URL_ + "" + _values_send ); //una vez enviado los valores inmediatamente llamamos a la propiedad //onreadystatechange _objetus.onreadystatechange=function() { //dentro de la funcion comprobamos el estado del proceso //si es 4 (terminado) pedimos lo que nos han mandado if (_objetus.readyState==4) { //si se da un status 200 (TERMINADO CON EXITO) if(_objetus.status==200) { //usamos la propiedad responseText para recibir en una cadena //lo que nos mandaron //window.alert(_objetus.responseText); } } } _objetus.send(null); } function limpiar(profile) { var ifr = document.getElementById(profile); ifr.contentWindow.document.body.innerHTML = ""; // Limpia el buffer. ifr.contentWindow.scroll(0,0); } function enviar(profile) { var smileys = new Array(); var url = "http://www.gentefriki.com/"; smileys[':sonrisa:'] = ""; smileys[':sonrisota:'] = ""; smileys[':trizte:'] = ""; smileys[':llora1:'] = ""; smileys[':cachulo:'] = ""; smileys[':picandoelojo:'] = ""; smileys[':fumeta:'] = ""; smileys[':estrella:'] = ""; smileys[':corazon:'] = ""; smileys[':beso:'] = ""; var el = document.getElementById('Enviar'+profile+''); var ifr = document.getElementById(''+profile+''); //var html = ifr.contentWindow.document.body.innerTEXT; while (el.value.match(":sonrisa:")!=null || el.value.match(":sonrisota:")!=null || el.value.match(":trizte:")!=null || el.value.match(":llora1:")!=null || el.value.match(":cachulo:")!=null || el.value.match(":picandoelojo:")!=null || el.value.match(":fumeta:")!=null || el.value.match(":estrella:")!=null || el.value.match(":corazon:")!=null || el.value.match(":beso:")!=null){ el.value = el.value.replace(/:sonrisa:/, smileys[':sonrisa:'] ); el.value = el.value.replace(/:sonrisota:/, smileys[':sonrisota:'] ); el.value = el.value.replace(/:trizte:/, smileys[':trizte:'] ); el.value = el.value.replace(/:llora1:/, smileys[':llora1:'] ); el.value = el.value.replace(/:cachulo:/, smileys[':cachulo:'] ); el.value = el.value.replace(/:picandoelojo:/, smileys[':picandoelojo:'] ); el.value = el.value.replace(/:fumeta:/, smileys[':fumeta:'] ); el.value = el.value.replace(/:estrella:/, smileys[':estrella:'] ); el.value = el.value.replace(/:corazon:/, smileys[':corazon:'] ); el.value = el.value.replace(/:beso:/, smileys[':beso:'] ); } ifr.contentWindow.document.body.innerHTML += "«"+ myuser + "» "+ el.value + "
"; var _msg = el.value; el.value = ""; ifr.contentWindow.scroll(0,ifr.contentWindow.document.body.scrollTop+200); _profile = profile.split(/Content/); _profile=_profile[1]; sendmsg(_msg,_profile); } function enviarSmiley(icon,profile) { //alert (icon + ' ' + profile); var el = document.getElementById('EnviarContent'+profile+''); //alert ( el.value); el.value += icon; }