
  //Configure below to change URL path to the snow image
  var snowsrc="/GlobalTemplates/OfficeTemplates/REM046-REMAXGardenCity/images/balloon.png"
  // Configure below to change number of snow to render
  var no =1;
  // Configure whether snow should disappear after x seconds (0=never):
  var hidesnowtime = 0;
  // Configure how much snow should drop down before fading ("windowheight" or "pageheight")
  var snowdistance = "pageheight";

///////////Stop Config//////////////////////////////////

  var ie4up = (document.all) ? 1 : 0;
  var ns6up = (document.getElementById&&!document.all) ? 1 : 0;

	function iecompattest(){
	return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
	}

  var dy, xp, yp;    // coordinate and position variables
  var am, stx, sty;  // amplitude and step variables
  var size;
  var i, doc_width = 800
  var doc_height;
  if (document.getElementById("rgc_floating_baloons").className=="frontpagebaloons") {
		doc_height = 100; 
	} else {
		doc_height = 100;
	}
	
  if (ns6up) {
    doc_width = self.innerWidth;
    //doc_height = self.innerHeight;
  } else if (ie4up) {
    doc_width = iecompattest().clientWidth;
    //doc_height = iecompattest().clientHeight;
  }

  dy = new Array();
  xp = new Array();
  yp = new Array();
  am = new Array();
  stx = new Array();
  sty = new Array();
  size = new Array();
  //snowsrc=(snowsrc.indexOf("remaxgardencity.com")!=-1)? "/GlobalTemplates/OfficeTemplates/REM046-REMAXGardenCity/images/balloon.png" : snowsrc
  for (i = 0; i < no; ++ i) {  
    dy[i] = 0;                        // set coordinate variables
    am[i] = Math.random()*80;         // set amplitude variables
    yp[i] = Math.random()*doc_height-findWrapPos(document.getElementById("rgc_floating_baloons"))[1];  // set position variables
    xp[i] = Math.random()*doc_width-findWrapPos(document.getElementById("rgc_floating_baloons"))[0]-50;
    stx[i] = 0.1 + Math.random()/10;     // set step variables
    sty[i] = stx[i];
		if (ie4up||ns6up) {
      if (i == 0) {
		document.getElementById("rgc_floating_baloons").innerHTML = document.getElementById("rgc_floating_baloons").innerHTML+"<div id=\"dot"+ i +"\" style=\"POSITION: absolute; z-index: -"+i+"; TOP: 15px; LEFT: 15px;\"><img src='"+snowsrc+"' border=\"0\"><\/div>";
		//document.write("<div id=\"dot"+ i +"\" style=\"POSITION: absolute; TOP: 15px; LEFT: 15px;\"><img src='"+snowsrc+"' border=\"0\"><\/div>");
      } else {
        document.getElementById("rgc_floating_baloons").innerHTML = document.getElementById("rgc_floating_baloons").innerHTML+"<div id=\"dot"+ i +"\" style=\"POSITION: absolute; z-index: -"+i+"; TOP: 15px; LEFT: 15px;\"><img src='"+snowsrc+"' border=\"0\"><\/div>";
        //document.write("<div id=\"dot"+ i +"\" style=\"POSITION: absolute; TOP: 15px; LEFT: 15px;\"><img src='"+snowsrc+"' border=\"0\"><\/div>");
      }
		size[i] = 0.5 + (Math.random())/2;
		      document.getElementById("dot"+i).getElementsByTagName("img")[0].style.width=68*size[i]+"px";
		      document.getElementById("dot"+i).getElementsByTagName("img")[0].style.height=94*size[i]+"px";
			  pngFixBaloon(document.getElementById("dot"+i).getElementsByTagName("img")[0]);

    }
  }

  function snowIE_NS6() {  // IE and NS6 main animation function
    doc_width = ns6up?window.innerWidth-10 : iecompattest().clientWidth-10;
		//doc_height=(window.innerHeight && snowdistance=="windowheight")? window.innerHeight : (ie4up && snowdistance=="windowheight")?  iecompattest().clientHeight : (ie4up && !window.opera && snowdistance=="pageheight")? iecompattest().scrollHeight : iecompattest().offsetHeight;
    for (i = 0; i < no; ++ i) {  // iterate for every dot
      xp[i] += stx[i];
      if (xp[i] > (doc_width-findWrapPos(document.getElementById("rgc_floating_baloons"))[0]-50)) {
		am[i] = Math.random()*80;         // set amplitude variables
        yp[i] = Math.random()*doc_height-findWrapPos(document.getElementById("rgc_floating_baloons"))[1];
        xp[i] = 0-findWrapPos(document.getElementById("rgc_floating_baloons"))[0];
        stx[i] = 0.1 + Math.random()/10;
        sty[i] = stx[i];
		size[i] = 0.5 + (Math.random())/2;
			if (document.getElementById("dot"+i).getElementsByTagName("img")[0]) {
		      document.getElementById("dot"+i).getElementsByTagName("img")[0].style.width=68*size[i]+"px";
		      document.getElementById("dot"+i).getElementsByTagName("img")[0].style.height=94*size[i]+"px";
			} else {
		      document.getElementById("dot"+i).getElementsByTagName("span")[0].style.width=68*size[i]+"px";
		      document.getElementById("dot"+i).getElementsByTagName("span")[0].style.height=94*size[i]+"px";
			}
      }
      dy[i] += sty[i]*0.01;
      document.getElementById("dot"+i).style.top=yp[i]+ am[i]*Math.sin(dy[i])+"px";
      document.getElementById("dot"+i).style.left=xp[i]+"px";
    }
    snowtimer=setTimeout("snowIE_NS6()", 10);
  }

	function hidesnow(){
		if (window.snowtimer) clearTimeout(snowtimer)
		for (i=0; i<no; i++) document.getElementById("dot"+i).style.display="none"
	}
		

if (ie4up||ns6up){
    snowIE_NS6();
		if (hidesnowtime>0)
		setTimeout("hidesnow()", hidesnowtime*1000)
		}

function findWrapPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		do {
			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;
		} while (obj = obj.offsetParent);
	}
	return [curleft,curtop]
}

function pngFixBaloon(img) {
      var imgName = img.src.toUpperCase()
      if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
      {
         var imgID = (img.id) ? "id='" + img.id + "' " : ""
         var imgClass = (img.className) ? "class='" + img.className + "' " : ""
         var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
         var imgStyle = "display:inline-block;" + img.style.cssText 
         if (img.align == "left") imgStyle = "float:left;" + imgStyle
         if (img.align == "right") imgStyle = "float:right;" + imgStyle
         if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
         var strNewHTML = "<span " + imgID + imgClass + imgTitle
         + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
         + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
         + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
         img.outerHTML = strNewHTML
       }


}