<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->
function addFav(){
    var url        = "http://www.ambientec.com";
    var title    = "Ambientec - Meio Ambiente, Segurança e Saúde";
    if (window.sidebar) window.sidebar.addPanel(title, url,"");
    else if(window.opera && window.print){
        var mbm = document.createElement('a');
        mbm.setAttribute('rel','sidebar');
        mbm.setAttribute('href',url);
        mbm.setAttribute('title',title);
        mbm.click();
    }
    else if(document.all){window.external.AddFavorite(url, title);}
}
function TypePrintSelect(){
	if(document.getElementById('PrintSeft')){
		//executa função abre black x
		obj = document.getElementById('PrintSeft');
		window.open(obj.href);
	}
	else{
		// imprime a pagina
		window.print();
	}
}



// Novos Scripts

// Esta função instancia o objeto XMLHttpRequest
function openAjax() {
	var ajax;
	try {
		ajax = new XMLHttpRequest();
	} catch(ee) {
		try {
			ajax = new ActiveXObject("Msxml2.XMLHTTP");
		} catch(e) {
			try {
				ajax = new ActiveXObject("Microsoft.XMLHTTP");
			} catch(E) {
				ajax = false;
			}
		}
	}
	return ajax;
}


// Utilizado para evitar de digitar: document.getElementById toda hora, tornando o processo mais prático
function gE(ID) {
	return document.getElementById(ID);
}

// Utilizado para evitar de digitar: document.getElementsByTagName toda hora, tornando o processo mais prático
function gEs(tag) {
	return document.getElementsByTagName(tag);
}

function Del(id){
	var obj = gE(id);
	obj.parentNode.removeChild(obj);
	}

function HaId(id){
	if (!gE(id)){ return false; }
	else { return true;}
}

// Insert Before
function insertTag(tagWhat,idWhere,idNew,classNew) {
	// 1º
	var newElement = document.createElement(tagWhat);
	// 2º
	newElement.appendChild(document.createTextNode(""));
	// 3º
	var referencia = document.getElementById(idWhere);
	// 4º
	var parentTag = referencia.parentNode;
	// 5º
	newElement.setAttribute('id',idNew);
	newElement.setAttribute('class',classNew);
	parentTag.insertBefore(newElement, referencia);
}
function insertTagInBody(tagWhat,idNew,classNew){
	// 1º
	var newElement = document.createElement(tagWhat);
	// 2º
	newElement.appendChild(document.createTextNode(""));
	// 3º
	var objtBody = document.getElementsByTagName('body');
	var referencia = objtBody[0];
	// 4º
	var parentTag = referencia.parentNode;
	// 5º
	newElement.setAttribute('id',idNew);
	newElement.setAttribute('class',classNew);
	parentTag.insertBefore(newElement, referencia);
}

// Insert After
function insertTagA(tagWhat,idWhere,idNew,classNew){
	// 1º
	var newElement = document.createElement(tagWhat);
	// 2º
	newElement.appendChild(document.createTextNode(""));
	// 3º
	var referencia = document.getElementById(idWhere);
	// 4º
	var parentTag = referencia.parentNode;
	// 5º
	newElement.setAttribute('id',idNew);
	newElement.setAttribute('class',classNew);
	parentTag.insertBefore(newElement, referencia.nextSibling);
}

// NewChild
function newChild(what,where,idNew,idClass) {
 var newElement = document.createElement(what);
 	 newElement.setAttribute("Class",idClass);
 	 newElement.setAttribute("id",idNew);
	document.getElementById(where).appendChild(newElement);
}

function alertSis(msg,bad){
		var minhaclass = 'noclass';
		if(bad!=0){
				var minhaclass = 'msgBad';
			}
		if(HaId('msgSis')==false){
			insertTag('div','conteiner','msgSis','noclass');
			//insertTagInBody('div','msgSis','noclass');
			newChild('span','msgSis','boxMsgI','boxMsg');
			newChild('div','boxMsgI','boxMsgT',minhaclass);
			newChild('img','boxMsgT','boxMsgM','noclass');
			gE('boxMsgM').src = './imagens/x.gif';
			gE('boxMsgM').onclick = function(){
				Del('msgSis');
			}
			newChild('span','boxMsgT','boxMsgTint','boxMsg');
			gE('boxMsgTint').innerHTML = msg;
		}
		else{
			Del('msgSis');
			alertSis(msg,bad);
		}
}

window.onload = IdentificaDrogas;

function IdentificaDrogas(){
	var win_ie_ver = parseFloat(navigator.appVersion.split("MSIE")[1]);
	if (navigator.userAgent.indexOf('Mac')	>= 0) { win_ie_ver = 0; }
	if (navigator.userAgent.indexOf('Windows CE') >= 0) { win_ie_ver = 0; }
	if (navigator.userAgent.indexOf('Opera')	>= 0) { win_ie_ver = 0; }
	if (win_ie_ver < 7.0) {	
	//		alert ('Atualize seu navegador!');
		alertSis('<strong>Navegador desatualizado</strong>!  Para melhor visualização atualize seu navegador!  <a href="infonavegador.asp">saiba mais.</a>','0');
	}
//	else{
//	}
}
