

var xmlHttp;
function showwords()
{
	checkDB();
	xmlHttp = GetXmlHttpObject() ;
	var str = document.all.inptxt.value ;
	if( xmlHttp == null )
 	{
 		alert( "Browser does not support HTTP Request" ) ;
 		return ;
 	}
	var url = "insertandload.php" ;
	
	url = url + "?q=" + str ;
	url = url + "&sid=" + Math.random() ;
	//alert (url);
	
	xmlHttp.onreadystatechange = checkDB ;
	xmlHttp.open( "GET", url, true ) ;
	xmlHttp.send( null ) ;
	document.all.inptxt.value = "" ;
}

function GetXmlHttpObject()
{
	var xmlHttp = null ;
	try
	{
		// Firefox, Opera 8.0+, Safari
 		xmlHttp = new XMLHttpRequest() ;
	}
	catch (e)
	{
		//Internet Explorer
 		try
  		{
  			xmlHttp = new ActiveXObject( "Msxml2.XMLHTTP" ) ;
  		}
 		catch (e)
  		{
  			xmlHttp = new ActiveXObject( "Microsoft.XMLHTTP" ) ;
  		}
 	}
	return xmlHttp ;
}
function checkDB()
{
	new Ajax.PeriodicalUpdater( 'usr_list', './load_usr.php', {method: 'get', frequency: 1, decay: 2} ) ;
	new Ajax.PeriodicalUpdater( 'shout', './load.php', {method: 'get', frequency: 1, decay: 2} ) ;
	
}