/*
	CHP Consulting by Gary Bennion
	Version 1.0
	
	Contents
		1. map
*/

$(document).ready(function(){	
		var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
		if($.browser.msie && $.browser.version=="6.0") {
			$('#map .character').click(function() {
				location = $(this).children(".info").children(".infoTxt").children(".readMore").attr("href");		
				return false;
			})	
		} 
		else if(is_chrome){
			$('#map .character').click(function() {
				location = $(this).children(".info").children(".infoTxt").children(".readMore").attr("href");		
				return false;
			})	
		} else {
			
			$('#map .character').click(function() {
				$('#map .character a').removeClass('selected'); /* reset any selected labels */
				$('#map .character').css("z-index","0"); /*reset all z-indexes*/
				
				$(this).siblings().children(".info").fadeOut(); /* hide all the siblings */
				$(this).children(".info").fadeIn(); /* bring in the info panel */
				$(this).children("a").addClass('selected'); /* add a selected class to the label */
				$(this).css("z-index","1000"); /*make sure it appears on top*/
			
				return false;
			})
			
			$('#map .info .close').click(function() {
				$(this).parent().parent().fadeOut(); /* close the info panel */
				$('#map .character a').removeClass('selected'); /* remove the select class from the label */
				return false;
			});
			
			$('#map .info .readMore').click(function() {
				location = $(this).attr("href"); 
			});
		}

});
