function getCookie(name) {
	var result = null; 
	var myCookie = " " + document.cookie + ";";
	var searchName = " " + name + "=";
	var startOfCookie = myCookie.indexOf(searchName); 
	var endOfCookie; 
	if (startOfCookie != -1) {
		startOfCookie += searchName.length; 
		endOfCookie = myCookie.indexOf(";", startOfCookie); 
		result = unescape(myCookie.substring(startOfCookie, endOfCookie)); 
	}
	return result; 
}

if ( navigator.javaEnabled() )
{

document.write("<APPLET ID=\"idGROOPZ\" CODEBASE=http://www.planetrealestate.com/groopz/groopz2");
document.write(" CODE=com.diginet.groopz.suite.ec.applet.GroopzApplet.class ");

if ( groopzPopup )
{
  document.write(" WIDTH=129 ");
  document.write(" HEIGHT=32 ");
}
else
{
  document.write(" WIDTH=10 ");
  document.write(" HEIGHT=10 ");
}

document.write(" MAYSCRIPT ");
document.write(" ARCHIVE=GroopzApplet.jar ");
document.write(" name=GroopzApplet> ");

var user_id = getCookie("USER_ID");
var firstName = '';
if ( user_id )
{
  gid=user_id;
  firstName = getCookie("FIRST_NAME");
}
else
{
  gid = getCookie("GroopzUID");
}

if(gid == null) {
	gid = Math.random();
	var dat = new Date();
	dat.setTime(dat.getTime() + 365*24*60*60*1000); 
	var expString = "; domain=www.planetrealestate.com; path=/; expires=" + dat.toGMTString();
	document.cookie = "GroopzUID" + "=" + escape(gid) + expString; 
}

if ( customParams ){
  document.write( customParams );
}


if (!groopzPopup ){

/* support section */
document.write(' <param name="customParam2" value ="Support-Browser-Advanced">');
document.write(' <param name="customValue2" value ="'+
  navigator.appName+' '+
  navigator.appVersion+' ( '+
  navigator.platform+' / '+
  navigator.cpuClass+' )">');

if (window.ScriptEngine){
  tempstring = 
    ScriptEngine()+' '+
    ScriptEngineMajorVersion()+'.'+
    ScriptEngineMinorVersion()+ ' Build '+
    ScriptEngineBuildVersion();
}else{
  tempstring='Yes';
}

document.write(' <param name="customParam3" value ="Support-JavaScript">');
document.write(' <param name="customValue3" value ="'+tempstring+'">');

var strFlash = new String();

if (flashinstalled == 0){
  strFlash += 'Unknown';
}
  if (flashinstalled == 1){
    strFlash += 'No';
  }
if (flashinstalled == 2){
  strFlash += 'Yes';
}

if (flashversion){
  strFlash += ' ( v'+flashversion+' )';
}

document.write(' <param name="customParam4" value ="Support-Flash">');
document.write(' <param name="customValue4" value ="'+strFlash+'">');

/******************************************
      Browser sniffer script - EVIL!!
  Written by Mark Wilton-Jones, 30/8/2002
*******************************************

Before you use this, I want you to read this. It is important.

You should NEVER use this method to determine browser support.
You should ALWAYS check if the browser supports what you are
trying to do. It is arrogant to assume that you know exactly
how all browsers behave. This technique should only be used if
you know that a specific browser has a specific bug that you
need to avoid. Then and ONLY then should you detect that browser
and write a browser specific script for it.

This script can be used to detect all 4th+ generation browsers
that I know of, even if they attempt to masq their identity
(unlike most 'browser sniffer' scripts). This algorithm will
fail if a browser that I do not know about is being used. That
is highly possible. I'm sure that there are others that I do
not know about. I am sure that there are some that this script
can detect that YOU did not know about. This script will also
fail if future versions of these browsers are released that
behave differently to their ancestors. Every type of 'browser
sniffer' will fail if that happens. That means that every time
a new browser is released, you will have to rewrite every
browser sniffer you use and update it for the new browser.

To save yourself the waste of time, and to save your viewers
the frustration of having to contend with such a bad programming
style, ALWAYS detect a browser's capabilities, not its make or
version number.

if( window.focus ) { window.focus(); }

if( document.all ) { myElement = document.all['myElementID']; }

if( window.screen ) { myHeight = window.screen.height; }
_____________________________________________________________________________________________________

I DO NOT authorise this script's use for determining script support.
It is only to be used according to the guidelines given above.
_____________________________________________________________________________________________________

To use, simply put the line:
<script type="text/javascript" language="javascript1.2" src="PATH TO SCRIPT/sniffer.js"></script>
inbetween the <head> tags of your document, before ANY OTHER scripts.

Four variables will be created:
yourBro[0] = browser code, yourBro[1] = browser name, yourBro[2] = operating system code, yourBro[3] = operating system name

Possible results:

Browser code | Browser name
-------------|----------------------------
    ice      | ICEbrowser
    op7      | Opera 7+
    opr      | Opera 6-
    ipn      | iPanel MicroBrowser
    icb      | iCab
    hjv      | HotJava
    kde      | Konqueror / Safari
    wtv      | WebTV
    nbx      | Netgem NetBox
    otv      | OpenTV
    omn      | Omniweb
    esc      | Escape (or iBrow - I think)
    ns4      | Netscape 4
    gek      | Gecko engine (Mozilla, Netscape 6+ etc.)
    clu      | Clue browser
    ie4      | Internet Explorer 4
    ie5      | Internet Explorer 5+
    oth      | an unknown browser

Operating system code | Operating system name
----------------------|----------------------------
         lin          | Linux
         unx          | Unix
         mac          | MacOS
         win          | Windows
         wtv          | WebTV Platform
         ngm          | Netgem
         otv          | OpenTV Platform
         oth          | an unknown operating system
___________________________________________________________________________________________________*/

var yourBro = [];

//perform checks for different browsers
if( navigator.vendor == 'KDE' ) { yourBro[0] = 'kde'; yourBro[1] = 'Konqueror / Safari'; }
else if( navigator.__ice_version ) { yourBro[0] = 'ice'; yourBro[1] = 'ICEbrowser'; }
else if( window.ScriptEngine && ScriptEngine().indexOf( 'InScript' ) + 1 ) { yourBro[0] = 'icb'; yourBro[1] = 'iCab'; }
else if( navigator.userAgent.toLowerCase().indexOf( 'hotjava' ) + 1 && typeof( navigator.mimeTypes ) == 'function' ) { yourBro[0] = 'hjv'; yourBro[1] = 'HotJava'; }
else if( document.layers && !document.classes ) { yourBro[0] = 'omn'; yourBro[1] = 'Omniweb'; }
else if( document.layers && !navigator.mimeTypes['*'] ) { yourBro[0] = 'esc'; yourBro[1] = 'Escape or iBrow'; }
else if( document.layers ) { yourBro[0] = 'ns4'; yourBro[1] = 'Netscape 4'; }
else if( window.opera && document.childNodes ) { yourBro[0] = 'op7'; yourBro[1] = 'Opera 7+'; }
else if( navigator.userAgent.toLowerCase().indexOf( 'opera' ) + 1 ) { yourBro[0] = 'opr'; yourBro[1] = 'Opera 6-'; }
else if( navigator.appName.indexOf( 'WebTV' ) + 1 ) { yourBro[0] = 'wtv'; yourBro[1] = 'WebTV'; }
else if( navigator.userAgent.toLowerCase().indexOf( 'netgem' ) + 1 ) { yourBro[0] = 'nbx'; yourBro[1] = 'Netgem NetBox'; }
else if( navigator.userAgent.toLowerCase().indexOf( 'opentv' ) + 1 ) { yourBro[0] = 'otv'; yourBro[1] = 'OpenTV'; }
else if( navigator.userAgent.toLowerCase().indexOf( 'ipanel' ) + 1 ) { yourBro[0] = 'ipn'; yourBro[1] = 'iPanel MicroBrowser'; }
else if( document.getElementById && !document.childNodes ) { yourBro[0] = 'clu'; yourBro[1] = 'Clue browser'; }
else if( document.childNodes && !document.all && !navigator.taintEnabled ) { yourBro[0] = 'kde'; yourBro[1] = 'Konqueror / Safari'; }
else if( navigator.product == 'Gecko' ) { yourBro[0] = 'gek'; yourBro[1] = 'Gecko engine (Mozilla, Netscape 6+ etc.)'; }
else if( document.getElementById ) { yourBro[0] = 'ie5'; yourBro[1] = 'Internet Explorer 5+'; }
else if( document.all ) { yourBro[0] = 'ie4'; yourBro[1] = 'Internet Explorer 4'; }
else { yourBro[0] = 'oth'; yourBro[1] = 'an unknown browser'; }

//perform checks for different operating systems
if( navigator.userAgent.toLowerCase().indexOf( 'linux' ) + 1 ) { yourBro[2] = 'lin'; yourBro[3] = 'Linux'; }
else if( navigator.userAgent.toLowerCase().indexOf( 'x11' ) + 1 ) { yourBro[2] = 'unx'; yourBro[3] = 'Unix'; }
else if( navigator.userAgent.toLowerCase().indexOf( 'mac' ) + 1 ) { yourBro[2] = 'mac'; yourBro[3] = 'MacOS'; }
else if( navigator.userAgent.toLowerCase().indexOf( 'win' ) + 1 ) { yourBro[2] = 'win'; yourBro[3] = 'Windows'; }
else if( navigator.userAgent.toLowerCase().indexOf( 'webtv' ) + 1 ) { yourBro[2] = 'wtv'; yourBro[3] = 'WebTV Platform'; }
else if( navigator.userAgent.toLowerCase().indexOf( 'netgem' ) + 1 ) { yourBro[2] = 'ngm'; yourBro[3] = 'Netgem'; }
else if( navigator.userAgent.toLowerCase().indexOf( 'opentv' ) + 1 ) { yourBro[2] = 'otv'; yourBro[3] = 'OpenTV Platform'; }
else { yourBro[2] = 'oth'; yourBro[3] = 'an unknown operating system'; }

document.write(' <param name="customParam5" value ="Support-Browser-Simple">');
document.write(' <param name="customValue5" value ="'+yourBro[1]+' :: '+yourBro[3]+'">');

document.write(' <param name="customParam6" value ="Support-URL">');
document.write(' <param name="customValue6" value ="'+window.location.href+'">');


var dateNow = new Date();
document.write(' <param name="customParam7" value ="Support-Browser-Time">');
document.write(' <param name="customValue7" value ="'+dateNow.toGMTString()+'">');

document.write(' <param name="customParam8" value ="Support-Cookies-Has">');
document.write(' <param name="customValue8" value ="'+document.cookie+'">');

document.write(' <param name="customParam9" value ="Support-Server-Time">');
document.write(' <param name="customValue9" value ="'+serverTime+'">');

if ( navigator.plugins )
{
  var pluginString = new String();
  var i;

  for ( i=0; i<navigator.plugins.length; i++ )
  {
    if ( i != 0 )
    {
      pluginString += ' :: ';
    }
    pluginString += navigator.plugins[i].name;
  }

  //pluginString += new String(':: Java '+version);

  document.write(' <param name="customParam10" value ="Support-Browser-Plugins">');
  document.write(' <param name="customValue10" value ="'+pluginString+'">');
}
else
{
  document.write(' <param name="customParam10" value ="Support-Browser-Plugins">');
  document.write(' <param name="customValue10" value ="Unknown">');
}

}


document.write(" <param name = emailTo value = 'operator@planetrealestate.com'>");
document.write(" <param name = email_Img value = 'pre-logo-email.jpg'>");

// document.write(" <param name = CustomParam1 value = 'user_id'>");
// document.write(" <param name = CustomValue1 value = '77'>");

if ( firstName )
{
  document.write(" <param name = UserName value = '"+firstName+"'>");
}

document.write(" <param name = GroopzUID value = "+gid+">");

// The name of the server to connect to.  This must be the same machine
// that the applet is served from.  For http tunneling, this should be
// the full URL to the HttpTunnelingServlet
document.write(" <param name = server value = www.planetrealestate.com>");	

// The name of the site to connect to.  In the absence of this
// paramter, the default is 1000
document.write(" <param name = site value = 1>");

// The protocol to use by default (tcp, http, udp)
document.write(" <param name = network value = tcp>");
//http tunneling is off by default
document.write(" <param name = allowhttp value = no>");

// The title of the page shown in Groopz Operator.  This value is set to the 
// title of the web page it came from.
if ( groopzPopup && window.opener )
{
  document.write(" <param name = title value = '"+'( Home Chat Popup ) '+window.opener.document.title+"'>");
}
else
{
  document.write(" <param name = title value = '"+document.title+"'>");
}

// The referrer 
if ( groopzPopup && window.opener )
{
  document.write(" <param name = referrer value = '"+window.opener.document.referrer+"'>");
}
else
{
  document.write(" <param name = referrer value = '"+document.referrer+"'>");
}

if ( groopzPopup )
{
  document.write(" <param name = active_img value = groopz-popup-active.gif>");
  document.write(" <param name = away_img value = groopz-popup-away.gif>");
  document.write(" <param name = paging_img value = groopz-popup-paging.gif>");
}
else
{
  document.write(" <param name = active_img value = groopz-active-hidden.gif>");
  document.write(" <param name = away_img value = groopz-away-hidden.gif>");
  document.write(" <param name = paging_img value = groopz-paging-hidden.gif>");
}
document.write(" <param name = skin_img value = groopz-skin-pre.jpg>");
document.write(" <param name = sendup_img value = send-down.gif>");
document.write(" <param name = senddown_img value = send-up.gif>");
document.write(" <param name = closeup_img value = close-down.gif>");
document.write(" <param name = closedown_img value = close-up.gif>");
document.write(" <param name = name_pos value = 91,31>");
document.write(" <param name = close_pos value = 308,257>");
document.write(" <param name = send_pos value = 308,287>");
document.write(" <param name = input_pos value = 10,255,288,57>");
document.write(" <param name = avatar_pos value = 13,15>");
document.write(" <param name = chat_pos value = 10,62,377,181>");

//document.write(" <param name = emailFG value = >");
document.write(" <param name = emailBG value = 249,241,218>");

document.write(" </APPLET>");
document.write(" <!-- End Applet Code -->");


}
