// JavaScript Document

function getHttpObject(){
	var xmlhttp;
	if (window.ActiveXObject){
		try {
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (E) {
				xmlhttp = false;
			}
		}
	} else if (window.XMLHttpRequest) {
		try {
			xmlhttp = new XMLHttpRequest();
		} catch (E) {
			xmlhttp = false;
		}
	}
	return xmlhttp;
}

/*
function getHttpObject()
{
   var xmlhttp = null;
   var success = false;
   
   // List of MS XMLHTTP versions - newest first
   var MSXML_XMLHTTP_PROGIDS = new Array(
       'MSXML2.XMLHTTP.5.0',
       'MSXML2.XMLHTTP.4.0',
       'MSXML2.XMLHTTP.3.0',
       'MSXML2.XMLHTTP',
       'Microsoft.XMLHTTP'
   );

   for (var i = 0; i < MSXML_XMLHTTP_PROGIDS.length && !success; i++)
   {
      try
      {
         xmlhttp = new ActiveXObject(MSXML_XMLHTTP_PROGIDS[i]);
         success = true;
         return xmlhttp;
      }
      catch (e)
      {
         xmlhttp = false;
      }
   }

   if (!xmlhttp && typeof XMLHttpRequest != 'undefined')
   {
      try
      {
         xmlhttp = new XMLHttpRequest();
      }
      catch (e)
      {
         xmlhttp = false;
      }
   }

   return xmlhttp;
}
*/
function addListener(eSrc, eType, eFunc, cap) {
	if (eSrc.attachEvent) {
		eSrc.attachEvent('on' + eType, eFunc);
	} else if (eSrc.addEventListener){
		eSrc.addEventListener(eType, eFunc, cap);
	} else {
		alert('No support on your Browser');
		return false;
	}
}
function getid(e) {
	if(e.srcElement) {
		return e.srcElement.id;
	} else if (e.target) {
		return e.target.id;
	} else {
		return false;
	}
}
function getkcode(e) {
	if (e.keyCode) {
		return e.keyCode;
	} else if (e.which) {
		return e.which;
	} else {
		return false;
	}
}

