document.onkeypress = function (e) 
{
 	var enterpressed = e? e.which == 13: window.event.keyCode == 13;
 	if (enterpressed)
 	{
  		Login();
  		return false;
		}
}

function getXhr()
{
	var xhr = null; 
	if(window.XMLHttpRequest) // Firefox and others
	   xhr = new XMLHttpRequest(); 
	else if(window.ActiveXObject){ // Internet Explorer 
	   try {
				xhr = new ActiveXObject("Msxml2.XMLHTTP");
			} catch (e) {
				xhr = new ActiveXObject("Microsoft.XMLHTTP");
			}
	}
	else { // XMLHttpRequest not supported by brownser
	   alert("Your browser doesn\'t support object XMLHTTPRequest..."); 
	   xhr = false; 
	} 
	return xhr;
}


var ChatTitleTimer = null;
function ChatChangeTitle(NewTitle)
{
	//alert(NewTitle);
	clearTimeout(ChatTitleTimer);
	document.title = NewTitle;
	ChatTitleTimer = setTimeout( "ChatGetDefautTitle('"+NewTitle+"')", 1000);
}

function ChatGetDefautTitle(NewTitle)
{
	clearTimeout(ChatTitleTimer); 
	document.title = "Family-Mingle";
	ChatTitleTimer = setTimeout( "ChatChangeTitle('"+NewTitle+"')", 1000);
}

function ChatClearTimeout()
{
	//alert("Clear")
	clearTimeout(ChatTitleTimer);
	document.title = "Family-Mingle";
}
	