$(document).ready(
	function() {
		// generateSprites arguments:
		// 1st - parent class (the main class on the parent ul), with preceding period
		// 2nd - selected prefix (eg. for a selected class of "selected-about", use "selected-" as the value)
		// 3rd - :active state toggle, set to true if you've defined :active states (and the jQuery equivalent) in your CSS
		// 4th - animation speed, in milliseconds (eg. 300 = 0.3 seconds)
		// 5th - animation style, as a string. Set to "slide" or "fade" (defaults to "fade")
		
		// example usage:
		// generateSprites(".navigation", "selected-", true, 300, "fade");
		// generateSprites(".top-nav", "position-", true, 200, "slide");
		// generateSprites(".sidebar-nav", "current-", false, 150, "fade");
		
		//generateSprites(".navigation", "nav-", true, 500, "slide");
		
		function execMenuFunction() {
			$(".navigation").children("li").each(function() {
				var current = "navigation current-" + ($(this).attr("class"));
				var parentClass = $(".navigation").attr("class");
				if (parentClass != current) {
					$(this).children("a").css({backgroundImage:"none"});
				}
			});
		}

		function attachNavEvents(parent, myClass) {
			$(parent + " ." + myClass).mouseover(function() {
				$(this).before('<div class="nav-' + myClass + '"></div>');
				$("div.nav-" + myClass).css({display:"none"}).fadeIn(500);
			}).mouseout(function() {
				// fade out & destroy pseudo-link
				$("div.nav-" + myClass).fadeOut(500, function() {
					$(this).remove();
				});
			});
		}

		if (parseInt(jQuery.browser.version) != 6) {
			execMenuFunction();
			attachNavEvents(".navigation", "home");
			attachNavEvents(".navigation", "register");
			attachNavEvents(".navigation", "schedule");
			attachNavEvents(".navigation", "location");
			attachNavEvents(".navigation", "sponsors");
			attachNavEvents(".navigation", "exhibitors");
		}
	}
);
function popup(href,width,height,win_name) {
	if (!win_name) win_name = 'none';
	var window_features = "height="+height+",width="+width+",toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,copyhistory=0,dependent=1,top=100,left=100";
	win = window.open(href,win_name,window_features);
	if(win) {win.focus();}
	return false;
}
