/****************************************************************************************************
program type:               Javascript include file
name: 			            browser.js
description:                this file contains the functions to check different browser version

copyright © 2004 by FIRMENPUNKT GmbH

client:                     -
documentation:              - 
date (dd/mm/yyyy):          08/12/2004
created by (with email):    fabian von derschatta <fvd@firmenpunkt.de>
last modified (dd/mm/yyyy): 
reason for modification:    
modified by (with email):   

function		|arguments          | return             |   description
------------------------------------------------------------------------------------------------------
CheckBrowser    |-                  |-                   |   Check what browser is used and call different functions
verNumIEOpera   |-                  |-                   |   Execute actions for browser Internet Explorer and Opera
verNumNet       |-                  |-                   |   Execute actions for browser Netscape
*****************************************************************************************************/

	// define variable navName and save the Browsername
	var navName = navigator.appName ;
	// define variable brVer and saver the UserAgent string
	var brVer = navigator.userAgent;
	// define variable brNum
	var brNum; 
	// define variable reg and save the regular expression '/'
	var reg = new RegExp('/');

	/**************************************************************************
	function:                   verNumIEOpera
	description:                xecute actions for browser Internet Explorer and Opera
	calling parameter:          -
	return:                     -
	templates used:             -
	date (dd/mm/yyyy):          08/12/2004
	created by:                 fabian von derschatta <fvd@firmenpunkt.de>
	last modified (dd/mm/yyyy): -
	reason of modification:     -
	modified by:                -
	**************************************************************************/	
	function verNumIEOpera() {
		// define variable brVerId
		var brVerId;
		// search in string brVer for "Opera" and save the position in brVerId
		brVerId = brVer.indexOf('Opera');
		// get part of string from brVerId on and save it in brNum
		brNum = brVer.substr(brVerId,7);
		// get part of string that is the browser version
		var Num = brNum.substr(6, 7);
		// if browser version lesser than 7 
	}

	/**************************************************************************
	function:                   verNumNet
	description:                xecute actions for browser Netscape
	calling parameter:          -
	return:                     -
	templates used:             -
	date (dd/mm/yyyy):          08/12/2004
	created by:                 fabian von derschatta <fvd@firmenpunkt.de>
	last modified (dd/mm/yyyy): -
	reason of modification:     -
	modified by:                -
	**************************************************************************/
	function verNumNet() {
		// search in string brVer for regular expression '\' and save the position in brVerId
		var brVerId = brVer.search(reg);
		// get part of string from brVerId on and save it in brNum
		brNum = brVer.substring(brVerId+1);
		// get part of string that is the browser version
		var Num = brNum.substr(0,1);
		// if browser version lesser and equak than 4 
		if(Num <= "4") {
			// redirect to file "wrong_browser.html"
			document.location.href='wrong_browser.html'
		}
	}	
	
	/**************************************************************************
	function:                   CheckBrowser
	description:                Closes the open popup created with CreatePopup
	calling parameter:          -
	return:                     -
	templates used:             -
	date (dd/mm/yyyy):          07/10/2004
	created by:                 fabian von derschatta <fvd@firmenpunkt.de>
	last modified (dd/mm/yyyy): 
	reason of modification:     
	modified by:                
	**************************************************************************/
	function CheckBrowser() {
		// if browser appears to be "Microsoft Internet Explorer"
		if (navigator.appName == 'Microsoft Internet Explorer') {
			// call function for more actions for this browser
			verNumIEOpera();
		// if browser appears to be "Netscape"
		} else if (navigator.appName == 'Netscape'){
			// call function for more actions for this browser
			verNumNet();
		// if browser appears to be "Opera" or an other browser
		} else {
			// call function for more actions for this browser	
			verNumIEOpera();
		}
	}	