function reset_cart() {
var agree = confirm("Oletko varma että haluat tyhjentää ostoskorin?\n");
if (agree == true){
	return true ;
}else{
	return false ;
}
}


//------------------------------------------------------------------------------
function order2() {
var virheviesti = "Seuraavat pakolliset kentät jäivät täyttämättä tai on täytetty väärin:\n";

if (document.form.firstname) {
	 if (document.form.firstname.value == "") virheviesti += "\nEtunimi";
	 }

if (document.form.lastname) {
	 if (document.form.lastname.value == "") virheviesti += "\nSukunimi";
	 }	 

if (document.form.address) {
	 if (document.form.address.value == "") virheviesti += "\nLähiosoite";
	 }	 

if (document.form.zipcode) {
	 if (document.form.zipcode.value == "") virheviesti += "\nPostiosoite";
	 }

if (document.form.phone) {
	 if (document.form.phone.value == "") virheviesti += "\nPuhelinnumero";
	 }	 	 	 

if (document.form.email) {	 
	 if ((document.form.email.length < 6)||(document.form.email.value.indexOf("@") == -1)||(document.form.email.value.indexOf(".") == -1)) virheviesti += "\nSähköpostiosoite";
	 }
	 
if (document.form.payment) {	 
	 if ((document.form.payment[2].checked) && (document.form.delivery[1].checked == false)) virheviesti += "\nKäteismaksu mahdollinen vain tilausta noudettaessa.";
	 }
	 
if (virheviesti != "Seuraavat pakolliset kentät jäivät täyttämättä tai on täytetty väärin:\n") {
alert(virheviesti);
return false;
} else return true;
} 
//------------------------------------------------------------------------------
function feedback(){
var virheviesti = "Seuraavat pakolliset kentät jäivät täyttämättä tai on täytetty väärin:\n";

if (document.form.message.value == "") virheviesti += "\nViesti puuttuu";

if (virheviesti != "Seuraavat pakolliset kentät jäivät täyttämättä tai on täytetty väärin:\n") {
alert(virheviesti);
return false;
} else return true;
}