/* Snow Effect Script- By Altan d.o.o. (http://www.altan.hr/snow/index.html)
* Visit (http://www.dynamicdrive.com/)
* Update: 11/9/05 by DD
*/
var sr="js/sn.gif"
var no = 10;
var hst = 15;
var sdi = "pht";
var i4u = (document.all) ? 1 : 0;
var n6u = (document.getElementById&&!document.all) ? 1 : 0;
function ict(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}
var dx, xp, yp;
var am, sx, sy;
var i, doc_width = 800, doc_height = 600;
if (n6u) {
doc_width = self.innerWidth;
doc_height = self.innerHeight;
} else if (i4u) {
doc_width = ict().clientWidth;
doc_height = ict().clientHeight;
}
dx = new Array();
xp = new Array();
yp = new Array();
am = new Array();
sx = new Array();
sy = new Array();
sr=(sr.indexOf("dwellingplace.com")!=-1)? "sn.gif" : sr
for (i = 0; i < no; ++ i) {
dx[i] = 0;
xp[i] = Math.random()*(doc_width-50);
yp[i] = Math.random()*doc_height;
am[i] = Math.random()*20;
sx[i] = 0.02 + Math.random()/10;
sy[i] = 0.7 + Math.random();
if (i4u||n6u) {
if (i == 0) {
document.write("<div id=\"dt"+ i +"\" style=\"position:absolute;z-index: "+ i +";visibility:visible;top:15px;left:15px;\"><a href=\"http://www.dwellingplace.com\"><img src='"+sr+"' border=\"0\"><\/a><\/div>");
} else {
document.write("<div id=\"dt"+ i +"\" style=\"position:absolute;z-index: "+ i +";visibility:visible;top:15px;left:15px;\"><img src='"+sr+"' border=\"0\"><\/div>");
}
}
}
function I_N() {
doc_width = n6u?window.innerWidth-10 : ict().clientWidth-10;
doc_height=(window.innerHeight && sdi=="wht")? window.innerHeight : (i4u && sdi=="wht")?  ict().clientHeight : (i4u && !window.opera && sdi=="pht")? ict().scrollHeight : ict().offsetHeight;
for (i = 0; i < no; ++ i) {
yp[i] += sy[i];
if (yp[i] > doc_height-50) {
xp[i] = Math.random()*(doc_width-am[i]-30);
yp[i] = 0;
sx[i] = 0.02 + Math.random()/10;
sy[i] = 0.7 + Math.random();
}
dx[i] += sx[i];
document.getElementById("dt"+i).style.top=yp[i]+"px";
document.getElementById("dt"+i).style.left=xp[i] + am[i]*Math.sin(dx[i])+"px";
}
sti=setTimeout("I_N()", 10);
}
function hsw(){
if (window.sti) clearTimeout(sti)
for (i=0; i<no; i++) document.getElementById("dt"+i).style.visibility="hidden"
}
if (i4u||n6u){
I_N();
if (hst>0)
setTimeout("hsw()", hst*1000)
}