// common.js
// javascript functions

_objectMoving = "";
_objectMovingIF = "";

_isIE6 = false;
_isIE7 =(navigator.userAgent.indexOf('MSIE 7.0')>=0)?true:false;
_isFOX =(navigator.userAgent.indexOf('Firefox')>=0)?true:false;
_isSafari =(navigator.userAgent.indexOf('Safari')>=0)?true:false;
_isIE = (_isIE6||_isIE7)?true:false;
_callHasSpecialAction = false;

// Add to the string object method for trim(), ltrim and rtrim.
// Exemple: var test = "hello ";
//          test = test.trim();
String.prototype.trim = function() {
	return this.replace(/^\s+|\s+$/g,"");
}
String.prototype.ltrim = function() {
	return this.replace(/^\s+/,"");
}
String.prototype.rtrim = function() {
	return this.replace(/\s+$/,"");
}




function ajaxFunction(qry,placeholder)
{
var xmlhttp;
if (window.XMLHttpRequest)
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else if (window.ActiveXObject)
  {
  // code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
else
  {
  alert("Your browser does not support XMLHTTP!");
  }
xmlhttp.onreadystatechange=function()
{
if(xmlhttp.readyState==4)
  {
    if(xmlhttp.responseText=='login')
    {
    document.location='<%=Request.ServerVariables("HTTP_REFERER")%>';
    }
    else
    {
    document.getElementById(placeholder).innerHTML=xmlhttp.responseText;
    }
  }
}
xmlhttp.open("GET",qry,true);
xmlhttp.send(null);
}

