
    // Client-side Javascript version of request.getContextPath().
    // This function will work OK as long as this web app is not deployed as the root web application.
    function getContextPath() {
        var fullPath = location.pathname.substr(1);
        var index = fullPath.indexOf("/");
        return "/" + fullPath.substring(0, index);
    }

    function updateCtn() {

        // Determine selected CTN.
        var sel = document.forms["selectedCtnForm"].selectedCtn;
        var selectedCtnIndex = sel.selectedIndex;
        var selectedCtn = sel.options[selectedCtnIndex].value;

        var url = getContextPath() + "/view/update-active-mobile.do?subIdxValue=" + selectedCtn + "&currentView=" + location.pathname;
        location.href = url;
    }


    function updateCallDetailGroup() {

        // Determine selected group.
        var sel = document.forms["selectedGroupForm"].selectedGroup;
        var selectedGroupIndex = sel.selectedIndex;
        var selectedGroup = sel.options[selectedGroupIndex].value;

        var url = getContextPath() + "/view/update-active-call-detail-group.do?GroupName=" + selectedGroup + "&currentView=" + location.pathname;
        location.href = url;
    }

	function openViewBillWin(){
	    x = window.open(getContextPath() + "/bill_tutorial/bill_tutorial.htm","window2","width=630,height=455,scrollbars=no,toolbar=no,resizable=yes");
    }

    function sessionTimeoutRelogin(seconds)  {
        // todo:  minutes should be an argument and retrieved from web.xml -- not hardcoded.
        var minutes = seconds / 60;

        alert("Your Online Account Manager session has timed out."
        + "\n" + "As a security measure, sessions within My Account end after " + minutes + " minutes of inactivity."
        + "\n" + "Select OK to return to My Account Login.");

        location.href = "/olam/logout.olamexecute";
    }

      function dotcomCookie()  {
      popup = window.open('https://www.cingular.com/includes/cookie_setter','Cingular','height=0,width=0,status=no,toolbar=no,menubar=no,location=no');
      popup.opener.focus();
      window.setTimeout('popup.close()', 0);
      }

      function dotcomCookie1(ctn, zipCode)  {

        var today = new Date();
        var expire = new Date();

        expire.setTime(today.getTime() + 3600000*24*1000000);

        document.cookie = "zipcode= " +  zipCode  + " " + ctn + ";expires=" + expire.toGMTString() + ";path=/;domain=.cingular.com";
        document.cookie = "ctn=" + ctn + ";expires=" + expire.toGMTString() + ";path=/;domain=.cingular.com";
        document.cookie = "cingularOrAtt=cingularNonAweCustomer;expires=Fri, 01-Jan-55 00:00:01 GMT;path=/;domain=.cingular.com";
      }




