function clearDefault(searchbox) {
	if (searchbox.defaultValue==searchbox.value) searchbox.value = "";
}
function fillDefault(searchbox) {
	if (searchbox.value=="") searchbox.value = "Produkt";
}
function delete_check(product_name, product_cat, product_id) {
	var where_to = confirm("Vill du verkligen ta bort " + product_name + "?");
	if (where_to == true) {
		window.location="deleteproducts.php?pid=" + product_id + "&cat=" + product_cat;
	}
}

function delete_cat_check(cat_name, cat_id) {
	var where_to = confirm("Vill du verkligen ta bort kategorin: " + cat_name + "?");
	if (where_to == true) {
		window.location="admincategories.php?do=delete&cid="+cat_id;
	}
}

function formAction() {
	if (document.pay.readAgreement.checked == false) {
		document.pay.action = 'checkout.php?agree=false';
	} else {
		if (document.pay.PaymentMethod[4].checked == true || document.pay.PaymentMethod[5].checked == true) {
			document.pay.action = 'checkout.php';
		} else {
			document.pay.action = 'https://www.payson.se/merchant/default.aspx';
		}
	}
	return true;
}

var state = 'none';
function showOrder(order) {
	if (state == 'block') {
		state = 'none';
	} else {
		state = 'block';
	}
	if (document.all) {
		eval( "document.all." + order + ".style.display = state");
	}
	if (document.layers) {
		document.layers[order].display = state;
	}
	if (document.getElementById &&!document.all) {
		hza = document.getElementById(order);
		hza.style.display = state;
	}
} 

