function addLoadListener(fn)
{
  if (typeof window.addEventListener != 'undefined')
  {
    window.addEventListener('load', fn, false);
  }
  else if (typeof document.addEventListener != 'undefined')
  {
    document.addEventListener('load', fn, false);
  }
  else if (typeof window.attachEvent != 'undefined')
  {
    window.attachEvent('onload', fn);
  }
  else
  {
    var oldfn = window.onload;
    if (typeof window.onload != 'function')
    {
      window.onload = fn;
    }
    else
    {
      window.onload = function()
      {
        oldfn();
        fn();
      };
    }
  }
}

function attachEventListener(target, eventType, functionRef, capture)
{
  if (typeof target.addEventListener != "undefined")
  {
    target.addEventListener(eventType, functionRef, capture);
  }
  else if (typeof target.attachEvent != "undefined")
  {
    target.attachEvent("on" + eventType, functionRef);
  }
  else
  {
    eventType = "on" + eventType;

    if (typeof target[eventType] == "function")
    {
      var oldListener = target[eventType];

      target[eventType] = function()
      {
        oldListener();

        return functionRef();
      }
    }
    else
    {
      target[eventType] = functionRef;
    }
  }

  return true;
}


function startList() {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("dropdown");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}
addLoadListener(startList);


function getEventTarget(event)
{
  var targetElement = null;

  if (typeof event.target != "undefined")
  {
    targetElement = event.target;
  }
  else
  {
    targetElement = event.srcElement;
  }

  while (targetElement.nodeType == 3 && targetElement.parentNode != null)
  {
    targetElement = targetElement.parentNode;
  }

  return targetElement;
}

var newwindow;
function poptastic(url)
{
	newwindow=window.open(url,'name','height=500,width=640,resizable=yes,scrollbars=yes,toolbar=no,status=no');
	if (window.focus) {newwindow.focus()}
}

function toggleDivOL( elemID )
{
	var elem = document.getElementById( elemID );
	if( elem.style.position != 'absolute' )
	{
		elem.style.position = 'absolute';
		elem.style.left = '-4000px';
	}
	else
	{
		elem.style.position = 'relative';
		elem.style.left = '0px';
	}
}



function initCar()
{

function pageWidth() {
  return window.innerWidth != null? window.innerWidth : 
  document.documentElement
  && document.documentElement.clientWidth
  ?  document.documentElement.clientWidth
  :  document.body != null ? document.body.clientWidth : null;
}

var pg=pageWidth();

if (pg < '970') {
    pg=970;

}
pg=pg-970;

pg=pg/2;
pg=pg+640;  
document.getElementById("movingcar").animationTimer = setInterval('moveObjectDecelerate(document.getElementById("movingcar"), '+pg+', 510, 25)', 50);

}

function moveObjectDecelerate(target, destinationLeft, destinationTop, maxSpeed)
{
  var currentLeft = parseInt(retrieveComputedStyle(target, "left"));
  var currentTop = parseInt(retrieveComputedStyle(target, "top"));

  if (isNaN(currentLeft))
  {
    currentLeft = 0;
  }

  if (isNaN(currentTop))
  {
    currentTop = 0;
  }

  if (typeof target.floatingPointLeft == "undefined")
  {
    target.floatingPointLeft = currentLeft;
    target.floatingPointTop = currentTop;
  }

  var decelerateLeft = 1 + Math.abs(destinationLeft - target.floatingPointLeft) / 5;
  var decelerateTop = 1 + Math.abs(destinationTop - target.floatingPointTop) / 5;

  if (decelerateLeft > maxSpeed)
  {
    decelerateLeft = maxSpeed;
  }

  if (decelerateTop > maxSpeed)
  {
    decelerateTop = maxSpeed;
  }

  if (target.floatingPointLeft < destinationLeft)
  {
    target.floatingPointLeft += decelerateLeft;

    if (target.floatingPointLeft > destinationLeft)
    {
      target.floatingPointLeft = destinationLeft;
    }
  }
  else
  {
    target.floatingPointLeft -= decelerateLeft;

    if (target.floatingPointLeft < destinationLeft)
    {
      target.floatingPointLeft = destinationLeft;
    }
  }

  if (target.floatingPointTop < destinationTop)
  {
    target.floatingPointTop += decelerateTop;

    if (target.floatingPointTop > destinationTop)
    {
      target.floatingPointTop = destinationTop;
    }
  }
  else
  {
    target.floatingPointTop -= decelerateTop;

    if (target.floatingPointTop < destinationTop)
    {
      target.floatingPointTop = destinationTop;
    }
  }

  target.style.left = parseInt(target.floatingPointLeft) + "px";
  target.style.top = parseInt(target.floatingPointTop) + "px";

  if (target.floatingPointLeft == destinationLeft && target.floatingPointTop == destinationTop)
  {
    clearInterval(target.animationTimer);
  }
}


function retrieveComputedStyle(element, styleProperty)
{
  var computedStyle = null;

  if (typeof element.currentStyle != "undefined")
  {
    computedStyle = element.currentStyle;
  }
  else
  {
    computedStyle = document.defaultView.getComputedStyle(element, null);
  }

  return computedStyle[styleProperty];
}
