/**************************************************************
Exibe um filme em flash. Necessário usá-lo e deixá-lo em
arquivo js externo para evitar "clique aqui para ativar e usar
esse controle" no internet explorer.
**************************************************************/
function exibeFlash(url, width, height, wmode) {
	exibeFlash(url, width, height, wmode, null); 
}

function encaminharHref(url){
	window.location.href = url;
}

function LigaDesligaBotoes(botao){
	botao.className = botao.className == "box_ajuda_off" ? "box_ajuda_on" : "box_ajuda_off";
}

function exibeFlash(url, width, height, wmode, nomexml) {
	var montaSWF="";
	
	montaSWF+="<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" ";
	montaSWF+="codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" ";
	montaSWF+="width=\"" + width + "\" height=\"" + height + "\" >";
	montaSWF+="<param name=\"movie\" value=\"" + url;
	if( nomexml != null ){
		montaSWF+= "?nomexml=" + nomexml;
		montaSWF+= "&link=" + nomexml + "\"";
	}
	montaSWF+="\>";
	montaSWF+="<param name=\"wmode\" value=\""+ wmode +"\">";
	montaSWF+="<param name=\"play\" value=\"true\">";
	montaSWF+="<embed pluginspage=\"http://www.macromedia.com/go/getflashplayer\" ";
	montaSWF+="type=\"application/x-shockwave-flash\" quality=\"best\" play=\"true\" ";
	montaSWF+="wmode=\"" + wmode + "\" width=\"" + width + "\" height=\"" + height + "\" ";
	if( nomexml != null ){
		montaSWF+= "flashVars=\"nomexml=" + nomexml;	
		montaSWF+= "&link=" + nomexml + "\"";
	}
	montaSWF+="src=\"" + url + "\">"; 
	montaSWF+="</object>";
	document.write(montaSWF);
}

/**************************************************************
Formata o cep de acordo com os dados passados como parametro.<b> 
*************************************************************/
		function MM_formtCep(e,src,mask) {
		    if(window.event) { 
		    	_TXT = e.keyCode; 
		    } else if(e.which) { 
		    	_TXT = e.which; 
		    }
		
		    if(_TXT > 47 && _TXT < 58) { //numeros de 0 a 9
				var i = src.value.length; 
				var saida = mask.substring(0,1); 
				var texto = mask.substring(i)
				
				if (texto.substring(0,1) != saida) { 
					src.value += texto.substring(0,1); 
				}
				
				return true; 
				
			} else {
				if (_TXT != 8 || _TXT != 13 || _TXT != 0) {  //backspace - enter - tab
					return false; 
				} else { 
					return true; 
				}
			    }
		}

/**************************************************************
Filtra os dados digitados pelo usuário retornando apenas os
números.
**************************************************************/
function soNumero(e){

	navegador = /msie/i.test(navigator.userAgent);
	if (navegador){
		var tecla = event.keyCode;
	}else {
		var tecla = e.which;
	}
	if (tecla > 47 && tecla < 58) { //numeros de 0 a 9
		return true;
	}else {
		if (tecla != 8 || tecla != 13 || tecla != 0) { //backspace - enter - tab
			return false;
		}else {		
			return true;
		}
	}
}

/**************************************************************
Executa um Tab ao precionar o enter.
**************************************************************/
function Enter(index, event){

	try{

	var key	

	if(window.event) // IE
	{
	key = window.event.keyCode;
	}
	else if(event.which) // Netscape/Firefox/Opera
	{
	key = event.which
	}

	if(key == 13){
		var proximoIndex = 9999;
		for(var i = 0; i < document.all.length; i++){
			var indexAtual = document.all[i].tabIndex;
			if( indexAtual < proximoIndex && indexAtual > index){
				proximoIndex = indexAtual;
			}
		}
		for(var i = 0; i < document.all.length; i++){
			var indexAtual = document.all[i].tabIndex;
			if( indexAtual == proximoIndex){
				document.all[i].focus();
			}
		}
	}
	
	
	}catch(e){
		alert('erro'); 	
	}
}


