// ==============================================================================
// WhosOn LiveStats & Chat Gateway script www.whoson.com
// (c) 2006 Parker Software Ltd
// ==============================================================================
// This script should be placed in the root directory of your web site. It should
// be included in each page you want to track.
// Place the Include on your page at the place where you want the Click-To-Chat 
// graphic to appear.
// ===============================================================================

var sWOGateway       = "www.bghydro.com:8080";    // specify the address:port of the WhosOn Gateway server
var sWOGatewaySSL    = "www.bghydro.com:444"; // specify the address:port of the WhosOn Gateway server SSL interface
var sWODomain        = "www.bghydro.com";  // the domain you are monitoring
var sWODepartment    = ""; // optional department
var sWOChatstart     = "http://www.bghydro.com/chat/chatstart.htm"; // url to the chatstart.htm page 
var sWOLanguage      = "en"; // language for the chat window
var sWOBackgroundURL = ""; // optional custom background url
var sWOInvite        = "Y";  // set to a blank string if you do NOT want invite requests to be polled
var sWOPreselect     = ""; // set to D to pre-select Department before starting chat, O to pre-select Operator

var sWOSession;
var sWOUrl;
var sWOUser="";
var sWOPage="";
var sWOProtocol=window.location.protocol;

// specify a user name here if you want a specific user name instead of a session cookie
// sWOUser="my user";

// specify a page name here if you want a specific page name shown in WhosOn instead of the window.location
// sWOPage="my page";

var sWOCost=0;    // specify a visit cost 
var sWORevenue=0; // specify the revenue generated by the visitor

if(sWOUser==""){
	// create a unique session cookie for the visitor
	var dt=new Date();
	var sWOCookie=document.cookie.toString();
	if(sWOCookie.indexOf("whoson")==-1){
		sWOSession=parseInt(Math.random()*1000)+"-"+dt.getTime();
		document.cookie="whoson="+sWOSession+";expires=Fri, 31-Dec-2010 00:00:00 GMT;";
	}
	sWOCookie=document.cookie.toString();
	if(sWOCookie.indexOf('whoson')==-1){
		sWOSession="";
	} else {
		var s=sWOCookie.indexOf("whoson=")+7;
		var e=sWOCookie.indexOf(";",s);
		if(e==-1)e=sWOCookie.length;
		sWOSession=sWOCookie.substring(s,e);
	}
}

