// JavaScript Document

function checkform( thisform ) {
if (thisform.txtNumber.value == null || thisform.txtNumber.value == "") {
	alert ("Please fill in the correct Safety Code!") ;
	thisform.txtNumber.focus() ;
	thisform.txtNumber.select() ;
	return false ;
}
if ((thisform.name.value == "") || (thisform.mail.value == "") || (thisform.notes.value == "")) {
	alert ("Please fill in all the fields!") ;
	thisform.name.focus() ;
	return false ;
}
 
return true;
}

function checkformadminaccommodation( thisform ) {
if ((thisform.new_accommodation_name.value == "") || (thisform.new_accommodation_category.value == "") || (thisform.new_accommodation_location.value == "") || (thisform.new_accommodation_phone1.value == "") || (thisform.uploadfile2.value == "")) {
	alert ("Name, category, location, phone1 and image are required!") ;
	thisform.new_accommodation_name.focus() ;
	return false;
}

return true;
}

function checkformadminfood( thisform ) {
if ((thisform.new_food_name.value == "") || (thisform.new_food_location.value == "") || (thisform.new_food_phone1.value == "") || (thisform.uploadfile3.value == "")) {
	alert ("Name, location, phone1 and image are required!") ;
	thisform.new_food_name.focus() ;
	return false;
}

return true;
}

function checkformadminfun( thisform ) {
if ((thisform.new_fun_name.value == "") || (thisform.new_fun_location.value == "") || (thisform.new_fun_phone1.value == "") || (thisform.uploadfile4.value == "")) {
	alert ("Name, location, phone1 and image are required!") ;
	thisform.new_fun_name.focus() ;
	return false;
}

return true;
}

function checkformadminshops( thisform ) {
if ((thisform.new_shops_name.value == "") || (thisform.new_shops_location.value == "") || (thisform.new_shops_phone1.value == "") || (thisform.uploadfile5.value == "")) {
	alert ("Name, location, phone1 and image are required!") ;
	thisform.new_shops_name.focus() ;
	return false;
}

return true;
}

function checkformadminactivities( thisform ) {
if ((thisform.new_activities_name.value == "") || (thisform.new_activities_location.value == "") || (thisform.new_activities_phone1.value == "") || (thisform.uploadfile6.value == "")) {
	alert ("Name, location, phone1 and image are required!") ;
	thisform.new_activities_name.focus() ;
	return false;
}

return true;
}

function checkformadminvillage( thisform ) {
if ((thisform.new_village_name.value == "") || (thisform.uploadfile7.value == "")) {
	alert ("Name and image are required!") ;
	thisform.new_village_name.focus() ;
	return false;
}

return true;
}

function checkformadminlink( thisform ) {
if ((thisform.new_link_name.value == "") || (thisform.new_link_url.value == "")) {
	alert ("Name and URL are required!") ;
	thisform.new_link_name.focus() ;
	return false;
}

return true;
}

function limitText(limitField, limitCount, limitNum) {
	if (limitField.value.length > limitNum) {
		limitField.value = limitField.value.substring(0, limitNum);
	} else {
		limitCount.value = limitNum - limitField.value.length;
	}
}



function checkformrequest( thisform ) {
if (thisform.request_name_gr.value == "" || (thisform.request_type.value == "") || (thisform.request_location_gr.value == "") || (thisform.request_mail.value == "") || (thisform.request_telephone1.value == "")) {
	alert ("Please fill in all the required fields!") ;
	thisform.request_name_gr.focus() ;
	return false ;
} else {
if (thisform.txtNumber.value == null || thisform.txtNumber.value == "") {
	alert ("Please fill in the correct Safety Code!") ;
	thisform.txtNumber.focus() ;
	thisform.txtNumber.select() ;
	return false ;
}
}
 
return true;
}


function checkformoffer( thisform ) {
if ((thisform.offer_name.value == "") || (thisform.offer_title.value == "") || (thisform.offer_description.value == "") || (thisform.offer_price.value == "") || (thisform.offer_date_start.value == "") || (thisform.offer_date_expiration.value == "")) {
	alert ("Please fill in all the fields!") ;
	thisform.offer_name.focus() ;
	return false ;
} else {
if (thisform.txtNumber.value == null || thisform.txtNumber.value == "") {
	alert ("Please fill in the correct Safety Code!") ;
	thisform.txtNumber.focus() ;
	thisform.txtNumber.select() ;
	return false ;
}
}
 
return true;
}


function checkformreservation( thisform ) {
if ((thisform.new_reservation_name.value == "") || (thisform.new_reservation_mail.value == "") || (thisform.new_reservation_from.value == "") || (thisform.new_reservation_to.value == "")) {
	alert ("Please fill in all the fields!") ;
	thisform.new_reservation_name.focus() ;
	return false ;
} else {
if (thisform.txtNumber.value == null || thisform.txtNumber.value == "") {
	alert ("Please fill in the correct Safety Code!") ;
	thisform.txtNumber.focus() ;
	thisform.txtNumber.select() ;
	return false ;
}
}
 
return true;
}


function limitText(limitField, limitCount, limitNum) {
	if (limitField.value.length > limitNum) {
		limitField.value = limitField.value.substring(0, limitNum);
	} else {
		limitCount.value = limitNum - limitField.value.length;
	}
}
