
//On Doc Ready
$(function() {
	
	//*************** js uniButton ***************
	//find anchor with class js_button
	$('.js_uniButton').each(function() {
		//store $(this) as a variable
		$this = $(this);
		//get original full src path
		var imgPath = $this.children('img').attr('src');
		//split imgPath after each '/' and create array to path directories and file name
		var srcPathArray = imgPath.split('/');
		//find image file name get length of srcPathArray and retrieve last item which is the image file ex: "images/buttons/IMG.gif"
		var imgFile = srcPathArray[srcPathArray.length-1];
		//image file name array split at "." to get:[fileName, ext]
		var imgArray = imgFile.split('.');
		//img name (first item in imgArray)
		var imgName = imgArray[0];
		//image ext (second item in imgArray)
		var imgExt = imgArray[1];
		//image src path
		var srcPath = imgPath.split(imgFile , 1);
		//mouse events
		$this.mouseover(function() {
			//on mouseover, swap image with another that contains "_hover"
			$(this).children('img').attr('src' , srcPath + imgName+'_hover.'+ imgExt);
		});
		$this.mouseout(function() {
			// on mouseout, swap current image with original image path
			$(this).children('img').attr('src' , imgPath);
		});
	});
	
	//Close On Doc Ready
})
