//WBL 17 Jun 2010 Go back to r1.13 (ie non xmas operational version)
//WBL 9 Apr 2007 add cookie
//WBL 3 Mar 2007 add time+name for firefox
//WBL 17 June 2006 point both ie4up and ns6up pfeiffer_local.html r1.114
var CookieName = "animation";
function setCookie(value) {
var today = new Date()
var expires = new Date()
expires.setTime(today.getTime() + 1000*60*60*24*365)
document.cookie = CookieName + "=" + escape(value)
+ "; expires=" + expires.toGMTString()
}
function getCookie(def) {
if (navigator.cookieEnabled == 0) return 0;
var search = CookieName + "="
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
var s = unescape(document.cookie.substring(offset, end))
//alert("cookie is '"+s+"'");
return s;
}
}
return def;
}
//from http://www.assortedstuff.com/webmaster/beyond/jssample/snow/snow.html
//!-- Original: Altan (snow@altan.hr)
//!-- Web Site: http://www.altan.hr/snow
var no = 0; // snow number
var running = true;
var speed = 50; // smaller number moves the snow faster
var snowflake = "http://www.cs.ucl.ac.uk/cgi-bin/staff/W.Langdon/endpop.bat?";
var snowname = "http://www.cs.ucl.ac.uk/cgi-bin/staff/W.Langdon/endnam.bat?1";
var ns4up = (document.layers) ? 1 : 0; // browser sniffer
var ie4up = (document.all) ? 1 : 0;
var ns6up = (document.getElementById&&!document.all) ? 1 : 0;
var dx, xp, yp; // coordinate and position variables
var am, stx, sty; // amplitude and step variables
//--var i, doc_width = 800, doc_height = 600;
var i, doc_width = 800, doc_height = 2600;
if (ns4up||ns6up) {
doc_width = self.innerWidth;
//--doc_height = self.innerHeight;
} else if (ie4up) {
doc_width = document.body.clientWidth;
doc_height = document.body.clientHeight;
}
dx = new Array();
xp = new Array();
yp = new Array();
am = new Array();
stx = new Array();
sty = new Array();
function initialise(number) {
no=number;
for (i = 0; i < no; ++ i) {
dx[i] = 0; // set coordinate variables
xp[i] = Math.random()*(doc_width-50); // set position variables
yp[i] = Math.random()*doc_height;
am[i] = Math.random()*20; // set amplitude variables
stx[i] = 0.02 + Math.random()/10; // set step variables
sty[i] = 0.7 + Math.random(); // set step variables
var h=(ie4up||ns6up)? "http://www.cs.ucl.ac.uk/staff/W.Langdon/pfeiffer_local.html" : "http://www.cs.ucl.ac.uk/staff/W.Langdon/pfeiffer_server.html";
var t=""+
"
";
if(i==0) t = t + "Newest snowflake ";
if(ns6up) {//IE6 sort of works but looks bad
t= t + "";
}
t = t + "