Buscar Embarque: HandleClearSaved(); LoadCookie(); HandleValue('QuickViewNumber'); HandleMsg('QuickViewErrorMsg'); function HandleClearSaved() { var text = GetValue('ClearSaved'); if ( text != null ) { DeleteCookie(); } } function HandleValue(Key) { var controls = document.getElementsByName(Key) var text = GetValue(Key); if ( controls.length == 1 && text != null ) { controls[0].value = text; } } function HandleMsg(Key) { var control = document.getElementById(Key) var text = GetValue(Key); if ( control != null && text != null ) { control.innerText = text; } } function GetValue(Key) { var result; var queryString = location.search.substring(1); var parameterName = Key + "="; if ( queryString.length > 0 ) { begin = queryString.indexOf ( parameterName ); if ( begin != -1 ) { begin += parameterName.length; end = queryString.indexOf ( "&" , begin ); if ( end == -1 ) { end = queryString.length } result = decodeURIComponent( queryString.substring ( begin, end ) ); } } return result; } function SaveCookie() { var rememberMe = document.forms[0].RememberMe; if (rememberMe != null && rememberMe.checked) { var companyCode = escape( document.forms[0].CompanyCode.value ); var userEmail = escape( document.forms[0].UserEmail.value ); var userPassword = escape( document.forms[0].UserPassword.value ); var nextYear = new Date(); nextYear.setFullYear( nextYear.getFullYear() + 1 ); document.cookie = "0=" + companyCode + "; expires=" + nextYear.toUTCString(); document.cookie = "1=" + userEmail + "; expires=" + nextYear.toUTCString(); document.cookie = "2=" + userPassword + "; expires=" + nextYear.toUTCString(); } else { DeleteCookie(); } } function DeleteCookie() { document.cookie = "0=; expires=" + new Date().toUTCString(); document.cookie = "1=; expires=" + new Date().toUTCString(); document.cookie = "2=; expires=" + new Date().toUTCString(); } function LoadCookie() { LoadCookieValue( document.forms[0].CompanyCode, "0" ); LoadCookieValue( document.forms[0].UserEmail, "1" ); LoadCookieValue( document.forms[0].UserPassword, "2" ); document.forms[0].RememberMe.checked = document.forms[0].UserPassword.value != ''; } function LoadCookieValue(Target, Key) { var results = document.cookie.match ( '(^|;) ?' + Key + '=([^;]*)(;|$)' ); if ( results ) { Target.value = unescape ( results[2] ); } }