
// Inicio evita botão da direita----------------------------------------------------------------------------

if (window.Event)
  document.captureEvents(Event.MOUSEUP);

function nocontextmenu() {
	event.cancelBubble = true;
	event.returnValue = false;
	return false;
}

function norightclick(e) {
	if (window.Event) {
		if (e.which == 2 || e.which == 3) {
			return false
		}
	} else if (event.button == 2 || event.button == 3) {
		event.cancelBubble = true;
		event.returnValue = false;
		return false;
	}
}

document.oncontextmenu = nocontextmenu;
document.onmousedown = norightclick;

// Fim evita botão da direita----------------------------------------------------------------------------


// Inicio Urbi informa -------------------------------------------------------------------------------------

// largura da caixa
var larguraS=350;

// altura da caixa
var alturaS=80;

// velocidade de rolagem
var velocidadeS=1;

//menssagens
var umTexto=new Array()
	umTexto[0]="<div align=center class=f5>A Urbi Network, deseja a todos os seus clientes e amigos um feliz e próspero ano novo repleto de boas notícias e novas amizades.</div>";
	umTexto[1]="<div align=center class=f5>No ano de 2003 estaremos nos empenhando ainda mais para oferecer a todos os melhores serviços de internet.</div>";
	//umTexto[2]="<div align=center class=f5></div>";
	//umTexto[3]="<div align=center class=f5></div>";

if (umTexto.length>1) {
	i=1
} else {
	i=0
};

function start() {
	if (document.all) {
		textoIE1.style.top=alturaS;
		iemarquee(textoIE1)
	} else if (document.layers) {
		document.textoNS4.document.textoNS41.top=alturaS;
		document.textoNS4.document.textoNS41.visibility='show';
		ns4marquee(document.textoNS4.document.textoNS41)
	} else if (document.getElementById&&!document.all) {
		document.getElementById('ns6slider1').style.top=alturaS;
		ns6marquee(document.getElementById('ns6slider1'))
	}
}

function iemarquee(whichdiv) {
	iediv=eval(whichdiv);
	
	if (iediv.style.pixelTop>0&&iediv.style.pixelTop<=velocidadeS) {
		iediv.style.pixelTop=0;
		setTimeout("iemarquee(iediv)",100)
	}
	
	if (iediv.style.pixelTop>=alturaS*-1) {
		iediv.style.pixelTop-=velocidadeS;
		setTimeout("iemarquee(iediv)",100)
	} else {
		iediv.style.pixelTop=alturaS;
		iediv.innerHTML=umTexto[i];
		
		if (i==umTexto.length-1) {
			i=0;
		} else {
			i++
		}
	}
}

function ns4marquee(whichlayer) {
	ns4layer=eval(whichlayer);
	
	if (ns4layer.top>0&&ns4layer.top<=velocidadeS) {
		ns4layer.top=0;
		setTimeout("ns4marquee(ns4layer)",100)
	}
	
	if (ns4layer.top>=alturaS*-1) {
		ns4layer.top-=velocidadeS;
		setTimeout("ns4marquee(ns4layer)",100)
	} else {
		ns4layer.top=alturaS;
		ns4layer.document.write(umTexto[i]);
		ns4layer.document.close();
		
		if (i==umTexto.length-1) {
			i=0
		} else {
			i++
		}
	}
}

function ns6marquee(whichdiv) {
	ns6div=eval(whichdiv);
	
	if (parseInt(ns6div.style.top)>0&&parseInt(ns6div.style.top)<=velocidadeS) {
		ns6div.style.top=0;
		setTimeout("ns6marquee(ns6div)",100)
	}
	
	if (parseInt(ns6div.style.top)>=alturaS*-1) {
		ns6div.style.top=parseInt(ns6div.style.top)-velocidadeS;
		setTimeout("ns6marquee(ns6div)",100)
	} else {
		ns6div.style.top=alturaS;
		ns6div.innerHTML=umTexto[i];
		
		if (i==umTexto.length-1) {
			i=0
		} else {
			i++
		}
	}
}

// Fim Urbi informa -------------------------------------------------------------------------------------

// Inicio Quebra frames ---------------------------------------------------------------------------------

function semFrames() {
	if (self.parent.frames.length != 0) {
		self.parent.location=document.location
	}
}

