function ShowHideMenu(Action) {
	
	var Menu	= 'LayoutMenu';
	
	if (document.all) {
		if (Action == 'show')
			document.all(Menu).style.visibility  = 'visible';
		else
			document.all(Menu).style.visibility  = 'hidden';
	}
	else {
		if (Action == 'show')
			document.getElementById(Menu).style.visibility  = 'visible';
		else
			document.getElementById(Menu).style.visibility  = 'hidden';
	}
}

function ShowHideObject(object_id, action, type) {
	if (type != 'block' && type != 'inline') type = 'block';
	
	if (action == 'show')
		document.getElementById(object_id).style.display  = type;
	else
		document.getElementById(object_id).style.display  = 'none';
}

function changeClass(id, name) {
	if (document.all) {
		document.all(id).className = name;
	}
	else if (document.getElementById) {
		document.getElementById(id).className = name;
	}
}

function winOpen(url,target,width,height, sroll) {
	if (scroll == "") scroll = "no";
	window.open(url, target,'height=' + height + ',width=' + width + ',scrollbars=' + sroll +',toolbar=no,directories=no,status=no,resize=yes,menubar=no');
}

function clear_object(object_name) {
	if (object_name == '') return false;
	
	var object_id = document.getElementById(object_name);
	if (object_id == null) return false;
	
// clear object

	var len = object_id.childNodes.length;
	
	for (var i = len; i > 0; i--) {
		var tmp_child = object_id.firstChild;
		object_id.removeChild(tmp_child);
	}	
	
	return true;
}

function confirmLink(text)
{
	if (confirm(text) != "") {
		return true;
	}
	else {
		return false;
	}
} 

function global_xhr_erro(response, ioArgs) {
	var text = '';
	
	for (var item in response)
		text+= response[item] + "\n\n";

	for (var item in ioArgs)
		text+= item  + ' - ' + ioArgs[item] + "\n\n";
	
	alert(text);	

	return true;
}
