
	function showCharAtPos( textto )
	{
		var macstr = "images/buttons/vkeyboard/mac/"+textto+".jpg";
		var id = "number"+textto;
		document.getElementById(id).src= macstr;
	}

	function clearPass()
	{
		document.all.password.value='';
	}
	function clearChar(textto)
	{
		var str = "images/buttons/vkeyboard/"+textto+".jpg";
		var id = "number"+textto;
		document.getElementById(id).src= str;
	}
        function mOver(number,str)
	{
		var id=number
		document.getElementById(id).src=str;
	}
	function mOut(number,str)
	{
		var id=number
		document.getElementById(id).src=str;
	}
	function randomKeyLog()
	{
		var end= false;
		var rannum_begin = Math.round(Math.random()*10);
		var rannum_loop = "0.21619878376784096";
		var rannum_direction = Math.round(Math.random()*10);
		rannum_loop = Math.round(rannum_loop*10);
		if (rannum_loop == 10) rannum_loop--;
		if (rannum_begin == 10) rannum_begin--;
		var stop_sign = rannum_loop;
		while (!end)
			{
				var id = "number"+rannum_loop;
				document.getElementById(id).innerHTML = "<img border=\"0\" src=\"images/buttons/bnum-"+rannum_begin+".jpg\" width=\"32\" height=\"17\" id=\"num"+rannum_begin+"\" style=\"cursor:hand\""
                                                       +"onmouseover=\"mOver('num"+rannum_begin+"','images/buttons/bnum-"+rannum_begin+"-on.jpg')\""
                                                      +"onmouseout=\"mOut('num"+rannum_begin+"','images/buttons/bnum-"+rannum_begin+".jpg')\""
                                                      +"onClick=\"getCharAtPos('"+rannum_begin+"')\""
                                                      +"alt=\"Bàn phím &#7843;o ch&#7889;ng keylogger !\">";
				if (rannum_direction%2==0)
				{
					if (rannum_begin == 9) rannum_begin = 0;
					else rannum_begin ++;
				} else {
					if (rannum_begin == 0) rannum_begin = 9;
					else rannum_begin --;
				}
				if (rannum_loop == 9) rannum_loop =0;
					else rannum_loop++;
				if (rannum_loop == stop_sign) end = true;
		}
	}
	function getCharAtPos( textto )
		{
		var husername = document.getElementById("husername").value;

		if (husername == 1)
		{
			document.all.username.value=document.all.username.value+textto;
		} else {
			document.all.password.value=document.all.password.value+textto;
		}
	}

	function changeFocus(id)
	{
		if (id == 0)
		{
			document.getElementById("husername").value = 1;
			document.getElementById("hpassword").value = 0;
		}
		else
		{
			document.getElementById("hpassword").value = 1;
			document.getElementById("husername").value = 0;
		}
	}


function getInfo(event)
{
		if (event.keyCode != 8 && event.keyCode != 9)
		{
				alert("Quý khách vui lòng s&#7917; d&#7909;ng bàn phím &#7843;o &#273;&#7875; nh&#7853;p S&#7889; m&#7853;t mã, b&#7857;ng cách s&#7917; d&#7909;ng chu&#7897;t &#273;&#7875; b&#7845;m ch&#7885;n vào dãy s&#7889; bên d&#432;&#7899;i!");
				document.all.password.value="";
		}
}
function Clear()
{
	var husername = document.getElementById("husername").value;
	if(husername == 1)
	{
		document.mainform.username.value=""
		document.mainform.username.focus();
	}
	else
	{
		document.getElementById("password").value=""
		document.mainform.password.focus();
	}
}
function randomPopup()
{
	WI_NavigateEBankPopup1('popup1.html');
}

function isReload()
{
	if(location.reload(true))
	{
		anotherImg();
	}
}
//-->


function checkEnter(event) {
	if (event.keyCode == 13) {
		userSubmit();
	}
}

function anotherImg() {
	document.mainform.anotherimg.value = "1";
	document.mainform.submit();
	return true;
}

function userSubmit() {
	var hash_password = document.mainform.password.value;
	//hash_password = encrypt(hash_password);//hex_md5(hash_password);
	hash_password = hex_md5(hash_password);
	document.mainform.password.value = hash_password;
	document.mainform.submit();
	return true;
}

function setCookieEAB () {
	document.cookie="EABCookie=Internet_Banking";
}

function removeCookieEAB () {
	document.cookie=null;
}
