//=====================================================================
//==== nav.js  Zach Linster 5.7.2003 (with code from Alexey, for support visit http://www.geocities.com/menulite)
//==== include in all pages.  This generates the dynamic drop-down menus
//=====================================================================

var left_corner_x = 100; // x-coordinate of top left corner of dropdown menu
var left_corner_y = 246; // y-coordinate of top left corner of dropdown menu
// var back_color = '#E2E2C2'; // the background color of dropdown menu --- not web friendly
var back_color = '#FFFFFF';
var border_color = '#333366'; // the color of dropdown menu border

/// these are for the blank tables ... they should match the background color of the actual pages.
var blank_back_color = '#CCCC99';
var blank_border_color = '#CCCC99';

var border_size  = '1'; // the width of dropdown menu border
var menu_width   = '185'; // the width of dropdown menu 
//// Don't change these parameters
var delay  = 2000; /////<<<========================== changed to 0 from 500, need to swap out so graphics don't overlap
var active_layer_id = -1;  /////
var on_layer_id  = -1;  /////
var buff_id  = -1;  /////
 
var nav_dots = '<img src="images/nav_dots.gif" align="left" valign="bottom">';
var subnav_break = '<img src="images/1x1spacer.gif" width="1" height="1">&#187;<img src="images/1x1spacer.gif" width="10" height="1">';
var indent = '<img src="images/1x1spacer.gif" width="10" height="1">';

/// ----------------------------
//Script developed by Alexey
//for support visit http://www.geocities.com/menulite
//submitted to A1 JavaScripts - www.a1javascripts.com
// menu content; the dropdown menus themselfs between '' and items of every dropdown menu are diveded by |; 
// 


menu_content = new Array	(subnav_break + '<a href="overview.htm" class=subMenu>Love Ridge Overview & Description</a><br>' + subnav_break + '<a href="location.htm" class=subMenu>Location & Directions</a><br>' + subnav_break + '<a href="policies.htm" class=subMenu>Facts & Policies</a><br>' + subnav_break + '<a href="javascript:slide_show()" class=subMenu>Slide Show</a><br>' + subnav_break + '<a target="_blank" href="http://www.snowking.com" class=subMenu>Snow King Resort Home</a><br>' + subnav_break + '<a href="index.htm" class=subMenu>Love Ridge Home</a><br>',
							subnav_break + '<a href="rooms.htm" class=subMenu>Accommodations</a><br>' + subnav_break + '<a href="floorplans.htm" class=subMenu>Floor Plans</a><br>' + subnav_break + '<a href="amenities.htm" class=subMenu>Amenities</a><br>' + subnav_break + '<a href="rates.htm" class=subMenu>Rates & Packages</a><br>' + subnav_break + '<a href="reservations.htm" class=subMenu>Reservations & Availability</a><br>',
							subnav_break + '<a href="jacksonhole.htm" class=subMenu>Jackson Hole</a><br>' + subnav_break + '<a href="recreation.htm" class=subMenu>Seasonal Recreation</a><br>' + indent + subnav_break + '<a href="recreation.htm#warm" class=subMenu>Warm Weather Recreation/Activities</a><br>' + indent + subnav_break + '<a href="recreation.htm#winter" class=subMenu>Winter Recreation/Activities</a><br>' + indent + subnav_break + '<a href="recreation.htm#yearround" class=subMenu>Year Round</a><br>' + subnav_break + '<a href="diningshopping.htm" class=subMenu>Dining, Shopping, & Entertainment</a><br>' + subnav_break + '<a href="concierge.htm" class=subMenu>Concierge</a><br>',
							subnav_break + '<a href="conference.htm" class=subMenu>Conference Facilities</a><br>' + subnav_break + '<a href="catering.htm" class=subMenu>Catering</a><br>' + subnav_break + '<a href="familyweddings.htm" class=subMenu>Family Reunions & Weddings</a><br>',
							subnav_break + '<a href="realestate.htm" class=subMenu>Real Estate Opportunities</a><br>' + subnav_break + '<a href="features.htm" class=subMenu>Property Features</a><br>' + subnav_break + '<a href="masterplan.htm" class=subMenu>Snow King Resort & Masterplan</a><br>' + subnav_break + '<a href="javascript:slide_show()" class=subMenu>Pictures/Slide Show</a><br>' + subnav_break + '<a href="floorplans.htm" class=subMenu>Floor Plans</a><br>',
							subnav_break + '<a href="specialoffers.htm" class=subMenu>Special Offers</a><br>' + subnav_break + '<a href="reservations_groups.htm" class=subMenu>Group Reservations</a><br>' + subnav_break + '<a href="reservations.htm" class=subMenu>Reservations & Availability</a><br>',
							'');



//Script developed by Alexey
//for support visit http://www.geocities.com/menulite
//submitted to A1 JavaScripts - www.a1javascripts.com
// check browser version

function new_window(url) 
{
link = window.open(url,"Link","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=600,height=680,left=80,top=80");
}

