home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1998 November
/
pcwk_11_98a.iso
/
Wtestowe
/
Money99
/
money99.1
/
cps_cook.js
< prev
next >
Wrap
Text File
|
1998-07-25
|
1KB
|
45 lines
function getCookieVal (offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}
function GetCookie (strCookie) {
if (strCookie == "") {
alert("ASSERT: in GetCookie(): strCookie param is empty");
return null;
}
var arg = strCookie + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
var j;
while (i < clen) {
j = i + alen;
if (document.cookie.substring(i, j) == arg)
return getCookieVal(j);
i = document.cookie.indexOf(" ", i) + 1;
if (i == 0)
break;
}
return null;
}
// Has the CPS object been installed? If not, don't try to use it
var g_bUseCPS = false;
var myCookie = '' + GetCookie('MI_CPS_Installed');
if( myCookie.indexOf('yes') >= 0)
{
g_bUseCPS = true;
}
// Check Navigator's plugins array
if(navigator.appName.substring(0,8) == "Netscape")
{
var myPlugin = navigator.plugins["Microsoft CalcStore"];
if (myPlugin)
{
g_bUseCPS = true;
}
}