$apiWindow->updateWindow();
}
$app_action = $apiWindow->get_app_action();
define("APP_ID", $app_name);
define("APP_ACTION", $app_action);
define("WIN_TYPE", $apiWindow->getParam('wintype'));
/*
**************************
*/
if (file_exists(PHPOS_DIR . 'plugins/window.' . $apiWindow->getParam('wintype') . 'Plugin.php')) {
    define('PHPOS_PLUGIN', true);
    if (!empty($app_name)) {
        $my_app = new phpos_app();
        $my_app->set_app_id($app_name);
        $my_app->set_app_action($app_action);
        $my_app->set_window($apiWindow);
        $my_app->load_config();
        // esc - close
        if (WIN_ID != 1) {
            $tips = "\n\t\t\t\t//Select all anchor tag with rel set to tooltip\n\t\t\t\t\$('a[rel=tooltip]').mouseover(function(e) {\n\t\t\t\t\n\t\t\t\t//Grab the title attribute's value and assign it to a variable\n\t\t\t\tvar tip = \$(this).attr('title');\t\n\t\t\t\t\n\t\t\t\t//Remove the title attribute's to avoid the native tooltip from the browser\n\t\t\t\t\$(this).attr('title','');\n\t\t\t\t\n\t\t\t\t//Append the tooltip template and its value\n\t\t\t\t\$(this).append('<div id=\"tooltip\"><div class=\"tipHeader\"></div><div class=\"tipBody\">' + tip + '</div><div class=\"tipFooter\"></div></div>');\t\t\n\t\t\t\t\t\t\n\t\t\t\t//Show the tooltip with faceIn effect\n\t\t\t\t\$('#tooltip').fadeIn('500');\n\t\t\t\t\$('#tooltip').fadeTo('10',0.9);\n\t\t\t\t\n\t\t\t}).mousemove(function(e) {\n\t\t\t\n\t\t\t\t//Keep changing the X and Y axis for the tooltip, thus, the tooltip move along with the mouse\n\t\t\t\t\$('#tooltip').css('top', e.pageY - 100 );\n\t\t\t\t\$('#tooltip').css('left', e.pageX - 80 );\n\t\t\t\t\n\t\t\t}).mouseout(function() {\n\t\t\t\n\t\t\t\t//Put back the title attribute's value\n\t\t\t\t\$(this).attr('title',\$('.tipBody').html());\n\t\t\t\n\t\t\t\t//Remove the appended tooltip template\n\t\t\t\t\$(this).children('div#tooltip').remove();\n\t\t\t\t\n\t\t\t});\n\t\t\t";
            $keyboard = '	
				$(document).keyup(function(e)
				{
					switch(e.which)
					{
						// user presses the "a"
						case 97:	alert("a");
									break;	
									
						// user presses the "s" key
						case 27:	phpos.windowClose(window.PHPOS_ACTIVE_WINDOW);