// ############################################################################
// # Nome: funcoes.js
// # Sistema: Portal ODM
// # Criado por: Kleber Cioccari - 20/11/2008
// # Empresa: ORBIS
// # E-mail: kleber.cioccari@sesipr.org.br
// # Última alteração: - Função Aumentar ou Diminuir a Fonte do Parágrafo
// # Propósito: Funcoes gerais em javascript
// # Histórico: 
// #			. 20/11/08 - Kleber Cioccari - Criação da Página
// #			. 20/11/08 - Kleber Cioccari - FUNÇÂO IMPRIMIR TELA
// #			. 20/11/08 - Kleber Cioccari - FUNÇÂO ESCONDER DIV
// #			. 20/11/08 - Kleber Cioccari - FUNÇÂO ESCONDER DIV OBJETIVOS
// #			. 20/11/08 - Kleber Cioccari - FUNÇÂO VALIDAÇÃO DE FORMULÁRIO (AJAX - REQUERIDO)
// #        	. 20/11/08 - Kleber Cioccari - FUNÇÃO AUMENTAR OU DIMINUIR FONTE DA PÁGINA
// #        	. 02/12/08 - Kleber Cioccari - FUNÇÃO PNGFIX
// ############################################################################

function ajaxInit() 
{
	if (window.XMLHttpRequest) { // Mozilla, Safari,...
		ajax = new XMLHttpRequest();
		if (ajax.overrideMimeType) {
			ajax.overrideMimeType('text/xml');
		}
	}
	else if (window.ActiveXObject) { // IE
	   
		try {
			ajax = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e) {
			try {
				ajax = new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e) {}
		}
	}
	return ajax;
}
var ajax = ajaxInit();
		
/* Impressão da Tela do usuário */
function ImprimeTela(caminho) 
{
  var mac = (navigator.userAgent.indexOf("Mac") != -1); 
  var doc = (document.all) ? 1 : 0;
  var ie_ns = (window.print) ? 1 : 0;

  if (ie_ns)     			// Se for netscape 4 ou ie5
    window.print();
  else if (doc && !mac)     // Se for ie4
    vbPrintPage()
  else     					// Outros
    alert("Opção não suportada pela navegador ");
    return false;
}

/* VALIDAÇÃO DE FORMULÁRIO */
	var filters = {
			requerido: function(el) {return ($(el).val() != '' && $(el).val() != -1);},
			email: function(el) {return /^[A-Za-z][A-Za-z0-9_]*@[A-Za-z0-9_]+\.[A-Za-z0-9_.]+[A-za-z]$/.test($(el).val());},
			telefone: function(el){return /^[0-9]*$/.test($(el).val());}
		};
/* FIM - VALIDAÇÃO DE FORMULÁRIO */
	
/* MOSTRA OU ESCONDE DIV */
function mostra_div(nome_div)
{
	//alert(nome_div);
	if (document.getElementById(nome_div).className == "hidden") 
	{
		document.getElementById(nome_div).className = "";
	} 
}	
function esconde_div(nome_div)
{
	document.getElementById(nome_div).className = "hidden";
}	

function mostra_esconde_div(nome_div)
{
	if (document.getElementById(nome_div).className == "hidden") 
	{
		document.getElementById(nome_div).className = "";
	} 
	else  
	{
		document.getElementById(nome_div).className = "hidden"
	}
}	


function mostra_div_nome(nome_div)
{
	//alert(nome_div);
	if (document.getElementsByName(nome_div).className == "hidden") 
	{
		document.getElementgetsByName(nome_div).className = "lista_tabela_alt_pagination ";
	} 
	/*
	else  
	{
		document.getElementById(nome_div).className = "hidden"
	}
	*/
}	
function esconde_div_nome(nome_div)
{
	document.getElementsByName(nome_div).className = "hidden";
}	


/* MOSTRA / ESCONDE Pagina TOPO.PHP (8 Objetivos) */
function mostra_odm(div_objetivo)
{
	if (document.getElementById(div_objetivo).className == "hidden_odm")
	{
		var qtd_divs = 8; // SETADO NA MÃO AS 8 DIVS COM O NOME ODMS PARA O IE FUNCIONAR CORRETAMENTE.
			//var qtd_divs = document.getElementsByName("odms").length;
		
		var div_sel =  document.getElementById(div_objetivo);			
		var todas_divs;
	
		for (var i = 1; i <= qtd_divs; i++)
		{
			todas_divs = document.getElementById("div_odm"+i);
			if (todas_divs.id != div_objetivo)
				todas_divs.className = "hidden_odm";
			else
				div_sel.className = "";
		}
		document.getElementById(div_objetivo).className == "";
	}
	else  
	{
		document.getElementById(div_objetivo).className = "hidden_odm";
	}
}


