function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function Verifica_Email(Valor)
{
	var filter = RegExp(/^[A-Za-z0-9_\-\.]+@[A-Za-z0-9_\-\.]{2,}\.[A-Za-z0-9]{2,}(\.[A-Za-z0-9])?/);
	if (!filter.test(Valor))
	{
		return false;
	}
	return true;
}

function ValidaForm(Frm)
{
	var retorno = validaarquivo(Frm.ory_db.value)
	
	if (retorno)
	{
		Frm.recipient.value = 1;
		Frm.submit();
	}
	else
	{
		alert('Selecione um tipo de arquivo válido!');
		return false;
	}
}

function validaarquivo(campo)
{
   TamanhoString = campo.length;
   extensao      = campo.substr(TamanhoString - 4,TamanhoString);
   if (TamanhoString == 0 )
   {
      alert('Você precisa selecionar um arquivo antes de transmitir.');
      return false;
   }
   else 
   {
		var ext = new Array('.mdb');
		for(var i = 0; i < ext.length; i++) 
		{ 
			if (extensao.toLowerCase() == ext[i])
			{
				flag = "ok";
				break;
			}
			else
			{
				flag = "erro";
			}
		}
		if (flag=="erro")
		{
			return false;
		}
   }			
   return true;
}

function Confirma(Chk)
{
	Chk.checked = true;
	var confir;
	if(Chk.value == 1)
		confir = "Deseja confirmar a aprovação deste orçamento?";
	else
		confir = "Deseja recusar a aprovação deste orçamento?";	
	if(confirm(confir+"\nClique em \"Ok\" para confirmar ou \"Cancelar\" para fazer uma nova escolha."))
	{
		if(Chk.value == 1)
			alert('Aguarde. Em breve entraremos em contato!');
		else
			alert('Orçamento recusado. Caso mude de idéia contate a empresa');
		document.form.recipient.value=1;
		document.form.submit();
	}
	else
	{
		Chk.checked = false;
	}
}

function pularcampo(wobj,alvo,maxlenght)
{
	try
	{
		if (document.getElementById(wobj).value.length==maxlenght)
		{
			document.getElementById(alvo).focus();
		}
	}
	catch(err)
	{
		//alert(err);
	}
}

function mostrar(Formulario, Recipient)
{
	try
	{
		
		Recipient.value = "1";
		Formulario.submit();
	}
	catch(err)
	{
		//alert(err);
	}
}

function mostra(Formulario)
{
	try
	{
		Formulario.submit();
	}
	catch(err)
	{
		//alert(err);
	}
}

function tecla(a, Formulario, Recipient)
{
	try
	{
	    var Key = a.keyCode || a.which;
	    
		//QDO FOR TECLADO ENTER
		if(Key == "13")
		{
			var campo = Recipient;
			campo.value = 1;
			Formulario.submit();
		}
	}
	catch(err)
	{
		//alert(err);
	}
}

// Máscara de Campos Texto

addEvent = function(o, e, f, s)
{
    var r = o[r = "_" + (e = "on" + e)] = o[r] || (o[e] ? [[o[e], o]] : []), a, c, d;
    r[r.length] = [f, s || o], o[e] = function(e)
	{
        try
	{
            (e = e || event).preventDefault || (e.preventDefault = function(){e.returnValue = false;});
            e.stopPropagation || (e.stopPropagation = function(){e.cancelBubble = true;});
            e.target || (e.target = e.srcElement || null);
            e.key = (e.which + 1 || e.keyCode + 1) - 1 || 0;
        }catch(f){}
        for(d = 1, f = r.length; f; r[--f] && (a = r[f][0], o = r[f][1], a.call ? c = a.call(o, e) : (o._ = a, c = o._(e), o._ = null), d &= c !== false));
        return e = null, !!d;
    }
};

removeEvent = function(o, e, f, s){
    for(var i = (e = o["_on" + e] || []).length; i;)
        if(e[--i] && e[i][0] == f && (s || o) == e[i][1])
            return delete e[i];
    return false;
};

