/*
 * 	Multi-Actions On Hover
 *	written by Shawn Borelli, http://www.borellidesigns.com/
 *
 *	Originally developed and testing with jsFiddle: http://jsfiddle.net/nQzCt/111/
 *	with help for jQuery Forum: https://forum.jquery.com/topic/on-hover-events/
 *
 *	Copyright (c) 2011 Borelli Designs (http://www.borellidesigns.com)
 *	Dual licensed under the MIT (MIT-LICENSE.txt)
 *	and GPL (GPL-LICENSE.txt) licenses.
 *
 *	Built for jQuery library
 *	http://jquery.com
 *
 */
 
/* For Use In coding:

<style>

a {color: #333333;}
a:hover {color: #3399CC;}
.hover {color: #3399CC;}
img {padding: 5px; margin:0;}
img.hover {background: #3399CC;}

</style>

	<a href="#" class="group" tag="1">group 1</a>
	<a href="#" class="group" tag="2">group 2</a>

	<br /><br />

	<a href="#" class="fade" tag="1" group="1">item 1</a><br />
	<a href="#" class="fade" tag="2" group="1">item 2</a><br />
	<a href="#" class="fade" tag="3" group="2">item 3</a>

	<br /><br />
	
	<table border=1 cellspace=0 cellpadding=0>
		<tr>
			
			<td><img src="MW_image1.png" width="30" height="129" class="fade" tag="1" group="1" /></td>
			
			<td><img src="MW_image1.png" width="30" height="129" class="fade"  tag="2" group="1"/></td>
			
			<td><img src="MW_image1.png" width="30" height="129" class="fade"  tag="3" group="2"/></td>			
		</tr>
    
	</table>

 */
$(document).ready(function() {
$(".fade").hover(function() {
    var num = $(this).attr("tag");
    $(".hover").removeClass("hover");

    $('a.fade[tag="' + num + '"]').addClass("hover");
    $('img.fade[tag="' + num + '"]').addClass("hover");
}, function() {
    $(".hover").removeClass("hover");
});

$(".group").hover(function() {
    var groupid = $(this).attr("tag");
    $('a.fade[group="' + groupid + '"]').addClass("hover");
    $('img.fade[group="' + groupid + '"]').addClass("hover");
}, function() {
    $(".hover").removeClass("hover");
});
});

