/* Developer ATTENTION:
 * DO NOT copy this file to your website.
 * We keep updating our services and modifying this file.
 * In such cases, your copied *.js may not work in the future.
 * For correctly embedding WeBuzz.IM web messenger, please visit:
 * http://blog.izuz.net/category/developer/
 */
var winLoc = window.location.toString ();
if (winLoc.indexOf (".webuzz.im/") != -1) {
	window.location.replace ("http://webuzz.im/");
}
/* We keep updating our web messengers */
var j2sBuildDate = "20100714";
var j2sRelative = "2.0.1-v" + j2sBuildDate;
var zimRelative = "wbzz-v20100714";
var widgetRelative = "wz-v20100714";

window["j2s.update.delta"] = [
        "wbzz-v20100714", "wbzz-v20101115", "bz/FBExecutable.js",
        "$", "$", "bz/FBPipe.js",
        "$", "$", "im/webuzz/g/prefs/OptionAppearance.js",
        "$", "$", "im/webuzz/g/UserStatusPanel.js",
        "$", "$", "im/webuzz/plugin/DemoRobot.js",
        "$", "$", "im/webuzz/ViewportSenseUtils.js",
        "$", "$", "im/webuzz/modelrpc.z.js",
        "$", "$", "im/webuzz/package.js",
        "$", "$", "im/webuzz/settings.z.js",
        "$", "$", "uz/ServerStatus.js",
        "wbzz-v20100714", "wbzz-v20101216", "im/webuzz/g/Buzzing.js",
        "$", "$", "im/webuzz/g/BuzzingSession.js",
        "$", "$", "im/webuzz/buzz.z.js",
        "wbzz-v20100714", "wbzz-v20110228", "im/webuzz/g/MainWindow.js",
        "$", "$", "im/webuzz/main.z.js",
	/*
        "wz-v20100714", "wz-v20101215", "im/webuzz/balance/BuzzAccessibility.js",
        "$", "$", "im/webuzz/kaixinmeme/widget/WeBrowseWidget.js",
        "$", "$", "im/webuzz/space/SpaceUtility.js",
        "$", "$", "im/webuzz/widgets.z.js",
	//*/
        "wz-v20100714", "wz-v20110116", "im/webuzz/balance/BuzzAccessibility.js",
        "$", "$", "im/webuzz/balance/ServiceAccessible.js",
        "$", "$", "im/webuzz/kaixinmeme/widget/WeBrowseWidget.js",
        "$", "$", "im/webuzz/review/ProductReviewWidget.js",
        "$", "$", "im/webuzz/space/SpaceUtility.js",
        "$", "$", "im/webuzz/widgets.z.js",
        "2.0.1-v20100714", "2.0.1-v20101116", "java/lang/ClassLoader.js",
        "$", "$", "java/lang/String.js",
        "$", "$", "net/sf/j2s/ajax/HttpRequest.js",
        "$", "$", "net/sf/j2s/store/SimpleStore.js",
        "$", "$", "org/eclipse/swt/widgets/Combo.js",
        "$", "$", "org/eclipse/swt/widgets/Label.js",
        "$", "$", "org/eclipse/swt/widgets/more.z.js",
        "$", "$", "org/eclipse/swt/package.js",
        "$", "$", "j2slib.src.z.js",
        "$", "$", "j2slib.swt.z.js",
        "$", "$", "j2slib.z.js",
        "$", "$", "j2slibcore.z.js",
        "2.0.1-v20100714", "2.0.1-v20110408", "java/lang/reflect/Method.js",
        "$", "$", "java/lang/Class.js",
        "$", "$", "java/lang/Enum.js",
        "$", "$", "java/core.z.js",
        "$", "$", "net/sf/j2s/ajax/Base64.js",
        "$", "$", "net/sf/j2s/ajax/HttpRequestFactory.js",
        "$", "$", "net/sf/j2s/ajax/IHttpRequestFactory.js",
        "$", "$", "net/sf/j2s/ajax/ISimpleCacheable.js",
        "$", "$", "net/sf/j2s/ajax/SimplePipeRequest.js",
        "$", "$", "net/sf/j2s/ajax/SimpleRPCRequest.js",
        "$", "$", "net/sf/j2s/ajax/SimpleRPCSWTRequest.js",
        "$", "$", "net/sf/j2s/ajax/SimpleSerializable.js"
];

window["j2s.known.xss.domains"] = [
	"webuzz.im",
	"webuzztogether.com",
	"java2script.net",
	"java2script.com",
	"java2script.org",
	"demo.java2script.org",
	"izuz.net",
	"uziz.net",
	"kexmail.com"
];
//window["j2s.xss.cookie.url"] = "http://c." + host + "/xss-cookie.html";

if (window.location.toString ().indexOf ("about:") != -1) {
	document.title = "We Buzz Together - WeBuzz.IM";
}

// remove Google Analytics' subdomain cookies
(function () {
	try {
		var domain = document.domain;
		var expired = new Date ();
		expired.setTime (expired.getTime () - 3600000);
		var keys = ["a", "b", "c", "z"];
		for (var i = 0; i < keys.length; i++) {
			document.cookie = "__utm" + keys[i] + "=; expires=" + expired.toGMTString () + "; path=/; domain=." + domain;
		}
	} catch (e) {
	}
}) ();

window["swt.desktop.vscrollbar"] = true;

function multipleSites (path) {
	var length = path.length;
	if ((length > 15 && path.substring (0, 15) == "http://archive.")
			|| (length > 9 && path.substring (0, 9) == "http://a.")) {
		var index = path.lastIndexOf ("/");
		if (index < length - 3) {
			var arr = ['a', 'e', 'i', 'o', 'u', 'y'];
			var c1 = path.charCodeAt (index + 1);
			var c2 = path.charCodeAt (index + 2);
			var idx = (length - index) * 3 + c1 * 5 + c2 * 7; // Hash
			return path.substring (0, 7) + arr[idx % 6] + path.substring (8);
		}
	}
	return path;
}
function generatingScriptFunction (script) {
	return function () {
		eval (script);
		var e = window.event;
		e.cancelBubble = true;
		e.returnValue = false;
		return false;
	};
};