MaskInput = function(f, m){
	function mask(e){
		var patterns = {"1": /[A-Z]/i, "2": /[0-9]/, "4": /[\xC0-\xFF]/i, "8": /./ },
			rules = { "a": 3, "A": 7, "9": 2, "C":5, "c": 1, "*": 8};
		function accept(c, rule){
			for(var i = 1, r = rules[rule] || 0; i <= r; i<<=1)
				if(r & i && patterns[i].test(c))
					break;
				return i <= r || c == rule;
		}
		var k, mC, r, c = String.fromCharCode(k = e.key), l = f.value.length;
		(!k || k == 8 ? 1 : (r = /^(.)\^(.*)$/.exec(m)) && (r[0] = r[2].indexOf(c) + 1) + 1 ?
			r[1] == "O" ? r[0] : r[1] == "E" ? !r[0] : accept(c, r[1]) || r[0]
			: (l = (f.value += m.substr(l, (r = /[A|9|C|\*]/i.exec(m.substr(l))) ?
			r.index : l)).length) < m.length && accept(c, m.charAt(l))) || e.preventDefault();
	}
	for(var i in !/^(.)\^(.*)$/.test(m) && (f.maxLength = m.length), {keypress: 0, keyup: 1})
		addEvent(f, i, mask);
};

function formataMoeda(o, n, dig, dec){
	o.c = !isNaN(n) ? Math.abs(n) : 2;
	o.dec = typeof dec != "string" ? "," : dec, o.dig = typeof dig != "string" ? "." : dig;
	addEvent(o, "keypress", function(e){
		if(e.key > 47 && e.key < 58){
			var o, s, l = (s = ((o = this).value.replace(/^0+/g, "") + String.fromCharCode(e.key)).replace(/\D/g, "")).length, n;
			if(o.maxLength + 1 && l >= o.maxLength) return false;
			l <= (n = o.c) && (s = new Array(n - l + 2).join("0") + s);
			for(var i = (l = (s = s.split("")).length) - n; (i -= 3) > 0; s[i - 1] += o.dig);
			n && n < l && (s[l - ++n] += o.dec);
			o.value = s.join("");
		}
		e.key > 30 && e.preventDefault();
	});
}

