$(document).ready(function(){
	if($("#languages").length){
		$("#languages").hover(
		  function () {
			  if(window.willhide) clearTimeout(window.willhide);
			  $("#languages ul").show(500);
		  }, 
		  function () {
			  window.willhide = setTimeout(function() {
		     $("#languages ul").hide(500);
		  },2000)
		  }
		);
        }
	
	
	$("#fastSearch form").submit(function(e){
		if($('#fastSearch-nome').attr("placeholder")===$('#fastSearch-nome').val()){
			e.preventDefault();
			$('#fastSearch-nome').addClass('error');
		}
		
	});
	
	$('input[type="text"]').each(function() {
		var default_value = this.value;
		$(this).attr("placeholder",default_value);
		$(this).focus(function() {
			$(this).removeClass('error');
			$(this).addClass('filled');
			if(this.value == default_value) {
				this.value = '';
			}
		});
		$(this).blur(function() {
			if(this.value == '') {
				$(this).removeClass('filled');
				this.value = default_value;
			}
		});
	});
	
	
	
	$('<param name="wmode" value="transparent"></param>').insertBefore('embed'); 
	$('embed').attr('wmode','transparent'); 
	
	 $('#techBtn').colorbox({'transition':'fade', 'speed':500, 'width':680, 'height':500, iframe:true,
					onOpen:function(){ $('#topBanners iframe').hide();$('object').hide(); },
					onClosed:function(){ $('#topBanners iframe').show();$('object').show(); }
					});
	 $('#orderBtn, .colorbox').colorbox({'transition':'fade', 'speed':500, 'width':470, 'height':485, iframe:true,
					onOpen:function(){ $('#topBanners iframe').hide();$('object').hide(); },
					onClosed:function(){ $('#topBanners iframe').show();$('object').show(); }
					});
	
});