function fixLink (id, args, icon) {
	var alaaDiv = document.getElementById (id);
	if (alaaDiv == null) {
		return;
	}
	var o = window["j2s.lib"];
	//var j2sRelative = (o.alias ? o.alias : o.version);
	var j2sBase = o.base + j2sRelative + "/";
	// var zimRelative = "webuzz-v20090308";
	var zimBase = o.base + zimRelative + "/";
	if (typeof args == "string") {
		alaaDiv.href = args;
		alaaDiv.target = "_blank";
	} else {
		var argsStr = "[";
		if (args != null && args.length > 0) {
			for (var i = 0; i < args.length; i++) {
				argsStr += "\'" + args[i] + "\'";
				if (i != args.length - 1) {
					argsStr += ",";
				}
			}
		}
		argsStr += "]";
		var script = "if(a='im.webuzz.g.MainWindow@" + zimBase + "',r=" + argsStr + ",window['ClazzLoader']!=null)$w$(a,r);else{var d=document,t='onreadystatechange',x=d.createElement('SCRIPT'),f=function(){var s=this.readyState;if(s==null||s=='loaded'||s=='complete'){$w$(a,r);}};x.src='" + j2sBase + "j2slib.z.js';(typeof x[t]=='undefined')?x.onload=f:x[t]=f;d.getElementsByTagName('HEAD')[0].appendChild(x);void(0);}";
		alaaDiv.href = "javascript:" + script;
		if (navigator.userAgent.toLowerCase ().indexOf ("msie") != -1) {
			if (args != null && args.length > 0
					&& (args[0] == "--gtalk" || args[0] == "--msn"
					|| args[0] == "--ymsg" || args[0] == "--facebook"
					|| args[0] == "--aim" || args[0] == "--icq"
					|| args[0] == "--jabber")) {
				alaaDiv.href = "#" + args[0].substring (2);
			} else {
				alaaDiv.href = "#";
			}
			alaaDiv.onclick = generatingScriptFunction (script);
		}
	}
	if (icon != null) {
		var logos = [
				"g-logo.png",
				"m-logo.png",
				"y-logo.png",
				"a-logo.png",
				"i-logo.png",
				"j-logo.png",
				"b-logo.png",
				"mail-logo.png",
				"", //"icon-g.png",
				"", //"icon-m.png",
				"", //"icon-y.png",
				"", //"icon-a.png",
				"", //"icon-i.png",
				"", //"icon-j.png",
				"" //"icon-b.png"
		];
		var margin = 4;
		var width = 32;
		var height = 32;
		var i = -1;
		for (var j = 0; j < logos.length; j++) {
			if (logos[j] == icon) {
				i = j;
				break;
			}
		}
		if (i == -1) {
			var iconURL = multipleSites (icon);
			if (alaaDiv.className != null && alaaDiv.className.indexOf ("shortcut-item") != -1) {
				alaaDiv.style.backgroundImage = "url('" + iconURL + "')";
			} else {
				for (var j = 0; j < alaaDiv.childNodes.length; j++) {
					var item = alaaDiv.childNodes[j];
					if (item != null && item.className != null
							&& item.className.indexOf ("alaa-icon") != -1) {
						item.style.backgroundImage = "url('" + iconURL + "')";
						break;
					}
				}
			}
			return;
		}
		var arraySize = Math.ceil (Math.sqrt (logos.length));
		var ix = i % arraySize;
		var iy = (i - ix) / arraySize;
		var x = ix * (width + margin);
		var y = iy * (height + margin);
		var iconURL = multipleSites (zimBase + "im/webuzz/g/images/logos.png");
		if (alaaDiv.className != null && alaaDiv.className.indexOf ("shortcut-item") != -1) {
			alaaDiv.style.backgroundImage = "url('" + iconURL + "')";
			alaaDiv.style.backgroundPosition = "-" + x + "px -" + y + "px";
		} else {
			for (var j = 0; j < alaaDiv.childNodes.length; j++) {
				var item = alaaDiv.childNodes[j];
				if (item != null && item.className != null
						&& item.className.indexOf ("alaa-icon") != -1) {
					item.style.backgroundImage = "url('" + iconURL + "')";
					item.style.backgroundPosition = "-" + x + "px -" + y + "px";
					break;
				}
			}
		}
	}
}

function addDockLink (id, text) {
	var el = document.getElementById (id);
	if (el != null) {
		return;
	}
	var anchor = document.createElement ("A");
	anchor.id = id;
	anchor.className = "alaa";
	anchor.href = "#";
	anchor.style.display = "none";
	document.body.appendChild (anchor);
	var iconSpan = document.createElement ("SPAN");
	iconSpan.className = "alaa-icon";
	anchor.appendChild (iconSpan);
	anchor.appendChild (document.createTextNode (text));
}

function markScriptLoadingError (src) {
	var o = window["j2s.lib"];
	if (o.sites != null && o.errors != null) {
		for (var i = 0; i < o.sites.length; i++) {
			if (o.sites[i].length > 0 && src.indexOf (o.sites[i]) == 0) {
				o.errors[i] = true;
				break;
			}
		}
	}
}

function generateScriptErrorCallback () {
	return function () {
		markScriptLoadingError (this.src);
	};
}
function generateScriptCallback () {
	return function () {
		var s = this.readyState;
		if (s == null || s == "loaded" || s == "complete") {
			if (window["ClazzLoader"] != null) {
				window["j2s.lib"].onload (this);
			} else {
				markScriptLoadingError (this.src);
			}
			this.onreadystatechange = null;
			this.onload = null;
		}
	};
}

function loadJ2SLibZJS (path, cb) {
	var sxr = document.createElement ("SCRIPT");
	var deltas = window["j2s.update.delta"];
	if (deltas != null && deltas instanceof Array && deltas.length >= 3) {
		var lastOldVersion = null;
		var lastNewVersion = null;
		for (var i = 0; i < deltas.length / 3; i++) {
			var oldVersion = deltas[i + i + i];
			if (oldVersion != "$") {
				lastOldVersion = oldVersion;
			}
			var newVersion = deltas[i + i + i + 1];
			if (newVersion != "$") {
				lastNewVersion = newVersion;
			}
			var relativePath = deltas[i + i + i + 2];
			var key = lastOldVersion + "/" + relativePath;
			var idx = path.indexOf (key);
			if (idx != -1 && idx == path.length - key.length) {
				path = path.substring (0, idx) + lastNewVersion + "/" + relativePath;
				break;
			}
		}
	}
	sxr.src = path;
	sxr.type = "text/javascript";
	if (cb) {
		var t = "onreadystatechange";
		var xhrCallback = generateScriptCallback ();
		if (typeof sxr[t] == "undefined") {
			sxr.onload = xhrCallback;
			sxr.onerror = generateScriptErrorCallback ();
		} else {
			sxr[t] = xhrCallback;
		}
	}
	document.getElementsByTagName ("HEAD")[0].appendChild (sxr);
}

