function ObjShowDisplay(id, type)
{

	var obj = document.getElementById(id);

	if (obj)
	{
		if (type == null) type = 'block';
		obj.style.display = type;
	}
}

function ObjHideDisplay(id)
{

	var obj = document.getElementById(id);

	if (obj)
	{
		obj.style.display = 'none';
	}
}


function ObjToggleDisplay(id, type)
{

	var obj = document.getElementById(id);

	if (obj)
	{

		if (type == null) type = 'block';

		if (obj.style.display != 'none')
		{
			obj.style.display = 'none';
			return false;
		}
		else
		{
			obj.style.display = type;
			return true;
		}
	}
	else return null;
}

function MenuToggle(id)
{

	ObjToggleDisplay('submenu_' + id, 'block');

	var obj = document.getElementById('menu_link_' + id);
	if (obj)
	{
		if (obj.className == 'open') obj.className = 'closed'; else obj.className = 'open';
	}
}


function GetPostString(form)
{
	var result = '';

	if (form)
	{
		for (var i=0; i < form.length; i++)
		{
			result += '&' + form.elements[i].name + '=' + form.elements[i].value;
		}

		return result;
	}
	else return null;
}

function GetURL(url, jqobj, form)
{
	var req = new XMLHttpRequest();
	var postdata = null;

/*
	if (window.ActiveXObject)
		req = new ActiveXObject("Microsoft.XMLHTTP");
	else if (window.XMLHttpRequest)
		req = new XMLHttpRequest();
*/
	if (form)
	{
		url = form.action;
		method = 'POST';
		postdata = GetPostString(form);
	}
	else
	{
		method = 'GET';
		postdata = null;
	}

	req = $.ajax({
				type: method,
				url: url,
			   	data: postdata,
				success:function ()
					{

						if (req.responseText != null)
						{
							jqobj.attr('innerHTML', req.responseText);
							Init_AfterAJAX();
						}
					}
	});

/*
	if (req)
	{

		req.open(method, url, true);
		if (form) req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');

		req.onreadystatechange = function () {
			if ( (req.readyState == 4) )
			{
				if (req.responseText != null)
				{
					jqobj.attr('innerHTML', req.responseText);
					Init_AfterAJAX();
				}
			}
		}

		req.send(postdata);

	}
*/

}

