﻿// JScript File

  function SetLogoutCookie(value)
        {
            var exdate=new Date();
            exdate.setDate(exdate.getDate()+1);
            var expires = "; expires="+exdate.toGMTString();
            document.cookie = "logout=" + value + expires+"; path=/";
        }

        function Checklogout()
        {
            var c_start = document.cookie.indexOf("logout=");
            if (c_start!=-1)
            {
                c_start=c_start + 7; 
                c_end=document.cookie.indexOf(";",c_start)
                if (c_end==-1) 
                {
                    c_end=document.cookie.length;
                }
                if(document.cookie.substring(c_start,c_end) == "true")
                {
                    return true;
                }                
            }
            return false;
        }

        function RedirectToLoginPage()
        {
            if (Checklogout())
            {
                window.location = "Index.html";
            }
        }


