// JavaScript Document
function ScrollPage(startP)
{
if (startP <= 0)
	startP = 1;

pForm = document.pagerForm;
pForm.firstRec.value= startP;
pForm.action= "";
pForm.submit();
}

function displayImage(imgSrc){
document.getElementById('theGallery').style.display = 'none';
document.getElementById('imageContainer').style.display = 'block';
var image = document.getElementById('largeImage');
image.src = imgSrc;
}

function displayGallery(){
document.getElementById('theGallery').style.display = 'block';
document.getElementById('imageContainer').style.display = 'none';
}
// -----------------------------------------------------------
function ShowDiv()
	{
	boxGMap = document.getElementById("mapbox");
	if (boxGMap.style.visibility == "hidden")
		boxGMap.style.visibility = "visible";
	else
		boxGMap.style.visibility = "hidden";
	}

//--------------------------
function CheckForm(f)
{
badField = "";

s = "Please enter that field and sumbit this form again."
if (!f.name.value)
	badField = "First and last name are";
else if (!f.email.value || !f.address.value || !f.town.value || !f.state.value || !f.country.value || !f.code.value || !f.phone.value)
	badField = "Email, address, city, state, country, postal code and phone are";
else if (!f.numberweeks.value)
	badField = "Number of weeks is";
else if (!f.numberguests.value)
	badField = "Number of guests";

if (badField)
	{
	alert(badField + " mandatory!\n\nPlease enter all fields marked '*' and sumbit this form again.");
	return false;
	}

return true;
}
//--------------------------
function GoVillaDetail(f, vid)
{

f.v_id.value = vid;
f.action = "detail.php?v_id="+vid;
f.submit();
}
