//Set onload functions here:
$(document).ready(function(){
	// Initialize global scripts
	// Initialize local scripts (placed in each page)
	//localInit();
	// Your code here
	enableInputLeads();
});

//Show and hide
function fadeBlock(sFadeId) {
	if ($(sFadeId)[0].style.display == 'none') {
		$(sFadeId).slideDown("slow");
		//$(sFadeId).fadeIn("slow");
	}
	else {
		$(sFadeId).slideUp("slow");
		//$(sFadeId).fadeOut("slow");
	}
}

//Input text element leads
function enableInputLeads() {
	$('input.wlead').each(function(i) {
		//set onfocus
		this.onfocus = function() {
			itemFocus(this);
		}
		//set onblur
		this.onblur = function() {
			itemBlur(this);
		}
	});
}
//Clear field on focus
function itemFocus(e) {
	e.value = '';
	e.style.color = '#000000';
}
//Reset lead when leaving empty field
function itemBlur(e) {
	e.style.color = '';
	if (e.value == '') {
		e.value = e.title;
	}
	else {
		return false;	
	}
}
