$(document).ready(function(){

	if ($.browser.msie && parseInt($.browser.version.substr(0, 1)) < 7) {
		$('.centro_centro_img_mascara').each(function(){
			var bg = $(this).css("backgroundImage");
			bg.match(/^url[("']+(.*\.png)[)"']+$/i);
			bg = RegExp.$1;
			$(this).css("filter", "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + bg + "', sizingMethod='crop')").css("backgroundImage", "none");
		});
		$('.centro_centro_index_img_mascara').each(function(){
			var bg = $(this).css("backgroundImage");
			bg.match(/^url[("']+(.*\.png)[)"']+$/i);
			bg = RegExp.$1;
			$(this).css("filter", "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + bg + "', sizingMethod='crop')").css("backgroundImage", "none");
		});
		$('.centro_centro_index2_img_mascara').each(function(){
			var bg = $(this).css("backgroundImage");
			bg.match(/^url[("']+(.*\.png)[)"']+$/i);
			bg = RegExp.$1;
			$(this).css("filter", "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + bg + "', sizingMethod='crop')").css("backgroundImage", "none");
		});
		$('.centro_abajo_img').each(function(){
			var bg = $(this).css("backgroundImage");
			bg.match(/^url[("']+(.*\.png)[)"']+$/i);
			bg = RegExp.$1;
			$(this).css("filter", "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + bg + "', sizingMethod='crop')").css("backgroundImage", "none");
		});
	}

	$(".menu li a").mouseenter(function() {
		if($(this).attr("class")!="menu_activo") {
			$(this).stop().animate({ backgroundPosition: "(0px -48px)" });
		}
	}).mouseout(function() {
		if($(this).attr("class")!="menu_activo") {
			$(this).stop().animate({ backgroundPosition: "(0px 0px)" });
		}
	});

	$(".imagen_index").mouseenter(function() {
		$(this).parent().find("div").fadeIn();
	}).mouseout(function() {
		$(this).parent().find("div").fadeOut();
	});

	$('#banner').coinslider({
		width: 580,
		height: 110,
		spw: 5,
		sph: 3,
		delay: 2000,
		sDelay: 10,
		opacity: 1,
		titleSpeed: 3000,
		effect: 'rain',
		navigation: false,
		links : false,
		hoverPause: false
	});
	
	function texto_rojo() {
		setTimeout(function() { $(".texto_index").css("color","#330000"); }, 250);
		setTimeout(function() { $(".texto_index").css("color","#660000"); }, 500);
		setTimeout(function() { $(".texto_index").css("color","#990000"); }, 750);
		setTimeout(function() { $(".texto_index").css("color","#cc0000"); }, 1000);
		setTimeout(function() { $(".texto_index").css("color","#ff0000"); }, 1250);
		setTimeout(function() { texto_negro() }, 1250);
	}
	
	function texto_negro() {
		setTimeout(function() { $(".texto_index").css("color","#cc0000"); }, 250);
		setTimeout(function() { $(".texto_index").css("color","#990000"); }, 500);
		setTimeout(function() { $(".texto_index").css("color","#660000"); }, 750);
		setTimeout(function() { $(".texto_index").css("color","#330000"); }, 1000);
		setTimeout(function() { $(".texto_index").css("color","#000000"); }, 1250);
		setTimeout(function() { texto_rojo() }, 1250);
	}
	
	texto_rojo();

});