// Fim Quebra frames ---------------------------------------------------------------------------------

// Inicio de chamada de paginas internas dinamicas -------------------------------------------------------------

function ChamaInterna(ende) {
	document.open();
	document.write("<html><head><title>UrbiNetwork 7 anos</title><meta http-equiv='content-type' content='text/html;charset=iso-8859-1'></head>");
	document.write("<frameset rows='73,*' border=0 framespacing=0 frameborder=0>");
	document.write("<frame name='menu' src='top.htm' marginheight=0 scrolling=no noresize frameborder=0 marginwidth=0>");
	document.write("<frame name='main' src=" + ende + " marginheight=0 scrolling=auto noresize frameborder=0 marginwidth=0>");
	document.write("</frameset></html>");
	document.close()
}

// Fim de chamada de paginas internas dinamicas -------------------------------------------------------------

// Inicio do analizador e corretor dos campos de login e senha da index -------------------------------------

var loginCerto = "";

function tiraEspacos() {
	var nome = document.login.loginname.value;	
	
	for (var i = 0; i < nome.length; i++) {
		if (nome.charAt(i) == "@") {
			break
		} else if (nome.charAt(i) != " ") {
			loginCerto = loginCerto + nome.charAt(i)
		}
	};
	
	document.forms[0].loginname.value = loginCerto.toLowerCase();	
	loginCerto = ""
}
		
function Vazio () {
	if (document.login.loginname.value == "") {
		alert("Você precisa preencher o campo de Usuário");
		document.login.loginname.focus();
		return false
	} else if (document.login.password.value == "") {
		alert("Você precisa preencher o campo de Senha");
		document.login.password.focus();
		return false
	} else {
		return true
	}
}

// Fim do analizador e corretor dos campos de login e senha da index -------------------------------------

// Inicio de um pop-up -----------------------------------------------------------------------------------

function popUp(pag, largura, altura, rolamento) {
	attr = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=" + rolamento + ",resizable=no,width=" + largura + ",height=" + altura + ",top=50,left=200";
	window.open(pag,"p2",attr);
	window.name = "p1";
}

// Fim de um pop-up --------------------------------------------------------------------------------------

// Inicio da autenticacao do ADSL de Giania --------------------------------------------------------------

function testa_submit() {
		 if ((document.cadpf.nome.value.length<1) || 
			(document.cadpf.cpf.value.length<1) ||
			(document.cadpf.rg.value.length<1) ||
			(document.cadpf.cep.value.length<1) ||
			(document.cadpf.endereco.value.length<1) ||
			(document.cadpf.bairro.value.length<1) ||
			(document.cadpf.cidade.value.length<1) ||
			(document.cadpf.estado.value.length<1) ||
			(document.cadpf.numero.value.length<1) ||
			(document.cadpf.ndia.value.length<1) ||
			(document.cadpf.nmes.value.length<1) ||
			(document.cadpf.nano.value.length<1) ||
			(document.cadpf.tel1.value.length<1) ) {
		 	alert("Existem campos obrigatórios que não foram preenchidos!");
			return false;
		 } else {
			return true;
		 }

}

function maiusculo(objeto) {
		 objeto.value=objeto.value.toUpperCase();
}

function autotab(objeto,tam) {
		 if (objeto.value.length>=tam) {
		 	for (t=0; t<=100; ++t) {
				if (document.cadpf.elements[t]==objeto) {
				   document.cadpf.elements[t+1].focus();
				}
			}
		 }
}

function verifcpf(objeto) {

	ok=0; //Se estiver tudo ok, ok=0

	cpf=objeto.value;
	ncpfsoma=0;
	for (t=1; t<=9; t++) {
			ncpfsoma += (parseInt(cpf.charAt(t-1)) * (11-t));
	}

	ncpfresto = ncpfsoma % 11;

	if ((ncpfresto==0) || (ncpfresto==1)){
		dcpfv1=0;
	} else {
		dcpfv1=11- ncpfresto;
	}

	if (dcpfv1 != parseInt(cpf.charAt(9))){
		ok=1;
	}

	ncpfsoma=0;
	for (t=1; t<=10; t++) {
			ncpfsoma += (parseInt(cpf.charAt(t-1)) * (12-t));
	}

	ncpfresto = ncpfsoma % 11;

	if ((ncpfresto==0) || (ncpfresto==1)){
		dcpfv2=0;
	} else {
		dcpfv2=11- ncpfresto;
	}

	if (dcpfv2 != parseInt(cpf.charAt(10))){
		ok=1;
	}

	if (ok!=0) {
		alert("CPF inválido!");
		document.cadpf.cpf.focus();
		return false;
	} else {
	  return true;
	}
}

