var roll_width = 722;
var roll_height = 190;
var unit_width = 150;
var unit_height = 180;
var unit_margin = 3;
var roll_px = 1;
var roll_interval = 30;
var roll_i = 1;
var roll_j = 1;
var sheet_width = 0;
document.getElementById("roll").style.width = roll_width + "px";
document.getElementById("roll").style.height = roll_height + "px";
code = document.getElementById("roll_sheet").innerHTML;
for(i=0;i<3;i++)
{
	code += code;
}
document.getElementById("roll_sheet").innerHTML = code;
if(navigator.appName=="Microsoft Internet Explorer")
{
  unit_count = document.getElementById("roll_sheet").childNodes.length;
  for(i=0;i<unit_count;i++)
  {
	obj = document.getElementById("roll_sheet").childNodes.item(i).style;
	obj.width = unit_width + "px";
	obj.height = unit_height + "px";
	obj.margin = unit_margin + "px";
  }
  sheet_width = (unit_width + unit_margin * 2) * unit_count + unit_margin;
  document.getElementById("roll_sheet").style.width = sheet_width + "px";
}else{
  unit_count = document.getElementsByName("roll_unit").length;
  for(i=0;i<unit_count;i++)
  {
	obj = document.getElementsByName("roll_unit").item(i).style;
	obj.width = unit_width + "px";
	obj.height = unit_height + "px";
	obj.margin = unit_margin + "px";
  }
  sheet_width = (unit_width + unit_margin * 2) * unit_count + unit_margin;
  document.getElementById("roll_sheet").style.width = sheet_width + "px";
}
function roll()
{
  if(roll_i<sheet_width-roll_width)
  {
	document.getElementById("roll_sheet").style.left = -roll_i + "px";
	roll_j = (roll_i = roll_i + roll_px);
  }
  else
  {
	document.getElementById("roll_sheet").style.left = -roll_j + "px";
	roll_j = roll_j - roll_px;
	if(roll_j < 0) roll_i = roll_j;
  }
}
var setroll=setInterval("roll()",roll_interval);
function js_onmouseover()
{
  clearInterval(setroll);
}
function js_onmouseout()
{
  setroll=setInterval("roll()",roll_interval);
}
//新秀
