addLoadListener(activateJobLinks);

function activateJobLinks() {
	var jobLinks = getElementsByClassName(document, 'a' ,'job_title');
	for (i=0; i<jobLinks.length; i++) {
		jobLinks[i].onclick = function() {
			var jobContainer = document.getElementById(this.id + '_container');
			var jobContent = document.getElementById(this.id + '_content');
			if (jobContainer.offsetHeight == 0) {
				document.getElementById(this.id).style.backgroundImage = 'url(../img/employment/arrow_down.gif)';
				showJob(jobContent.offsetHeight, jobContainer);
			} else {
				document.getElementById(this.id).style.backgroundImage = 'url(../img/employment/arrow_right.gif)';
				closeJob(jobContent.offsetHeight, jobContainer);
			}
			return false;
		};
	}
}

function showJob(jobHeight, jobID) {
	var showJob = new YAHOO.util.Anim(jobID, { height: {to: jobHeight}}, .5, YAHOO.util.Easing.easeIn);
	showJob.animate();
}

function closeJob(jobHeight, jobID) {
	var closeJob = new YAHOO.util.Anim(jobID, { height: {to: 0}}, .5, YAHOO.util.Easing.easeIn);
	closeJob.animate();
}