function ledPrint(index, timeunit,number) {
	
	var digit1 = number % 10;

	number = Math.floor(number/10);
	var digit2 =  number % 10;

	var text = digit2.toString() + digit1.toString() + '';
	if (number > 10) text = '1' + text;
	
		jQuery('.book-counter:eq(' + index + ') .' + timeunit).text(text);
}

jQuery(function() {
	
	jQuery('img.book-feature').each(function(index) {
		var a = '<a href="/book' +(1+index) + '" />';
		jQuery(this).wrap(a);
			
	});
	
	if (jQuery('div.gallery').length > 0) {
		if (jQuery.browser.msie) {
		document.oncontextmenu=new Function('if (event.srcElement.tagName=="IMG") return false;');
			
		}	else {
		
			var protected = jQuery('.gallery img, .gallery a, .boxplus-viewer img');
			protected.live('mousedown contextmenu',function(evt) {
				if (evt.which == 3) {
					evt.preventDefault();
					evt.stopPropagation();
					return false;
				}
				} );
			}
	}
	
	if (jQuery('#video-author').length)
	jwplayer("video-author").setup(
		{ flashplayer: "custom/jwplayer/player.swf",
		file:'images/stories/videos/about-author.xml',
		 playlist: "left", playlistsize: 400,
		 height: 400, width: 900,
		 skin: 'custom/jwplayer/skins/glow-bigpl.zip'
		  }); 

	if (jQuery('#video-gallery').length)
		jwplayer("video-gallery").setup(
		{ flashplayer: "custom/jwplayer/player.swf",
		file:'images/stories/videos/goldhouse.xml',
		 playlist: "left", playlistsize: 300,
		 height: 400, width: 910,
		 skin: 'custom/jwplayer/skins/glow.zip'
		  }); 

		

	jQuery('.browsePriceContainer').hide();
	jQuery('.browseAddToCartContainer2').hide();
	/*jQuery('.browseProductContainer:lt(3)').append('<div class="book-counter ebook">'
	+ '<h4>Release Dates for Ebook</h4>'
		+ '<p><span class="days"></span> days <span class="hours"></span> hours '
		+ '<span class="mins"></span> mins <span class="secs"></span> secs</p>'		);
			jQuery('.browseProductContainer:lt(3)').append('<div class="book-counter hardcover">'
	+ '<h4>Release Dates for Hardcover</h4>'
		+ '<p><span class="days"></span> days <span class="hours"></span> hours '
		+ '<span class="mins"></span> mins <span class="secs"></span> secs</p>'		); */
		
			jQuery('.browseProductContainer').append('<div class="book-counter ebook">'
	+ '<h4>Release Dates for Ebook</h4><p>To Be Announced</p></div>'		);
	jQuery('.browseProductContainer').append('<div class="book-counter hardcover">'
	+ '<h4>Release Dates for Hardcover</h4><p>To Be Announced</p></div>'		);	
		jQuery('div.book-counter:first h4').remove();
	jQuery('div.book-counter:first p').html('<p style="line-height: 60px; margin-top: 20px"><a href="http://www.lulu.com/commerce/index.php?fBuyContent=11024306"><img src="http://static.lulu.com/images/services/buy_now_buttons/us/gray.gif?20110908141923" border="0" title="Buy this e-book on Lulu" alt="Support independent publishing: Buy this e-book on Lulu."></a></p>');

	jQuery('h3.browseProductTitle a').contents().unwrap().parent().css('color','#21BDDF');//attr('href','javascript:void(0)');

});


window.addEvent('domready', function() {
});



