<!--
function cancelUpload()
{
	return confirm("Are you sure?");
}

function isDate(year, month, day)
{
	var correct = true;
	
	if(month.charAt(0) == '0')
		month = month.charAt(1);
	
	if(day.charAt(0) == '0')
		day = day.charAt(1);
	
	if(!isInt(year) || !isInt(month) || !isInt(day))
		correct = false;
	
	if((month > 12) || (month < 1))
		correct = false;
	
	if((day > 31) || (day < 1))
		correct = false;
	
	if( ((month == 4) || (month == 6) || (month == 9) || (month == 11)) && (day > 30) )
		correct = false;
	
	if((month == 2) && (day > 29))
		correct = false;
	
	if( (month == 2) && (day == 29) && ((year % 4) != 0) )
		correct = false;
	
	return correct;
}

function isInt(number)
{
	if(number.length == 0)
		return false;
	
	for(var i = 0; i < number.length; i++)
	{
		if( (number.charAt(i) != '0') && !parseFloat(number.charAt(i)) )
			return false;
	}
	
	return true;
}

function isMoney(number)
{
	var answer = true;
	for(var i = 0; i < number.length; i++)
	{
		if( (number.charAt(i) != "0") &&
				(number.charAt(i) != "1") &&
				(number.charAt(i) != "2") &&
				(number.charAt(i) != "3") &&
				(number.charAt(i) != "4") &&
				(number.charAt(i) != "5") &&
				(number.charAt(i) != "6") &&
				(number.charAt(i) != "7") &&
				(number.charAt(i) != "8") &&
				(number.charAt(i) != "9") &&
				(number.charAt(i) != "."))
		{
			answer = false;
			break;
		}
	}
	
	if(number.indexOf(".") != number.lastIndexOf("."))
		answer = false;
	
	if( (number.length-3 > number.lastIndexOf(".")) && (number.lastIndexOf(".") != -1) )
		answer = false;
	
	return answer;
}

function displayFloat(num)
{
	if(num.indexOf(".") == -1)
		return num + ".00";
	else if(num.indexOf(".") == num.length-1)
		return num + "00";
	else if(num.indexOf(".") == num.length-2)
		return num + "0";
	else
		return num;
}

function stripHTML(str)
{
	var temp = str;
	
	while(temp.indexOf("<") != -1)
	{
		temp = temp.substring( 0, temp.indexOf("<") ) + temp.substring( temp.indexOf(">")+1, temp.length );
	}
	
	return temp;
}

function max(num1, num2)
{
	if(num1 > num2)
		return num1;
	return num2;
}

function tabMouseOver(id)
{
	document.getElementById("td"+id+"Tab").style.cursor = "hand";
	document.getElementById("a"+id+"Link").style.textDecoration = "underline";
}

function tabMouseOut(id)
{
	document.getElementById("td"+id+"Tab").style.cursor = "pointer";
	document.getElementById("a"+id+"Link").style.textDecoration = "none";
}

