/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tabbed popular picks script below
*/
function switchSlidey(slideToShow,slideToHide){
	document.getElementById(slideToHide).style.display='none';
	document.getElementById(slideToShow).style.display='inline';
	}
	
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

function init()
		{
			if(document.getElementById && document.createTextNode)
			{
				var mn=document.getElementById('main_nav');
				var as=mn.getElementsByTagName('a');
				for (var i=0;i<as.length;i++)
				{
					as[i].onmouseover=function(){show(this);return false}
				}	
			}
		}  
		function show(l)
		{
			hidem();
			var id=l.href.match(/#(\w.+)/)[1];
			document.getElementById(id).style.display='block';
		}
		function hidem()
		{
			for (var i=0;i<document.getElementById('secondary_nav').getElementsByTagName('ul').length;i++)
			{
				document.getElementById('secondary_nav').getElementsByTagName('ul')[i].style.display='none';
			}
		}
		window.onload=init;
		

	

// ~~~~~~~~~~~~~~~~~rollovers
function setupRollovers() {
if (!document.getElementsByTagName)
return;
var all_links = document.getElementsByTagName('a');
for (var i = 0; i < all_links.length; i++) {
var link = all_links[i];
if (link.className &&
(' ' + link.className + ' ').indexOf(' rollover ') != -1)
{
if (link.childNodes &&
link.childNodes.length == 1 &&
link.childNodes[0].nodeName.toLowerCase() == 'img') {
link.onmouseover = mouseover;
link.onmouseout = mouseout;
}
}
}
}
function findTarget(e)
{
/* Begin the DOM events part, which you */
/* can ignore for now if it's confusing */
var target;
if (window.event && window.event.srcElement)
target = window.event.srcElement;
else if (e && e.target)
target = e.target;
if (!target)
return null;
while (target != document.body &&
target.nodeName.toLowerCase() != 'a')
target = target.parentNode;
if (target.nodeName.toLowerCase() != 'a')
return null;
return target;
}
function mouseover(e) {
var target = findTarget(e);
if (!target) return;
// the only child node of the a-tag in target will be an img-tag
var img_tag = target.childNodes[0];
// Take the "src", which names an image called "something.ext",
// Make it point to "something_over.ext"
// This is done with a regular expression
img_tag.src = img_tag.src.replace(/(\.[^.]+)$/, '-over$1');
}
function mouseout(e) {
var target = findTarget(e);
if (!target) return;
// the only child node of the a-tag in target will be an img-tag
var img_tag = target.childNodes[0];
// Take the "src", which names an image as "something_over.ext",
// Make it point to "something.ext"
// This is done with a regular expression
img_tag.src = img_tag.src.replace(/-over(\.[^.]+)$/, '$1');
}
// When the page loads, set up the rollovers
window.onload = function() {
	setupRollovers();
}

// BFP below ... IS above
var axel = Math.random() + "";
var ord = axel * 1000000000000000000;

function alternate(id) {
	if(document.getElementsByTagName){
		var table = document.getElementById(id);
		if ( table == null ) {
			return true;
		}
		var rows = table.getElementsByTagName("tr");
		for (i = 0; i < rows.length; i++) {
			if(i % 2 == 0) {
				rows[i].className = "even";
			} else {
				rows[i].className = "odd";
			}
		}
	}
	return true;
}

