	function checkVals(val, obj)
	{
		
		var charpos = val.search("[^A-Za-z0-9]");
		
		if (charpos >= 0)
		{
		
			var str1, str2 = "";
			var len = val.length;
			alert("Only alphanumeric characters are allowed")
			
			str1 = val.substring(0, charpos);
			str2 = val.substring(charpos + 1, len);
			
			obj.value = str1 + str2;
		
		}
	
	}

function clearField(fieldID,clearValue){
	if (fieldID.value == clearValue){
		fieldID.value="";
	}
}

function checkCapsLock( e ) {


	var myKeyCode=0;
	var myShiftKey=false;
	var myMsg='Caps Lock is On.\n\nTo prevent entering your password incorrectly,\nyou should press Caps Lock to turn it off.';

	// Internet Explorer 4+
	if ( document.all ) {
		myKeyCode=e.keyCode;
		myShiftKey=e.shiftKey;

	// Netscape 4
	} else if ( document.layers ) {
		myKeyCode=e.which;
		myShiftKey=( myKeyCode == 16 ) ? true : false;

	// Netscape 6
	} else if ( document.getElementById ) {
		myKeyCode=e.which;
		myShiftKey=( myKeyCode == 16 ) ? true : false;

	}

	// Upper case letters are seen without depressing the Shift key, therefore Caps Lock is on
	if ( ( myKeyCode >= 65 && myKeyCode <= 90 ) && !myShiftKey ) {
		alert( myMsg );

	// Lower case letters are seen while depressing the Shift key, therefore Caps Lock is on
	} else if ( ( myKeyCode >= 97 && myKeyCode <= 122 ) && myShiftKey ) {
		alert( myMsg );

	}
}

function isAlphaNumeric(val, field)
{
	var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
	var checkOKNum = "0123456789";
	var checkStr = val;
	var allValid = true;
	
	var eStr = ""
	
	var aCount = 0;
	var nCount = 0;
	
	for (i = 0;  i < checkStr.length;  i++)
	{
		ch = checkStr.charAt(i);
		
		for (j = 0;  j < checkOK.length;  j++)
		{
			if (ch == checkOK.charAt(j))			
			{
				aCount = aCount + 1;			
				break;
			}
		}
		
		for (j = 0;  j < checkOKNum.length;  j++)
		{
			if (ch == checkOKNum.charAt(j))
			{
				nCount = nCount + 1;			
				break;
			}
		}
		
		if (j == checkOK.length)
		{
			allValid = false;			
			eStr = "Your " + field + " can only contain letters and numbers"			
		}
		
	}
	
	if ((aCount == 0) || (nCount == 0))
	{		
		eStr = "Your " + field + " must contain both letters and numbers and be at least 6 characters long"			
	}

	return eStr;

}

function resizeDiv(divName)
{
	
	document.getElementById(divName).style.height = (parseInt(getHeight()) - 150)+"px";
}
function resizeDiv2(divName)
{
	document.getElementById(divName).style.height = (parseInt(getHeight()) - 250);
}

function getHeight() 
{
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) 
  {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } 
  else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } 
  else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) 
  {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
 return myHeight;
 
}