
var ajax_response = null

function ajax($url, $vars){
	if (window.XMLHttpRequest){
		var $class = new XMLHttpRequest()
	} else{
		var $class = new ActiveXObject("MSXML2.XMLHTTP.3.0")
	}
	$class.open("POST", $url, false)
	$class.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	$class.onreadystatechange = function(){
		if ($class.readyState == 4 && $class.status == 200) {
			if ($class.responseText){
				ajax_response = $class.responseText
			}
		}
	}
	$class.send($vars)
}
	
function Tracking() {
	//Screen Resolution from client side vars
	x_res = window.screen.width
	y_res = window.screen.height
	if (y_res < 768) {
		alert("Your screen resolution is too low for this website. If you are running Windows XP right click on the desktop, choose Properties and then select Settings to adjust your display to 1024x768 or higher")
	}
	//Browser browser, version and operating system (from functionsGlobal.js)
	browser = BrowserDetect.browser
	version = BrowserDetect.version
	os = BrowserDetect.OS
	//Record a page hit to database via AJAX along with client side vars passed on querystring
	ajax("tracking.asp?getResolution="+x_res+"x"+y_res+"&browser="+browser+"&version="+version+"&os="+os, null, null)
}

function Stats() {
	location.href = "default.asp?mode=stats"
}
function GotoService(bar) {
	location.href = "default.asp?service_menu="+bar
}
function GotoW3C() {
	location.href = "default.asp?id=w3c"
}
var preserve_bar_color = ""
function HighlightBar(bar) {
	if (bar==1) {highlight_color = "#000000"}
	if (bar==2) {highlight_color = "#000000"}
	if (bar==3) {highlight_color = "#000000"}
	if (bar==4) {highlight_color = "#000000"}
	preserve_bar_color = document.getElementById("bar"+bar).bgColor
	document.getElementById("bar"+bar).bgColor = highlight_color
}

function UnHighlightBar(bar) {
	document.getElementById("bar"+bar).bgColor = preserve_bar_color
}
function Home() {
	location.href = "default.asp"
}
function SiteSearch() {
	search_value = document.search_form.searchbox.value
	if (search_value.length > 2) {
		document.search_form.action = "default.asp?mode=search"
		document.search_form.submit()
	} else {
		if (search_value == "IT" | search_value == "it") {
			document.search_form.searchbox.value = "I.T."
			document.search_form.action = "default.asp?mode=search"
			document.search_form.submit()
		} else {
			alert("Your search query is too short. Please enter a word or phrase of 3 characters or more")
		}
	}
}
