if (window.XMLHttpRequest){
	ajax = new XMLHttpRequest();
} else if (window.ActiveXObject){
	ajax = new ActiveXObject("Microsoft.XMLHTTP");
}

function gd_ajaxSearch(evt, lang) {
	var obj = document.getElementById('resultsTable');
	var searchField = document.getElementById('searchText');
	var charCode = (evt.which) ? evt.which : event.keyCode;
	if (charCode == 27) {
		obj.innerHTML = "";
	} else {
		ajax.open("GET", "/ajax/gd_getResults.php?search=" + searchField.value + "&lang=" + lang);
		ajax.onreadystatechange = function() {
			if (ajax.readyState == 4 && ajax.status == 200) {
				obj.innerHTML = ajax.responseText;
			}
		}
		ajax.send(null);
	}
}


function gd_clearMobileMenu() {
	document.getElementById('ddContainermobile').style.left = "-10000px";
}

function gothere(href, message) {
   if ((window.confirm(message)))
     window.location.href = href;
}

function openWindow(url, name, w, h) {
	 var popupWin = window.open(url, name, "resizable=yes,scrollbars=yes,toolbar=no,location=no,menubar=no,status=no" + ",width=" + w + ",height=" + h);
	 if (window.focus) {
		  popupWin.focus();
	 }
}
