<!--
// add standard javascript routines
var overArrow	= new Image();
var outArrow	= new Image();
var overTop	= new Image();
var outTop	= new Image();

overArrow.src	= '/images/red_arrow.gif';
outArrow.src	= '/images/1x1.gif';
overTop.src	= '/images/back_to_top_over.gif';
outTop.src	= '/images/back_to_top.gif';

function navOver(str) {
	document.images['arrow_'+str].src	= overArrow.src;
}

function navOut(str) {
	document.images['arrow_'+str].src	= outArrow.src;
}

function topOver()
{
	document.images['backtotop'].src	= overTop.src;
}

function topOut()
{
	document.images['backtotop'].src	= outTop.src;
}

function unFocus()
{
	window.focus();
}

function mouseIn(message)
{
	window.status = message;
	return true;
}
	
function mouseOut()
{
	window.status = '';
	return true;
}

function enlargeImage(img, lbl, cap)
{
	window.open('/cgi-bin/tools/enlargeimage.cgi/'+img+'/'+escape(lbl)+'/'+escape(cap),'enlarge','toolbar=no,scrollbars=yes,resizable=yes,menubar=no,status=yes,directories=no,location=no,width=350,height=350');
}
	
function printPage()
{
	window.open('/cgi-bin/tools/printpage.cgi'+escape(window.document.location.pathname)+'?referer='+escape(window.document.location)+'&template=standard','print','toolbar=yes,scrollbars=yes,resizable=no,menubar=yes,status=yes,directories=no,location=no,width=675,height=600');
}

function printPageExemplar()
{
	window.open('/cgi-bin/tools/printpage.cgi'+escape(window.document.location.pathname)+'?referer='+escape(window.document.location)+'&template=exemplar','print','toolbar=yes,scrollbars=yes,resizable=no,menubar=yes,status=yes,directories=no,location=no,width=675,height=600');
}

function emailPage()
{
	window.open('/cgi-bin/tools/mailpage.cgi'+escape(window.document.location.pathname)+'?title='+escape(document.title)+'&referer='+escape(window.document.location),'mail','toolbar=no,scrollbars=no,resizable=no,menubar=no,status=yes,directories=no,location=no,width=450,height=650');
}
	
function popup(page)
{
	window.open(page,'info','scrollbars=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,width=280,height=200');
}


// preload nav images
mainNavImage1 = new Image( 10, 30 );
mainNavImage1.src = "/images/mainNav_bulletActive.gif";
mainNavImage1 = new Image( 10, 30 );
mainNavImage1.src = "/images/mainNav_bulletHover.gif";

function mainNavButtonHover( buttonNumber ) {
	var buttonImage = document.getElementById( "all_mainNav_bullet" + buttonNumber );
	buttonImage.src = "/images/mainNav_bulletHover.gif";
}

function mainNavButtonUnhover( buttonNumber ) {
	var buttonImage = document.getElementById( "all_mainNav_bullet" + buttonNumber );
	buttonImage.src = "/images/mainNav_bulletBlank.gif";
}


// form checking functions
function isInputEmpty( fieldName ) {
	var inputName = document.getElementById( fieldName );
	var labelName = document.getElementById( fieldName + "_label");
	if( inputName.value == null || inputName.value == "" ) {
		labelName.className = "form_label_error";
		return true;
	}
	labelName.className = "form_label";
	return false;
}

function isDropDownEmpty( fieldName ) {
	var selectBox = document.getElementById( fieldName );
	var user_input = selectBox.options[selectBox.selectedIndex].value;
	//alert( 'province selected ' + user_input );

}

function isCheckBoxOff( checkBoxID ) {
	var checkBoxElement = document.getElementById( checkBoxID );
	if( checkBoxElement.checked ) {
		return false;
	}
	return true;

}

function isRadioOff( radioGroupID ) {
	var radioGroupElement = document.getElementById( radioGroupID );
	var radioGroupLabel = document.getElementById( radioGroupID + "_label");
	if( radioGroupElement.checked ) {
		radioGroupLabel.className = "form_label";
		return false;
	} else {
		radioGroupLabel.className = "form_label_error";
		return true;
	}
}

function validateEmail( fieldName ) {
	// check that the email field is not blank
	if( isInputEmpty( fieldName ) ) {
		return false;
	}

	var usersEmail = document.getElementById( fieldName ).value;
	var emailLabel = document.getElementById( fieldName + "_label");

	// check the email field with regular expressions (see FormMailAndLog1.92.pl for description)
	var valTest1 = usersEmail.search( /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/ );     //check for some invalid syntax
	var valTest2 = usersEmail.search( /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z0-9]+)(\]?)$/ );    // check for overall valid syntax

	if( valTest1 == -1 && valTest2 >= 0 ) {
		//alert('the email address was valid, valTest1:' + valTest1 + ' valTest2:' + valTest2);
		emailLabel.className = "form_label";
		return true;
	}
	//alert('the email address was NOT valid, valTest1:' + valTest1 + ' valTest2:' + valTest2);
	emailLabel.className = "form_label_error";
	return false;

}

function get_year() {
     var currentDate = new Date();
     var year = currentDate.getFullYear();
     document.write(year);
}


//-->
