// JavaScript Document
   function showpresence(presence)
   {
      var innerFrame = document.getElementById('innerFrame');
         
      var statusIcon = document.createElement('img');
      statusIcon.style.border = 'none';
      // statusIcon.src = presence.icon.url;
      // statusIcon.width = presence.icon.width;
      // statusIcon.height = presence.icon.height;
      statusIcon.alt = presence.statusText;
      statusIcon.title = presence.statusText;

 

      var imageUrl = '';

      switch (presence.status)

      {

          case 'Online':

              imageUrl = 'images_layout/msn_online.gif'; // TODO: Use your image here

              break;

          case 'Busy':

              imageUrl = 'images_layout/msn_offline.gif'; // TODO: Use your image here

              break;

          case 'OnThePhone':

              imageUrl = 'images_layout/msn_offline.gif'; // TODO: Use your image here

              break;

          case 'Away':

              imageUrl = 'images_layout/msn_offline.gif'; // TODO: Use your image here

              break;

          case 'Idle':

              imageUrl = 'images_layout/msn_offline.gif'; // TODO: Use your image here

              break;

          case 'BeRightBack':

              imageUrl = 'images_layout/msn_offline.gif'; // TODO: Use your image here

              break;

          case 'OutToLunch':

              imageUrl = 'images_layout/msn_offline.gif'; // TODO: Use your image here

              break;

          case 'Offline':

              imageUrl = 'images_layout/msn_offline.gif'; // TODO: Use your image here

              break;

      }

 

      statusIcon.src = imageUrl;

      var displayName = document.createElement('span');
      displayName.style.fontFamily = 'Tahoma, Verdana, sans-serif';
      displayName.style.fontSize = '12pt';
      displayName.title = presence.displayName;
      
      var statusText = document.createElement('span');
      statusText.style.fontFamily = 'Tahoma, Verdana, sans-serif';
      statusText.style.fontSize = '12pt';
      statusText.style.fontWeight = 'bold';	 
	  statusText.style.fontColor = '#fff';	 
      statusText.title = 'MSN ' + presence.statusText;
      
      var br = document.createElement('br');
      
      innerFrame.appendChild(statusIcon);
      innerFrame.appendChild(br);
      innerFrame.appendChild(displayName);
      innerFrame.appendChild(br);
      innerFrame.appendChild(statusText);
      
      if ((displayName.innerText !== undefined)&&(statusText.innerText !== undefined))
      {
         displayName.innerText = presence.displayName;
         statusText.innerText = 'MSN ' + presence.statusText;
      }
      else if ((displayName.textContent != undefined)&&(statusText.textContent !== undefined))
      {
         displayName.textContent = presence.displayName;
         statusText.textContent = 'MSN ' + presence.statusText;
      }
   }
