/************************************************************************
Filename:		base.js
Version:		1.70
Author:			Gabriel Salama
Email:			gabrielsalama@hotmail.com
Creation Date:	08/14/2006
Last Update:	07/20/2007

History:
--------

12/01/2006		Added cookie handling functions.
				Added Refresh() function.
				
12/13/2006		Added the FormatDateTime function to finally provide
				a clean format for dates and times.
				
12/27/2006		Added the IsItemInArray function to search for the existence
				a specific item in an array.
				
01/11/2007		Added the ToggleBlock function to display or hide a block.

04/20/2007		Added the functions IsIE and IsFirefox to check type of browser.

07/18/2007		Added RestrictNumeric and RestrictDate functions to filter out invalid characters from text boxes.
				Reorganized functions and added the "Numeric functions" section.
				
07/20/2007		Added the ToggleRow function to display or hide a table row.
************************************************************************/

/************************************************************************
Numeric functions
************************************************************************/

function IsNumeric(value) {
	var ValidChars = "0123456789.";
	var IsNumber = true;
	var Char;
	
	for (i = 0; i < value.length && IsNumber == true; i++) {
		Char = value.charAt(i);
		
		if (ValidChars.indexOf(Char) == -1) {
			IsNumber = false;
		}
	}
	
	return IsNumber;
}

function FormatNumber(value, decimals) {
	if (value == "") { return ""; }
	
	if (IsNumeric(value)) {
		var result = parseFloat(value);
		result = result.toFixed(decimals);
		
		return result;
	}
	else {
		return value;
	}
}

function FormatCurrency(num, displaySign/*, displayComma*/) {
	num = num.toString().replace(/\$|\,/g,'');
	
	if (isNaN(num)) {
		num = "0";
	}
	
	sign = (num == (num = Math.abs(num)));
	num = Math.floor(num * 100 + 0.50000000001);
	cents = num % 100;
	num = Math.floor(num / 100).toString();
	
	if (cents < 10) {
		cents = "0" + cents;
	}
	
	for (var i = 0; i < Math.floor((num.length - (1 + i)) / 3); i++) {
		num = num.substring(0, num.length - (4 * i + 3)) + ',' + num.substring(num.length - (4 * i + 3));
		
		/*num = num.substring(0, num.length - (4 * i + 3));
		
		if (displayComma) {
			num = num + ',';
		}
		
		num = num + num.substring(num.length - (4 * i + 3));*/
	}
	
	if (displaySign) {
		return (((sign) ? '' : '-') + '$' + num + '.' + cents);
	}
	else {
		return (((sign) ? '' : '-') + num + '.' + cents);
	}
}

function RestrictNumeric(input, required) {
	if (!input) { return; }
	
	if (!required) {
		required = true;
	}
	
	var value = input.value;
	var newValue = "";
	
	for (var i = 0; i < value.length; i++) {
		var char = value.substring(i, i + 1);
		
		if (IsNumeric(char)) {
			newValue += char;
		}
	}
	
	if (required && newValue == "") {
		newValue = "0";
	}
	
	input.value = newValue;
}

/***********************************************************************/


/************************************************************************
Date functions
************************************************************************/
/*
function IsDate(DateToCheck) {
	if (DateToCheck == "") { return true; }
	
	var m_strDate = FormatDate(DateToCheck);
	
	if (m_strDate == "") {
		return false;
	}
	
	var m_arrDate = m_strDate.split("/");
	var m_DAY = m_arrDate[0];
	var m_MONTH = m_arrDate[1];
	var m_YEAR = m_arrDate[2];
	
	if (m_YEAR.length > 4) { return false; }
	
	m_strDate = m_MONTH + "/" + m_DAY + "/" + m_YEAR;
	var testDate = new Date(m_strDate);
	
	if (testDate.getMonth() + 1 == m_MONTH) {
		return true;
	}
	else {
		return false;
	}
}//end function
*/

