// JavaScript Document

var fieldContent = new Array();
var fieldInitial = new Array();

function fieldFocus( field ) {
	if (!fieldInitial[field.id]) {
		fieldContent[field.id] = field.value;
		fieldInitial[field.id] = 1;
	}
	if (field.value == fieldContent[field.id]) {
		field.value = "";
	}
}

function fieldBlur( field ) {
	if( !field.value ) {
		field.value = fieldContent[field.id];
	}
}

function checkInputValues(form) {
  // iterate over all of the inputs for the form
  // element that was passed in
  $(':input', form).each(function() {
    var type = this.type;
    var tag = this.tagName.toLowerCase(); // normalize case
    // it's ok to reset the value attr of text inputs,
    // password inputs, and textareas
    if (type == 'text' || type == 'password' || tag == 'textarea'){
      this.onfocus();
      if (this.value == "") this.value = "";
    }
  })

};

 
function setInputValues(form){
$(':input', form).each(function() {
    var type = this.type;
    var tag = this.tagName.toLowerCase(); // normalize case
    // it's ok to reset the value attr of text inputs,
    // password inputs, and textareas
    if (type == 'text' || type == 'password' || tag == 'textarea'){
      this.onblur();
    }
  })
  
};