// MÁSCARA DE MOEDA
function MascaraMoeda(objTextBox, SeparadorMilesimo, SeparadorDecimal, e){
    var sep = 0;
    var key = '';
    var i = j = 0;
    var len = len2 = 0;
    var strCheck = '0123456789';
    var aux = aux2 = '';
    //var whichCode = (window.Event) ? e.which : e.keyCode;
    var whichCode = e.charCode ? e.charCode : e.keyCode ? e.keyCode : null;
    if (whichCode == 13 || whichCode == 8 || whichCode == 46) return true;
    key = String.fromCharCode(whichCode); // Valor para o código da Chave
    if (strCheck.indexOf(key) == -1) return false; // Chave inválida
    len = objTextBox.value.length;
    for(i = 0; i < len; i++)
        if ((objTextBox.value.charAt(i) != '0') && (objTextBox.value.charAt(i) != SeparadorDecimal)) break;
    aux = '';
    for(; i < len; i++)
        if (strCheck.indexOf(objTextBox.value.charAt(i))!=-1) aux += objTextBox.value.charAt(i);
    aux += key;
    len = aux.length;
    if (len == 0) objTextBox.value = '';
    if (len == 1) objTextBox.value = '0'+ SeparadorDecimal + '0' + aux;
    if (len == 2) objTextBox.value = '0'+ SeparadorDecimal + aux;
    if (len > 2) {
        aux2 = '';
        for (j = 0, i = len - 3; i >= 0; i--) {
            if (j == 3) {
                aux2 += SeparadorMilesimo;
                j = 0;
            }
            aux2 += aux.charAt(i);
            j++;
        }
        objTextBox.value = '';
        len2 = aux2.length;
        for (i = len2 - 1; i >= 0; i--)
        objTextBox.value += aux2.charAt(i);
        objTextBox.value += SeparadorDecimal + aux.substr(len - 2, len);
    }
    return false;
    
}
/*
function MascaraMoeda(e){
	var objTextBox = e.element();
	var SeparadorMilesimo = '.';
	var SeparadorDecimal = ',';
	
	var sep = 0;
	var key = '';
	var i = j = 0;
	var len = len2 = 0;
	var strCheck = '0123456789';
	var aux = aux2 = '';
	
	// var whichCode = (window.Event) ? e.which : e.keyCode;
	var whichCode = getKeycode(e);
	
	if (whichCode == 13)
	return true;
	
	key = String.fromCharCode(whichCode); // Valor para o código da Chave
	
	if (strCheck.indexOf(key) == -1)
	e.stop(); // Chave inválida
	
	len = objTextBox.value.length;
	for(i = 0; i < len; i++)
	if ((objTextBox.value.charAt(i) != '0') && (objTextBox.value.charAt(i) != SeparadorDecimal)) break;
	aux = '';
	for(; i < len; i++)
	if (strCheck.indexOf(objTextBox.value.charAt(i))!=-1) aux += objTextBox.value.charAt(i);
	aux += key;
	len = aux.length;
	if (len == 0) objTextBox.value = '';
	if (len == 1) objTextBox.value = '0'+ SeparadorDecimal + '0' + aux;
	if (len == 2) objTextBox.value = '0'+ SeparadorDecimal + aux;
	if (len > 2) {
	aux2 = '';
	for (j = 0, i = len - 3; i >= 0; i--) {
	if (j == 3) {
	aux2 += SeparadorMilesimo;
	j = 0;
	}
	aux2 += aux.charAt(i);
	j++;
	}
	objTextBox.value = '';
	len2 = aux2.length;
	for (i = len2 - 1; i >= 0; i--)
	objTextBox.value += aux2.charAt(i);
	objTextBox.value += SeparadorDecimal + aux.substr(len - 2, len);
	}
	e.stop();
}*/
// Fim Máscara de Campos Texto


function validaCNPJ(cnpj)
{
	cnpj = cnpj.value;
	//var cnpj = document.getElementById(val).value;
	//REMOVE CARACTERES INVALIDOS
	// /gi REMOVEM O QUE SE PROCURA EM TODA A STRING E NÃO DIFERENCIA MINUSCULA DE MAIUSCULA
	cnpj = cnpj.replace(".","");
	cnpj = cnpj.replace(".","");
	cnpj = cnpj.replace("/","");
	cnpj = cnpj.replace("-","");
	
	var numeros, digitos, soma, i, resultado, pos, tamanho, digitos_iguais;

	digitos_iguais = 1;

	for (var i=0; i < cnpj.length - 1; i++)
	{
		if (cnpj.charAt(i) != cnpj.charAt(i + 1))
		{
			digitos_iguais = 0;
			break;
		}
	}

	if (!digitos_iguais)
	{
		tamanho = cnpj.length - 2
		numeros = cnpj.substring(0,tamanho);
		digitos = cnpj.substring(tamanho);
		soma = 0;
		pos = tamanho - 7;

		for (var i=tamanho; i >= 1; i--)
		{
			soma += numeros.charAt(tamanho - i) * pos--;
			if (pos < 2)
			{
				pos = 9;
			}
		}
		resultado = soma % 11 < 2 ? 0 : 11 - soma % 11;

		if (resultado != digitos.charAt(0))
		{
			alert('CNPJ inválido!!');
			return false;
		}

		tamanho = tamanho + 1;
		numeros = cnpj.substring(0,tamanho);
		soma = 0;
		pos = tamanho - 7;
		
		for (i = tamanho; i >= 1; i--)
		{
			soma += numeros.charAt(tamanho - i) * pos--;
			if (pos < 2)
			{
				pos = 9;
			}
		}

		resultado = soma % 11 < 2 ? 0 : 11 - soma % 11;

		if (resultado != digitos.charAt(1))
		{
			alert('CNPJ inválido!!');
			return false;
		}

		return true;
	}
	else
	{
		alert('CNPJ inválido!!');
		return false;
	}
}

