$(document).ready(function() {
    
	//Comments cycle plugin
	$('#comments ul').cycle({
		fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
	});
	
	// Product Scrollbox
	$("#product-scrollbox").smoothDivScroll({ 
		autoScroll: "always", 
		autoScrollDirection: "endlessloopright", 
		autoScrollStep: 1, 
		autoScrollInterval: 40
	});

	$("#product-scrollbox").bind("mouseover", function() {
		$(this).smoothDivScroll("stopAutoScroll");
	}).bind("mouseout", function() {
		$(this).smoothDivScroll("startAutoScroll");
	});
	
	// Partners
	$("#partners").smoothDivScroll({ 
		autoScroll: "always", 
		autoScrollDirection: "endlessloopleft", 
		autoScrollStep: 1, 
		autoScrollInterval: 25 
	});
	
	$("#partners").bind("mouseover", function() {
		$(this).smoothDivScroll("stopAutoScroll");
	}).bind("mouseout", function() {
		$(this).smoothDivScroll("startAutoScroll");
	});


	
});

function mycarousel_initCallback(carousel)
{
    // Disable autoscrolling if the user clicks the prev or next button.
    carousel.buttonNext.bind('click', function() {
        carousel.startAuto(0);
    });

    carousel.buttonPrev.bind('click', function() {
        carousel.startAuto(0);
    });

    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
};


// Rounded Corner Effects
DD_roundies.addRule('#mainbody', "9px", true);
DD_roundies.addRule('#sidebar .categories', "9px", true);
DD_roundies.addRule('#product-scrollbox', "9px", true);


//Cufon Setup
Cufon.replace('#cart strong', { fontFamily: 'Eurostile' });
Cufon.replace('#cart a.view-cart-btn', { fontFamily: 'Eurostile' });
Cufon.replace('#header .contact .phone, #header .contact .email', { fontFamily: 'Eurostile' });
Cufon.replace('#sidebar .categories h3', { fontFamily: 'Eurostile' });
Cufon.replace('#content h1', { fontFamily: 'Eurostile' });
Cufon.replace('#content h2', { fontFamily: 'Eurostile' });
Cufon.replace('#contentwide h1', { fontFamily: 'Eurostile' });

//Search text
function clearText(srcObj){ if(srcObj.title == srcObj.value) srcObj.value = ""; }
function writeText(srcObj){ if(srcObj.value == "") srcObj.value = srcObj.title; }
