$(document).ready(function()
{
	/* nav top dropdowns for IE6 */
	var sfEls = $("#NavTop2_dropdown li");	
	sfEls.mouseenter(function(){$(this).children("ul").fadeIn(250);});
	sfEls.mouseleave(function(){$(this).children("ul").fadeOut(250);});
	
	/* related content tabs */
	$(".tab-content").hide();
	$("ul.content-type-tabs li:first").addClass("active").show();
	$(".tab-content:first").show();

	$("ul.content-type-tabs li").click(function() 
	{
		$("ul.content-type-tabs li").removeClass("active");
		$(this).addClass("active");
		$(".tab-content").hide();
		var activeTab = $(this).find("a").attr("href");
		$(activeTab).fadeIn();
		return false;
	});

	$(".prSnippetLink").click(function() { 
		$("ul.content-type-tabs li").removeClass("active");
		$("#tab-review").addClass("active");
		$(".tab-content").hide();
		var activeTab = $("#tab-review a").attr("href");
		$(activeTab).fadeIn();
		return false;
	});
	
	
	/* on-page popup */
	$(".popover").click(function() {
		var link = $(this).attr("href");
		
		$(this).append('<div class="popoverframe"><iframe src="' + link + '"><p>Your browser does not support iframes.</p></iframe></div>');
		$(".popoverframe").fadeIn("fast");
		
		$(".popoverframe").mouseleave(function() {
			$(this).fadeOut("fast", function(){
				$(this).remove();
			});
		});
		
		return false;
	});
});

//if(parent.frames.length!=0) { window.top.location.replace(self.document.location); } // FrameBuster

/* Old popup code. May still be used on checkout */
function Help(path){window.name = "main";var windowprops = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=350,height=300,top=50,left=50";window.open(path, "", windowprops);}

/* togglers */
function visibility_toggle(object_ID){$("#" + object_ID).toggle();return true;}

function toggle_more_info(list_id)
{
	var list = $("#list_" + list_id);
	var link = $("#more_" + list_id);
	
	if (link.html() == "more options...")
	{
		// show all
		list.children("li").slideDown();
		link.html("less options...");
	}
	else
	{
		// hide all but the top five
		list.children("li:gt(4)").slideUp();
		link.html("more options...");
	}
}