
	//var GetBaseUrl() = "https://irthnetweb01/irthnet";
	var baseUrl = "https://www.irth.com/irthnet";
	//var baseUrl = "";
	
	function SetInitialFocusToLogin()
	{
		var userID=document.getElementById("MemberLogin_UserIDTextBox");
	
		if(userID != null)
			userID.focus();
	}

	function GetBaseUrl()
	{
		if (baseUrl != "")
			return baseUrl;

		baseUrl = "https://" + window.location.hostname + "/irthnet";

		return baseUrl;
	}

	function submit_requestpassword()
	{
		if (!validateBrowser())
			reurn;

		document.forms[0].action = GetBaseUrl() + "/Logon.aspx?Reason=RequestPassword";
	    	document.forms[0].__VIEWSTATE.value = "";
		document.forms[0].__VIEWSTATE.name = 'NOVIEWSTATE';
		
		document.forms[0].submit();
	}

	function submit_memberlogin()
	{
		if (!validateBrowser())
			reurn;

		if (!Page_ClientValidate())
			return;

		// set the time zone offset
		var d = new Date();
		document.getElementById("MemberLogin_TimeZoneOffset").value = d.getTimezoneOffset();
				
		document.forms[0].action = GetBaseUrl() + "/Logon.aspx?ReturnUrl=%2firthnet%2fDefault.aspx";
	    	document.forms[0].__VIEWSTATE.value = "";
		document.forms[0].__VIEWSTATE.name = 'NOVIEWSTATE';
		
		document.forms[0].submit();

	}

	function validateBrowser()
	{
		version=0
		if (navigator.appVersion.indexOf("MSIE")!=-1){
			temp=navigator.appVersion.split("MSIE")
			version=parseFloat(temp[1])
		}

		if (version<6) //NON IE browser will return 0
		{
			document.getElementById("IeRequired").style.display = "inline";
			return false;
		}

		return true;
	}

	function checkEnter(e) //e is event object passed from function invocation
	{ 
		var characterCode; // literal character code will be stored in this variable

		if(e && e.which){ //if which property of event object is supported (NN4)
			e = e;
			characterCode = e.which; //character code is contained in NN4's which property
		}
		else{
			e = event;
			characterCode = e.keyCode; //character code is contained in IE's keyCode property
		}

		if(characterCode == 13){ //if generated character code is equal to ascii 13 (if enter key)
			submit_memberlogin(); //submit the form
			return false;
		}
		else{
			return true;
		}
	}

	function showContact()
	{
		var url = GetBaseUrl() + "/Contact.htm";
	
		showModalDialog(url,"","dialogWidth:375px; dialogHeight:320px; center=yes; help=no; status=no;");
	}
