// JavaScript Document


round_nav = {
	dynamic_class : 'dynav',
	dynamic_navs : new Array('',
							 '<br /><li class="dy_nav2"><a href="cove_hist.html">History of the Cove</a></li><li class="dy_nav2"><a href="cove_art.html">Fine Art Landscape Photos</a></li>',
							 '',
							 '<br /><li class="dy_nav2"><a href="attractions.html">Attractions</a></li>', 
							 '', 
							 '', 
							 '<br /><li class="dy_nav2"><a href="directions.html">Directions</a></li><li class="dy_nav2"><a href="land_prop.html">Property Land Location</a></li><li class="dy_nav2"><a href="topo_map.html">Topographical Map</a></li><li class="dy_nav2"><a href="shoot_map.html">Shooting Preserve</a></li>',
							 ''),


	init:function(){
		//round_nav.remove_html_nav();
		round_nav.test_roll();
	},	
	test_roll: function(){
		if(document.getElementById('1')){
			var link1 = document.getElementById('1');
			link1.onmouseover = function(){
				round_nav.add_dynamic_nav(1);
				round_nav.style_switch(link1);
				return false;
			}
		}
		if(document.getElementById('3')){
			var link2 = document.getElementById('3');
			link2.onmouseover = function(){
				round_nav.add_dynamic_nav(3);
				round_nav.style_switch(link2);
				return false;
			}
		}
		if(document.getElementById('6')){
			var link3 = document.getElementById('6');		
			link3.onmouseover = function(){
				round_nav.add_dynamic_nav(6);
				round_nav.style_switch(link3);
				return false;
			}
		}
		if(document.getElementById('0')){
			var link0 = document.getElementById('0');		
			link0.onmouseover = function(){
				round_nav.reverse_sub(0);
				return false;
			}
		}		
		if(document.getElementById('2')){
			var link5 = document.getElementById('2');		
			link5.onmouseover = function(){
				round_nav.reverse_sub(2);
				return false;
			}
		}
		if(document.getElementById('4')){
			var link6 = document.getElementById('4');		
			link6.onmouseover = function(){
				round_nav.reverse_sub(4);
				return false;
			}
		}
		if(document.getElementById('5')){
			var link7 = document.getElementById('5');		
			link7.onmouseover = function(){
				round_nav.reverse_sub(5);
				return false;
			}
		}
		if(document.getElementById('7')){
			var link8 = document.getElementById('7');		
			link8.onmouseover = function(){
				round_nav.reverse_sub(7);
				return false;
			}
		}
	},
	style_switch: function(element){
		var links = new Array();
		var t=0;
		if(document.getElementById('1')){links[t] = document.getElementById('1'); t++;}
		if(document.getElementById('3')){links[t] = document.getElementById('3'); t++}
		if(document.getElementById('6')){links[t] = document.getElementById('6'); t++}
		
		if(navigator.appName.indexOf('Microsoft') < 0){
			for(var i=0; i<links.length; i++){
				if(links[i] == element){
					links[i].parentNode.setAttribute('class', 'dy_nav');
				}else{
					links[i].parentNode.setAttribute('class', 'normal');
				}
			}
		}else{
			for(var i=0; i<links.length; i++){
				if(links[i] == element){
					links[i].style.color = '#A38771';
					//links[i].style.wordSpacing = '1px';
					links[i].parentNode.style.textDecoration = 'none';
					//links[i].parentNode.style.fontWeight = 'bold';
					links[i].parentNode.style.fontSize = '14px';
				}else{
					links[i].style.color = '#736D5A';
					//links[i].style.wordSpacing = 'normal';
					links[i].parentNode.style.textDecoration = 'none';
					links[i].parentNode.style.fontWeight = 'normal';
					links[i].parentNode.style.fontSize = '14px';
				}
			}
		}
	},
	add_dynamic_nav: function(which_nav){
		if(!document.getElementById('dynamic_secondary')){
			var dynamic2nd = document.createElement('ul');
			var box = document.getElementById('head_div');
			dynamic2nd.setAttribute('id','dynamic_secondary');
			box.insertBefore(dynamic2nd, document.getElementById('main_nav').nextSibling);
			dynamic2nd.innerHTML = round_nav.dynamic_navs[which_nav];
		}else{
			document.getElementById('dynamic_secondary').innerHTML = round_nav.dynamic_navs[which_nav];
		}
		//alert(which_nav);
	},
	switch_off: function(element){
		var links = new Array();
		var t=0;
		if(document.getElementById('1')){links[t] = document.getElementById('1'); t++;}
		if(document.getElementById('3')){links[t] = document.getElementById('3'); t++}
		if(document.getElementById('6')){links[t] = document.getElementById('6'); t++}
		
		if(navigator.appName.indexOf('Microsoft') < 0){
			for(var i=0; i<links.length; i++){
				if(links[i] != element){
					links[i].parentNode.setAttribute('class', 'normal');
				}
			}
		}else{
			for(var i=0; i<links.length; i++){
				if(links[i] != element){
					links[i].style.color = '#736D5A';
					//links[i].style.wordSpacing = 'normal';
					links[i].parentNode.style.textDecoration = 'none';
					links[i].parentNode.style.fontWeight = 'normal';
					links[i].parentNode.style.fontSize = '14px';
				}
			}
		}
	},
	reverse_sub: function(which_off){
		if(!document.getElementById('dynamic_secondary')){
			return;
		}else{
			document.getElementById('dynamic_secondary').innerHTML = round_nav.dynamic_navs[which_off];
			round_nav.switch_off(document.getElementById(which_off));
		}
	}
}

window.onload=function(){
	round_nav.init();
}