<!-- hide JavaScript from non-JavaScript browsers
//
//  Browser_check.js - used on the ProQuest technical Support Page
//  
//
// Creates "is_" variables indicating:
// (1) browser vendor:
//     is_nav, is_ie, is_opera
// (2) browser version number:
//     is_major (integer indicating major version number: 2, 3, 4 ...)
//     is_minor (float   indicating full  version number: 2.02, 3.01, 4.04 ...)
// (3) browser vendor AND major version number
//     is_nav2, is_nav3, is_nav4, is_nav4up, is_nav5, is_nav5up, 
//     is_nav6, is_nav6up, is_ie3, is_ie4, is_ie4up, is_ie5up, is_ie6...
// (4) JavaScript version number:
//     is_js (float indicating full JavaScript version number: 1, 1.1, 1.2 ...)
// (5) OS platform and version:
//     is_win, is_win16, is_win32, is_win31, is_win95, is_winnt, is_win98
//     is_os2
//     is_mac, is_mac68k, is_macppc
//     is_unix
//        is_sun, is_sun4, is_sun5, is_suni86
//        is_irix, is_irix5, is_irix6
//        is_hpux, is_hpux9, is_hpux10
//        is_aix, is_aix1, is_aix2, is_aix3, is_aix4
//        is_linux, is_sco, is_unixware, is_mpras, is_reliant
//        is_dec, is_sinix, is_freebsd, is_bsd
//     is_vms
//
// Note: you don't want your Nav4 or IE4 code to "turn off" or
// stop working when Nav5 and IE5 (or later) are released, so
// in conditional code forks, use is_nav4up ("Nav4 or greater")
// and is_ie4up ("IE4 or greater") instead of is_nav4 or is_ie4
// to check version in code which you want to work on future
// versions. For DOM tests scripters commonly used the 
// is_getElementById test, but make sure you test your code as
// filter non-compliant browsers (Opera 5-6 for example) as some 
// browsers return true for this test, and don't fully support
// the W3C's DOM1.
//

    // convert all characters to lowercase to simplify testing
    var agt=navigator.userAgent.toLowerCase();
    var appVer = navigator.appVersion.toLowerCase();
/*alert(agt);
alert(appVer);
alert(navigator.appCodeName);
alert(navigator.appName);
alert(navigator.appVersion);
alert(navigator.language);
alert(navigator.mimeTypes);
alert(navigator.platform);
alert(navigator.userAgent);
alert(navigator.plugins);*/

    // *** BROWSER VERSION ***

    var is_minor = parseFloat(appVer);
    var is_major = parseInt(is_minor);

    var is_opera  = (agt.indexOf("opera") != -1);
    var is_opera2 = (agt.indexOf("opera 2") != -1 || agt.indexOf("opera/2") != -1);
    var is_opera3 = (agt.indexOf("opera 3") != -1 || agt.indexOf("opera/3") != -1);
    var is_opera4 = (agt.indexOf("opera 4") != -1 || agt.indexOf("opera/4") != -1);
    var is_opera5 = (agt.indexOf("opera 5") != -1 || agt.indexOf("opera/5") != -1);
    var is_opera6 = (agt.indexOf("opera 6") != -1 || agt.indexOf("opera/6") != -1); // new 020128- abk
    var is_opera7 = (agt.indexOf("opera 7") != -1 || agt.indexOf("opera/7") != -1); // new 021205- dmr
    var is_opera8 = (agt.indexOf("opera 8") != -1 || agt.indexOf("opera/8") != -1); // new 040825- mwm
    var is_opera9 = (agt.indexOf("opera 9") != -1 || agt.indexOf("opera/9") != -1); // new 040825- mwm
    var is_opera5up = (is_opera && !is_opera2 && !is_opera3 && !is_opera4);
    var is_opera6up = (is_opera && !is_opera2 && !is_opera3 && !is_opera4 && !is_opera5); // new020128
    var is_opera7up = (is_opera && !is_opera2 && !is_opera3 && !is_opera4 && !is_opera5 && !is_opera6); // new021205 -- dmr
    var is_opera8up = (is_opera && !is_opera2 && !is_opera3 && !is_opera4 && !is_opera5 && !is_opera6 && !is_opera7); // new021205 -- mwm
    var is_opera9up = (is_opera && !is_opera2 && !is_opera3 && !is_opera4 && !is_opera5 && !is_opera6 && !is_opera8); // new021205 -- mwm

    // Note: On IE, start of appVersion return 3 or 4
    // which supposedly is the version of Netscape it is compatible with.
    // So we look for the real version further on in the string

    var iePos  = appVer.indexOf('msie');
    if (iePos !=-1) {
       is_minor = parseFloat(appVer.substring(iePos+5,appVer.indexOf(';',iePos)))
       is_major = parseInt(is_minor);
    }

    // ditto Konqueror
                                      
    var is_konq = false;
    var kqPos   = agt.indexOf('konqueror');
    if (kqPos !=-1) {                 
       is_konq  = true;
       is_minor = parseFloat(agt.substring(kqPos+10,agt.indexOf(';',kqPos)));
       is_major = parseInt(is_minor);
    }                                 

    var is_getElementById   = (document.getElementById) ? "true" : "false"; // 001121-abk
    var is_getElementsByTagName = (document.getElementsByTagName) ? "true" : "false"; // 001127-abk
    var is_documentElement = (document.documentElement) ? "true" : "false"; // 001121-abk

    var is_safari = ((agt.indexOf('safari')!=-1)&&(agt.indexOf('mac')!=-1))?true:false;
    var is_khtml  = (is_safari || is_konq);
    var is_firefox = (agt.toLowerCase().indexOf('firefox') != -1)?true:false;

    var is_gecko = ((!is_khtml)&&(navigator.product)&&(navigator.product.toLowerCase()=="gecko"))?true:false;
    var is_gver  = 0;
    if (is_gecko) is_gver=navigator.productSub;

    var is_moz   = ((agt.indexOf('mozilla/5')!=-1) && (agt.indexOf('spoofer')==-1) &&
                    (agt.indexOf('compatible')==-1) && (agt.indexOf('opera')==-1)  &&
                    (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1)     &&
                    (is_gecko) && 
                    ((navigator.vendor=="")||(navigator.vendor=="Mozilla")));
    if (is_moz) {
       var is_moz_ver = (navigator.vendorSub)?navigator.vendorSub:0;
       if(!(is_moz_ver)) {
           is_moz_ver = agt.indexOf('rv:');
           is_moz_ver = agt.substring(is_moz_ver+3);
           is_paren   = is_moz_ver.indexOf(')');
           is_moz_ver = is_moz_ver.substring(0,is_paren);
       }
       is_minor = is_moz_ver;
       is_major = parseInt(is_moz_ver);
    }

    var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
                && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
                && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1)
                && (!is_khtml) && (!(is_moz)));

    // Netscape6 is mozilla/5 + Netscape6/6.0!!!
    // Mozilla/5.0 (Windows; U; Win98; en-US; m18) Gecko/20001108 Netscape6/6.0
    // Changed this to use navigator.vendor/vendorSub - dmr 060502   
    // var nav6Pos = agt.indexOf('netscape6');
    // if (nav6Pos !=-1) {
    if ((navigator.vendor)&&
        ((navigator.vendor=="Netscape6")||(navigator.vendor=="Netscape"))&&
        (is_nav)) {
       is_major = parseInt(navigator.vendorSub);
       // here we need is_minor as a valid float for testing. We'll
       // revert to the actual content before printing the result. 
       is_minor = parseFloat(navigator.vendorSub);
    }

    var is_nav2 = (is_nav && (is_major == 2));
    var is_nav3 = (is_nav && (is_major == 3));
    var is_nav4 = (is_nav && (is_major == 4));
    var is_nav4up = (is_nav && is_minor >= 4);  // changed to is_minor for
                                                // consistency - dmr, 011001
    var is_navonly = (is_nav && ((agt.indexOf(";nav") != -1) || (agt.indexOf("; nav") != -1)) );

    var is_nav6   = (is_nav && is_major==6);  // new 010118 mhp
    var is_nav6up = (is_nav && is_minor >= 6) // new 010118 mhp

    var is_nav5   = (is_nav && is_major == 5 && !is_nav6); // checked for ns6
    var is_nav5up = (is_nav && is_minor >= 5);

    var is_nav7   = (is_nav && is_major == 7);
    var is_nav7up = (is_nav && is_minor >= 7);

    var is_ie   = ((iePos!=-1) && (!is_opera) && (!is_khtml));
    var is_ie3  = (is_ie && (is_major < 4));

    var is_ie4   = (is_ie && is_major == 4);
    var is_ie4up = (is_ie && is_minor >= 4);
    var is_ie5   = (is_ie && is_major == 5);
    var is_ie5up = (is_ie && is_minor >= 5);
    
    var is_ie5_5  = (is_ie && (agt.indexOf("msie 5.5") !=-1)); // 020128 new - abk
    var is_ie5_5up =(is_ie && is_minor >= 5.5);                // 020128 new - abk
    
    var is_ie6   = (is_ie && is_major == 6);
    var is_ie6up = (is_ie && is_minor >= 6);

