var FormElements				= {
	sActive : 'activeField',
	sInactive : 'inactiveField',
	sClearText : 'fieldClearText',
	
	addFunctions : function () {
		if(!document.getElementById||!document.createTextNode){return;}
		
		var aInputs = document.getElementsByTagName("input");
		for(var i=0; i < aInputs.length; i++){
			if(aInputs[i].type=='text'||aInputs[i].type=='password'){
				
				aInputs[i].onfocus = function() {
					DOMUtils.cssjs('remove', this, FormElements.sInactive);
					DOMUtils.cssjs('add', this, FormElements.sActive);
					
					if(DOMUtils.cssjs('check', this, FormElements.sClearText)){
						this.value = '';
					}
				};
				aInputs[i].onblur = function() {
					DOMUtils.cssjs('remove', this, FormElements.sActive);
					DOMUtils.cssjs('add', this, FormElements.sInactive);
				};
			}		
		}
	}
};

// quick search box
var QuickSiteSearch					= {
	init:function() {
		if(!document.getElementById||!document.createTextNode){return;}
		var eSearchPhrase			= document.getElementById('frmNewsSearch--sSearchPhrase');
		
		if (eSearchPhrase) {
			eSearchPhrase.value		= 'Find articles or jobs';
			eSearchPhrase.onclick	= function() {eSearchPhrase.value = '';};
		}
	}
};

WindowListener.add("load","FormElements.addFunctions()");
WindowListener.add("load","QuickSiteSearch.init()");