function loadJ2SApp (forced) {
	// Some visitors use sneakypass to use webuzz.im services. 
	// We just make some change so it will get a much better user
	// experience. We have NO business relationship with sneakypass.
	var host = null;
	try {
		host = window.location.host;
	} catch (e) {
	}
	if (host != null) {
		var isSneakyPass = host.indexOf ("sneakypass") != -1;
		if (isSneakyPass && forced != true) {
			custom_handler = function () {
				loadJ2SApp (true);
			};
			return;
		}
	}
	var o = window["j2s.lib"];
	if (o.loaded) {
		return;
	}
	var checkingInterval = 2000;
	var site = null;
	var prevSite = null;
	var loadFromAnotherSite = false;
	if (o.sites == null || o.sites.length == 0) {
		site = "http://archive.java2script.org/"; // should never reach here!
	} else {
		if (o.index > 0) {
			prevSite = o.sites[o.index - 1];
		}
		site = o.sites[o.index];
		loadFromAnotherSite = true;
	}
	var j2sLibSuffix = "/j2slib.swt.z.js";
	if (prevSite != null && prevSite.length > 0 && !o.errors[o.index - 1]) {
		if (navigator.userAgent.toLowerCase ().indexOf ("opera") != -1) {
			var scripts = document.getElementsByTagName ("SCRIPT");
			if (scripts != null && scripts.length > 0) {
				for (var i = 0; i < scripts.length; i++) {
					var s = scripts[i];
					if (s.src != null && s.src.length > 0 && s.src.indexOf (prevSite) == 0
							&& s.src.indexOf (j2sLibSuffix) == s.src.length - j2sLibSuffix.length) {
						if (s.readyState == "loaded" || s.readyState == "complete") {
							o.errors[o.index - 1] = true; // if successfully loaded, o.errors will be ignored
							checkingInterval = 1000;
						}
						break;
					}
				}
			}
		}
		window.setTimeout (loadJ2SApp, checkingInterval); // Not loaded yet
		return;
	}
	if (o.sites != null && o.sites.length > 0 && o.index >= o.sites.length) {
		alert ("Failed to load Java2Script core libraries from given "
				+ o.sites.length + " sites : " + o.sites + " !\r\n"
				+ "Please check your network!");
		return;
	}
	if (loadFromAnotherSite) {
		if (o.errors == null) {
			o.errors = [];
		}
		o.errors[o.index] = false;
		o.index++;
	}
	loadJ2SLibZJS(site + (o.alias ? o.alias : o.version) + j2sLibSuffix, o.onload);
	window.setTimeout (loadJ2SApp, checkingInterval); // Not loaded, try again with another site
}

function adjustDesktop () { // will be called if desktop finished initialization
	if (window["webuzz.im.type"] == null) {
		fixLink ("alaa-gtalk", ["--gtalk", "java2script.talk", "zzzzzzzz"], "g-logo.png");
		fixLink ("alaa-msn", ["--msn", "java2script.talk@gmail.com", "zzzzzzzz"], "m-logo.png");
		fixLink ("alaa-ymsg", ["--ymsg", "java2script.talk", "zzzzzzzz"], "y-logo.png");
		fixLink ("alaa-aim", ["--aim", "j2stalk", "zzzzzzzz"], "a-logo.png");
		fixLink ("alaa-icq", ["--icq", "582890450", "zzzzzzzz"], "i-logo.png");
		fixLink ("alaa-jabber", ["--jabber", "java2script.talk@jabber.org", "zzzzzzzz"], "j-logo.png");
		fixLink ("alaa-facebook", ["--facebook", "java2script.talk@gmail.com", "zzzzzzzz"], "b-logo.png");
		fixLink ("alaa-wemail", "http://webuzz.im/mail/", "mail-logo.png");
	}
	var alaaMail = document.getElementById ("alaa-mail");
	if (alaaMail != null) {
		alaaMail.target = "_blank";
	}
	var alaaTetris = document.getElementById ("alaa-tetris");
	if (alaaTetris != null) {
		alaaTetris.style.backgroundPosition = "center center";
	}
	var alaaControls = document.getElementById ("alaa-controls");
	if (alaaControls != null) {
		alaaControls.style.backgroundPosition = "center center";
	}
}

function loadDesktop () {
	if (window["webuzz.im.type"] == null) {
		addDockLink ("alaa-facebook", "Facebook Chat");
		addDockLink ("alaa-gtalk", "Google Talk");
		addDockLink ("alaa-msn", "Windows Live / MSN Messenger");
		addDockLink ("alaa-ymsg", "Yahoo! Messenger");
		addDockLink ("alaa-aim", "AOL Instant Messenger / AIM");
		addDockLink ("alaa-icq", "ICQ");
		addDockLink ("alaa-jabber", "Jabber");
		addDockLink ("alaa-wemail", "WeMail - Web Mail Client for Gmail, Live Mail/Hotmail, Yahoo! Mail/Rocket Mail, AOL Mail/AIM Mail and others");
	}
	loadJ2SApp ();
}

function initJ2SDesktop () {
	if (document.body != null) {
		loadDesktop ();
	} else {
		/* for Mozilla */
		if (document.addEventListener) {
			document.addEventListener ("DOMContentLoaded", loadDesktop, false);
		} else if (/WebKit/i.test (navigator.userAgent)) { // sniff
			var _timer = window.setInterval (function () {
				if (/loaded|complete/.test (document.readyState)) {
					window.clearInterval (_timer);
					loadDesktop (); // call the onload handler
				}
			}, 10);
		} else {
// for Internet Explorer (using conditional comments)
/*@cc_on @*/
/*@if (@_win32)
document.write ("<script id=__ie_onload defer src=javascript:void(0)><\/script>");
var script = document.getElementById ("__ie_onload");
script.onreadystatechange = function () {
	if (this.readyState == "complete") {
		loadDesktop (); // call the onload handler
	}
};
/*@end @*/
		}
	}
}

function createCookie (name, value, days) {
	var expires = "";
	if (days != null) {
		var toExpireDate = new Date();
		toExpireDate.setTime (toExpireDate.getTime () + days * 24 * 3600 * 1000);
		expires = "; expires=" + toExpireDate.toGMTString ();
	}
	document.cookie = name + "=" + value + expires + "; path=/";
}

