	window.onKeyPress = NNKeyCap;
	
	function NNKeyCap(){
		alert('a');
	}
	
	function makeNumeric(s)
	{
		var st = '';
		for (i=0; i < s.length; i++)
		{
			if ((s.charAt(i) >= '0') && (s.charAt(i) <= '9'))
				st = st + s.charAt(i);
		}
		if (st.length == 0)
			st = '0';
		return st;
	}

	//functions used by the dateInputField
	function getDaysofYear (Year)
	{
		if (leapYear (Year)==1)
			Leap=29;
		else
			Leap=28;
		daysOfYear = new Array(0, 31, Leap, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
		return (daysOfYear);
	}

	function leapYear (Year)
	{
		if (((Year % 4)==0) && ((Year % 100)!=0) || ((Year % 400)==0))
			return (1);
		else
			return (0);
	}
	
	function calcDays(_postfix)
	{
		obj = document.getElementById(_postfix + 'ddlMonth');
		month = obj.options[obj.selectedIndex].value;
		obj = document.getElementById(_postfix + 'ddlYear');
		year = obj.options[obj.selectedIndex].value;
		
		daycount = 31;
		
		if (month != 0 && year != 0)
			daycount = getDaysofYear(year)[month];
		
		obj = document.getElementById(_postfix + 'ddlDay');
		if (obj.options.length > 0)
		{
			hasZero = false;

			if (obj.options[0].value == "0")
				hasZero = true;
				
			oldVal = obj.options[obj.selectedIndex].value;
			
			obj.options.length = 0;
			
			y = 0;
			if (hasZero)
			{
				obj.options[y] = new Option('','0');
				y++;
			}
				
			for (x = 1; x <= daycount; x++)
			{
				obj.options[y] = new Option(x,x);
				if (x == oldVal)
					obj.options[y].selected = true;
				y++;
			}
		}
		CheckDate(obj.options[obj.selectedIndex].value,month,year,_postfix);
	}
	
	function RemoveSpaceToUppercase(s)
{
	var st = '';
	for (i=0; i < s.length; i++)
	{
		if (s.charAt(i) != ' ')
			st += s.charAt(i).toUpperCase();
	}
	return st;
}


function LettersOnlyToLowercase(s)
{
	var st = '';
	for (i=0; i < s.length; i++)
	{
		if (((s.charAt(i) >= 'a') && (s.charAt(i) <= 'z')) || 
			((s.charAt(i) >= 'A') && (s.charAt(i) <= 'Z')))
			st += s.charAt(i).toLowerCase();
	}
	return st;
}

function SetInitials(s)
{
	var st = '';
	for (i=0; i < s.length; i++)
	{
		if (((s.charAt(i) >= 'a') && (s.charAt(i) <= 'z')) || 
			((s.charAt(i) >= 'A') && (s.charAt(i) <= 'Z')))
		{
			st += s.charAt(i).toUpperCase() + '.';
		}
	}
	return st;
}


function ValidateInitials(s)
{
	var st = '';
	for (i=0; i < s.length; i++)
	{
		//if (((s.charAt(i) > 'a') && (s.charAt(i) < 'z')) || ((s.charAt(i) > 'A') && (s.charAt(i) < 'Z')))
		if (s.charAt(i) != '.')
			st = st + s.charAt(i).toUpperCase() + '.';
	}
	return st;
}

// This script makes every letter of a new word a capital letter and the rest a lowercase

function FirstLetterCapital(s)
{
	var newword = 1;
	var ns = new String;
	
	for (i=0; i < s.length; i++)
	{
		if (newword)
		{
			ns += s.charAt(i).toUpperCase();
			newword = 0;
		} else
		{
			if ((s.charAt(i) == '-') || (s.charAt(i) == ' ')) newword = 1;
			
			ns += s.charAt(i).toLowerCase();
		}
	}
	return ns;
}
	
	function CheckDate(_day,_month,_year,_postfix)
	{
		d = new Date();
		nowDay = d.getDate();
		nowMonth = d.getMonth() + 1;
		nowYear = d.getYear();

		if (_year == nowYear)
		{
			if (_month >= nowMonth)
			{
				if (_month > nowMonth)
				{
					obj = document.getElementById(_postfix + 'ddlMonth');
					obj.options[nowMonth - 1].selected = true;
					_month = nowMonth;
				}

				if (_month == nowMonth && _day > nowDay)
				{
					obj = document.getElementById(_postfix + 'ddlDay');
					obj.options[nowDay - 1].selected = true;
				}
			}
		}
		
		
	}
////////////

function noRightClick(buttonClicked)
{
	if (navigator.appName == 'Netscape' && (buttonClicked.which == 2 || buttonClicked.which == 3)) return false;
	else if (navigator.appName == 'Microsoft Internet Explorer' && (event.button == 3 || event.button == 2))
	{
		alert('disabled');
		return false;
	}
	return true;
}

document.onmousedown=noRightClick;
document.onmouseup=noRightClick;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
if (document.layers) window.captureEvents(Event.MOUSEUP);
window.onmousedown=noRightClick;
window.onmouseup=noRightClick;
