// JavaScript Document

$(document).ready(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}, 500 );
       return false;
      }
    }
  });
  $("a.group").fancybox({
		'zoomSpeedIn':	500, 
		'zoomSpeedOut':	500,
		'zoomOpacity' : .5,
		'overlayOpacity' : .5,
	});
  jQuery(document).ready(function($){
        $('#myForm').ajaxForm(function(data) {
            if (data==1){
                $('#success').fadeIn("slow");
                $('#bademail').fadeOut("slow");
                $('#myForm').fadeOut("fast");
				$('#contact-letstalk').fadeOut("fast");
				
            }
            else if (data==2) $('#badserver').fadeIn("slow");
            else if (data==3) {
                $('#bademail').fadeIn("slow");
                $('#emaillabel').css("color","red");
                $('#emailinput').focus();
            }
        });
    });
});



