//MUESTRA Y OCULTA INGRESO MAIL FEED BURNER
$(document).ready(function (){
	//valor inicial campo email
	$('#mailFeedBurner').attr("value", "Tu email");
	
	//borrando valor
	$('#mailFeedBurner').focus(function(){
		if ($('#mailFeedBurner')[0].value == "Tu email") {
			$('#mailFeedBurner').attr("value", "");
		}
	});
	
	//reinicia valores iniciales
	$('#mailFeedBurner').blur(function(){
		if ($('#mailFeedBurner')[0].value == "") {
			$('#mailFeedBurner').attr("value", "Tu email");
		}
	});
	
	//despliega/oculta caja
	$('.sigueSedal').click(function(){
		$("#feedBurnerBox").slideToggle();
			$('.feedMain p').removeClass("texoError");
			$('.feedMain p').html('Suscr\xEDbete y recibe por email las \xFAltimas novedades y promociones de Sedal Chile.');
	});
	$('.btnCerrar').click(function(){
		$("#feedBurnerBox").fadeOut();
		$('.feedMain p').removeClass("texoError");
		$('.feedMain p').html('Suscr\xEDbete y recibe por email las \xFAltimas novedades y promociones de Sedal Chile.');
		$('#input-feedburner').val('Tu email');
	});
});

//VALIDA FEEDBURNER
$(document).ready(function(){
	//$('#input-feedburner').attr('autocomplete', 'off');
	$('#input-feedburner').focus(function(){
		var valorInicialMail = $('#input-feedburner').val();
		if(valorInicialMail == "Tu email"){
			$('#input-feedburner').val('');
		}
	});
	$('#feedburner').attr('name', 'feedburner');
	$('#feedburner').attr('target', '_blank');
	$('.submitFeedBurner').click(function(){
		if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test($('input[name=email]').val())) {
			document.forms[0].submit();
			setTimeout(function(){
				$('#feedBurnerBox').fadeOut();
				$('#input-feedburner').val('Tu email');
			},1000);
		} else {
			$('.feedMain p').addClass("texoError");
			$('.feedMain p').html('Ingrese una direcci\xF3n de correo v\xE1lida.');
		}
	});
	/*$('#feedBurnerBox').mouseenter(function(){
		$('#feedBurnerBox').show();
	}).mouseleave(function(){
		$('#feedBurnerBox').fadeOut();
	});*/
});

//VALIDA BUSQUEDA
$(document).ready(function(){
	$('#formBusqueda').attr('name', 'searchForm');
	$('#s').focus(function(){
		var busqueda = document.getElementById('s').value;
		if(busqueda == "Ingresa tu b\xFAsqueda"){
			$('#s').attr("value", "")
			$('.btnBuscar').attr("href" , "javascript:;");
		}
	});
	//accion boton
	$('#searchsubmit').click(function(){
		var busqueda = document.getElementById('s').value;
		if(busqueda == "" || busqueda == "Ingresa tu b\xFAsqueda"){
			$('#s').attr("value", "Ingresa tu b\xFAsqueda")
			$('.btnBuscar').attr("href" , "javascript:;");
		}else{
			document.forms[1].submit();
		}
	});
});

//fix ie6 para enlace del logo
$(document).ready(function(){
	var enlaceHome = $("#menu .logo")[0].href;
	$("#menu h1").click(function(){
		window.location = enlaceHome;
	});
});

//EFECTO HOVER SOBRE MENU
$(document).ready(function(){
	$('.liBlog a').blend();
	$('.liProductos a').blend();
	$('.liPromociones a').blend();
	$('.liConsejos a').blend();
	$('.liHome a').blend();
});

$(document).ready(function(){
	var over = new Array();
	var over = $('.jsblend');
	jQuery.each( over, function(i){
		over[i].style.backgroundPosition = "50% -40px";
	});
});

