// JavaScript Document
function trocaImagem(i, pro)
{
	
	
	var ini = 1;
	
	var divImg = document.getElementById("hrefFotoProduto");
	var divAmpliar = document.getElementById("ampliarFotoProduto");
	
	divImg.innerHTML='<a href="'+URLREESCRITA+'imagens/produtos/g/'+ pro +'_'+ i +'.jpg" rel="prettyPhoto[image]"><img src="'+URLREESCRITA+'imagens/produtos/m/'+ pro +'_'+ i +'.jpg" id="imgFotoProduto"></a>';
//	divAmpliar.innerHTML='<a href="'+URLREESCRITA+'imagens/produtos/g/'+ pro +'_'+ i +'.jpg" rel="prettyPhoto[image0]"><img src="'+URLREESCRITA+'imagens/bt_ampliar_imagem.gif"></a>';
	idFotoSelecionada = i;

	
	
	while (ini<=imagens){
		var troca = document.getElementById("troca_"+ini);
		troca.className = 'img_inativo';
		
		if(ini != i)
		{
			divImg.innerHTML += '<a href="'+URLREESCRITA+'imagens/produtos/g/'+ pro +'_'+ ini +'.jpg" rel="prettyPhoto[image]">';
		}
		ini++;
	}
	
	var troca = document.getElementById("troca_"+i);
	troca.className = 'img_ativo';
	
	$(document).ready(function(){
		$("a[rel^='prettyPhoto']").prettyPhoto({
			animationSpeed: 'normal', /* fast/slow/normal */
			padding: 40, /* padding for each side of the picture */
			opacity: 0.35, /* Value betwee 0 and 1 */
			showTitle: true, /* true/false */
			allowresize: true, /* true/false */
			counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */
			theme: 'light_rounded', /* light_rounded / dark_rounded / light_square / dark_square */
			callback: function(){}
		});

	});

}


lib = new Object();

lib = {
	Import: function(File){
		document.write('<script src="'+URLREESCRITA+'admin/includes/js/'+File+'" type="text/javascript"></script>\n');
	}
}

function mostra(id){
	
	if(document.getElementById('submenu_'+id).style.display == 'none')
	{
		document.getElementById('submenu_'+id).style.display = 'block';
	} else if(document.getElementById('submenu_'+id).style.display == 'block')
	{
		document.getElementById('submenu_'+id).style.display = 'none';
	}
}
