function closeWindow(){
	if (window.opener){
		window.opener.focus()
	}
	else if (window.parent){
		window.parent.focus()
	}
	window.close()
}


/* Предзагрузка картинок */
if (document.images) {
	bulletmenuplus = new Image(); bulletmenuplus.src = "/images/sign.gif"; bulletmenuminus = new Image(); bulletmenuminus.src = "/images/signdown.gif";
}

/* images change */
function changeImages(){
	if(document.images){
		for(var i=0; i<changeImages.arguments.length; i+=2){
			document[changeImages.arguments[i]].src = eval(changeImages.arguments[i+1] + ".src");
		}
	}
}

/* Смена плюсов/минусов меню */
function changeSign(ID, isPlus){
	backgroundImage = eval('bulletmenu' + ((isPlus)?('plus'):('minus')) + '.src');
	bulletID = 'bullet' + ID.match(/\d/)
	if (document.getElementById(bulletID)){
		document.getElementById(bulletID).src = backgroundImage;
	}
}


if(document.getElementById) {
	var str = '<style type="text/css">\n';
	str+= '.submenu{display: none;}\n';
	str+= '</style>\n';
	document.write(str)
}
function menuType(id){
	submenuID = 'sub' + id;
	if (document.getElementById){
		var obj = document.getElementById(submenuID);
		var objStyle = obj.style;
		var divArray = document.getElementById("menuDiv").getElementsByTagName("div");
		if (objStyle.display != "block"){
			for (var i = 0; i < divArray.length; i++) {
				if(divArray[i].className=="submenu" && divArray[i].id != submenuID){
					divArray[i].style.display = "none";
					changeSign(divArray[i].id, true);
				}
				else{
					objStyle.display = "block";
					changeSign(divArray[i].id, false);
				}
			}
		}
		else{
			objStyle.display = "none";
			changeSign(submenuID, true);
		}
	}
	return false;
}

function openWindow (src, width, height){
	str = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">\n' +
			'<html>\n' +
			'<meta http-equiv="Content-Type" content="text/html; charset=Windows-1251">\n' +
			'<head>\n' +
			'	<title>Фотография</title>\n' +
			'</head>\n' +
			'<body text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" marginheight="0" marginwidth="0">\n' +
			'<div><img src="/images/photooftop.gif" width="86" height="30" border="0"></div>' +
			'<div><a href="javascript:window.close()"><img src="' + src + '" border="0" alt="(нажмите для закрытия окна)"></a></div>' +
			'<table border="0" cellpadding="0" cellspacing="0" width="' + width + '"><tr><td align="right"><img src="/images/photoofbottom.gif" width="68" height="30" border="0"></td></tr></table>' +
			'</body>\n' +
			'</html>';
	newWindow = window.open("", "simpleWindow", "width=" + width + ",height=" + height + ",menubar=no,status=no,resizeable=no,toolbar=no,location=no");
	window.newWindow.document.open("text/html");
	window.newWindow.document.write(str);
	window.newWindow.document.close();
	window.newWindow.focus();
}