function faqsinit(){ // Show all FAQs. Hide all answers.
	for (n=1; n<=3; n++){ 
		var obj=document.getElementById('q'+n);
		obj.className='quietQ';
		obj.style.display='block';
		var obj=document.getElementById('a'+n);
		obj.style.display='none';	
	}
}
function hideshow(n) { // Hide selected FAQ. Reveal selected answer panel.
	faqsinit();
	var obj=document.getElementById('q'+n);
	obj.style.display='none';
	var obj=document.getElementById('a'+n);
	obj.className='loudAns';
	obj.style.display='block';
}
function sameWin(theURL){
	document.location=theURL;
}
function newWin(theURL) {
	myWin = window.open(theURL,'myWin','scrollbars=yes,status=yes,left=100,top=50,width=800,height=600');
	myWin.focus();
	myWin.defaultStatus = theURL;
}
function newWinSize(theURL,streamID,winWidth,winHeight) {
var crit='scrollbars=1,status=1,left=100,top=50,width=' + winWidth + ',height=' + winHeight + ',resizable=1';
	myWin = window.open(theURL,streamID,crit);
	myWin.focus();
	myWin.defaultStatus = theURL;
}

function incWinSize(theURL,streamID,winWidth,winHeight) {
var crit='scrollbars=1,status=1,left=100,top=50,width=' + winWidth + ',height=' + winHeight + ',resizable=1';
myWin = window.open("", "", theURL,streamID,"left=100, width=50, height=10");
for (yy=1; yy<winHeight; yy=yy+10) myWin.resizeTo("1",yy);
for (xx=1; xx<winHeight; xx=xx+10) { 
	yy=yy+10;
	myWin.resizeTo(xx,yy);
}
myWin.location=theURL;
	myWin.focus();
	myWin.defaultStatus = theURL;
}


function checkPage() {
//str=location.href;
return true 
}	

function checkEmailAddress() {
var givenEmail = trim(document.forms.enquiry.enq_email.value);
document.forms.enquiry.enq_email.value=givenEmail;
//OK=/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi
OK=/^[\w\.-]+@[\w\.-]+\.[a-zA-Z]+$/
if (givenEmail.match(OK)){
   return true
} else {
   alert('Please enter a valid e-mail address.');
   document.forms.enquiry.enq_email.focus();
   document.forms.enquiry.enq_email.select();
  return false
   }
}
function checkEmailAddress2() {
var givenEmail = trim(document.forms.enquiry.enq_email.value);
var givenEmail2 = trim(document.forms.enquiry.enq_email2.value);
document.forms.enquiry.enq_email2.value=givenEmail2;

if (givenEmail==givenEmail2) {
   	return true
} else {
   alert('Please make sure e-mail addresses match.');
   document.forms.enquiry.enq_email2.focus();
   document.forms.enquiry.enq_email2.select();
	return false
}
}
function nameBlank() { 
	fieldValue=trim(document.forms.enquiry.enq_name.value);
	document.forms.enquiry.enq_name.value=fieldValue;	
	if (fieldValue.length<3) {
		alert("Please enter your name.");
		document.forms.enquiry.enq_name.focus(); 
		document.forms.enquiry.enq_name.select(); 
		return true
	}
	return false
}
function locationGiven() { 
	fieldValue=document.forms.enquiry.enq_location.value;
	fieldValue2=trim(document.forms.enquiry.enq_location2.value);
	if ((fieldValue=='ns') && (fieldValue2.length==0)) {
		alert("Please state your approximate location.");
		document.forms.enquiry.enq_location.focus(); 
		//document.forms.enquiry.enq_location.select(); 
		return false
	}		
	return true
}

function trim(str) {
/* temp disable
	while (str.charAt(0)==' ') { 
		str=str.substring(1,str.length);
	}
	while (str.charAt(str.length-1)==' ') { 
		str=str.substring(0,str.length-1);
	}	
	*/
	return str;
}
function checkEnquiryForm() {
	if ((!nameBlank()) && (checkEmailAddress()) && (locationGiven())){
		return true;
	} else {
		return false;
	}
}
