function writePageTracker()
{
	arrAnchors = document.getElementsByTagName("a");
	for (intCount = 0; intCount < arrAnchors.length; intCount++)
	{
		var objAnchor = arrAnchors[intCount];
		if (objAnchor.getAttribute("href"))
		{
			strHref = objAnchor.getAttribute("href");
			if ((strHref.indexOf(".pdf") > -1) || (strHref.indexOf(".doc") > -1))
			{
				objAnchor.target = "_blank";
				strHref = strHref.replace("http://www.anzsog.edu.au/", "");
				objAnchor.onclick = function(){pageTracker._trackPageview(strHref)};
			}
		}
	}
}

function StyleTables() {
    if (!document.getElementsByTagName) return;
    arrTables = document.getElementsByTagName("table");
    for (intCount=0; intCount<arrTables.length; intCount++) {
        objTable = arrTables[intCount];
		objRow = objTable.getElementsByTagName("tr")[0];
		objRow.style.background = "rgb(230,242,255)";

	    arrRows = objTable.getElementsByTagName("tr");
	    for (intCountTwo=1; intCountTwo<arrRows.length; intCountTwo++) {
			objRow = arrRows[intCountTwo];
			objRow.style.background = "white";
	    }
    }
}

function CheckSearchForm() {
	if (document.SearchForm.SearchField.value.length<3)		{window.alert("Please enter a search term.");	document.SearchForm.SearchField.focus();	return false;}
	return true;
}

function CheckCaseStudiesForm() {
	if (document.CaseStudiesForm.FirstName.value.length<3)		{window.alert("Please enter your first name.");			document.CaseStudiesForm.FirstName.focus();		return false;}
	if (document.CaseStudiesForm.LastName.value.length<3)		{window.alert("Please enter your last name.");			document.CaseStudiesForm.LastName.focus();		return false;}
	if (document.CaseStudiesForm.PostalAddress.value.length<3)	{window.alert("Please enter your postal address.");		document.CaseStudiesForm.PostalAddress.focus();	return false;}
	if (document.CaseStudiesForm.Suburb.value.length<3)			{window.alert("Please enter your suburb.");				document.CaseStudiesForm.Suburb.focus();		return false;}
	if (document.CaseStudiesForm.Country.value.length<3)		{window.alert("Please enter your country.");			document.CaseStudiesForm.Country.focus();		return false;}
	if (document.CaseStudiesForm.Phone.value.length<3)			{window.alert("Please enter your last phone number.");	document.CaseStudiesForm.Phone.focus();			return false;}
	if (document.CaseStudiesForm.EmailAddress.value.indexOf(".")<1)	{window.alert("Please enter a valid email address.");	document.CaseStudiesForm.EmailAddress.focus();		return false;}
	if (document.CaseStudiesForm.EmailAddress.value.indexOf("@")<1)	{window.alert("Please enter a valid email address.");	document.CaseStudiesForm.EmailAddress.focus();		return false;}
	return true;
}

function CheckPaceForm() {
	//if (document.PaceForm.EmailAddress.value.indexOf(".")<1)	{window.alert("Please enter a valid email address.");	document.PaceForm.EmailAddress.focus();		return false;}
	//if (document.PaceForm.EmailAddress.value.indexOf("@")<1)	{window.alert("Please enter a valid email address.");	document.PaceForm.EmailAddress.focus();		return false;}
	if (document.PaceForm.Username.value.length<3)				{window.alert("Please enter your username.");			document.PaceForm.Username.focus();			return false;}
	if (document.PaceForm.Password.value.length<3)				{window.alert("Please enter your password.");			document.PaceForm.Password.focus();			return false;}
	return true;
}

function CheckContactForm() {
	if (document.ContactForm.FirstName.value.length<3)		{window.alert("Please enter your first name.");			document.ContactForm.FirstName.focus();	return false;}
	if (document.ContactForm.Email.value.indexOf(".")<1)	{window.alert("Please enter a valid email address.");	document.ContactForm.Email.focus();		return false;}
	if (document.ContactForm.Email.value.indexOf("@")<1)	{window.alert("Please enter a valid email address.");	document.ContactForm.Email.focus();		return false;}
	if (document.ContactForm.Regarding.value=="")			{window.alert("Please select a Regarding option.");		document.ContactForm.Regarding.focus();	return false;}
	if (document.ContactForm.Hear.value=="")				{window.alert("Please select a 'How Did You Hear' option.");	document.ContactForm.Hear.focus();		return false;}
	if (document.ContactForm.Comments.value=="")			{window.alert("Please enter a comment.");				document.ContactForm.Comments.focus();	return false;}
	return true;
}

function CheckSubscribeForm() {
	if (document.SubscribeForm.FirstName.value.length<3)	{window.alert("Please enter your first name.");			document.SubscribeForm.FirstName.focus();	return false;}
	if (document.SubscribeForm.Email.value.indexOf(".")<1)	{window.alert("Please enter a valid email address.");	document.SubscribeForm.Email.focus();		return false;}
	if (document.SubscribeForm.Email.value.indexOf("@")<1)	{window.alert("Please enter a valid email address.");	document.SubscribeForm.Emaul.focus();		return false;}
	return true;
}

function clickMenu(a) {
	aMenu = document.getElementById(a + "Menu");
	aImage = document.getElementById(a + "Image");
	if (aMenu.style.display == "block")
	{
		aMenu.style.display = "none";
		aImage.src = "images/folderClosed.gif";
	}
	else
	{
		aMenu.style.display = "block";
		aImage.src = "images/folderOpen.gif";
	}
}