/* MOSTRA OU ESCONDE DIV */


	/* FUNÇÃO AUMENTA OU DIMINUI A FONTE */
	var tgs = new Array('p'); //pega todas as tags p//

	//Specify spectrum of different font sizes:
	var szs = new Array('xx-small','x-small','small','medium','large','x-large','xx-large');
	var startSz = 2;
	
	function ts(trgt,inc) 
	{
		if (!document.getElementById) return
		var d = document,cEl = null,sz = startSz,i,j,cTags;
		sz += inc;
		if (sz<2) sz = 2;
		if (sz>5) sz = 5;
		startSz = sz;
		if (!(cEl = d.getElementById(trgt))) cEl = d.getElementsByTagName(trgt)[0];
		
		cEl.style.fontSize = szs[sz];
		
		for (i = 0; i < tgs.length; i++) 
		{
			cTags = cEl.getElementsByTagName(tgs[i]);
			for (j = 0; j < cTags.length; j++) cTags[j].style.fontSize = szs[sz];
		}
	}
	/* FIM - FUNÇÃO AUMENTA OU DIMINUI A FONTE */

	/* FUNCAO PARA ADICIONAR UM ACESSO A MAIS NA CATEGORIA EM QUE A NOTICIA CLICADA PERTENCE */
	function adicionaAcessoCategoria(id_categoria,categoria)
	{
	 	//alert(id_categoria);
		//alert(categoria);
		if(ajax) {
			ajax.open("GET", "adiciona_acesso_categoria_bd.php?id_categoria=" + id_categoria + "&categoria=" + categoria, true);
			ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");       
			ajax.send(null);
			ajax.onreadystatechange = function() 
			{
				if(ajax.readyState == 4) 
				{
					if(ajax.status == 200) {
					   //alert(ajax.responseText);
					} else {
					   //alert(ajax.statusText);
					   //FOI COMENTADO PARA TESTES
					}
				}
			}
		}
	 }
 	
	/* FUNCAO PARA ADICIONAR UM ACESSO A MAIS NA CATEGORIA EM QUE A NOTICIA CLICADA PERTENCE */
	/* FUNCAO PARA ADICIONAR UM ACESSO A MAIS NA CATEGORIA EM QUE A NOTICIA CLICADA PERTENCE */
	function adicionaAcessoItem(id_item,categoria)
	{		
	 	//alert(id_item);
		//alert(categoria);		
		//var variaveljs = document.write("<?php echo $_SESSION['id_sessao'] = "+id_item+";  ?>");
		//alert(id_sessao);
		if(ajax) {
			ajax.open("GET", "adiciona_acesso_item_bd.php?id_item=" + id_item + "&categoria=" + categoria, true);
			ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");       
			ajax.send(null);
			ajax.onreadystatechange = function() 
			{
				if(ajax.readyState == 4) 
				{
					if(ajax.status == 200) {
					   //alert(ajax.responseText);
					} else {
					   //alert(ajax.statusText);
					   //FOI COMENTADO PARA TESTES
					}
				}
			}
		}
	 }
 	/* FUNCAO PARA ADICIONAR UM ACESSO A MAIS NA CATEGORIA EM QUE A NOTICIA CLICADA PERTENCE */
	
	/* FUNCAO PARA ADICIONAR UM ACESSO A MAIS NO PERFIL DOS RELATORIOS DE ACORDO COM O CLIQUE */
	/* FUNCAO PARA ADICIONAR UM ACESSO A MAIS NO PERFIL DOS RELATORIOS DE ACORDO COM O CLIQUE */
	function adicionaAcessoRelatorio(AcaoPerfil,IPUsuario)
	{		
	 	//alert(AcaoPerfil);
		//alert(IPUsuario);		
		if(ajax) 
		{
			ajax.open("GET", "adiciona_acesso_relatorio_perfil.php?AcaoPerfil=" + AcaoPerfil + "&IPUsuario=" + IPUsuario, true);
			//alert("adiciona_acesso_relatorio_perfil.php?AcaoPerfil=" + AcaoPerfil + "&IPUsuario=" + IPUsuario);
			ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");       
			ajax.send(null);
			ajax.onreadystatechange = function() 
			{
				if(ajax.readyState == 4) 
				{
					if(ajax.status == 200) {
					   //alert(ajax.responseText);
					   //FOI COMENTADO PARA NAO DEVOLVER RESPOSTA POIS É SOMENTE LOG.
					} else {
					   //alert(ajax.statusText);
					   //FOI COMENTADO PARA NAO DEVOLVER RESPOSTA POIS É SOMENTE LOG.
					}
				}
			}
		}
	 }
	/* FUNCAO PARA ADICIONAR UM ACESSO A MAIS NO PERFIL DOS RELATORIOS DE ACORDO COM O CLIQUE */

