var jUserInfo = '';
var phpUserInfo = '';

function showLog()
{
	$("#login").css('display', 'block');
}

function hideLog()
{
	$("#login").css('display', 'none');
}

function showReg()
{
	$("#register").css('display', 'block');
}

function hideReg()
{
	$("#register").css('display', 'none');
}

function openReg()
{
	
	window.location = "#";
	$("#popup_dimmer").css('display', 'block');
	$("#popup_dimmer").css('height', getDocumentHeight());
	hideLog();
	showInfo();
	showReg();
	$("#inp_mail").focus();
}

function openLog()
{
	window.location = "#";
	$("#popup_dimmer").css('display', 'block');
	$("#popup_dimmer").css('height', getDocumentHeight());
	hideReg();
	showInfo();
	showLog();
	$("#inp_login").focus();
}

function close_all()
{
	$("#infoList").css('display', 'none');
	$("#popup_dimmer").css('display', 'none');
	hideLog();
	hideReg();
}

function getDocumentHeight()
{
	return (document.body.scrollHeight > document.body.offsetHeight)?document.body.scrollHeight:document.body.offsetHeight;
}


function setPhpInfo(info)
{
	phpUserInfo = info;
}

function setJinfo(info)
{
	jUserInfo = info;
}

function showInfo()
{
	
	$("#infoRegList").empty();
	$("#infoLogList").empty();
	if (empty(phpUserInfo) && empty(jUserInfo))
	{
		return;
	}

	if (!empty(jUserInfo))  
	{
		$("#infoRegList").append($.create('li', {}, [jUserInfo]));
		$("#infoLogList").append($.create('li', {}, [jUserInfo]));
	}
		else
		{
			$("#infoRegList").append($.create('li', {}, [phpUserInfo]));
			$("#infoLogList").append($.create('li', {}, [phpUserInfo]));
		}
	
	$("#infoRegList").css('display', 'block');
	$("#infoLogList").css('display', 'block');
	
}

function empty(a)
{
	return a == null || a == undefined || a == '' || a == 0 || a == false; 
}

