
//here you place the ids of every element you want.
var ids=new Array('post-entry','cforms');

function switchid(id){	
	hideallids();
	showdiv(id);
	document.getElementById('footer').style.bottom = 0;
}

function hideallids(){
	//loop through the array and hide each element by id
	for (var i=0;i<ids.length;i++){
		hidediv(ids[i]);
	}		  
}

function hidediv(id) {
	//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'none';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'none';
		}
		else { // IE 4
			document.all.id.style.display = 'none';
		}
	}
}

function showdiv(id) {
	//safe function to show an element with a specified id
		  
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'block';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'block';
		}
		else { // IE 4
			document.all.id.style.display = 'block';
		}
	}
}

$(document).ready(function(){
	$('#primaryNav ol li').each(function(){
		var $this = $(this), width = 0;
		
		// $this.find('ol li').each(function(){
		// 	
		// 	var thisWidth = $(this).find('a').width() + 50;
		// 	if(thisWidth > width){
		// 		width = thisWidth;
		// 	}
		// });
		// 
		// $this.find('ol').width(width);
		
		
	});
	
	$('ol.alternating').each(function(){
		$(this)
			.find('li:odd')
				.addClass('odd')
					.end()
			.find('li:even')
				.addClass('even')
					.end()
			.find('li:last:even')
					.append('<span class="bl">&nbsp;</span><span class="br">&nbsp;</span>');
				
			
	});
	
	$('#primaryNav ol li ol').css({visibility: 'visible', display: 'none'});
	
	$('#cforms a.back').prependTo('#cforms2form p.cf-sb');
	
	$('#primaryNav ol li').hover(function(){
		var $this = $(this);
		// $this.find('ol').css({display: 'block'});
		$this.find('ol').fadeIn('fast');
	}, function(){
		var $this = $(this);
		// $this.find('ol').css({display: 'none'});
		$this.find('ol').fadeOut('fast');
	});
	
	$('#primaryNav ol li ol li').hover(function(){
		var $this = $(this);
		// $this.find('ol').css({display: 'block'});
		$this.find('ul').fadeIn('fast');
	}, function(){
		var $this = $(this);
		// $this.find('ol').css({display: 'none'});
		$this.find('ul').fadeOut('fast');
	});
	
});

