var image_list = Array();



// Code from http://www.alistapart.com/articles/horizdropdowns/
//
// * Modified by Paul Forsyth 25/11/04 -  navRoot element id changed.
// * Modified by Sven Berg Ryen 3/8/05 -  to allow for menus to have a dely


var timeout_length = 1000; // the set timer will run after 1 second
var last_element = false; // initialize variable that will hold the last element we added the 'over' style to
var current_menu_timer = false; // initialize variable for the menu timeout return value, so that it may later be erased using clearTimeout()
var gMenuIdList = new Array();

// this function steps through all specified tags and attaches rollover functions 
// to the containing LI items
// the LI items will need to have "parentmenu" in their class name

function activateMenu(menuNode) {
	if (document.getElementById) 
	{
		if ( document.getElementsByTagName('LI') )
		{
			// DOM standard code, as childNodes is an IE5+ specific feature
			// firefox, safari (and possibly Opera and IE6?) will use this section
			nodeList = document.getElementsByTagName('LI');
			nodeListLength = nodeList.length;
			for (j= 0; j<nodeListLength; j++)
			{
				if (nodeList[j].className.indexOf("parentmenu") != -1)
				{
					// attach actions
					nodeList[j].onmouseover=function() { addClass(this); }
					nodeList[j].onmouseout=function() { removeClass(this); }
				}
			}
		}
		else if (document.all)
		{
			// code for IE
			for (j=0; j<menuNode.childNodes.length; j++) 
			{
				node = menuNode.childNodes[j];
				if (node.nodeName=="LI" && node.className.indexOf("parentmenu") != -1) 
				{
					// attach actions
					node.onmouseover=function() { addClass(this); }
					node.onmouseout=function() { removeClass(this); }
				}
			}
		}
	}
}

function addClass(target_element)
{
	// check if a timeout is currently set
	if (last_element != false && last_element != target_element) 
	{
		// if a timeout is set, then make sure the menu hides IMMEDIATELY
		// rather than waiting for the timeout to be triggered
		last_element.className=last_element.className.replace(" over", "");
		last_element = false;
	}
	clearTimeout(current_menu_timer);
	// show the submenu
	target_element.className+=" over";
}

function removeClass(target_element)
{
	if (last_element != false) 
	{
		// if a timeout is set, then make sure the menu hides IMMEDIATELY
		// rather than waiting for the timeout to be triggered
		last_element.className=last_element.className.replace(" over", "");
		last_element = false;
		clearTimeout(current_menu_timer);
	}
	// set the last element to be the targeted element
	last_element = target_element;
	// set timer to hide submenu after an interval
	current_menu_timer=setTimeout("last_element.className=last_element.className.replace(\" over\", \"\"); last_element=false;",timeout_length);
}

function check_poll_form_and_submit(frm){
         var flag = false;
         var options = document.forms[frm].poll_options;
         for(var i=0;i<options.length;i++){
	     flag = options[i].checked; 
	     if (flag==true){
	         break;
	    }
	}
	 if(flag==false){
	    alert("Please select an option.");
	    return;
	 }
	 document.forms[frm].submit();
}
