function my_onload()
{
    document.loginform.uid.focus();
	showErrorsIfAny();
	
}
//set_focus();

function gup( name )
{  
   name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");  
   var regexS = "[\\?&]"+name+"=([^&#]*)";  
   var regex = new RegExp( regexS );  
   var results = regex.exec( window.location.href );  
   if( results == null )    
      return "";  
   else    return results[1];
   }

function setAction() {
 var caseID = gup("caseID");
 var urlValue = gup("URL")
 if (caseID != "") {
     document.loginform.action="help/logon.asp?URL=rep/editcase.asp?id=" + caseID;
     }
     else {
         if (urlValue != "") {
                document.loginform.action = "help/logon.asp?URL=" + urlValue;
            }
            else {
                document.loginform.action = "help/logon.asp?URL=";
            }
     }
 return true;
}
function showErrorsIfAny() {
    var invalid = gup("InvalidCredentials");
    if (invalid == "True") {
    document.loginform.elements["TextArea1"].value = "Invalid login details";
    }
}
//call after page loaded
window.onload = showErrorsIfAny; 
 