// KNOWN BUG: On AOL4, returns false if IE3 is embedded browser
// or if this is the first browser window opened.  Thus the
// variables is_aol, is_aol3, and is_aol4 aren't 100% reliable.

    var is_aol   = (agt.indexOf("AOL") != -1);
    var is_aol3  = (is_aol && is_ie3);
    var is_aol4  = ((is_aol && is_ie4) || ((agt.indexOf("AOL 4") !=-1) || (agt.indexOf("AOL4")!=-1)  || (agt.indexOf("AOL/4")!=-1)));
    var is_aol5  = ((agt.indexOf("AOL 5") !=-1) || (agt.indexOf("AOL5")!=-1)  || (agt.indexOf("AOL/5")!=-1));
    var is_aol6  = ((agt.indexOf("AOL 6") !=-1) || (agt.indexOf("AOL6")!=-1)  || (agt.indexOf("AOL/6")!=-1));
    var is_aol7  = ((agt.indexOf("AOL 7") !=-1) || (agt.indexOf("AOL7")!=-1)  || (agt.indexOf("AOL/7")!=-1));
    var is_aol8  = ((agt.indexOf("AOL 8") !=-1) || (agt.indexOf("AOL8")!=-1)  || (agt.indexOf("AOL/8")!=-1));
    var is_aol9  = ((agt.indexOf("AOL 9") !=-1) || (agt.indexOf("AOL9")!=-1)  || (agt.indexOf("AOL/9")!=-1));
    var is_aol10 = ((agt.indexOf("AOL 10")!=-1) || (agt.indexOf("AOL10")!=-1) || (agt.indexOf("AOL/10")!=-1));
    
    var is_webtv = (agt.indexOf("webtv") != -1);
    
    // new 020128 - abk
    
    var is_TVNavigator = ((agt.indexOf("navio") != -1) || (agt.indexOf("navio_aoltv") != -1)); 
    var is_AOLTV = is_TVNavigator;

    var is_hotjava = (agt.indexOf("hotjava") != -1);
    var is_hotjava3 = (is_hotjava && (is_major == 3));
    var is_hotjava3up = (is_hotjava && (is_major >= 3));

    // end new
    
    // *** JAVASCRIPT VERSION CHECK ***
    // Useful to workaround Nav3 bug in which Nav3
    // loads <SCRIPT LANGUAGE="JavaScript1.2">.
    // updated 020131 by dragle
    var is_js;
    if (is_nav2 || is_ie3) is_js = 1.0;
    else if (is_nav3) is_js = 1.1;
    else if ((is_opera5)||(is_opera6)) is_js = 1.3; // 020214 - dmr
    else if (is_opera7up) is_js = 1.5; // 031010 - dmr
    else if (is_khtml) is_js = 1.5;   // 030110 - dmr
    else if (is_opera) is_js = 1.1;
    else if ((is_nav4 && (is_minor <= 4.05)) || is_ie4) is_js = 1.2;
    else if ((is_nav4 && (is_minor > 4.05)) || is_ie5) is_js = 1.3;
    else if (is_nav5 && !(is_nav6)) is_js = 1.4;
    else if (is_hotjava3up) is_js = 1.4; // new 020128 - abk
    else if (is_nav6up) is_js = 1.5;

    // NOTE: In the future, update this code when newer versions of JS
    // are released. For now, we try to provide some upward compatibility
    // so that future versions of Nav and IE will show they are at
    // *least* JS 1.x capable. Always check for JS version compatibility
    // with > or >=.

    else if (is_nav && (is_major > 5)) is_js = 1.4;
    else if (is_ie && (is_major > 5)) is_js = 1.3;
    else if (is_moz) is_js = 1.5;
    
    // what about ie6 and ie6up for js version? abk
    
    // HACK: no idea for other browsers; always check for JS version 
    // with > or >=
    else is_js = 0.0;
    // HACK FOR IE5 MAC = js vers = 1.4 (if put inside if/else jumps out at 1.3)
    if ((agt.indexOf("mac")!=-1) && is_ie5up) is_js = 1.4; // 020128 - abk
    
    // Done with is_minor testing; revert to real for N6/7
    if (is_nav6up) {
       is_minor = navigator.vendorSub;
    }
    
    // *** PLATFORM ***
    var is_win   = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );
    // NOTE: On Opera 3.0, the userAgent string includes "Windows 95/NT4" on all
    //        Win32, so you can't distinguish between Win95 and WinNT.
    var is_win95 = ((agt.indexOf("win95")!=-1) || (agt.indexOf("windows 95")!=-1));

    // is this a 16 bit compiled version?
    var is_win16 = ((agt.indexOf("win16")!=-1) ||
               (agt.indexOf("16bit")!=-1) || (agt.indexOf("windows 3.1")!=-1) ||
               (agt.indexOf("windows 16-bit")!=-1) );

    var is_win31 = ((agt.indexOf("windows 3.1")!=-1) || (agt.indexOf("win16")!=-1) ||
                    (agt.indexOf("windows 16-bit")!=-1));
    
    var is_winme = ((agt.indexOf("win 9x 4.90")!=-1));    // new 020128 - abk
    var is_win2k = ((agt.indexOf("windows nt 5.0")!=-1) || (agt.indexOf("windows 2000")!=-1)); // 020214 - dmr
    var is_winxp = ((agt.indexOf("windows nt 5.1")!=-1) || (agt.indexOf("windows xp")!=-1)); // 020214 - dmr

    // NOTE: Reliable detection of Win98 may not be possible. It appears that:
    //       - On Nav 4.x and before you'll get plain "Windows" in userAgent.
    //       - On Mercury client, the 32-bit version will return "Win98", but
    //         the 16-bit version running on Win98 will still return "Win95".
    var is_win98 = ((agt.indexOf("win98")!=-1) || (agt.indexOf("windows 98")!=-1));
    var is_winnt = ((agt.indexOf("winnt")!=-1) || (agt.indexOf("windows nt")!=-1));
    var is_win32 = (is_win95 || is_winnt || is_win98 ||
                    ((is_major >= 4) && (navigator.platform == "Win32")) ||
                    (agt.indexOf("win32")!=-1) || (agt.indexOf("32bit")!=-1));

    var is_os2   = ((agt.indexOf("os/2")!=-1) ||
                    (navigator.appVersion.indexOf("OS/2")!=-1) ||
                    (agt.indexOf("ibm-webexplorer")!=-1));

    var is_mac    = (agt.indexOf("mac")!=-1);
    if (is_mac) { is_win = !is_mac; } // dmr - 06/20/2002
    var is_mac68k = (is_mac && ((agt.indexOf("68k")!=-1) ||
                               (agt.indexOf("68000")!=-1)));
    var is_macppc = (is_mac && ((agt.indexOf("ppc")!=-1) ||
                                (agt.indexOf("powerpc")!=-1)));

    var is_sun      = (agt.indexOf("sunos")!=-1);
    var is_sun4     = (agt.indexOf("sunos 4")!=-1);
    var is_sun5     = (agt.indexOf("sunos 5")!=-1);
    var is_suni86   = (is_sun && (agt.indexOf("i86")!=-1));
    var is_irix     = (agt.indexOf("irix") !=-1);    // SGI
    var is_irix5    = (agt.indexOf("irix 5") !=-1);
    var is_irix6    = ((agt.indexOf("irix 6") !=-1) || (agt.indexOf("irix6") !=-1));
    var is_hpux     = (agt.indexOf("hp-ux")!=-1);
    var is_hpux9    = (is_hpux && (agt.indexOf("09.")!=-1));
    var is_hpux10   = (is_hpux && (agt.indexOf("10.")!=-1));
    var is_aix      = (agt.indexOf("aix") !=-1);      // IBM
    var is_aix1     = (agt.indexOf("aix 1") !=-1);
    var is_aix2     = (agt.indexOf("aix 2") !=-1);
    var is_aix3     = (agt.indexOf("aix 3") !=-1);
    var is_aix4     = (agt.indexOf("aix 4") !=-1);
    var is_linux    = (agt.indexOf("inux")!=-1);
    var is_sco      = (agt.indexOf("sco")!=-1) || (agt.indexOf("unix_sv")!=-1);
    var is_unixware = (agt.indexOf("unix_system_v")!=-1);
    var is_mpras    = (agt.indexOf("ncr")!=-1);
    var is_reliant  = (agt.indexOf("reliantunix")!=-1);
    var is_dec      = ((agt.indexOf("dec")!=-1) || (agt.indexOf("osf1")!=-1) ||
           (agt.indexOf("dec_alpha")!=-1) || (agt.indexOf("alphaserver")!=-1) ||
           (agt.indexOf("ultrix")!=-1) || (agt.indexOf("alphastation")!=-1));
    var is_sinix    = (agt.indexOf("sinix")!=-1);
    var is_freebsd  = (agt.indexOf("freebsd")!=-1);
    var is_bsd      = (agt.indexOf("bsd")!=-1);
    var is_unix     = ((agt.indexOf("x11")!=-1) || is_sun || is_irix || is_hpux ||
                 is_sco ||is_unixware || is_mpras || is_reliant ||
                 is_dec || is_sinix || is_aix || is_linux || is_bsd || is_freebsd);

    var is_vms      = ((agt.indexOf("vax")!=-1) || (agt.indexOf("openvms")!=-1));
