jQuery(document).ready(function($){
	
	// ----------------
	// Header Nav Menu
	// ----------------
/*	$("ul#topnav li").hover(function() { //Hover over event on list item
		$(this).find("ul").show(); //Show the subnav
		$("ul#topnav li.active ul").hide()
	} , function() { //on hover out...
		$(this).find("ul").hide(); //Hide the subnav
		$("ul#topnav li.active ul").show()
	});
	$("ul#topnav li.active").hover(function() { //Hover over event on list item
		$(this).find("ul").show(); //Show the subnav
	} , function() { //on hover out...
		$(this).find("ul").show(); //Hide the subnav
	});
	$("ul#topnav li.active li").hover(function() { //Hover over event on list item
		$("ul#topnav li.active ul").show(); //Show the subnav
	} , function() { //on hover out...
		$("ul#topnav li.active ul").show(); //Hide the subnav
	});
*/	
	// ----------------
	// JQ Zoom for Images
	// ----------------
	var options = {
		zoomWidth: 490,
		zoomHeight: 420,
		xOffset: 10,
		yOffset: 0,
		title: false,
		lens: true,
		position: "right",
		showEffect: "fadein",
		hideEffect: "show",
                fadeinSpeed: "slow",
		fadeoutSpeed: "slow",
                //zoomType: "reverse"
                imageOpacity: "0.5"
		};
	$(".jqzoom").jqzoom(options);
	
	$("#image0").css("z-index","500");
	$("#image0").css("display","block");
	$("#image0").css("position","absolute");
	
	
	// ----------------
	// Product Page Accordion
	// ----------------
	$('#generic-info-accordion').accordion({ 
    header: "h4",
//	event: 'mouseover',
	autoHeight: false,
	//active:false,
	collapsible:true,
	icons: {header: "accordion-expand", headerSelected: "accordion-close"}
	});
	
	// ----------------
	// Product Message Box Animation
	// ----------------
	$.fn.pause = function(duration) {
    $(this).animate({ dummy: 1 }, duration);
    return this;
	};
	
	$("div#messages_product_view ul").pause(5000).fadeOut("slow");
	
});

function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "external")
     anchor.target = "_blank";
 }
}
window.onload = externalLinks;

jQuery.noConflict();