jQuery(document).ready(function(){ 

	Cufon.set('fontFamily', 'Gotham').replace('H1')('H2')('H3')('.top1')('.top2')('#header ul li'); 
	Cufon.set('fontFamily', 'Gotham-Light').replace('.submenu ul li')('.learn_more_button .text'); 
	jQuery('.bg').css({ 'display':'block', 'opacity':0 });
	
	jQuery('#header>#access>.menu-header>ul>li').hover(
		function(){
			if (!jQuery(this).attr('class').match('current_page_item')) {
				jQuery(this).find('.bg').animate({ 'opacity':.6 }, { duration:300});
			}
		},
		function(){
			if (!jQuery(this).attr('class').match('current_page_item')) {
				jQuery(this).find('.bg').animate({ 'opacity':0 }, { duration:300});
			}
		}
	);
	
	jQuery('#header .menu-item').click(function(){
		window.location.replace((this).id);
	});

	jQuery('#email_address_input').focus(function(){
		jQuery(this).val('');
	});

	jQuery('.enter_your_email form').submit(function(){
		var address = jQuery(this).find("#email_address_input").attr('value');
		if (address == 'Enter Your Email' || address == '') {
			alert('Please enter a valid email address');
		} else {
			var address = jQuery(this).find("#email_address_input").attr('value');
			jQuery.get('/wp-content/themes/acento/email_sender.php?address='+address, function(a){
				if (a == 1) {
					jQuery('.enter_your_email').html('<p class="top2">Thank you!</p><p class="top1">Your address will be added to our mailing list.</P>');
				} else {
					alert('ERROR! '+a);
				}
			});
		}
		return false;
	});

	$("<div id='tweet'></div>").hide().appendTo(".latest_tweet").lastTwitterMessage('AcentoAd');	

});

