Cufon.replace('.c');

function validateEmail(elementValue){
   var emailPattern = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;
   return emailPattern.test(elementValue);
 }

$(function(){ 

	//email signup
	$('#email-go').click(function(){
		
		if (validateEmail($('#email-input').val()))
		{
			$('#email-txt').html("Thank you, please wait...");
			var email = $('#email-input').val();
			$.post('/forms.php', 'type=email&email='+email, function(){$('#email-txt').html("Complete");});
		}
		else
		{
			$('#email-txt').html("Please enter your email address: ");
		}
		
		return false;
		
		
	});

		$("#main-nav ul").superfish({		
			autoArrows:    false,               
			dropShadows:   false,  
			disableHI:     true,
			delay: 200		
		});		
		
		$('#email-input').focus(function(){			
			if ($(this).val() == 'Enter your email'){
				$(this).val('');
			}			
		}).blur(function(){				
			if ($(this).val() == ''){
				$(this).val('Enter your email');
			}				
		});	
		
		//Product lighbox
		
		$('.product-gal a').each(function(){
			
			if (!$(this).hasClass('nogen'))
			{
			
				var href = $(this).find('img').attr('src');
				var newhref = href.replace('lg/', '');
				var nnnewhref = newhref.replace('tb/', '');
					
				$(this).attr('href', nnnewhref);
			
			}
			
			
		});
		
		
		$('.product-gal a').prettyPhoto({
			
			slideshow: false,
			deeplinking: false,
			overlay_gallery: false,
			social_tools: false,
			show_title: false
			
			
			});
			
			
			$('.pp').prettyPhoto({
			
			slideshow: false,
			deeplinking: false,
			overlay_gallery: false,
			social_tools: false,
			show_title: false
			
			
			});
		
		
		$('a.false').click(function(){return false;});	
		
		
getTwitters('tweet', {
        id: 'MallardCreekInc', 
        count: 1, 
        enableLinks: true, 
        ignoreReplies: false,
        template: '<span class="twitterPrefix"><span class="twitterStatus">%text%</span> <em class="twitterTime"><a href="http://twitter.com/%user_screen_name%/statuses/%id%">- %time%</a></em>',
        newwindow: true
    });
				
});
