﻿function texto(obj, vlr, vlrT, act)
{
	if(act=='1')
	{
		if(vlr==vlrT)
		{
			obj.value='';
		}
	}
	else
	{
		if(vlrT=='')
		{
			obj.value=vlr;
		}
	}
}

function selecionar_tudo(){ 
   for (i=0;i<document.aspnetForm.elements.length;i++) 
   {
      if(document.aspnetForm.elements[i].type == "checkbox") 
      {
         document.aspnetForm.elements[i].checked=true;
      }
   }
} 

function deselecionar_tudo(){    
   for (i=0;i<document.aspnetForm.elements.length;i++) 
   {
      if(document.aspnetForm.elements[i].type == "checkbox") 
      {
         document.aspnetForm[i].checked=false;
      }
   }
} 

function selecao(valor)
{
    if(valor==true)
    {
        selecionar_tudo();
    }
    else
    {
        deselecionar_tudo();
    }
}

function trocafoto(elemento, valor, numero)
{
    document.getElementById(elemento).src = valor;
    document.getElementById('atual').value = numero;
}

function vf(i1, i2, i3, atual, elemento, acao)
{

    valor1= document.getElementById(i1).src;
    valor1=valor1.replace('_138_','_640_');
    valor2= document.getElementById(i2).src.replace('_138_','_640_');
    valor3= document.getElementById(i3).src.replace('_138_','_640_');
    
    atual = document.getElementById(atual).value;
    
    if(atual=='1')
    {
        if(acao=='n')
        {
            trocafoto(elemento, valor2,'2');
        }
        else
        {
            trocafoto(elemento, valor3,'3');
        }
    }
    
    if(atual=='2')
    {
        if(acao=='n')
        {
            trocafoto(elemento, valor3,'3');
        }
        else
        {
            trocafoto(elemento, valor1,'1');
        }
    }
    
    if(atual=='3')
    {
        if(acao=='n')
        {
            trocafoto(elemento, valor1,'1');
        }
        else
        {
            trocafoto(elemento, valor2,'2');
        }
    }
    
}

function pg(pag)
{	
	document.getElementById('frm').src = pag + ".html";
}

function redimensiona(altura)
{   
	document.getElementById('frm').height=altura;
}

function redimensionaLargura(largura)
{   
	document.getElementById('frm').width=largura;
}
