	function showStuff(itemToDisplay)
	{
		document.getElementById(itemToDisplay).style.display = "block";
	}
	
	function hideStuff(itemToHide)
	{
		document.getElementById(itemToHide).style.display = "none";
	}

    function showDropdown(li_Trigger)
	{
		var children = li_Trigger.childNodes;
		var i=0;
		// Find unordered list
		while (children[i].tagName!="UL"&&i<children.length) {
		    i++;
		}
		//show <ul>
		children[i].style.display="block";
		children[i].style.zIndex="-1";
		children[i].style.left="auto";
		
		
		var j=0;
		while (children[j].tagName!="A"&&j<children.length) {
		    j++;
		}
		var menuLink = children[j];
		
		
		//<li> border
		if(menuLink.className=="TopMenu trigger") {
		    menuLink.style.borderLeft="solid 1px black";
		    menuLink.style.borderTop="solid 1px black";
		    menuLink.style.borderRight="solid 1px black";
		    li_Trigger.style.backgroundColor="White";
		}
	}
	
	function hideDropdown(li_Trigger)
	{
		var children = li_Trigger.childNodes;
		
		//find <a>
		var j=0;
		while (children[j].tagName!="A"&&j<children.length) {
		    j++;
		}
		var menuLink = children[j];
		//remove border around <a>
		menuLink.style.border="none";
		
		var i=0;
		// Find unordered list
		while (children[i].tagName!="UL"&&i<children.length) {
		    i++;
		}
	
		//hide <ul>	
		children[i].style.display="none";
	}
	
	function populateProvinces(provinces)
	{
	    var country = document.searchForm.country.value;
	    document.searchForm.province.options.length=0;
	    var optionIndex = 0;
	    document.searchForm.province.options[optionIndex]=
	                new Option("All","");
	    optionIndex++;
	    for (i=0; i<provinces.length; i++) {
	        if(provinces[i][1]==country)
	        {
	            document.searchForm.province.options[optionIndex]=
	                new Option(provinces[i][0],provinces[i][0]);
	            optionIndex++;
	        }
	    }
	}
	
	function populateCities(cities, calledFrom)
	{
	    // cities [0 - City], [1 - Province], [2 - Country]
	    var filterBy;
	    document.searchForm.city.options.length=0;
	    var optionIndex = 0;
	    document.searchForm.city.options[optionIndex]=
	        new Option("All","");
	    optionIndex++;
	    if (calledFrom.name=="country") {
	        filterBy = document.searchForm.country.value;
	        for (i=0; i<cities.length; i++) {
	            if(cities[i][2]==filterBy)
	            {
	                document.searchForm.city.options[optionIndex]=
	                    new Option(cities[i][0],cities[i][0]);
	                optionIndex++;
	            }
	        }
	    }
	    else if (calledFrom.name=="province") {
	        filterBy = document.searchForm.province.value;
	        for (i=0; i<cities.length; i++) {
	            if(cities[i][1]==filterBy)
	            {
	                document.searchForm.city.options[optionIndex]=
	                    new Option(cities[i][0],cities[i][0]);
	                optionIndex++;
	            }
	        }
	    }
	    else
	        alert("Could not determine where populateCities() is called from");
	}
	
	function enableElement(name) {
	    var element=document.getElementsByName(name)[0];
	    if (countOptions(name)>2)
	        element.disabled=false;
	}
	
	function countOptions(elName) {
	    var children=document.getElementsByName(elName)[0].childNodes;
	    var numRecords=0;
	    for (i=0; i<children.length;i++)
	        if(children[i].nodeName=="OPTION")
	            numRecords++;
	    return (numRecords);
	}
	
	function toOrange ( element ) {
	    // Get all list items from list of questions
	    var children = document.getElementById("questionList").childNodes;
	    
		var i=0;
		// Run through all questions - list items
		while (i<children.length) {
		    // Each list item has one child - "A" tag
		    // Dye all "A" tags to default blue color
		    children[i].childNodes[0].style.color="rgb(33,66,99)";
		    i++;
		}
		// Dye clicked "A" tag (question) into orange
	    element.style.color="rgb(204,66,00)";
	}
	
	function sayHi()
	{
	    alert("hi");
	}