$(document).ready(function(){ 
	$("#menu table td").hover(
	  function() { 
		  $(this).addClass("menuOver"); 
	  }, 
	  function() { 
		  $(this).removeClass("menuOver"); 
	  }
	);
	$(".op_subcat").hover(
	  function() { 
		  $(this).css("background-color","#ebebeb"); 
	  }, 
	  function() { 
		  $(this).css("background-color","#fff"); 
	  }
	);
	$('.op_subcat').hide(0);
	$('.op_subcat',$(".selCat").closest(".op_cat")).show(0);
	/*
	$(".valueCat").hover(
		function() { 
		$('.op_subcat').hide(500);
		$('.op_subcat',$(this).closest(".op_cat")).show(500);

		}, 
		function() { 

		}
	});*/
	$(".swf").fancybox({
		'padding'           : 0,
		'width'           	: 1000,
		'height'    		: 662,		
		'autoScale'     	: false,
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe',
		'onStart'			: function(){$('embed, object, select').css('visibility', 'hidden');},
		'onClosed'			: function(){$('embed, object, select').css('visibility', 'visible');}
	});
	$(".descarga-pinta").fancybox({
		'padding'           : 0,
		'width'           	: 776,
		'height'    		: 565,		
		'autoScale'     	: false,
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe',
		'onStart'			: function(){$('embed, object, select').css('visibility', 'hidden');},
		'onClosed'			: function(){$('embed, object, select').css('visibility', 'visible');}
	});
	$(".pintaPinta").fancybox({
		'padding'           : 0,
		'width'           	: 1060,
		'height'    		: 810,		
		'autoScale'     	: false,
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe',
		'onStart'			: function(){$('embed, object, select').css('visibility', 'hidden');$("#fancybox-close").css("right","-25px");$("#fancybox-close").css("top","-25px");},
		'onClosed'			: function(){$('embed, object, select').css('visibility', 'visible');}
	});
});

function resetForm(){
	$(".sValue").html("Elegir un área");
	$('#frm_contactenos :input').each(function() {
		$(this).val("");
	});
}
$(document).ready(function(){ 
	resetForm();
	$('body').click(function() {
		  $(".sOptions",this).slideUp("slow");
	 });				
	$(".styleSelect").click(function(event){
		if ($(".sOptions",this).is(":hidden")) {
		  $(".sOptions").slideUp("slow");
		  $(".sOptions",this).slideDown("slow");
		  event.stopPropagation();
		} else {
		  $(".sOptions",this).slideUp("slow");
		}						
	 });
	$("#sArea .sOption").click(function(event){
		$("#sArea .sValue").text($(this).text());
		$("#area").val($(this).text());
	});
	$("#frm_contactenos").validate();
});
