// JavaScript Document


jQuery(function($){
				
				// FONT REPLACEMENT
	Cufon.replace('#header a.active', {fontFamily:'Avenir', fontWeight:500, color:'#ce3b38' });
	Cufon.replace('#left-nav a:not(.active), #archive a,#archives-3 li a, #right-nav a:not(#eddie-argos-resource)', {fontFamily:'Avenir', fontWeight:500, hover:{color:'#ce3b38'}});
	Cufon.replace('h2', {fontFamily:'Avenir', fontWeight:900});
	Cufon.replace('label, h4, .button, h3', {fontFamily:'Avenir', fontWeight:500, hover:{color:'#535251'} });
	
	
	//CONTACT FORMS
	$('#contact-form').bind('validationPassed', function(){
		$('.submit').hide();
		$('.loader').show();
		$(this).find('input').attr('readonly', 'readonly');
		$(document).ajaxError( function(){
			$('.submit').show();
			$('.loader').hide();							
			alert('Message Sending Failed.  Please try again');
		});
		$.post(this.action, $(this).serialize(), function(){
			$('.submit').show();
			$('.loader').hide();
			$('#contact-form fieldset').animate({'left': $('#contact-form').width()}, {
				complete: function(){
					$('.contact-form-message').animate({'top':0});
				}
			});
		});
	});
	
	$('input.submit').each( function(){
		var onsrc = this.src.replace('.png', '_on.png');
		new Image().src = onsrc;
		$(this)
			.attr('offsrc', this.src)
			.attr('onsrc', onsrc)
			.mouseover( function(){ this.src = $(this).attr('onsrc'); })
			.mouseout( function(){ this.src = $(this).attr('offsrc'); });
			
		
	});
	
	
	
	
				
});

