/**************************[move Layer]*************************************/ function move(layer,x,y) { accessCSS(layer).left=x; accessCSS(layer).top = y; }
function browserBredde() { if (window.innerWidth) return window.innerWidth; else if (document.body.clientWidth) return document.body.clientWidth; else return 1024; }
function browserHoyde() {
if (window.innerHeight) return window.innerHeight; else if (document.body.clientHeight) return document.body.clientHeight; else return 800; }
function makeDiv(objName,content) { // positionType could be 'absolute' or 'relative' var oDiv = document.createElement ("DIV"); oDiv.id = objName; oDiv.style.width = 24; oDiv.style.height= 24; oDiv.innerHTML=content; oDiv.style.position = "absolute"; oDiv.style.left=-2000; oDiv.style.top=-2000; oDiv.style.overflow="hidden"; document.body.appendChild (oDiv); delete oDiv; }
var snowC=0; var x = new Array(); var y = new Array(); var speed = new Array(); var t=0; var cC = new Array(); var ra = new Array(); var sum_snowC = 0; var alive = new Array();
var snoHaug = new Array(); var maxWidth=browserBredde()-60; var maxHeight = browserHoyde();
for (t=0;t<Math.round(maxWidth/10);t++) snoHaug[t] = maxHeight-10;
function makeSnow() { sum_snowC++; x[snowC] = Math.round(Math.random()*maxWidth); y[snowC] = 10; speed[snowC] = Math.round(Math.random()*8)+1; var bilde="//i194.photobucket.com/albums/z118/bondslozo/d745da34.gif"; if (speed[snowC]<3) bilde="//i194.photobucket.com/albums/z118/bondslozo/c7109967.gif"; else if (speed[snowC]<6) bilde="//i194.photobucket.com/albums/z118/bondslozo/8b92042a.gif"; else if (speed[snowC]<8) bilde="//i194.photobucket.com/albums/z118/bondslozo/7ed009d1.gif";
<script language="javascript">
<!--
ns6 = document.getElementById;
ns = document.layers;
ie = document.all;
/*******************[AccessCSS]***********************************/
function accessCSS(layerID) { //
if(ns6){ return document.getElementById(layerID).style;} //
else if(ie){ return document.all[layerID].style; } //
else if(ns){ return document.layers[layerID]; } //
}/***********************************************************/
/**************************[move Layer]*************************************/
function move(layer,x,y) { accessCSS(layer).left=x; accessCSS(layer).top = y; }
function browserBredde() {
if (window.innerWidth) return window.innerWidth;
else if (document.body.clientWidth) return document.body.clientWidth;
else return 1024;
}
function browserHoyde() {
if (window.innerHeight) return window.innerHeight;
else if (document.body.clientHeight) return document.body.clientHeight;
else return 800;
}
function makeDiv(objName,content)
{
// positionType could be 'absolute' or 'relative'
var oDiv = document.createElement ("DIV");
oDiv.id = objName;
oDiv.style.width = 24;
oDiv.style.height= 24;
oDiv.innerHTML=content;
oDiv.style.position = "absolute";
oDiv.style.left=-2000;
oDiv.style.top=-2000;
oDiv.style.overflow="hidden";
document.body.appendChild (oDiv);
delete oDiv;
}
var snowC=0;
var x = new Array();
var y = new Array();
var speed = new Array();
var t=0;
var cC = new Array();
var ra = new Array();
var sum_snowC = 0;
var alive = new Array();
var snoHaug = new Array();
var maxWidth=browserBredde()-60;
var maxHeight = browserHoyde();
for (t=0;t<Math.round(maxWidth/10);t++) snoHaug[t] = maxHeight-10;
function makeSnow() {
sum_snowC++;
x[snowC] = Math.round(Math.random()*maxWidth);
y[snowC] = 10;
speed[snowC] = Math.round(Math.random()*8)+1;
var bilde="//i194.photobucket.com/albums/z118/bondslozo/d745da34.gif";
if (speed[snowC]<3) bilde="//i194.photobucket.com/albums/z118/bondslozo/c7109967.gif";
else if (speed[snowC]<6) bilde="//i194.photobucket.com/albums/z118/bondslozo/8b92042a.gif";
else if (speed[snowC]<8) bilde="//i194.photobucket.com/albums/z118/bondslozo/7ed009d1.gif";
alive[snowC] = true;
makeDiv("snow"+snowC,'<img src="'+bilde+'">');
cC[snowC]=Math.random()*3;
ra[snowC] = Math.random()*5;
snowC++;
}
function deleteSnow(nr) {
sum_snowC--;
alive[nr] = false;
snoHaug[Math.round(x[nr]/10)]-=7;
}
function moveSnow() {
var r = Math.round(Math.random()*100);
if (r>70 && sum_snowC<20) makeSnow();
for (t=0;t<snowC;t++) {
if (alive[t]) {
y[t]+=speed[t];move("snow"+t,x[t],y[t]);
if (y[t]>snoHaug[Math.round(x[t]/10)]) deleteSnow(t);
cC[t]+=0.01;
x[t]+=Math.cos(cC[t]*ra[t]);
if (x[t]>maxWidth) x[t] -= 5;
else if (x[t]<10) x[t] = 10;
}
}
// setTimeout('moveSnow()',20);
}
var snowId = "jau";
snowId = setInterval('moveSnow()',10);
//========================[Sound variables - checking for sound] ===================================//
var NSsound = navigator.plugins && navigator.plugins["LiveAudio"];
var IEsound = navigator.plugins && document.all;
var audioEnabled = NSsound || IEsound;
function newContent(layernm,content) {
if (ns6) document.getElementById(layernm).innerHTML=content;
else if (ie) document.all[layernm].innerHTML=content;
else if (ns) {
eval(' document.layers["'+layernm+'"].document.open();');
eval(" document.layers['"+layernm+"'].document.write('"+content+"');");
eval(' document.layers["'+layernm+'"].document.close();');
}
}
//--------------------------------[stop]--------------------------------------
//-->
</script>