function ini () {
	MM_preloadImages('common/canduEduRoll.gif','common/canduTrainingRoll.gif','common/canduEventsRoll.gif','common/canduHolidayRoll.gif')
}

function dropMenu(theLink) {
	//theLink.parentNode.parentNode.style.left='auto';
}
function hideMenu(theLink) {
	//theLink.parentNode.parentNode.style.left='-999em';
}


/*Pull Down-----------------------------------------*/
sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("TD"); 
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}

	var sfEls2 = document.getElementById("nav").getElementsByTagName("LI"); 
	for (var i=0; i<sfEls2.length; i++) {
		sfEls2[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls2[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
/*End Pull Down ------------------------------------*/


function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}


/*FORM-----------------------------*/
function ValidateSubmit() {
 error="";
var theForm=document.ca_enquiry;
var allTextInput = theForm.visitorname.value+theForm.visitoremail.value+theForm.clientComments.value+theForm.clientAddress.value+theForm.heardviamessage.value;
 if (allTextInput.match("http://")=="http://") {
	/*alert("This form does not accept weblinks")*/
	//theForm.reset();
	return (false);
  } else {

 // validate form fields
 if (theForm.visitorname.value == "") {
  error=error+'Name\n'; var noName=1;
 }

 if (theForm.visitoremail.value == "") {
  error=error+'Email address\n'; var noEmail=1;
 }

 if (theForm.freeDVD.value == 'on') {
	 if (theForm.clientAddress.value == "") {
		error=error+'Postal address\n'; var noPostal=1
	  }
 }
 // validate email address
 emailtovalidate=theForm.visitoremail.value;
 // the following line of code is from http://javascript.internet.com/
if (noEmail !=1) {
 if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(emailtovalidate))) {
  error=error+'\nError: the supplied email address is invalid';
 }
}
 // display error if needed, then exit
 if (error) {
	if (noName || noEmail || noPostal) {
  		error='Error: the following details have not been entered:\n\n'+error;
	}
  alert(error);
  return false;
 } else {
  return true;
 }
}
}

function showField (value) {

 if (value=="other") {
document.forms[0].via.style.display="inline";
	}else{
document.forms[0].via.style.display="none";
	}
}

function showAddress (value) {

 if (value) {
MM_findObj('addressField').style.display="block";
MM_findObj('addressLabel').style.display="block";
	}else{
MM_findObj('addressField').style.display="none";
MM_findObj('addressLabel').style.display="none";
	}
}
/*End FORM---------------------------------*/