// Main Menu for Dunes Cottage. 
// Created by Mat Way: 2nd May 2006

imgPath = 'images/buttons/'

homeOn = new Image();
homeOn.src = imgPath + 'home-on.gif';

venueOn = new Image();
venueOn.src = imgPath + 'The_Cottage-on.gif';

locationOn = new Image();
locationOn.src = imgPath + 'location-on.gif';

normanvilleOn = new Image();
normanvilleOn.src = imgPath + 'Normanville-on.gif';

costsOn = new Image();
costsOn.src = imgPath + 'Costs-on.gif';

enquireOn = new Image();
enquireOn.src = imgPath + 'Surrounding_Attractions-on.gif';

contactOn = new Image();
contactOn.src = imgPath + 'Contact-on.gif';

function btnOn(btn, pic) {btn.src = imgPath + pic + '-on.gif';}
function btnOff(btn, pic) {btn.src = imgPath + pic + '-off.gif';}


var myString = this.location + " ";
var duneLinks = new Array()
var imgPath = 'images/buttons/'

duneLinks[0] = "Home";
duneLinks[1] = "The_Cottage";
duneLinks[2] = "Location";
duneLinks[3] = "Surrounding_Attractions";
duneLinks[4] = "Costs";
duneLinks[5] = "Contact";

function writeLinks(menuNumber)
	{
	for (i=0;i<duneLinks.length;i++)
		{
			document.write(addBull(i))
		if (myString.match(duneLinks[i]))
			{
			document.write('<img src="images/buttons/' + duneLinks[i] + '-on.gif" border=0>');
			}
		else
			{
			var btnName = duneLinks[i] + menuNumber;
			var pic = duneLinks[i];
			
			document.write('<a href="' + duneLinks[i] + '.htm" onmouseover="btnOn(' + btnName + ', \'' + pic + '\')" onmouseout="btnOff(' + btnName + ', \'' + pic + '\')">');
			document.write('<img name=' + btnName + ' src="images/buttons/' + duneLinks[i] + '-off.gif" border=0></a>');
			}
		}
	}

function addBull(arrayPosition)
	{
	if (arrayPosition == 0 || arrayPosition == duneLinks.length)
		{return ""}
	else
		{return " &bull; "}
	}
	
function winOpen(img)
	{
	newWin = window.open(img, '_blank', 'width=640 height=500 top=10 left=10');
	newWin.document.write('<title>&copy; Dunes Cottage</title>');

	newWin.document.write('<body style="margin: 0px;">');
	newWin.document.write('<div align="center"><img src="' + img + '"></div>');
	newWin.document.write('<div style="background-color: #000000; text-align: right; padding: 4px 8px 0px 0px; height: 20px;">');
	newWin.document.write('<a style="padding-left: 5px; font-size: 6pt; color: #ffffff; ');
	newWin.document.write('font-family: arial; font-weight: bold;" href="javascript:window.close()">X CLOSE</a>');
	newWin.document.write('</div>');
	newWin.document.write('</body>');
	}


// for testing: document.write('<br><br>' + myString)