// additional checks, abk
    var is_anchors = (document.anchors) ? "true":"false";
    var is_regexp  = (window.RegExp)    ? "true":"false";
    var is_option  = (window.Option)    ? "true":"false";
    var is_all     = (document.all)     ? "true":"false";
// cookies - 990624 - abk
    document.cookie = "cookies=true";
    var is_cookie = (document.cookie)   ? "true":"false";
    var is_images = (document.images)   ? "true":"false";
    var is_layers = (document.layers)   ? "true":"false"; // gecko m7 bug?
    
// new doc obj tests 990624-abk
    var is_forms  = (document.forms)    ? "true":"false";
    var is_links  = (document.links)    ? "true":"false";
    var is_frames = (window.frames)     ? "true":"false";
    var is_screen = (window.screen)     ? "true":"false";

// BROWSER RESOLUTION
function browserRes() {
   document.write( screen.width + ' x ' + screen.height );
}

// java
    var is_java = (navigator.javaEnabled());

// Flash checking code adapted from Doc JavaScript information; 
// see http://webref.com/js/column84/2.html

   var is_Flash        = false;
   var is_FlashVersion = 0;

   if ((is_nav||is_opera||is_moz)||
       (is_mac&&is_ie5up)) {
      var plugin = (navigator.mimeTypes && 
                    navigator.mimeTypes["application/x-shockwave-flash"] &&
                    navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin) ?
                    navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
      if (plugin) {
         is_Flash = true;
         is_FlashVersion = parseInt(plugin.description.substring(plugin.description.indexOf(".")-1));
      }
   }

   if (is_win && is_ie4up) {
      document.write(
         '<script language=VBScript>' + '\n' +
         'Dim hasPlayer, playerversion' + '\n' +
         'hasPlayer = false' + '\n' +
         'playerversion = 10' + '\n' +
         'Do While playerversion > 0' + '\n' +
            'On Error Resume Next' + '\n' +
            'hasPlayer = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & playerversion)))' + '\n' +
            'If hasPlayer = true Then Exit Do' + '\n' +
            'playerversion = playerversion - 1' + '\n' +
         'Loop' + '\n' +
         'is_FlashVersion = playerversion' + '\n' +
         'is_Flash = hasPlayer' + '\n' +
         '<\/script>'
      );
   }

