	function initHelpDialog(section,topic){
				// Dialog			
				$('#dialog').dialog({
					autoOpen: false,
					draggable: true,
					width: 300,
					buttons: {
						"More help": function() { 
							window.location="/client/help/"+section+"/"+topic+"/"; 
						}
					}
				}).data('title.dialog','Delete Warning');
	}
	
	
	function showHelpDialog(lang){
		

		$('.help').click(function(e){
			
			var i = $(this);
			var top = 0; var left =0; var x=0; //x is just for avoiding infinite loops
			var oParent = i[0];
			while (oParent  && x++ <100) {
			    top  += oParent.offsetTop  - oParent.scrollTop;
			    left += oParent.offsetLeft - oParent.scrollLeft;
			    oParent = oParent.offsetParent;
			}
			top += i.height() - (document.documentElement.scrollTop || document.body.scrollTop); // want it below the i-object
			
			section = $(this).attr('helpsection');
			topic = $(this).attr('helptopic');
			
			$.getJSON("/ajax/gethelptopic/"+section+"/"+topic+"/"+lang+"/summary/",function(res){
				initHelpDialog(section,topic);	
				$("#help-paragraph").html(res['content']);
				$('#dialog').data('title.dialog', res['longname']); 
				$('#dialog').dialog('option', 'position',[left,top]).dialog("open");
			});
			return false;
		});

	}
	
	function setHelpDialogHandler(lang){
		showHelpDialog(lang);
	}