		
function formatNumber(num,dec) {
	num = isNaN(num) || num === '' || num === null ? 0.00 : num;
	return parseFloat(num).toFixed(dec);
}



function redirectPage(url) {
	window.location = url;
}
	
	
	
	
	
	
	
$(document).ready(function() {	


	// pour initier le script imageZoom
	// ----------------------------------------------------------------------------------------------------------------------------------------------------------------
	//$(document.body).imageZoom();


	
	// pour initier le script CSS Globe image preview
	// ----------------------------------------------------------------------------------------------------------------------------------------------------------------
	imagePreview();


	
	// pour changer le bg du TR
	// ----------------------------------------------------------------------------------------------------------------------------------------------------------------		
	$("tr.tr_link").hover(function(e){
		$(this).find("td").addClass("td_hover");				
    },
	function(){
		$(this).find("td").removeClass("td_hover");	
	});	


	
	// pour linker on click tu TR
	// ----------------------------------------------------------------------------------------------------------------------------------------------------------------		
	$("tr.tr_link").click(function(e){
		var href = $(this).find("a.productLink").attr("href");
        if(href && href != 'undefined') {
            window.location.href = href;
        }	
    });	





	// pour baisser les checkbox
	// ----------------------------------------------------------------------------------------------------------------------------------------------------------------
	$('input[type=checkbox]').css({
		'top':'3px',
		'width':'14px',
		'height':'14px',
		'position':'relative'
	});





	// standard pour les input text
	// ----------------------------------------------------------------------------------------------------------------------------------------------------------------
	$('input[type=text], input[type=password]').addClass('standard_input');
	$('select').addClass('standard_select');
	$('textarea').addClass('standard_textarea');





	// standard pour les input text
	// ----------------------------------------------------------------------------------------------------------------------------------------------------------------
	$('input[type=file]').css({
		'margin':'2px'
	});




	// pour enlever le border-bottom du dernier TR d'une TABLE .removelastborder
	// ----------------------------------------------------------------------------------------------------------------------------------------------------------------	
	$("table.removelastborder").find("tr:last-child").prev().find("td").css("border", "0");
	
	
	
	

});