function validaCPF(ipt)
{
	ipt = ipt.value;
	//var ipt = document.getElementById(val).value;
	//REMOVE CARACTERES INVALIDOS
	// /gi REMOVEM O QUE SE PROCURA EM TODA A STRING E NÃO DIFERENCIA MINUSCULA DE MAIUSCULA
	ipt = ipt.replace(".","");
	ipt = ipt.replace(".","");
	//ipt = ipt.replace(".","");
	ipt = ipt.replace("-","");
	ipt = ipt.replace("/","");
	
	if ((ipt == "00000000000") || (ipt == "11111111111") || (ipt == "22222222222") || (ipt == "33333333333")
		|| (ipt == "44444444444") || (ipt == "55555555555") || (ipt == "66666666666") || (ipt == "77777777777")
		|| (ipt == "88888888888") || (ipt == "99999999999"))
	{
		alert('CPF inválido!!');
		return false;
	}
	
	var p1cpf = new String(ipt.substr(0, 3));
	var p2cpf = new String(ipt.substr(3, 3));
	var p3cpf = new String(ipt.substr(6, 3));

	var c = p1cpf + p2cpf + p3cpf;

	var dv = ipt.substr(9,2);
	var d1 = 0;

	for (i = 0; i < 9; i++)
	{
		d1 += c.charAt(i)*(10-i);
	}
	if (d1 == 0)
	{
		alert('CPF inválido!!');
		return false;
	}

	d1 = 11 - (d1 % 11);

	if (d1 > 9)
		d1 = 0;

	if (dv.charAt(0) != d1)
	{
		alert('CPF inválido!!');
		return false;
	}

	d1 *= 2;

	for (i = 0; i < 9; i++)
	{
		d1 += c.charAt(i)*(11-i);
	}

	d1 = 11 - (d1 % 11);

	if (d1 > 9)
		d1 = 0;
	if (dv.charAt(1) != d1)
	{
		alert('CPF inválido!!');
		return false;
	}

	return true;
}


//Função TRIM
String.prototype.trim = function() {
	return this.replace(/^\s+|\s+$/g, "");
}

String.prototype.ltrim = function() {
	return this.replace(/^\s+/, "");
}

String.prototype.rtrim = function() {
	return this.replace(/\s+$/, "");
}

function verifica2(a, Formulario)
{
	var Key = a.keyCode || a.which;
	if(Key == 13)
	{
		if(verifica(Formulario))
		{
			Formulario.recipient.value=1;
			Formulario.submit();
		}
	}
}

function DelimitarTexto(Nome_Text, Nome_Contador, Tamanho)
{
    Total = document.getElementById(Nome_Text).value.length;
    
    if(Total <= Tamanho)
    {
        Resto = Tamanho - Total;
        if (Nome_Contador != '')
        	document.getElementById(Nome_Contador).innerHTML = Resto;
    }
    else
    {
    	alert('Limite máximo de ' + Tamanho + ' caracteres!');
        document.getElementById(Nome_Text).value = document.getElementById(Nome_Text).value.substr(0, Total);
    }
}

function MostraPagina(Pagina,frm)
{
	document.forms[frm].PaginaAtual.value=Pagina;
	document.forms[frm].submit();
}

function IsDate(day, month, year)
{
	var date = new Date();
	var blnRet = false;
	var blnDay;
	var blnMonth;
	var blnYear;

	date.setFullYear(year, month -1, day);
	blnDay   = (date.getDate() == day);
	blnMonth = (date.getMonth() == month -1);
	blnYear  = (date.getFullYear() == year);
	/*
	alert(date.getDate());
	alert(day);
	
	alert(date.getMonth());
	alert(month);
	
	alert(date.getFullYear());
	alert(year);
*/
	if (blnDay && blnMonth && blnYear)
		blnRet = true;

	return blnRet;
}

