﻿/***********************************************
* Scrollable Menu Links- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* Visit http://www.dynamicDrive.com for hundreds of DHTML scripts
* This notice must stay intact for legal use
***********************************************/

var menuwidth = 720; //configure menu width (in px)
var menuheight = 103; //configure menu height (in px)
var scrolldir = "normal"; //Specify scroll buttons directions ("normal" or "reverse")
var scrollspeed = 6; //configure scroll speed (1-10), where larger is faster

var iedom = document.all || document.getElementById;

if (scrolldir=="reverse")
{
  var tempswap = leftdircode;
  leftdircode = rightdircode;
  rightdircode = tempswap;
}

var actualwidth = '';
var cross_scroll, ns_scroll;
var loadedyes = 0;


function fillup()
{
  if (iedom)
  {
    cross_scroll = document.getElementById ? document.getElementById("productsmenu") : document.all.productsmenu;
    actualwidth = document.all ? cross_scroll.offsetWidth : document.getElementById("productsmenu").offsetWidth;
  }
  loadedyes = 1;
}

window.onload = fillup;



function moveleft()
{
  if (loadedyes)
  {
    if (iedom && parseInt(cross_scroll.style.left) > (menuwidth - actualwidth))
    {
      cross_scroll.style.left = parseInt(cross_scroll.style.left) - scrollspeed + "px";
    }
    else if (document.layers && ns_scroll.left > (menuwidth - actualwidth) )
      ns_scroll.left -= scrollspeed;
  }
  lefttime = setTimeout("moveleft()", 50);
}

function moveright()
{
  if (loadedyes)
  {
    if (iedom && parseInt(cross_scroll.style.left) < 0)
      cross_scroll.style.left = parseInt(cross_scroll.style.left) + scrollspeed + "px";
    else if (document.layers && ns_scroll.left < 0)
      ns_scroll.left += scrollspeed;
  }
  righttime = setTimeout("moveright()", 50);
}


function validateProductsMenu(value)
{
  if(document.getElementById(value).value == "")
  {
    alert("Please select a box to customize.");
  }
}
