// Post para Popup
function postToPopup(f,n,w,h,c){
  openPopup('about:blank',n,w,h,null,c)
  if(!is.ns4)
    popup.document.bgColor='#E4E4E4'
  f.target='pop_'+n
  f.submit()
}
// Path Internas
function mkPathInt(idioma, secao, subsecao, nome) {
  str ='<td><img src="/b2c/img/'+secao+'/'+idioma+'_mn_int_'+nome+'_'+((subsecao==nome)?'on':'off')+'.gif" height=20 border=0 hspace=5></td>';
  d.write(str);
}
// Botoes de formulario
function mkBt(nome, action){
  str='<table id='+nome+' border=0 cellspacing=0 cellpadding=0><tr><td><img src="/b2c/img/bt_esq.gif" width=7 height=16></td><td  class="bt-bg"><a href="javascript:'+action+'" class="link-bt" onmouseover="window.status=\'www.tam.com.br\';return true"><b>'+nome+'</b></a></td><td><img src="/b2c/img/bt_dir.gif" width=7 height=16></td></tr></table>';
  d.write(str);
}
// Botoes de figura
function mkBtImg(nome, idioma, action){
  str ='<table id='+nome+' border=0 cellspacing=0 cellpadding=0><tr><td><a href="javascript:'+action+'" onmouseover="window.status=\'www.tam.com.br\';return true"><img src="/b2c/vgn/img/nb_botao/' + idioma + nome + '.gif" border="0"></a></td></tr></table>';
  document.write(str);
}
// Botoes de figura
function mkBtImg2(nome, id_img, idioma, action){
  str ='<table id='+nome+' border=0 cellspacing=0 cellpadding=0><tr><td><a href="javascript:'+action+'" onmouseover="window.status=\'www.tam.com.br\';return true"><img src="/b2c/vgn/img/nb_botao/' + idioma + nome + '.gif" id='+id_img+' border="0"></a></td></tr></table>';
  document.write(str);
}
// Botoes de figura
function mkBtImg3(nome, id_img, idioma, action){
  str ='<table id='+nome+' border=0 cellspacing=0 cellpadding=0><tr><td><img style="cursor : hand" onclick="javascript:'+action+'" onmouseover="window.status=\'www.tam.com.br\';return true" src="/b2c/vgn/img/nb_botao/' + idioma + nome + '.gif" id='+id_img+' border="0"></td></tr></table>';
  document.write(str);
}
// Spacer
function mkPx(wIe,hIe,wNs,hNs){
  if(!is.ns4){
    str='<img src="/b2c/img/px.gif" width='+wIe+' height='+hIe+'>';
  }else{
    str='<spacer type="block" width='+wNs+' height='+hNs+'>';
  }
  d.write(str);
}
function show() {
	for (lnArg = 0; lnArg < arguments.length; lnArg ++) {
		lvArg = arguments[lnArg];
		if (typeof(lvArg) == "object") {
			if (lvArg.constructor.toString().indexOf("Array") > -1) {
				for (lnItem = 0; lnItem < lvArg.length; lnItem ++)
					document.getElementById(lvArg[lnItem]).style.display = "block";
			} else {
				if (lvArg.style) {
					lvArg.style.display = "block";
				}
			}
		} else {
			if (document.getElementById(lvArg))
				document.getElementById(lvArg).style.display = "block";
		}
	}
}
function hide() {
	for (lnArg = 0; lnArg < arguments.length; lnArg ++) {
		lvArg = arguments[lnArg];
		if (typeof(lvArg) == "object") {
			if (lvArg.constructor.toString().indexOf("Array") > -1) {
				for (lnItem = 0; lnItem < lvArg.length; lnItem ++)
					document.getElementById(lvArg[lnItem]).style.display = "none";
			} else {
				if (lvArg.style) {
					lvArg.style.display = "none";
				}
			}
		} else {
			if (document.getElementById(lvArg))
				document.getElementById(lvArg).style.display = "none";
		}
	}
}
function returnDisplay(element) {
	return document.getElementById(element).style.display;	
}
function returnClassName(element) {
	return document.getElementById(element).className;
}
function changeClass(element,newClassName) {
	document.getElementById(element).className = newClassName;
}
function img(imgName,imgSrc) {
	document.images[imgName].src = imgSrc;
}
var oImg = new Array;
var sImg = new Array;
function swapImg(imgName, imgSrc) {
	oImg[oImg.length] = imgName;
	sImg[sImg.length] = document.images[imgName].src;
	img(imgName,imgSrc);
}
function restoreImg() {
	for (i=0; i<oImg.length; i++) {
		img(oImg[i],sImg[i]);
	}	
}
function destaque(i) {
	changeClass('destaqueAberto1','destaqueA1' + i);
	changeClass('destaqueAberto2','destaqueA2' + i);
	changeClass('destaqueAberto3','destaqueA3' + i);
	changeClass('destaqueAberto4','destaqueA4' + i);
	
	changeClass('destaqueFechado1','destaqueF1' + i);
	changeClass('destaqueFechado2','destaqueF2' + i);
	changeClass('destaqueFechado3','destaqueF3' + i);
	changeClass('destaqueFechado4','destaqueF4' + i);
}
function inter(i) {
	hide('inter1','inter2','inter3');
	show('inter' + i);
}
function nextInter() {	
	if (returnDisplay('inter1') == 'block') {
		hide('inter1','inter2','inter3');
		show('inter2');
	} else if (returnDisplay('inter2') == 'block') {
		hide('inter1','inter2','inter3');
		show('inter3');
	} else {
		hide('inter1','inter2','inter3');
		show('inter1');
	}
}

//[WLR 29/07/2009] - Fábrica Accenture - CR0034 - Inicio
function moveElement(elementMoveFrom, elementMoveTo){
  var newPos = document.getElementById(elementMoveTo); 
  var oldPos = document.getElementById(elementMoveFrom); 
  if (newPos && oldPos) { 
    var body = oldPos.parentNode; 
    body.removeChild (oldPos);
    newPos.innerHTML='';
    newPos.appendChild (oldPos);
  } 
}
//[WLR 29/07/2009] - Fábrica Accenture - CR0034 - Fim

//[MFT 02/09/2009] - Fábrica Accenture - REQ80 - Início

// Altera background de um elemento através de seu ID
function elementStyleBg(elementId, bg) {
  document.getElementById(elementId).style.background = bg;
}
//[MFT 29/09/2009] - Fábrica Accenture - REQ80 - Fim