function loadScripts()
{
	setmyclass();
	openMenus();
	clearSearchForm();
	verify();
}

function clearSearchForm()
	{
		$(document).ready(function(){
			$(".inputfield").focus(function() {
			if ( $(this).val() != "")
			$(this).val('');
			});
		});
	}

function openMenus()
{
// set this variable to the classname:
	var myclass = "current";
	var pnode;
	var cnode;
	var target = location.href;
	var sn = document.getElementById("localNav");
	if (sn != null)
	{
	var ul = sn.getElementsByTagName("UL");
	for (i=0;ul.length;i++)
	{
		if (ul[i] != null)
		{
			if (ul[i].className == "localNav")
			   ul[i].style.display = "block";
			else
				ul[i].style.display = "none";
		} else
			break;
	}
	var hrefs = document.getElementsByTagName("a");
	for (i=0; hrefs.length; i++)
	{
		if(hrefs[i] != null)
		{
			var testme = hrefs[i].href;
			if(testme==target)
			{
				if (hrefs[i].parentNode.tagName == "LI")
				{
					pnode = hrefs[i].parentNode;
					pnode.className = myclass;
					cnodes = pnode.childNodes
					for (j=0; cnodes.length; j++)
					{
						if (cnodes[j] != null)
						{
								if (cnodes[j].tagName == "UL")
									cnodes[j].style.display = 'block';
						}
						else
							break;
					}
				}
				
				if (pnode != null)
				{
					while ((pnode == null) || (pnode.className != "localNav"))
					{
						if (pnode != null)
						{
							if (pnode.tagName == "UL")
									pnode.style.display = 'block';
								
								pnode = pnode.parentNode;
						}
						else
							break;
					}
				}
			}  
			//alert(me);
		} 
		else 
		{
			break;
		}
	}
	}
}
function verify() {
	myform = document.contribute_form;
	if (myform.os0.value.length < 1) 
	{
		alert("Please enter your employer's name.");
		return false;
	}
	else if (myform.os1.value.length < 1)
	{
		alert("Please enter your occupation.");
		return false;
	}
	if ((myform.q1.checked == false) || (myform.q2.checked == false))
	{
		alert("You must agree to both certifications in order to continue.");
		return false;
	}
	else
		return true;
}
