<!-- 
	function placeFocus() 
	{
		var setfocus = false,
			j, i;

		if (document.forms.length > 0)
			for (j = 0; j < document.forms.length && !setfocus; j++)
			{
				var field = document.forms[j];
					
				for (i = 0; i < field.length && !setfocus; i++) 
					if (!field.elements[i].disabled && ((field.elements[i].type == "text") || (field.elements[i].type == "textarea"))) 
					{
						document.forms[j].elements[i].focus();
						setfocus = true;
					}
			}
	}

	function createWindow(URL, name, options)
	{
		var j = window.open(URL, name, options); 
		j.focus();
		
		return j;
	}

//  Function to create a cookie. You can add additional parameters such as expires, path, security
function SetCookie(name,value,expires)
{
	var argv = SetCookie.arguments;
    var argc = SetCookie.arguments.length;
    var expires = (argc > 2) ? argv[2] : null;
//    var path = (argc > 3) ? argv[3] : null;
    var domain = (argc > 4) ? argv[4] : null;
    var secure = (argc > 5) ? argv[5] : false;
    
	document.cookie = name + "=" + escape (value) +
        ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
  		"; path= /" +
        ((domain == null) ? "" : ("; domain=" + domain)) +
        ((secure == true) ? "; secure" : "");
}

	// Returns true if the given string contains no printable characters.
	function isStringEmpty(str)
	{
		return !str.match(/[A-Za-z0-9_]/,'i');
	}
	
	// Focus's the browser on the given object.
	function objFocus(obj)
	{
		if (obj.type != "hidden" && !obj.disabled)
		{
			obj.focus();
			if (obj.type == "text" || obj.type == "textarea" || obj.type == "password")
				obj.select();
		}
	}

	// Returns true if the given object contains only alpha-numeric chars.
	function validateNumeric(obj, sMsg)
	{
		if (obj) 
			if (!obj.value.match(/^\d+$/,'i'))
			{
				alert( sMsg );
				objFocus(obj);
				return false;
			}
		return true;
	}

	// Returns true if the given object contains a guid.
	function validateGUID(obj, sMsg)
	{
		if (obj) 
			if (!obj.value.match(/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/,'i'))
			{
				alert( sMsg );
				objFocus(obj);
				return false;
			}
		return true;
	}
	

	// Returns true if the given object contains a valid floating point number.
	function validateFloat(obj, sMsg)
	{
		if (obj) 
			if (!obj.value.match(/^(\d+,)*\d+(\.\d+)?$/,'i'))
			{
				alert( sMsg );
				objFocus(obj);
				return false;
			}
		return true;
	}

	function validateIsDate(obj, sErrStr)
	{
		var datestr = obj.value;
			
		var strarray = datestr.split("/");
				
		// We check for Australian Syntax here  (DD/MM/YYYY)
		if (strarray.length != 3 
			|| !isFinite(strarray[0]) || strarray[0] < 1 || strarray[0] > 31     // This is the day
			|| !isFinite(strarray[1]) || strarray[1] < 1 || strarray[1] > 12     // This is the month
			|| !isFinite(strarray[2]) || strarray[2] < 1724 && strarray[2] > 9999)  // This is the year
		{
			alert(sErrStr)
			objFocus(obj)
			return false;
		}
			
		return true;
	}

	
// -->