function slide_show()
{
new_window('slideshow.htm')
}

NS4 = (document.layers) ? 1 : 0;

function layer_enter (id)

{

	on_layer_id = id;

}

function layer_exit (id)

{

	on_layer_id = - 1;

	setTimeout ('hide('+ id +')', delay/5);

}

function menu_enter (id)

{

	if (buff_id >= 0)

		hide (buff_id);



	show (id);

	active_layer_id = id;

}

function menu_exit (id)

{

	setTimeout ('hide('+ id +')', delay);

	buff_id = active_layer_id;

	active_layer_id = -1;

}

function show (id)

{
	
	 // ------ IE 4
	if (document.all)
	{
		document.all['Menu' + id].style.visibility = "visible";
		document.all['Menu' + id].style.display = "block";
		//document.all['Menu' + id].style.zIndex = 100;
	}
	
	 // ------ gecko(NN6) + IE 5+
	else if(document.getElementById)
	{
		//id = "Menu" + id;
		var obj = document.getElementById('Menu' + id);
        obj.style.visibility = "visible";
        obj.style.display = "block";
        //obj.style.zIndex = 100;
    }
        
	 // ------ Early Netshame
	else
	{
		document.layers[id].visibility = "visible";
	}
	
	// sketchy code to swap images
	var navImageName = "nav" + id;
	var navImageSrc = "images/nav" + id + "_over.jpg";
	
	//alert("changeImages(" + navImageName +", " + navImageSrc + ")");
	
	changeImages(navImageName, navImageSrc); return true;

}

function hide (id)

{

	if (active_layer_id != id && on_layer_id != id)

	{

	 	// ------ IE 4
		if (document.all)
		{
			document.all['Menu' + id].style.visibility = "hidden";
			document.all['Menu' + id].style.display = "none";
			//document.all['Menu' + id].style.zIndex = -1;
		}
	
	 	// ------ gecko(NN6) + IE 5+
		else if(document.getElementById)
		{
			//id = "Menu" + id;
			var obj = document.getElementById('Menu' + id);
        	obj.style.visibility = "hidden";
        	obj.style.display = "none";
        	//obj.style.zIndex = -1;
    	}
        
	 	// ------ Early Netshame
		else
		{
			document.layers[id].visibility = "hide";
		}
		
		// sketchy code to swap images
		var navImageName = "nav" + id;
		var navImageSrc = "images/nav" + id + ".jpg";

		//alert("changeImages(" + navImageName +", " + navImageSrc + ")");
	
		changeImages(navImageName, navImageSrc); return true;

	}

}

function generate_layers ()

{

	for (i = 0; i < menu_content.length; i++)

	{
		var x_coordinate;
		
		// get x-coordinate for menu location
		if (i==0)
		{
			x_coordinate = 1;
			menu_width = 225;
		}
		else if (i==1)
		{
			x_coordinate = 123;
			menu_width = 177;
		}
		else if (i==2)
		{
			x_coordinate = 245;
			menu_width = 239;
		}
		else if (i==3)
		{
			x_coordinate = 367;
			menu_width = 192;
		}
		else if (i==4)
		{
			x_coordinate = 403;
			menu_width = 207;
		}
		else if (i==5)
		{
			x_coordinate = 555;
			menu_width = 177;
		}
		
		

		if (!NS4)
		{
			layer_header = '<div id=Menu' + i +
					   	   ' onMouseOver="layer_enter (' + i + ');" onMouseOut = "layer_exit (' + i + ');"' +
				           ' style="visibility: hidden; position: absolute; left: ' + (x_coordinate) +
				           '; top: ' + left_corner_y + ';">';
		}
				           

		else
		{

			layer_header = '<layer id=' + i +
						   ' onMouseOver="layer_enter (' + i + ');" onMouseOut = "layer_exit (' + i + ');"' +
						   ' visibility=hide left=' + (x_coordinate) +
						   ' top = ' + left_corner_y + '>';
		}


		layer_header += '<table width=' + menu_width + ' cellpadding=0 cellspacing=0 border=0>' +

					    '<td bgcolor=' + border_color + '><table width=' + menu_width + ' cellpadding=3 ' +

					    'cellspacing=' + border_size + ' border=0><td width=' + menu_width + ' bgcolor=' + back_color + '>';



		elements = menu_content[i].split (/\s*\|\s*/);

		layer_body = '';

		for (j = 0; j < elements.length; j++)

		{

			layer_body += elements[j];	

			if ((NS4 && j < elements.length - 1) || (!NS4 && j < elements.length - 1))

				layer_body += '<hr width=' + (menu_width - 8) + ' size=1 color='+ border_color + '>';

		}

		layer_footer = '</td></table></td></table>';

		if (!NS4)

			layer_footer += '</div>';

		else

			layer_footer += '</layer>';

		document.writeln (layer_header + layer_body + layer_footer);

	}

}

