$(document).ready(function(){
	$(".group").attr("id", function(gr){
		return "group"+gr;							
	});
	
	$(".close").attr('id', function(b){
		return "close"+b;							
	}).each(function(ee){
		$(this).click(function(){
			$(".group").fadeOut("fast");				   
		});
	});
	
	$("#alphabets tr td > a").attr("id",function(a){
		return "alpha"+a;								   
	}).each(function(e){
		$(this).click(function(){
			$(".group").hide();
			$("#group"+e).fadeIn();
		});
	});
	
	$("span.terms > strong").attr("id", function(f){
		return "word"+f;									 
	});
	
	$("li.def").attr("id", function(f){
		return "def"+f;									 
	});
	
	$("#glossary > a").attr("id",function(g){
		return "term"+g;					  
	}).each(function(w){
		$(this).click(function(){
			$("#word").hide();
			$("#inWord").empty();
			$("#word").fadeIn("fast");
			$("#word"+w).clone().appendTo("#inWord");
			$("#def"+w).clone().appendTo("#inWord");
		});
	});
	
	$("#closeWord").click(function(){
		$("#word").hide();
		$("#inWord").empty();
	});
	
});