//
// Plugin Detector()
//
var WM_startTagFix = '</';
var msie_windows = 0;
if ((navigator.userAgent.indexOf('MSIE') != -1) && (navigator.userAgent.indexOf('Win') != -1)){
  msie_windows = 1;
  document.writeln('<script language="VBscript">');
  document.writeln('\'This will scan for plugins for all versions of Internet Explorer that have a VBscript engine version 2 or greater.');
  document.writeln('\'This includes all versions of IE4 and beyond and some versions of IE 3.');
  document.writeln('Dim WM_detect_through_vb');
  document.writeln('WM_detect_through_vb = 0');
  document.writeln('If ScriptEngineMajorVersion >= 2 then');
  document.writeln('  WM_detect_through_vb = 1');
  document.writeln('End If');
  document.writeln('Function WM_activeXDetect(activeXname)');
  document.writeln('  on error resume next');
  document.writeln('  If ScriptEngineMajorVersion >= 2 then');
  document.writeln('     WM_activeXDetect = False');
  document.writeln('     WM_activeXDetect = IsObject(CreateObject(activeXname))');
  document.writeln('     If (err) then');
  document.writeln('        WM_activeXDetect = False');
  document.writeln('     End If');
  document.writeln('   Else');
  document.writeln('     WM_activeXDetect = False');
  document.writeln('   End If');
  document.writeln('End Function');
  document.writeln(WM_startTagFix+'script>');
}

function WM_pluginDetect(plugindescription, pluginxtension, pluginmime, activeXname)
{
  var i,plugin_undetectable=0,detected=0, daPlugin=new Object();
  if (msie_windows && WM_detect_through_vb)
  {
      plugin_undetectable = 0;
  }
  else
  {
      plugin_undetectable = 1;
  }
  
  if(navigator.plugins)
  {
      numPlugins = navigator.plugins.length;
      if (numPlugins > 1)
      {
        if (navigator.mimeTypes && navigator.mimeTypes[pluginmime] && navigator.mimeTypes[pluginmime].enabledPlugin && (navigator.mimeTypes[pluginmime].suffixes.indexOf(pluginxtension) != -1)) 
        { // seems like we have it, let's just make sure and check the version (if specified)
          if ((navigator.appName == 'Netscape') && (navigator.appVersion.indexOf('4.0') != -1))
          { // Netscape can't handle the references to navigator.plugins by number
	          for(i in navigator.plugins)
	          {
	              if ((navigator.plugins[i].description.indexOf(plugindescription) != -1) || (i.indexOf(plugindescription) != -1))
                  { // some versions of quicktime have no description. 
		              detected=1;
		              break;
                  }
              }
          }
          else
          {
            for (i = 0; i < numPlugins; i++)
            {
              daPlugin = navigator.plugins[i];
              if ((daPlugin.description.indexOf(plugindescription) != -1) || (daPlugin.name.indexOf(plugindescription) != -1))
              {
	              detected=1;
	              break;
              }
            }
          }

          // Mac weirdness
        if (navigator.mimeTypes[pluginmime] == null)
        {
          detected = 0;
        }
      }
      return detected;
      }
      else if((msie_windows == 1) && !plugin_undetectable)
      {
        return WM_activeXDetect(activeXname);
      }
      else
      {      
        return 0;
      }
  }
  else
  {
      return 0;
  }
}

function WM_easyDetect(whichPlugin) {
    var isItThere = 0;
    if( (whichPlugin == 'flash') || (whichPlugin == 'Flash') ) {
        isItThere = WM_pluginDetect('Flash', 'swf', 'application/x-shockwave-flash', 'ShockwaveFlash.ShockwaveFlash');
    } else if( (whichPlugin == 'director') || (whichPlugin == 'Director') ) {
        isItThere = WM_pluginDetect('Shockwave', 'dcr', 'application/x-director', 'SWCtl.SWCtl.1');
    } else if( (whichPlugin == 'quicktime') || (whichPlugin == 'Quicktime') || (whichPlugin == 'QuickTime') ) {
        isItThere = WM_pluginDetect('QuickTime', 'mov', 'video/quicktime', '');
    } else if( (whichPlugin == 'realaudio') || (whichPlugin == 'Realaudio') || (whichPlugin == 'RealAudio') ) {
        isItThere = (WM_pluginDetect('RealPlayer', 'rpm', 'audio/x-pn-realaudio-plugin', 'RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)')) || (WM_pluginDetect('RealPlayer', 'rpm', 'audio/x-pn-realaudio-plugin','rmocx.RealPlayer G2 Control')) || (WM_pluginDetect('RealPlayer', 'rpm', 'audio/x-pn-realaudio-plugin','RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)')) || (WM_pluginDetect('RealPlayer', 'rpm', 'audio/x-pn-realaudio-plugin','RealVideo.RealVideo(tm) ActiveX Control (32-bit)'))
    } else {
        alert('You need to tell me which plug-in to look for, like so:\n\n' + '          WM_easyDetect(\'flash\')\n\n' + '          WM_easyDetect(\'director\')\n\n' + '          WM_easyDetect(\'quicktime\')\n\n' + '          WM_easyDetect(\'realaudio\')');
    }
    return isItThere;
}

function RealPlayer() {
  var real = 0;
  if (WM_easyDetect('realaudio') == 0) {
    document.write("Real Player is not supported");
  } else {
    document.write("Real Player Supported");
  }
}

