var URL = location.href;


function getElementByClass(classname){
ccollect=new Array()
var alltags=document.all? document.all : document.getElementsByTagName("*")
for(i=0; i<alltags.length; i++){
if(alltags[i].className==classname)
ccollect[ccollect.length]=alltags[i].innerHTML;
}
}

function nomeDaPagina(url){
		paginaAtual = url.replace('<a href="','');
		paginaAtual = paginaAtual.replace('<A href="','');
		Nmpag = paginaAtual.split('"');
		return Nmpag[0];
}

function ondeestou(url){
		nomedapagina=url.split('/');
		return nomedapagina[nomedapagina.length-1];
}

function numpage(){
		numero = 0;
		pagatual = ondeestou(URL);
		for(x=0;x<ccollect.length;x++){
			Nomepag = nomeDaPagina(ccollect[x]);
			if(Nomepag == PaginaAtual){numero=x;}
		}

		return numero;
}

