/*
 * File:        detectionNavigator.js
 * Description: Detector of navigation for javascript
 * Author:      Samuel Cléroux-Bouthillier
 * Created:     Monday June 1 2009
 * Language:    javascript
 * Copyright 2009 Samuel Cléroux-Bouthillier, all rights reserved.
 
 * List of browser that are possible the var navigateur can be only these value : 
 	* Safari
	* Ipod (include Ipod And Iphone)
	* IE
	* Firefox
	* Opera
*/

var DetectNavigator = {
	
  Browser: {
    IE:     !!(window.attachEvent && !window.opera),
    Opera:  !!window.opera,
    WebKit: navigator.userAgent.indexOf('AppleWebKit/') > -1,
    Gecko:  navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAgent.indexOf('KHTML') == -1, // http://fr.wikipedia.org/wiki/Gecko_(moteur_de_rendu)#Navigateurs_web;lk
    MobileSafari: !!navigator.userAgent.match(/Apple.*Mobile.*Safari/)
  }
  
};

var navigateur = "";

if(DetectNavigator.Browser.WebKit) {
	navigateur = "Safari";
}
else if(DetectNavigator.Browser.MobileSafari) {
	navigateur = "Ipod";
}
else if(DetectNavigator.Browser.IE) {
	navigateur = "IE";
}
else if(DetectNavigator.Browser.Gecko) {
	navigateur = "Firefox";
}
else if(DetectNavigator.Browser.Opera) {
	navigateur = "Opera";
}