/*

	Form Utility Functions
	-----------------------

	@file 		forms.js
	@version 	1.0.0b
	@date 		2010-06-07 08:55:42 +0100 (Mon, 7 Jun 2010)
	@author 	Gordon Mackay <gm@navertech.com>

	Copyright (c) 2010 Navertech <http://navertech.com/>

*/

function clearInputs() {
 var inputs = document.getElementsByTagName('input');
 for(var i=0; i < inputs.length; i++) {
  inputs[i].setAttribute('rel',inputs[i].defaultValue);
  inputs[i].onfocus = function() {
   if (this.value == this.getAttribute('rel') && this.getAttribute('type') != 'submit' && this.getAttribute('type') != 'reset') {
    this.value = '';
   } else {
    return false;
   }
  }
  inputs[i].onblur = function() {
   if(this.value=='' && this.getAttribute('type') != 'submit' && this.getAttribute('type') != 'reset') {
    this.value = this.getAttribute('rel');
   } else {
    return false;
   }
  }
  inputs[i].ondblclick = function() {
   this.value = this.getAttribute('rel')
  }
 }
}





