	
	
The source text:



<html>
<head>
	

	
</head>
<body bgcolor="#000000">
	<br>
	<center><h3>[ Falling Snow With Music ]</h3></center>
	<br>
<table><tr><td>
<p class="Xtext2">

		Falling snow javascript with background music and some depth to it. 
		You can set this script to literally fill your entire browser screen with snow. :)
		You may find it difficult to click some links after a while ;)

		<!-- =============[NoScript by cyber-web.biz]================ //-->
<noscript><table cellspacing="0" border="4"><tr>
<td bgcolor="#ff0000" align="center" width="180px" height="60px">
<table cellspacing="0" cellpadding="0"><tr><td align="center">
<font size="-2" face="Verdana">ERROR ALERT : <br>
You have to enable javascript for this page to work !!</font> 
<a href="http://cyber-web.biz/enable_javascript.php" target="_top">cw</a>
</td></tr></table></td></table></noscript>
<!-- =====================[END NoScript]=====================  //-->
		
		<br>Internet Explorer, Netscape,  FireFox & Opera. 
		 <br><br><br>
		 Author : <a href="<?php echo $root; ?>">Cyber-Web.biz</a>
		 
  <br><center><img src="http://www.ventadecasasenmiami.com/images/Navidad/Snow.png"><br>
  <a href="falling snow part3.zip">Download the script</a>

	<br>or<br>
	<img src="../../../bilder/view_obj.gif">
	<a href="snow.txt" target="_blank">View the source here</a>
	</center>
</p>
</td><td>
<img src="santa.gif" title="marry X-mas!">
</td></tr></table>


	







<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="snow1.gif";
	if (speed[snowC]<3)  bilde="snow4.gif";
	 else if (speed[snowC]<6) bilde="snow3.gif";
	  else if (speed[snowC]<8) bilde="snow2.gif";
	
	alive[snowC] = true;
	makeDiv("snow"+snowC,'<img src="'+bilde+'">');
	
	cC[snowC]=Math.random()*10;
	ra[snowC] = Math.random()*7;
	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();');		     
  } 
}

//========[crossbrowser init sound]==============//
function makeSoundDiv(soundname,newInnerHTML) {
    var oDiv = document.createElement ("DIV");
    oDiv.id = soundname;
 		oDiv.style.position = "absolute";
		oDiv.style.left=-2000;
    oDiv.innerHTML=newInnerHTML;
    document.body.appendChild (oDiv);
    delete oDiv; }
//==================================[crossbrowser init sound]========================================//
function init(soundfile,autostart,loopit) {
	soundname=soundfile;
	var buff='';
	if (loopit==null) loopit=false;
	
	if (audioEnabled) {

				if (autostart==null) autostart=false;
				buff+='<embed name="obj_'+soundname+'" src='+soundfile+' autoplay="'+autostart+'" AUTOSTART="'+autostart+'" loop="'+loopit+'" hidden="true" volume="80%" > ';
				buff+='<NOEMBED><BGSOUND src='+soundfile+'></NOEMBED>';
			  buff+='</embed> ';
	} 
	
	else { // try something else
	
		

			if (autostart==true) autostart=1; else autostart=0;
			if (loopit==true) loopit=1; else loopit=0;			
			buff+='<object type="application/x-mplayer2" ';
			buff+=' pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" ';
			buff+=' Name="obj_'+soundname+'" src='+soundfile+' AutoStart='+autostart+' ShowStatusBar=1 volume=-1 loop='+loopit+' >';
  		buff+=' </object> ';
  
  		

  		
  		
	}
	

	makeSoundDiv(soundname,"");
	makeSoundDiv(soundname+"_buffer",buff);
}


function play(soundname,loopit) {
	if (document.getElementById(soundname)) newContent(soundname,document.getElementById(soundname+"_buffer").innerHTML); 
	else init(soundname,true,loopit);
}




//must have this to avoid IE bug..
function doIt() { setTimeout('moveSnow();',100);setTimeout('play("xmas.mid",true);',200);  }
document.body.onLoad=doIt();






//--------------------------------[stop]--------------------------------------
//-->
</script>

</body>
</html>