/*
	A variável txtdataInformada deve ser passada no seguinte padrão dd/mm/yyyy.
*/
function CompareDate(txtInformada)
{
	var data = new Date();
	var txtDataAtual = '';
	//var txtInformada = document.cadastro.data.value;

	if (data.getDate().toString().length == 1)
		txtDataAtual += '0' + data.getDate() + '/';
	else
		txtDataAtual += data.getDate() + '/';
		
	if (data.getMonth().toString().length == 1 && data.getMonth() < 9)
		txtDataAtual += '0' + (data.getMonth() + 1) + '/';
	else
		txtDataAtual += (data.getMonth() + 1) + '/';
		
	txtDataAtual += data.getFullYear();

	//dataMaior(txtDataAtual, txtInformada);

	if(Date.parse(txtDataAtual.split("/").reverse().join("/")) > Date.parse(txtInformada.split("/").reverse().join("/")))
	{
		//alert('Data informada é menor que data de hoje');
		return false;
	}
	else if(Date.parse(txtDataAtual.split("/").reverse().join("/")) == Date.parse(txtInformada.split("/").reverse().join("/")))
	{
		//alert('Data informada é igual que data de hoje');
		return false;
	}
	else if(Date.parse(txtDataAtual.split("/").reverse().join("/")) < Date.parse(txtInformada.split("/").reverse().join("/")))
	{
		//alert('Data informada é maior que data de hoje');
		return true;
	}
}

function claro(theRow, action)
{
	var theCells = null;
	if(action=='over')
	{
		newColor='#E1E1C7';
	}
	else
	{
		newColor='transparent';
	}

	if (typeof(document.getElementsByTagName) != 'undefined')
	{
		theCells = theRow.getElementsByTagName('td');
	}
	else if (typeof(theRow.cells) != 'undefined')
	{
		theCells = theRow.cells;
	}
	else
	{
		return false;
	}

	var rowCellsCnt  = theCells.length;
	if (newColor)
	{
		var c = null;
		for (c = 0; c < rowCellsCnt; c++)
		{
			theCells[c].style.backgroundColor = newColor;
		}
	}
}


function MontaCSSLoading()
{
	var myWidth = 0, myHeight = 0;
	if(typeof(window.innerWidth) == 'number')
	{
		//Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
	}
	else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight))
	{
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
	}
	else if(document.body && (document.body.clientWidth || document.body.clientHeight))
	{
		//IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
	}
	
	if (myWidth == "" || myWidth == "0")
		myWidth = screen.width;
	if (myHeight == "" || myHeight == "0")
		myHeight = screen.height;
	
	
	document.writeln("<style type='text/css'>");
	document.writeln(".divSaibaMais{");
	document.writeln("position: absolute;");
	document.writeln("-moz-opacity: 0.5; opacity: .50; filter: alpha(opacity=50);");
	document.writeln("background-color:#fbfbfb;");
	document.writeln("font-size: 10px;");
	document.writeln("margin-right: 10px;");
	document.writeln("padding-top: 25%;");
	document.writeln("z-index: 9999;");
	//document.writeln("width: " + (screen.width) + "px;");
	//document.writeln("height: " + (screen.height) + "px;");
	document.writeln("width: " + (myWidth - 20) + "px;");
	//document.writeln("height: " + (myHeight) + "px;");
	document.writeln("height: 75%;");
	document.writeln("overflow: auto;");
	document.writeln("}");
	document.writeln("</style>");
}