// OPERATING SYSTEM (OS) TEST
function osCheck(nameOrImage) {
  var result;
  var result2 = nameOrImage;

    if (navigator.userAgent.indexOf("NT 5.0") != -1) {
       if (result2 == 0) {document.write("Win 2000");}
       // set result to 0 - critical; 1 - okay; 2 - warning
       result=1;
       return result;
    } else if (navigator.userAgent.indexOf("NT 5.1") != -1) {
        if (result2 == 0) {document.write("WinXP");}
        result=1;
        return result;
    } else if (navigator.userAgent.indexOf("NT 4.0") != -1) {
        if (result2 == 0) {document.write("NT 4.0");}
        result=1;
        return result;
    } else if (navigator.userAgent.indexOf("NT") != -1) {
        if (result2 == 0) {document.write("Win NT");}
        result=1;
        return result;
    } else if (navigator.userAgent.indexOf("Win 9x 4.90") != -1) {
        if (result2 == 0) {document.write("WinME");}
        result=2;
        return result;
    } else if ((navigator.userAgent.indexOf("Win98") != -1) || (navigator.userAgent.indexOf("Windows 98") != -1) || (navigator.userAgent.indexOf("W98") != -1)) {
        if (result2 == 0) {document.write("Win 98");}
        result=1;
        return result;
    } else if (navigator.userAgent.indexOf("Mac OS X") != -1) {
       if (result2 == 0) {document.write("Mac OS X");}
       result=1;
       return result;
    } 
    // Mac IE 5.2.3 is only available on OS X or above
    else if (navigator.userAgent.indexOf("MSIE 5.23") != -1) {
       if (result2 == 0) {document.write("Mac OS X");}
       result=1;
       return result;
    } else if (navigator.userAgent.indexOf("Mac") != -1) {
	   if (result2 == 0) {document.write("Mac");}
	   result=2;
	   return result;
    } else if ((navigator.userAgent.indexOf("Win95") != -1) || (navigator.userAgent.indexOf("Windows 95") != -1) || (navigator.userAgent.indexOf("W95") != -1) || (navigator.userAgent.indexOf("Windows 9.x") != -1)) {
       if (result2 == 0) {document.write("Win 95");}
       result=0;
       return result;
    } else if (navigator.userAgent.indexOf("Windows") != -1) {
       if (result2 == 0) {document.write("Windows");}
       result=2;
       return result;
    } else {
       if (result2 == 0) {findOS()}
       result=2;
       return result;
    }
}

// OS TEST (PART 2)
function findOS() {
    
    //if (is_win) {document.write("Windows OS, ");}
    //if (is_win16) {document.write("Win16, ");}
    //if (is_win31) {document.write("Win31, ");}
    //if (is_win32) {document.write("Win32, ");}
    if (is_win95) {document.write("Win95 ");}
    if (is_win98) {document.write("Win98 ");}
    if (is_winme) {document.write("WinME ");}
    //if (is_winnt) {document.write("WinNT ");}
    //if (is_win2k) {document.write("Win2000 ");}
    //if (is_winxp) {document.write("WinXP ");}
    if (is_os2) {document.write("OS2 ");}
    if (is_mac) {document.write("Mac ");}
    if (is_mac68k) {document.write("Mac68k ");}
    if (is_macppc) {document.write("MacPPC ");}
    if (is_unix) {document.write("Unix ");}
    if (is_sun) {document.write("Sun, ");}
    if (is_sun4) {document.write("Sun4, ");}
    if (is_sun5) {document.write("Sun5, ");}
    if (is_suni86) {document.write("Suni86, ");}
    if (is_irix) {document.write("Irix, ");}
    if (is_irix5) {document.write("Irix 5, ");}
    if (is_irix6) {document.write("Irix 6, ");}
    if (is_hpux) {document.write("Hpux, ");}
    if (is_hpux9) {document.write("Hpux 9, ");}
    if (is_hpux10) {document.write("Hpux 10, ");}
    if (is_aix) {document.write("aix, ");}
    if (is_aix1) {document.write("aix1, ");}
    if (is_aix2) {document.write("aix2, ");}
    if (is_aix3) {document.write("aix3, ");}
    if (is_aix4) {document.write("aix4, ");}
    if (is_linux) {document.write("Linux, ");}
    if (is_sco) {document.write("sco, ");}
    if (is_unixware) {document.write("Unixware, ");}
    if (is_mpras) {document.write("mpras, ");}
    if (is_reliant) {document.write("reliant, ");}
    if (is_dec) {document.write("dec, ");}
    if (is_sinix) {document.write("sinix, ");}
    if (is_bsd) {document.write("BSD, ");}
    if (is_freebsd) {document.write("FreeBSD, ");}
    if (is_vms) {document.write("Vms, ");}
    else {document.write("N/A");}
    //return true;
}

function browserName() {
    var napp=navigator.appName;
    if (napp == "Microsoft Internet Explorer") {
        //var chopMS = napp.substring(10,27);
        var chopMS = "IE"
        document.write(chopMS + " " + is_major);
    } else {
    document.write(napp + " " + is_major);
    }
}

