home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2000 May
/
Chip_2000-05_cd1.bin
/
zkuste
/
Delphi
/
nastroje
/
profil
/
Prodel_soubory
/
survey.js
< prev
next >
Wrap
Text File
|
2000-03-10
|
2KB
|
73 lines
//<!--
var surveyLocation = "http://www.gamespot.com/research/zddownload/";
var cookieName = "dl_study01";
var sampleRate = .001;
var expireDate = new Date(2000, 4, 8);
var cookieValue = getCookie(cookieName);
if (cookieValue == null){
setCookie(cookieName, "Sampled", expireDate);
var sampled = getRandom();
if(sampled < sampleRate) {
if ((navigator.appName == "Microsoft Internet Explorer") &&
(parseInt(navigator.appVersion) < 4)) {
window.location=(surveyLocation);
}else{
window.open(surveyLocation,'surveyWindow','scrollbars,resizable');
}
}
}
function getRandom() {
var D = new Date();
this.seed = 2345678901 + (D.getSeconds() * 0xFFFFFF) + (D.getMinutes() * 0xFFFF);
this.A = 48271;
this.M = 2147483647;
this.Q = this.M / this.A;
this.R = this.M % this.A;
this.oneOverM = 1.0 / this.M;
var Hi = this.seed / this.Q;
var Lo = this.seed % this.Q;
var Test = this.A * Lo - this.R * Hi;
if(Test > 0)
this.seed = Test;
else
this.seed = Test + this.M;
return(this.oneOverM * this.seed);
}
function getCookie(Name) {
var search = Name + "=";
if (document.cookie.length > 0) { // if there are any cookies
offset = document.cookie.indexOf(search);
if (offset != -1) { // if cookie exists
offset += search.length ;
// set index of beginning of value
end = document.cookie.indexOf(";", offset);
// set index of end of cookie value
if (end == -1);
end = document.cookie.length;
return unescape(document.cookie.substring(offset, end));
}
}
}
// Sets cookie values. Expiration date is optional
function setCookie(name, value, expire) {
document.cookie = name + "=" + escape(value)
+ ((expire == null) ? "" : ("; expires=" + expire.toGMTString()))
}
//-->