function imgOver() {
	var imgNodes = $('img').get();
	var inputNodes = $('input').get();
	var nodes = imgNodes.concat(inputNodes);
	$(nodes).each(function() {
		$(this).hover(
			function() {
				srcReplace(this, '_off', '_on');
			},
			function() {
				srcReplace(this, '_on', '_off');
			}
		);
	});
}
function srcReplace(elm, suffix1, suffix2) {
	var file = elm.src.match(/^(.*)?(\.[^.]*$)/i);
	if (file) {
		if (file[1].lastIndexOf(suffix1) > -1) {
			elm.src = file[1].replace(suffix1, suffix2) + file[2];
		}
	}
}
function itemPhotoZoom() {
	$('#item_photo_box').click(function() {
		if ($(this).find('a').attr('rel') === 'lightbox') {
			$(this).lightBox();
		}
	})
}

$(function() {
	imgOver();
	//itemPhotoZoom();
	$('a[rel*=lightbox]').lightBox(); // Select all links that contains lightbox in the attribute rel
})

