jQuery.noConflict(); // bigcartel.com uses prototype framework, this ensure jQuery will not conflict with it
				
var isHighlighterOut = false;
var timeout = null;

function pptInit() {			
	jQuery(".pod ul li a")
		.removeAttr("title")
		.mouseover(pptMouseOver)
		.mousemove(pptMouseMove)
		.mouseout(pptMouseOut);			
}

function pptMouseOver(e) {
	var highlighter = jQuery("#nav-highlighter");
	highlighter.stop();
	
	var top = (jQuery(e.target).offset().top - 56) + "px";
	
	if(!isHighlighterOut) {
		highlighter.css("top", top);
		highlighter.animate({width:"178px",left:0}, 250);
		isHighlighterOut = true;
	}
	else {
		highlighter.animate({top:top,width:"178px",left:0}, 200);
	}
	
	pptClearTimeout();
}

function pptMouseMove(e) {
	pptClearTimeout();
}

function pptMouseOut(e) {
	timeout = window.setTimeout("pptHideHighlighter();", 1000);
}

function pptClearTimeout() {		
	if(timeout) {
		window.clearTimeout(timeout);
		timeout = null;
	}
}

function pptHideHighlighter() {
	pptClearTimeout();
	var highlighter = jQuery("#nav-highlighter");
	highlighter.stop();
	highlighter.animate({width:"0px",left:"178px"}, 250);	
	pptClearTimeout();
	isHighlighterOut = false;
}