﻿function get_information_card()
{
 try
 {
   //asking for the value of the hml token
   var token = document.getElementById("_xmlToken");
   //Asking for the token actually fires the Windows Cardspace
   var value= token.value;
 }
 catch(err)
 {
   //Windows Cardspace is not installed or th euser pressed the cancel buttton
   return;
 }
}
 function AreCardsSupported()
   {
     var IEVer = -1; 
     
     if (navigator.appName == 'Microsoft Internet Explorer')
       if (new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})").exec(navigator.userAgent) != null)
         IEVer = parseFloat( RegExp.$1 );

     if( IEVer > 6 ) 
     { 
       var infocardObject = document.createElement("object");
       infocardObject.setAttribute("type", "application/x-informationcard");
       
       if(  ""+infocardObject.issuerPolicy != "undefined" )
         return true;

       return false;         
      }     

     if( IEVer < 0 && navigator.mimeTypes && navigator.mimeTypes.length)
     {
       x = navigator.mimeTypes['application/x-informationcard'];
       if (x && x.enabledPlugin)
         return true;
     }
     return false;
   }
   function DetectInformationCardSupport()
   {
        if( !AreCardsSupported() )
          // alert( "Information Cards supported." );
       // else
            alert( "Information Cards are NOT supported.  Please install IE 7.0 and .NET Framework 3.0" );
   }