var eglvchathandle = null;
function openHelp(entryPointName, pid, referrerName, referrerUrl) {
	try {
		if (eglvchathandle != null && eglvchathandle.closed == false) {
			eglvchathandle.focus();
			return;
		}
	}
	catch(err) {}
	if (!referrerName) {
		referrerName = encodeURIComponent("");
	}
	if (!referrerUrl) {
		referrerUrl = encodeURIComponent(document.location.href);
	}
	var hashIndex = referrerUrl.lastIndexOf('#');
	if (hashIndex != -1){
		referrerUrl = referrerUrl.substring(0,hashIndex);
	}
	var w = 630, h = 440;
	var t = 0, l = 0;
	if (window.screen) {
		if (window.screen.availWidth == 800)
			w = window.screen.availWidth * 41 / 100;
		else {
			w = window.screen.availWidth * 31 / 100;
		}
		h = window.screen.availHeight * 50 / 100;
		l = (window.screen.availWidth - w) /100;
	}
	var params =  "width=" + w + ",height=" + h + ",left=" + l + ",top=" + t + ",resizable=yes,scrollbars=yes,toolbar=no";
	eglvchathandle = window.open('http://chat.livebikechat.com/system/LiveCustomerServlet.egain?eglvcmd=CustEntry&entryPointName='+entryPointName+'&eglvepid='+pid+'&departmentid=999&eglvpartid=1&referer='+referrerUrl+'&eglvrefname='+referrerName,'',params);
}