/**************************************************************
Executa um Tab para o botão OK ao precionar o enter.
**************************************************************/
function enterBtn(e,nmBotao){

	var key	

	navegador = /msie/i.test(navigator.userAgent); //identificador de browser
	
	if (navegador) {
		key = event.keyCode;
	}else {
		key = e.which;
	}

	if(key == 13){
		var fireOnThis;
		
		if(nmBotao != '') {
			fireOnThis = document.getElementById(nmBotao);
		}else { 
			fireOnThis = document.getElementById("btnOK");
		}
		
		if( document.createEvent ) {
			var evObj = document.createEvent('MouseEvents');
			evObj.initEvent( 'click', true, false );
			fireOnThis.dispatchEvent(evObj);
		} else if( document.createEventObject ) {
			fireOnThis.fireEvent('onclick');
		}	
			
	}

}

function EnterSoNumeros(index, e){
	
	navegador = /msie/i.test(navigator.userAgent);
	
	if (navegador){
		var tecla = event.keyCode;
	}else {
		var tecla = e.which;
	}
	
	if (tecla > 47 && tecla < 58 || tecla == 13 || tecla == 0) { // numeros de 0 a 9 - backspace - enter - tab
		if(tecla == 13){
			var proximoIndex = 9999;
			for(var i = 0; i < document.all.length; i++){
				var indexAtual = document.all[i].tabIndex;
				if( indexAtual < proximoIndex && indexAtual > index){
					proximoIndex = indexAtual;
				}
			}
			for(var i = 0; i < document.all.length; i++){
				var indexAtual = document.all[i].tabIndex;
				if( indexAtual == proximoIndex){
					document.all[i].focus();
				}
			}
		}		
		return true;
	}else {
		if (tecla != 8) { // backspace
			return false;
		}else {		
			return true;
		}
	}
	
}

function EnterBtnSoNumeros(e, nmBotao){
	
	var tecla;
		
	navegador = /msie/i.test(navigator.userAgent); //identificador de browser
	
	if (navegador) {
		tecla = event.keyCode;
	}else {
		tecla = e.which;
	}
	
	if (tecla > 47 && tecla < 58 || tecla == 13) { // numeros de 0 a 9 e Enter
		if (tecla == 13) {
			var fireOnThis;		
			if(nmBotao != '') {
				fireOnThis = document.getElementById(nmBotao);
			}else { 
				fireOnThis = document.getElementById("btnOK");
			}
			
			if( document.createEvent ) {
				var evObj = document.createEvent('MouseEvents');
				evObj.initEvent( 'click', true, false );
				fireOnThis.dispatchEvent(evObj);
			} else if( document.createEventObject ) {
				fireOnThis.fireEvent('onclick');
			}	
		}
		return true;
	}else {
		if (tecla != 8) { // backspace
			return false;
		}else {		
			return true;
		}
	}	
}

/**************************************************************
Trata campos decimais.
campo = Objecto do tipo texto
tamanho = tamanho total do campo
decimal = tamanho das casas decimais
***************************************************************/
function campoDecimal(campo, tamanho, decimal ){

	try{
		//Se o caractere informado for diferente de número e diferente de vírgula então o caractere será ignorado.
		if ((event.keyCode < 48 || event.keyCode > 57) && ( event.keyCode != 44 && event.keyCode != 46 ) ) {
			event.returnValue = false;
			return;
		}
	
		//Se o caractere informado for vírgula e já exitir uma vírgula no campo ou for o primeiro caractere do 
		//então o caractere será ignorado
		if( ( event.keyCode == 44 || event.keyCode == 46 ) && ( campo.value.indexOf('.') != -1 || campo.value.length == 0 ) ){
			event.returnValue = false;
			return;
		}
	
		//Se o valor do campo já chegou ao temanho limite então o caractre será ignorado
		if( campo.value.replace('.', '').length == tamanho ){
			event.returnValue = false;
			return;
		}
	
		//Se o tamanho do campo for igual ao tamanho máximo e o caractere informado for diferente de vírgula
		//então será incluído uma vírgula antes do próximo número
		if( campo.value.length == ( tamanho - decimal ) && campo.value.indexOf('.') == -1 && ( event.keyCode != 44 && event.keyCode != 46 ) ){
			campo.value += '.';
		}

		//Se já existir vírgula e a qtd de valor após a vírgula for igual ao total de decimais 
		//então o caractere será ignorado
		if( campo.value.indexOf('.') != -1 && campo.value.substr(campo.value.indexOf('.') + 1).length == decimal ){
			event.returnValue = false;
			return;
		}

		if( event.keyCode == 44 ){
			campo.value += '.';
			event.returnValue = false;
			return;
		}

	}catch(e){}

}
/**************************************************************
Função que abre o popup.
***************************************************************/
function abrir(nome,pagina,altura,largura)
{
	janela=window.open(pagina,nome,"resizable=no,status=no,scrollbars=yes" + ",width=" + largura + ",height=" + altura)
}