function FormatDate(DateToFormat,FormatAs){
	if (DateToFormat == "") { return ""; }
	if (!FormatAs) { FormatAs = "mm/dd/yyyy"; }

	var strReturnDate;
	
	FormatAs = FormatAs.toLowerCase();
	DateToFormat = DateToFormat.toLowerCase();
	
	var arrDate
	var arrMonths = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
	var strMONTH;
	var Separator;

	while (DateToFormat.indexOf("st") > -1) {
		DateToFormat = DateToFormat.replace("st", "");
	}

	while(DateToFormat.indexOf("nd")>-1){
		DateToFormat = DateToFormat.replace("nd","");
	}

	while(DateToFormat.indexOf("rd")>-1){
		DateToFormat = DateToFormat.replace("rd","");
	}

	while(DateToFormat.indexOf("th")>-1){
		DateToFormat = DateToFormat.replace("th","");
	}

	if(DateToFormat.indexOf(".")>-1){
		Separator = ".";
	}

	if(DateToFormat.indexOf("-")>-1){
		Separator = "-";
	}


	if(DateToFormat.indexOf("/")>-1){
		Separator = "/";
	}

	if(DateToFormat.indexOf(" ")>-1){
		Separator = " ";
	}

	arrDate = DateToFormat.split(Separator);
	DateToFormat = "";
	
	for(var iSD = 0; iSD < arrDate.length; iSD++){
		if(arrDate[iSD] != ""){
			DateToFormat += arrDate[iSD] + Separator;
		}
	}
	
	DateToFormat = DateToFormat.substring(0,DateToFormat.length-1);
	arrDate = DateToFormat.split(Separator);

	if(arrDate.length < 3){
		return "";
	}

	//var DAY = arrDate[0];
	//var MONTH = arrDate[1];
	var MONTH = arrDate[0];
	var DAY = arrDate[1];
	var YEAR = arrDate[2];

	if (parseFloat(arrDate[1]) > 12) {
		DAY = arrDate[1];
		MONTH = arrDate[0];
	}

	if (parseFloat(DAY) && DAY.toString().length == 4) {
		YEAR = arrDate[0];
		DAY = arrDate[2];
		MONTH = arrDate[1];
	}


	for(var iSD = 0;iSD < arrMonths.length;iSD++){
	var ShortMonth = arrMonths[iSD].substring(0,3).toLowerCase();
	var MonthPosition = DateToFormat.indexOf(ShortMonth);
		if(MonthPosition > -1){
		MONTH = iSD + 1;
			if(MonthPosition == 0){
			DAY = arrDate[1];
			YEAR = arrDate[2];
			}
		break;
		}
	}

	var strTemp = YEAR.toString();
	if(strTemp.length==2){

		if(parseFloat(YEAR)>40){
		YEAR = "19" + YEAR;
		}
		else{
		YEAR = "20" + YEAR;
		}

	}


		if(parseInt(MONTH)< 10 && MONTH.toString().length < 2){
		MONTH = "0" + MONTH;
		}
		if(parseInt(DAY)< 10 && DAY.toString().length < 2){
		DAY = "0" + DAY;
		}
		switch (FormatAs){
		case "dd/mm/yyyy":
		return DAY + "/" + MONTH + "/" + YEAR;
		case "mm/dd/yyyy":
		return MONTH + "/" + DAY + "/" + YEAR;
		case "dd/mmm/yyyy":
		return DAY + " " + arrMonths[MONTH -1].substring(0,3) + " " + YEAR;
		case "mmm/dd/yyyy":
		return arrMonths[MONTH -1].substring(0,3) + " " + DAY + " " + YEAR;
		case "dd/mmmm/yyyy":
		return DAY + " " + arrMonths[MONTH -1] + " " + YEAR;	
		case "mmmm/dd/yyyy":
		return arrMonths[MONTH -1] + " " + DAY + " " + YEAR;
		}

	return DAY + "/" + strMONTH + "/" + YEAR;;

} //End Function

/**
 * DHTML date validation script. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/)
 */
// Declaring valid date character, minimum year and maximum year
var dtCh= "/";
var minYear = 1900;
var maxYear = 2100;

