function doField(what,ortext) {
if (what.value==ortext) {
what.value=''
}
else if (what.value=='') {
what.value=ortext;
}
}

// check multi checkboxes based on the name passed in.
function CheckMultiple(name) 
{
theFrm = document.frmSS;
for (var i=0; i < theFrm.length; i++) 
{
fldObj = theFrm.elements[i];
var fieldnamecheck=fldObj.name.indexOf(name);
if (fieldnamecheck != -1) {
if (fldObj.checked) {
return true;
}
}
}
return false;
}


function CheckSS()
{
theFrm = document.frmSS;

hasDot = theFrm.Email.value.indexOf(".");
hasAt = theFrm.Email.value.indexOf("@");

if (hasDot == -1 || hasAt == -1)
{
alert("Please enter a valid email address.");
theFrm.Email.focus();
theFrm.Email.select();
return false;
}


return true;
}





function getElementsByClass(searchClass,node,tag) {
	var classElements = new Array();
	if ( node == null )
		node = document;
	if ( tag == null )
		tag = '*';
	var els = node.getElementsByTagName(tag);
	var elsLen = els.length;
	var pattern = new RegExp("(^|\\\\s)"+searchClass+"(\\\\s|$)");
	for (i = 0, j = 0; i < elsLen; i++) {
		if ( pattern.test(els[i].className) ) {
			classElements[j] = els[i];
			j++;
		}
	}
	return classElements;
}


function checkEnquiry() {
	
if (document.enquiry_form.fullname.value=='' || document.enquiry_form.enquiry.value=='' || isValidEmail(document.enquiry_form.email.value)==false) {
	
	
	alert('Please ensure you have entered your name, enquiry and a valid email address.');

	return false;
	
	 
} else {
	

return true;

}





	
	
}



function isValidEmail(str) {

   return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
 


}