function marcarveiculo(chk){
  if (chk.checked)
  {
    window.frames['MarcaVeiculo'].location.href = 'lista_add.php?id='+ chk.value;
	
	window.alert('Veículo Incluido na Lista.');
  }
  else
  {
    window.frames['MarcaVeiculo'].location.href = 'lista_del.php?id='+ chk.value;
    window.alert('Veículo retirado da Lista.');
  }
}

function open_window(url) 
{
mywin = window.open(url,"win",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=420,height=320');
}

function popup(caminho,nome,largura,altura,rolagem) {
	var esquerda = (screen.width - largura) / 2;
	var cima = (screen.height - altura) / 2 -50;
	window.open(caminho,nome,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=' + rolagem + ',resizable=no,copyhistory=no,top=' + cima + ',left=' + esquerda + ',width=' + largura + ',height=' + altura);
}

function abreFotos(url){
    janela=window.open(url,'fotodetalhe','width=720,height=610,top=0,left=0,resizable=no,status=no')
}


function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function validar(Form) {
	var invalid, s;
	invalid = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/;
	var s;
// inicio de verificacao
 	if (Form.YourName.value.length == 0) {
		alert("Nome!");
		Form.YourName.focus();
	        return false;	}
	
	     				
		if (Form.YourEmail.value.length == 0) {
    		alert("O Email!");
    		Form.YourEmail.focus();
    		return false;	}

					
		if( document.Form.YourEmail.value.length < 5 || document.Form.YourEmail.value.indexOf("@") < 0 || document.Form.YourEmail.value.indexOf(".") < 0 ) 
	{
			alert("E-mail inválido !");
   			Form.YourEmail.focus();
			return (false);

	}
		
		
		if (Form.YourTel.value.length == 0) {
		alert("TELEFONE!");
		Form.YourTel.focus();
	        return false;	}
		
		
		if (Form.assunto.value.length == 0) {
		alert("Assunto!");
		Form.assunto.focus();
	        return false;	}
		
		
		if (Form.comments.value.length == 0) {
		alert("MENSAGEM!");
		Form.comments.focus();
	        return false;	}
		
		
     return true;
}