$(document).ready(function(){
	var bills = new Array();
	bills = $("#bills-selector .bill");
	$(bills).removeClass().addClass("offTab");
	$("#bill1").removeClass().addClass("onTab");
	$("#bill1_page").show();
	$("#definitions-wrapper").removeClass('nonjs-layout');
	$("#definitions-wrapper div.explaination-wrapper div.explaination").hide();
	$("#definitions-wrapper div.definition-wrapper div.definition span").hide();
	
	$(bills).each(function(){
		$(this).bind('click',function(){
			var id = $(this).attr('id');
			var content = id + "_page";

			if(content){
				$(bills).each(function(){
					$(this).removeClass().addClass("offTab");
					var id1 = $(this).attr('id');
					$("#" + id1 + "_page").hide();
				})
				$(this).removeClass().addClass("onTab");				
				$("#" + content).show();
			} else{}	
		})	
	})	

	$(".toggle-link").bind('click',function(){
											
		$(this).parent().hide();
		$("#definitions-wrapper div.definition-wrapper div.definition span").hide();
	})
						   
	$(".example-marker").bind('click',function(){
		var selID = $(this).parent().attr('id');
		var selclass = $(this).parent().attr('class');		
		//alert(selclass);
		
		if(selclass == "question"){
			selValue = selID.split('q');
			selID = selValue[0];
		}
		$("#definitions-wrapper div.explaination-wrapper div.explaination").hide();
		$("#definitions-wrapper div.definition-wrapper div.definition span").hide();
		$("#" + selID + "_question_wrapper").show();
		$("#" + selID + "-example-title").show();
		$("#" + selID + "-example-route").show();			
	})
	
})