function readCookie (name) {
	var prefix = name + "=";
	var allCookies = document.cookie.split (';');
	for(var i = 0; i < allCookies.length; i++) {
		var item = allCookies[i].replace (/^\s*/, "");
		if (item.indexOf (prefix) == 0) {
			return item.substring (prefix.length, item.length);
		}
	}
	return null;
}

function fixCookie(type, store) {
	var cookieName = type + ".pref";
	var p = readCookie (cookieName);
	if (p != null) {
		var pp = store.getProperty (cookieName);
		createCookie (cookieName, "", -1);
		if (pp == null) {
			store.setProperty (cookieName, p);
		}
	}
	for (var i = 1; i <= 5; i++) {
		cookieName = type + "." + i + ".pref";
		p = readCookie (cookieName);
		if (p != null) {
			var pp = store.getProperty (cookieName);
			createCookie (cookieName, "", -1);
			if (pp == null) {
				store.setProperty (cookieName, p);
			}
		}
	}
}

function moveXSSCookies (store) {
	fixCookie ("G", store);
	fixCookie ("M", store);
	fixCookie ("Y", store);
	fixCookie ("A", store);
	fixCookie ("I", store);
	fixCookie ("J", store);
	fixCookie ("B", store);

	var cookieName = "wblang";
	var p = readCookie (cookieName);
	if (p != null) {
		var pp = store.getProperty (cookieName);
		createCookie (cookieName, "", -1);
		if (pp == null) {
			store.setProperty ("wbzz.lang", p);
		}
	}
	cookieName = "bgstatus";
	p = readCookie (cookieName);
	if (p != null) {
		var pp = store.getProperty (cookieName);
		createCookie (cookieName, "", -1);
		if (pp == null) {
			store.setProperty (cookieName, p);
		}
	}
	cookieName = "wbzz.visits";
	var p = readCookie (cookieName);
	if (p != null) {
		var v1 = 0;
		try {
			v1 = parseInt (p);
		} catch (e) {}
		var pp = store.getProperty (cookieName);
		var v2 = 0;
		if (pp != null) {
			try {
				v2 = parseInt (pp);
			} catch (e) {}
		}
		createCookie (cookieName, "", -1);
		if (v1 > v2) {
			store.setProperty (cookieName, p);
		}
	}
}

function moveCookie2HTML5Store(cookieName, store) {
	var p = store.getProperty (cookieName);
	if (p != null) {
		var pp = localStorage.getItem (cookieName);
		store.setProperty (cookieName, null);
		if (pp == null) {
			localStorage.setItem (cookieName, p);
		}
	}
}

function movePrefs2HTML5Store(type, store) {
	moveCookie2HTML5Store (type + ".pref", store);
	for (var i = 1; i <= 5; i++) {
		moveCookie2HTML5Store (type + "." + i + ".pref", store);
	}
}

function moveXSSCookies2HTML5Store (store) {
	movePrefs2HTML5Store ("G", store);
	movePrefs2HTML5Store ("M", store);
	movePrefs2HTML5Store ("Y", store);
	movePrefs2HTML5Store ("A", store);
	movePrefs2HTML5Store ("I", store);
	movePrefs2HTML5Store ("J", store);
	movePrefs2HTML5Store ("B", store);

	moveCookie2HTML5Store ("wbzz.lang", store);
	moveCookie2HTML5Store ("bgstatus", store);
	moveCookie2HTML5Store ("wbzz.visits", store);

	moveCookie2HTML5Store ("wz.bing.time", store);
	moveCookie2HTML5Store ("wz.bing.status", store);
	moveCookie2HTML5Store ("wz.news.time", store);
	moveCookie2HTML5Store ("wz.news.status", store);
	moveCookie2HTML5Store ("wz.kkl.time", store);
	moveCookie2HTML5Store ("wz.kkl.status", store);
	moveCookie2HTML5Store ("wz.chrome.time", store);
	moveCookie2HTML5Store ("wz.chrome.status", store);
	moveCookie2HTML5Store ("wbzz.i18n.session", store);

	localStorage.setItem ("wbzz.store", "true");
}

function disableEscAborting () {
	Clazz.addEvent (document, "keydown", function (e) {
		var ie = false;
		if (e == null) {
			e = window.event;
			ie = true;
		}
		var key = e.keyCode || e.charCode;
		if (key == 27) {
			if (ie) {
				e.returnValue = false;
			} else {
				e.preventDefault();
			}
			return false;
		}	
	});
}

function hideSponsorReviewTips () {
	var el = document.getElementById ("product-review");
	if (el != null) {
		el.parentNode.style.backgroundColor = "lightyellow";
		el.parentNode.style.color = "black";
		el.style.marginTop = "8px";
		for (var i = 0; i < el.childNodes.length; i++) {
			var child = el.childNodes[i];
			if (child.nodeName == "DIV" && child.className == "review-title") {
				el = child;
				break;
			}
		}
	}
	if (el != null) {
		for (var i = 0; i < el.childNodes.length; i++) {
			var child = el.childNodes[i];
			if (child.nodeName == "A") {
				child.style.color = "blue";
				continue;
			}
			if (child.nodeName == "SPAN" && child.className == "sponsor-title") {
				child.style.display = "none";
				break;
			}
		}
	}
}

function isDomainRedirecting () {
	//if (O$.isIE) return false;
	var host = window.location.host;
	if (host != null) {
		var domains = [
			"java2script",
			"izuz",
			"uziz",
			"kexmail",
			"webuzztogether"
		];
		for (var i = 0; i < domains.length; i++) {
			if (host.indexOf (domains[i]) != -1) {
				return true;
			}
		}
		if (host.indexOf ("webuzz.im") != -1) {
			if (window.location.toString ().indexOf ("/beta.html") != -1) {
				return true;
			}
		}
	}
	return false;
}

function getDomainPrefix () {
	//if (Math.random () > 0.75) return null;
	var host = window.location.host;
	if (host != null) {
		var domains = [
			"java2script",
			"izuz",
			"uziz",
			"kexmail",
			"webuzztogether"
		];
		for (var i = 0; i < domains.length; i++) {
			if (host.indexOf (domains[i]) != -1) {
				return host;
			}
		}
		if (host.indexOf ("webuzz.im") != -1) {
			if (window.location.toString ().indexOf ("/beta.html") != -1) {
				return "webuzz.im/beta";
			}
			return "webuzz.im";
		}
	}
	return null;
}

