jQuery(document).ready(function() {
	/*******************************************************************************/
	var philo = new Object();
	philo.espotContainer = "#xsell_body";
	philo.espotSelector = ".espot_item";
	philo.numToDisplay = 4;
	
	philo.prevPosition = jQuery(philo.espotContainer).find(philo.espotSelector + ":last").css("position");
	philo.prevLeft = jQuery(philo.espotContainer).find(philo.espotSelector + ":last").css("left");
	
	if(jQuery(philo.espotContainer).find(philo.espotSelector).length > philo.numToDisplay){
	jQuery(philo.espotContainer).find(philo.espotSelector).each(function(i) {
		if(i>=philo.numToDisplay){
			jQuery(this).css("position", "absolute").css("left", "-9999px");	// position the extra espots off screen
		}
	});
	jQuery(philo.espotContainer)
		.append("<a class='displayToggle' style='display:block; margin:3px 0 20px 6px; text-align: center;' href='#none'>see more related products</a>");		// create the toggle link
	jQuery(".displayToggle").toggle(function() {
		jQuery(philo.espotContainer).find(philo.espotSelector).each(function(i) {
			if(i>=philo.numToDisplay){
				jQuery(this).css("position", philo.prevPosition).css("left", philo.prevLeft);	// position the extra espots off screen
			}
		});
		jQuery(this).text("see fewer related products");	// update the toggle link text
	}, function() {
		jQuery(philo.espotContainer).find(philo.espotSelector).each(function(i) {
			if(i>=philo.numToDisplay){
				jQuery(this).css("position", "absolute").css("left", "-9999px");	// position the extra espots off screen
			}
		});
		jQuery(this).text("see more related products");		// update the toggle link text
	});
	}
	
	/*******************************************************************************/
	
	
	
	/*******************************************************************************/
	if(jQuery(".product_details_right p:first").height() > 42) {
		jQuery(".product_details_right p:first").height("42px").css("overflow", "hidden").css("padding-bottom", "0")
			.after("<a style=' background:#fff; position:relative; padding: 0;' href='#none'>read more</a>");
		jQuery(".product_details_right a:first").toggle(function() {
			jQuery(".product_details_right p:first").height("auto");
			jQuery(this).text("read less");
		}, function() {
			jQuery(".product_details_right p:first").height("42px");
			jQuery(this).text("read more");
		});
	}
	/*******************************************************************************/
});