/*
 -------------------------------------------------------------------------------
 * jQuery rollover js
 *
 * USAGE
 *  if rollover image, add class "rollover"
 *  next step, before rollover image name 'foobar.gif'.
 *  after rollover image name 'foobar_on.gif'.
 *  you add to image name '_on'.
 *
 * EXAMPLE
 *  <img src="images/menu01.gif" class="rollover" />
 *
 -------------------------------------------------------------------------------
 */
jQuery(function(){
	jQuery(".rollover").each(function(){
		$t = jQuery(this) ;
		var _src = $t.attr("src").toString() ;
		if( !_src.match(/\.(gif|png|jp(g|eg))$/i) ) {
			return ;
		}
		
		var tmp = _src.split(".") ;
		tmp[tmp.length - 2] = tmp[tmp.length - 2] + "_on" ;
		var onImage = tmp.join(".") ;
		$t.data("def", _src) ;
		$t.data("on", onImage) ;
		$t.hover(function(){
			jQuery(this).attr("src", jQuery(this).data("on")) ;
		},
		function(){
			jQuery(this).attr("src", jQuery(this).data("def")) ;
		}) ;
	}) ;
}) ;