function MontaCSSBoleto()
{	
	var myWidth = 0, myHeight = 0;
	if(typeof(window.innerWidth) == 'number')
	{
		//Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
	}
	else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight))
	{
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
	}
	else if(document.body && (document.body.clientWidth || document.body.clientHeight))
	{
		//IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
	}
	
	if (myWidth == "" || myWidth == "0")
		myWidth = screen.width;
	if (myHeight == "" || myHeight == "0")
		myHeight = screen.height;
	
	
	document.writeln("<style type='text/css'>");
	document.writeln(".divBoleto{");
	document.writeln("position: absolute;");
	document.writeln("-moz-opacity: 0.5; opacity: .50; filter: alpha(opacity=50);");
	document.writeln("background-color:#fbfbfb;");
	document.writeln("font-size: 10px;");
	document.writeln("margin-right: 10px;");
	document.writeln("padding-top: 25%;");
	document.writeln("padding-left: 35%;");
	document.writeln("z-index: 99999;");
	//document.writeln("width: " + (screen.width) + "px;");
	//document.writeln("height: " + (screen.height) + "px;");
	
	myWidth = myWidth - (myWidth * 0.36);
	myHeight = myHeight - (myHeight * 0.26);
	
	document.writeln("width: " + (myWidth) + "px;");
	document.writeln("height: " + (myHeight) + "px;");
	document.writeln("overflow: auto;");
	document.writeln("left: 0;");
	document.writeln("top: 0;");
	document.writeln("}");
	document.writeln("</style>");
}


function ajaxInit() {};

//Eventos
ajaxInit.prototype.iniciar = function() {
	try
	{
		//FIREFOX E ÓPERA
		this.xmlhttp = new XMLHttpRequest();
	}
	catch(ee)
	{
		try
		{
			//IE
			this.xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");

		}
		catch(e)
		{
			try
			{				
				this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch(E)
			{
				this.xmlhttp = false;
			}
		}
	}

	return true;
}

ajaxInit.prototype.ocupado = function() {
    estadoAtual = this.xmlhttp.readyState;
    return (estadoAtual && (estadoAtual < 4));
}

ajaxInit.prototype.processa = function() {
    if (this.xmlhttp.readyState == 4 && this.xmlhttp.status == 200) {
        return true;
    }
}

ajaxInit.prototype.enviar = function(url, metodo, modo) {
    if (!this.xmlhttp)
	{
        this.iniciar();
    }
    if (!this.ocupado())
	{
        if(metodo == "GET")
		{
            this.xmlhttp.open("GET", url, modo);
            this.xmlhttp.send(null);
        }
		else
		{
            this.xmlhttp.open("POST", url, modo);
            this.xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
            this.xmlhttp.setRequestHeader("Cache-Control", "no-store, no-cache, must-revalidate");
            this.xmlhttp.setRequestHeader("Cache-Control", "post-check=0, pre-check=0");
            this.xmlhttp.setRequestHeader("Pragma", "no-cache");
            this.xmlhttp.send(url);
        }    

        if (this.processa)
		{
            return unescape(this.xmlhttp.responseText.replace(/\+/g," "));
        }
    }
    return false;
}
//Fim Eventos

function verifica_associado(Numero)
{
	Numero = Numero.replace(".","");
	Numero = Numero.replace(".","");
	Numero = Numero.replace("-","");
	Numero = Numero.replace("/","");
	
	xmlhttp = new ajaxInit();
	var Contem = xmlhttp.enviar('consulta_bd.php?Numero=' + Numero, 'POST', false);
	
	if (Contem == '1')
		return true;
	else
		return false;
}

function verifica_associado_curso(Numero)
{
	Numero = Numero.replace(".","");
	Numero = Numero.replace(".","");
	Numero = Numero.replace("-","");
	Numero = Numero.replace("/","");
	
	xmlhttp = new ajaxInit();
	var Contem = xmlhttp.enviar('consulta_bd_cursoI.php?Numero=' + Numero, 'POST', false);
	
	if (Contem == '1')
		return true;
	else
		return false;
}

function Ajustar_Iframe(_Iframe, _Mais)
{
	if(document.getElementById && !(document.all))
	{
		_Iframe.height = document.body.offsetHeight + _Mais;
	}
	else if(document.all)
	{
		_Iframe.height = document.body.scrollHeight + _Mais;
	}
}

function Publicar(formulario, url)
{
	formulario.recipient.value = 'publicar';
	formulario.action = url;
	formulario.submit();
}