﻿<!-- //
function OnSubmitLogon(strCookiePath, strCookieName, dtExpiry, bCaseSensitive, bQuick)
    {
    if(IsCookiesValid(true) == false) return false;
    var hidChallenge = document.getElementById((bQuick) ? "hidQuickChallenge" : "hidChallenge");
    var pasPassword = document.getElementById((bQuick) ? "pasQuickPassword" : "pasPassword");
    
    if(hidChallenge)
        {
        var strPassword = pasPassword.value;
        if(!bCaseSensitive) strPassword = strPassword.toLowerCase();
        SetCookieValue(strCookieName, 'CHAL', hidChallenge.value, strCookiePath, dtExpiry);
        hidChallenge.value = MD5(MD5(strPassword) + hidChallenge.value);
        pasPassword.value = "";
        }
    
    return true;
    }
    
function OnClickReloadCaptcha(strRootPath, strCookiePath, strCookieName, dtExpiry)
    {    
	var strQueryString
	strQueryString = "";
	
	if(strCookieName != "") strQueryString += "CID=" + strCookieName;
	
	if(strCookiePath != "")
	    {
	    if(strQueryString != "") strQueryString += "&"
	    strQueryString += "CPT=" + strCookiePath;
	    }
	    
	if(dtExpiry != "")
	    {
	    if(strQueryString != "") strQueryString += "&"
	    strQueryString += "CXP=" + dtExpiry;
	    }
	
	var imgCaptcha = document.getElementById("imgCaptcha");
	if(imgCaptcha)
	    {
	    var dtNow = new Date();
	    SetCookieValue(strCookieName, "CAPT", "", strCookiePath, dtNow);
	    imgCaptcha.src = strRootPath + "inc/captcha.asp?" + strQueryString + "SEC=" + dtNow.getMilliseconds();
	    }
    }
// -->