// imageButton.js (Website Framework) || Version: 1.11 || Last Updated: 2011-01-19 10:00 || Updated by: Jelle Kingma || Created: 2009-02-27 by Hidde-Finne Peters
//--------------------------------------------------------------------------------------------------------------------------------------------------------------------
//	1.10:	Optimized for jQuery framework
//--------------------------------------------------------------------------------------------------------------------------------------------------------------------


function initializeJavascriptButtons () {
	var elements = jQuery.merge($("img[id$='_button']"), $("input[type=image]"));
	elements.each(function () {
		initializeImageButton($(this));
	});
}

// Supplied element is expected to be a jquery object!
function initializeImageButton (element) {
	element.mouseover(function() {
		element.attr('src', element.attr('src').replace(new RegExp('_default\\b'), '_over'));
	});
	element.mouseout(function() {
		element.attr('src', element.attr('src').replace(new RegExp('_over\\b'), '_default'));
	});
}

$('document').ready(initializeJavascriptButtons);
