$(document).ready(function()
{
  initTextInputFields();
});

function initTextInputFields()
{
	$('.fldAutoComplete').each(function(){
	  if ($(this).attr('rel') == $(this).val())
	  {
  	  $(this).css('color', '#999999');
  	}
//	  $(this).attr('rel', $(this).val());
	  $(this).focus(function(){
	    if ($(this).val() === $(this).attr('rel'))
	    {
  	    $(this).css('color', '#000000');
  	    $(this).val('');
  	  }
	  });
	  $(this).blur(function(){
	    if ($(this).val() === '')
	    {
	      $(this).css('color', '#999999');
  	    $(this).val($(this).attr('rel'));
  	  }
	  });
	});
	
	
	$('#headerLoginButton').hide();
	$('#fldSelectLoginType').change(function() {
	  if ($(this).val() != '0')
	  {
	    switch ($(this).val())
	    {
        case 'wellness':
          window.open("http://www.bwell.co");
          break;
        
        default:
    	    $('#headerLoginButton').click();
          break;
      }
	  }
	});
}
