// JavaScript Document

function initNav(){
	if (typeof document.body.style.maxHeight == 'undefined') {
		var nav = document.getElementById("main-nav");
		var lis = nav.getElementsByTagName("li");
		for (var i=0; i<lis.length; i++) {			
			lis[i].onmouseover = function()	{
				this.className += " hover";
			};
			lis[i].onmouseout = function() {
				this.className = this.className.replace(" hover", "");
			};			
		}
	}
}
if (document.all && !window.opera)
	attachEvent("onload", initNav);
	
window.addEvent('domready', function() {
	try {
		var sbLinks = $('sidebar').getElements('a');
		for (var i=0; i<sbLinks.length; i++) {
			$(sbLinks[i]).addEvent('click', function(){
				var href = $(this).getAttribute('href');
				var name = $(this).getAttribute('title');
				window.open(href, name, 'width=700,height=415')
				
				return false;
			}); 
		}
	} catch (ex1) {
		// in case there isn't a sidebar
	}
	
});

jQuery.noConflict();
jQuery(document).ready(function(){
	jQuery('a[rel="popup"]').click(function(){ 
		var href = jQuery(this).attr('href');
		
		window.open(href, '', 'width=840,height=810,scrollbars,resizable');
		return false;
	});
	jQuery('a[rel="external"]').click(function(){
		var href = jQuery(this).attr('href');
		window.open(href, '', 'scrollbars,resizable,menubar,toolbar,status');
		return false;
	});
});