var chamaPaginaAjax = function(url,nome_div) 
{
	document.getElementById(nome_div).className = '';
	document.getElementById(nome_div).innerHTML = 'Gerando arquivo PDF';
	
	window.location.href = url;
	window.setTimeout('esconde_div("popup_div_carrega_pdf")',3200);
	/*
	ajax_Req = ajaxInit();
	// Realizando a solicitacao
	ajax_Req.open("GET", url, true);
	// Verificando o estado da solicitacao
	ajax_Req.onreadystatechange = function() 
	{
		// 1=carregando
		if(ajax_Req.readyState == 1)
		{
			document.getElementById(nome_div).innerHTML = 'Capturando Gráficos e Imagens...<br /><img src="../images/ajax-loader-barrinha.gif" border="0" />';
			document.getElementById(nome_div).className = '';
		}
		// 4=concluido
		if(ajax_Req.readyState == 4)
		{
			document.getElementById(nome_div).innerHTML = ajax_Req.responseText+'Gerando Arquivo PDF..<br /><img src="../images/ajax-loader-barrinha.gif" border="0" />';
			// HTTP ok
			if(ajax_Req.status == 200) 
			{
				// Carrega o elemento indicado po id com a resposta da solicitacao
				document.getElementById(nome_div).innerHTML = ajax_Req.responseText+'<br /><img src="../images/ajax-loader-barrinha.gif" border="0" />OKKKKK  !!!';
				document.getElementById('div_aguarde').className = "hidden";
			}
		}
	}
	ajax_Req.send(null);
	*/
}


function chamaPaginaExternaAjax(url,nome_div,msg_ok) 
{
	if(ajax) {
			//alert(url);
			ajax.open("GET", url, true);
			ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");			
			ajax.send(null);
			ajax.onreadystatechange = function() 
			{
				//document.getElementById(nome_div).className = '';
				// 1=carregando
				if(ajax.readyState == 1)
				{
					//document.getElementById(nome_div).innerHTML = 'Enviando solicitação..';
				}
				
				if(ajax.readyState == 4) 
				{
					//document.getElementById(nome_div).className = '';
					//document.getElementById('retornoAjax').innerHTML = ajax_Req.responseText;
					
					if(ajax.status == 200) 
					{
						//document.getElementById('retornoAjax').innerHTML = ajax_Req.responseText;
					}
				}
			}
		}
		
	if ( nome_div == 'twitter_atualizado' )
	{ document.getElementById('cadastra_twitter').className = 'hidden'; }
}

function objectSwf(swf,width,height)
{
	document.write('<object type="application/x-shockwave-flash" width="' + width + '" height="' + height + '" data="' + swf + '">');
	document.write('<param name="movie" value="' + swf + '" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="menu" value="false" />');
	document.write('<param name="wmode" value="opaque" />');
	document.write('<embed src="' + swf + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + width + '" height="' + height + '" wmode="opaque"></embed>');
	document.write('</object>');
}
/**
	PARA O PLAYER .FLV
	
 * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */
if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;