function FormatDateTime(inDate, format) {
	/*****************************************************************************
	Available formats:
	------------------
	generalAll		12/03/2006 04:15:24 PM
	generalDate		12/03/2006
	generalTime		04:15:24 PM
	
	longAll			Sunday, December 3rd, 2006, 04:15:24 PM
	longDate		Sunday, December 3rd, 2006
	longTime		04:15:24 PM
	
	shortAll		12/3/2006 4:15:24 pm
	shortDate		12/3/2006
	shortTime		4:15:24 pm
	
	24Hour			16:15:24
	*****************************************************************************/
	
	// First, get every number available from a date and time.
	var year = inDate.getYear();
	var month = inDate.getMonth();
	var dayOfMonth = inDate.getDate();
	var dayOfWeek = inDate.getDay();
	var hour = inDate.getHours();
	var minutes = inDate.getMinutes();
	var seconds = inDate.getSeconds();
	
	/*document.write("now = " + inDate + "<br />");
	document.write("year = " + year + "<br />");
	document.write("month = " + month + "<br />");
	document.write("dayOfMonth = " + dayOfMonth + "<br />");
	document.write("hour = " + hour + "<br />");
	document.write("minutes = " + minutes + "<br />");
	document.write("seconds = " + seconds + "<br />");
	return null;*/
	
	// Now, create arrays with the names of everything
	
	// Months (full)
	var monthsFull = new Array(12);
	monthsFull[0] = "January";
	monthsFull[1] = "February";
	monthsFull[2] = "March";
	monthsFull[3] = "April";
	monthsFull[4] = "May";
	monthsFull[5] = "July";
	monthsFull[6] = "June";
	monthsFull[7] = "August";
	monthsFull[8] = "September";
	monthsFull[9] = "October";
	monthsFull[10] = "November";
	monthsFull[11] = "December";
	
	// Months (abreviated)
	var monthsAbv = new Array(12);
	monthsAbv[0] = "Jan";
	monthsAbv[1] = "Feb";
	monthsAbv[2] = "Mar";
	monthsAbv[3] = "Apr";
	monthsAbv[4] = "May";
	monthsAbv[5] = "Jul";
	monthsAbv[6] = "Jun";
	monthsAbv[7] = "Aug";
	monthsAbv[8] = "Sep";
	monthsAbv[9] = "Oct";
	monthsAbv[10] = "Nov";
	monthsAbv[11] = "Dec";
	
	// Days of the week (full)
	var daysFull = new Array(7);
	daysFull[0] = "Sunday";
	daysFull[1] = "Monday";
	daysFull[2] = "Tuesday";
	daysFull[3] = "Wednesday";
	daysFull[4] = "Thursday";
	daysFull[5] = "Friday";
	daysFull[6] = "Saturday";
	
	// Days of the week (abreviated)
	var daysAbv = new Array(7);
	daysAbv[0] = "Sun";
	daysAbv[1] = "Mon";
	daysAbv[2] = "Tue";
	daysAbv[3] = "Wed";
	daysAbv[4] = "Thu";
	daysAbv[5] = "Fri";
	daysAbv[6] = "Sat";
	
	// Handle year
	if (year < 2000) { year = year + 1900; }
	
	// Get day ordinal
	var dayOrdinal;
	
	if (dayOfMonth == 1 || dayOfMonth == 21 || dayOfMonth == 31) {
		dayOrdinal = "st";
	}
	else if (dayOfMonth == 2 || dayOfMonth == 22) {
		dayOrdinal = "nd";
	}
	else if (dayOfMonth == 3 || dayOfMonth == 23) {
		dayOrdinal = "rd";
	}
	else {
		dayOrdinal = "th";
	}
	
	// Get am/pm
	var ampm;
	
	if (hour < 12) {
		ampm = "am";
	}
	else {
		ampm = "pm";
	}
	
	// Get 12 and 24 hour cycle hours
	var hour12
	var hour24 = hour;
	
	if (hour < 12) {
		hour12 = hour;
	}
	else {
		hour12 = hour - 12;
	}
	
	// Get two digit numbers
	var monthTD = GetTwoDigitValue(month + 1);
	var dayOfMonthTD = GetTwoDigitValue(dayOfMonth);
	var hour12TD = GetTwoDigitValue(hour12);
	var hour24TD = GetTwoDigitValue(hour24);
	var minutesTD = GetTwoDigitValue(minutes);
	var secondsTD = GetTwoDigitValue(seconds);
	
	// Now, build the returning value
	
	/*****************************************************************************
	Available formats:
	------------------
	generalAll		09/03/2006 04:15:24 PM
	generalDate		09/03/2006
	generalTime		04:15:24 PM
	
	longAll			Sunday, September 3rd, 2006, 04:15:24 PM
	longDate		Sunday, September 3rd, 2006
	longTime		04:15:24 PM
	
	shortAll		9/3/2006 4:15:24 pm
	shortDate		9/3/2006
	shortTime		4:15:24 pm
	
	24Hour			16:15:24
	*****************************************************************************/
	
	var result = "";
	
	switch (format) {
		case "generalAll":
			result += monthTD + "/" + dayOfMonthTD + "/" + year;
			result += " ";
			result += hour12TD + ":" + minutesTD + ":" + secondsTD;
			result += " ";
			result += ampm.toUpperCase();
			break;
			
		case "generalDate":
			result += monthTD + "/" + dayOfMonthTD + "/" + year;
			break;
			
		case "generalTime":
			result += hour12TD + ":" + minutesTD + ":" + secondsTD;
			result += " ";
			result += ampm.toUpperCase();
			break;
			
		case "longAll":
			result += daysFull[dayOfWeek];
			result += ", ";
			result += monthsFull[month];
			result += " ";
			result += dayOfMonth + dayOrdinal;
			result += ", ";
			result += year;
			result += ", ";
			result += hour12TD + ":" + minutesTD + ":" + secondsTD;
			result += " ";
			result += ampm.toUpperCase();
			
			break;
			
		case "longDate":
			result += daysFull[dayOfWeek];
			result += ", ";
			result += monthsFull[month];
			result += " ";
			result += dayOfMonth + dayOrdinal;
			result += ", ";
			result += year;
			break;
			
		case "longTime":
			result += hour12TD + ":" + minutesTD + ":" + secondsTD;
			result += " ";
			result += ampm.toUpperCase();
			break;
			
		case "shortAll":
			result += month + "/" + dayOfMonth + "/" + year;
			result += " ";
			result += hour12 + ":" + minutesTD + ":" + secondsTD;
			result += " ";
			result += ampm;
			break;
			
		case "shortDate":
			result += month + "/" + dayOfMonth + "/" + year;
			break;
			
		case "shortTime":
			result += hour12 + ":" + minutesTD + ":" + secondsTD;
			result += " ";
			result += ampm;
			break;
			
		case "24Hour":
			result += hour24TD + ":" + minutesTD + ":" + secondsTD;
			break;
			
		default:
			result = inDate;
			break;
	}
	
	return result;
}

