
		
			function contact(){
				var form = $("#contact-form input, #contact-form textarea");
				var nombre = $(form[0]);
				var email = $(form[1]);
				var consulta = $(form[3]);
				if(!nombre.val())
					return focusField(nombre);
				if(!email.val())
					return focusField(email);
				if(!consulta.val())
					return focusField(consulta);
				$.ajax({
					type: "POST",
					url: "controller.php",
					data: "do=contact&nombre="+nombre.val()+"&email="+email.val()+"&consulta="+consulta.val()+"&",
					success: function(xml){
						xml = $.trim(xml);
						if(xml == 0){
							alert("Lo sentimos, hubo un problema al enviar el formulario.");
						}else if(xml == 1){
							alert("Gracias por contactarse con nosotros");
							top.location = "/contacto-ok";
							nombre.val("");
							email.val("");
							consulta.val("");
						}
					}
				});
			}
			
			function post(){
				var form = $("#testimonio .box");
				var post_title = $(form[0]);
				var post_content = $(form[1]);
				if(!post_title.val())
					return focusField(post_title);
				if(!post_content.val())
					return focusField(post_content);
				$.ajax({
					type: "POST",
					url: "/controller.php",
					data: "do=post&post_title="+post_title.val()+"&post_content="+post_content.val(),
					success: function(xml){
						xml = $.trim(xml);
						if(xml == 0){
							alert("Lo sentimos, hubo un problema al intentar guardar su testimonio.");
						}else if(xml == 1){
							$("#testimonio").html("<b>Muchas gracias, hemos recibido su testimonio correctamente. El mismo estar&aacute; visible en cuanto sea revisado.</b>");
							/*alert("Su testimonio se ha guardado correctamente");
							post_title.val("");
							post_content.val("");*/
						}
					}
				});
			}


			$.fn.extend({
				opacity : function(value) {
					$(this)
						.css("opacity", value)
						.css("-moz-opacity", value)
						.css("filter", "alpha(opacity = " + (value * 100) + ")")
						.css("zoom", "1"); // ie7
				}
			});
			
			function openBox(obj){
				$("div.button").hide();
				//$("div.button").fadeOut("fast", function(){
					$("#full div.content").hide();
					$("#" + $(obj).attr("class")).show();	
					$("#full").show();
				//});
			}
			
			function closeBox(){
				$("#full").hide();
				//$("#full").fadeOut("fast", function(){
					$("div.button").show();
				//});
			}
			
			function hvr(obj){
				/*$(obj).unbind('mouseout');
				$(obj).mouseover(function(){
					$("div#content div.adv a").opacity(0.7);
					$(this).opacity(1);
				}).mouseout(function(){
					$("div#content div.adv a").opacity(1);
				});*/
			}
			
			function focusField(obj){
				obj.addClass("shine");
				setTimeout(function(){obj.removeClass("shine");}, 2000);	
				obj.get(0).focus();
				return false;
			}
			
			
			
