	
	var inputs = new Array();
	var textareas = new Array();
	var texts = new Array();		
	
	//Initialization function - if you have any other 'onload' functions, add them here
	function init() {		
		getElements();
		separateElements();
		focusTextFields();
		focusTextArea();
		initFileUploads();
	}
	
			
	//getting all the required elements
	function getElements() {		
		 for (var nf = 0; nf < document.getElementsByTagName('form').length; nf++) {
				for(var nfi = 0; nfi < document.forms[nf].getElementsByTagName('input').length; nfi++) {inputs.push(document.forms[nf].getElementsByTagName('input')[nfi]);}			
				for(var nft = 0; nft < document.forms[nf].getElementsByTagName('textarea').length; nft++) {textareas.push(document.forms[nf].getElementsByTagName('textarea')[nft]);}
		}		
	}
			
	//separating all the elements in their respective arrays		
	function separateElements() {
		var t = 0; 
		for (var q = 0; q < inputs.length; q++) {			
			if((inputs[q].type == "text") || (inputs[q].type == "password")) {texts[t] = inputs[q]; t++;}			
		}		
	}
		
	// Focus On Text Inputs
	function focusTextFields() {
		for(var q = 0; q < texts.length; q++) {
	
			texts[q].tmp = texts[q].value ;		
			texts[q].onfocus = function() {
				if(this.value == this.tmp){
					this.value = "";
				}		
			}
			texts[q].onblur = function() {
				if(this.value ==""){
					this.value = this.tmp;
				}			
			}
		}
	}
		
	// Focus On Text Area
	function focusTextArea() {
		for(var q = 0; q < textareas.length; q++) {
		
				textareas[q].tmp = textareas[q].value ;		
				textareas[q].onfocus = function() {
				if(this.value == this.tmp){
						this.value = "";
					}		
				}
				textareas[q].onblur = function() {
				if(this.value ==""){
					this.value = this.tmp;
				}			
			}
		}
	}	
	
window.onload = init;


