// variables a ajustar
var position_max=300;
var pas=10;
var pas_time=100;

// codigo class textarea
var position=0;
var timer="";

function scroll(id2,sens) {
	id=document.getElementById('box_content'+id2);
	var ll=parseInt(id.style.top);
	if (sens=="up") {
		ll+=pas;
		if (ll>0) {
			clearInterval(timer);
			ll=0;
		}
	} else {
		if (ll<-position_max) {
			clearInterval(timer);
			ll=-position_max;
		}
		ll-=pas;
	}
	id.style.top=ll+"px";
}

function scroll_init(id2,sens) {
	if (timer!="") {
		clearInterval(timer);
	}
	timer=setInterval("scroll('"+id2+"','"+sens+"')", pas_time);
	return false;
}

function scroll_end() {
	if (timer!="") {
		clearInterval(timer);
	}
	return false;
}

function setCookie(name, value)
{
  document.cookie = name+"="+value;
}

function myGetCookie(name)
{
  if (document.cookie)
  {
    var cookies=document.cookie.split(";");
    for (var i=0; i<cookies.length; i++)
    {
      var varName=(cookies[i].split("=")[0]);
      var varValue=(cookies[i].split("=")[1]);

      while (varName.charAt(0)==" ")
        varName=varName.substr(1,varName.length);

      // the escape() function will url encode the value				
      if (varName==name)
        return escape(varValue);
    }
  }
  return " ";
}


