$(document).ready(function() {

//$("h2.toggler").toggler({method: "toggle", speed: 0, state: "null"});
//$("h3.toggler").toggler({method: "toggle", speed: 0});

$("h2.toggler").toggler({speed: 500});
$("h3.toggler").toggler({speed: 500});



  contentHeight = $('#main').height();
  //calculate height of vertical divider based on div#content height
  $('#vertDivMid').css('height', (contentHeight-320)+'px');
	
  //remove right margin from second column of bios on members page
  $("#bioGrid li:odd").css('margin-right' , '0px');
	
  //make entire div on Our Work page clickable
  //$("#bioGrid li").click(function(){
  //window.location=$(this).find("a").attr("href");
  //});

  $('input[type*=submit]').addClass('submit');

  $('#target-page').prepend("<h2>Email Text</h2>");
  $('#sign-page').prepend("<h2>Your Information</h2>");
  $('.supporterInfo br').remove();

  $('#tempZip').attr('value', 'Zip Code').focus(function(){
    if($(this).attr('value') == 'Zip Code'){
      $(this).attr('value', '');
    }
  }).blur(function(){
    if($(this).attr('value') == ''){
      $(this).attr('value', 'Zip Code');
    }
  });

  $('#f1').attr('value', 'First Name').focus(function(){
    if($(this).attr('value') == 'First Name'){
      $(this).attr('value', '');
    }
  }).blur(function(){
    if($(this).attr('value') == ''){
      $(this).attr('value', 'First Name');
    }
  });

  $('#f2').attr('value', 'Last Name').focus(function(){
    if($(this).attr('value') == 'Last Name'){
      $(this).attr('value', '');
    }
  }).blur(function(){
    if($(this).attr('value') == ''){
      $(this).attr('value', 'Last Name');
    }
  });

  $('#f3').attr('value', 'Email').focus(function(){
    if($(this).attr('value') == 'Email'){
      $(this).attr('value', '');
    }
  }).blur(function(){
    if($(this).attr('value') == ''){
      $(this).attr('value', 'Email');
    }
  });

  $('#f4').attr('value', 'Address 1').focus(function(){
    if($(this).attr('value') == 'Address 1'){
      $(this).attr('value', '');
    }
  }).blur(function(){
    if($(this).attr('value') == ''){
      $(this).attr('value', 'Address 1');
    }
  });

  $('#f5').attr('value', 'Address 2').focus(function(){
    if($(this).attr('value') == 'Address 2'){
      $(this).attr('value', '');
    }    
  }).blur(function(){
    if($(this).attr('value') == ''){
      $(this).attr('value', 'Address 2');
    }
  });

  $('#f6').attr('value', 'City').focus(function(){
    if($(this).attr('value') == 'City'){
      $(this).attr('value', '');
    }    
  }).blur(function(){
    if($(this).attr('value') == ''){
      $(this).attr('value', 'City');
    }
  });

  $('#f8').attr('value', 'Zip Code').focus(function(){
    if($(this).attr('value') == 'Zip Code'){
      $(this).attr('value', '');
    }    
  }).blur(function(){
    if($(this).attr('value') == ''){
      $(this).attr('value', 'Zip Code');
    }
  });
});


//auto-select form field contents on click-tab

function highlight(field) {
  field.focus();
  field.select();
};


Cufon.replace('h1, #rsb h4, #rsb a, #coalition-members #bd a, h5', {
  fontFamily: 'Interstate-Light' ,
  hover: true
});
Cufon.replace('h1 em, #rsb a em', {
  fontFamily: 'Interstate-Light-Italic' ,
  hover: true
});
Cufon.replace('#nav a, h2, #coalition-members h3, #action-center h3', {
  fontFamily: 'Interstate-Bold' ,
  hover: true
});




