// Functions

//Short Date String returns date in format mm/dd/yyyy
function shortDateString(somedate)
{
	var strDateOut;
	var mo;
	
	mo = somedate.getMonth() + 1;
	strDateOut = mo.toString();
	strDateOut += "/";
	strDateOut += somedate.getDay().toString();
	strDateOut += "/";
	strDateOut += somedate.getYear().toString();
	
	return strDateOut;
}

//daysElapsed returns number of days between two date strings
function daysElapsed(strDate1,strDate2) 
{    
	var t1, t2, t3;
	
	t1 = Date.parse(strDate1);
	t2 = Date.parse(strDate2);
	
	t3 = (t2 >= t1 ) ? t2 - t1 : t1 - t2;
	t3 = Math.round(t3/1000/60/60/24);

	return(t3);
}

function clear_enter_key()
{
	if (window.event.keyCode == 13) return false;//window.event.keyCode = 0;
}

//Should be obsolete but here to ensure application stability
function confirmDelete(msg)
{
	if (confirm(msg))
	{
		document.editFund.txtDelete.value = "yes";
	}
	else
	{
		document.editFund.txtDelete.value = "no";
	}
}


//Function to turn the mouseover highlight color on.
function changeColorOn(objRow)
{
	if (objRow.bgColor != '#ffd700')
	{
		objRow.bgColor = 'khaki';
	}
}

//Function to highligt or unhighlight a row when it is clicked.
function highlightRow(objRow, nonhighlightcolor, highlightcolor)
{
	if (objRow.bgColor != highlightcolor)
	{
		objRow.bgColor = highlightcolor;	
	}
	else
	{
		objRow.bgColor = nonhighlightcolor;
	}
	//alert('hi');
	
}


//Function to highligt or unhighlight a row when it is clicked.
function highlightRow2(objRow, nonhighlightcolor, highlightcolor)
{
	if (objRow.bgColor != highlightcolor)
	{
		objRow.bgColor = highlightcolor;	
	}
	else
	{
		objRow.bgColor = nonhighlightcolor;
		
	}
	
	
}

//Function to turn the mouseover highlight color off.
function changeColorOff(objRow)
{
	//If the color is not hightlighted in gold or '#ffd700' then
	//  set the color off or white '#FFFFFF'.
	if (objRow.bgColor != '#ffd700')
	{
		objRow.bgColor = '#FFFFFF';
	}
}



