//send password recovery
function sendMail(str)
{ 
document.getElementById('txtHint2').className='ajax_load_process1';
document.getElementById('btnSubmit').className='ajax_load_button';

xmlHttp=GetXmlHttpObject();

if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

var url="contact_cgi.php";

var selType = document.getElementById('selType').value;
var txtName = document.getElementById('txtName').value;
var txtMail = document.getElementById('txtMail').value;
var txtComment = document.getElementById('txtComment').value;

var txtMemberID = document.getElementById('txtMemberID').value;
var txtContact = document.getElementById('txtContact').value;

if ( (document.frmContact.txtMail.value.indexOf('@') == -1) || (document.frmContact.txtMail.value.indexOf('.') == -1) ) {
var txtMail = "error";
}

url=url+"?selType="+selType;
url=url+"&txtMemberID="+txtMemberID+"&txtName="+txtName+"&txtMail="+txtMail+"&txtComment="+txtComment+"&txtContact="+txtContact; 


xmlHttp.onreadystatechange=stateLost;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function stateLost() 
{ 
if (xmlHttp.readyState==4)
{ 
document.getElementById("txtHint").innerHTML=xmlHttp.responseText;
document.getElementById('txtHint2').className='';
document.getElementById('btnSubmit').className='';
}
}



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;
}



//contactUS chars left
function textCounter(field, countfield, maxlimit) {
if (field.value.length > maxlimit) // if too long...trim it!
field.value = field.value.substring(0, maxlimit);
// otherwise, update 'characters left' counter
else 
countfield.value = maxlimit - field.value.length;
}