function domRollover() {
	if (navigator.userAgent.match(/Opera (\S+)/)) {
		var operaVersion = parseInt(navigator.userAgent.match(/Opera (\S+)/)[1]);
	}
	if (!document.getElementById||operaVersion <7) return;
	var imgarr=document.getElementsByTagName('img');
	var imgPreload=new Array();
	var imgSrc=new Array();
	var imgClass=new Array();
	for (i=0;i<imgarr.length;i++){
		if (imgarr[i].className.indexOf('domroll')!=-1){
			imgSrc[i]=imgarr[i].getAttribute('src');
			imgClass[i]=imgarr[i].className;
			imgPreload[i]=new Image();
			if (imgClass[i].match(/domroll (\S+)/)) {
				imgPreload[i].src = imgClass[i].match(/domroll (\S+)/)[1]
			}
			imgarr[i].setAttribute('xsrc', imgSrc[i]);
			imgarr[i].onmouseover=function(){
				this.setAttribute('src',this.className.match(/domroll (\S+)/)[1])
			}
			imgarr[i].onmouseout=function(){
				this.setAttribute('src',this.getAttribute('xsrc'))
			}
		}
	}
}

if(window.addEventListener){window.addEventListener("load", domRollover, false);} 
else{
	if(window.attachEvent){window.attachEvent("onload", domRollover);}
	else{if(document.getElementById){window.onload=domRollover;}}
}














//Chrome Drop Down Menu v2.01- Author: Dynamic Drive (http://www.dynamicdrive.com)
//Last updated: November 14th 06- added iframe shim technique

var cssdropdown={
disappeardelay: 250, //set delay in miliseconds before menu disappears onmouseout
disablemenuclick: false, //when user clicks on a menu item with a drop down menu, disable menu item's link?
enableswipe: 1, //enable swipe effect? 1 for yes, 0 for no
enableiframeshim: 1, //enable "iframe shim" technique to get drop down menus to correctly appear on top of controls such as form objects in IE5.5/IE6? 1 for yes, 0 for no

//No need to edit beyond here////////////////////////
dropmenuobj: null, ie: document.all, firefox: document.getElementById&&!document.all, swipetimer: undefined, bottomclip:0,

getposOffset:function(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
},

swipeeffect:function(){
if (this.bottomclip<parseInt(this.dropmenuobj.offsetHeight)){
this.bottomclip+=10+(this.bottomclip/10) //unclip drop down menu visibility gradually
this.dropmenuobj.style.clip="rect(0 auto "+this.bottomclip+"px 0)"
}
else
return
this.swipetimer=setTimeout("cssdropdown.swipeeffect()", 10)
},

showhide:function(obj, e){
if (this.ie || this.firefox)
this.dropmenuobj.style.left=this.dropmenuobj.style.top="-500px"
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover"){
if (this.enableswipe==1){
if (typeof this.swipetimer!="undefined")
clearTimeout(this.swipetimer)
obj.clip="rect(0 auto 0 0)" //hide menu via clipping
this.bottomclip=0
this.swipeeffect()
}
obj.visibility="visible"
}
else if (e.type=="click")
obj.visibility="hidden"
},

iecompattest:function(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
},

