/*This will add some nice behavior to form inputs and text fields
  add the class "clear-text" to the input or text-field to include
  this behavior*/
function clearText(field){
  if (field.defaultValue == field.value) field.value = '';
  else if (field.value == '')
    field.value = field.defaultValue;
}
function initFormTextClear(){
  jQuery("input[type=text].clear-text, textarea.clear-text").blur(
    function(event){clearText(event.target);}
  );
  jQuery("input[type=text].clear-text, textarea.clear-text").focus(
    function(event){clearText(event.target);}
  );
}
/*Adds list classes for first and last list elements*/
function initListClasses(){
  jQuery('ul li:first-child').addClass( 'list-first' );
  jQuery('ul li:last-child').addClass( 'list-last' );
  jQuery('ol li:first-child').addClass( 'list-first' );
  jQuery('ol li:last-child').addClass( 'list-last' );
}

function initEmployment(){
  jQuery('.employement-more-info').click(
    function(event){
      event.preventDefault();
      jQuery('#'+jQuery(this).attr('id')+'-row').slideToggle();
      var rel = jQuery(this).attr('rel');
      var thetext = jQuery(this).text();
      jQuery(this).attr('rel', thetext);
      jQuery(this).text(rel);
    }
  
  );
}

jQuery(document).ready(function() {
  initFormTextClear();  
  initListClasses();
	jQuery("#tabs").tabs();
  Cufon.replace('.txt-rpl', {hover:true});
  initEmployment();
});
