var Site = {
  Common: {
    init: function(e) {
      $('body').removeClass('nojs').addClass('js');
      /* First child support for IE6 */
      $('#sidebar ul.base li li:first-child').addClass('first-child');
    }
  }
};

$(document).ready(function() {
  Site.Common.init();

/* Accessible input values
---------------- */
 $("form#searchsite input.text, .support input[type=text], .page-id-14 .support textarea").each(function(){
  var val = $(this).parent().prev().prev().html();
  if (this.value == '') {this.value = val;}
  $(this)
   .focus(function(){
    if(this.value == val) { this.value = ''; $(this).addClass('focus'); }
   }).blur(function(){
    if(this.value == '') { this.value = val; $(this).removeClass('focus'); }
  })
 });
 
/* Accessible input values - comment form
---------------- */
 $("#commentform .input-wrapper input, #commentform textarea").each(function(){
  var val = $(this).prev().html();
  if (this.value == '') {this.value = val;}
  $(this)
   .focus(function(){
    if(this.value == val) { this.value = ''; $(this).addClass('focus'); }
   }).blur(function(){
    if(this.value == '') { this.value = val; $(this).removeClass('focus'); }
  })
 });
   
/* Enable keyboard navigation in IE6
---------------- */

  $('.wpcf7-form .your-name input').keypress(function(event) {
    if (event.keyCode == '13'|| event.keyCode == '9') {
       event.preventDefault();
       $(this).removeClass('focus');
       setTimeout( function() {
        $('.wpcf7-form .your-email input').focus();
       } , 100);
    }
  });
  
  $('.wpcf7-form .your-email input').keypress(function(event) {
    if (event.keyCode == '13'|| event.keyCode == '9') {
       event.preventDefault();
       $(this).removeClass('focus');
       setTimeout( function() {
        $('.wpcf7-form .your-message textarea').focus();
       } , 100);
    }
  });

  /* Hitting tab on textarea focuses on submit button */
  $('.wpcf7-form .your-message textarea').keypress(function(event) {
    if (event.keyCode == '9') {
       event.preventDefault();
       $(this).removeClass('focus');
       setTimeout( function() {
        $('.wpcf7-form .submit input').focus();
       } , 100);
    }
  });
 
 
});
