/**
 * Client Side Functions Library for iGate
 * @access global
 * @author YP. Ajie (ajie@ageedev.com)
 * @abstract Handle AJAX Style operation.
 * @since 11/05/2006
 */


function getHTTPObject() {
				var http_object;
					/*@cc_on
					@if (@_jscript_version >= 5)
						try {
							http_object = new ActiveXObject("Msxml2.XMLHTTP");
						}
						catch (e) {
							try {
								http_object = new ActiveXObject("Microsoft.XMLHTTP");
							}
							catch (E) {
								http_object = false;
							}
						}
					@else
						xmlhttp = http_object;
					@end @*/

				if (!http_object && typeof XMLHttpRequest != 'undefined') {
					try {http_object = new XMLHttpRequest();}
					catch (e) {http_object = false;}
				}

	return http_object;
}

function startProgress(strMessage){
	document.getElementById("statusMessage").innerHTML = "<img src='/js/progress.gif' align=absmiddle>&nbsp;&nbsp;" + strMessage + "...";
}

function stopProgress(strMessage){
	document.getElementById("statusMessage").innerHTML = strMessage;
}

function setResultTitle(strTitle){
	document.getElementById("searchResultTitle").innerHTML = strTitle;
}

function setErrorMessage(strMessage){
	document.getElementById("statusMessage").innerHTML = "<img src='/js/icon_error.gif' align=absmiddle>&nbsp;&nbsp;" + strMessage + "...";
}

function setInfoMessage(strMessage){
	document.getElementById("statusMessage").innerHTML = "<img src='/js/icon_info.gif' align=absmiddle>&nbsp;&nbsp;" + strMessage + "...";
}

function switchLanguage(langCode){
	var currentLocationArray = document.location.toString().split("?");
	var currentLocation = "/index.php?" + currentLocationArray[1];

	Set_Cookie('strCurrLang',langCode);
	top.location = currentLocation;

}




function Get_Cookie(name) {
   var start = document.cookie.indexOf(name+"=");
   var len = start+name.length+1;
   if ((!start) && (name != document.cookie.substring(0,name.length))) return null;
   if (start == -1) return null;
   var end = document.cookie.indexOf(";",len);
   if (end == -1) end = document.cookie.length;
   return unescape(document.cookie.substring(len,end));
}

function Set_Cookie(name,value,expires,path,domain,secure) {
    var cookieString = name + "=" +escape(value) +
       ( (expires) ? ";expires=" + expires.toGMTString() : "") +
       ( (path) ? ";path=" + path : "") +
       ( (domain) ? ";domain=" + domain : "") +
       ( (secure) ? ";secure" : "");
    document.cookie = cookieString;
}

function Delete_Cookie(name,path,domain) {
   if (Get_Cookie(name)) document.cookie = name + "=" +
      ( (path) ? ";path=" + path : "") +
      ( (domain) ? ";domain=" + domain : "") +
      ";expires=Thu, 01-Jan-70 00:00:01 GMT";
}




