//This javascript is used in order to display the submenu in IE6
/*
Old code ( in case of bugs )
function menu_init(){
$(".menu li").hover( function () {	$(this).addClass("hover");	}, function () { $(this).removeClass("hover");	}	);
$(".menu img.mnimg").hover( function () { this.src = this.src.replace('.png','_over.png');	}, function () { this.src = this.src.replace('_over.png','.png');	}	);
}
function showroom_init(){	$(".car_box").hover( function () {	$(this).addClass("hover");	}, function () { $(this).removeClass("hover");	}	);}
*/
var timeOutDelay = 2000;
var currentMenu = new Array();
var t_o;

function menu_init(){
	$(".menu li").hover( 
								  function () {	
										clearTimeout(t_o);
										$(this).data("hoverState", "true");
										currentMenu.push($(this));
										$(this).addClass("hover");
										menu_off();
									},
								  function () { 
										$(this).removeData("hoverState");
										t_o=setTimeout("menu_off()",timeOutDelay);
									}
									
							 );
	
	
	$(".menu img.mnimg").hover( function () { this.src = this.src.replace('.png','_over.png');	}, function () { this.src = this.src.replace('_over.png','.png');	}	);
}

function showroom_init(){	$(".car_box").hover( function () {	$(this).addClass("hover");	}, function () { $(this).removeClass("hover");	}	);}


function menu_off(){	
	var menu; 
	var storage = new Array();
	while( menu = currentMenu.pop()){	
		if( menu.data("hoverState")){
			storage.push(menu);
		}else{							  
			menu.removeClass("hover");
		}
	}
	currentMenu = storage;
}
