

$parseLast = "";
$sendLast = "";
function parseText()
{
    
    /*$space_chars = array("\n","\r","!","?","_","\"","{","}",")","(",",",".");
    $text = str_replace($space_chars," ",$text);
        
    $bad_chars = array("`","'","$","£","^","\\","/","*","&");
    $text = str_replace($bad_chars,"",$text);
        
    $bad_words = array(" the "," a "," is "," be "," as ", " that ", " this ", " to ", " of ", " or ", " in ", " we ", " also ", " which ", " our ", " be "," and "," will ", " do ", " an ", " has ", " into ", " if ", " its ", " are ", " on ", " there ", " then ", " are ", " for ", " at ", " their ", " but ", " want "," have ", " can ");
    $text = str_replace($bad_words," ",$text);
    */
    
    xml = " " + _Find("message").value + " ";



    if(xml=="") return;
    if(xml==$parseLast) return;    
    $parseLast = xml;
    
    
    xml = xml.replace(new RegExp("[.,^%!£&*']","g")," ");
    
    $bad_words = new Array("hi", "the", "a", "is", "be", "as", "that", "this", "to", "of", "or", "in", "we", "also", "which", "our", "and", "will", "do", "an", "has", "into", "if", "its", "are", "on", "there", "then", "are", "for", "at", "their", "but", "want","have", "can", "how", "hello", "your");
    
    for(var i in $bad_words)
    {
        exp = "\\s+"+$bad_words[i]+"\\s+";
        regex = new RegExp(exp,"gi");
        /*alert(exp);
        alert(xml);
        alert(xml.match(regex))*/
        
        xml = xml.replace(regex," ");
    }
    
    
    if(xml==$sendLast) return;
    $sendLast = xml;
    //_Find("side2").innerHTML = "Sent:"+xml+"<br/><br/>"; 
    
	
    //_Find('info').innerHTML = 'Analysing...';
	ajax_callback_return_js("handlers/ajax.contactus.php",xml);
    
}