<!--
function highlightField(f) {
	if(getElementById(f)) {
		getElementById(f).className = 'text-high';
	}
	// usually for tickboxes or radios - highlight the label
	if(getElementById(f+'Label')) {
		getElementById(f+'Label').className = 'label-high';
	}
}

// gets width of window
function getWindowWidth() {
  var myWidth = 0;
  if(typeof(window.innerWidth) == 'number') {
    //Non-IE
    myWidth = window.innerWidth;
  } else if(document.documentElement && (document.documentElement.clientWidth )) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
  } else if(document.body && (document.body.clientWidth)) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
  }
  return(myWidth);
}

function getWindowHeight() {
  var myHeight = 0;
  if(typeof(window.innerHeight) == 'number') {
    //Non-IE
    myHeight = window.innerHeight;
  } else if( document.documentElement && (document.documentElement.clientHeight)) {
    //IE 6+ in 'standards compliant mode'
    myHeight = document.documentElement.clientHeight;
  } else if(document.body && (document.body.clientHeight)) {
    //IE 4 compatible
    myHeight = document.body.clientHeight;
  }
  return(myHeight);
}


function getElementById(id) {
	if (document.all) {
		return document.all[id];
	} else  {
		return document.getElementById(id);
	}
}

function getElementByName(name) {
	if (document.all) {
		return document.all[name];
	} else  {
		return document.getElementByName(name);
	}
}

function checkLength(elem, len) {
	/* 
	 To use this function the input (type=text) or textarea must have its id attribute set
	 There must be an empty div element with an id of the same name with '-msg' at the end to display the error message
	 Call using... onkeyup="checkLength(this, 50)" ...where 50 is the maximum length you want to allow
	 e.g. 
	 <textarea id="Comments" name="Comments" onkeyup="checkLength(this, 50)"></textarea>
	 <div id="Comments-msg"></div>
	*/
	if(elem.value.length >= len) {
		if(getElementById(elem.id + '-msg')) {
			getElementById(elem.id + '-msg').innerHTML = 'You have reached the maximum length';
		}
		elem.value = elem.value.substr(0, len);
	} else {
		if(getElementById(elem.id + '-msg')) {
			getElementById(elem.id + '-msg').innerHTML = '';
		}
	}
}

var s_page = '/contactus.htm';
function schk(f) {
	f.action = s_page;
}

function GetXmlHttpObject() {
	var xmlHttp = null;
	try {  
		// Firefox, Opera 8.0+, Safari  
		xmlHttp = new XMLHttpRequest(); 
	}
	catch (e) {  
		// Internet Explorer  
		try {
			xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");   
		}
  	catch (e) {
			xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");      
		}
	}  
	return xmlHttp;
}


//-->

