//
// UniSoft Corporation, 2007-2009.
//
// Simple javascript functions used currently only by
// the home page.
//

var	global_id;
var	ids = new Array("dropmenu", "dropmenu1", "dropmenu2",
		"dropmenu3");

var	months = new Array("January", "February", "March", "April",
			"May", "June", "July", "August", "September",
			"October", "November", "December");

function get_index(id) {
	var	n = ids.length;
	var	i;

	for(i = 0; i < n; i++)
		if(ids[i] == id)
			return(i);
	document.write("get_index: HTML error\n");
	return(-1);
}


// dropall() - before we make one of the drop down menus visible,
//             we hide all menus so that we are not left with more
//             than one menu dropped down at any one time.

function dropall() {
	var	n = ids.length;
	var	i;

	for(i = 0; i < n; i++)
		hidemenu(ids[i]);
}


// showmenu() - simple function which turns on the CSS
//		"visibility" to make a particular dropdown
//		menu visiable. We set a timeout of 10 seconds
//		to hide the menu. Before we set visibility
//		we called dropall() to ensure none of the
//		other drop downs are active.
//
//		hidemenu() does the reverse and makes the
//		menu item invisible.

function showmenu(id) {
	var	elem = document.getElementById(id);
	global_id = id;
	var t = setTimeout("hidemenu(global_id)", 10000);

	dropall();
	
	if(elem == "")
		elem = document.all.getElementById(id);

	elem.style.visibility = "visible";
}


// Hide the element

function hidemenu(id) {
	var	elem = document.getElementById(id);

	if(elem == "")
		elem = document.all.getElementById(id);

	elem.style.visibility = "hidden";
}



function new_para(id2) {
	var	curp = document.getElementById(id2);
	var	textstuff = document.createTextNode("UniSoft loves you.");
	var	para = document.createElement("p");

	para.appendChild(textstuff);
	para.setAttribute("class", "maintext");
	curp.appendChild(para);
}



