// JavaScript Document
function click() {
if (event.button==2||event.button==3) {
oncontextmenu='return false'; alert ('Todos os direitos reservados');
}
}
document.onmousedown=click
document.oncontextmenu = new Function("return false;")
function addFav(){
    var url      = "http://www.travessia.tur.br";
    var title    = "Travessia Ecoturismo";
    if (window.sidebar) window.sidebar.addPanel(title, url,"");
    else if(window.opera && window.print){
        var mbm = document.createElement('a');
        mbm.setAttribute('rel','sidebar');
        mbm.setAttribute('href',url);
        mbm.setAttribute('title',title);
        mbm.click();
    }
    else if(document.all){window.external.AddFavorite(url, title);}
}
function addFav(){
    var url      = "http://www.travessia.tur.br";
    var title    = "Travessia Ecoturismo";
    if (window.sidebar) window.sidebar.addPanel(title, url,"");
    else if(window.opera && window.print){
        var mbm = document.createElement('a');
        mbm.setAttribute('rel','sidebar');
        mbm.setAttribute('href',url);
        mbm.setAttribute('title',title);
        mbm.click();
    }
    else if(document.all){window.external.AddFavorite(url, title);}
}
function valida_cad_simples(){
	var Form
	Form = document.cadastrar
	if (Form.pf_nome.value.length == 0 ) {
		alert('Please enter your full name.');
		Form.pf_nome.focus();
		return false;
    }
	if(Form.pf_email.value.indexOf("@")==-1 || Form.pf_email.value.indexOf(".")==-1 || Form.pf_email.value==''){
		alert('Verify that you correctly typed your e-mail.')
		Form.pf_email.focus();
		return false;
	}
	return true
}
function valida_contato(){
	var Form
	Form = document.contato
	if (Form.pf_nome.value.length == 0 ) {
		alert('Please enter your full name.');
		Form.pf_nome.focus();
		return false;
    }
	if(Form.pf_email.value.indexOf("@")==-1 || Form.pf_email.value.indexOf(".")==-1 || Form.pf_email.value==''){
		alert(' Verify that you correctly typed your e-mail.')
		Form.pf_email.focus();
		return false;
	}
	return true
}

function Amplia_Imagem_Livre(img,winName,width,height,features) { 
//1.1 kadazuro kadazuro@kardouz.com
	if(window.screen){
		per_ancho=(width/screen.width)*100;//porcentaje screen-ancho
		per_alto=(height/width)*100;//porcentaje de ancho-alto
		win_ancho=(screen.width*per_ancho)/100;//ancho de la ventana
		win_alto=(win_ancho*per_alto)/100;//alto de la ventana
		x=(screen.width-win_ancho)/2;//centra x
		y=(screen.height-win_alto)/2;//centra y
	}else{// si el buscador es 4-- queda todo igual :(
		x=0;
		y=0;
		win_ancho=w;
		win_alto=y;
	}
	winfeatures=("top="+y+",left="+x+",width="+win_ancho+",height="+win_alto+",scrollbars=no");
	window.open("mostra_img_gd.asp?imagem="+img+"",winName,winfeatures);
}

function tamanho_campo(objA, objP,tipo, tamanho) {
	var key = window.event.keyCode;	
  	if(tipo==0) {
				if (( key < 47 )||( key > 58 )) {
						window.event.returnValue = null; 
						return; 
     			}
 			}
	 caracter = String.fromCharCode(key); 
   	 palavra = objA.value +  caracter; 
	 if (palavra.length == tamanho) 
   		{
   			objA.value = palavra;
			window.event.returnValue = null;
			objP.focus();
			return;
   		}
   	 else
   		{ 
			if (palavra.length > tamanho) 
   				{
   					objA.value = palavra.substring(0, tamanho);
					window.event.returnValue = null;
					objP.focus();
					return;
   				}
   			else
   				{ 
	 	 			objA.focus(); 
	  			}
   		}
}
function valida_numero(s){
	if ( s != '' ) {
		var i;
		var dif = 0;
		for (i = 0; i < s.value.length; i++){
			var c = s.value.charAt(i);
			if (!((c >= '0') && (c <= '9'))){
				dif = 1;
			}
		}
		if (dif == 1){
			alert('Este campo deve ser numerico!');
			s.focus();	
			s.select();
			return false;
		}
	}
	return true;
}
