if (document.cookie && !window.webChattr && (location.href.indexOf("mysobrietyspace") == -1) && (location.href.indexOf("dogstarspace") == -1)) {
	webChattr = {
		channel:null,
		baseUrl: "http://webchattr.com/embed/sitechat",
		nickName: null,
		pictureUrl: null,
		profileUrl: null,
		width: "99%",
		height: "450px",
		hideOptIn: false,
		keepCloseChat: false,
		enableAnonymous: true,
		isSavedOpen: function() {
			return (
				(c=document.cookie)
				&&
				(c.indexOf("webChattrOpen=1") != -1)
			);
		},
		isSavedClosed: function() {
			return (
				(c=document.cookie)
				&&
				(c.indexOf("webChattrOpen=0") != -1)
			);
		},
		startChat: function(bypassSave) {
			if (webChattr.chattrBox) {
				webChattr.chattrBox.style.display = "block";
				webChattr.startLink.style.display = "none";
				if (!webChattr.hideOptIn || webChattr.keepCloseChat) {
					webChattr.closeLink.style.display = "block";
				}
				webChattr.chattrBox.src = webChattr.baseUrl + webChattr.params;
				if (!bypassSave) {
					webChattr.setPermCookie("webChattrOpen","1");
				}
			}
		},
		closeChat: function() {
			if (webChattr.chattrBox) {
				webChattr.chattrBox.style.display = "none";
				webChattr.startLink.style.display = "block";
				webChattr.closeLink.style.display = "none";
				webChattr.setPermCookie("webChattrOpen","0");
			}
		},
		scape: function(s) {
			return (window.encodeURIComponent?encodeURIComponent(s):escape(s));
		},
		setPermCookie: function(k,v) {
			dNow = (new Date()).getTime();
			expiry = dNow + (7 * 24 * 60 * 60 * 1000);
			dateExpiry = (new Date(expiry)).toGMTString();
			document.cookie = k + "=" + v + "; path=/; expires=" + dateExpiry;
		},
		params: null
	};
	
	if (window.webChattrEnableAnonymous) {
		webChattr.enableAnonymous = true;
	}
	
	if (window.webChattrChannel) {
		webChattr.channel = webChattr.scape(window.webChattrChannel);
	}
	if (window.webChattrWidth) {
		webChattr.width = window.webChattrWidth;
	}
	if (window.webChattrHeight) {
		webChattr.height = window.webChattrHeight;
	}
	if (window.webChattrHideOptIn) {
		webChattr.hideOptIn = true;
	}
	if (window.webChattrKeepCloseChat) {
		webChattr.keepCloseChat = true;
	}
	if (window.webChattrInlineBox) {
		webChattr.inlineBox = true;
	}
	if (window.webChattrShowOnMainPage) {
		webChattr.showOnMainPage = true;
	}
	if (window.webChattrNickName && window.webChattrPictureUrl && window.webChattrProfileUrl ) {
		if (window.webChattrNickName)
			webChattr.nickName = webChattr.scape(window.webChattrNickName);
		if (window.webChattrPictureUrl)
			webChattr.pictureUrl = webChattr.scape(window.webChattrPictureUrl);
		if (window.webChattrProfileUrl)
			webChattr.profileUrl = webChattr.scape(window.webChattrProfileUrl);
	}
	webChattr.params = "?mode=2"; 
	if (webChattr.channel) webChattr.params += "&channel=" + webChattr.channel;
	if (webChattr.nickName) webChattr.params += "&nn=" + webChattr.nickName;
	if (webChattr.pictureUrl) webChattr.params += "&pic=" + webChattr.pictureUrl;
	if (webChattr.profileUrl) webChattr.params += "&pro=" + webChattr.profileUrl;
	
	if (webChattr.inlineBox) {
		document.write('<a name="webChattrAnchorLink" id="webChattrAnchor"></a>');
	}
	
	if (
			webChattr.enableAnonymous
			||
			(
				webChattr.nickName
				&& webChattr.pictureUrl
				&& webChattr.profileUrl
			)
		) {
		webChattr.chattrBox = document.createElement("iframe");
		webChattr.chattrBox.style.width=webChattr.width;
		webChattr.chattrBox.style.height=webChattr.height;
		webChattr.chattrBox.style.border="0px";
		webChattr.chattrBox.style.padding="0px";
		webChattr.chattrBox.style.margin="0px";
		webChattr.chattrBox.style.display="none";
	
		webChattr.startLink = document.createElement("a");
		webChattr.startLink.href = "javascript:webChattr.startChat()";
		webChattr.startLink.innerHTML = "";
		webChattr.startLink.style.display = webChattr.hideOptIn?"none":"block";
		webChattr.startLink.style.fontSize = "16px";
		webChattr.startLink.style.textAlign = "center";
		webChattr.startLink.style.width = webChattr.width;
		webChattr.startLink.style.height = "41px";
		webChattr.startLink.style.background = "url('http://apitools.webchattr.com/syndication/glue/open.png') top center no-repeat";
	
		webChattr.closeLink = webChattr.startLink.cloneNode(true);
		webChattr.closeLink.style.background = "url('http://apitools.webchattr.com/syndication/glue/close.png') top center no-repeat";
		webChattr.closeLink.style.display = "none";
		webChattr.closeLink.href = "javascript:webChattr.closeChat()";
	
	
		mBody = document.getElementById("webChattrAnchor").parentNode;
		mBody.appendChild(webChattr.startLink);
		mBody.appendChild(webChattr.chattrBox);
		mBody.appendChild(webChattr.closeLink);
	
	}
	if (webChattr.hideOptIn && !webChattr.keepCloseChat) {
		webChattr.startChat(true);
	} else if ((webChattr.hideOptIn || webChattr.isSavedOpen()) && !webChattr.isSavedClosed()) {
		if (webChattr.hideOptIn && !webChattr.isSavedOpen()) {
			webChattr.startChat(true);
		} else {
			webChattr.startChat();
		}
	} else if (webChattr.isSavedClosed() && webChattr.keepCloseChat) {
		webChattr.closeChat();
	}
}