// default text in input fields disappears on focus.

var active_color = '#000';
var inactive_color = '#333';

$(document).ready(function() {
  $('input[type=text]').css("color", inactive_color);
  var default_values = new Array();
  $('input[type=text]').focus(function() {
    if (!default_values[this.id]) {
      default_values[this.id] = this.value;
    }
    if (this.value == default_values[this.id]) {
      this.value = '';
      this.style.color = active_color;
    }
    $(this).blur(function() {
      if (this.value == '') {
        this.style.color = inactive_color;
        this.value = default_values[this.id];
      }
    });
  });
});

// clears default values from forms on submit
function clearDefaults(field){
  if ((field.title || field.defaultValue)  == field.value) field.value = '';

}

$(".tab").click(function() {
	var tabcontents = $(this).attr("tabname");
	$(".tabcontents").hide();
	$(tabcontents).show();
	$(".tab").parent().removeClass("selected");
	$(this).parent().addClass("selected");
});

// Create faq collapsibles
// Hide answers
$("p", "#faq_content").hide();
// Show questions
$("p a", "#faq_content").parent().show();
// Setup voided href
$("p", "#faq_content").not(':has(em)').find('a').attr("href", "javascript:void(0);");
// Create click function to toggle answer
$("a", "#faq_content").click( function() { 
	$(this).parent().next().slideToggle('fast');
});
	