clearbrowseredge:function(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=this.ie && !window.opera? this.iecompattest().scrollLeft+this.iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
this.dropmenuobj.contentmeasure=this.dropmenuobj.offsetWidth
if (windowedge-this.dropmenuobj.x < this.dropmenuobj.contentmeasure)  //move menu to the left?
edgeoffset=this.dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=this.ie && !window.opera? this.iecompattest().scrollTop : window.pageYOffset
var windowedge=this.ie && !window.opera? this.iecompattest().scrollTop+this.iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
this.dropmenuobj.contentmeasure=this.dropmenuobj.offsetHeight
if (windowedge-this.dropmenuobj.y < this.dropmenuobj.contentmeasure){ //move up?
edgeoffset=this.dropmenuobj.contentmeasure+obj.offsetHeight
if ((this.dropmenuobj.y-topedge)<this.dropmenuobj.contentmeasure) //up no good either?
edgeoffset=this.dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
},

dropit:function(obj, e, dropmenuID){
hideSelects('hidden', dropmenuID);
if (this.dropmenuobj!=null) //hide previous menu
this.dropmenuobj.style.visibility="hidden" //hide menu
this.clearhidemenu()
if (this.ie||this.firefox){
obj.onmouseout=function(){cssdropdown.delayhidemenu()}
obj.onclick=function(){return !cssdropdown.disablemenuclick} //disable main menu item link onclick?
this.dropmenuobj=document.getElementById(dropmenuID)
this.dropmenuobj.onmouseover=function(){cssdropdown.clearhidemenu()}
this.dropmenuobj.onmouseout=function(e){cssdropdown.dynamichide(e)}
this.dropmenuobj.onclick=function(){cssdropdown.delayhidemenu()}
this.showhide(this.dropmenuobj.style, e)
this.dropmenuobj.x=this.getposOffset(obj, "left")
this.dropmenuobj.y=this.getposOffset(obj, "top")
this.dropmenuobj.style.left=this.dropmenuobj.x-this.clearbrowseredge(obj, "rightedge")+"px"
this.dropmenuobj.style.top=this.dropmenuobj.y-this.clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+1+"px"
this.positionshim() //call iframe shim function
}
},

positionshim:function(){ //display iframe shim function
if (this.enableiframeshim && typeof this.shimobject!="undefined"){
if (this.dropmenuobj.style.visibility=="visible"){
this.shimobject.style.width=this.dropmenuobj.offsetWidth+"px"
this.shimobject.style.height=this.dropmenuobj.offsetHeight+"px"
this.shimobject.style.left=this.dropmenuobj.style.left
this.shimobject.style.top=this.dropmenuobj.style.top
}
this.shimobject.style.display=(this.dropmenuobj.style.visibility=="visible")? "block" : "none"
}
},

hideshim:function(){
hideSelects('visible', null);
if (this.enableiframeshim && typeof this.shimobject!="undefined")
this.shimobject.style.display='none'
},

contains_firefox:function(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
},

dynamichide:function(e){
var evtobj=window.event? window.event : e
if (this.ie&&!this.dropmenuobj.contains(evtobj.toElement))
this.delayhidemenu()
else if (this.firefox&&e.currentTarget!= evtobj.relatedTarget&& !this.contains_firefox(evtobj.currentTarget, evtobj.relatedTarget))
this.delayhidemenu()
},

delayhidemenu:function(){
this.delayhide=setTimeout("cssdropdown.dropmenuobj.style.visibility='hidden'; cssdropdown.hideshim()",this.disappeardelay) //hide menu
},

clearhidemenu:function(){
if (this.delayhide!="undefined")
clearTimeout(this.delayhide)
},

startchrome:function(){
for (var ids=0; ids<arguments.length; ids++){
var menuitems=document.getElementById(arguments[ids]).getElementsByTagName("a")
for (var i=0; i<menuitems.length; i++){
if (menuitems[i].getAttribute("rel")){
var relvalue=menuitems[i].getAttribute("rel")
menuitems[i].onmouseover=function(e){
var event=typeof e!="undefined"? e : window.event
cssdropdown.dropit(this,event,this.getAttribute("rel"))
}
}
}
}
if (window.createPopup && !window.XmlHttpRequest){ //if IE5.5 to IE6, create iframe for iframe shim technique
document.write('<DIV id="iframeshim"  style="display: none; left: 0; top: 0; z-index: 90; position: absolute; filter: progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)" frameBorder="0" scrolling="no"></DIV>')
this.shimobject=document.getElementById("iframeshim") //reference iframe object
}
}

}




function hideSelects(action, idMenu) {

	//documentation for this script at http://www.shawnolson.net/a/1198/
	//possible values for action are 'hidden' and 'visible'
	
	//Comentado por Ricardo Cury. Esta solução foi descartada
	/*if (action!='visible'){action='hidden';}
	if (navigator.appName.indexOf("MSIE")) {
		for (var S = 0; S < document.forms.length; S++){
			for (var R = 0; R < document.forms[S].length; R++) {
				if (document.forms[S].elements[R].options) {
					document.forms[S].elements[R].style.visibility = action;
				}
			}
		} 
	}*/
	
	if (action!='visible'){action='hidden';}
	if (navigator.appName.indexOf("MSIE") ) {
		for (var S = 0; S < document.forms.length; S++){
			for (var R = 0; R < document.forms[S].length; R++) {
				if (document.forms[S].elements[R].options) {
					if(document.forms[S].elements[R].name == "cdCategoria" && idMenu=='dropmenu2' ){
						document.forms[S].elements[R].style.visibility = action;
					} else {
						document.forms[S].elements[R].style.visibility = 'visible';
					}
				}
			}
		} 
	}
	
}


