// JavaScript Document
//Copyright (c) 2006-2007 Nokia Corporation.
/*
This material, including documentation and any related computer programs,
* is protected by copyright controlled by Nokia. All rights are reserved.
* Copying, including reproducing, storing, adapting or translating,
* any or all of this material requires the prior written consent of Nokia.
* This material also contains confidential information, which may not be
* disclosed to others without the prior written consent of Nokia.
*
* DESCRIPTION
* -------------------------------------------------------------------------
* This script check for all browsers and unified the use of Javascript in the Site
*Creates "is_" variables indicating:
*(1) browser vendor:
// (2) browser version number:
* -------------------------------------------------------------------------
*
* CHANGE HISTORY
* -------------------------------------------------------------------------
*
* Version | Date      | Developer     | Changes
* 1.01    | 04/04/2007| Keo           | Initial creation
* 1.02    | 06/06/2007| Keo           | Add OS Detect
* -------------------------------------------------------------------------
*/
    // convert all characters to lowercase to simplify testing
    var navAgent = navigator.userAgent.toLowerCase();
    var navVersion = navigator.appVersion.toLowerCase();
	//***** OS Detect Version *****
	var is_win   = ((navAgent.indexOf("win")!=-1) || (navAgent.indexOf("16bit")!=-1));
	var is_mac = (navAgent.indexOf("mac")!=-1);

	// ***** Browser Version *****
    var is_minor = parseFloat(navVersion);
    var is_major = parseInt(is_minor);

	// ***** Identify Browser *****
	var is_firefox = (navAgent.indexOf("firefox") != -1);
	var iePos  = navVersion.indexOf('msie');
    if (iePos !=-1) {
       is_minor = parseFloat(navVersion.substring(iePos+5,navVersion.indexOf(';',iePos)))
       is_major = parseInt(is_minor);
    }

	//***** Check DOM Control *****
	var is_getElementById   = (document.getElementById) ? "true" : "false"; // IE
    var is_getElementsByTagName = (document.getElementsByTagName) ? "true" : "false"; // Mozilla
    var is_documentElement = (document.documentElement) ? "true" : "false"; // Not Supported
	