// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults
var current = 0;

function button_rotate()
{
  var elem = $('#featured_candidate ul');
  var list_count = elem.children('li').size() - 1;

  $('#featured_candidate ul .fc'+current).fadeOut(300, function(){
    if (current == list_count) current = 0;
    else current++;
    $('#featured_candidate ul .fc'+current).fadeIn();
  });


  tar = setTimeout('button_rotate()', 10000);
}

$(document).ready(function() {

  $('input.clearme').focus(function(e) {
    if (this.value == this.title) {
      this.value = "";
      $(this).removeClass('clearme');
    }
  });
  $('input.clearme').blur(function(i) {
    if (this.value == "") {
      this.value = this.title;
      $(this).addClass('clearme')
    }
  });

  tar = setTimeout('button_rotate()', 10000);

  if ($("input#total_money")) {
    var total = $("input#total_money").val() * 1
    $("#red").animate({width: Math.round((total/10000)*846)}, total+500);
  }

  /*if ($("#payment_amount_other")) {
    $("#payment_amount_other:parent").css("clear", "both");
  }*/
})