JS_DOM	= (document.getElementById) ? true : false;
JS_NS4	= (document.layers) ? true : false;
JS_IE	= (document.all) ? true : false;
JS_IE4	= JS_IE && !JS_DOM;
function esconde_mensagem(indice) {
	if (JS_DOM && !JS_IE && !JS_NS4)
	{
		document.getElementById("bod_" + indice).style.display = 'none';
		document.getElementById("bod_" + indice).style.position = 'absolute';
	}
	else
	{
		eval("document.all.bod_" + indice).style.display = 'none';
	}
}

function mensagem_mostra(indice) {
	if (JS_DOM && !JS_IE && !JS_NS4)
	{
		document.getElementById("bod_" + indice).style.display = '';
		document.getElementById("bod_" + indice).style.position = 'relative';
	}
	else
	{
		eval("document.all.bod_" + indice).style.display = '';
	}
}

function mostra_mensagem(indice,tipo) {
	if (tipo == 0)	{
		//troca2(indice);
		if (JS_DOM && !JS_IE && !JS_NS4)
		{
			if (document.getElementById("bod_" + indice).style.display == 'none'){
				document.getElementById("bod_" + indice).style.position = 'relative';
				document.getElementById("bod_" + indice).style.display = '';
			}
			else
			{
				document.getElementById("bod_" + indice).style.display = 'none';
				document.getElementById("bod_" + indice).style.position = 'absolute';
			}
		}
		else
		{
			//document.getElementById("bod_" + indice).style.position = 'relative';
			if (eval("document.all.bod_" + indice).style.display == '')
				eval("document.all.bod_" + indice).style.display = 'none';
			else
				eval("document.all.bod_" + indice).style.display = '';
		}
	}
}

function troca2(ind_img) {
	var fonte;
	if (isNaN(document.imagem.length)){fonte = document.imagem.src;}
	else{fonte = document.imagem[ind_img].src;}
	if (fonte.indexOf("abre1.") == -1) {
		if (isNaN(document.imagem.length))
		{
			document.imagem.src=fonte.substring(0,fonte.length-10) + "abre1.gif";
		}
		else
		{
			document.imagem[ind_img].src=fonte.substring(0,fonte.length-10) + "abre1.gif";
		}
	}
	else
	{
		if (isNaN(document.imagem.length))
		{
			document.imagem.src=fonte.substring(0,fonte.length - 9) + "fecha1.gif";
		}
		else
		{
			document.imagem[ind_img].src=fonte.substring(0,fonte.length - 9) + "fecha1.gif";
		}
	}
}



browser_ok = false;
if(document.all){browser_ok = true};

function troca(indice){
	if(browser_ok){
		fonte=document.imagem[indice].src
		if(fonte.indexOf("on.") == -1){
			document.imagem[indice].src=fonte.substring(0,fonte.length-7) + "on.gif"
		}
		else{
			document.imagem[indice].src=fonte.substring(0,fonte.length - 6) + "off.gif"
		}
	}
}