function GetTwoDigitValue(value) {
	if (value < 10) {
		return "0" + value.toString();
	}
	else {
		return value;
	}
}

function RestrictDate(input) {
	if (!input) { return; }
	
	var value = input.value;
	var newValue = "";
	
	if (!IsDate(value)) {
		input.value = "";
	}
}

/***********************************************************************/

function IsInteger(s){
	var i;
    for (i = 0; i < s.length; i++){   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function stripCharsInBag(s, bag){
	var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++){   
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function daysInFebruary (year){
	// February has 29 days in any year evenly divisible by four,
    // EXCEPT for centurial years which are not also divisible by 400.
    return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
}
function DaysArray(n) {
	for (var i = 1; i <= n; i++) {
		this[i] = 31
		if (i==4 || i==6 || i==9 || i==11) {this[i] = 30}
		if (i==2) {this[i] = 29}
   } 
   return this
}

function IsDate(dtStr){
	var daysInMonth = DaysArray(12)
	var pos1=dtStr.indexOf(dtCh)
	var pos2=dtStr.indexOf(dtCh,pos1+1)
	var strMonth=dtStr.substring(0,pos1)
	var strDay=dtStr.substring(pos1+1,pos2)
	var strYear=dtStr.substring(pos2+1)
	strYr=strYear
	if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1)
	if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1)
	for (var i = 1; i <= 3; i++) {
		if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1)
	}
	month=parseInt(strMonth)
	day=parseInt(strDay)
	year=parseInt(strYr)
	if (pos1==-1 || pos2==-1){
		//alert("The date format should be : mm/dd/yyyy")
		return false
	}
	if (strMonth.length<1 || month<1 || month>12){
		//alert("Please enter a valid month")
		return false
	}
	if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){
		//alert("Please enter a valid day")
		return false
	}
	if (strYear.length != 4 || year==0 || year<minYear || year>maxYear){
		//alert("Please enter a valid 4 digit year between "+minYear+" and "+maxYear)
		return false
	}
	if (dtStr.indexOf(dtCh,pos2+1)!=-1 || IsInteger(stripCharsInBag(dtStr, dtCh))==false){
		//alert("Please enter a valid date")
		return false
	}
