var isIE = (!document.all && document.getElementById) ? 0 : 1;
function RenderNWR(){
   var nwr = document.getElementById("nwr");
   var onclick_ok = true;
   var onmouseover_in = false;
   var divs = new Array();
   var timer;
   var timer_id;
   divs = nwr.getElementsByTagName("div");
   nwr.onmouseover = function(){
	  onmouseover_in = true;
   }
   nwr.onmouseout = function(){
      onmouseover_in = false;
   }
   if (isIE) {
      var scrolldelay = nwr.getAttribute("className") || 4.5;
   }
   else {
  	  var scrolldelay = nwr.getAttribute("class") || 4.5;
   }
   if(isNaN(scrolldelay)){
      nwr.style.display = "none";
	  return;
   }
   scrolldelay = Math.max(parseFloat(scrolldelay) * 1000 ,1000);
   for (var i=0; i<divs.length; i++) {
      divs[i].style.top = nwr.offsetHeight*2 + "px";
	  divs[i].i = i;
	  if(divs[i].id == null || divs[i].id == ""){
	     divs[i].id = "_marquee_" + i;
	  }
	  divs[i].flyin = function(){
	     onclick_ok = true;
	     this.style.visibility = "visible";
		 timer_id = this.i;
         timer = setTimeout("document.getElementById('" + this.id + "').flyout()",scrolldelay);
	  }
	  divs[i].ondblclick = function(){
	     if (onclick_ok == true){
		    clearTimeout(timer);
            var next_div = this.i + 1;
		    if (next_div == divs.length){
		       next_div = 0;
		    }
	        this.style.top = nwr.offsetHeight*2 + "px";
		    next_div = divs[next_div];
	        next_div.style.visibility = "visible";
	        next_div.style.top = "0px";
		    next_div.flyin();
		 }
	  }
	  divs[i].flyout = function(){
         if ((onmouseover_in == true)&&(parseFloat(this.style.top) == 0)){
            setTimeout("document.getElementById('" + this.id + "').flyout()",50);
         }
		 else if (timer_id != this.i){
		 }
	     else {
		    onclick_ok = false;
	        var next_div = this.i + 1;
		    if (next_div == divs.length){
		       next_div = 0;
		    }
		    next_div = divs[next_div];
	        this.top = parseFloat(this.style.top);
		    if (this.top == 0){
	           next_div.style.top = this.offsetHeight + "px";
	           next_div.style.visibility = "visible";
		    }
	        next_div.top = parseFloat(next_div.style.top);
            if (next_div.top - 2 < 0){
		       next_div.style.top = "0px";
            }
		    else {
		       next_div.style.top = next_div.top - 2 + "px";
	        }
	        this.style.top = this.top - 2 + "px";
		    if (next_div.top > 0){
               setTimeout("document.getElementById('" + this.id + "').flyout()",50);
		    }
            else {
		       next_div.flyin();
		    }
	     }
	  }
   }
   if(divs.length > 0){
	  divs[0].style.top = "0";
	  divs[0].flyin();
   }
}




