
/*
Menu Script © Copyright 2006 by Marc Neureiter
*/

function men_main_click(idx, suffix)
{
		
	if (men_menuidx == idx && (men_submenuidx == -1 || men_urls[idx] == "") ) return; // Current Menu

	// Hide Sumbenu
	var subtable = document.getElementById("men_mainrow2_" + men_menuidx);
	if (subtable != undefined)
		subtable.style.display = "none";

	// Show Submenu
	subtable = document.getElementById("men_mainrow2_" + idx);
	if (subtable != undefined)
		subtable.style.display = "inline";
	
	// Go To URL
	var url = men_urls[idx];
	var urlset = false;
	if (url != "")
	{
		urlset = true;
		location.href = men_get_url(url);
	}

	var mainrow = document.getElementById("men_mainrow_" + idx);
	var name;
	if (urlset)
	{
		// Highlighht
		name = "men_mainrow_sel";
	}
	else
	{
		// No mouseover
		name = "men_mainrow_open";
	}
	
	if (typeof(suffix) != "undefined")
		name += suffix;
	mainrow.className = name;
	
	// Reset old row
	mainrow = document.getElementById("men_mainrow_" + men_menuidx);
	if (mainrow != undefined)
	{
		mainrow.className = "men_mainrow";
	}
	
	men_menuidx = idx;
	
}

function men_get_url(url)
{
	return url;
}

function men_main_mouseover(idx, suffix)
{
	if (men_menuidx == idx && (men_submenuidx == -1 || men_urls[idx] == "") ) return; // Current Menu
	var mainrow = document.getElementById("men_mainrow_" + idx);
	var name = "men_mainrow_mover";
	if (typeof(suffix) != "undefined")
		name += suffix;
	mainrow.className = name;
}

function men_main_mouseout(idx, suffix)
{
	if (men_menuidx == idx && (men_submenuidx == -1 || men_urls[idx] == "") ) return; // Current Menu
	var mainrow = document.getElementById("men_mainrow_" + idx);
	var name = "men_mainrow";
	if (typeof(suffix) != "undefined")
		name += suffix;
	mainrow.className = name;
}

function men_sub_click(idx)
{
	
	if (men_submenuidx == idx) return; // Current Menu

	// Go To URL
	var url = men_urls[idx];
	var urlset = false;
	if (url != "")
	{
		urlset = true;
		location.href = men_get_url(url);
	}

	var subrow = document.getElementById("men_subrow_" + idx);
	if (urlset)
	{
		// Highlighht
		subrow.className = "men_subrow_sel";
	}
	else
	{
		// No mouseover
		subrow.className = "men_subrow";
	}
	
	// Reset old row
	mainrow = document.getElementById("men_subrow_" + men_submenuidx);
	if (mainrow != undefined)
		mainrow.className = "men_subrow";
	
	men_submenuidx = idx;
		
}

function men_sub_mouseover(idx, suffix)
{
	if (men_submenuidx == idx) return; // Current Menu
	var subrow = document.getElementById("men_subrow_" + idx);
	var name = "men_subrow_mover";
	if (typeof(suffix) != "undefined")
		name += suffix;
	subrow.className = name;
}

function men_sub_mouseout(idx, suffix)
{
	if (men_submenuidx == idx) return; // Current Menu
	var subrow = document.getElementById("men_subrow_" + idx);
	var name = "men_subrow";
	if (typeof(suffix) != "undefined")
		name += suffix;
	subrow.className = name;
}

function docsel_popup(id, sel, type)
{
	if (sel != '')
		sel = "&sel=" + sel;
	return window.open("popup.docsel.php?id=" + id + sel + "&type=" + type, "docsel", "width=" + screen.width + ",height=" + screen.height + ",left=0,top=0,dependent=yes,location=no,menubar=no,resizable=no,scrollbars=yes,status=no,toolbar=no");
}

function image_popup(url)
{
	var name = 'image';
	var width = '500';
	var height = '400';
	var scrollbars = false;
	var left = screen.width / 2 - width / 2;
	var top = screen.height / 2 - height / 2;
	return window.open(url, name, "width=" + width + ",height=" + height + ",left=" + left + ",top=" + top + ",dependent=yes,location=no,menubar=no,resizable=no,scrollbars=" + (scrollbars ? "yes" : "no") + ",status=no,toolbar=no");
}

function cam_popup(id)
{
	var url = 'popup.cam.php?id=' + id;
	var name = 'cam';
	var width = '730';
	var height = '595';
	var scrollbars = false;
	var left = screen.width / 2 - width / 2;
	var top = screen.height / 2 - height / 2;
	return window.open(url, name, "width=" + width + ",height=" + height + ",left=" + left + ",top=" + top + ",dependent=yes,location=no,menubar=no,resizable=no,scrollbars=" + (scrollbars ? "yes" : "no") + ",status=no,toolbar=no");
}

function shop_open()
{
	var name = 'shop';
	var width = screen.width;
	var height = screen.height;
	var scrollbars = true;
	var left = 0;
	var top = 0;
	var url = 'http://www.shopping4000.com/aiderbichl/';
	return window.open(url, name, "width=" + width + ",height=" + height + ",left=" + left + ",top=" + top + ",dependent=no,location=no,menubar=no,resizable=yes,scrollbars=" + (scrollbars ? "yes" : "no") + ",status=no,toolbar=no");	
}
