domReady(function() {
	try {
		if (fc.authRegInit) fc.authRegInit();
		if (gebi("authLinkId")) {
			addHandler(
				gebi("authLinkId"),
				"click",
				function(evt) {stopLink(evt); fc.hideReg(); fc.showAuth(); return false;}
			);
		}
		if (gebi("authLinkId2")) {
			addHandler(
				gebi("authLinkId2"),
				"click",
				function(evt) {stopLink(evt); fc.hideReg(); fc.showAuth(); return false;}
			);
		}
		if (gebi("regLinkId")) {
			addHandler(
				gebi("regLinkId"),
				"click",
				function(evt) {stopLink(evt); fc.hideAuth(); fc.showReg(); return false;}
			);
		}
		if (gebi("regLinkId2")) {
			addHandler(
				gebi("regLinkId2"),
				"click",
				function(evt) {stopLink(evt); fc.hideAuth(); fc.showReg(); return false;}
			);
		}
		
		if (gebi("authid")) addHandler(gebi("authid"), "click", cancelBubbling);
		if (gebi("regid")) addHandler(gebi("regid"), "click", cancelBubbling);
		addHandler(
			document,
			"click",
			function() {
				try {fc.hideAuth(); fc.hideReg();} catch(e) {}
			}
		);
		if (gebi("loginFormId")) fc.initLoginForm();
		if (gebi("regFormId")) fc.initRegForm();
		if (gebi("forgotFormId")) fc.initForgotForm();
		if (gebi("qFormId")) fc.initQForm();
		if (gebi("showCountersId")) {
			addHandler(
				gebi("showCountersId"),
				"click",
				function(evt) {stopLink(evt); fc.showCounters(1); return false;}
			);
		}
		if (gebi("showCountersId")) {
			addHandler(
				gebi("hideCountersId"),
				"click",
				function(evt) {stopLink(evt); fc.showCounters(); return false;}
			);
		}
	} catch(e) {
		alert("Add handlers error [handlers.js]");
	}
});

// Resize global DIV
function globalResize(ie) {
	if (!ie) return;
	var minW = 990, maxW = false;
	var div;
	if (div = document.body) {
		// Min-width
		if (minW) {
			if (screenSize().w <= minW) div.style.width = minW + "px";
			else div.style.width = "auto";
		}
		// Max-width
		if (maxW) {
			if (screenSize().w >= maxW) div.style.width = maxW + "px";
			else div.style.width = "auto";
		}
	}
}

addHandler(
	window,
	"load",
	function() {
		globalResize(/*@cc_on 1@*/);
	}
);
addHandler(
	window,
	"resize",	
	function() {
		globalResize(/*@cc_on 1@*/);
	}
);
addHandler(
	document,
	"click",
	function() {if (gebi("syntaxId")) gebi("syntaxId").style.display = "none";}
);