function switchStylestyle(styleName){
        $('link[@rel*=style]').each(function(i)
        {
                this.disabled = true;
                if (this.getAttribute('title') == styleName) this.disabled = false;
        });
}

function init_form_fields(){
var inputs = $(":text");
for(x=0;x < inputs.length;x++){

     switch(inputs[x].id){
        
        case "qsEmail":
        $(inputs[x]).bind("focus", function(){
          if(this.value == 'Enter your email address here')
             this.value = '';
        });
        $(inputs[x]).bind("blur", function(){
          if(this.value == '')
             this.value = 'Enter your email address here';
        });
        break;

        case "esEmail":
        $(inputs[x]).bind("focus", function(){
          if(this.value == 'Enter your email address here')
             this.value = '';
        });
        $(inputs[x]).bind("blur", function(){
          if(this.value == '')
             this.value = 'Enter your email address here';
        });
        break;

        case "searchQ":
        $(inputs[x]).bind("focus", function(){
          if(this.value == 'Search wecansolveit.org')
             this.value = '';
        });
        $(inputs[x]).bind("blur", function(){
          if(this.value == '')
             this.value = 'Search wecansolveit.org';
        });
        break;
   }
}
}


$(document).ready(function() {

  init_form_fields();

  $('input[@name=email]').addClass('input_email');
  $('input[@name=firstname]').addClass('input_firstname');
  $('input[@name=lastname]').addClass('input_lastname');
  $('input[@name=addr1]').addClass('input_addr1');
  $('input[@name=addr2]').addClass('input_addr2');
  $('input[@name=city]').addClass('input_city');
  $('input[@name=zip]').addClass('input_zip');
  $('select[@name=state_cd]').addClass('select_state_cd');
  $('select[@name=country]').addClass('select_country');
  $('input[@name=phone]').addClass('input_phone');

  $('input[type="text"]').addClass('text');
  $('input[type="password"]').addClass('text');
  $('input[type="checkbox"]').addClass('checkbox');
  $('input[type="radio"]').addClass('radiobutton');
  $('input[type="submit"]').addClass('submit');
  $('input[type="image"]').addClass('buttonImage');

  var section = $.query.get('style');
  if (section) switchStylestyle(section);

  var submit = $('<h1>My Community</h1><p>Please create an account to sign up for an event, add an event, join a group and other activities.</p>').insertBefore('#constituent');

  // insert disclaimer to group creation
  var disclaimer1 = $('<p class="disclaimer">Please note: The We Campaign website is intended to foster a positive dialogue about solutions to the climate crisis. If you wish to debate whether global warming is a problem or topics not related to the solving the climate crisis, there are other venues for those discussions.  It is also expected that people will accord to basic standards of basic civility and decorum (no profanity, for example).</p>').insertBefore('#circle_edit');

});