function lgnUserNameKeyPress(e)
{
    if (e && e.keyCode == 13)
    {
        var psw = document.getElementById("Logon1_tbPasswd");
        if (psw) psw.focus();
        e.cancelBubble = true;
        e.returnValue = false;
        return false;
    }
}

function lgnPasswdKeyPress(e)
{
    if (e && e.keyCode == 13)
    {
        //var but = document.getElementById("Logon1_butLogin");
        //if (but) but.click();
        
        //To support firefox
        __doPostBack('Logon1$butLogin','')

        e.cancelBubble = true;
        e.returnValue = false;
        return false;
    }
}

function phFullSise(_url,e)
{
    window.open(_url, "_blank", "status=no,resizable=yes,scrollbars=yes,menubar=yes,toolbar=yes");
    e.cancelBubble = true;
    e.returnValue = false;
    return false;
}

function phEmail(_url,e)
{
    window.open(_url, "_blank", "status=no,resizable=yes,scrollbars=yes,width=500,height=500");
    e.cancelBubble = true;
    e.returnValue = false;
    return false;
}

function phDownload(_url,e)
{
    window.open(_url, "_blank", "status=no,resizable=yes,scrollbars=yes");
    e.cancelBubble = true;
    e.returnValue = false;
    return false;
}

function emlrepair(arr) {
	var a = "";
	for (var i=0; i<arr.length; i++) {
		a+=String.fromCharCode(arr[i]);
	}
	return a;
}

function emlexplode(str) {
	var a = new Array();
	var tmp = "";
	for(var i=0; i<str.length; i++) {
		if (str.substr(i,1)=="," || str.substr(i,1)==".") {
			a[a.length] = parseInt(tmp) - 1;
			tmp="";
		} else
			tmp+=str.substr(i,1)
	}
	if (tmp)
		a[a.length]=parseInt(tmp)-1;
	return a;
}

function emlwrite(str,msg,css) {
	var x=emlrepair(emlexplode(str));
	document.write('<a href=javascript:void(0) onclick="window.location=\'mail\u0074o\u003a'+x+'\'">'+(msg?msg:x)+'</a>');
}