return true
}

/***********************************************************************/

function IsCurrency(f)
{
	var nNum = 0;			// Total numbers for currency value.
	var nDollarSign = 0;	// Total times a dollar sign occurs.
	var nDecimal = 0;		// Total times a decimal point occurs.
	var nCommas = 0;		// Total times a comma occurs.
	var txtLen;				// Length of string passed.
	var xTxt;				// Assigned object passed.
	var sDollarVal;			// Assigned dollar amount with or without commas.
	var bComma;				
	var decPos;				// Assigned value of numbers or positions after decimal point.
	var nNumCount = 0;		// Total number between commas.
	var i;					// For forloop indexing.
	var x;					// Assigned each indivual character in string.

	// Set the xTxt variable to the object passed to this function.

	// Assign the length of the string to txtLen.
	xTxt = f;
	txtLen = xTxt.length;

	for(i = 0; i < txtLen; i++)
	{
		// Assign charater in substring to x.
		x = xTxt.substr(i, 1);

		if(x == "$")
			nDollarSign = nDollarSign + 1; // Sum total times dollar sign occurs.
		else if(x == ".")
			nDecimal = nDecimal + 1; // Sum total times decimal point occurs.
		else if(x == ",")
			nCommas = nCommas + 1; // Sum total times comma occurs.
		else if(parseInt(x) >= 0 || parseInt(x) <= 9)
			nNum = nNum + 1; // If the character is a number sum total times a number occurs.
		else
		{
			// Error occurs if any other character value is in the string
			// othere then the valid characters.
			/*alert("ERROR! \n\nYou have entered an illegal value!\nPlease enter only: Dollar" +
				  " Signs, Commas, Decimal Points, and numbers between 0...9!");*/
			return false;
		} // end else
	} // end for

	if(nDollarSign > 1)
	{
		//alert("ERROR! \n\nYou have entered more then one dollar sign!\nPlease only enter one!");
		return false;
	} // end if

	if(nDecimal > 1)
	{
		//alert("ERROR! \n\nYou have entered more then one decimal point!\nPlease only enter one!");
		return false;
	} // end if

	if(nDollarSign == 1)
	{
		// Make sure dollar sign in the first character in string
		// if there is a dollar sign present.
		if(xTxt.indexOf("$") != 0)
		{
			//alert("ERROR!  \n\nThe dollar sign you entered is not in the correct position!");
			return false;
		} // end if
	}// end if

	if(nDecimal == 1)
	{
		// Get the number of numbers after the decimal point in
		// the string if there is a decimal point present
		decPos = (txtLen - 1) - xTxt.indexOf(".");

		// Floating point cannot be more then two.
		// Valid format after decimal point.
		/**********************************/
		/*   $#.##, $#.#, $.#, $#., $.##  */
		/**********************************/
		
		if(decPos > 2)
		{
			//alert("ERROR! \n\nThe decimal point you entered is not in the correct position!");
			return false;
		} // end if
	} // end if

	if(nCommas == 0)
	{
		// If no commas are present value is a valid US
		// currency.
		return true;
	}
	else
	{
		// Get total number of dollar number(s), removing
		// floating point numbers or cents.
		nNum = nNum - decPos;

		// Determine if dollar sign is in string so to be 
		// removed.
		// After determining dollar sign, assign sDollarVal
		// numbers and comma(s)
		if(xTxt.indexOf("$", 0) == 0)
			sDollarVal = xTxt.substr(1, (nNum + nCommas));
		else
			sDollarVal = xTxt.substr(0, (nNum + nCommas));

		// Determine if a zero is the first number or if a
		// comma is the first or last character in the string.
		if(sDollarVal.lastIndexOf("0", 0) == 0 )
		{
			//alert("ERROR! \n\nYou cannot start the dollar amount out with a zero!");
			return false;
		}
		else if(sDollarVal.lastIndexOf(",", 0) == 0)
		{
			//alert("ERROR! \n\nYou cannot start the dollar amount out with a comma!");
			return false;
		}
		else if(sDollarVal.indexOf(",", (sDollarVal.length - 1)) == (sDollarVal.length - 1))
		{
			//alert("ERROR! \n\nYou cannot end the dollar amount with a comma!");
			return false;
		}
		else
		{
			// Initialize bComma indicating a comma has not been
			// occured yet.
			bComma = false;

			for(i = 0; i < sDollarVal.length; i++)
			{
				// Assign charater in substring to x.
				x = sDollarVal.substr(i, 1);

				if(parseInt(x) >= 0 || parseInt(x) <= 9)
				{
					// If x is a number add one to the number counter.
					nNumCount = nNumCount + 1;

					// Sense comma(s) are present number counter cannot
					// be more then three before the first or next comma.
					if(nNumCount > 3)
					{
						//alert("ERROR! \n\nYou have a mis-placed comma!");
						return false;
					} // end if
				}
				else
				{
					// If the number counter is less then three and
					// the comma indicator is true the comma is either
					// mis-placed or there are not enough values.
					if(nNumCount != 3 && bComma)
					{
						//alert("ERROR! \n\nYou have a mis-placed comma!");
						return false;
					} // end if

					// Reset the number counter back to zero.
					nNumCount = 0;

					// Set the comma indicator to true indicating
					// that the first comma has been found and that
					// there now MUST be three numbers after each
					// comma until the loop hits the end.
					bComma = true;
				} // end if
			} // end for

			// Determine if after the loop ended that there
			// was a total of three final numbers after the
			// last comma.
			if(nNumCount != 3 && bComma)
			{
				//alert("ERROR! \n\nYou have a mis-placed comma!");
				return false;
			} // end if
		} // end if
	} // end if

	// Return true indicating that the value is a valid
	// currency.
	return true;
}


