$(document).ready(function() {

      $(".show_send_resume").click( function() {
        $rigstatusObject = $(this).parents(".resume_info").children(".submit_resume_online");

        $(this).unbind('mouseleave');

        if ( $rigstatusObject.css( "display" ) == "block" ) {
          $(this).bind( 'mouseleave', function () {
            $(this).attr('src', $(this).attr('src').replace( overRegexp, '$1' + offString + '$2' ) );
          });
        }


        $rigstatusObject.animate({height: 'toggle'}, { duration: "slow" });
      });


      $(".bio_control").click( function() {
        $bioObject = $(this).parents(".contact_wrapper").children(".contact_bio");
        $bioRealObject = $(this).parents(".contact_wrapper").find(".contact_email");


        if ( $bioRealObject.css( "display" ) == "block" ) {
          $imageObject =
            $(this).
            parents(".contact_wrapper").find('.email_control');

            $imageObject.bind( 'mouseleave', function () {
            $imageObject.attr('src', $imageObject.attr('src').replace( overRegexp, '$1' + offString + '$2' ) );
          });

            $imageObject.attr('src', $imageObject.attr('src').replace( overRegexp, '$1' + offString + '$2' ) );

            $bioRealObject.animate({height: 'toggle'}, { duration: "slow" });
//            alert( $bioRealObject.css( 'class' ) );
        }


//        alert( $bioObject.css( "display" ) );

        $(this).unbind('mouseleave');

        if ( $bioObject.css( "display" ) == "block" ) {
          $(this).bind( 'mouseleave', function () {
            $(this).attr('src', $(this).attr('src').replace( overRegexp, '$1' + offString + '$2' ) );
          });
        }

        if ( $bioObject.css( "display" ) == "block" ) {
          $(this).bind( 'mouseleave', function () {
            $(this).attr('src', $(this).attr('src').replace( overRegexp, '$1' + offString + '$2' ) );
          });
        }


        $bioObject.animate({height: 'toggle'}, { duration: "slow" });
      });




      $(".email_control").click( function() {
        $bioObject = $(this).parents(".contact_wrapper").children(".contact_email");
        $bioRealObject = $(this).parents(".contact_wrapper").find(".contact_bio");

        if ( $bioRealObject.css( "display" ) == "block" ) {
          $imageObject =
            $(this).
            parents(".contact_wrapper").find('.bio_control');

            $imageObject.bind( 'mouseleave', function () {
            $imageObject.attr('src', $imageObject.attr('src').replace( overRegexp, '$1' + offString + '$2' ) );
          });
        
            $imageObject.attr('src', $imageObject.attr('src').replace( overRegexp, '$1' + offString + '$2' ) );

            $bioRealObject.animate({height: 'toggle'}, { duration: "slow" });
        }

        $(this).unbind('mouseleave');

        if ( $bioObject.css( "display" ) == "block" ) {
          $(this).bind( 'mouseleave', function () {
            $(this).attr('src', $(this).attr('src').replace( overRegexp, '$1' + offString + '$2' ) );
          });
        }

        $bioObject.animate({height: 'toggle'}, { duration: "slow" });
      });


      $(".close_link1").click( function() {
        $imageObject =
            $(this).
              parents(".resume_info").children('.show_send_resume');



//        $rigstatusObject = $(this).parent().parent();
        $rigstatusObject = $(this).parents(".resume_info").children(".submit_resume_online");

        $imageObject.unbind('mouseleave');

        if ( $rigstatusObject.css( "display" ) == "block" ) {
          $imageObject.bind( 'mouseleave', function () {
            $imageObject.attr('src', $imageObject.attr('src').replace( overRegexp, '$1' + offString + '$2' ) );
          });
        }



        $rigstatusObject.animate({height: 'toggle'}, { duration: "slow" });

        $imageObject.attr('src', $imageObject.attr('src').replace( overRegexp, '$1' + offString + '$2' ) );
      });



      $(".close_link2").click( function() {
        $imageObject =
            $(this).
              parents(".contact_wrapper").find('.email_control');

        $rigstatusObject = $(this).parents(".contact_wrapper").children(".contact_email");

        $imageObject.unbind('mouseleave');

        if ( $rigstatusObject.css( "display" ) == "block" ) {
          $imageObject.bind( 'mouseleave', function () {
            $imageObject.attr('src', $imageObject.attr('src').replace( overRegexp, '$1' + offString + '$2' ) );
          });
        }



        $rigstatusObject.animate({height: 'toggle'}, { duration: "slow" });

        $imageObject.attr('src', $imageObject.attr('src').replace( overRegexp, '$1' + offString + '$2' ) );
      });


      $(".close_link3").click( function() {
        $imageObject =
            $(this).
              parents(".contact_wrapper").find('.bio_control');

        $rigstatusObject = $(this).parents(".contact_wrapper").children(".contact_bio");

        $imageObject.unbind('mouseleave');

        if ( $rigstatusObject.css( "display" ) == "block" ) {
          $imageObject.bind( 'mouseleave', function () {
            $imageObject.attr('src', $imageObject.attr('src').replace( overRegexp, '$1' + offString + '$2' ) );
          });
        }



        $rigstatusObject.animate({height: 'toggle'}, { duration: "slow" });

        $imageObject.attr('src', $imageObject.attr('src').replace( overRegexp, '$1' + offString + '$2' ) );
      });




      $("form#send_resume_form").submit(function() {
        var $name = $("input[name='name']").attr( 'value' );
        var $email = $("input[name='email']").attr( 'value' );
        var $areaCode = $("input[name='areaCode']").attr( 'value' );
        var $exchange = $("input[name='exchange']").attr( 'value' );
        var $digits = $("input[name='digits']").attr( 'value' );
        var $fileName = $("input[name='fileName']").attr( 'value' );

        $.ajax({
          type: "POST",
          url: "send_resume.php",
          data: "name=" + $name + "&email=" + $email + "&areaCode=" + $areaCode + "&exchange=" + $exchange + "&digits=" + $digits + "&fileName=" + $fileName,
          success: function(del) {
            $imageObject =
              $(".resume_info").find('.show_send_resume');

            $rigstatusObject = $(".resume_info").find(".submit_resume_online");

            $imageObject.unbind('mouseleave');

            if ( $rigstatusObject.css( "display" ) == "block" ) {
              $imageObject.bind( 'mouseleave', function () {
                $imageObject.attr('src', $imageObject.attr('src').replace( overRegexp, '$1' + offString + '$2' ) );
              });
            }



            $rigstatusObject.animate({height: 'toggle'}, { duration: "slow" });

            $imageObject.attr('src', $imageObject.attr('src').replace( overRegexp, '$1' + offString + '$2' ) );


            jQuery.facebox('<div style="height: 200px; width: 200px;">Thank You ' + $name + '!  You should have a confirmaiton e-mail shortly </div>');
          }
        });

        return false;
      });


      $("#resume_upload_box").jqUploader({
        background: "faf9fa",
        barColor: "cccccc",
        varName: "fileName",
        allowedExt: "*.pdf; *.doc; *.docx",
        allowedExtDescr: "Word Documents [*.doc, *.docx] or Adobe Acrobat (PDF) files [*.pdf]",
        params: {quality:'low', menu: false},
        validFileMessage: 'Thanks, now hit Upload!',
        endMessage: '',
        afterScript: '',
        hideSubmit: true });


      $("#box_test").click(function() {
        alert( 'hi' );
        $(this).facebox('some facebox.cssst');
      });

});
