jQuery.noConflict();

jQuery(document).ready(function() 
{
		
	// Slider Homepage
	if(jQuery('#slider').length)
	{
		jQuery('#slider').cycle({
			fx: 'fade',
			speed: 2000,
			timeout: 5000,
			pager: '#controls',
			slideExpr: '.panel'
		});
	}


	// Category Description Expand
		
	if(jQuery('div.categoryexpand').length)
	{
		//if(jQuery("div.categoryexpand p + p").length)
		//{
			// get total height
			var fullheight = jQuery("div.categoryexpand").height();

			// get height of first p (plus a bit more)
			var pheight = jQuery("div.categoryexpand p:first").height() + 50;

			// hide all p's after the first
			jQuery("div.categoryexpand p + p").hide();

			// set height of div to that of first p
			jQuery("div.categoryexpand").css({"height":pheight});


			jQuery('span#readmore').toggle(function()
			{
				jQuery("div.categoryexpand").animate({"height":fullheight}, {queue:false, duration:500});
				jQuery("div.categoryexpand p + p").fadeIn();
			},
			function()
			{
				jQuery("div.categoryexpand").animate({'height':pheight}, {queue:false, duration: 500});
				jQuery("div.categoryexpand p + p").fadeOut();
			});
		//}
	}


	// Featured Horizontal Products
	if(jQuery('#featured').length)
	{
		jQuery('#featured').jcarousel({
			auto: 2
		});
	}


	// Product Image Zoom
	if(jQuery('img.jqzoom').length)
	{
		jQuery("img.jqzoom").jqueryzoom(
		{
			xzoom: 585, //zooming div default width(default width value is 200)
			yzoom: 385, //zooming div default width(default height value is 200)
			offset: 10  //zooming div default offset(default offset value is 10)
			//position: "right" //zooming div position(default position value is "right")
		});
	}



	jQuery("#more-views ul li a").click(function()
	{
		
		var thethumbsrc = jQuery(this).attr('href');
		var thefullsrc	= jQuery(this).attr('rel');

		//alert(thehref);

		jQuery('#mainimage img').attr('src', thethumbsrc);

		jQuery('#mainimage img').attr('alt', thefullsrc);

		return false;

	});


	if(jQuery('div#idtabs').length)
	{
		jQuery("#idtabs ul").idTabs(); 
	}


});
