function alturaMenu() {
	var col1 = document.getElementById('coluna1');
	var col2 = document.getElementById('coluna2'); 
	var col3 = document.getElementById('coluna3'); 
	c1h = col1.offsetHeight;
	c2h = col2.offsetHeight;
	c3h = col3.offsetHeight;
	
	if(c1h > c2h) {colmax = c1h;} else {colmax = c2h;}
	if(c3h > colmax) {colmax = c3h;} 
	
	col1.style.height = colmax+'px';
	col3.style.height = colmax+'px';
}

var xmlhttp;
function loadAjax(url)
{
document.getElementById('ajaxLoader').style.visibility='visible';
xmlhttp=null;
if (window.XMLHttpRequest)
  {// code for Firefox, Opera, IE7, etc.
  xmlhttp=new XMLHttpRequest();
  }
else if (window.ActiveXObject)
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
if (xmlhttp!=null)
  {
  xmlhttp.onreadystatechange=state_Change;
  xmlhttp.open("GET",url,true);
  xmlhttp.send(null);
  }
else
  {
  alert("Your browser does not support XMLHTTP.");
  }
}

function state_Change()
{
if (xmlhttp.readyState==4)
  {// 4 = "loaded"
  if (xmlhttp.status==200)
    {// 200 = "OK"
    document.getElementById('frameAjax').innerHTML=xmlhttp.responseText;
	Shadowbox.init({ skipSetup: true }); Shadowbox.setup();
	document.getElementById('ajaxLoader').style.visibility='hidden';

    }
  else
    {
    alert("Problem retrieving data:" + xmlhttp.statusText);
    }
  }
}

function findPos(obj){
var posX = obj.offsetLeft;var posY = obj.offsetTop;
	while(obj.offsetParent){
	if(obj==document.getElementsByTagName('body')[0]){break}
	else{
	posX=posX+obj.offsetParent.offsetLeft;
	posY=posY+obj.offsetParent.offsetTop;
	obj=obj.offsetParent;
	}
}
var posArray=[posY];
return posArray;
}
function Change_Big_One(caixa_artigo){
	document.getElementById('imagem_' + caixa_artigo).src = document.getElementById('fotobig_'+caixa_artigo).value;
	overlay_id = document.getElementById("overlay_" + caixa_artigo);						
	overlay_id.style.display = "block";
	searchid = document.getElementById("caixa_artigo_" + caixa_artigo);
	//divtop = findPos(searchid) - 36;
	//overlay_id.style.top = divtop + "px";	
}
function Change_to_normal(caixa_artigo){
	overlay_id = document.getElementById("overlay_" + caixa_artigo);	
	overlay_id.style.display = "none";
}		

function adicionar_cartao(id) {adiciona_ajax('includes/compras/adicionar_ao_cartao.php?id=' + id);}
var xmlhttp3;
function adiciona_ajax(url){xmlhttp3=null;if (window.XMLHttpRequest){xmlhttp3=new XMLHttpRequest();}else if (window.ActiveXObject){xmlhttp3=new ActiveXObject("Microsoft.XMLHTTP");}if (xmlhttp3!=null){xmlhttp3.onreadystatechange=state_Change3;xmlhttp3.open("GET",url,true);xmlhttp3.send(null);}else {alert("Your browser does not support XMLHTTP.");}}function state_Change3(){if (xmlhttp3.readyState==4)
{if (xmlhttp3.status==200){document.getElementById('cartao').innerHTML = xmlhttp3.responseText;}else{alert("Problem retrieving data:" + xmlhttp3.statusText);}}}

function abre2(j) {
	//r = document.getElementById('resultados');
	//r.innerHTML = ''; r.style.display='none';
	Shadowbox.open({player:'iframe',content:site_base+'includes/artigos/item.php?item='+j,width:900,height:600});	
}

function mostra_acessorios(a) {
	window.location = site_base + 'acess/' + a;
}