/*
	#########
	getElementsByClassName no IE
	#########
	Developed by Robert Nyman, http://www.robertnyman.com
	Code/licensing: http://code.google.com/p/getelementsbyclassname/
	
	
	Parameters
	
	className
	One or several class names, separated by space. Multiple class names demands that each match have all of the classes specified. Mandatory.
	tag
	Specifies the tag name of the elements to match. Optional.
	elm
	Reference to a DOM element to look amongst its children for matches. Recommended for better performance in larger documents. Optional.
	Call Examples
	
	To get all elements in the document with a "info-links" class.
	getElementsByClassName("info-links");
	To get all div elements within the element named "container", with a "col" class.
	getElementsByClassName("col", "div", document.getElementById("container"));
	To get all elements within in the document with a "click-me" and a "sure-thang" class.
	getElementsByClassName("click-me sure-thang");
	
	
*/
var getElementsByClassName = function (className, tag, elm){
	if (document.getElementsByClassName) {
		getElementsByClassName = function (className, tag, elm) {
			elm = elm || document;
			var elements = elm.getElementsByClassName(className),
				nodeName = (tag)? new RegExp("\\b" + tag + "\\b", "i") : null,
				returnElements = [],
				current;
			for(var i=0, il=elements.length; i<il; i+=1){
				current = elements[i];
				if(!nodeName || nodeName.test(current.nodeName)) {
					returnElements.push(current);
				}
			}
			return returnElements;
		};
	}
	else if (document.evaluate) {
		getElementsByClassName = function (className, tag, elm) {
			tag = tag || "*";
			elm = elm || document;
			var classes = className.split(" "),
				classesToCheck = "",
				xhtmlNamespace = "http://www.w3.org/1999/xhtml",
				namespaceResolver = (document.documentElement.namespaceURI === xhtmlNamespace)? xhtmlNamespace : null,
				returnElements = [],
				elements,
				node;
			for(var j=0, jl=classes.length; j<jl; j+=1){
				classesToCheck += "[contains(concat(' ', @class, ' '), ' " + classes[j] + " ')]";
			}
			try	{
				elements = document.evaluate(".//" + tag + classesToCheck, elm, namespaceResolver, 0, null);
			}
			catch (e) {
				elements = document.evaluate(".//" + tag + classesToCheck, elm, null, 0, null);
			}
			while ((node = elements.iterateNext())) {
				returnElements.push(node);
			}
			return returnElements;
		};
	}
	else {
		getElementsByClassName = function (className, tag, elm) {
			tag = tag || "*";
			elm = elm || document;
			var classes = className.split(" "),
				classesToCheck = [],
				elements = (tag === "*" && elm.all)? elm.all : elm.getElementsByTagName(tag),
				current,
				returnElements = [],
				match;
			for(var k=0, kl=classes.length; k<kl; k+=1){
				classesToCheck.push(new RegExp("(^|\\s)" + classes[k] + "(\\s|$)"));
			}
			for(var l=0, ll=elements.length; l<ll; l+=1){
				current = elements[l];
				match = false;
				for(var m=0, ml=classesToCheck.length; m<ml; m+=1){
					match = classesToCheck[m].test(current.className);
					if (!match) {
						break;
					}
				}
				if (match) {
					returnElements.push(current);
				}
			}
			return returnElements;
		};
	}
	return getElementsByClassName(className, tag, elm);
};

/*
	#########
	getElementsByClassName no IE
	#########
	
	Developed by Robert Nyman, http://www.robertnyman.com
	Code/licensing: http://code.google.com/p/getelementsbyclassname/
	
*/






/* UTLIZADO NA PAGINA DE CURSOS PARA SELECIONAR A DIV CORRETA */ 
	function abreDiv(idElementoSelecionado)
	{	
		var todos_elementos = document.getElementsByClassName('cat');
		
		for (var i=0; i<todos_elementos.length; i++)
		{
		  	var link = todos_elementos[i];		 
		  	var IdsElemento = link.getAttribute('id');
		  
	 	    if (IdsElemento == idElementoSelecionado)
			{
				mostra_div('curso-'+IdsElemento);
				//$('#LI_'+IdsElemento).addClass('selected cat_LI');
				//$('#curso-'+IdsElemento).css('display', 'block');
				//$('#curso-'+IdsElemento).addClass('curso-cat-geral');
				alert(IdsElemento);	
				//$('#seta-troca-'+IdsElemento).html(setaBaixoIMG);
			}
			else
			{
				esconde_div('curso-'+IdsElemento);	
				//$('#curso-'+IdsElemento).css('display', 'none');
				//$('#LI_'+IdsElemento).removeClass("selected");
				//$('#seta-troca-'+IdsElemento).html(setaIMG);
				//$('#curso-'+IdsElemento).addClass('curso-cat-geral');
				//alert('não aparece '+IdsElemento);
			}
		}			
	}
	
	
	function trocaSetaCursos(idElementoSelecionado)
	{
		var setaIMG	=	"<img src='http://www.orbis.org.br/images/_seta-curso-titulo.jpg' />";
		var setaBaixoIMG	=	"<img src='http://www.orbis.org.br/images/_seta-curso-titulo-baixo.jpg' class='seta-baixo' />";
	
		var todos_elementos = getElementsByClassName('requisitos');
		
		for (var i=0; i<todos_elementos.length; i++)
		{
		  	var link = todos_elementos[i];		 
		  	var IdsElemento = link.getAttribute('id');
		  
	 	    if (IdsElemento == idElementoSelecionado)
			{
				mostra_div('div-'+IdsElemento);
				$('#div-'+IdsElemento).css('display', 'block');
				$('#div-'+IdsElemento).removeClass('hidden');
				$('#seta-troca-'+IdsElemento).html(setaBaixoIMG);
			}
			else
			{
				esconde_div('div-'+IdsElemento);	
				$('#div-'+IdsElemento).css('display', 'none');
				$('#div-'+IdsElemento).addClass("hidden");
				$('#seta-troca-'+IdsElemento).html(setaIMG);
			}
		}			
	}
/* FIM - UTLIZADO NA PAGINA DE CURSOS PARA SELECIONAR A DIV CORRETA */ 
