function SaveCookies() { var strLogin = null; var strPassword = null; var strLoginAdd = null; var iElementCount = document.forms[ 0 ].elements.length; for( iElementCounter = 0; iElementCounter < iElementCount; iElementCounter++ ) { if( document.forms[ 0 ].elements[ iElementCounter ].type == "text" || document.forms[ 0 ].elements[ iElementCounter ].type == "password" || document.forms[ 0 ].elements[ iElementCounter ].type == "checkbox" ) { var strElementName = document.forms[ 0 ].elements[ iElementCounter ].name; var iIndex = 0; while( strElementName.indexOf( ".", iIndex ) != -1 ) { iIndex = strElementName.indexOf( ".", iIndex ) + 1; } strElementName = strElementName.substr( iIndex ); if( strElementName == "i_login" ) { strLogin = document.forms[ 0 ].elements[ iElementCounter ].value; } else if( strElementName == "i_pwd" ) { strPassword = document.forms[ 0 ].elements[ iElementCounter ].value; } else if( strElementName == "i_email" ) { strLoginAdd = document.forms[ 0 ].elements[ iElementCounter ].value; } else if( strElementName == "xb_savecookies" || strElementName == "xb_savepassword" ) { bSaveCookies = document.forms[ 0 ].elements[ iElementCounter ].checked; } } } if( bSaveCookies == true && ( strLogin != null || strLoginAdd != null ) && strPassword != null ) { var oDate = new Date(); oDate.setYear( oDate.getYear() + 25 ); if( strLoginAdd != null ) { document.cookie = "Login=" + escape( strLoginAdd ) + "; expires=" + oDate.toGMTString(); } else if( strLogin != null ) { document.cookie = "Login=" + escape( strLogin ) + "; expires=" + oDate.toGMTString(); } document.cookie = "Password=" + escape( strPassword ) + "; expires=" + oDate.toGMTString(); } } function getCookie( _CookieName ) { var strCookiePrefix = _CookieName + "="; var iCookieStartIndex = document.cookie.indexOf( strCookiePrefix ); if( iCookieStartIndex == -1 ) { return null; } var iCookieEndIndex = document.cookie.indexOf( ";", iCookieStartIndex + strCookiePrefix.length ); if( iCookieEndIndex == -1 ) { iCookieEndIndex = document.cookie.length; } return unescape( document.cookie.substring( iCookieStartIndex + strCookiePrefix.length, iCookieEndIndex ) ); } function deleteCookie( _CookieName ) { var oDate = new Date(); oDate.setTime( oDate.getTime() - 1 ); document.cookie = _CookieName + "=" + "; expires=" + oDate.toGMTString(); } function submitLoginPasswordInfo( _strLogin, _strPassword, _strPathToBP ) { document.forms[ 0 ].elements[ "var_login_param" ].value = _strLogin; document.forms[ 0 ].elements[ "var_password_param" ].value = _strPassword; s( _strPathToBP + ".b_p", "1" ); } // EOF