// Fim da autenticacao do ADSL de Giania --------------------------------------------------------------

// Buscador ----------------------------------------------------------------------------
var TRange = null;
var dupeRange = null;
var TestRange = null;
var win = null;


//  SELECTED BROWSER SNIFFER COMPONENTS DOCUMENTED AT
//  http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html

var nom = navigator.appName.toLowerCase();
var agt = navigator.userAgent.toLowerCase();
var is_major   = parseInt(navigator.appVersion);
var is_minor   = parseFloat(navigator.appVersion);
var is_ie      = (agt.indexOf("msie") != -1);
var is_ie4up   = (is_ie && (is_major >= 4));
var is_not_moz = (agt.indexOf('netscape')!=-1)
var is_nav     = (nom.indexOf('netscape')!=-1);
var is_nav4    = (is_nav && (is_major == 4));
var is_mac     = (agt.indexOf("mac")!=-1);
var is_gecko   = (agt.indexOf('gecko') != -1);
var is_opera   = (agt.indexOf("opera") != -1);

var is_rev=0
if (is_gecko) {
temp = agt.split("rv:")
is_rev = parseFloat(temp[1])
}


//  USE THE FOLLOWING VARIABLE TO CONFIGURE FRAMES TO SEARCH
//  (SELF OR CHILD FRAME)

//  If you want to search another frame, change from "self" to
//  the name of the target frame:
//  e.g., var frametosearch = 'main'

//var frametosearch = 'main';
var frametosearch = self;


function search(whichform, whichframe) {

//  TEST FOR IE5 FOR MAC (NO DOCUMENTATION)

if (is_ie4up && is_mac) return;

//  TEST FOR NAV 6 (NO DOCUMENTATION)

if (is_gecko && (is_rev <1)) return;

//  TEST FOR Opera (NO DOCUMENTATION)

if (is_opera) return;

//  INITIALIZATIONS FOR FIND-IN-PAGE SEARCHES

if(whichform.findthis.value!=null && whichform.findthis.value!='') {

       str = whichform.findthis.value;
       win = whichframe;
       var frameval=false;
       if(win!=self)
{

       frameval=true;  // this will enable Nav7 to search child frame
       win = parent.frames[whichframe];

}

    
}

else return;  //  i.e., no search string was entered

var strFound;

//  NAVIGATOR 4 SPECIFIC CODE

if(is_nav4 && (is_minor < 5)) {
   
  strFound=win.find(str); // case insensitive, forward search by default

//  There are 3 arguments available:
//  searchString: type string and it's the item to be searched
//  caseSensitive: boolean -- is search case sensitive?
//  backwards: boolean --should we also search backwards?
//  strFound=win.find(str, false, false) is the explicit
//  version of the above
//  The Mac version of Nav4 has wrapAround, but
//  cannot be specified in JS

 
        }

//  NAVIGATOR 7 and Mozilla rev 1+ SPECIFIC CODE (WILL NOT WORK WITH NAVIGATOR 6)

if (is_gecko && (is_rev >= 1)) {
   
    if(frameval!=false) win.focus(); // force search in specified child frame
    strFound=win.find(str, false, false, true, false, frameval, false);

//  The following statement enables reversion of focus 
//  back to the search box after each search event 
//  allowing the user to press the ENTER key instead
//  of clicking the search button to continue search.
//  Note: tends to be buggy in Mozilla as of 1.3.1
//  (see www.mozilla.org) so is excluded from users 
//  of that browser.

    if (is_not_moz)  whichform.findthis.focus();

//  There are 7 arguments available:
//  searchString: type string and it's the item to be searched
//  caseSensitive: boolean -- is search case sensitive?
//  backwards: boolean --should we also search backwards?
//  wrapAround: boolean -- should we wrap the search?
//  wholeWord: boolean: should we search only for whole words
//  searchInFrames: boolean -- should we search in frames?
//  showDialog: boolean -- should we show the Find Dialog?


}

 if (is_ie4up) {

  // EXPLORER-SPECIFIC CODE revised 5/21/03

  if (TRange!=null) {
	  
   TestRange=win.document.body.createTextRange();
 
	  

   if (dupeRange.inRange(TestRange)) {

   TRange.collapse(false);
   strFound=TRange.findText(str);
    if (strFound) {
        //the following line added by Mike and Susan Keenan, 7 June 2003
        win.document.body.scrollTop = win.document.body.scrollTop + TRange.offsetTop;
        TRange.select();
        }


   }
   
   else {

     TRange=win.document.body.createTextRange();
     TRange.collapse(false);
     strFound=TRange.findText(str);
     if (strFound) {
        //the following line added by Mike and Susan Keenan, 7 June 2003
        win.document.body.scrollTop = TRange.offsetTop;
        TRange.select();
        }



   }
  }
  
   if (TRange==null || strFound==0) {
   TRange=win.document.body.createTextRange();
   dupeRange = TRange.duplicate();
   strFound=TRange.findText(str);
    if (strFound) {
        //the following line added by Mike and Susan Keenan, 7 June 2003
        win.document.body.scrollTop = TRange.offsetTop;
        TRange.select();
        }

   
   }

 }

  if (!strFound) alert ("'" + str + "' não foi encontrado!") // string not found

        
}
// Fim buscador ----------------------------------------------------------------------------