function browserTest(nameOrImage) {
  var result;
  var result2 = nameOrImage;
  // set result to 0 - critical; 1 - okay; 2 - warning
  if (navigator.userAgent.indexOf('Safari/125') != -1 ) {
        if (result2 == 0) {document.write("Safari 1.2");}
        var result=1;
        return result;
  } else if (navigator.userAgent.indexOf('Safari/85') != -1 ) {
        if (result2 == 0) {document.write("Safari 1.0");}
        var result=1;
        return result;
  } else if (navigator.userAgent.indexOf('Safari') != -1 ) {
        if (result2 == 0) {document.write("Safari");}
        var result=1;
        return result;
  }
  // NETSCAPE BROWSER TEST -->  anything < v.7 not supported fully
  else if(navigator.userAgent.indexOf('Netscape/7.2') != -1 ) {
        if (result2 == 0) {document.write("Netscape 7.2");}
        var result=1;
        return result;
  } else if (navigator.userAgent.indexOf('Netscape/7.1') != -1 ) {
        if (result2 == 0) {document.write("Netscape 7.1");}
        var result=1;
        return result;
  } else if (navigator.userAgent.indexOf('Netscape/7.02') != -1 ) {
        if (result2 == 0) {document.write("Netscape 7.02");}
        var result=1;
        return result;
  } else if (navigator.userAgent.indexOf('Netscape/7.01') != -1 ) {
        if (result2 == 0) {document.write("Netscape 7.01");}
        var result=1;
        return result;
  } else if (navigator.userAgent.indexOf('Netscape/7') != -1 ) {
        if (result2 == 0) {document.write("Netscape 7.x");}
        var result=1;
        return result;
  } else if (navigator.userAgent.indexOf('Netscape6/6.2.3') != -1 ) {
        if (result2 == 0) {document.write("Netscape 6.2.3");}
        var result=2;
        return result;
  } else if (navigator.userAgent.indexOf('Netscape6/6.2.1') != -1 ) {
        if (result2 == 0) {document.write("Netscape 6.2.1");}
        var result=2;
        return result;
  } else if (navigator.userAgent.indexOf('Netscape6/6.2') != -1 ) {
        if (result2 == 0) {document.write("Netscape 6.2");}
        var result=2;
        return result;
  } else if (navigator.userAgent.indexOf('Netscape6/6.1') != -1 ) {
        if (result2 == 0) {document.write("Netscape 6.1");}
        var result=2;
        return result;
  } else if ((navigator.userAgent.indexOf('Netscape/6') != -1 ) || (navigator.userAgent.indexOf('Netscape6') != -1)) {
        if (result2 == 0) {document.write("Netscape 6");}
        var result=2;
        return result;
  } else if (navigator.userAgent.indexOf('Mozilla/4.8') != -1 ) {
        if (result2 == 0) {document.write("Netscape 4.8");}
        var result=0;
        return result;
  } else if (navigator.userAgent.indexOf('Mozilla/4.79') != -1 ) {
        if (result2 == 0) {document.write("Netscape 4.79");}
        var result=0;
        return result;
  } else if (navigator.userAgent.indexOf('Mozilla/4.77') != -1 ) {
        if (result2 == 0) {document.write("Netscape 4.77");}
        var result=0;
        return result;
  } else if (navigator.userAgent.indexOf('Mozilla/4.75') != -1 ) {
        if (result2 == 0) {document.write("Netscape 4.75");}
        var result=0;
        return result;
  } else if (navigator.userAgent.indexOf('Mozilla/4.72') != -1 ) {
        if (result2 == 0) {document.write("Netscape 4.72");}
        var result=0;
        return result;
  } else if (navigator.userAgent.indexOf('Mozilla/4.7') != -1 ) {
        if (result2 == 0) {document.write("Netscape 4.7");}
        var result=0;
        return result;
  } else if (navigator.userAgent.indexOf('Mozilla/4.61') != -1 ) {
        if (result2 == 0) {document.write("Netscape 4.61");}
        var result=0;
        return result;
  } else if (navigator.userAgent.indexOf('Mozilla/4.08') != -1 ) {
        if (result2 == 0) {document.write("Netscape 4.08");}
        var result=0;
        return result;
  }
  // MAC IE BROWSER TEST --> anything less than 5.1.6 is not supported
  else if (navigator.userAgent.indexOf("Mac") != -1) {   
        if (navigator.userAgent.indexOf("MSIE 5.23") != -1) {
            if (result2 == 0) {document.write("IE 5.2.3");}
            var result=1;
            return result;
        } else if (navigator.userAgent.indexOf("MSIE 5.22") != -1) {
            if (result2 == 0) {document.write("IE 5.2.2");}
            var result=1;
            return result;
        } else if (navigator.userAgent.indexOf("MSIE 5.17") != -1) {
            if (result2 == 0) {document.write("IE 5.1.7");}
            var result=1;
            return result;
        } else if (navigator.userAgent.indexOf("MSIE 5.16") != -1) {
            if (result2 == 0) {document.write("IE 5.1.6");}
            var result=1;
            return result;
        } else if (navigator.userAgent.indexOf("MSIE 5.14") != -1) {
            if (result2 == 0) {document.write("IE 5.1.4");}
            var result=0;
            return result;
        } else if (navigator.userAgent.indexOf("MSIE 5.13") != -1) {
            if (result2 == 0) {document.write("IE 5.1.3");}
            var result=0;
            return result;
        } else if (navigator.userAgent.indexOf("MSIE 5.12") != -1) {
            if (result2 == 0) {document.write("IE 5.1.2");}
            var result=0;
            return result;
        } else if (navigator.userAgent.indexOf("MSIE 5.0") != -1) {
            if (result2 == 0) {document.write("IE 5.0");}
            var result=0;
            return result;
        } else if (navigator.userAgent.indexOf("MSIE 4.5") != -1) {
            if (result2 == 0) {document.write("IE 4.5");}
            var result=0;
            return result;
        } else if (navigator.userAgent.indexOf("MSIE 4.01") != -1) {
            if (result2 == 0) {document.write("IE 4.0.1");}
            var result=0;
            return result;
        } else if ((navigator.userAgent.indexOf('MSIE') != -1 ) && (is_minor < 5.16)) {
            document.write("IE " + is_minor);
            var result=2;
            return result;
        } 
        // MAC FIREFOX BROWSER TEST
        else if (navigator.userAgent.toLowerCase().indexOf('firefox') != -1 )  {
		    if (result2 == 0) {document.write("Firefox");}
		    var result=1;
		    return result;
		} else {document.write("N/A");
		    var result=2;
		    return result;
        }
  }
  // FIREFOX BROWSER TEST
  else if (navigator.userAgent.toLowerCase().indexOf('firefox') != -1 )
  {
        if (result2 == 0) {document.write("Firefox");}
        var result=1;
        return result;
  }
  // AOL BROWSER TEST
  else if (navigator.userAgent.indexOf("AOL")!= -1) {
	    var is_aol4  = ((navigator.userAgent.indexOf("AOL 4") !=-1) || (navigator.userAgent.indexOf("AOL4")!=-1)  || (navigator.userAgent.indexOf("AOL/4")!=-1));
	    var is_aol5  = ((navigator.userAgent.indexOf("AOL 5") !=-1) || (navigator.userAgent.indexOf("AOL5")!=-1)  || (navigator.userAgent.indexOf("AOL/5")!=-1));
	    var is_aol6  = ((navigator.userAgent.indexOf("AOL 6") !=-1) || (navigator.userAgent.indexOf("AOL6")!=-1)  || (navigator.userAgent.indexOf("AOL/6")!=-1));
	    var is_aol7  = ((navigator.userAgent.indexOf("AOL 7") !=-1) || (navigator.userAgent.indexOf("AOL7")!=-1)  || (navigator.userAgent.indexOf("AOL/7")!=-1));
	    var is_aol8  = ((navigator.userAgent.indexOf("AOL 8") !=-1) || (navigator.userAgent.indexOf("AOL8")!=-1)  || (navigator.userAgent.indexOf("AOL/8")!=-1));
	    var is_aol9  = ((navigator.userAgent.indexOf("AOL 9") !=-1) || (navigator.userAgent.indexOf("AOL9")!=-1)  || (navigator.userAgent.indexOf("AOL/9")!=-1));
	    var is_aol10 = ((navigator.userAgent.indexOf("AOL 10")!=-1) || (navigator.userAgent.indexOf("AOL10")!=-1) || (navigator.userAgent.indexOf("AOL/10")!=-1));
           if (is_aol10) {
                if (result2 == 0) {document.write("AOL 10");}
                var result=1;
                return result;
           } else if (is_aol9) {
                if (result2 == 0) {document.write("AOL 9");}
                var result=1;
                return result;
           } else if (is_aol8) {
                if (result2 == 0) {document.write("AOL 8");}
                var result=1;
                return result;
           } else if (is_aol7) {
                if (result2 == 0) {document.write("AOL 7");}
                var result=1;
                return result;
           } else if (is_aol6) {
                if (result2 == 0) {document.write("AOL 6");}
                var result=1;
                return result;
           } else if (is_aol5) {
                if (result2 == 0) {document.write("AOL 5");}
                var result=1;
                return result;
           } else if (is_aol4) {
                if (result2 == 0) {document.write("AOL 4");}
                var result=0;
                return result;
           } else if (is_aol3) {
                if (result2 == 0) {document.write("AOL 3");}
                var result=0;
                return result;
           } else {
                if (result2 == 0) {document.write("AOL");}
                var result=0;
                return result;
           }
  }
  // MS INTERNET EXPLORER TEST
  else if (navigator.userAgent.indexOf('MSIE') != -1 )
  {
        if (result2 == 0) {
            document.write("IE" + " " + is_minor);
                if (is_minor < 5.16 && is_mac) {
                    var result=2;
                    return result;
                } else {
                    var result=1;
                    return result;
                }
        } else {
            var result=1;
            return result;
        }
  }
  // GIVE UP, I DON'T KNOW TEST
  else if (navigator.appName != "")
  {
        if (result2 == 0) {document.write(navigator.appName + " " + is_minor);}
        var result=2;
        return result;
  }
  else
  {
        if (result2 == 0) {document.write("undetermined");}
        var result=2;
        return result;
  } 
}

