var oldsubmenu;
var timeOnMenu;

function showmenu(obj)
{
	if (timeOnMenu) {
		clearTimeout(timeOnMenu);
	}
	if (oldsubmenu) hide(oldsubmenu);
	show(obj);
	oldsubmenu=obj;
}

function hidemenu()
{
	if (oldsubmenu) timeOnMenu = setTimeout("hide(oldsubmenu)",800);
}

function getObject(obj)
{
	var theObj;
	if (document.layers) {
		if (typeof obj == "string") return document.layers[obj];
		else return obj;
	}
	if (document.all) {
		if (typeof obj == "string")
		{
			if (document.all(obj) !=null) return document.all(obj).style;
			else return null;
		}
		else return obj.style;
	}
	if (document.getElementById)
	{
		if (typeof obj == "string")
			return document.getElementById(obj).style;
		else return obj.style;
	}
	return null;
}

function show(obj) {
	var theObj = getObject(obj);
	if (typeof theObj.visibility != "undefined")
		theObj.visibility = "visible";
	if (typeof theObj.display != "undefined")
		theObj.display = "block";
}

function hide(obj) {
	var theObj = getObject(obj);
	if (typeof theObj.visibility != "undefined")
		theObj.visibility = "hidden";
	if (typeof theObj.display != "undefined")
		theObj.display = "none";
}

/* Подмена изображения */
if (document.images) {
mastunik_off = new Image(); mastunik_off.src = "images/mastunik.jpg";
mastunik_over = new Image(); mastunik_over.src = "images/mastunik_over.jpg";
}

function turn_off(ImageName) {
	if (document.images != null) {
		document[ImageName].src = eval(ImageName + "_off.src");
	}
}

function turn_over(ImageName) {
	if (document.images != null) {
		document[ImageName].src = eval(ImageName + "_over.src");
	}
}
/* End Подмена изображения */
