/******************************************************************************
 *
 * Purpose: SIRAP generic functions
 * Author:  Thomas Raffin, SIRAP
 *
 ******************************************************************************
 *
 * Copyright (c) 2007 SIRAP
 *
 * This is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version. See the COPYING file.
 *
 * The software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with p.mapper; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 *
 ******************************************************************************/


// generic click :
function sirap_generic_click(mode, action, tool, helptext, cursor) {
	if (typeof(cursor) == 'undefined') {
		cursor = 'pointer';
	}
	
	PM.Map.resetFrames();
	
	if (mode) {
		PM.Map.mode = mode;
	}
	if (action) {
		PM.Map.maction = action;
	}
	if (tool) {
		PM.Map.tool = tool;
	}
    
    if (PM.useCustomCursor) {
        PM.setCursor(false, cursor);
    }
	
	if (typeof(helptext) != 'undefined' && helptext) {
		PM.Map.showHelpMessage(_p(helptext));
	}
}

/* old version
function sirap_showHelpMessage(helptext) {
	if (typeof(helptext) != 'undefined') {
		if (helptext) {
			var helptranslation = _p(helptext);
			if (helptranslation) {
				if (helptranslation.length > 0) {
					showHelpMessage(helptranslation);
				}
			}
		}
	}
}
old version */
