// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults
function validBrandName(brandName)
{
/*  if(brandName == "xxx"){*/
/*  if(true){*/
  brandPattern = /^[a-zA-Z0-9.\s-]+$/
  if(brandPattern.test(brandName)){
    return true;
  }
  else{
    return false;
  }
}


function inlineFieldLabel (label, inputid)
{
  var fieldLabel = label;         // string to put in your text input
  var textInput = $(inputid)  // your text input field

  /* add the field label css class to the form field and set the value */
  textInput.addClass("intra-field-label");//.val(fieldLabel);

  /* remove the placeholder string when field gets focus */
  textInput.focus(function()
   {
      if(this.value == fieldLabel )
      {
         $(this).removeClass("intra-field-label").val("");
      };
   });

  /* add the field label string when field looses focus */
  textInput.blur(function()
   {
      if(this.value == "")
      {
         $(this).addClass("intra-field-label").val(fieldLabel );
      };
   });

   /* if the field is set to the fieldLabel on submit, clear the field */
/*   form.submit(function()
   {
      if(textInput.val() == fieldLabel)
      {
         textInput.removeClass("intra-field-label").val("");
      };
   });*/

}

$(document).ready(function(){
$(".stripeMe tr").mouseover(function() {$(this).addClass("over");}).mouseout(function() {$(this).removeClass("over");});
$(".stripeMe tr:even").addClass("alt");
});
