Images = new Array();

function chgImage(Button, Index)
{	
	document.images[Button].src = Images[Index].src;
}

function postForm(form, action)
{
	f = document.forms[form];
	if(!f)
	{
		alert("Форма \""+form+"\" не найдена");
		return;
	}
	f.action = action;
	f.submit();
}

function chgDisplay(menu)
{
	m = null;
	
	if(document.all)
	{
		m = document.all[menu];
	}
	else
		m = document.getElementByName(menu);
	
	if(m.style.display == "block")
	{
		m.style.display = "none";
	} 
	else
		m.style.display = "block";
}

function openWindow(href, text, extra)
{
	Win = window.open(href, "", extra);
	if(href == null)
	{
		Win.document.open();
		Win.document.write(text);
		Win.document.close();
	}
	
	return Win;
}

function askForDelete(id, form, ref)
{
	if(confirm("Вы действительно хотите удалить "+id+" ?"))
		postForm(form, ref);
	else
		return false;
}

