var lpMTagConfig = {
	// FIRM SPECIFIC SETTINGS
	lpNumber: '74983054',
	imagesPath: 'https://fsimages.findlaw.com/charlesrocklegal',
	width: '475',
	height: '400',
	// THIS PART (BELOW) USUALLY STAYS THE SAME
	lpServer: 'server.iad.liveperson.net',
	lpProtocol: 'https'
};

/*********************************************
	DO NOT MODIFY ANYTHING BELOW THIS LINE
*********************************************/
var livePerson = {
	// Initialization function
	init: function() {
		if (window.attachEvent) window.attachEvent('onload', livePerson.lpAddMonitorTag);
		else window.addEventListener('load', livePerson.lpAddMonitorTag, false);
	},
	// Chat function
	chat: function() {
		lpButtonCTTUrl = 'https://server.iad.liveperson.net/hc/' + lpMTagConfig.lpNumber + '/?cmd=file&amp;file=visitorWantsToChat&amp;site=' + lpMTagConfig.lpNumber + '&amp;imageUrl=' + lpMTagConfig.imagesPath + '&amp;referrer=' + escape(document.location);
		lpButtonCTTUrl = (typeof(lpAppendVisitorCookies) != 'undefined' ? lpAppendVisitorCookies(lpButtonCTTUrl) : lpButtonCTTUrl);
		lpButtonCTTUrl = ((typeof(lpMTag)!='undefined' && typeof(lpMTag.addFirstPartyCookies) != 'undefined') ? lpMTag.addFirstPartyCookies(lpButtonCTTUrl) : lpButtonCTTUrl);
		window.open(lpButtonCTTUrl, 'chat' + lpMTagConfig.lpNumber, 'width=' + lpMTagConfig.width + ',height=' + lpMTagConfig.height + ',resizable=yes');
		return false;
	},
	// Rating function
	rating: function() {
		window.open('http://solutions.liveperson.com/customer-service/?site=' + lpMTagConfig.lpNumber + '&amp;domain=server.iad.liveperson.net&amp;origin=chatbutton&amp;referrer=' + escape(document.location));
		return false;
	},
	// Monitor code
	lpAddMonitorTag: function(src) {
		if (typeof(src) == 'undefined' || typeof(src) == 'object') {
			src = lpMTagConfig.lpMTagSrc ? lpMTagConfig.lpMTagSrc : '/hcp/html/mTag.js';
		}
		if (src.indexOf('http') != 0) { 
			src = lpMTagConfig.lpProtocol + "://" + lpMTagConfig.lpServer + src + '?site=' + lpMTagConfig.lpNumber;
		} else {
			if (src.indexOf('site=') < 0) {
				if (src.indexOf('?') < 0) src = src + '?';
				else src = src + '&';
				src = src + 'site=' + lpMTagConfig.lpNumber;
			}
		};
		
		var s = document.createElement('script');
		s.setAttribute('type','text/javascript');
		s.setAttribute('charset','iso-8859-1');
		s.setAttribute('src', src);
		document.getElementsByTagName('head').item(0).appendChild(s);
	}
}

livePerson.init();
