jQuery(document).ready(function() {
	$("div.z9").toggle();
	$("a.link-tm").click(function () {
		var curID = $(this).attr("id");
		curID = curID.substring(7).toLowerCase();
		$("div.z9").not("div#menu-"+curID).hide();
		if ($("div#menu-"+curID).is(":hidden")) {
			$("div#menu-"+curID).show();
    }
	});
	$("span.link-tm").click(function () {
		var curID = $(this).attr("id");
		curID = curID.substring(7).toLowerCase();
		$("div.z9").not("div#menu-"+curID).hide();
		if ($("div#menu-"+curID).is(":hidden")) {
			$("div#menu-"+curID).show();
    }
	});
	$("table#footer *").not("span.link-tm").click(function () {
		if ($("div#menu-dealers").is(":visible") || $("div#menu-technology").is(":visible") || $("div#menu-about").is(":visible")) {
			$("div.z9").hide();
		}
	});
	resizeDiv();
});

function resizeDiv() {
	var ua = navigator.userAgent.toLowerCase();
	isIE = (ua.indexOf("msie") != -1 || ua.indexOf("opera") != -1 && ua.indexOf("webtv") == -1); 
  isGecko = (ua.indexOf("gecko") != -1);
	var winH2 = 0;
	if (isIE) {winH2 = (window.innerHeight)?window.innerHeight:((document.all)?document.body.offsetHeight:null) - 150;}
	if (isGecko) {winH2 = window.innerHeight - 150;}
	$("div#scroll").css("height", winH2);
}
function nWindow(src, wt, ht, sbar) {
	if (sbar==null || sbar=="") {sbar=0;} 
	if (sbar==scroll) {sbar=1;} 
	if (ht==null || ht=="" || ht==0) {ht=640;}
	if (wt==null || wt=="" || wt ==0) {wt=480;}
	if (src==null || src=="") {return 0;} 
		else {window.open(src, "", "width="+wt+",height="+ht+",menubar=0,scrollbars="+sbar+",titlebar=0,location=0,fullscreen=0");}
}
