function SortPhoto()
{
	var mainpath="";
	var elem=document.forms['photo'];

	if(elem.theme.selectedIndex>=0)
		mainpath+="theme="+elem.theme[elem.theme.selectedIndex].value;

	if(elem.street.selectedIndex>=0)
	{
		if(mainpath!="") mainpath+="&";
		mainpath+="street="+elem.street[elem.street.selectedIndex].value;
	}

	if(elem.city.checked==true)
	{
		if(mainpath!="") mainpath+="&";
		mainpath+="city=1";
	}

	if(mainpath!="")
		document.location.href="?"+mainpath;
}

function photoEdit(id)
{
	document.location.href='/city/photo/add_photo/?id='+id;
}

function photoDelete(id, pid)
{
	if(confirm("Вы действительно хотите удалить фотографию?	"))
	{
		if(id>0 && pid>0)
		{
			document.location.href='/city/photo/add_photo/?action=save&mode=2&pid='+pid+'&id='+id;
		}
		else
		{
			document.forms['photo'].mode.value='2';
			document.forms['photo'].submit();
		}
	}
}

function albumEdit(id)
{
	document.location.href='/city/photo/add_album/?id='+id;
}

function albumDelete(id)
{
	if(confirm("Вы действительно хотите удалить албом?	"))
	{
		if(id>0)
		{
			document.location.href='/city/photo/add_album/?action=asave&mode=2&id='+id;
		}
		else
		{
			document.forms['photo'].mode.value='2';
			document.forms['photo'].submit();
		}
	}
}

function list_null(n)
{
	if(n==0)
	{
		document.forms['photo'].street.options[0].selected = true;
	}
	else
	{
		document.forms['photo'].theme.options[0].selected = true;
		document.forms['photo'].city.checked=true;
	}
}

