/* JavaScript Document
   Initialises highlighting effect for headings of works table in works.php
   (c) 2009 The Lennox Berkeley Society
*/

add_onload(init_work_headings);


function init_work_headings()
{
	var tags=document.getElementsByTagName("div");
	for (var count=0; count<tags.length; count++)
	{
		// Check to see if this 'div' tag has the 'table_heading' class name
		if (tags[count].className == "works_table_heading")
		{
			// Yes, insert event handlers to call 'mouse in' and 'mouse out' functions
			// and set unselected background colour as default
			tags[count].style.backgroundColor = "#f9f9f9";
		 	//tags[count].style.backgroundPosition = "bottom left";
			tags[count].onmouseover = work_heading_rollover;			
			tags[count].onmouseout = work_heading_rollout;			
		}
	}
}

function work_heading_rollover()
{
	this.style.backgroundColor = "#ffffff";
}

function work_heading_rollout()
{
	this.style.backgroundColor = "#f9f9f9";
}

// Called when user changes the value of the pull-down menu.  Auto submit the control panel form
function submit_control_form()
{
    document.getElementById("control_panel_form").submit();
}