function toggleShowHideLayer ( stringObject ) {
	objElement = document.getElementById( stringObject );
	if ( objElement.style.display == 'block' ){
		objElement.style.display = 'none';
	} else {
		objElement.style.display = 'block';		
	}
}

function getElementsByClassName(stringElementType, stringClassName) {
 d = document.getElementsByTagName(stringElementType);
 j=0;
 var cl = new Array()
 for(i=0;i<d.length;i++){
  if(d[i].className == stringClassName){
   cl[j] = d[i];
   j++
  }
 }
 return cl
}
 
function hideClass ( stringElementType, stringClassName ){
 objElements = getElementsByClassName(stringElementType, stringClassName);
 alert ('hiding '+objElements.length+' items');
 for (i=0;i<objElements.length;i++){
  objElements[i].style.display = 'none';
 }
}

function stripMouseOverEvents(){
	arrObj = document.getElementsByTagName( "div" );
	for ( i=0; i<arrObj.length; i++ ){
		arrObj[i].onmouseout = function(){};
		arrObj[i].onmouseover = function(){};
	}
}

function submitform() {
	if (document.getElementById('moodle').checked == true) {
		document.getElementById('login').action = 'http://moodle.reigate.ac.uk/login/index.php'
		document.getElementById('login').target = 'myNewWindow'
	} else {
//		document.getElementById('login').action = 'http://titan.reigate.ac.uk/exchange/'
		document.getElementById('login').name = 'loginForm'
        document.getElementById('login').action = 'http://tarvos.reigate.ac.uk/exchweb/bin/auth/owaauth.dll'
        document.getElementById('login').method = 'POST'
        
	}
}

function checkEntry() {
	if (document.getElementById('strSearch').value == "Search this site ...") {
		document.getElementById('strSearch').value = "";
	}
}
