var Pnj = Class.create(); 
Pnj.prototype = { 

	initialize: function(action) {
		if(action == 'map'){
			this.pnjs = $$('.pnj');
			this.prefixeNom = 'nom_pnj_';
		}
	},	
	
	init: function() {		
		this.pnjs.each(this.initPnj.bind(this));
	},
	
	initPnj: function(elt) {	
	
		var id = elt.id.replace('pnj_img_mini_','');
		var urlAjax = 'ajax/game/module/pnj.ajax.php?action=speak&idPnj='+id;
		var t = this ;
		new Tip(elt, 
		{
			title: $(this.prefixeNom+id).innerHTML,
			closeButton: true,
			showOn: 'click',
			hideOn: { element: 'closeButton', event: 'click'},
			stem: 'bottomMiddle',
			hook: { target: 'topMiddle', tip: 'bottomMiddle' },
			offset: { x: 0, y: -2 },
			width: 'auto',
			ajax: {
				url: urlAjax,
				options: {
					onComplete:this.initAction.bind(this) 
				}
			}			
		});				
	},

	initAction: function(requester){
			
	},
	
	speak: function(e){

	}
	

};	