function flashCheck(nameOrImage) {
    var isItThere = WM_pluginDetect('Flash', 'swf', 'application/x-shockwave-flash', 'ShockwaveFlash.ShockwaveFlash');
    var result;
    var result2 = nameOrImage;
    if (isItThere) {
        if (result2 == 0) {
            document.write("Yes");
        }
        result = 1;
        return result;
    } else {
        if (result2 == 0) {
            document.write("No");
        }
        result = 0;
        return result;
    }
}

function flashVersion() {
  if ( is_Flash ) {document.write("v." + is_FlashVersion );}
}

function ipCheck(nameOrImage) {
    var ipAddress = '<!--#echo var="REMOTE_ADDR"-->';
    var result2 = nameOrImage;
    if (ipAddress != -1) {
        if (result2 == 0) {
            document.write(IPAddress);
        }
        result = 1;
        return result;
    } else {
        if (result2 == 0) {
            document.write("None Detected");
        }
        result = 0;
        return result;
    }
}

function javaCheck(nameOrImage) {
	var java=new Object();
	java.installed=navigator.javaEnabled() ? true:false;
	java.version='0.0';
	
	var numPlugs=navigator.plugins.length;
		if (numPlugs) {
		    for (var x=0; x<numPlugs; x++) {
		        var pluginjava = navigator.plugins[x];
		
		        if (pluginjava.name.toLowerCase().indexOf('java plug-in') != -1) {
		            //java.version=pluginjava.description.toLowerCase().split('java plug-in ')[1].split(' for')[0];
		            break;
		        }
		    }
		}
	
	var result;
	var result2 = nameOrImage;
	    if (java.installed) {
	        if (result2 == 0) {
	            if (java.version == "0.0") {
	                document.write("Yes");
	            } else {
	                document.write(java.version);
	            }
	        }
	        result = 1;
	        return result;
	     } else {
	        if (result == 0) {
	            document.write("No");
	        }
	        result = 0;
	        return result;
	     }
}

function pickImage(whichOne) {
    switch (whichOne) {
        case 0:
            var whichImage = "critical";
            break;
        case 1:
            var whichImage = "thumbsup";
            break;
        case 2:
            var whichImage = "warning";
            break;
        default:
    }
    document.write("<img name=\"" + whichImage + "\" src=\"hc-images/login/ico_" + whichImage + ".gif\" width=\"21\" height=\"18\" border=0>");
    eval("get" + whichImage + "()");
}


function browserImage() {
    var browserResult = browserTest("1");
    pickImage(browserResult);
}

function platformImage() {
    var osResult = osCheck("1");
    pickImage(osResult)
}

function resolutionImage() {
    if (screen.width < 800) {var resResult = 2;}
    else {var resResult = 1;}
    pickImage(resResult);
}

function cookieImage() {
    setCookie("testcookie", true, "", "/", "", "");
    var cookieResult = getCookie("testcookie");
    if (cookieResult) {var cookieResult = 1;}
    else              {var cookieResult = 0;}
    pickImage(cookieResult);
}

function srvrcookieImage() {
    var cookieResult = getCookie("srvrtest");
    if (cookieResult) {var cookieResult = 1;}
    else              {var cookieResult = 0;}
    pickImage(cookieResult);
}

function flashImage() {
    var flashResult = flashCheck("1");
    pickImage(flashResult);
}

function pdfImage() {
    var pdfResult = pluginDetect("detectPDF()", "1");
    pickImage(pdfResult);
}

function ipImage() {
    var IPAddress = ipCheck("1");
    pickImage(ipResult);
}

var countWarning=0;
var countCritical=0;
var countThumbsUp=0;
function getthumbsup() {var incrementThumbsUp = countThumbsUp++;}
function getwarning()  {var incrementWarning = countWarning++;}
function getcritical() {var incrementCritical = countCritical++;}

function healthCheckResult(w, c, t) {
    var stringA = "The Browser Health Check has found ";
    if (countWarning > 0) {
        stringA += "<span style=\'color:#ff6600\'>" + countWarning + " warning</span>";
    }
    if (countWarning > 0 && countCritical > 0) {
        stringA += " and ";
    }
    if (countCritical > 0) {
        stringA += "<span style=\'color:#cc0000\'>" + countCritical + " critical</span>";
    }
    if (countWarning < 1 && countCritical < 1) {
        stringA += " no ";
    }
    stringA += " item(s) that may likely affect your experience with ProQuest Products.";
    document.write(stringA);   
}

function healthResult(w) {
    var stringA = "The Browser Health Check has found ";
	countWarning = countWarning + w;
    if (countWarning > 0) {
        stringA += "<span style=\'color:#ff6600\'>" + countWarning + " warning</span>";
    }
    if (countWarning > 0 && countCritical > 0) {
        stringA += " and ";
    }
    if (countCritical > 0) {
        stringA += "<span style=\'color:#cc0000\'>" + countCritical + " critical</span>";
    }
    if (countWarning < 1 && countCritical < 1) {
        stringA += " no ";
    }
    stringA += " item(s) that will likely affect your experience with ProQuest Products. ";
    document.write(stringA);   
}

