/** MOSTRA E ESCONDE DIVS **/

function getStyle(id){	
	return document.getElementById(id).style;
}

function HideLayer(id){	
	getStyle(id).visibility = "hidden";
	getStyle(id).display = "none";
}
function ShowLayer(id){	
	getStyle(id).visibility = "visible";
	getStyle(id).display = "block";
}

/** TROCA CLASSE **/

function change(id, newClass) {
	var i;
	var botoes=new Array("imgIgredientes","imgAplicacao","imgVerComentarios");
	for (i=0;i<=2;i++) {		
		identity=document.getElementById("bt_"+i);
		identity.className=botoes[i];
	}
	identity=document.getElementById(id);
	identity.className=newClass;    
}


function MakeActive(num){
    	if(document.getElementById){
        	for(i=0;i<lnk.length;i++){
        		lnk[i].style.background = "#63b2f3";
        		lnk[num].style.background = "#1287e8";
        	}
    	}
}

function MakeActiveInit() {
    	if(document.getElementById){
        	lnk = document.getElementById("Rosto").getElementsByTagName("a");
        	for(i=0;i<lnk.length;i++){
        		lnk[i].onfocus=new Function("if(this.blur)this.blur()");
        		lnk[0].style.background = "#63b2f3";
		}
        }	
}

function popTermos(mypage, myname, w, h, chscroll) {
	var winLargura = (screen.width - w) / 2;
	var winAltura = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+winAltura+',left='+winLargura+',scrollbars='+chscroll+',resizable'
	win = window.open(mypage, myname, winprops)
	
	if (parseInt(navigator.appVersion) >= 4){
	win.window.focus();
	}
}

function changeBorderColor(ref,color){
    ref.style.borderColor=color;
}

function changeTypeField(ref,_type,_value){    
    ref.value = _value;
    ref.type  = _type;                
}

function changeTypeField2(ref,_type,_value){       
    if (ref.value.length == 0){
        ref.type  = _type;
        ref.value = _value;        
    }
}

function changeTypeField3(ref,_value){   
    if (ref.value.length == 0){ 
        ref.className = _value;
    }
}

/*********** ABRE FECHA DIV ************/

function lunchboxOpen(lunchID) {
	if(document.getElementById('faq_' + lunchID).style.display == "none"){
		document.getElementById('faq_' + lunchID).style.display = "block";
		document.getElementById('min_' + lunchID).src="img/bt_minimizar.gif";
	}else{
		document.getElementById('faq_' + lunchID).style.display = "none";
		document.getElementById('min_' + lunchID).src="img/bt_maximizar.gif";
	}
}

function homeBanner(archivo,ancho,alto,version,name) // tutorial by IVI CONCEPT - www.ivi-concept.com
  {
  var quality="high"; // calidad de visualización de la peli
  var bgcolor="#fb6d00"; // color de fondo de la peli
  var wmode="transparent"; // color de fondo de la peli
  // --fin parametros--------------------------------------------------
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+version+'" name='+name+' width='+ancho+' height='+alto+'>\n');
document.write('<param name="movie" value='+archivo+' />\n');
document.write('<param name="quality" value='+quality+'>\n');
document.write('<param name="bgcolor" value='+bgcolor+'>\n');
document.write('<param name="wmode" value='+wmode+'>\n');
document.write('<embed src='+archivo+' wmode='+wmode+' bgcolor='+bgcolor+' quality='+quality+' pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" id='+name+' width='+ancho+' height='+alto+'></embed>');
document.write('</object>\n');
}


