var submitted = false;

// Override the jQuery '$' function to avoid conflicts
var $jsi = {
		fn : this.prototype		
};

$(document).ready(function()
{
  $('input[type=submit].active').click(function(){
      if( submitted == true ) {
          return false;
      } else {
          submitted = true;
          width = $(this).width();
          $(this).css('background-color','grey');
          return true;
      }
  });
  $('input[type=button].active').click(function(){
      if( submitted == true ) {
          return false;
      } else {
          submitted = true;
          width = $(this).width();
          $(this).css('background-color','grey');
          return true;
      }
  });
});

function enableButtons() {
  submitted = false;
  $('input[type=submit].active').css('background-color','#567891');
  $('input[type=button].active').css('background-color','#567891');

}

var defaultEmptyTextColor = '#D3D3D3';
var defaultNonEmptyTextColor = '#6F6F6F';
function showAltEmptyStrTB(id, altText, emptyTextColor, nonEmptyTextColor) {
    id = "#"+id;
    if(emptyTextColor == null) {
        emptyTextColor = defaultEmptyTextColor;
    }
    if(nonEmptyTextColor == null) {
        nonEmptyTextColor = defaultNonEmptyTextColor;
    }
    var text = $(id).val();
    if(text == "" || text == altText) {
        $(id).val(altText);
        $(id).css('color', emptyTextColor);
    }
    else {
        $(id).css('color', nonEmptyTextColor);
    }
}

function hideAltEmptyStrTB(id, altText, nonEmptyTextColor, emptyTextColor) {
     id = "#"+id;
     if(nonEmptyTextColor == null) {
         nonEmptyTextColor = defaultNonEmptyTextColor;
     }
    if(emptyTextColor) {
        emptyTextColor = defaultEmptyTextColor;
    }
     var text = $(id).val();
     if(text == altText) {
         $(id).val("");
     }
     $(id).css('color', nonEmptyTextColor);
}

