function inicia()
{
	var teclado = new Array(10);
	var numeros = '';
	var i=0;

	while (i<10)
	{
		temp = Math.floor((Math.random()*10));
		if (numeros.search(temp)<0)
		{
			numeros = numeros + temp;
			teclado[i] = temp;
			i++;
		}
	}
	for (i=0;i<10;i++)
	{
		document.getElementById('img'+i).src='../../images/images/teclado_'+teclado[i]+'.gif';
	}
}


function valor_teclado(id)
{
	//document.getElementById(id).src;
	//alert((document.getElementById(id).src).substr((document.getElementById(id).src).length -5, 1));
	document.getElementsByName('termasa_senha')[0].value += (document.getElementById(id).src).substr((document.getElementById(id).src).length -5, 1);
}


function apagar_senha(id)
{
	(document.getElementsByName('termasa_senha')[0].value) = (document.getElementsByName('termasa_senha')[0].value.substring(0,(document.getElementsByName(id)[0].value).length-1)); 
}

function apagar_toda_senha(id)
{
	(document.getElementsByName('termasa_senha')[0].value) = ''; 
}



function empresa()
{
	location.replace("../internas/empresa.html");
} 

function servicos()
{
	location.replace("../internas/servicos.html");
} 

function termasa()
{
	location.replace("../internas/termasa.html");
} 

function tergrasa()
{
	location.replace("../internas/tergrasa.html");
} 


function termasatq()
{
	location.replace("../internas/termasa_taquari.html");
} 

function termasacn()
{
	location.replace("../internas/termasa_canoas.html");
} 

function pessoas()
{
	location.replace("../internas/pessoas.html");
} 

function entidades()
{
	location.replace("../internas/entidades.html");
} 

//janela
function janela(pagina,largura,altura) {
   window.open(pagina,'nova','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=' + largura + ',height=' + altura)
}

function popup(foto) 
{
		   novajanela = window.open('about:blank','','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=1,height=1')
		   novajanela.document.writeln(""+
		   								"<HTML> " +
		   								"<HEAD> " +
		   								"	<TITLE>ISPS CODE</TITLE> " +
										"<link rel=\"stylesheet\" href=\"../styles/central.css\" type=\"text/css\">"+
										"<scr"+"ipt>" +
										"   function dimensao()" +
										"	{" +
										"		if((screen.width >= document.getElementById('foto').width+13) && (screen.height >= document.getElementById('foto').height+32)){"+
										"			window.resizeTo(document.getElementById('foto').width+16, document.getElementById('foto').height+80);document.body.scroll = 'no'; }"+
										"		else "+
										"			window.resizeTo(screen.width, screen.height-32);"+ 
										"	window.moveTo(0,0);"+
										"	} "+
										    "function troca(imagem)"+
											"{"+
												"document.getElementById('foto').src=imagem;"+
											"}"+
										
										"</scr"+"ipt>" +
		   								"</HEAD> " +
		   								"<BODY onload=\"dimensao();\" bottommargin=0 leftmargin=0 marginheight=0 marginwidth=0 rightmargin=0 topmargin=0>"+
										"<spam class=\"cinza\"><b>Selecione a empresa abaixo para vizualizar seu certificado:</b></spam><br />"+
										"<img src=\"../images/images/bolinha.gif\" border=\"0\">&nbsp;<a href=\"javascript:troca('../pop/tm.jpg')\" class=\"menu\">Termasa</a> <img src=\"../images/images/bolinha.gif\" border=\"0\">&nbsp;<a href=\"javascript:troca('../pop/tg.jpg')\" class=\"menu\">Tergrasa</a><br>"+
										"<img id=foto src='"+foto+"' border=0>"+
										"</BODY>" +
		   								"</HTML>")
			novajanela.document.close();
}

