var photos = ['context_breachContract.jpg','context_businessLit.jpg','context_civilRights.jpg', 'context_contract.jpg', 'context_criminalLaw.jpg', 'context_disabilityDiscrimination.jpg', 'context_discrimination.jpg', 'context_educationLaw.jpg', 'context_educationLaw.jpg', 'context_eeoc.jpg', 'context_employmentLaw.jpg', 'context_espanol.jpg', 'context_estatePlanning.jpg', 'context_executiveCompensation.jpg', 'context_partners.jpg', 'context_practiceAreas.jpg', 'context_proBono.jpg', 'context_resources.jpg', 'context_sexualHarassment.jpg', 'context_wageDisputes.jpg', 'context_whistleblower.jpg'];


YAHOO.util.Event.onDOMReady(init);

function init() {
	initContactForm();
	initRotateCaption();
}

function initContactForm() {
	cf = document.getElementById('contactForm');
	YAHOO.util.Event.addListener(cf.getElementsByTagName('input'), "click", clearField);
	YAHOO.util.Event.addListener(cf.getElementsByTagName('textarea'), "click", clearField);
	YAHOO.util.Event.addListener(cf.getElementsByTagName('input'), "blur", checkField);
	YAHOO.util.Event.addListener(cf.getElementsByTagName('textarea'), "blur", checkField);
}

function clearField(e) {
	if (this.value == this.id || this.id == "description") {
		this.value = '';	
	}
}

function checkField(e) {
	if (this.value == '' && this.id != "description") {
		this.value = this.id;
	}
}
function randArray(data) {
	return data[Math.floor(Math.random()*data.length)];
}
function getRandPhoto(attributes) {
	document.write('<img src="/employment/images/' + randArray(photos) + '" ');
	for (var i in attributes) {
		document.write(i + '="' + attributes[i] + '" ');
	}
	document.write("/>\n");
}