/* Copyright (c) 2010 Strong Engineering LLC */

var navigationLinks = 
[
	{
		"name":"Welcome!",
		"href":"index.html"
	},
	{
		"name":"Availability Calendar",
		"href":"availabilityCalendar.html"
	},
	{
		"name":"Location",
		"href":"location.html"
	},
	{
		"name":"Condo Details",
		"href":"condoDetails.html"
	},
	{
		"name":"Kamaole Sands Amenities",
		"href":"kamaoleSandsAmenities.html"
	},
	{
		"name":"Rates",
		"href":"rates.html"
	},
	{
		"name":"Photos",
		"href":"photos.html"
	},
	{
		"name":"Rental Policies",
		"href":"rentalPolicies.html"
	},
	{
		"name":"Frequently Asked Questions",
		"href":"faq.html"
	},
	{
		"name":"Guest Comments",
		"href":"guestBook.html"
	},
	{
		"header":"South Kihei"
	},
	{
		"name":"Kamaole Beach",
		"href":"kamaoleBeach.html"
	},	
	{
		"name":"Restaurants/Shopping",
		"href":"restaurants.html"
	},	
	{
		"header":"Maps"
	},
	{
		"name":"Map of Kamaole Sands",
		"href":"mapKamaoleSands.html"
	},	
	{
		"name":"Google map of resort",
		"href":"mapGoogleKamaoleSands.html"
	},	
	{
		"name":"Google map of Maui",
		"href":"mapGoogleMaui.html"
	},	
	{
		"header":"Links"
	},
	{
		"name":"Listing on VRBO",
		"href":"http://www.vrbo.com/281362",
		"newWindow":true
	},
	{
		"name":"Listing on Flipkey",
		"href":"http://www.flipkey.com/kihei-condo-rentals/p304545/",
		"newWindow":true
	},	
	{
		"name":"Listing on AirBnB",
		"href":"http://www.airbnb.com/rooms/150465",
		"newWindow":true
	},	
	{
		"header":"Contact Information"
	},
	{
		"name":"iris@MauiIris.com",
		"href":"mailto:iris@MauiIris.com?subject=Kamaole Sands 9-107",
		"noBullet":true
	},
	{
		"text":"831 818 7461"
	},
	{
		"text":"866 816 6822 fax"
	}
		
];

function navigationSetup()
{
	var i;
	var anchorNode;
	var listItemNode;
	var spanNode;
	
	/* add ul */
	var rootNode = document.getElementById("navigation");
	var listNode = document.createElement("ul");
	rootNode.appendChild(listNode);
	
	for( i = 0; i < navigationLinks.length; i += 1 )
	{
	
		if( navigationLinks[i].href != undefined )
		{

			/* create anchor node */
			anchorNode = document.createElement("a");
			anchorNode.setAttribute("href", navigationLinks[i].href );
			if( navigationLinks[i].newWindow != undefined )
			{
				anchorNode.setAttribute("target", "_blank" );
			} 
			anchorNode.appendChild(document.createTextNode(navigationLinks[i].name));
			
			if( navigationLinks[i].noBullet != undefined )
			{
				listNode.appendChild(anchorNode);
			}
			else
			{
				/* add li */
				listItemNode = document.createElement("li");
				listNode.appendChild(listItemNode);
				listItemNode.appendChild(anchorNode);
			}
		}

		if( navigationLinks[i].text != undefined )
		{
			/* add a new line of text */
			listNode.appendChild(document.createElement("br"));
			listNode.appendChild(document.createTextNode(navigationLinks[i].text));
		}
		
		if( navigationLinks[i].header != undefined )
		{
			/* add a header span to the div and start a new ul */
			spanNode = document.createElement("span");
			spanNode.appendChild(document.createTextNode(navigationLinks[i].header));
			rootNode.appendChild(spanNode);
			listNode = document.createElement("ul");
			rootNode.appendChild(listNode);
		}
	}
	
}	

