/**********************************************************************
Funcionalidade: Abrir um popup
Autor: SoftJumper Sistemas
Data: 18/04/2009
**********************************************************************/
function openWindow(url, largura, altura, nome, barra, maximiza, ferramentas)
{

	var intX = new Number((screen.width / 2) - (largura / 2) - 10);
	var intY = new Number((screen.height / 2) - (altura / 2));
	var datData = new Date();
	var intSegundos = datData.getSeconds();
	var strNome = new String('j' + intSegundos.toString());
	var strBarra = new String('no');
	var strMaximiza = new String('no');
	var strFerramentas = new String('no');
	
	if (nome != null)
	{
	
		strNome = nome;
	
	}

	if (barra != null)
	{
	
		if (barra.toString() == '1' || barra.toString().toLowerCase() == 'yes')
		{
		
			strBarra = 'yes';
		
		}
	
	}

	if (maximiza != null)
	{
	
		if (maximiza.toString() == '1' || maximiza.toString().toLowerCase() == 'yes')
		{
		
			strMaximiza = 'yes';
		
		}
	
	}

    if (ferramentas != null)
    {
    
        if (ferramentas.toString() == '1' || ferramentas.toString().toLowerCase() == 'yes')
		{
		
			strFerramentas = 'yes';
		
		}
    
    }

	window.open(url, strNome, 'top=' + intY.toString() + ', left=' + intX.toString() + ', width=' + largura + ', height=' + altura + ', scrollbars=' + strBarra + ', resizable=' + strMaximiza + ', status=yes, menubar = ' + strFerramentas);

}

/**********************************************************************
Funcionalidade: Verifica se a janela atual é um popup
Autor: SoftJumper Sistemas
Data: 18/04/2009
**********************************************************************/
function checkReferer(url)
{

    if (window.opener == null)
    {
        top.location.href = url;
    }
    else
    {
        window.opener.location.href = url;
        window.opener.focus();
    }

}

/**********************************************************************
Funcionalidade: Atualiza propriedades do álbum
Autor: SoftJumper Sistemas
Data: 19/07/2009
**********************************************************************/
function albumMudarFoto(jFoto, jDescricao, jFotografo, propriedades)
{

    var fotoPath = jFoto.attr('src').substring(0, jFoto.attr('src').lastIndexOf('/') + 1);
    
    jDescricao.html(propriedades[1]); 
    jFotografo.html(propriedades[2]); 
    jFoto.attr('src', fotoPath + propriedades[0]);

}