<?
// common_wml.inc
//
// Copyright, Exolution GmbH / Michael Kerrisk, Sep 2000
// http://www.exolution.com/wapsh   mailto:wapsh@exolution.de
//
// This software is Open Source licensed under the terms of the Trolltech QPL
// version 1.0.  See http://www.exolution.de/wapsh for further information.
//
// ---------------------------------------------------------------------
//
// Common definitions needed by WML
//

    
    // Many form submission buttons share a common set of fields...

    srand ((double) microtime() * 1000000);

    $commFields = '<postfield name="' . session_name() . '" ' . 
    		' value="' . session_id() . '" />' .
               	'<postfield name="r' . (rand() % 10000). '" ' .  ' value=""/>';
				     
    $shCommFields = $commFields .  '<postfield name="cmdForm" value="y" />';
    $scrCommFields = $commFields .  '<postfield name="scrForm" value="y" />';

    define("DEF_OUTPUT_WINDOW_SIZE", 200);	
    				// Default maximum number of characters to 
    				// display at a time in shell output window
    						
    define("DEF_HISTORY_BLOCK_SIZE", 3);
    				// Default number of items to display
    				// at a time from history list

    define("DEF_SHORTCUT_BLOCK_SIZE", 10);
    				// Default number of items to display
    				// at a time from shortcut list

    // A handy routine for distinguishing UP phone from Nokia

    function isUpPhone() {
	global $wapBrowserStyle;

	return strpos($GLOBALS["HTTP_USER_AGENT"], "UP/") !== false ||
	    isset($wapBrowserStyle) && $wapBrowserStyle == SNA_WBS_UPBROWSER;
    } // isUpPhone
?>
