
function checkLength(limitField, limitNum) {
	if (limitField.value.length > limitNum) {
		limitField.style.backgroundColor="#ff4444";
	} else {
		limitField.style.backgroundColor="white";
	}
}

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 doAjax(url_vars,div_catcher){
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null) {
	  alert ('Your browser does not support AJAX!');
	  return;
	} 

	var ajax_url = '?' + url_vars;

	xmlHttp.onreadystatechange=function(){
		if(xmlHttp.readyState==4) {
			document.getElementById(div_catcher).innerHTML=xmlHttp.responseText;
		}
	}

	xmlHttp.open('GET',ajax_url,true);
	xmlHttp.send(null);

}
 

function stateChanged()
{ 
if (xmlHttp.readyState==4)
{ 
alert(message);
document.getElementById('test_div').innerHTML=xmlHttp.responseText;
}
}

function activateComment(incoming){
	if(incoming.value=='Add your comment here.'){
		incoming.value='';
		incoming.style.color='black';
	} else {
		this.select();
	}
}

function deactivateComment(incoming){
	if(!incoming.value){
		incoming.value='Add your comment here.';
		incoming.style.color='gray';
	}
	
}

