function preload_link_images(){
//alert('onload');
var img_array = new Array(
	'/images/intro2.gif',

	'/images/pshe2.gif',

	'/images/sre2.gif',
	'/images/drug2.gif',
	'/images/he2.gif',

	'/images/pa2.gif',

	'/images/ehw2.gif',

	'/images/ecm2.gif',

	'/images/notice2.gif',

	'/images/team2.gif',

	'/images/events2.gif',

	'/images/onboard2.gif',

	'/images/cpd2.gif',

	'/images/resourcerev2.gif',

	'/images/teachlog2.gif',

	'/images/teamlog2.gif',

	'/images/contact2.gif'

	

	);

return true;

}

function swap_link_img(id, source){

//alert ('id=' + id + '\nsrc=' + source);

//alert ('src1=' + document.images[id].src);
document.images[id].src = source;
//alert ('src2=' + document.images[id].src);

return true;
}

//function MM_swapImage() { //v3.0
//  var i,j=0,x,a=MM_swapImage.arguments;
//  document.MM_sr=new Array;
//  for(i=0;i<(a.length-2);i+=3){
//  		if ((x=MM_findObj(a[i]))!=null){
//  			document.MM_sr[j++]=x;
//  			if(!x.oSrc){
//  				x.oSrc=x.src;
//  				x.src=a[i+2];
//  				}
//  			}
//	}
//}

// =================================================================

function checkform_postings(){

//alert('down=' + document.post_message.down.checked);

document.post_message.post_name.value = trim(document.post_message.post_name.value);
document.post_message.post_work.value = trim(document.post_message.post_work.value);
document.post_message.post_message.value = trim(document.post_message.post_message.value);

if (document.post_message.post_name.value.length < 1){
	alert ('You need to enter your name!');
	document.post_message.post_name.focus();
	document.post_message.post_name.select();
	return false;
	}

if (document.post_message.post_work.value.length < 1){
	alert ('You need to enter where you work!');
	document.post_message.post_work.select();
	return false;
	}

if(document.post_message.mode.value == 'new'){
	if (document.post_message.hdg.value.length < 1){
		alert ('You need to enter a subject heading!');
		document.post_message.hdg.select();
		return false;
		}
	}

if (document.post_message.post_message.value.length < 1){
	alert ('You need to enter a message!');
	document.post_message.post_message.select();
	return false;
	}



if((document.post_message.type.value == 'buddy')
&&(document.post_message.mode.value == 'new')){
	var num = document.post_message.buddy_id.length;
//			if(num == undefined){ num = 1};
	var i;

	var ticked = false;

//	alert('bidl=' + num);

// if only 1 item:
	if((num == undefined)||(num == null)||num < 2){ 
//		alert('bid0=' + document.post_message.buddy_id.checked);
		if (document.post_message.buddy_id.checked == false){
			alert ('You\'ll need to pick a buddy...');
			return false;
			}
		return true;
		}
	
	for(i = 0; i < num; i++){
//		alert(i + '=' + document.post_message.buddy_id[i].checked);
		if (document.post_message.buddy_id[i].checked){
			ticked = true;
			}
		}
	
	if (ticked == false){
		alert ('You\'ll need to pick a buddy...');

		return false;
		}
	}

// if((document.invset.descrip2.value.length > 0)&&(document.invset.amount2.value == 0)){
// 	alert('You need an amount for any item described\ndescrip=' + document.invset.descrip2.value + ':');
// 	document.invset.amount2.select();
// 	return false;
// 	}

// if(isNaN(document.invset.amount1.value)){
// 	alert(document.invset.amount1.value + '\nJust needs to be figures');
// 	document.invset.amount1.select();
// 	return false;
//	}

return true;
}


function trim(text){

   if (typeof text != "string") {
   	return text;
   	}
   var retValue = text;
   var ch = retValue.substring(0, 1);
   while (ch == " ") {				// Check for spaces at the beginning of the string
      retValue = retValue.substring(1, retValue.length);
      ch = retValue.substring(0, 1);
   	}
   ch = retValue.substring(retValue.length-1, retValue.length);
   while (ch == " ") {				// Check for spaces at the end of the string
      retValue = retValue.substring(0, retValue.length-1);
      ch = retValue.substring(retValue.length-1, retValue.length);
   	}
   while (retValue.indexOf("  ") != -1) {			 // Note that there are two spaces in the string - look for multiple spaces within the string
      retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length); // Again, there are two spaces in each of the strings
   	}
   

return retValue;

}

// ====================================================

function checkform(){

document.post_message.post_name.value = trim(document.post_message.post_name.value);
document.post_message.post_work.value = trim(document.post_message.post_work.value);
document.post_message.post_message.value = trim(document.post_message.post_message.value);

if (document.post_message.post_name.value.length < 1){
	alert ('You need to enter your name!');
	document.post_message.post_name.select();
	return false;
	}

if (document.post_message.post_work.value.length < 1){
	alert ('You need to enter where you work!');
	document.post_message.post_work.select();
	return false;
	}

if (document.post_message.post_message.value.length < 1){
	alert ('You need to enter a message!');
	document.post_message.post_message.select();
	return false;
	}

return true;
}

function jumpto(loc){			//	used for dropdown select link boxes
// alert("l=" + loc);
var url=loc; // document.dropdown.jump[document.dropdown.jump.selectedIndex].value;
if (url == ""){
	return false;
	}
url = '#' + url;
// alert("url=" + url);
document.location.href=url;
return true;
}

