function ajudaItens(idLi, idConteudo) {
	if (document.getElementById(idConteudo).style.display == 'none') {
		document.getElementById(idConteudo).style.display = '';
		document.getElementById(idLi).className = "listaAjudaAberta";
	} 
	else {
		document.getElementById(idConteudo).style.display = 'none';
		document.getElementById(idLi).className = "listaAjudaFechada";
	}
}




// LAYER SOLICITE ATENDIMENTO
function abreLayer() {
	document.getElementById('layerFundo').style.display = 'block';
	//document.getElementById('centraliza').className = "opacidadeBaixa";
	//document.getElementById('coluna1024').className = "opacidadeBaixa";
	document.getElementById('layerCaixa').style.visibility = "visible";
}
function fechaLayer() {
	document.getElementById('layerFundo').style.display = 'none';
	//document.getElementById('centraliza').className = "opacidadeNormal";
	//document.getElementById('coluna1024').className = "opacidadeNormal";
	document.getElementById('layerCaixa').style.visibility = "hidden";
}


// HELP - Legenda 
function helpOn(id) {
		document.getElementById(id).style.display = "block";
}
function helpOff(id) {
		document.getElementById(id).style.display = "none";
}


//
function btnAdquiraOver(id) {
	var aba = "abaAdquira"+id;
	document.getElementById(aba).className = "abaAdquira abaAdquiraOver"
	
	var img11 = "btnAdquira"+id+"1img1";
	var img12 = "btnAdquira"+id+"1img2";
	document.getElementById(img11).style.display = "none";
	document.getElementById(img12).style.display = "none";
	
	var img21 = "btnAdquira"+id+"2img1";
	var img22 = "btnAdquira"+id+"2img2";
	document.getElementById(img21).style.display = "block";
	document.getElementById(img22).style.display = "block";
}

function btnAdquiraOut(id) {
	var aba = "abaAdquira"+id;
	document.getElementById(aba).className = "abaAdquira"
	
	var img11 = "btnAdquira"+id+"1img1";
	var img12 = "btnAdquira"+id+"1img2";
	document.getElementById(img11).style.display = "block";
	document.getElementById(img12).style.display = "block";
	
	var img21 = "btnAdquira"+id+"2img1";
	var img22 = "btnAdquira"+id+"2img2";
	document.getElementById(img21).style.display = "none";
	document.getElementById(img22).style.display = "none";
}



function mudaCampo(maxTam,idAtual,proxCampo) {
	 if (document.getElementById(idAtual).value.length >= maxTam) {
		 document.getElementById(proxCampo).focus();
	 }
}


// Carrega Over do botão adquira
function pre_carregar_imagens(){
	
	var imagem_lista = Array('../img/imgAbaLaranjaInversaL.gif', '../img/imgAbaLaranjaInversaR.gif', '../img/imgAbaLaranjaInversaM.gif');
	var imagem_qtd = imagem_lista.length;
	for (i = 0; i <imagem_qtd; i++) {
	    var preload = new Image();
	    preload.src = imagem_lista[i];
	}
}
//pre_carregar_imagens();


// FLASH
function flash(swf,flashVarString,w,h,bgcolor,menu,mode,q,id){
document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" '
	+'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" '
	+'width="'+w+'" height="'+h+'" id="'+id+'" align="">'
	+'<param name="movie" value="'+swf+'">'
	+'<param name="menu" value="'+menu+'"> '
	+'<param name="quality" value="'+q+'"> '
	+'<param name="wmode" value="'+mode+'"> '
	+'<param name="bgcolor" value="'+bgcolor+'"> '
	+'<param name="flashvars" value="'+flashVarString+'"> '
	+'<param name="allowScriptAccess" value="sameDomain"> '
	+'<embed src="'+swf+'" flashvars="'+flashVarString+'" menu="'+menu+'" quality="'+q+'" wmode="'+mode+'" '
	+' bgcolor="'+bgcolor+'" width="'+w+'" height="'+h+'" name="'+swf+'" '
	+' align="" type="application/x-shockwave-flash" '
	+' pluginspage="http://www.macromedia.com/go/getflashplayer" allowScriptAccess="sameDomain"></embed></object> ');
}

















/***********************************************
* Cool DHTML tooltip script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/
var offsetxpoint=-60 //Customize x offset of tooltip
var offsetypoint=20 //Customize y offset of tooltip
var ie=document.all
var ns6=document.getElementById && !document.all
var enabletip=false
if (ie||ns6)

var tipobj=document.all? document.all["helpCaixa"] : document.getElementById? document.getElementById("helpCaixa") : ""

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function ddrivetip(thetext, thecolor, thewidth){
if (ns6||ie){
if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px"
if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor
tipobj.innerHTML=thetext
enabletip=true
return false
}
}

function positiontip(e){
if (enabletip){
var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;
//Find out how close the mouse is to the corner of the window
var rightedge=ie&&!window.opera? ietruebody().clientWidth-event.clientX-offsetxpoint : window.innerWidth-e.clientX-offsetxpoint-20
var bottomedge=ie&&!window.opera? ietruebody().clientHeight-event.clientY-offsetypoint : window.innerHeight-e.clientY-offsetypoint-20

var leftedge=(offsetxpoint<0)? offsetxpoint*(-1) : -1000

//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<tipobj.offsetWidth)
//move the horizontal position of the menu to the left by it's width
tipobj.style.left=ie? ietruebody().scrollLeft+event.clientX-tipobj.offsetWidth+"px" : window.pageXOffset+e.clientX-tipobj.offsetWidth+"px"
else if (curX<leftedge)
tipobj.style.left="5px"
else
//position the horizontal position of the menu where the mouse is positioned
tipobj.style.left=curX+offsetxpoint+"px"

//same concept with the vertical position
if (bottomedge<tipobj.offsetHeight)
	tipobj.style.top=ie? ietruebody().scrollTop+event.clientY-tipobj.offsetHeight-offsetypoint+"px" : window.pageYOffset+e.clientY-tipobj.offsetHeight-offsetypoint+"px"
else
	tipobj.style.top=curY+offsetypoint+"px"
	tipobj.style.visibility="visible"
}
}

function hideddrivetip(){
	if (ns6||ie){
		enabletip=false
		tipobj.style.visibility="hidden"
		tipobj.style.left="-1000px"
		tipobj.style.backgroundColor=''
		tipobj.style.width=''
	}
}

document.onmousemove=positiontip
