document.write('<style type="text/css">.glossary dl dd {display:none;}</style>');

function initGlossary() {
	
	getId = document.location.href.split('#');
	var open = getId[1];
	
	if(open) {
		var i = 0;
		$('.text .glossary dt').each(function(){
			$(this).removeClass('open').next('dd').removeClass('open');
		});
		$('.text .glossary dt').each(function(){
			i++;
			if (open == i){
				$(this).addClass('open').next('dd').addClass('open');
			}
		});
	}
	
	$('#worldmap area').each(function(){ 
		$(this).click( function() { 
			var i = 0;
			$('.text .glossary dt').each(function(){
				$(this).removeClass('open').next('dd').removeClass('open');
			});
			getId = $(this).attr('href').split('#');
			open = getId[1];
			$('.text .glossary dt').each(function(){
				i++;
				if (open == i){
					$(this).addClass('open').next('dd').addClass('open');
				}
			});
		});
	});
	
	$('dt').hover(
		function(){
			$(this).css("cursor","pointer");
			$(this).css("color","#f90");
			$(this).css("textDecoration","underline");
		},
		function(){
			$(this).css("cursor","default");
			$(this).css("textDecoration","none");
			$(this).css("color","#555");
		}
	)
	$('dt').click( function() { 		
		$(this).toggleClass('open');
		$(this).next('dd').toggleClass('open');		
	});
}

$(document).ready(function(){
	initGlossary();
});