function initialiseLogin(id) {
	var loginPanelObj = getElementsByAttribute(document.getElementById(id), "div", "id", "LoginPanel");
	var loginFormInputElements = loginPanelObj[0].getElementsByTagName("INPUT");
		loginFormInputElements[2].value = "";
		loginFormButton = new Image();
		loginFormButton.src = "images/login-mo.gif";
		loginFormInputElements[2].onmouseover = function() {
			this.style.backgroundImage = "url(images/login-mo.gif)";
		}
		loginFormInputElements[2].onmouseout = function() {
			this.style.backgroundImage = "url(images/login.gif)";
		}
		loginFormInputElements[2].onclick = function() {
			var theForm = document.forms[0];
			var oldAction = theForm.action;	
			var qStr = document.location.search;
				theForm.action = document.location.href.replace("http://","https://");
			if (document.location.href.indexOf(".aspx") == -1) {
				if (oldAction.indexOf("?") != -1) oldAction = oldAction.substring(0, oldAction.indexOf("?"));		
				if (oldAction.indexOf("/") != -1) oldAction = oldAction.substring(oldAction.lastIndexOf("/") + 1, oldAction.length);
				if (qStr.length > 0) theForm.action = theForm.action.replace(qStr, oldAction + qStr) 
				else theForm.action += oldAction;
			}
			if (theForm.action.indexOf("hm=1") == -1) {
				if (qStr.length > 0) {
					var newQStr = qStr.replace("?", "?hm=1&");
						theForm.action = theForm.action.replace(qStr, newQStr);
				} else theForm.action += "?hm=1";
			}
		}
}