/************************************************************************
Cookies functions
************************************************************************/

function CreateCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function ReadCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	
	return null;
}

function EraseCookie(name) {
	CreateCookie(name,"",-1);
}


/************************************************************************
Array functions
************************************************************************/

function IsItemInArray(inArray, searchItem) {
	for (var i = 0; i < inArray.length; i++) {
		if (inArray[i] == searchItem) {
			return true;
		}
	}
	
	return false;
}


/************************************************************************
Other functions
************************************************************************/

function Refresh() {
	var sURL = unescape(window.location.pathname);
	window.location.reload(false);
}

function Trim(str) {
	return str.replace(/^\s*|\s*$/g,"");
}

function ToggleBlock(id) {
	var block = document.getElementById(id);
	
	if (block) {
		if (block.style.display == "none") {
			block.style.display = "block";
		}
		else {
			block.style.display = "none";
		}
	}
}

function IsIE() {
	if (navigator.appName.indexOf("Explorer") > -1) {
		return true;
	}
	else {
		return false;
	}
}

function IsFirefox() {
	if (navigator.appName.indexOf("Navigator") > -1) {
		return true;
	}
	else {
		return false;
	}
}

function ToggleRow(row) {
	if (row.style.display == "none") {
		if (IsIE()) {
			displayValue = "block";
		}
		else {
			displayValue = "table-row";
		}
	}
	else {
		displayValue = "none";
	}
	
	row.style.display = displayValue;
}
