function RedirectOpener(Target, Secure){ var URL if (Secure == true){ URL = 'https://www.chevrontravelclub.com/cccard/' + getLanguage() + '/' + Target; } else{ URL = 'http://www.chevrontravelclub.com/cccard/' + getLanguage() + '/' + Target; } window.opener.location.href = URL; window.opener.focus(); window.close(); } function getLanguage() { var currentURL = window.location.href; var enPos = currentURL.indexOf('/en/'); var esPos = currentURL.indexOf('/es/'); var currentLang; if (esPos != -1) currentLang = "es"; else currentLang = "en"; return currentLang; } // Both "Get Language" functions do the same thing, but // are being kept for legacy purposes (older pages using one or the other) function getLang() { var currentURL = window.location.href; var enPos = currentURL.indexOf('/en/'); var esPos = currentURL.indexOf('/es/'); var currentLang; if (esPos != -1) currentLang = "es"; else currentLang = "en"; return currentLang; } function Load_Enroll(strTargetPage) { window.top.location.href='https://www.chevrontravelclub.com/cccard/' + getLanguage() + '/public_SSL/cce_enroll.asp?TargetPage=' + strTargetPage; } function Load_Frames(strLeftFrame,strRightFrame,sTab) { window.top.frames[0].document.location.href="cce_TopNav.asp?tab=" + sTab; window.top.frames[1].document.location.href=strLeftFrame; window.top.frames[2].document.location.href=strRightFrame; } function AutoTab(From, To){ if(From.value.length == From.getAttribute("maxlength")) To.focus(); } function launchWindow(targetURL){ window.open("http://www.chevrontravelclub.com/cccard/" + getLanguage() + '/' + targetURL,'faq') } function linkToPage(targetURL, blnSecure, blnNewWindow){ var strURL if (blnSecure) strURL = "https://www.chevrontravelclub.com/cccard/" + getLanguage() + "/" + targetURL else strURL = "http://www.chevrontravelclub.com/cccard/" + getLanguage() + "/" + targetURL if (blnNewWindow) { window.open(strURL) } else { document.location.href = strURL; } } function ViewAd(sAdPage,iAdID,bNewWindow,sAdType) { if(bNewWindow) window.open("http://www.chevrontravelclub.com/cccard/" + getLang() + "/include/link.asp?AdID=" + iAdID + "&AdPage=" + sAdPage + "-" + getLang() + "&AdType=" + sAdType + "&AdName=" + iAdID,"_blank"); else document.location.href = "http://www.chevrontravelclub.com/cccard/" + getLang() + "/include/link.asp?AdID=" + iAdID + "&AdPage=" + sAdPage + "-" + getLang() + "&AdType=" + sAdType + "&AdName=" + iAdID; } // Function to Check Numeric values function IsNumeric(sText) { var ValidChars = "0123456789"; var IsNumber=true; var Char; for (i = 0; i < sText.length && IsNumber == true; i++) { Char = sText.charAt(i); if (ValidChars.indexOf(Char) == -1) { IsNumber = false; } } return IsNumber; }//End Function // Function is used to impose a specified maxLength on a Text Area function imposeMaxLength(Object, MaxLen){ return (Object.value.length < MaxLen); }