$(document).ready(function(){ 
	//escondemos los li que sobran del cambio de idioma
	$(".mod_changelanguage li:eq(1)").hide();
	$(".mod_changelanguage li:eq(2)").hide();
	$(".mod_changelanguage li:eq(3)").hide();

	/*var imgWidth = [];
	var imgHeight = [];
	var aux = 0;
	$(".rollover div a").each(function(){
		imgWidth.push($(this).width());
		aux = $(this).height();
		
		if($.browser.mozilla)
			aux = aux-5;

		imgHeight.push(aux);
	});
	
	alert(imgHeight);*/
	
	$(document).pngFix();

	var imgSrc = "";
	
	$(".rollover div a").each(function(i) {
	
		imgSrc = $(this).children("img").attr("src");
		$(this).children("img").hide();
		$(this).css("background", "url("+imgSrc+") no-repeat");
		$(this).css("float", "left");
		
		$(this).mouseover(function () {
			$(this).css("background-position", "0 100%");
		});
		$(this).mouseout(function () {
		  $(this).css("background-position", "0 0");
		});
	});
	
	
	$(".rollover").show();
	
	$(".corner").corner("7px");
	
	$(".accordion").accordion({ active: false });
});

jQuery(function( $ ){
		$.preload("img.clientRollover", {
		find:'.jpg',
		replace:'_r.jpg'
	});

	$("img.clientRollover").hover(function(){
		this.src = this.src.replace('.jpg','_r.jpg');
	},function(){
		this.src = this.src.replace('_r','');
	});
});

function show(headerBtn, section) {
	$(".reasonsContent:visible").hide();
	$("#reasons .active").removeClass("active");
	headerBtn.parent().addClass("active");
	section.show();
	$('.reasonsContent').corner('bottom');
}

function initMagentoTabs() {
	show($("#reasons .passion a"), $('.reasonsContent:eq(0)'));
	$(".reasonsHeader a").each(function() {
		$(this).bind("mouseenter", function() {
			var i = $(".reasonsHeader a").index(this);
			show($(this), $('.reasonsContent:eq('+i+')'));
		});
	});
} 