function opensizedwin(link, w, h)  {
	popupWinex = window.open('http://mazda-nagy-autopark.hu/' + link,'','scrollbars=auto, width=' + (w+20) + ', height=' + (h+20) + ', left=' + ((screen.width/2)-w/2) + ', top=' + ((screen.height/2)-h/2));
}

var oDefaultSubMenu = null;
function initMenu()
{
	var oDefaultSubMenu = document.getElementsByClassName("default")[0];
	var a = $A($("nav").getElementsByTagName("li"));
	a.shift();// skip Home
	a.each(
		function(node)
		{
			node.onmouseover = function() {
				Element.removeClassName(oDefaultSubMenu, "default");
				Element.addClassName(this, "hover");
			}
			node.onmouseout = function() {
				Element.removeClassName(this, "hover");
				Element.addClassName(oDefaultSubMenu, "default");
			}
		}
	);
}
Event.observe(window, "load", initMenu, false);


function fixExternalLinks()
{
	var aLinks = $A($("body").getElementsByTagName("a"));
	var aFound = [];
	aLinks.each(
		function(node)
		{
			aFound = node.href.match(/\/\/[^\/]+/);
			if (!Element.hasClassName(node, "nofix")
				&& (aFound && location.hostname != aFound[0].replace(/^\/+/, "")))
			{
				Element.addClassName(node, "external");
			}
		}
	);
}
Event.observe(window, "load", fixExternalLinks, false);

function popupgallery(dir, idx, sClose, sPrev, sNext)
{
	var baseHref = document.getElementsByTagName("base")[0].getAttribute("href");
	openPopupWindow(baseHref + ':popupgallery?dir='
		+ dir
		+ '&idx=' + idx
		, {width:400,height:336,resizable:false,scrollbars:false});
}



var toShowroom = null;
function golabel(str)
{
	toShowroom = setTimeout("dolabel('" + str + "')", 500);
}
function clearlabel(str)
{
	clearTimeout(toShowroom);
}
function dolabel(str)
{
	var o = (document.all)
		? window.testcommand
		: window.document.testcommand;
	o.SetVariable("interacted", true);
	o.SetVariable("chosenModel", str);
	o.TGotoLabel("_level0/", "go");
}


function printBestOf2006()
{
	var oContent = document.getElementById("tbl1div");
	var w = window.open("", "", "width=700,height=450,resizable,scrollbars");
	w.document.open();
	w.document.writeln('<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><style type="text/css">');
	w.document.writeln("body {background: white; margin: 10px; color: black; font-size: 12px; font-family: verdana, arial, helvetica, sans-serif;}");
	w.document.writeln("table {}");
	w.document.writeln("th {padding: .5em; background: silver; border: 1px solid black; font-size: 12px;}");
	w.document.writeln("td {padding: .5em; border: 1px solid black; font-size: 12px;}");
	w.document.writeln('</style></head><body>');
	w.document.write(oContent.innerHTML);
	w.document.write('</body></html>');
	w.document.close();
	w.focus();
	w.print();
}

