var totalImages = 12; // Total images used

browserName = navigator.appName;
browserVer = parseInt(navigator.appVersion);

ns3up = (browserName == "Netscape" && browserVer >= 3);
ie4up = (browserName.indexOf("Microsoft") >= 0 && browserVer >= 4);

function showPic(imgName) 
{
	if (ns3up || ie4up) 
		imgOn = ("images/nav/" + imgName);
		
	document.mainpic.src = imgOn;
}

if(document.images)
{
	mFX = new Array(totalImages);
	for(i = 0; i < mFX.length; i++)
	{
		mFX[i] = new Image();
	}
	
	mFX[0].src = "images/nav/home.jpg";
	mFX[1].src = "images/nav/home-over.jpg";
	mFX[2].src = "images/nav/accommodation.jpg";
	mFX[3].src = "images/nav/accommodation-over.jpg";
	mFX[4].src = "images/nav/bookings.jpg";
	mFX[5].src = "images/nav/bookings-over.jpg";
	mFX[6].src = "images/nav/map.jpg";
	mFX[7].src = "images/nav/map-over.jpg";
	mFX[8].src = "images/nav/paragliding.jpg";
	mFX[9].src = "images/nav/paragliding-over.jpg";
	mFX[10].src = "images/nav/sitemap.jpg";
	mFX[11].src = "images/nav/sitemap-over.jpg";
	
}

function imgFX(img, num)
{
	if(document.images)
	{
		document.images[img].src = mFX[num].src;
	}
}

function MM_preloadImages() 
{ //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function validateBooking()
{
	fv =  new formValidator();
	
	if (fv.isEmpty("your_name"))
		fv.raiseError("Please specify your name.");
		
	if (fv.isEmpty("telephone_no"))
		fv.raiseError("Please specify your telephone number.");
		
	if (fv.isEmpty("your_email"))
		fv.raiseError("Please specify your email address.");
	else
	{
		if (!fv.isEmailAddress("your_email"))
			fv.raiseError("Please specify a valid email address.");
	}
	
	if (fv.isEmpty("date_of_arrival"))
		fv.raiseError("Please specify your date of arrival.");
		
	if (fv.isEmpty("date_of_departure"))
		fv.raiseError("Please specify your date of departure.");
		
	if (fv.isEmpty("no_of_people"))
		fv.raiseError("Please specify the number of people.");
		
	if (fv.numErrors() > 0)
	{
		fv.displayErrors();
		return false;
	}
	else
	  return true;	
}


