var scrspeed=2;
var scrdelay=10;
var ioScroller='';
var ioBottomScroller='';
var centerpos=0;
var scrwidth=0;
var maxleft=0;
var maxright=0;
var curpos=0;
var scradj=0;


function initScroll() {
var webtechItems = webtech.length/3;
if (webtechItems > 4) {
centerPos();
}
}


function widthtest() {
scrwidth=document.getElementById('web-tech-scrcontent').scrollWidth;
//centerpos=(scrwidth/2);
maxleft=-scrwidth+657;
//maxright=scrwidth-657;
return [scrwidth];
}

function findPos(obj) {
obj=document.getElementById(obj);
curpos=obj.offsetLeft;
return [curpos];
}

function centerPos(){
scrwidth=parseInt(widthtest());
centerpos=scrwidth/2-325;
curpos=parseInt(findPos('web-tech-scrcontent'));
centerpos=-centerpos;
if (curpos >= centerpos) {
curpos=curpos-scrspeed;
scradj=curpos;
document.getElementById('web-tech-scrcontent').style.left=scradj + 'px';
ioScroller=setTimeout("centerPos()",scrdelay);
}
}

function scrollright(){
window.clearTimeout(ioScroller);
scrwidth=parseInt(widthtest());
curpos=parseInt(findPos('web-tech-scrcontent'));
if (curpos>=maxleft) {
scradj=curpos-scrspeed;
document.getElementById('web-tech-scrcontent').style.left=scradj + 'px';
ioScroller=setTimeout("scrollright()",scrdelay);
document.getElementById('ra').className="blackscroller";
document.getElementById('la').className="blackscroller";
}
else {
document.getElementById('ra').className="grayscroller";
document.getElementById('la').className="blackscroller";
}
}

function scrollleft(){
window.clearTimeout(ioScroller);
//scrwidth=parseInt(widthtest());
//curpos=parseInt(findPos('web-tech-scrcontent'));
if (curpos<=0) {
scradj=curpos+scrspeed;
curpos=scradj;
document.getElementById('web-tech-scrcontent').style.left=scradj + 'px';
ioScroller=setTimeout("scrollleft()",scrdelay);
document.getElementById('ra').className="blackscroller";
document.getElementById('la').className="blackscroller";
}
else {
document.getElementById('la').className="grayscroller";
document.getElementById('ra').className="blackscroller";
}
}

function stopScroll(){
window.clearTimeout(ioScroller);
}


function webBuilder() {

var webtechItems = webtech.length/4;
var techdivBuilder = webtechItems*150+25 + "px";
document.getElementById('web-tech-scrcontent').width = techdivBuilder;
var webtechContent = "<table width='" + techdivBuilder + "'>";
webtechContent = webtechContent + "<tr>";
var i=0;
    while (i<webtech.length)
    {
		var webtechIMG = webtech[i];
		var webtechText = webtech[i+1];
		var webtechURL = webtech[i+2];
		var webtechgPath = webtech[i+3];
		webtechContent = webtechContent + "<td class='scrollerTD'>";
		webtechContent = webtechContent + "<a href='" + webtechURL + "' target='_blank' onclick='pageTracker._trackPageview(" + webtechgPath + ");'>";
		webtechContent = webtechContent + "<img class='TDimg' src='http://iomega.com/support/solutions/img/" + webtechIMG + "' />";
		webtechContent = webtechContent + "<br />";
		webtechContent = webtechContent + webtechText;
		webtechContent = webtechContent + "</a></td>";
    	i=i+4;
	}
webtechContent = webtechContent + "<td style='width: 25px;'>&nbsp;</td>";
webtechContent = webtechContent + "</tr>";
webtechContent = webtechContent + "</table>";

document.getElementById('web-tech-scrcontent').innerHTML = webtechContent;
}

function buildLeft() {
var webtechItems = webtech.length/3;
if (webtechItems > 4) {
document.write('<div id="webleftarr" class="blackscroller" onMouseover="scrollleft()" onMouseout="stopScroll()">');
document.write('<div class="blackscroller" id="la"></div>');
document.write('</div>');
}
}

function buildRight() {
var webtechItems = webtech.length/3;
if (webtechItems > 4) {
document.write('<div id="webrightarr" class="blackscroller" onMouseover="scrollright()" onMouseout="stopScroll()">');
document.write('<div class="blackscroller" id="ra"></div>');
document.write('</div>');
}
}