function TPanel(name, tipo, htm, index, temLogo) {
this.name = name;
this.index = index;

if (tipo == 999)
imgH = 521;
else
imgH = 48;

if (temLogo)
imgH = 90;

var zIndex = this.index + '2';
eval('iTime' + parseInt(zIndex) + ' = 0');

document.write('<div onmouseover=null onmouseout=null id=div_' + this.name + ' style="position:absolute; margin:0px 0px 0px 36px; _margin:0px 0px 0px -45px;  width:180px;  display:none; z-index:' + zIndex + ';border:0px solid #000000"><div class="conteudo_pop">'+htm+'</div></div>');

this.div_obj = findObj('div_' + this.name);

this.isVisible = function () {
return (this.div_obj.style.display != 'none');
}

this.show = function () {
this.div_obj.style.display = '';
}

this.hide = function () {
this.div_obj.style.display = 'none';
}


this.div_obj.onmouseover = function () {
var sTime = 'iTime' + parseInt(this.style.zIndex);

eval('clearTimeout(' + sTime + ');');

this.style.display = '';
}

this.div_obj.onmouseout = function () {
var sTime = 'iTime' + parseInt(this.style.zIndex);
eval(sTime + ' = setTimeout(\'findObj("' + this.id + '").style.display = "none"\', 200);');

//this.style.display = 'none';
}

/*this.div_obj.onmouseover = function () {
this.style.display = '';
var sTime = 'iTime' + parseInt(this.style.zIndex);
eval(sTime + ' = setTimeout(\'findObj("' + this.id + '").style.display = "none"\', 1000);');
}

this.div_obj.onmousemove = function () {
this.style.display = '';
var sTime = 'iTime' + parseInt(this.style.zIndex);

eval('clearTimeout(' + sTime + ');');
eval(sTime + ' = setTimeout(\'findObj("' + this.id + '").style.display = "none"\', 1000);');
}*/
}









function TPanel2(name, tipo, htm, index, temLogo) {
this.name = name;
this.index = index;

if (tipo == 999)
imgH = 521;
else
imgH = 48;

if (temLogo)
imgH = 90;

var zIndex = this.index + '2';
eval('iTime' + parseInt(zIndex) + ' = 0');

document.write('<div onmouseover=null onmouseout=null id=div_' + this.name + ' style="position:absolute; margin:0px 0px 0px -130px; _margin:0px 0px 10px -125px;  width:180px;  display:none; z-index:' + zIndex + ';border:0px solid #000000"><div class="conteudo_pop_cesta1">'+htm+'</div></div>');

this.div_obj = findObj('div_' + this.name);

this.isVisible = function () {
return (this.div_obj.style.display != 'none');
}

this.show = function () {
this.div_obj.style.display = '';
}

this.hide = function () {
this.div_obj.style.display = 'none';
}


this.div_obj.onmouseover = function () {
var sTime = 'iTime' + parseInt(this.style.zIndex);

eval('clearTimeout(' + sTime + ');');

this.style.display = '';
}

this.div_obj.onmouseout = function () {
var sTime = 'iTime' + parseInt(this.style.zIndex);
eval(sTime + ' = setTimeout(\'findObj("' + this.id + '").style.display = "none"\', 200);');

//this.style.display = 'none';
}

/*this.div_obj.onmouseover = function () {
this.style.display = '';
var sTime = 'iTime' + parseInt(this.style.zIndex);
eval(sTime + ' = setTimeout(\'findObj("' + this.id + '").style.display = "none"\', 1000);');
}

this.div_obj.onmousemove = function () {
this.style.display = '';
var sTime = 'iTime' + parseInt(this.style.zIndex);

eval('clearTimeout(' + sTime + ');');
eval(sTime + ' = setTimeout(\'findObj("' + this.id + '").style.display = "none"\', 1000);');
}*/
}

  function ME_cBrowser(){
    this.ie=false;
    this.ns7=false;
    if (window.navigator.appName=='Microsoft Internet Explorer')
        this.ie=true;
      else
    if (window.navigator.appName=='Netscape')
        this.ns7=true;
  }

    g=new ME_cBrowser();



  function findObj(name) {
    if (g.ie)
      return document.all[name];
    else {
    //if (g.ns7) {
      if (document.getElementsByName(name).length > 1)
        return document.getElementsByName(name);
      else
      if (document.getElementsByName(name)[0])
        return document.getElementsByName(name)[0];
      else
        return document.getElementById(name);
    }
  }


	


function adicionar(){
	if (confirm("Você deseja cancelar?") == true){
		location.href = "javascript:history.back();";
	};
}

