<!--

////////////////////// DETECTOR DE PLUGINS /////////////////////////

//This script detects the following:
//Flash
//Windows Media Player
//Java
//Shockwave
//RealPlayer
//QuickTime
//Acrobat Reader
//SVG Viewer

var agt=navigator.userAgent.toLowerCase();
var ie  = (agt.indexOf("msie") != -1);
var ns  = (navigator.appName.indexOf("Netscape") != -1);
var win = ((agt.indexOf("win")!=-1) || (agt.indexOf("32bit")!=-1));
var mac = (agt.indexOf("mac")!=-1);

if (ie && win) {	pluginlist = detectIE("Adobe.SVGCtl","SVG Viewer") + detectIE("SWCtl.SWCtl.1","Shockwave Director") + detectIE("ShockwaveFlash.ShockwaveFlash.1","Shockwave Flash") + detectIE("rmocx.RealPlayer G2 Control.1","RealPlayer") + detectIE("QuickTimeCheckObject.QuickTimeCheck.1","QuickTime") + detectIE("MediaPlayer.MediaPlayer.1","Windows Media Player") + detectIE("PDF.PdfCtrl.5","Acrobat Reader"); }
if (ns || !win) {
		nse = ""; for (var i=0;i<navigator.mimeTypes.length;i++) nse += navigator.mimeTypes[i].type.toLowerCase();
		pluginlist = detectNS("image/svg-xml","SVG Viewer") + detectNS("application/x-director","Shockwave Director") + detectNS("application/x-shockwave-flash","Shockwave Flash") + detectNS("audio/x-pn-realaudio-plugin","RealPlayer") + detectNS("video/quicktime","QuickTime") + detectNS("application/x-mplayer2","Windows Media Player") + detectNS("application/pdf","Acrobat Reader");
}

function detectIE(ClassID,name) { result = false; document.write('<SCRIPT LANGUAGE=VBScript>\n on error resume next \n result = IsObject(CreateObject("' + ClassID + '"))</SCRIPT>\n'); if (result) return name+','; else return ''; }
function detectNS(ClassID,name) { n = ""; if (nse.indexOf(ClassID) != -1) if (navigator.mimeTypes[ClassID].enabledPlugin != null) n = name+","; return n; }

pluginlist += navigator.javaEnabled() ? "Java," : "";
if (pluginlist.length > 0) pluginlist = pluginlist.substring(0,pluginlist.length-1);

//SAMPLE USAGE- detect "Flash"
//if (pluginlist.indexOf("Flash")!=-1)
//document.write("You have flash installed")

/////////////////////////////////////////////////////////////////////

////////////////////// DESABILITA SELECIONAR /////////////////////////
//form tags to omit in NS6+:
var omitformtags=["input", "textarea", "select"]

omitformtags=omitformtags.join("|")

function disableselect(e){
if (omitformtags.indexOf(e.target.tagName.toLowerCase())==-1)
return false
}

function reEnable(){
return true
}

if (typeof document.onselectstart!="undefined")
document.onselectstart=new Function ("return false")
else{
document.onmousedown=disableselect
document.onmouseup=reEnable
}
/////////////////////////////////////////////////////////////////////

////////////////////////////// AJAX /////////////////////////////////
function openAjax()
{ 
	var Ajax; 
	try
	{
		Ajax = new XMLHttpRequest(); // XMLHttpRequest para browsers mais populares, como: Firefox, Safari, dentre outros. 
	}
	catch(ee) 
	{ 
		try
		{
			Ajax = new ActiveXObject("Msxml2.XMLHTTP"); // Para o IE da MS 
		}
		catch(e)
		{ 
			try
			{
				Ajax = new ActiveXObject("Microsoft.XMLHTTP"); // Para o IE da MS 
			}
			catch(e)
			{
				Ajax = false; 
			} 
		} 
	} 
	return Ajax; 
} 

function carregaAjax(id, pagina, metodo)
{ 
	if(document.getElementById)  // Para os browsers complacentes com o DOM W3C.
	{ 
		var exibeResultado = document.getElementById(id); // div que exibirá o resultado. 
		var Ajax = openAjax(); // Inicia o Ajax. 
		
		Ajax.open(metodo, pagina, true); // fazendo a requisição 
		
		Ajax.onreadystatechange = function() 
		{ 
			if(Ajax.readyState == 1) // Quando estiver carregando, exibe: carregando...
			{ 
				exibeResultado.innerHTML = "<div style='width:80px; height:18px; background-color:#CC3300; padding-left:2px; padding-top:1px;'><font color='#FFFFFF'>Carregando...</font></div>"; 
			} 
			
			if(Ajax.readyState == 4) // Quando estiver tudo pronto. 
			{
				if(Ajax.status == 200)
				{ 
					var resultado = Ajax.responseText; // Coloca o retornado pelo Ajax nessa variável 
					resultado = resultado.replace(/\+/g," "); // Resolve o problema dos acentos (saiba mais aqui: http://www.plugsites.net/leandro/?p=4) 
					resultado = unescape(resultado); // Resolve o problema dos acentos 
					exibeResultado.innerHTML = resultado; 
				}
				else
				{ 
					exibeResultado.innerHTML = "<div align='center'><strong>Erro: Problemas com a conexão.</strong></div>"; 
				} 
			} 
		} 
	Ajax.send(null); // submete 
	} 
} 
/////////////////////////////////////////////////////////////////////

////////////////////// ABRE JANELA INVISÍVEL //////////////////////
var win= null;
function janela_saida(pagina)
{
  var winl = screen.width;
  var wint = screen.height;
  var settings  ='height=1,';
      settings +='width=1,';
      settings +='top='+wint+',';
      settings +='left='+winl+',';
      settings +='scrollbars=no,';
      settings +='resizable=no, status=no';
  win=window.open(pagina,"_blank",settings);
  //if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}
//////////////////////////////////////////////////////////////////

////////////////////// ABRE JANELA INVISÍVEL //////////////////////
var win= null;
function janela_certificado(pagina,w,h)
{
  var winl = (screen.width-w)/2;
  var wint = (screen.height-h)/2;
  var settings  ='height='+h+',';
      settings +='width='+w+',';
      settings +='top='+wint+',';
      settings +='left='+winl+',';
      settings +='scrollbars=no,';
      settings +='resizable=no,';
	  settings +='menubar=yes';
  win=window.open(pagina,"_blank",settings);
  //if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}
//////////////////////////////////////////////////////////////////

-->