/* Author: 
	end // esteban.ortegafernandez@gmail.com
*/







$(document).ready(
	function (){
		 $('a[href*=#]').bind('click', function(e) {
				        e.preventDefault(); //prevent the "normal" behaviour which would be a "hard" jump
				
				        var target = $(this).attr("href"); //Get the target
						
						 
						if(target == "#agencia"){
						//$('body').css( "background-color", "#FFF");
						 
						 
						// movimiento a la categoria siguiente
				        $('#super_container').stop().animate({ scrollTop: 0,scrollLeft: 1300 }, 2000, function() { //1100
				             location.hash = target;  //attach the hash (#jumptarget) to the pageurl
				         	    
				        });
				        
						}
						else if(target =="#objetivos"){
							$('#super_container').stop().animate({ scrollTop: 0,scrollLeft: 2595 }, 2000, function() {
				             location.hash = target;  //attach the hash (#jumptarget) to the pageurl
				           
				       		 });
						}
						else if(target =="#metodo"){
							 $('#super_container').stop().animate({ scrollTop: 0,scrollLeft: 3897 }, 2000, function() {
					             location.hash = target;  //attach the hash (#jumptarget) to the pageurl
					             
					       		}); 
						}
						else if(target =="#servicios"){
							$('#super_container').stop().animate({ scrollTop: 0,scrollLeft: 5199 }, 2000, function() {
					             location.hash = target;  //attach the hash (#jumptarget) to the pageurl
					             
					       		}); 
						}
						else if(target =="#clientes"){
							$('#super_container').stop().animate({ scrollTop: 0,scrollLeft: 6498 }, 2000, function() {
					             location.hash = target;  //attach the hash (#jumptarget) to the pageurl
					             
					       		});
						}
						else if(target =="#portafolio"){}
						else if(target =="#contacto"){
							$('#super_container').stop().animate({ scrollTop: 0,scrollLeft: 7798 }, 2000, function() {
					             location.hash = target;  //attach the hash (#jumptarget) to the pageurl
					             
					       		});
						}
						else if(target =="#homeefecto"){
							
							//going home #homeefecto								
					        $('#super_container').stop().animate({ scrollTop: 0,scrollLeft: 0 }, 2000, function() {
					             location.hash = target;  //attach the hash (#jumptarget) to the pageurl
					             
					        });
						}
						
				        
						
				        return false;
				   });
				   
				   
				   $('#contacto_btn_enviar').click( function () {
				   	$.ajax({
					      url: "mailform.php",
					      global: false,
					      type: "POST",
					      data: ({telefonoContacto : $('#asunto_forma').attr('value'),
		      							emailContacto : $('#email_forma').attr('value'),
		      								mensaje : $('#txtarea_form').attr('value')}),
		      				dataType: "html",
		      				async: true,
		      				success: function(msg){
		         				if(msg == "true"){
		         					$('#form_contacto').empty();
		         					$('#form_contacto').html("<div><p style='font-family:"+'"AdobeGaramondProRegular"'+";color:#FFF;font-size:30px;text-shadow:1px 1px 1px rgba(0,0,0,0.01);'><br /><br />Nos contactaremos<br /> a la brevedad :)!</p></div>");
		         					$('#contacto_btn_enviar').hide("fast"); 
		         					
		         				}else{
		         					
		         					alert("Ooh! Un error ha ocurrido, no dejes campos vacios!");
		         					
		         				}
		      				}
		   				}
					).responseText;
		   						
				   });
	}
);




$(document).ready( function (){
	$('#social_twitter').click( function () {
		window.open( "http://twitter.com/efecto_creativo ");
	});
	$('#social_facebook').click( function () {
		window.open( "http://es-es.facebook.com/pages/Efecto-Creativo-Ltda/82981503868 ");
	});
	//$('#home_aves').delay(200).animate({opacity: 1,marginTop:"46px"},"slow");
	
	/*$('#home_aves').hover( function (){
		$(this).stop().animate({marginTop:"40px"},"fast");
	}, function () {
		$(this).stop().animate({marginTop:"46px"},"fast");
	});*/

	
	
			
});











