/* RowRollover/RowUpdateBg -- Changes the color of the <tr> rows with mouseover*/

function rowRollover(myId, isInRow, color) { 
 // myId is our own integer id, not the DOM id 
 // isInRow is 1 for onmouseover, 0 for onmouseout 
 var row = document.getElementById('tr_' + myId); 
 rowWithMouse = (isInRow) ? row : null; 
 rowUpdateBg(row, color); 
} 

function rowUpdateBg(row, color) 
{ 
   row.style.backgroundColor = (row == rowWithMouse) ? '#FFFFD9' : color; 
} 

function datetime(){
	var d_names = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
	var m_names = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", 	"October", "November", "December");
	
	var aceDate = new Date();
	var curr_day = aceDate.getDay();
	var curr_date = aceDate.getDate();
	var sup = "";
	if (curr_date == 1 || curr_date == 21 || curr_date ==31)
	   {
	   sup = "st";
	   }
	else if (curr_date == 2 || curr_date == 22)
	   {
	   sup = "nd";
	   }
	else if (curr_date == 3 || curr_date == 23)
	   {
	   sup = "rd";
	   }
	else
	   {
	   sup = "th";
	   }
	var curr_month = aceDate.getMonth();
	var curr_year = aceDate.getFullYear();
	
	document.write(d_names[curr_day] + " " + m_names[curr_month]+" "+ curr_date + "<SUP>"+ sup + "</SUP> ");


	var right_hours=aceDate.getHours()
	if (right_hours > 12) 
	right_hours = right_hours - 12; 
	document.write(right_hours);
	document.write(":");
	var right_min=aceDate.getMinutes();
	if (right_min < 10)
	document.write("0");
	document.write(right_min);
	var ampm=" A.M.";
	if (aceDate.getHours() > 12)
	ampm=" P.M.";
	document.write(ampm);	
}
function donothing(){}
function putFocusInput(formName, inputFieldName)
{
	document.forms[formName].elements[inputFieldName].focus();
}

function removeIDElementDisplay(id)
{ // Remove ID Element;
	document.getElementById( id ).style.display = 'none';
}

function idElementDisplay(id, form)
{ // Remove ID Element;

	if (form != '')
		document.forms[form].elements[id].style.display = '';
	else
		document.getElementById( id ).style.display = '';
}

function hideCategoryColumn()
{
	removeIDElementDisplay('categoryColumnHideA');
	removeIDElementDisplay('categoryColumnTd');
	idElementDisplay('categoryColumnShowA', '');
	ajaxSend('/assets/libraries/ajax.php?categoryColumnSet=hide', donothing);
}

function showCategoryColumn()
{
	removeIDElementDisplay('categoryColumnShowA');
	idElementDisplay('categoryColumnHideA', '');
	idElementDisplay('categoryColumnTd', '');
	ajaxSend('/assets/libraries/ajax.php?categoryColumnSet=show', donothing);
}