/**************************************************************************/
/*                                                                        */
/* Copyright (c) 2005,2006 NoMachine, http://www.nomachine.com.           */
/*                                                                        */
/* NXBUILDER, NX protocol compression and NX extensions to this software  */
/* are copyright of NoMachine. Redistribution and use of the present      */
/* software is allowed according to terms specified in the file LICENSE   */
/* which comes in the source distribution.                                */
/*                                                                        */
/* Check http://www.nomachine.com/licensing.html for applicability.       */
/*                                                                        */
/* NX and NoMachine are trademarks of Medialogic S.p.A.                   */
/*                                                                        */
/* All rigths reserved.                                                   */
/*                                                                        */
/**************************************************************************/

browserVersion=parseInt(navigator.appVersion);
browserName=navigator.appName;
var sLinkRel = '';
var site='nxbuilder/';
if(navigator.userAgent.indexOf("Windows") != -1)
{
  if (navigator.appCodeName.indexOf("Explorer") != -1 ||
      navigator.appName.indexOf("Explorer")     != -1)
  {
    //alert("Loading win_ie.css for "+navigator.appCodeName+" - "+navigator.appName);
    sLinkRel += '<link rel=stylesheet href="nxbuilder/style/winie.css" type="text/css">';
  }
  else if (navigator.appCodeName.indexOf("Mozilla") != -1 ||
           navigator.appName.indexOf("Mozilla")     != -1)
  {
    //alert("Loading win_mz.css for "+navigator.appCodeName+" - "+navigator.appName);
    sLinkRel += '<link rel=stylesheet href="nxbuilder/style/winmz.css" type="text/css">';
  }
  else if (navigator.appCodeName.indexOf("Netscape") != -1 ||
           navigator.appName.indexOf("Netscape")     != -1)
  {
    //alert("Loading win_ns.css for "+navigator.appName);
    sLinkRel += '<link rel=stylesheet href="nxbuilder/style/winns.css" type="text/css">';
  }
  else
  {
    //alert("Loading win_ie.css for others");
    sLinkRel += '<link rel=stylesheet href="nxbuilder/style/winie.css" type="text/css">';
  }
}
else if(navigator.userAgent.indexOf("Unix")    != -1 ||
        navigator.userAgent.indexOf("Linux")   != -1 ||
        navigator.userAgent.indexOf("Solaris") != -1 ||
        navigator.userAgent.indexOf("SunOS") != -1)
{
  if (navigator.appCodeName.indexOf("Konqueror") != -1 ||
      navigator.appName.indexOf("Konqueror")     != -1)
  {
    //alert("Loading lin_mz.css for "+navigator.appCodeName+" - "+navigator.appName);
    sLinkRel += '<link rel=stylesheet href="nxbuilder/style/linkq.css" type="text/css">';
  }
  else if (navigator.appCodeName.indexOf("Mozilla") != -1 ||
           navigator.appName.indexOf("Mozilla")     != -1)
  {
    //alert("Loading lin_kq.css for "+navigator.appCodeName+" - "+navigator.appName);
    sLinkRel += '<link rel=stylesheet href="nxbuilder/style/linmz.css" type="text/css">';
  }
  else if (navigator.appCodeName.indexOf("Netscape") != -1 ||
           navigator.appName.indexOf("Netscape")     != -1)
  {
    //alert("Loading lin_ns.css for "+navigator.appName);
    sLinkRel += '<link rel=stylesheet href="nxbuilder/style/linns.css" type="text/css">';
  }
  else
  {
    //alert("Loading win_ie.css for others");
    sLinkRel += '<link rel=stylesheet href="nxbuilder/style/winie.css" type="text/css">';
  }
}
else if (navigator.userAgent.indexOf("Mac") != -1)
{
  if (navigator.appCodeName.indexOf("Explorer") != -1 ||
      navigator.appName.indexOf("Explorer")     != -1||
      navigator.userAgent.indexOf("Safari")     != -1)
  {
    sLinkRel += '<link rel=stylesheet href="nxbuilder/style/macie.css" type="text/css">';
  }
  else if (navigator.userAgent.indexOf("Firefox") != -1)
  {
    sLinkRel += '<link rel=stylesheet href="nxbuilder/style/macns.css" type="text/css">';
  }
  else 
    sLinkRel += '<link rel=stylesheet href="nxbuilder/style/macie.css" type="text/css">';
}
else 
  sLinkRel += '<link rel=stylesheet href="nxbuilder/style/macie.css" type="text/css">';
document.write( sLinkRel );
//alert ("Loaded browser.js successfully: \nLoaded: \n"+sLinkRel);
