var subSite = "vw";

// Change background of bannerbuttons
function changeBgImage (image, id) {
	var element = document.getElementById(id);
	element.style.backgroundImage = "url("+image+")";
}

// Submenu
var timeout = 500;
var closetimer = 0;
var subnavitem = 0;

function subnav_open() {
    $subnavitem = $("#" + $(this).attr("submenu"));

    subnav_canceltimer();
    if (subnavitem && (subnavitem.attr("id") != $subnavitem.attr("id")))
        subnav_close();

    subnavitem = $subnavitem.slideDown(250);
}

function subnav_close() { if (subnavitem) subnavitem.slideUp(200); }

function subnav_timer() { closetimer = window.setTimeout(subnav_close, timeout); }

function subnav_canceltimer() {
    if (closetimer) {
        window.clearTimeout(closetimer);
        closetimer = null;
    }
}

document.onclick = subnav_close;

$(function() {
    $(".nav").hover(subnav_open, subnav_timer);
    $(".overlayer").hover(subnav_canceltimer, subnav_timer);
});


// Show hide table row
$(function() {
	$("tr.car").click(function() {
		var id = $(this).attr("id");
		var id_extra = id + "_extra";
		
		$("tr[id$='_extra']").hide();
		$("#" + id_extra).show();
	});
});
	
function carOver(id) {
	elmnt = document.getElementById(id);
	elmnt.style.backgroundColor = '#e8ecf1';
	elmnt.style.cursor = 'pointer';
}
	
function carOut(id) {
	elmnt = document.getElementById(id);
	elmnt.style.backgroundColor = '';
	elmnt.style.cursor = 'pointer';
}
