function get_id(ID) {
	return document.getElementById(ID);
}

function get_tag(tag) {
	return document.getElementsByTagName(tag);
}

function abre_ajax() {
	var core;
	if (window.XMLHttpRequest) {
		core = new XMLHttpRequest();
	} else if (window.ActiveXObject) {
		core= new ActiveXObject("Msxml2.XMLHTTP");
		if (!core) {
			core = new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	else {
		alert("Seu Navegador não possui suporte a essa aplicação");
	}
	return core;
}

function Trim(str) { return str.replace(/^\s+|\s+$/g,""); }

function show_hide(opt1,opt2){
	get_id(opt2).style.display = 'none';
	get_id(opt1).style.display = 'block';
}
function formata_data(campo,passo) {
	if (passo==1) {
		if (get_id(campo).value.length == 2) { get_id(campo).value += '/'; }
	}
	else {
		if (get_id(campo).value.length == 2) { get_id(campo).value += '/'; }
		if (get_id(campo).value.length == 5) { get_id(campo).value += '/'; }
	}}
function formata_hora(campo,passo) {
	if (passo==1) {
		if (get_id(campo).value.length == 2) { get_id(campo).value += ':'; }
	}
	else {
		if (get_id(campo).value.length == 2) { get_id(campo).value += ':'; }
		if (get_id(campo).value.length == 5) { get_id(campo).value += ':'; }
	}
}