// scripten

function en(form,callingField)
{
top.location.href=form.till.options[form.till.selectedIndex].value
}
function antal_bilder(form,callingField)
{
top.location.href=form.till.options[form.till.selectedIndex].value
}

function validate(field,alerttxt)
{
	with (field)
	{
		if (value==null || value=="") {
			alert(alerttxt);
			return false;
		} else {
			return true;
		}
	}
}

function validate_form(thisform)
{
	with (thisform)
	{
		if (validate(text,"Textfältet är obligatoriskt!") == false) {
			text.focus();
			return false;
		}
	}
}


function del_pic(id, gid, filename)
{
	if(confirm("Vill du verkligen ta bort denna bild?")) {
		window.location="mata.php?del_pic&id=" + id + "&gid=" + gid + "&filename=" + filename;
	}

}

function del_gallery(gid)
{
	if(confirm("Vill du verkligen ta bort detta?")) {
		window.location="mata.php?del_gallery&gid=" + gid;
	}

}

function del_cat(id)
{
	if(confirm("Vill du verkligen ta bort hela kategorin samt alla gallerier och bilder i?")) {
		window.location="mata.php?del_cat&id=" + id;
	}

}

function del_gb_post(id)
{
	if(confirm("Vill du verkligen ta bort detta?")) {
		window.location="mata.php?del_gb_post&id=" + id;
	}

}





 