// JavaScript Document
$(document).ready(function(){
	
	//PINTAR EL MENU SELCCIONADO
	$("#m1").addClass("selected");
		
	//SLIDER VISOR
	$('#slider').nivoSlider({
		effect			:	'random',
		controlNav		:	true,
		animSpeed		:	600,
		pauseTime		:	3000,
	});
	
	//SLIDER PORTAFOLIO
	$('#sliderpor').bxSlider({
		displaySlideQty	: 	3,
		auto			:	true,
		controls		:	true,
		autoHover		:	true,
		speed			:	500,
		prevImage		:	'image/img-btn-prev-1.png',
		nextImage		:	'image/img-btn-next-1.png',			
		prevSelector	:	'#prevS',
		nextSelector	:	'#nextS',
		easing			:	'easeOutBounce'
	})
	
	//FOOTER
	$("#tnom").val("Ingrese su nombre");
	$("#tmail").val("Ingrese su e-mail");
	$("#tmsj").val("Ingrese su mensaje");
	
	$("#tnom").click(function(){
		$(this).val("")
		//$("#texto").val("Ingrese su mensaje");
	})
	$("#tmail").click(function(){
		$(this).val("")
		//$("#texto").val("Ingrese su mensaje");
	})
	$("#tmsj").click(function(){
		$(this).val("")
		//$("#mail").val("Ingrese su mail");
	})
	
	//CONSULTAS RAPIDAS
	$("#btnEnviar").click(function(){
		$.post("setContact.php",{
			"tnom": $("#tnom").val(),
			"tmail": $("#tmail").val(),
			"tmsj": $("#tmsj").val()
		},
		function(data){
			if(data == "Ok"){
				var url = "contactenos/gracias.php?nom=" + $("#tnom").val();
				$(location).attr('href',url);
			}
		})
	})
	
	
	//ANIMACIONES ACCESOS DIRECTOS
	$("#imgw").mouseover(function(){
		$(this).attr('src','image/img-diseno-web-index-2.jpg');
	})
	$("#imgw").mouseout(function(){
		$(this).attr('src','image/img-diseno-web-index.jpg');
	})	
	
	$("#imgg").mouseover(function(){
		$(this).attr('src','image/img-diseno-grafico-index-2.jpg');
	})
	$("#imgg").mouseout(function(){
		$(this).attr('src','image/img-diseno-grafico-index.jpg');
	})	
	
	$("#imge").mouseover(function(){
		$(this).attr('src','image/img-e-marketing-index-2.jpg');
	})
	$("#imge").mouseout(function(){
		$(this).attr('src','image/img-e-marketing-index.jpg');
	})	
	
	//ANIMANDO TEXTO SOPORETE
	//$("#contenido").hide()
	$("#contenido").fadeTo(100,0)
	
	$("#mostrar").click(function(){
		//$("#contenido").slideToggle(1000)
		$("#contenido").fadeTo(300,0.9)
	})
	
	$("#cerr").click(function(){
		$("#contenido").fadeTo(300,0)
	})
	
	

	$('#defaultReal').realperson(); 
 
	$('#removeReal').toggle(function() { 
        $(this).text('Re-attach'); 
        $('#defaultReal').realperson('destroy'); 
    }, 
    function() { 
        $(this).text('Remove'); 
        $('#defaultReal').realperson(); 
    });
	
})