function TPanelsub(name, tipo, htm, index, temLogo) {
this.name = name;
this.index = index;

if (tipo == 999)
imgH = 521;
else
imgH = 48;

if (temLogo)
imgH = 90;

var zIndex = this.index + '2';
eval('iTime' + parseInt(zIndex) + ' = 0');

document.write('<div onmouseover=null onmouseout=null id=div_' + this.name + ' style="position:absolute; margin:0px 0px 0px 62px; _margin:0px 0px 10px -34px;  width:180px;  display:none; z-index:' + zIndex + ';border:0px solid #000000"><div class="conteudo_pop">'+htm+'</div></div>');

this.div_obj = findObj('div_' + this.name);

this.isVisible = function () {
return (this.div_obj.style.display != 'none');
}

this.show = function () {
this.div_obj.style.display = '';
}

this.hide = function () {
this.div_obj.style.display = 'none';
}


this.div_obj.onmouseover = function () {
var sTime = 'iTime' + parseInt(this.style.zIndex);

eval('clearTimeout(' + sTime + ');');

this.style.display = '';
}

this.div_obj.onmouseout = function () {
var sTime = 'iTime' + parseInt(this.style.zIndex);
eval(sTime + ' = setTimeout(\'findObj("' + this.id + '").style.display = "none"\', 200);');

//this.style.display = 'none';
}

/*this.div_obj.onmouseover = function () {
this.style.display = '';
var sTime = 'iTime' + parseInt(this.style.zIndex);
eval(sTime + ' = setTimeout(\'findObj("' + this.id + '").style.display = "none"\', 1000);');
}

this.div_obj.onmousemove = function () {
this.style.display = '';
var sTime = 'iTime' + parseInt(this.style.zIndex);

eval('clearTimeout(' + sTime + ');');
eval(sTime + ' = setTimeout(\'findObj("' + this.id + '").style.display = "none"\', 1000);');
}*/
}

function TPanelespecial(name, tipo, htm, index, temLogo) {
this.name = name;
this.index = index;

if (tipo == 999)
imgH = 521;
else
imgH = 48;

if (temLogo)
imgH = 90;

var zIndex = this.index + '2';
eval('iTime' + parseInt(zIndex) + ' = 0');

document.write('<div onmouseover=null onmouseout=null id=div_' + this.name + ' style="position:absolute; margin:0px 0px 0px 34px; _margin:0px 0px 10px -45px;  width:180px;  display:none; z-index:' + zIndex + ';border:0px solid #000000"><div class="conteudo_pop">'+htm+'</div></div>');

this.div_obj = findObj('div_' + this.name);

this.isVisible = function () {
return (this.div_obj.style.display != 'none');
}

this.show = function () {
this.div_obj.style.display = '';
}

this.hide = function () {
this.div_obj.style.display = 'none';
}


this.div_obj.onmouseover = function () {
var sTime = 'iTime' + parseInt(this.style.zIndex);

eval('clearTimeout(' + sTime + ');');

this.style.display = '';
}

this.div_obj.onmouseout = function () {
var sTime = 'iTime' + parseInt(this.style.zIndex);
eval(sTime + ' = setTimeout(\'findObj("' + this.id + '").style.display = "none"\', 200);');

//this.style.display = 'none';
}

/*this.div_obj.onmouseover = function () {
this.style.display = '';
var sTime = 'iTime' + parseInt(this.style.zIndex);
eval(sTime + ' = setTimeout(\'findObj("' + this.id + '").style.display = "none"\', 1000);');
}

this.div_obj.onmousemove = function () {
this.style.display = '';
var sTime = 'iTime' + parseInt(this.style.zIndex);

eval('clearTimeout(' + sTime + ');');
eval(sTime + ' = setTimeout(\'findObj("' + this.id + '").style.display = "none"\', 1000);');
}*/
}


/* Produto Exclusivo Aktiline*/
function trocaPagina(pag){
var indice_paginas = 0;
paginas = ["produto","ciencia_comprovada","como_funciona","compre_agora"];
	for (indice_paginas = 0; indice_paginas < paginas.length; indice_paginas++ ){
		document.getElementById('pag_'+paginas[indice_paginas]).style.display='none';
		document.getElementById('btn_'+paginas[indice_paginas]).src='/RaiaEcommWeb/pages/includes/img/menu_'+paginas[indice_paginas]+'_off.jpg';
	}
	document.getElementById('pag_'+pag).style.display='block';
	document.getElementById('btn_'+pag).src='/RaiaEcommWeb/pages/includes/img/menu_'+pag+'_on.jpg';
}


/**************************************************************
***** Função para trocar o foco do campo automaticamente ******
**************************************************************/
function trocaCampo(campo, prox_campo, num_max, nome_form){
	
	if (campo.value.length == num_max){
		campo = eval("document." + nome_form + "." + prox_campo);
		campo.focus();
	}
}