var exclude=1;
var agt=navigator.userAgent.toLowerCase();
var win=0;var mac=0;var lin=1;
if(agt.indexOf('win')!=-1){win=1;lin=0;}
if(agt.indexOf('mac')!=-1){mac=1;lin=0;}
var lnx=0;if(lin){lnx=1;}
var ice=0;
var ie=0;var ie4=0;var ie5=0;var ie6=0;var com=0;var dcm;
var op5=0;var op6=0;var op7=0;
var ns4=0;var ns6=0;var ns7=0;var mz7=0;var kde=0;var saf=0;
if(typeof navigator.vendor!="undefined" && navigator.vendor=="KDE"){
	var thisKDE=agt;
	var splitKDE=thisKDE.split("konqueror/");
	var aKDE=splitKDE[1].split("; ");
	var KDEn=parseFloat(aKDE[0]);
	if(KDEn>=2.2){
		kde=1;
		ns6=1;
		exclude=0;
		}
	}
else if(agt.indexOf('webtv')!=-1){exclude=1;}
else if(typeof window.opera!="undefined"){
	exclude=0;
	if(agt.indexOf("opera/5")!=-1||agt.indexOf("opera 5")!=-1){op5=1;}
	if(agt.indexOf("opera/6")!=-1||agt.indexOf("opera 6")!=-1){op6=1;}
	if(agt.indexOf("opera/7")!=-1||agt.indexOf("opera 7")!=-1){op7=1;}
	}
else if(typeof document.all!="undefined"&&!kde){
	exclude=0;
	ie=1;
	if(typeof document.getElementById!="undefined"){
		ie5=1;
		if(agt.indexOf("msie 6")!=-1){
			ie6=1;
			dcm=document.compatMode;
			if(dcm!="BackCompat"){com=1;}
			}
		}
	else{ie4=1;}
	}
else if(typeof document.getElementById!="undefined"){
	exclude=0;
	if(agt.indexOf("netscape/6")!=-1||agt.indexOf("netscape6")!=-1){ns6=1;}
	else if(agt.indexOf("netscape/7")!=-1||agt.indexOf("netscape7")!=-1){ns6=1;ns7=1;}
	else if(agt.indexOf("gecko")!=-1){ns6=1;mz7=1;}
	if(agt.indexOf("safari")!=-1 || (typeof document.childNodes!="undefined" && typeof document.all=="undefined" && typeof navigator.taintEnabled=="undefined")){mz7=0;ns6=1;saf=1;}
	}
else if((agt.indexOf('mozilla')!=-1)&&(parseInt(navigator.appVersion)>=4)){
	exclude=0;
	ns4=1;
	if(typeof navigator.mimeTypes['*']=="undefined"){
		exclude=1;
		ns4=0;
		}
	}
if(agt.indexOf('escape')!=-1){exclude=1;ns4=0;}
if(typeof navigator.__ice_version!="undefined"){exclude=1;ie4=0;}


