function surfDiv(id, request) {
	$.post("/datarequest/" + request, { }, function (html) {
		$("#" + id).html(html);
	});
}

$(document).ready(function() {
	setInterval(function() {
		$("#radioGlow").fadeIn(300, function() {
			$("#radioGlow").fadeOut(1400);
		});
	}, 2200);

	$(".radioGrid .item").hover(function() {
		$(".desc", this).fadeIn(200);
	}, function() {
		$(".desc", this).fadeOut(400);
	});
	$(".desc").hover (function() {
		$(this).fadeOut(400);
	}, function() {
	});

	
	$(".radioGrid .micro").hover(function() {
		$(".desc", this).fadeIn(200);
		$(".rTitle", this).fadeIn(200);
	}, function() {
		$(".desc", this).fadeOut(400);
		$(".rTitle", this).fadeOut(200);
	});
	
	$("#fEmpresa").submit(function() {
		$.ajax({
			type : "POST",
			url : "artise/admin/backend/business-ajax-add.php",
			dataType : "html",
			global : true,
			data : ({
				nombre : $("#tName").val(),
				localidad : $("#tLocation").val(),
				pais : $("#tCountry").val(),
				url : $("#tURL").val(),
				descripcion : $("#tDesc").val()
			}),
	
			success : function(resource) {
	
				//Informo sobre la accion
				if( resource == "1" ) {
					window.alert("Enviado Correctamente");
					$(".empresaForm").slideUp(400, function() {
						$("#fEmpresa :text, #tDesc").each(function(){
							$(this).val("");
						});
						$(".empresaForm").slideDown(400);
					});
					
				} else {
					//Alerto algo negativo
					window.alert(resource);
				}
				// Que te la haces escribiendo comentarios en castellano? xD
			}
		});
		
		return false;
	});
	
	$("#fContacto").submit(function() {
		$.ajax({
			type : "POST",
			url : "/artise/admin/backend/send-ajax-mail.php",
			dataType : "html",
			global : true,
			data : ({
				tName : $("#tName").val(),
				tEmail : $("#tEmail").val(),
				tPhone : $("#tPhone").val(),
				cTo : $("#cTo").val(),
				tMsg : $("#tMsg").val()
			}),
	
			success : function(resource) {
	
				//Informo sobre la accion
				if( resource == 1 ) {
					window.alert("Enviado Correctamente")
				} else if(resource == 0) {
					//Alerto algo negativo
					window.alert("Hay datos sin completar");
				} else if(resource == "fail") {
					window.alert("Error enviando correo. Intente nuevamente");
				}
			}
		});
		
		return false;
	});
});