function checkBrowser() {

   var browser;
   var bName = navigator.appName;
   var bVersion = parseInt(navigator.appVersion);
   
   if (bName == "Netscape" && bVersion == 2) browser = "Netscape2";
   else if (bName == "Netscape" && bVersion == 3) browser = "Netscape3";
   else if (bName == "Netscape" && bVersion >= 4) browser = "Netscape4";
   else if (bName == "Microsoft Internet Explorer" && bVersion >= 3 && bVersion<4) browser = "IE3";
   else if (bName == "Microsoft Internet Explorer" && bVersion >= 4) browser = "IE4";

   return browser;
}

function checkOS() {
// Checks the Operating System
  var OpSys;

  if(navigator.userAgent.indexOf('IRIX') != -1) OpSys = "Irix";
  else if(navigator.userAgent.indexOf('Mac') != -1) OpSys = "Macintosh";
  else if(navigator.userAgent.indexOf('Win') != -1) {
     if (navigator.userAgent.indexOf('95') != -1) OpSys = "Windows95";
     else if (navigator.userAgent.indexOf('NT') != -1) OpSys = "WindowsNT";
     else OpSys = "Windows3.1";
  }
  else { OpSys = "other"; }

  return OpSys;
}

browser = checkBrowser();
os = checkOS();

if (browser != "Netscape3") {
	pos1 = 0;
	pos2 = 440;
	pos3 = 880; 
	pos4 = 1320;
	pos5 = 1760;
	pos6 = 2200;
	pos7 = 2640;
	pos8 = 3080;
	pos9 = 3520;
	pos10 = 3960; 
	pos11 = 4400;
	pos12 = 4840;
	pos13 = 5280;
	pos14 = 5720;
	
} else {                    // Browser is Netscape 3
    if (os != "Macintosh") {
		pos1 = 0;
		pos2 = 440;
		pos3 = 880; 
		pos4 = 1320;
		pos5 = 1760;
		pos6 = 2200;
		pos7 = 2640;
		pos8 = 3080;
		pos9 = 3520;
		pos10 = 3960; 
		pos11 = 4400;
		pos12 = 4840;
		pos13 = 5280;
		pos14 = 5720;
	
	} else { 				// OS is Macintosh
		pos1 = 0;
		pos2 = 440;
		pos3 = 880; 
		pos4 = 1320;
		pos5 = 1760;
		pos6 = 2200;
		pos7 = 2640;
		pos8 = 3080;
		pos9 = 3520;
		pos10 = 3960; 
		pos11 = 4400;
		pos12 = 4840;
		pos13 = 5280;
		pos14 = 5720;
	
    }	
}

window.onError=null;

var x = 0;
var currPos = 1;
var scrollEnd;

function oneStep(dir) {

	if (dir=='right') {
		if (x==pos14) null;
		else ScrollTo(x+440);
	}
	
	if (dir=='left') {
		if (x==pos1) null;
		else ScrollTo(x-440);
	}

}

function ScrollTo(xpix) {
    if (x < xpix) {
        scrollEnd = xpix;
	    ScrollRight();
    } else if (x>xpix) {
        scrollEnd = xpix;
		ScrollLeft();
    }	
}
function ScrollRight() {
	if (x < scrollEnd) {
		parent.content.scroll(x,0);
		x += 50;
		if (x > scrollEnd) x = scrollEnd;
		setTimeout('ScrollRight()', 1);		
	}
	else if (x==scrollEnd) parent.content.scroll(x,0);
}

function ScrollLeft() {
	if (x > scrollEnd) {
		parent.content.scroll(x,0);
		x -= 50;
  	    if (x < scrollEnd) x = scrollEnd;
		setTimeout('ScrollLeft()', 1);
	} else if (x==scrollEnd) parent.content.scroll(x,0);
}

if (document.images) {
	circle_on=new Image();
	circle_on.src="../images/navigation/button_products.gif";
	circle_off=new Image();
	circle_off.src="../images/navigation/button.gif";
}

function rollIn(newPos) {
	if (document.images) {
		if (newPos>0 && newPos<15) {
			document['pos'+currPos].src=circle_off.src;
			document['pos'+newPos].src=circle_on.src;
			currPos=newPos;
		}
	}
}
