//controls display of portfolio images in a page

var curWork = 'one';

function workImgOver() {
	var img = arguments[0];
	if (img.id != 'work_'+curWork+'_img') {
		img.src = ((img.origSrc)?img.origSrc:img.src).replace(/(.*)(\..*)$/, '$1_on$2');
	}
}

function workImgOut() {
	var img = arguments[0];
	if (img.id != 'work_'+curWork+'_img') {
		img.src = ((img.origSrc)?img.origSrc:img.src).replace('_on', ''); 
	}
}

function workImgClick() {
	var img = arguments[0];
	if (img.id != 'work_'+curWork+'_img') { 
		document.getElementById('work_'+curWork).className = 'hide';
		var oldWork = curWork;
		curWork = img.id.replace('work_', '').replace('_img', '');
		workImgOut(document.getElementById('work_'+oldWork+'_img'));
		document.getElementById('work_'+curWork).className = 'show';
	}
	return(false);
}
