$(document).ready(function(){
		  //$("div:odd").css("background-color", "#CCC");
		  //$("div:even").css("background-color", "#666");
		  $(".vAlign").vAlign('p');//vertical align
		  $(".b1").border('1px solid #000');
		  $(".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", "/tpl/default/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");
				  //$(this).append('<img src="/tpl/default/images/space.gif" alt="'+alt+'" border="0"  width="'+w+'" height="'+h+'" style="background:url('+img+') center center no-repeat"  />');
			});
		//$('a[href^="http://"]')	.attr({ target: "_blank" });
		function smartColumns() {
			$("ul.column").css({ 'width' : "100%"});
			var colWrap = $("ul.column").width();
			var colNum = Math.floor(colWrap / 170);
			var colFixed = Math.floor(colWrap / colNum);
			$("ul.column").css({ 'width' : colWrap});
			$("ul.column li").css({ 'width' : colFixed});
			}	
		
		smartColumns();	
		
		$(window).resize(function () {
			smartColumns();
		});
		$("a[rel='galeria']").colorbox({slideshow:true});
		$("a[rel='lineas']").colorbox();
		$(".mapa").colorbox({width:"800", height:"600", iframe:true, scrolling:false, href:"http://maps.google.com.br/maps/ms?hl=pt-BR&amp;ie=UTF8&amp;msa=0&amp;msid=107543957322627813210.00048af697e337fede0cd&amp;t=h&amp;ll=-25.509427,-54.60763&amp;spn=0.003873,0.007499&amp;z=17&amp;iwloc=00048af69b9076a2e0d5a&amp;output=embed"});
});
//form buscar********************************************************
function buscar(){
	var valor = $("#busca").val();
	if (valor == '' | valor == 'Buscar' | valor == 'Buscar'){
		document.getElementById('busca').value = 'Buscar';
	}else{
		window.location = "/productos/busca/"+valor;
	}
}
function buscahover(){
	var valor = $("#busca").val();
	if (valor == 'Buscar'){
		document.getElementById('busca').value = '';
	}
}
function bloqEnter(objEvent) {
	var iKeyCode;
	iKeyCode = objEvent.keyCode;
	if(iKeyCode == 13) return false;
	return true;
}
//fim form buscar*****************************************************
