function CreateBookmarkLink() {
	url = location.href;
	
	if (window.sidebar) window.sidebar.addPanel(document.title, url, ""); // Firefox
	else if(window.external) window.external.AddFavorite(url, document.title); // IE
	 
}

function reloadPage(){
	window.location.reload();
}

function updatePhotoNav(photoInd){
	$('.info ul a').attr('class','');
	$('.info ul a:eq('+photoInd+')').attr('class','selected');
}

function generateMainMenu(parent, selectedPrefix, setActive, hoverSpeed, style) {
	var parentClass = $(parent).attr("class");
	$(parent).children("li").each(function() {
		var myClass = ($(this).attr("class"))
		var current = parent.substring(1) + " current-" + ($(this).attr("class"));

		// add em and hover-event but only if this isn't the currently-selected item
		if (parentClass != current) attachNavEvents(parent, myClass, setActive, hoverSpeed, style);
	});
}

function attachNavEvents(parent, myClass, setActive, hoverSpeed, style) {
	$(parent + " ." + myClass + " a").each(function() {
		$(this).append('<em class="hidden"></em>');
		$(this).data('emSelector',parent + " ." + myClass + " em");

		$(this).hover(
			function() {
				var em = ($(this).data('emSelector'));
				$(this).children("span").css({'background-position':'0 0', 'height':'31px'});
				
				if (style == "slide") $(em).css({'display':'none', 'height':'31px'}).slideDown(hoverSpeed,function(){
					$(this).css({'height':'31px'});
				});
				else $(em).css({'display':'none', 'height':'31px'}).fadeIn(hoverSpeed,function(){
					$(this).css({'height':'31px'});
				});
			},
			function() {
				var em = ($(this).data('emSelector'));
				if (style == "slide") $(em).slideUp(hoverSpeed);
				else $(em).fadeOut(hoverSpeed);
			}
		);
		
	});
}


