/*	
	Script written specifically for Best Parties by MJDIGITAL
	Used by permission - MJDIGITAL reserve all rights
	Author - Mark Jackson : March 2009
	http://www.mjdigital.co.uk
	
	This script automatically applies a separate focus style without having to
	add individual class attributes or javascript handlers to each form object
*/

fObjFocus = function(d) { // set focus class for selected form objects - resets onBlur
var x;
var d = (typeof(d)=='Object') ? d : document;
var tagList = new Array("INPUT","TEXTAREA","SELECT");
for (x in tagList) {
	var fObjEls = d.getElementsByTagName(tagList[x]); 
	for (var i=0; i<fObjEls.length; i++) {
		var arrtribs = fObjEls[i].getAttribute("TYPE");
		if ((arrtribs != "checkbox")&&(arrtribs != "radio")&&(arrtribs != "image")&&(arrtribs != "submit")) {
		fObjEls[i].onfocus=function() { 
			if(this.value==this.title) { this.value = ''; }
			if(isIE) {
				this.className="formObjHover";
			}
		}
		}
		if((arrtribs == "submit")&&(isIE)) {	
			fObjEls[i].onmouseover=function() { this.className+=" formObjHover"; } 
			fObjEls[i].onmouseout=function() { this.className= this.className.replace(new RegExp(" formObjHover\\b"), "");  } 
		}
	if ((arrtribs != "checkbox")&&(arrtribs != "radio")&&(arrtribs != "image")&&(arrtribs != "submit")) {
		fObjEls[i].onblur=function() { 
				if(this.value=='') { this.value = this.title; 	}
				if(isIE) {
					this.className=''; //this.className.replace(new RegExp(" formObjHover\\b"), ""); 
				}
			}
		} 
	} 
}
} 

if(window.addEventListener) window.addEventListener("load", fObjFocus, false); // for non IE browsers
else if(window.attachEvent) window.attachEvent("onload", fObjFocus);			 // for IE