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

function colourBars()
{
	var even = false;
    var evenColor =  "#fff";
    var oddColor =  "#F2F2F2";
	
	 
  	var thearea = document.getElementById('spectable');
      var trs = thearea.getElementsByTagName('tr');

      for (var i = 0; i < trs.length; i++) {
        
          trs[i].style.backgroundColor = even ? evenColor : oddColor;
		     
			 even =  ! even;
}
}

sfHover = function() {
	var sfEls = document.getElementById("topnavi").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
//if (window.attachEvent) window.attachEvent("onload", sfHover);

startTable = function() {
	
	
	if(document.getElementById("spectable")){

		tableRoot = document.getElementById("spectable");
		
		var r = tableRoot.rows;
		var rlen = r.length;
		
		for (var h = 0; h < rlen; h++) {
		 
		 var node = r[h];
				
					node.onmouseover=function() {
							this.className+="over";
					}
							
					node.onmouseout=function() {
							this.className=this.className.replace("over", "");
					}
			
		}
	}	
}




function menu_expand(menu_id, count)
{
	
	for (var i=1; i <=count; i++)
	{

		if (i == menu_id)
		{
			document.getElementById('menu'+i).style.display = "";
		}
		else
		{
			document.getElementById('menu'+i).style.display = "none";
		}
	}
}

function viewRange(id, specialSearch)
{
	if (specialSearch == "1"){
	    
	    document.location='stock.php?specialsearch='+id;	
	    
	}else{
	    
	   document.location='stock.php?marque='+id;	
	
	}
	
}
