function detectDevice(user_agent)
{
   mobile_base_url = 'http://www.h2i-technologies.eu/index.php?project=smart_h2i&locale=en'

   var html_1 = '';
   var html_2 = ' <a href="'+mobile_base_url+'">h2i smartphone version</a>';

   // Liste des supports mobiles
   var device = new Array(
                  "Blackberry",
                  "Blazer",
                  "Handspring",
                  "iPhone",
                  "iPod",
                  "Kyocera",
                  "LG",
                  "Motorola",
                  "Nokia",
                  "Palm",
                  "PlayStation Portable",
                  "Samsung",
                  "Smartphone",
                  "SonyEricsson",
                  "Symbian",
                  "WAP",
                  "Windows CE"
                );

   var max_device = device.length;

   for(i=0 ; i<max_device ; i++)
   {
      if(user_agent.indexOf(device[i]) != -1)
      {
         if (device[i] == "iPhone")
         {
            document.getElementById('annonce_site_mobile').innerHTML = html_2;
            document.getElementById('annonce_site_mobile').style.display = 'block';
         }
         else if (device[i] == "iPod")
         {
            document.getElementById('annonce_site_mobile').innerHTML = html_2;
            document.getElementById('annonce_site_mobile').style.display = 'block';
         }
         else
         {
            document.getElementById('annonce_site_mobile').innerHTML = html_2;
            document.getElementById('annonce_site_mobile').style.display = 'block';
            //document.location = url_mobile;
         }
         return;
      }
   }
}
