orientation = "horizontal"
scrollerWidth = "100%"
scrollerHeight = "176"
borderWidth = 0
borderColour = "black"
backColour = "#ffffff"
staticColour = "#000000"
stopScroll = 1
textAlignment = "center"
posterTitle = "Золотая коллекция. Шампуры и аксессуары."
scrollerDivider = "<span style=\"display: block; width: 30px;\">&nbsp;</span>"
timer=0;

var isIE = (document.getElementById && document.all)?true:false;
var isNS4 = (document.layers)?true:false;
var isNS6 = (document.getElementById && !document.all)?true:false;
var isLoaded=false;


ns4Text = "";
ns4URL = "";
ns4Target = "_top";


function buildScroller()
{
boundry='<div name="boundry" id="boundry" style="position:relative"></div>';
document.writeln(boundry);
}


function loadScroller(){
if(isNS4){
scroller='<table border="0" cellpadding="0" cellspacing="0" width="'+scrollerWidth+'" bgcolor="'+borderColour+'"><tr><td>'
scroller+='<table border="0" cellpadding="0" cellspacing="0" width="100%" height="'+scrollerHeight+'" style="overflow: hidden;"><tr><td align="center" nowrap><p>';
if(ns4URL.toLowerCase()!="none"){scroller+='<a href="'+ns4URL+'" class="rcScroller" target="'+ns4Target+'">'+ns4Text+'</a>';}
else{scroller+=ns4Text;}
scroller+='</p></td></tr></table></td></tr></table>'
}else{
scroller='<table border="0" cellpadding="0" cellspacing="0" style="width:'+scrollerWidth+';height:'+scrollerHeight+';border:'+borderWidth+'px solid '+borderColour+';" class="scroller_bg">';
scroller+='<tr valign="top"><td><div id="div" ';
if(orientation.toLowerCase()=="vertical"){scroller+='height:'+scrollerHeight+';';}
scroller+='width:'+scrollerWidth+'; position:relative; overflow:hidden">';
scroller+='<div id="div1" style="position:relative; left:0; z-index:1;">';
scroller+='<table border="0" cellpadding="0" cellspacing="0" name="table" id="table"';
if(orientation.toLowerCase()=="vertical"){scroller+='style="width:'+scrollerWidth+'"';}
scroller+='><tr>';
y=0;
while (y<4)
{
for (x=0; x<(Article.length); x++)
{
if(orientation.toLowerCase()=="vertical"){scroller+='<tr>';}
scroller+='<td ';
if(orientation.toLowerCase()=="horizontal"){scroller+='nowrap';} if(stopScroll==1){scroller+=' onMouseOver="stopScroller();"';}
scroller+=' valign="top"><div class="poster_bg">';
if(Article[x][1].toLowerCase()!="none"){scroller+='<a class="rcScroller" href="'+Article[x][1]+'"><div><img src="'+Article[x][0]+'" width="'+Article[x][2]+'" height="176" border="0" title="'+posterTitle+'"></div><\/a>';
}else{scroller+=Article[x][0];}
scroller+='</div><\/td>';
if(orientation.toLowerCase()=="vertical"){scroller+='<\/tr>';}
if(scrollerDivider.toLowerCase() != "none"){scroller+='';}
}
y++
}
scroller+='<\/tr><\/table><\/div><\/div><\/td><\/tr><\/table>';
}
document.getElementById("boundry").innerHTML=scroller;
//setWidth();
}


function setWidth(param,speed)
{
  tableObj=(isIE)?document.all("table"):document.getElementById("table");
  obj=(isIE)?document.all.div1:document.getElementById("div1");
  objWidth=(orientation.toLowerCase()=="horizontal")?getOffset(tableObj,"width"):getOffset(tableObj,"height");
  HalfWidth=Math.floor(objWidth/2);
  newWidth = (HalfWidth*2)+2;
  obj.style.width=newWidth
  moveLayer(obj, newWidth,param,speed);

}


function moveLayer(obj, width,param,speed)
{
maxLeft = (0-(width/2)+2)/2
if(orientation.toLowerCase()=="horizontal"){
if (param=='left') obj.style.left=(parseInt(obj.style.left) <= maxLeft)?0:parseInt(obj.style.left)-speed
//alert(obj.style.left);
else if(param=='right')
{
	if (parseInt(obj.style.left)>0) obj.style.left=maxLeft+speed;
	else obj.style.left=parseInt(obj.style.left)+speed
}
}else{
if(obj.style.top==""){obj.style.top=0;}
// alert(obj.style.top)
if (parseInt(obj.style.top)<(0-(width/2)+6)){
obj.style.top = 0
}else{
obj.style.top = parseInt(obj.style.top)-1
}
}
timer = setTimeout ("moveLayer(obj, "+width+",'"+param+"',"+speed+");", 25);
}

// Определяем размеры слоя
function getOffset(obj, dim)
{
if(dim=="width")
{
oWidth = obj.offsetWidth
return oWidth
}
else if(dim=="height")
{
oHeight = obj.offsetHeight
return oHeight
}
}

// Паузим при наведении
function stopScroller()
{
if (timer) clearTimeout(timer)
}