function pluginDetect(whichPlug, nameOrImage) {
	detectableWithVB = false;
	pluginFound = false;
	
	function detectQuickTime() {pluginFound = detectPlugin('QuickTime'); if(!pluginFound && detectableWithVB) {pluginFound = detectQuickTimeActiveXControl();}
	    return pluginFound;}
	function detectReal() {pluginFound = detectPlugin('RealPlayer');if(!pluginFound && detectableWithVB) {pluginFound = (detectActiveXControl('rmocx.RealPlayer G2 Control') || detectActiveXControl('RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)') || detectActiveXControl('RealVideo.RealVideo(tm) ActiveX Control (32-bit)'));}   
	    return pluginFound;}
	function detectWindowsMedia() {pluginFound = detectPlugin('Windows Media Player');if(!pluginFound && detectableWithVB) {pluginFound = detectActiveXControl('MediaPlayer.MediaPlayer.1');}
	    return pluginFound;}
	function detectAcrobat() {pluginFound = detectPDF ();if(!pluginFound && detectableWithVB) {pluginFound = detectActiveXControl('PDF.PdfCtrl.1');}
	    return pluginFound;}
	function detectPDF () {if (!document.all && document.images) {for (i = 0; i < navigator.mimeTypes.length; i++) {if ((navigator.mimeTypes[i].suffixes.indexOf ("PDF") != -1)  || (navigator.mimeTypes[i].suffixes.indexOf ("pdf") != -1)) {return true;}}
	        return false;}
	return true;}
	
	var result;
	var result2 = nameOrImage;
	if (whichPlug) {
	    if (result2 == 0) {
	        document.write("Yes");
	    }
	    var result = 1;
	    return result;
	} else {
	    if (result2 == 0) {
	        document.write("No");
	    }
	    var result = 2;
	    return result;
	}
}


// COOKIE SCRIPT
// name - name of the cookie
// value - value of the cookie
// [expires] - expiration date of the cookie (defaults to end of current session)
// [path] - path for which the cookie is valid (defaults to path of calling document)
// [domain] - domain for which the cookie is valid (defaults to domain of calling document)
// [secure] - Boolean value indicating if the cookie transmission requires a secure transmission
// * an argument defaults when it is assigned null as a placeholder
// * a null placeholder is not required for trailing omitted arguments
function setCookie(name, value, expires, path, domain, secure) {
  var curCookie = name + "=" + escape(value) +
      ((expires) ? "; expires=" + expires.toGMTString() : "") +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");
  document.cookie = curCookie;
}

function cookieTest() {
    setCookie("testcookie", true, "", "/", "", "");
    var cookieResult = getCookie("testcookie");
    if (cookieResult) {document.write("Yes");}
    else {document.write("No");}
}

function srvrcookieTest() {
    var cookieResult = getCookie("srvrtest");
    if (cookieResult) {document.write("Yes");}
    else {document.write("No");}
}
// name - name of the desired cookie
// * return string containing value of specified cookie or null if cookie does not exist
function getCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}

// name - name of the cookie
// [path] - path of the cookie (must be same as path used to create cookie)
// [domain] - domain of the cookie (must be same as domain used to create cookie)
// * path and domain default if assigned null or omitted if no explicit argument proceeds
function deleteCookie(name, path, domain) {
  if (getCookie(name)) {
    document.cookie = name + "=" +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}

//-->



// this fixes an issue with the old method, ambiguous values 
// with this test document.cookie.indexOf( name + "=" );

// To use, simple do: Get_Cookie('cookie_name'); 
// replace cookie_name with the real cookie name, '' are required
function Get_Cookie( check_name ) {
	// first we'll split this cookie up into name/value pairs
	// note: document.cookie only returns name=value, not the other components
	var a_all_cookies = document.cookie.split( ';' );
	var a_temp_cookie = '';
	var cookie_name = '';
	var cookie_value = '';
	var b_cookie_found = false; // set boolean t/f default f
	
	for ( i = 0; i < a_all_cookies.length; i++ )
	{
		// now we'll split apart each name=value pair
		a_temp_cookie = a_all_cookies[i].split( '=' );
		
		
		// and trim left/right whitespace while we're at it
		cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, '');
	
		// if the extracted name matches passed check_name
		if ( cookie_name == check_name )
		{
			b_cookie_found = true;
			// we need to handle case where cookie has no value but exists (no = sign, that is):
			if ( a_temp_cookie.length > 1 )
			{
				cookie_value = unescape( a_temp_cookie[1].replace(/^\s+|\s+$/g, '') );
			}
			// note that in cases where cookie is initialized but no value, null is returned
			return cookie_value;
			break;
		}
		a_temp_cookie = null;
		cookie_name = '';
	}
	if ( !b_cookie_found ) 
	{
		return null;
	}
}

/*
only the first 2 parameters are required, the cookie name, the cookie
value. Cookie time is in milliseconds, so the below expires will make the 
number you pass in the Set_Cookie function call the number of days the cookie
lasts, if you want it to be hours or minutes, just get rid of 24 and 60.

Generally you don't need to worry about domain, path or secure for most applications
so unless you need that, leave those parameters blank in the function call.
*/
function Set_Cookie( name, value, expires, path, domain, secure ) {
	// set time, it's in milliseconds
	var today = new Date();
	today.setTime( today.getTime() );
	// if the expires variable is set, make the correct expires time, the
	// current script below will set it for x number of days, to make it
	// for hours, delete * 24, for minutes, delete * 60 * 24
	if ( expires )
	{
		expires = expires * 1000 * 60 * 60 * 24;
	}
	//alert( 'today ' + today.toGMTString() );// this is for testing purpose only
	var expires_date = new Date( today.getTime() + (expires) );
	//alert('expires ' + expires_date.toGMTString());// this is for testing purposes only

	document.cookie = name + "=" +escape( value ) +
		( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + //expires.toGMTString()
		( ( path ) ? ";path=" + path : "" ) + 
		( ( domain ) ? ";domain=" + domain : "" ) +
		( ( secure ) ? ";secure" : "" );
}

// this deletes the cookie when called
function Delete_Cookie( name, path, domain ) {
	if ( Get_Cookie( name ) ) document.cookie = name + "=" +
			( ( path ) ? ";path=" + path : "") +
			( ( domain ) ? ";domain=" + domain : "" ) +
			";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}