Cufon.replace('.light', { fontFamily: 'Archer Light', textShadow: '2px 2px #102941'});
Cufon.replace('.semibold', { fontFamily: 'Archer Semibold',textShadow: '2px 2px #102941'});
Cufon.replace('.bold', { fontFamily: 'Archer Bold',textShadow: '2px 2px #102941', hover: true});
Cufon.replace('.ibold', { fontFamily: 'Archer Bold Italic',textShadow: '2px 2px #102941'});
Cufon.replace('.boldns', { fontFamily: 'Archer Bold'});
Cufon.replace('#tel2', { fontFamily: 'Archer Bold',textShadow: '0px 1px #629AA9, 1px 0px #629AA9, -1px 0px #629AA9, 0px -1px #629AA9, 0px 1px #3D606E, 1px 0px #3D606E, -1px 0px#3D606E, 0px -1px #3D606E', hover: true});


$(function() {
	

	
	
	
	/*btn hover*/
		$('.contact').hover(
		function () { $('span',this).fadeIn();}, 
		function () { $('span',this).stop(true,true).fadeOut();
		});
		
	$('.btn-submit').hover(
		function () { $('span',this).fadeIn();}, 
		function () { $('span',this).stop(true,true).fadeOut();
		});
		
		
	$('.contact').click(function () {
		$.scrollTo( '#contactform', 1000, {easing: 'easeOutExpo'} );
	});	
	
	$('.about').click(function () {
		$.scrollTo( '#aboutus', 1000, {easing: 'easeOutExpo'} );
	});	
	
	$('.workbtn').click(function () {
		$.scrollTo( '#portfolio', 1000, {easing: 'easeOutExpo'} );
	});	
	/* btn hovers*/
	
	
	
	/*thumbnails*/
	  $('.img').hover(function () {
	  	$('span',this).css('background-position', '0 -10px');
		$('span',this).animate({backgroundPosition: '0 -30px', opacity: 1},500);
	},function () {
		 $('span',this).animate({backgroundPosition: '0 -50px', opacity: 0},500);
	});   
	/*thubmnails*/
	
	
	/* lightbox
	$('.img').click(function () {
	
	if (!$(this).hasClass('selected')){
		$(this).addClass('selected');
		
		
		offset = $(this).offset();
		top = offset.top - $(window).scrollTop();
		left = offset.left;
		
		$('#overlay em').css('left',offset.left).css('top', top).fadeIn(300);
		

		src = $(this).attr('rel');
		
		$('<img />')
			.css('opacity',0)
			.attr('src', src)
			.load(function(){
				$('#overlay em').html($(this));
				var h = $(this).attr('height');
				var w = $(this).attr('width');
				
				$('#overlay').stop(true,true).fadeIn();
				$('#overlay em').animate({width: w+'px', height: h+'px', top: '50%', marginTop: -h/2, left: '50%', marginLeft: -(w/2)-10}, 300, function () { $('img',this).animate({opacity:1}); });
				
				
   		});
		

		
	} else {//s que esta ampliado
		
		cerrar();
	
	}
	});
	
	
	$('#overlay').click(function () {
	 
		cerrar();
		
	});
	
	
	
	
	$(document).keypress(function (event) {
		if (event.keyCode==27){
	
		if ($('#overlay').css('display')=='block'){
			 cerrar();
		}
		
		$('#overlay2').fadeOut();
		
	
	}
	});
	
	
	function cerrar() {
		offset = $('.selected').offset();
		top = offset.top - $(window).scrollTop();
		
		$('#overlay em img').fadeOut(100, function() {
			$('#overlay em').animate({width: '320px', height: '200px', top: top, marginTop: 0, left:left, marginLeft:0}, 300);
			$('#overlay em').delay(300).fadeOut();
			$('.selected').removeClass('selected');
		});
		$('#overlay').delay(300).fadeOut();
	
	}
	ligtbox */
	
	
	
	
	
	/*brillo contacto 
	$("#contactform input, #contactform textarea").focus(
	function () {
		cant = 3;
		$(this).css("-webkit-box-shadow" , "0px 0px "+cant+"px "+ cant +"px #304A66"  );
		$(this).css("box-shadow" , "0px 0px "+cant+"px "+ cant+"px #304A66"  );
		$(this).css("-moz-box-shadow" , "0px 0px "+cant+"px "+cant+"px #304A66"  );
		});
	$("#contactform input, #contactform textarea").blur(
	function () {
		cant = 0;
		$(this).css("-webkit-box-shadow" , "0px 0px "+cant+"px "+ cant +"px #304A66"  );
		$(this).css("box-shadow" , "0px 0px "+cant+"px "+ cant+"px #304A66"  );
		$(this).css("-moz-box-shadow" , "0px 0px "+cant+"px "+cant+"px #304A66"  );
		});
	/*brillo contact*/
	
	
	
	/*contacto*/
/*remueve el valor por defecto d elos inputs*/
$("#contactform input, #contactform textarea").each(function () {	
	value = $(this).attr('title');
	$(this).data('value',value);
	});
$("#contactform input, #contactform textarea").focus(
	function () {
		valuestore = $(this).data('value');
		value = $(this).attr('value');
		if (value==valuestore) $(this).attr('value','');
		$(this).removeClass('error');
		});
$("#contactform input, #contactform textarea").blur(
	function () {
		valuestore = $(this).data('value');
		value = $(this).attr('value');
		if (value=='') $(this).attr('value',valuestore);
		});

/* remueve el valor por defecto d elos inputs*/


$(".btn-submit").click(function() {
	var error = 0;
	
	$('.errormsj').fadeOut(500, function () {$(this).remove()});
	
	$("#contactform .req").each(function () {	
		valuestore = $(this).data('value');
		value = $(this).attr('value');
		obj = $(this);
		
		//console.log( '>'+value+'-'+valuestore+'<');
		if (value === valuestore) {
			$(this).attr('style','');
			$(this).addClass('error');
			errorms = $(this).attr('alt');
			$(this).after('<div class="errormsj" style="display:none">'+errorms+'</div>');
			$(this).next().fadeIn();
			error = 1;
		}
		
		
		if ($(this).attr('id') == 'email' ) {
	
			if (!validemail(value) && value != valuestore)
				{
					$(obj).addClass('error');
					error = 1;
					
					errorms = 'Please, enter a valid email!';
					$(this).after('<div class="errormsj" style="display:none">'+errorms+'</div>');
					$(this).next().fadeIn();
				}
		}
		
	});

	if (error == 0) 
		$("#contactform").submit();
	return false;
});



/*contacto*/

$('.errormsj').live('hover', function () {

	$(this).fadeOut(500, function () {$(this).remove()});

});




$('#tel1').hover(function () {
	$('#tel2').fadeIn();
},function () {
	$('#tel2').fadeIn();
});

$('#tel2').hover(function () {
	$('#tel2').fadeIn();
},function () {
	$('#tel2').fadeOut();
}
);


$('.twitter').hover(function () {
	$('em',this).fadeIn();
},function () {
	$('em',this).fadeOut();
});

$('.linkedin').hover(function () {
	$('em',this).fadeIn();
},function () {
	$('em',this).fadeOut();
});
	
	
	
$('#privacy').click(function () {
	$('#overlay2').fadeIn();
});	
$('#overlay2').click(function () {
	$('#overlay2').fadeOut();
});		
	
	
		
}); //document ready 


function validemail(valor) {
if (/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/.test(valor)){
return (true)
} else {
return (false);
}
}
