    var contactForm  = null;
    var submitButton = null;

    var inputArray = null;
    var textArray  = null;
    var helpArray  = null;

    var color   = null;
    var bg      = null;
    var border  = null;
    var style   = null;
    var width   = null;
    var padding = null;

    function initialize()
    {
      contactForm  = document.getElementById('contactformjs');
      submitButton = document.getElementById('submitbutton');

      inputArray = new Array();
      textArray  = new Array();
      helpArray  = new Array();

      inputArray[0] = document.getElementById('customer');
      inputArray[1] = document.getElementById('street1');
      inputArray[2] = document.getElementById('city');
      inputArray[3] = document.getElementById('phone');
      inputArray[4] = document.getElementById('zip');
      inputArray[5] = document.getElementById('email');
      inputArray[6] = document.getElementById('select_s2');
      inputArray[7] = document.getElementById('select_s4');
      inputArray[8] = document.getElementById('select_s3');

      textArray[0] = document.getElementById('textcustomer');
      textArray[1] = document.getElementById('textstreet1');
      textArray[2] = document.getElementById('textcity');
      textArray[3] = document.getElementById('textphone');
      textArray[4] = document.getElementById('textzip');
      textArray[5] = document.getElementById('textemail');
      textArray[6] = document.getElementById('textcontainer');
      textArray[7] = document.getElementById('textrestroom');
      textArray[8] = document.getElementById('textcontainernum');

      color   = inputArray[0].style.color;
      bg      = inputArray[0].style.backgroundColor;
      border  = inputArray[0].style.borderColor;
      style   = inputArray[0].style.borderStyle;
      width   = inputArray[0].style.borderWidth;
      padding = inputArray[0].style.padding;

      contactForm.onsubmit = checkFeedback;
    }

    function checkFeedback ()
    {
       var pos = null;
       var sel = 0;

       for(var i = 0; i < inputArray.length; i++)
       {
         switch(i)
         {
           case 0:
             pos = inputArray[0].value.search(/\w+ ?\w?.? ?\w+/);
             break;
           case 1:
             pos = inputArray[1].value.search(/\w+/);
             break;
           case 2:
             pos = inputArray[2].value.search(/\w+/);
             break;
           case 3:
             pos = inputArray[3].value.search(/\d?(-| )?((\(\d{3}\))|(\d{3}))(-| )?\d{3}(-| )?\d{4}$/);
             break;
           case 4:
             pos = inputArray[4].value.search(/\d{5}(-\d{4})?$/);
             break;
           case 5:
             if(inputArray[5].value == "")
               pos = 0;
             else
               pos = inputArray[5].value.search(/(\w+\.?)*\w+@(\w+\.?)*\w+\.\w{1,4}$/);
             break;
           case 6:
             pos = 0;
             sel = 0;
             break;
           case 7:
             pos = 1;
             sel = inputArray[7].value + inputArray[6].value;
             break;
           case 8:
             pos = 0;
             sel = 0;
             break;
           default:
             pos = inputArray[i].value.search(/\w+/);
         }

         if(pos != 0 && sel == 0)
         {
            textArray[i].style.color           = "#F00";
           inputArray[i].style.backgroundColor = "#FFEDE5";
           inputArray[i].style.borderColor     = "#F99";
           inputArray[i].style.borderStyle     = "solid";
           inputArray[i].style.borderWidth     = "1px";
           inputArray[i].style.padding         = "2px";
           inputArray[i].focus();

           if(i == 7)
           {
              textArray[i-1].style.color           = "#F00";
             inputArray[i-1].style.backgroundColor = "#FFEDE5";
             inputArray[i-1].style.borderColor     = "#F99";
             inputArray[i-1].style.borderStyle     = "solid";
             inputArray[i-1].style.borderWidth     = "1px";
             inputArray[i-1].style.padding         = "2px";
             inputArray[i-1].focus();

              textArray[i+1].style.color           = "#F00";
             inputArray[i+1].style.backgroundColor = "#FFEDE5";
             inputArray[i+1].style.borderColor     = "#F99";
             inputArray[i+1].style.borderStyle     = "solid";
             inputArray[i+1].style.borderWidth     = "1px";
             inputArray[i+1].style.padding         = "2px";
           }

           return false;
         }
         else
         {
           for(var j = 0; j < inputArray.length; j++)
           {
              textArray[j].style.color           = color;
             inputArray[j].style.backgroundColor = bg;
             inputArray[j].style.borderColor     = border;
             inputArray[j].style.borderStyle     = style;
             inputArray[j].style.borderWidth     = width;
             inputArray[j].style.padding         = padding;
           }
         }
       }

       submitButton.disabled = true;
       return true;
    }

    window.onload = initialize;