function getMovingTips (prefix) {
	var j2sDomainTips = " is a domain for Java2Script technoloy project with web messenger demos. But as containing Oracle's trademark \"Java\", it cannot be used any more. We recommend you our web messenger karoolark.com.";
	var izuzDomainTips = " is being used before we launched webuzz.im in 2008. We recommended moving to webuzz.im at that time. Now, we recommend moving to karoolark.com, as it is our new primary web messenger from now on.";
	var tips = [
		'demo.java2script.org' + j2sDomainTips,
		'java2script.org' + j2sDomainTips,
		'java2script.com' + j2sDomainTips,
		'java2script.net' + j2sDomainTips,
		'izuz.net' + izuzDomainTips,
		'uziz.net' + izuzDomainTips,
		'kexmail.com is a domain for web mail proxy service. We recommended moving to karoolark.com, as it is for web messenger service.',
		'webuzztogether.com is an alternative domain for webuzz.im. We recommend you moving to our new web messenger karoolark.com.',
		'webuzz.im is our old web messenger with old UI layout. We recommended moving to our latest web messenger karoolark.com, which has a more modern new UI layout.',
		'webuzz.im/beta.html is our web messenger with latest updates for webuzz.im. We recommended moving to our latest web messenger karoolark.com.'
	];
	for (var i = 0; i < tips.length; i++) {
		if (tips[i].indexOf (prefix) == 0) {
			return tips[i];
		}
	}
	return null;
}

window["j2s.object.native"] = true;

window["j2s.lib"] = {
	sites : [
			"http://a.woziger.com/",
			"http://archive.woziger.com/",
			"http://a.webuzz.im/",
			"http://a.java2script.org/",
			"http://archive.java2script.org/",
			"http://a.java2script.net/",
			"http://a.java2script.com/",
			"http://a.kexmail.com/",
			"http://a.izuz.net/",
			"http://a.uziz.net/"//*/
		],
	index : 0,
	base : null,
	alias : j2sRelative, //"2.0.0-v20090310",
	version : "v" + j2sBuildDate, // "v20090310",
	/*forward : true,*/
	mode : "dailybuild",
	loaded : false,
	onload : function (script) {
		var o = window["j2s.lib"];
		if (o.loaded) {
			return;
		}
		o.loaded = true;
		var src = script.src;
		var loadingSite = "http://archive.java2script.org/";
		for (var i = 0; i < o.sites.length; i++) {
			if (src.indexOf (o.sites[i]) == 0) {
				loadingSite = o.sites[i];
				o.base = loadingSite;
				break;
			}
		}
		//var j2sRelative = (o.alias ? o.alias : o.version);
		ClazzLoader.packageClasspath ("java", loadingSite + j2sRelative, true);
		ClazzLoader.packageClasspath ("org.eclipse.swt", loadingSite + j2sRelative, true);

		window["j2s.css.single.site.classes"] = [ "im.webuzz.g.themes" ];

/* Begin of package.js */

/* private */
window["im.webuzz.registered"] = false;

Clazz.declarePackage ("az");
Clazz.declarePackage ("ez");
Clazz.declarePackage ("gz");
Clazz.declarePackage ("mz");
Clazz.declarePackage ("uz");
Clazz.declarePackage ("wz");
Clazz.declarePackage ("yz");

window["im.webuzz.package.callback"] = function () {
	window["im.webuzz.package.callback"] = null;
	var path = ClazzLoader.getClasspathFor ("im.webuzz.*");
	
	ClazzLoader.jarClasspath (path + "modelrpc.z.js", [
		"im.webuzz.model.ZimListener",
		"$.ZimClientListener",
		"$.ZimFriendListener",
		"$.ZimGroupListener",
		"$.ZimMessageListener",
		"$.ZimUserListener",
		"$.ZimAdapter",
		
		"$.ZimItem",
		"$.ZimList",
		"$.ZimMessage",
		"$.ZimUser",
		"$.ZimOwner",
		"$.ZimThread",
		"$.ZimGroup",
		"$.ZimFriend",
		"$.ZimClient",
		"$.ZimManager",

		"ez.AF",
		"$.AT",
		"$.CG",
		"$.EF",
		"$.IF",
		"$.LO",
		"$.NT",
		"$.SF",
		"$.SM",
		"$.UA",
		"$.UN",
		"$.US",
		
		"wz.FC",
		"$.FE",
		"$.GE",
		"$.LE",
		"$.ME",
		"$.MN",
		"$.RC",
		"$.RP",
		"$.TE",
		
		"uz.IMRunnable",
		"$.IStatusMode",
		"$.DelegatableIMPipeSession",
		"$.LoginRunnable",
		"$.AbstractProxyExecutable",
		"$.ProxyBuzzRunnable",
		"$.IMUtils",
		"$.SimpleRSA",
		
		"gz.GPipe",
		"mz.MPipe",
		"yz.YPipe",
		"az.APipe",
		"iz.IPipe",
		"jz.JPipe",
		"bz.FBPipe"
	]);
	ClazzLoader.jarClasspath (path + "main.z.js", [
   		"im.webuzz.ViewportSenseUtils",
   		"im.webuzz.BuzzRequest",
		"$.TitleNotifier",
		"im.webuzz.g.I18N",
		"$.ImageManager",
		"$.Options",
		"$.ShellSingletonUtils",
		"$.TopLogoPanel",
		"$.UserPressence",
		"$.UserStatusPanel",
		"$.SearchContactPanel",
		"im.webuzz.g.prefs.Preferences",
		"im.webuzz.g.MainWindow"
	]);
	ClazzLoader.jarClasspath (path + "buzz.z.js", [
   		"im.webuzz.FlashUtils",

		"im.webuzz.g.Dashboard",
		"$.ContactCard",
		"$.PopupNotifier",
		"$.BuzzToolBar",
		"$.BuzzingSession",
		"$.Buzzing",

		"im.webuzz.g.themes.Bubble",
		"$.BubblePicture",
		"$.Classi",
		"$.ClassicPicture",
		"$.Orkut",
		"$.OrkutPicture",
		"$.PingPongPicture",
		"$.Serene",
		"$.SerenePicture",
		"$.Swiss",
		"$.SwissPicture"
	]);
	ClazzLoader.jarClasspath (path + "settings.z.js", [
   		"im.webuzz.g.prefs.Settings",
   		"$.OptionGeneral",
   		"$.OptionBuzz",
   		"$.OptionBlocked",
   		"$.OptionNotifications",
   		"$.OptionConnection",
   		"$.OptionAudio",
   		"$.OptionAppearance"
   	]);
	ClazzLoader.jarClasspath (path + "dialogs.z.js", [
  		"im.webuzz.g.NotifyStillRunning",
  		"$.InviteFriendsDialog",
  		"$.BlockFriend",
  		"$.RemoveFriend",
  		"$.AboutWeBuzz"
  	]);
};
if (ClazzLoader.classpathMap["@im.webuzz"] != null) {
	window["im.webuzz.package.callback"] ();
}

/* private */
window["im.webuzz.registered"] = true;

/* End of package.js */

		ClazzLoader.packageClasspath ("im.webuzz", loadingSite + zimRelative, true);
		ClazzLoader.setPrimaryFolder (loadingSite + zimRelative);

		ClazzLoader.packageClasspath ([
				"com.swtdesigner",
				"im.webuzz.widget",
				"im.webuzz.balance",
				"im.webuzz.space",
				"im.webuzz.news",
				"im.webuzz.review",
				"im.webuzz.background",
				"im.webuzz.kaixinmeme.widget",
				"im.webuzz.languages",
				"im.webuzz.google"
		], loadingSite + widgetRelative);

		ClazzLoader.jarClasspath (loadingSite + widgetRelative + "/im/webuzz/widgets.z.js", [
    			"im.webuzz.widget.WidgetUtils",
    			"$.AbstractWidget",

    			"im.webuzz.balance.ServiceAccessible",
    			"$.BuzzAccessibility",

    			"im.webuzz.background.ReadBingBackground",
	    		"$.BingBackgroundWidget",

    			"im.webuzz.kaixinmeme.widget.RetrievePhotoPost",
    			"$.WeBrowseWidget",

    			"im.webuzz.news.ServicesLastestNews",
	    		"$.ServicesNewsWidget",

			"im.webuzz.review.ProductReviewWidget",

    			"im.webuzz.space.SpaceUtility",
    			"im.webuzz.google.chrome.Chrome4IEWidget",

    			"im.webuzz.languages.I18NSessionRequest",
	   		"$.I18NLoadingRequest",
       			"$.I18NTranslatingRequest",
	   		"$.I18NUpdatingRequest",
       			"$.I18NNode",
       			"$.I18NUtils",
       			"$.LanguagesWidget",
       			"$.I18NEditorWidget",

    			"com.swtdesigner.SWTResourceManager"
		]);

		// For SWT Control Examples
		ClazzLoader.packageClasspath ("org.eclipse.swt.examples.controlexample", "http://demo.java2script.org/controls/bin/");

		ClazzLoader.loadClass ("org.eclipse.swt.widgets.Display", function () {
			var display = $wt.widgets.Display.getDefault();
			//*
			var prefix = getDomainPrefix ();
			if (prefix != null && isDomainRedirecting ()) {
				var shell = new $wt.widgets.Shell (display, 1 << 2 | 1 << 16);
				shell.setSize (660, 300);
				var html = window["wbzz.affiliated.products"][0][2];
				html = html.replaceAll ("\\starget=\"_blank\"", "");
				shell.containerHandle ().style.backgroundColor = "lightyellow";
				shell.containerHandle ().innerHTML = "<div style=\"background-color:lightyellow;font-family:Arial, sans-serif;font-size:13pt;line-height:20px;padding:16px\">" + html +
						"<div><button style=\"float:right;width:450px;font-size:13pt;padding:4px 16px;color:blue;cursor:pointer;cursor:hand;\" onclick=\"window.location=\'http://karoolark.com/\';\">&gt;&gt; Go http://karoolark.com/ Web Messenger Now!</button> <button id=\"stay-here\" style=\"margin-top:12px;\" href=\"#\">Stay here</button></div>"
						"</div>";
				var stayBtn = document.getElementById ("stay-here");
				if (stayBtn != null) {
					stayBtn.onclick = function () {
						shell.close ();
						var style = 16777216;
						$wt.internal.ResizeSystem.unregister (shell, style);
						loadWebMessengers ();
					};
				}

				shell.open ();
				var size = shell.getSize ();
				var clientArea = shell.getMonitor ().getClientArea ();
				var y = Math.floor ((clientArea.height - size.y) / 2) - 20;
				if (y < 0) {
					y = 0;
				}
				shell.setLocation (Math.floor ((clientArea.width - size.x) / 2) + clientArea.x, y + clientArea.y);
				var style = 16777216;
				$wt.internal.ResizeSystem.register (shell, style);
				Sync2Async.block (shell, this, function () { });
				return;
			}
			//*/
			loadWebMessengers ();
		});
	}
};

