function _up(){
  var dp_menu = document.getElementById('dp_menu');
  if(typeof(dp_menu.scrollTop)=="undefined")
  	return false;
  dp_menu.scrollTop=dp_menu.scrollTop-2;
  if(_up_v==true)
  window.setTimeout('_up()',5);
}
function _down(){
  var dp_menu = document.getElementById('dp_menu');
  if(typeof(dp_menu.scrollTop)=="undefined")
  	return false;
  dp_menu.scrollTop=dp_menu.scrollTop+2;
  if(_down_v==true)
  window.setTimeout('_down()',5);
}
function hr(){
  txt='<div class=sb_hr></div>\n';
  document.write(txt);
}
function fadeThis(o){
   this.init = function(){
      this.f = o.from;
      this.t = o.to;
      this.d = o.duration;
      this.el = document.getElementById(o.id);
      if(o.contentID)
         document.getElementById('postView').innerHTML = document.getElementById(o.contentID).innerHTML;
      this.total = this.d*30;
      this.mSecends = this.d*1000/this.total;
      this.counter = 0;
      this.el.style.display = "block";
   };
   this.c = function(arg){
      return ((((this.t-this.f)/(this.d*1000))*arg)+this.f);
   };
   this.setOpacity = function(){
         var postView = document.getElementById('postView');
         var closeView = document.getElementById('closeView');
      if(this.t==0 && this.counter==0){
         postView.style.display = "none";
         closeView.style.display = "none";
      }
      var tmp = this.c(this.counter*this.mSecends);
      fadeThis_var = this;
      this.el.style["filter"] = "alpha(opacity="+tmp+")";
      this.el.style["-mo-opacity"] = tmp/100;
      this.el.style["opacity"] = tmp/100;
      this.counter++;
      this.timeout = window.setTimeout("fadeThis_var.setOpacity()",this.mSecends);
      if(this.counter == Math.floor(this.total)+1){
         window.clearTimeout(this.timeout);
         if(postView.style.display == "none" && this.t != 0){
            postView.style.display = "block";
            closeView.style.display = "block";
         } else {
            postView.style.display = "none";
            closeView.style.display = "none";
         }
         if(this.t==0)
            this.el.style.display = "none";
      }
   };
   var isIE = navigator.userAgent.match(/msie ([0-9]{1})\./i);
   if(isIE && parseInt(isIE[1])<7){
      // older than IE7
      if(confirm("مرورگر شما قدیمی است و شما نمی توانید از این قسمت استفاده کنید\nآیا تمایل دارید شما را برای دربافت مرورگر راهنمایی کنیم؟"))
         window.open("http://www.getfirefox.com/");
      return;
   }
   this.init();
   this.setOpacity();
}
