/*
 * jquery_rollover.js
 * 
 */
 

// Rollover opacity

// image button base
//----------------------------------------------
function fSwpImg (){
	var postfix = '_ov';

	$('.swpImg').not('[src*="_ac"]').each(function() {
		var img = $(this);
		var src = img.attr('src');
		var src_ov = src.substr(0, src.lastIndexOf('.'))
							 + postfix
							 + src.substring(src.lastIndexOf('.'));
		$('<img>').attr('src', src_ov);
		img.hover(
			function() {
				img.attr('src', src_ov);
			},
			function() {
				img.attr('src', src);
			}
		);
	});
}

// opacity base
//----------------------------------------------
function fBtnImg (){
	var opacity = '0.7';
	$('.btnImg').each(function() {
		var img = $(this);
		img.hover(
			function() {
				img.css('opacity', opacity);
			},
			function() {
				img.css('opacity', 1.0);
			}
		);
	});
}

// fade 
//----------------------------------------------
function fFadeImg (){
	var opacity = '0.7';
	$('.fadeImg').each(function() {
		var img = $(this);
		img.hover(
			function() {
				img.stop(true, true).fadeTo(50, opacity).fadeTo(500, 1.0); 
			},
			function() {
				img.fadeTo(100, 1.0); 
			}
		);
	});
}
	
$(function(){	
	//fSwpImg();
	fBtnImg();
	fFadeImg();
});


