$(document).ready(function(){
var heightf = $(".footer").height();
$(".footer").height('22');
  $(".crop-img").each(function(){
				  img = $(this).attr("src");
				  alt = $(this).attr("alt");
				  h = $(this).attr("height");
				  w = $(this).attr("width");
				  alg = $(this).attr("align");
				  //alert(img);
				  $(this).attr("src", "/templates/mk1/images/space.gif");
				  $(this).css("background-image", "url("+img+")");
				  if (alg == "top") {
				  	$(this).css("backgroundPosition", "top center");
				  }else if (alg == "left") {
					$(this).css("backgroundPosition", "left top");
				  }else if (alg == "right") {
					$(this).css("backgroundPosition", "right top");
				  }else {
				  	$(this).css("backgroundPosition", "center center");
				  }
				  $(this).css("background-repeat", "no-repeat");
		});
		
	    $("a[rel='galeria']").colorbox({
        maxWidth:'800px',
        maxHeight:'600px'
        
        });
		$('input').focus(function(){ 
		var valor = this.value;
		var padrao = this.lang;
		if(valor==padrao){
			$(this).val("");
		}
	
	});
	$('input').blur(function(){
		var valor = this.value;
		var padrao = this.lang;
		if(valor==""){
			$(this).val(padrao);
		}
	});
	$('textarea').focus(function(){ 
		var valor = this.value;
		var padrao = this.lang;
		if(valor==padrao){
			$(this).val("");
		}
	
	});
	$('textarea').blur(function(){ 
		var valor = this.value;
		var padrao = this.lang;
		if(valor==""){
			$(this).val(padrao);
		}
	
	});
	$("#buscar_produto").click(function() {
		var valor = $("#busca").val();
		if(valor!="" && valor!="Localize seu produto aqui") {
			window.location = "/produtos/busca/"+valor;
		}
	});
	$('#direction-fade-slider').aviaSlider({
			blockSize: {height: 3, width:'full'},
			display: 'topleft',
			transition: 'fade',
			betweenBlockDelay:10,
			animationSpeed: 400,
			switchMovement: true
		});
		
		$('#direction-fade-slider').css('display', 'block');
		

	
});


