if (useJS==true) {
document.write("<APPLET NAME=\"groopz\" CODEBASE=http://" + server + "/groopz2/");
document.write(" CODE=com.diginet.groopz.suite.ec.applet.GroopzApplet.class ");
document.write(" WIDTH=");
document.write((useJS == false) ? button_width + " " :"0 ");
document.write(" HEIGHT=");
document.write((useJS == false) ? button_height + " " :"0 ");
document.write(" MAYSCRIPT ");
document.write(" ARCHIVE=GroopzApplet.jar>");

gid = getCookie("GroopzUID");
if(gid == null) {
	gid = Math.random();
	var dat = new Date();
	dat.setTime(dat.getTime() + 365*24*60*60*1000); 
	var expString = "; expires=" + dat.toGMTString();
	document.cookie = "GroopzUID" + "=" + escape(gid) + expString; 
}

//document.write(" <param name = UserName value = 'MyUser'>");
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 = " + server + ">");	

// The name of the site to connect to.  In the absence of this
// paramter, the default is 1000
document.write(" <param name = site value = " + siteid +">");

// 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 = " + tunneling + ">");

document.write(" <param name = persist value = " + persist + ">");

if(group.length != 0)
	document.write(" <param name = Groups value = " + group + ">");

// The title of the page shown in Groopz Operator.  This value is set to the 
// title of the web page it came from.
document.write(" <param name = title value = '"+document.title+"'>");

// The referrer 
document.write(" <param name = referrer value = '"+document.referrer+"'>");

//e-mail stuff

if(email=="builtin") {
	document.write(" <param name = emailTo value = " + emailTo + " >");
	document.write(" <param name = email_img value = " + email_img + "  >");
	document.write(" <param name = emailBG value = " + emailBG + " >");
	document.write(" <param name = emailFG value = " + emailFG + " >");
}

if(email=="url") {
	document.write(" <param name = emailURL value = " + emailURL + " >");
	document.write(" <param name = emailTarget value = " + emailTarget + "  >");
}

// The URL (relative to the Codebase above) of the image to use as the
// skin of the applet's Chat Dialog
document.write(" <param name = skin_img value = groopz-skin.gif>");

// The URL (relative to the Codebase above) of the image to use as the
// face of the applet when operators are available for calls
document.write(" <param name = active_img value = " + active_img + ">");

// The URL (relative to the Codebase above) of the image to use as the
// face of the applet when no operators are available.
document.write(" <param name = away_img value = " + away_img + ">");

// The URL (relative to the Codebase above) of the image to use as the
// face of the applet when the user clicks and requests help
document.write(" <param name = paging_img value = " + paging_img + ">");

// The URL (relative to the Codebase above) of the image to use as the
// send button in the "up" state (not pressed) (this button is on the Chat Dialog)
document.write(" <param name = sendup_img value = send-up.gif>");

// The URL (relative to the Codebase above) of the image to use as the
// send button in the "down" state (pressed) (this button is on the Chat Dialog)
document.write(" <param name = senddown_img value = send-down.gif>");

// The URL (relative to the Codebase above) of the image to use as the
// close button in the "up" state (not pressed) (this button is on the Chat Dialog)
document.write(" <param name = closeup_img value = close-up.gif>");

// The URL (relative to the Codebase above) of the image to use as the
// close button in the "down" state (pressed) (this button is on the Chat Dialog)
document.write(" <param name = closedown_img value = close-down.gif>");

// The location where the Operator's name should appear.
// This position is the top left corner of the name specified in pixels relative to the top left corner of the Chat Window
// The x and y coordinates are separated by a comma, so the point (100, 95) would be written as value = 100,95
document.write(" <param name = name_pos value = 341,33>");

// The location where the Send button should appear.
// This position is the top left corner specified in pixels relative to the top left corner of the Chat Window
// The x and y coordinates are separated by a comma, so the point (100, 95) would be written as value = 100,95
document.write(" <param name = send_pos value = 337,150>");

// The location where the Close button should appear.
// This position is the top left corner specified in pixels relative to the top left corner of the Chat Window
// The x and y coordinates are separated by a comma, so the point (100, 95) would be written as value = 100,95
document.write(" <param name = close_pos value = 337,120>");

// The location where the message input area should appear.
// This position is the top left corner specified in pixels relative to the top left corner of the Chat Window
// followed by the width and height of the input area.
// The values are separated by a comma, so to put the area at the point (10, 15) with a width and height of  200 X 100
// the value should be written as value = 10,15,200,100
document.write(" <param name = input_pos value = 8,253,316,61>");

// The location where the chat messages should appear.
// This position is the top left corner specified in pixels relative to the top left corner of the Chat Window
// followed by the width and height of the input area.
// The values are separated by a comma, so to put the area at the point (10, 15) with a width and height of  200 X 100
// the value should be written as value = 10,15,200,100
document.write(" <param name = chat_pos value = 8,60,430,185>");

document.write(" </APPLET>");
document.write(" <!-- End Applet Code -->");
}