lib = new Object();

lib = {
	Import: function(File){
		document.write('<script src="includes/js/'+File+'" type="text/javascript"></script>\n');
	}
}

function trocaImagem(i, pro)
{
	var ini = 1; //numero de inicio padrão para inicia na primeira
	
	var divImg = document.getElementById("hrefFotoProduto");
	var divAmpliar = document.getElementById("ampliarFotoProduto");
	
	divImg.innerHTML='<a href="imagens/produtos/g/'+ pro +'_'+ i +'.jpg" rel="prettyPhoto[]" title=""><img src="imagens/produtos/m/'+ pro +'_'+ i +'.jpg" id="imgFotoProduto"></a>';
	divAmpliar.innerHTML='<a href="imagens/produtos/g/'+ pro +'_'+ i +'.jpg" rel="prettyPhoto[0]" title=""><img src="imagens/bt_ampliar_imagem.gif" width="108" height="12"></a>';
	idFotoSelecionada = i;
	
	while (ini<=imagens){
		var troca = document.getElementById("troca_"+ini);
		troca.className = 'troca_imagem';
		
		if(ini != i)
		{
			divImg.innerHTML += '<a href="imagens/produtos/g/'+ pro +'_'+ ini +'.jpg" rel="prettyPhoto[]" title=""></a>';
		}
		
		ini++;
	}
	
	var troca = document.getElementById("troca_"+i);
	troca.className = 'troca_imagem_ativo';

	$("a[rel^='prettyPhoto']").prettyPhoto({
		animationSpeed: 'normal', /* fast/slow/normal */
		padding: 30, /* padding for each side of the picture */
		opacity: 0.50, /* 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(){}
	});
	
}

function popUP(sURL, sName, iWidth, iHeight, scrollb) { 
	posHoriz = parseInt((screen.availWidth / 2) - parseInt(iWidth / 2));
	posVert = parseInt((screen.availHeight / 2) - parseInt(iHeight / 2));
	
	open (sURL, sName, "status=no, scrollbars=no, left=" + posHoriz + ", top=" + posVert + ", width="+iWidth+", height="+iHeight)
}