// JavaScript Document
$(document).ready(function() {





//summarize resume
/*
	$("#summarize").click(function () {
      $(".summarize").slideToggle("slow");
	 
	  
    });*/


var Toggled=false;

          $('#summarize').click(function() {
          	if(Toggled==false){$('#summarize').html('Show Details'); Toggled=true;}
            else{$('#summarize').html('Hide Details');Toggled=false;}
            $(".summarize").slideToggle(400);
            return false;
          });
 
	  



	
/*	swapValues = [];
	$(".swap_value").each(function(i){
		swapValues[i] = $(this).val();
		$(this).focus(function(){
			if ($(this).val() == swapValues[i]) {
				$(this).val("");
			}
		}).blur(function(){
			if ($.trim($(this).val()) == "") {
				$(this).val(swapValues[i]);
			}
		});
	});  */
	
	//style links
	$("a[href$=pdf]").addClass("pdf");
	$("a[href$=doc]").addClass("doc");
	$("a[href$=rss]").addClass("feed");
	$("a[href$=xml]").addClass("feed");
	$("a[href*=http://www.facebook.com]").addClass("facebook");
	$("a[href*=http://digg.com]").addClass("digg");
	$("a[href*=http://www.myspace.com]").addClass("myspace");
	$("a[href*=http://www.linkedin.com]").addClass("linkedin");
	$("a[href*=http://www.youtube.com]").addClass("youtube");
	$("a[href*=http://www.flickr.com]").addClass("flickr");
	$("a[href*=http://twitter.com]").addClass("twitter");
	$("a[href*=http://www.google.com/talk]").addClass("chat");
	$("a:not([href*=http://www.jeremyladuke.com])").not("[href^=#]").addClass("external").attr({ target: "_blank" });

  //validate form
  $("#contact").validate();

$("#contact").ajaxForm(function(data) {
            if (data==1){
				$("#contact").append("<p><label id='success' style='display:none;' class='success'>Your email was sent! Thanks!</label></p>");
                $("#success").fadeIn("slow");
                $("#contact").resetForm();
            }
            else if (data==2){
				$("#contact").append("<p><label id='badserver' style='display:none;' class='error'>Message not sent.  Try again later.</label></p>");
                $("#badserver").fadeIn("slow");
            }
            else if (data==3)
            {
				//$("#contact").append("<p><label id='bademail' style='display:none;' class='error'>Please enter a valid email.</label></p>");
                $("#bademail").fadeIn("slow");
            }
        });





});

