$(function() {

  //error style in form for list item wrappers
  $('form li strong').parent('label').parent('li').addClass('ff-error');

  //error style in form for list item wrappers for radios/checkboxes
  $('form li fieldset strong').parent('label').parent('li').parent('ol').parent('fieldset').parent('li').addClass('ff-error');

  //give focus to first error field
  $('form li strong:first').parent('label').next('input').focus();

  $('a[rel="external"]').click(function(){
  	this.target="_blank";
  })

	$('.method-group').parent().hide();
  $('#title_arguments li').each(function(a,b){
  	var selects = $(b).find('select').not('.method-group');
  	if(selects.val() == 'required'){
  		selects.next().show();
  	}
  });

	$('#title_arguments select').not('.method-group').change(function(){
		if($(this).val() == 'required'){
			$(this).next().show();
		}else{
			$(this).next().hide();
		}
	});


});//end of document-ready