function loadWebMessengers () {
			if (O$.isIE) {
				window["swt.disable.shadow"] = true; // improve IE performance
			}
			
			window.defaultWindowLeft = "200";
			window.defaultWindowTop = "28";

			adjustDesktop (); // fix dock links and icons
			if (window["localStorage"] != null && localStorage.getItem ("wbzz.store") != null) {
				window["j2s.html5.store"] = true;
			}
			window["messenger.logined.callback"] = function () {
				ClazzLoader.loadClass ("im.webuzz.space.SpaceUtility", function () {
					window.setTimeout (function () {
						im.webuzz.space.SpaceUtility.checkSpace ();
					}, 500);
				});
			};
			ClazzLoader.loadClass ("im.webuzz.g.MainWindow", function () {
				net.sf.j2s.ajax.SimplePipeRequest.switchToQueryMode (1000);
				net.sf.j2s.store.SimpleStore.getDefault ().execute ({
					run : function () {
						var store = net.sf.j2s.store.SimpleStore.getDefault ();
						var host = null;
						try {
							host = window.location.host;
						} catch (e) {
						}
						if (host != null) {
							host = host.toLowerCase ();
						}
						// To be deleted in September, 2010
						if ((O$.isIE || (host != null && (host.indexOf ("webuzztogether.com") != -1 || host.indexOf ("uziz.net") != -1 )))
								&& store.store != null && store.store.getClass ().getName ().indexOf ("XSS") != -1) {
							moveXSSCookies (store);
						}
						var v = store.getProperty ("wblang");
						if (v != null && v.length > 0) {
							store.setProperty ("wblang", null);
							store.setProperty ("wbzz.lang", v);
						}
						var isLocalFile = false;
						try {
							isLocalFile = window.location.protocol == "file:";
						} catch (e) {
							isLocalFile = true;
						}
						if (window["localStorage"] != null && store.store != null && (!O$.isFirefox || !isLocalFile)
								&& store.store.getClass ().getName ().indexOf ("Cookie") != -1) {
							moveXSSCookies2HTML5Store (store);
							window["j2s.html5.store"] = true;
							net.sf.j2s.store.SimpleStore.singleton = null;
							store = net.sf.j2s.store.SimpleStore.getDefault ();
						}
						var v = store.getProperty ("wblang");
						if (v != null && v.length > 0) {
							store.setProperty ("wblang", null);
							store.setProperty ("wbzz.lang", v);
						}
						var v = store.getProperty ("wbzz.lang");
						if (v != null && v.length > 0) {
							window["webuzz.lang"] = v;
							var updateCB = window["webuzz.language.updatecb"];
							if (updateCB != null) {
								try {
									updateCB (v);
								} catch (e) {
								}
							}
						}

						window.setTimeout (function () {
							var imType = im.webuzz.g.MainWindow.parseIMType ();
							if (imType == null) {
								var loc = window.location.toString () + "#" + window.location.hash + "!" + document.referrer;
								if (loc.indexOf ("facebook") != -1 || loc.indexOf ("fb") != -1) {
									imType = "facebook";
								}
							}
							if (document.referrer != null && document.referrer.indexOf (".facebook.com") != -1) {
								imType = null;
							}
							if (imType == null) {
								imType = window["webuzz.im.type"];
							}
							if (imType != null) {
								var done = false;
								if (window["webuzz.im.callback"] != null) {
									try {
										done = window["webuzz.im.callback"] ();
									} catch (e) {
									}
								}
								if (!done) {
									im.webuzz.g.MainWindow.main(["--" + imType]);
								}
								return;
							}

							im.webuzz.g.MainWindow.loadKnownMessengers ();
						}, 2500);

					}
				}); // end of SimpleStore

				if (window["webuzz.im.type"] != null) {
					return;
				}
				ClazzLoader.loadClass ("im.webuzz.space.SpaceUtility", function () {
					window.setTimeout (function () {
						im.webuzz.space.SpaceUtility.checkSpace ();
					}, 500);
				});
				//if (window.location.host == "webuzz.im" || window.location.host == "java2script.org" || window.location.host == "demo.java2script.org") {
				var prefix = getDomainPrefix ();
				if (prefix != null && getMovingTips (prefix) != null) {
				ClazzLoader.loadClass ("im.webuzz.review.ProductReviewWidget", function () {
					window.setTimeout (function () {
						new im.webuzz.review.ProductReviewWidget ().start ();
						hideSponsorReviewTips ();
					}, 1250);
				});
				}
				/*
				if (O$.isIE) {
					ClazzLoader.loadClass ("im.webuzz.google.chrome.Chrome4IEWidget", function () {
						window.setTimeout (function () {
							new im.webuzz.google.chrome.Chrome4IEWidget ().start ();
						}, 750);
					});
				}
				//*/
			}); // end of MainWindow

			ClazzLoader.loadClass ("im.webuzz.balance.BuzzAccessibility", function () {
				im.webuzz.balance.BuzzAccessibility.setAccessibleOKCallback ({
					run : function () {
						im.webuzz.balance.BuzzAccessibility.setAccessibleOKCallback (null);
						var server = im.webuzz.balance.BuzzAccessibility.getServiceServer ();
						net.sf.j2s.store.SimpleStore.getDefault ().setProperty ("wbzz.last.server", server);

						if (window["webuzz.im.type"] != null) {
							return;
						}
						ClazzLoader.loadClass ("im.webuzz.news.ServicesNewsWidget", function () {
							new im.webuzz.news.ServicesNewsWidget (im.webuzz.balance.BuzzAccessibility.getServiceServer () + "news/simplerpc").start ();
						});
						if (!O$.isIE)
						ClazzLoader.loadClass ("im.webuzz.background.BingBackgroundWidget", function () {
							window.setTimeout (function () {
								new im.webuzz.background.BingBackgroundWidget (im.webuzz.balance.BuzzAccessibility.getServiceServer () + "bingbg/simplerpc").start ();
							}, 1000 + Math.round (Math.random () * 1000));
						});
						/*
						ClazzLoader.loadClass ("im.webuzz.kaixinmeme.widget.WeBrowseWidget", function () {
							window.setTimeout (function () {
								new im.webuzz.kaixinmeme.widget.WeBrowseWidget ().start ();
							}, 3000 + Math.round (Math.random () * 3000));
						});
						//*/
						window.setTimeout (function () {
							ClazzLoader.loadClass ("im.webuzz.languages.LanguagesWidget", function () {
								im.webuzz.languages.I18NUtils.rpcRequestURL = im.webuzz.balance.BuzzAccessibility.getServiceServer () + "i18n/simplerpc";
								im.webuzz.languages.LanguagesWidget.initialize ();
							});
						}, 1000);
					}
				});
				ClazzLoader.loadClass ("net.sf.j2s.store.SimpleStore", function () {
					net.sf.j2s.store.SimpleStore.getDefault ().execute ({
						run: function () {
							var store = net.sf.j2s.store.SimpleStore.getDefault ();
							var server = store.getProperty ("wbzz.last.server");
							if (server != null && server.length > 0
									&& server.indexOf ("z1.") == -1
									&& server.indexOf ("z2.") == -1
									&& server.indexOf ("z3.") == -1
									&& server.indexOf ("z5.") == -1
									&& server.indexOf ("208.109.209.84") == -1
									&& server.indexOf ("208.109.217.97") == -1
									&& server.indexOf ("72.167.41.164") == -1
									&& server.indexOf ("72.167.44.7") == -1) {
								window["webuzz.im.last.server"] = server;
							}
							im.webuzz.balance.BuzzAccessibility.test ("u/c");
						}
					});
				});
			});

			disableEscAborting ();

			/*
			if (window["webuzz.im.type"] != null || window["page.ads.enabled"] != true) {
				return;
			}
			ClazzLoader.loadClass ("im.webuzz.ViewportSenseUtils", function () {
				if (document.getElementById ("gsidebar") == null) {
					im.webuzz.ViewportSenseUtils.startAdRotating();
				} else {
					im.webuzz.ViewportSenseUtils.switchingAds();
				}
			});
			//*/
}

