/* (c) 2009 Jean Luc BIELLMANN - EES - contact@adressesetservices.com */

// 'has' method for prototype
Array.prototype.has = function(needle) {
  for (var i=0;i<this.length;i++) {
    if(this[i] == needle){ return true; }
  }
  return false;
}
// simple array -> hash table
function hashDatasFromCSV (keys,values) {
	var h = {};
	$A(keys).each(function (k) {
		h[k] = values.shift();
	});
	return h;	
}
function initIndex (e) {
	var i=0;
	$$('.ls tbody tr').each(function (tr) {
		tr.addClassName(i++%2 ? 'hl' : 'nothl');
	});
	i = 0;
	$$('.forklift tbody tr').each(function (tr) {
		tr.addClassName(i++%2 ? 'hl' : 'nothl');
	});
	$('menu').select('a').each(function (a) {
		// lastmenu is defined in index.html
		if (a.innerHTML==lastmenu)
			a.style.background='rgb(255, 241, 79)';
	});
	_warn.show(e);
}
//function smoothScroll () {
  //$$('a[href^=#]:not([href=#])').each(function(element) {
    //element.observe('click', function(event) {
      //new Effect.ScrollTo(this.hash.substr(1));
      //Event.stop(event);
    //}.bindAsEventListener(element))
  //})
//});
//Event.observe(window, 'load', smoothScroll);
