

//SET AN ONLOAD EVENT
jQuery(function($) {
	loadImageEvents();
	//loadMapHotBoxes();
});

function loadImageEvents() {
	$('div[id*=image_]').each(function() {
		
		//ADD HOVER EVENT TO IMAGE
		$(this).hover(function() {
			$('a[href=' + $(this).parent().attr('href') + ']').addClass('hover');
		}, function() {
			$('a[href=' + $(this).parent().attr('href') + ']').removeClass('hover');						
		});
		
		//ADD HOVER EVENT TO MENU LINK
		$('a[href=' + $(this).parent().attr('href') + ']').hover(function() {
			$('a[href=' + $(this).attr('href') + '] div[id*=image_]').addClass('hover');
		}, function() {
			$('a[href=' + $(this).attr('href') + '] div[id*=image_]').removeClass('hover');						
		});
		
	});
}


function loadMapHotBoxes() {
	$('#map a').hover(function() {
		var classes = $(this).attr('className').split(' ');
		if ($('#' + classes[0]).length) {
			$('#' + classes[0]).toggleClass('hover');
		}
	}, function() {
		var classes = $(this).attr('className').split(' ');
		if ($('#' + classes[0]).length) {
			$('#' + classes[0]).toggleClass('hover');
		}
	});
	
	$('#map dt').hover(function() {
		$(this).next().addClass('hover');
		},
	function() {
		$(this).next().removeClass('hover');	
	});

}

$(document).ready(function(){

	$('#map a#n_w_01').click(function(event) {
		event.preventDefault();
		top.location="selector_2.aspx?id=1";
	});

	$('#map a#n_w_02').click(function(event) {
		event.preventDefault();
		top.location="selector_2.aspx?id=1";
	});

	$('#map a#n_e_01').click(function(event) {
		event.preventDefault();
		top.location="selector_2.aspx?id=2";
	});

	$('#map a#n_e_02').click(function(event) {
		event.preventDefault();
		top.location="selector_2.aspx?id=2";
	});

	$('#map a#y_h_01').click(function(event) {
		event.preventDefault();
		top.location="selector_2.aspx?id=3";
	});

	$('#map a#y_h_02').click(function(event) {
		event.preventDefault();
		top.location="selector_2.aspx?id=3";
	});

	$('#map a#e_m_01').click(function(event) {
		event.preventDefault();
		top.location="selector_2.aspx?id=4";
	});
	$('#map a#e_m_02').click(function(event) {
		event.preventDefault();
		top.location="selector_2.aspx?id=4";
	});
	$('#map a#e_m_03').click(function(event) {
		event.preventDefault();
		top.location="selector_2.aspx?id=4";
	});
	$('#map a#e_m_04').click(function(event) {
		event.preventDefault();
		top.location="selector_2.aspx?id=4";
	});

	$('#map a#e_m_04').click(function(event) {
		event.preventDefault();
		top.location="selector_2.aspx?id=4";
	});

	$('#map a#e_e_01').click(function(event) {
		event.preventDefault();
		top.location="selector_2.aspx?id=5";
	});

	$('#map a#e_e_02').click(function(event) {
		event.preventDefault();
		top.location="selector_2.aspx?id=5";
	});

	$('#map a#l_01').click(function(event) {
		event.preventDefault();
		top.location="selector_2.aspx?id=6";
	});


	$('#map a#s_e_01').click(function(event) {
		event.preventDefault();
		top.location="selector_2.aspx?id=7";
	});
				 
	$('#map a#s_e_02').click(function(event) {
		event.preventDefault();
		top.location="selector_2.aspx?id=7";
	});
				 
	$('#map a#s_e_03').click(function(event) {
		event.preventDefault();
		top.location="selector_2.aspx?id=7";
	});
				 

	$('#map a#s_w_01').click(function(event) {
		event.preventDefault();
		top.location="selector_2.aspx?id=8";
	});
				 
	$('#map a#s_w_02').click(function(event) {
		event.preventDefault();
		top.location="selector_2.aspx?id=8";
	});

	$('#map a#w_m_01').click(function(event) {
		event.preventDefault();
		top.location="selector_2.aspx?id=9";
	});
				 
	$('#map a#w_m_02').click(function(event) {
		event.preventDefault();
		top.location="selector_2.aspx?id=9";
	});


});