function adjustJ2SLibSites () { // if possible, use similar domains for j2slib loading
	var sites = window["j2s.lib"].sites;
	var host = null;
	try {
		host = window.location.host.toLowerCase ();
	} catch (e) {
	}
	if (host != null && host.length > 0) {
		var segments = host.split (/\./);
		if (segments.length >= 2) {
			var domain = segments[segments.length - 2] + "." + segments[segments.length - 1];
			var keyPart = "." + domain + "/";
			for (var i = 0; i < sites.length; i++) {
				if (sites[i].indexOf (keyPart) != -1) {
					if (i != 0) {
						var tmp = sites[i];
						for (var j = i; j >= 1; j--) {
							sites[j] = sites[j - 1];
						}
						sites[0] = tmp;
					}
					break;
				}
			}
		}
	}
}

window["wbzz.affiliated.products"] = [
	/*
	["Online Backup Storage Service Review: Livedrive", "http://webuzz.im/reviews/online-backup-storage-service.html",
		'<p><a href="http://www.dpbolvw.net/click-4249115-10733254" target="_blank" rel="nofollow"><img src="http://www.lduhtrp.net/image-4249115-10733254" width="468" height="60" alt="Livedrive Simple, Secure Online Backup" border="0"/></a></p>' +
		'<p><strong>Have you ever lost your files</strong>? If you use computer for many years, you must have lots of personal files collected on hard disk. Computer hardware may break down. You has risk of losing those files. One reasearch report says that <strong>65% of users have lost his/her files</strong> for more than once. So we recommend you to use online backup services.</p>' +
		'<p><strong>Livedrive</strong> offer truly unlimited online storage space, allowing you to backup your files quickly and easily. <a href="http://www.anrdoezrs.net/click-4249115-10709105" target="_blank">Start your free 14 day trial</a>.<img src="http://www.ftjcfx.com/image-4249115-10709105" width="1" height="1" border="0"/> You should take it a try!</p>' +
		'<p>For more information of about this service, please visit <a href="http://www.kqzyfj.com/click-4249115-10709103" target="_blank">livedrive.com</a><img src="http://www.lduhtrp.net/image-4249115-10709103" width="1" height="1" border="0"/> .' +
		'<blockquote style="border-left:3px solid gray;padding-left:8px;">From now on, WeBuzz.IM team is reviewing and recommending services or products instead of displaying ads, in consideration of providing better user experience to our users. If given product/service is what you need, please buy it through us. It is <strong>your support helps WeBuzz.IM being a better free web messenger service</strong>.</blockquote>'
		],
	//*/
	["Review of Windows 7: A Must Upgrade for Your PC", "http://webuzz.im/reviews/windows-7-a-must-upgrade.html",
		'<div style="float:left;margin:0 24px 4px 0;"><iframe src="http://rcm.amazon.com/e/cm?t=weim07-20&o=1&p=8&l=as1&asins=B002DHLUWK&fc1=000000&IS2=1&lt1=_blank&m=amazon&lc1=0000FF&bc1=000000&bg1=FFFFFF&f=ifr" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe></div>' +
		'<p style="margin-left:-8px;">Still using 10 years old XP? Can not stand Vista\'s slowness any more? <strong>Already 20% of PC are Windows 7 powered now!</strong></p>' +
		'<p style="margin-left:-8px;">You may already heard a lot of Windows 7 in the past year, so why? Because Windows 7 offer the best entertainment experience on your PC:</p>' +
		'<ul><li>Easiest Windows to use ever</li><li>It\'s faster</li><li>Best PC entertainment experience</li><li>Simplifies everyday tasks</li><li>Easy to connect</li><li>Easy to browse the web</li><li>Work anywhere with less effort</li><li>Safeguard your hard work</li><li>...</li></ul>' +
		'<p>So, discard XP/Vista and trust the choice of millions of people and buy <a href="http://www.amazon.com/gp/product/B002DHLUWK?ie=UTF8&tag=weim07-20&linkCode=as2&camp=1789&creative=9325&creativeASIN=B002DHLUWK" target="_blank">Microsoft Windows 7 Home Premium Upgrade</a><img src="http://www.assoc-amazon.com/e/ir?t=weim07-20&l=as2&o=1&a=B002DHLUWK" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /> to make your PC updated!</p>'
		],
	["Outdoor and Sport Equipments from Amazon", null,
		'<iframe src="http://rcm.amazon.com/e/cm?t=weim07-20&o=1&p=12&l=ur1&category=sports&banner=09BK6G1P1CEMFQ9PW5R2&f=ifr" width="300" height="250" scrolling="no" border="0" marginwidth="0" style="border:none;" frameborder="0"></iframe>' +
		'<p style="margin-left:-8px;">Don\'t spend too much time before your PC! To make life much joyful, spend more time on fitness, sport or outdoor with your friends or your family!</p>'
		]
];
(function () {
	var prefix = "webuzz.im"; //getDomainPrefix ();
	if (prefix != null) {
		var tips = getMovingTips (prefix);
		if (tips != null) {
			window["wbzz.affiliated.products"] = [
				["Notification: Moving to Karoo Lark Web Messenger", "http://karoolark.com/",
					'<a href="http://karoolark.com/" target="_blank" title="Go to Karoo Lark web messenger" style="float:right;"><img src="http://karoolark.com/karoolark.gif" width="96" height="96" alt="Karoo Lark" /></a>' +
					'<p>Hi, ' + prefix + ' web messenger users,</p>' +
					'<img src="http://a.woziger.com/2.0.1-v20100714/org/eclipse/swt/widgets/images/warning.png" width="32" height="32" alt="information" style="float:left;margin:6px;" />' +
					'<p><strong>We are strongly recommending you moving to our primary Karoo Lark web messenger: <a href="http://karoolark.com/" target="_blank" style="color:blue;">http://karoolark.com/</a> .</strong></p>' +
					'<p>' + tips + '</p>' +
					'<p>Please move to <a href="http://karoolark.com/" target="_blank" style="color:blue;">Karoo Lark web messenger</a>. We think you will like it.</p>'
				]
			];
		}
	}
}) ();

if (window["imSensed"] == null || !imSensed) {
	//adjustJ2SLibSites ();
	initJ2SDesktop ();
}

(function () {
	if (window["webuzz.im.servers"] != null) {
		return;
	}
	var serverOrders = [6, 4];
	var domainOrders = window["j2s.known.xss.domains"];
	var servers = [];
	for (var i = 0; i < domainOrders.length; i++) {
		for (var j = 0; j < serverOrders.length; j++) {
			servers[servers.length] = "http://z" + serverOrders[j] + "." + domainOrders[i] + "/";
		}
	}
	window["webuzz.im.servers"] = servers;
}) ();

