function Login()
{
    if (document.getElementById('username') != null && document.getElementById('password') != null)
    {
        var boolRet = true;
	    if (document.getElementById('username').value =='')
	    {
		    alert('user name is a required entry');
		    document.getElementById('username').focus();
		    boolRet = false;
    	
	    }
	    else
	    {
	        if (document.getElementById('password').value =='')
	        {
		        alert('password is a required entry');
		        document.getElementById('password').focus();
		        boolRet = false;
	        }
	    }
	    if (boolRet)
	    {
	    	//Get Server
	        loc1 = location.href.toLowerCase();
	        var locationRedirect;

	        if (loc1.indexOf("heman") != -1 || loc1.indexOf("shera") != -1)
	        {
		        locationRedirect = "http://www.truestarhealth.com/"
	        }
	        else
	        {
		        if (loc1.indexOf("genesis") != -1)
		        {
			        locationRedirect = "http://genesis/"
		        }
		        else
		        {
			        locationRedirect = "http://localhost/"
		        }
	        }
	
	        document.form1.action = locationRedirect;
	        document.form1.submit();   
	    }
	}
}
function showPress(evt)
{
	evt = (evt) ? evt : ((event) ? event : null);
	if (evt) 
	{
		if (evt.keyCode == 13)
		{
			 Login();
		}
	}
}	
document.onkeypress = showPress;

function Redirect()
{
	//Get Server
	loc1 = location.href.toLowerCase();
	var locationRedirect;

	if (loc1.indexOf("heman") != -1 || loc1.indexOf("shera") != -1)
	{
		locationRedirect = "http://www.truestarhealth.com/contact_us.asp"
	}
	else
	{
		if (loc1.indexOf("genesis") != -1)
		{
			locationRedirect = "http://genesis/contact_us.asp"
		}
		else
		{
			locationRedirect = "http://localhost/contact_us.asp"
		}
	}
	location.href = locationRedirect;
}