function hasInvalidHTML(input)
{
	var i;
	var str = input.toLowerCase();
	var str2 = str.replace(new RegExp(" ", "g"), "");
	if(str2.indexOf("<!--") != -1)
		return true;
	if(str2.indexOf("<!doctype") != -1)
		return true;
	if(str2.indexOf("<applet") != -1)
		return true;
	if(str2.indexOf("<area") != -1)
		return true;
	if(str2.indexOf("<body") != -1)
		return true;
	if(str2.indexOf("<button") != -1)
		return true;
	if(str2.indexOf("<comment") != -1)
		return true;
	if(str2.indexOf("<embed") != -1)
		return true;
	if(str2.indexOf("<form") != -1)
		return true;
	if(str2.indexOf("<frame") != -1)
		return true;
	if(str2.indexOf("<frameset") != -1)
		return true;
	if(str2.indexOf("<head") != -1)
		return true;
	if(str2.indexOf("<html") != -1)
		return true;
	if(str2.indexOf("<iframe") != -1)
		return true;
	if(str2.indexOf("<input") != -1)
		return true;
	if(str2.indexOf("<link") != -1)
		return true;
	if(str2.indexOf("<map") != -1)
		return true;
	if(str2.indexOf("<meta") != -1)
		return true;
	if(str2.indexOf("<noframes") != -1)
		return true;
	if(str2.indexOf("<noscript") != -1)
		return true;
	if(str2.indexOf("<object") != -1)
		return true;
	if(str2.indexOf("<option") != -1)
		return true;
	if(str2.indexOf("<param") != -1)
		return true;
	if(str2.indexOf("<script") != -1)
		return true;
	if(str2.indexOf("<select") != -1)
		return true;
	if(str2.indexOf("<textarea") != -1)
		return true;
	if(str2.indexOf("<title") != -1)
		return true;
	
	var strNoSpacesByEquals = str;
	while(strNoSpacesByEquals.indexOf(" =") != -1)
		strNoSpacesByEquals = strNoSpacesByEquals.replace(new RegExp(" =", "g"), "=");
	while(strNoSpacesByEquals.indexOf("= ") != -1)
		strNoSpacesByEquals = strNoSpacesByEquals.replace(new RegExp("= ", "g"), "=");
	while(strNoSpacesByEquals.indexOf("=\" ") != -1)
		strNoSpacesByEquals = strNoSpacesByEquals.replace(new RegExp("=\" ", "g"), "=\"");
	while(strNoSpacesByEquals.indexOf("=' ") != -1)
		strNoSpacesByEquals = strNoSpacesByEquals.replace(new RegExp("=' ", "g"), "='");
	
	strNoSpacesByEquals = strNoSpacesByEquals.replace(new RegExp("'", "g"), "' ");
	strNoSpacesByEquals = strNoSpacesByEquals.replace(new RegExp("'  ", "g"), "' ");
	strNoSpacesByEquals = strNoSpacesByEquals.replace(new RegExp("\"", "g"), "\" ");
	strNoSpacesByEquals = strNoSpacesByEquals.replace(new RegExp("\"  ", "g"), "\" ");
	
	strNoSpacesByEquals = strNoSpacesByEquals.replace(new RegExp("\t", "g"), " ");
	strNoSpacesByEquals = strNoSpacesByEquals.replace(new RegExp("\r\n", "g"), " ");
	strNoSpacesByEquals = strNoSpacesByEquals.replace(new RegExp("\r", "g"), " ");
	strNoSpacesByEquals = strNoSpacesByEquals.replace(new RegExp("\n", "g"), " ");
	
	// make sure they dont have any javascript: links
	var temp = strNoSpacesByEquals;
	while(temp.indexOf("<a") != -1)
	{
		temp = temp.substring(temp.indexOf("<a"), temp.length);
		var strATag = temp.substring(temp.indexOf("<a"), temp.indexOf(">"));
		temp = temp.substring(temp.indexOf(">")+1, temp.length);
		var arrAttr = strATag.split(" ");
		for(i = 0; i < arrAttr.length; i++)
		{
			if(arrAttr[i].indexOf("=") == -1)
				continue;
			var arrAttr2 = arrAttr[i].split("=");
			if(arrAttr2[0] == "href")
			{
				arrAttr2[1] = arrAttr2[1].replace(new RegExp(" ", "g"), "");
				if(arrAttr2[1].indexOf("javascript:") < 2 && arrAttr2[1].indexOf("javascript:") > -1)
					return true;
			}
		}
	}
	
	// make sure they dont have any javascript event attributes
	temp = strNoSpacesByEquals;
	while(temp.indexOf("<") != -1)
	{
		temp = temp.substring(temp.indexOf("<"), temp.length);
		var strEventTag = temp.substring(temp.indexOf("<"), temp.indexOf(">"));
		temp = temp.substring(temp.indexOf(">")+1, temp.length);
		var arrEvent = strEventTag.split(" ");
		for(i = 0; i < arrEvent.length; i++)
		{
			if(arrEvent[i].indexOf("=") == -1)
				continue;
			var arrEvent2 = arrEvent[i].split("=");
			/*if( (arrEvent2[0] == "onabort") || 
					(arrEvent2[0].indexOf("onbefore") != -1 || 
					(arrEvent2[0] == "onblur") || 
					(arrEvent2[0] == "onchange") || 
					(arrEvent2[0] == "onclick") || 
					(arrEvent2[0] == "ondblclick") || 
					(arrEvent2[0] == "ondrag") || 
					(arrEvent2[0] == "onerror") || 
					(arrEvent2[0] == "onfocus") || 
					(arrEvent2[0] == "onhelp") || 
					(arrEvent2[0] == "onkeydown") || 
					(arrEvent2[0] == "onkeypress") || 
					(arrEvent2[0] == "onkeyup") || 
					(arrEvent2[0] == "onload") || 
					(arrEvent2[0] == "onmousedown") || 
					(arrEvent2[0] == "onmouseout") || 
					(arrEvent2[0] == "onmouseover") || 
					(arrEvent2[0] == "onmouseup") || 
					(arrEvent2[0] == "onmove") || 
					(arrEvent2[0] == "onreset") || 
					(arrEvent2[0] == "onresize") || 
					(arrEvent2[0] == "onsubmit") || 
					(arrEvent2[0] == "onunload") )
			{*/
			if(arrEvent2[0].indexOf("on") == 0)
			{
				return true;
			}
		}
	}
	
	return false;
}
//-->
