/*##
 ##
 ## Java Detection
 ##
 ##*/

 function getJava()
 {
   if(navigator.javaEnabled() == true)
   {
     return MSG_ACTIVE;
   }

   else
   {
     return MSG_NOTACTIVE;
   }
 }


 /*##
 ##
 ## Visual Basic Detection
 ##
 ##*/

 var vbactive = false;

 function setVisualBasic()
 {
   vbactive = true;
 }

 function getVisualBasic()
 {
   // Initiiert durch ein VB-Script
   if(vbactive)
   {
     return MSG_ACTIVE;
   }

   else
   {
     return MSG_NOTACTIVE;
   }
 }


 /*##
 ##
 ## ActiveX(SafeMode) Detection
 ##
 ##*/

 function getActiveXSave()
 {
   var ret = MSG_NOTACTIVE;

   try
   {
     ua = new ActiveXObject("Shell.UIHelper");

     ret = MSG_ACTIVE;
   }
   catch(e)
   {
     ret = MSG_NOTACTIVE;
   }

   return ret; 
 }


 /*##
 ##
 ## ActiveX(UnSafe) Detection
 ##
 ##*/

 function getActiveXUnSave()
 {
   var ret = MSG_NOTACTIVE;

   try
   {
     ua = new ActiveXObject("Scripting.FileSystemObject");

     ret = MSG_ACTIVE;
   }
   catch(e)
   {
     ret = MSG_NOTACTIVE;
   }

   return ret; 
 }


 /*##
 ##
 ## Get ClipBoard Content
 ##
 ##*/

 function getClipBoard()
 {
   if( typeof(window.clipboardData) != 'undefined' && window.clipboardData.getData('Text'))
   {
     var clipb = window.clipboardData.getData('Text');

     // Ersetze HTML - Sonderzeichen
     var chars = new Array ('<','>');
     var entities = new Array ('lt','gt');

     for (var i = 0; i < chars.length; i++)
     {
       myRegExp = new RegExp();
       myRegExp.compile(chars[i],'g');

       clipb = clipb.replace (myRegExp, '&' + entities[i] + ';');
     }

     // 100 Zeichen maximaler L&auml;nge, damit das Design nicht gesprengt wird...
     if(clipb.length < 100)
     {
       return clipb;
     }
     else
     {
       return clipb.substr(0, 100) + '...';
     }
   }
   else
   {
     return MSG_NOTACTIVE;
   }
 }


 /*##
 ##
 ## Detect if ZoneAlarm is installed
 ##
 ##*/

 function getZoneAlarm()
 {
   if( typeof(NS_ActualWrite) != 'undefined' )
   {
     return MSG_ACTIVE;
   }
   else
   {
     return MSG_NOTACTIVE;
   }
 }


 /*##
 ##
 ## Detect if NortonInternetSecurity is installed
 ##
 ##*/

 function getNortonInternetSecurity()
 {
   if( typeof(window.SymWinOpen) != 'undefined' || typeof(window.SymRealWinOpen) != 'undefined' )
   {
     return MSG_ACTIVE;
   }
   else
   {
     return MSG_NOTACTIVE;
   }
 }


 /*##
 ##
 ## Detect if a popup-blocker is installed
 ##
 ##*/


 function isPopupblockerActive()
 {
   popupwin = window.open('./poptest.html', 'popupwin', 'width = 200, height = 200, left = 0, top = 0');

	setTimeout("", 500);
	
   if (isPopupblockerInstalledCheck()) return MSG_NOTACTIVE; 
   else return MSG_ACTIVE;
   
 }

 function isPopupblockerInstalledCheck()
 {

   if((popupwin != null) || (typeof(popupwin) != 'undefined') || (typeof(popupwin.location.hash) == 'string'))
   {
     try
     {
       popupwin.close();

       return true;
     }
     catch (e)
     {
       // Opera
       return false;
     }
   }
   else
   {
     return true;
   }

   window.focus();
	
 }

 /*##
 ##
 ## Detect if a WebBug / advertisement - blocker is installed
 ##
 ##*/

 function getOj(oj)
 {
   if(document.getElementById)
   {
     return(document.getElementById(oj));
   }

   else if (document.all)
   {
     return(document.all[oj]);
   }

   else if (document.layers)
   {
     return(document.layers[oj]);
   }
 }


 function isWebbugblockerActive()
 {
   if(getOj('good') && getOj('webbug'))
   {
     return MSG_NOTACTIVE;
   }
   else
   {
     return MSG_ACTIVE;
   }
 }

 
  function isAdblockerActive()
 {
   if(getOj('good') && getOj('ad'))
   {
     return MSG_NOTACTIVE;
   }
   else
   {
     return MSG_ACTIVE;
   }
 }