// Initialize menus

var primaryNav;

Spry.Utils.addLoadListener(function()
{
	primaryNav = new Spry.Widget.MenuBar("primaryNav");
});

$(document).ready(function(){
	
	// Set up image rotation
	var x = (Math.floor(Math.random() * 3) + 1);
	var imgSrc = "images/imagebar-home-" + x + ".jpg";
	$("#imagebarHome").attr("src", imgSrc);

	//Open external links in a new window
	$("a[href^='http']").click(function(){
		window.open(this.href);
		return false;
	});
	
	//Open PDFs in a new window
	$("a[href*=.pdf]").click(function(){
		window.open(this.href);
		return false;
	});
	// Lightbox for Disclaimer
	$("a#legal").nyroModal({
		width: 600, // default Width If null, will be calculate automatically
		height: 400, // default Height If null, will be calculate automatically
		minWidth: 600, // Minimum width
		minHeight: 400, // Minimum height
		resizable: false
	});
});


