$(document).ready(function(){ 	
			   
	if($(".Success").length > 0){
		var successStories = "<li>Success Stories</li>";
		$(".pagination").prepend(successStories);
	}	
		  // radius Box
	// $('.box_r').css({"border-radius": "5px", "-moz-border-radius":"5px", "-webkit-border-radius":"5px"});
		// end radius Box
	// wrap 'span' to nav page link
	/* $('.topnav ul').children('li').each(function() {
		$(this).children('a').html('<span>'+$(this).children('a').text()+'</span>'); // add tags span to a href
	}); */
	
	$('.product').each(function(){
		var type = $(this).find(".product-type").html();
		$(this).find(".product-type").remove();
		$('.product-details .product-link a').html('Buy this ' + type + ' now!').attr('target','_blank');
	});
	
	$('.product .product-price .product-price-value').each(function() {
	if($(this).html().length > 0){
		price = $(this).html();
		price = String(Number(price).toFixed(2));
		a_price = price.split('.');
		price_1 = a_price[0]
		price_2 = a_price.length > 1 ? '.' + a_price[1] : '';
		var rgx = /(\d+)(\d{3})/;
		while( rgx.test(price_1) ) {
		  price_1 = price_1.replace(rgx, '$1' + ',' + '$2');
		}
		if( (price_1 + price_2) != "0.00"){
			$(this).html(price_1 + price_2);
		}else{
			$(this).parents("div.product-wrapper").find("div.product-link a").html("Listen to an excerpt")
					.end().find("div.product-price").html("In Development");
		}
	}else{
		var parent = $(this).parents("div.product-wrapper");
		$(this).parents("div.product-price").remove();
		var link = $(parent).find("div.product-link a").attr("href");
		$(parent).find(".product-name a, .product-image a,").attr("href",link);
	}
  });
	
});	


