/**
* Sets focus to first field on page
*/
function setFocusFirstField()
	{
    	try
	    {
    		var bFound = false;
		    for (f=0; f < document.forms.length; f++)
			    {
			    var formClassName = document.forms[f].className.toLowerCase();
			    
			    // Focus on first element enable of a form that the class is not noFocus (to skip a form)
			    if(formClassName.match("nofocus") == null) {			    	
				    for(i=0; i < document.forms[f].length; i++)
					    {
						    if ((document.forms[f][i].type != null) && (document.forms[f][i].type != "hidden") && (document.forms[f][i].disabled != true))
							    {
									document.forms[f][i].focus();
									var bFound = true;
							    }
						    if (bFound == true)
							    {
								    break;
							    }
					    }
				    if (bFound == true)
					    {
						    break;
					    }
				    }
			    }
	    }
    	catch(e)
	    {
		    // do nothing
	    }
    }
