$(function(){

    $('a[href*=#]').click(function() {
    
    if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') 
        && location.hostname == this.hostname) {
        
            var $target = $(this.hash);
            
            $target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
            
            if ($target.length) {
            
                var targetOffset = $target.offset().top;
                
                $('html,body').animate({scrollTop: targetOffset}, 1000);
                    
                return false;
                
            }
            
        }
        
    });
    
});

$(document).ready(function(){
	$('#myForm').ajaxForm(function(data) {
		if (data==1){
			$('#success').fadeIn("slow");
			$('#myForm').resetForm();
		}
		else if (data==2){
			$('#badserver').fadeIn("slow");
		}
		else if (data==3)
		{
			$('#bademail').fadeIn("slow");
		}
	});
});


	$(document).ready(function(){	
		$("#slider").easySlider({
			auto: false, 
			continuous: true
		});
	});	



		if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) 
		{
		if (document.cookie.indexOf("iphone_redirect=false") == -1) window.location = "http://m.trevormcnaughton.com/";
		}
