// Global Functions

// determine browser capabilities

doclay = (document.layers)? true : false
docall = (document.all)? true : false
docget = (document.getElementById)? true : false

// Contact popup
function contactPopup()
{
	contactWindow = "contact.php";
	window.open(contactWindow,'contact','width=360,height=400,toolbar=no,location=no,resizable=no,scrollbars=yes,status=yes,left=10,top=10,screenX=10,screenY=10');
}

// SlideShow Pop
function popSlideshow(slideshowURL) {
	slideshowWindow = window.open(slideshowURL,'slideshow','width=620,height=550,toolbar=no,location=no,resizable=no,scrollbars=no,status=no,left=10,top=10,screenX=10,screenY=10');
	slideshowWindow.focus();
}

// SlideShow Pop
function popGardenImage(img) {
	imgURL = "garden_pop_display.php";
	imgURL = imgURL + "?" + img;
	gardenWindow = window.open(imgURL,'gardenpic','width=450,height=550,toolbar=no,location=no,resizable=yes,scrollbars=no,status=no,left=10,top=10,screenX=10,screenY=10');
	gardenWindow.focus();
}

// Map Pop
function popMap(mapURL) {
	mapWindow = window.open(mapURL,'map','width=500,height=358,toolbar=no,location=no,resizable=no,scrollbars=no,status=no,left=20,top=20,screenX=20,screenY=20');
	mapWindow.focus();
}

// Emails directions to the site
function emailDirections()
{
	directionsWindow = "email_directions.php";
	window.open(directionsWindow,'directions','width=360,height=200,toolbar=no,location=no,resizable=no,scrollbars=yes,status=yes,left=10,top=10,screenX=10,screenY=10');
}
// For newsletter signup
function emailPopup()
{
	emailWindow = "email_sender.php";
	window.open(emailWindow,'email','width=360,height=200,toolbar=no,location=no,resizable=no,scrollbars=yes,status=yes,left=10,top=10,screenX=10,screenY=10');
}


function layerWrite(id,nestref,title,subcopy,num) {

// location of the layout images
imageLocation = new Array()

imageLocation[0] = "img/HolidayFoyer_sm.jpg"

imageLocation[1] = "img/bar.jpg"

imageLocation[2] = "img/chivari_sm.jpg"

imageLocation[3] = "img/kitchen.jpg"

imageLocation[4] = "img/terrace3.jpg"

thisImg = imageLocation[num];

	if (docget) {
		document.getElementById("layoutinfo").innerHTML = "<span class=\"welcome\"><b>" + title + "<\/b><\/span><p>" + "<img src=\"" + thisImg + "\"><br>" + "<span class=\"facilitycopy\">" + subcopy + "<\/span>";
	} else if (doclay) {
		document.layers["layoutinfo"].document.open()
		document.layers["layoutinfo"].document.write("<span class=\"welcome\"><b>" + title + "<\/b><\/span><p>" + "<img src=\"" + thisImg + "\"><br>" + "<span class=\"facilitycopy\">" + subcopy + "<\/span>");
		document.layers["layoutinfo"].document.close()
	} else if (docall) {
		document.all.layoutinfo.innerHTML = "<span class=\"welcome\"><b>" + title + "<\/b><\/span><p>" + "<img src=\"" + thisImg + "\"><br>" + "<span class=\"facilitycopy\">" + subcopy + "<\/span>";
	}

}
