function assinala_eventos(frm) {
	
	alert("hello");
	
	// date is a JS Date object
	//if (date.getFullYear() == 2004 &&
	//date.getMonth() == 5
	//date.getDate() == 23 ) 
	//{
	// return false; // enable July 5 2003
	//}
	// return true; // disable  other dates
};


function disallowDate() {
	alert("ola");	   
	window.location = "wsmical0.data_eventos";
}; 


function registaEventos(calendar){
	calendar.setDisabledHandler(disallowDate);
};		


function mostraEvento(calendar) {
   if (calendar.dateClicked) {

	   var y = calendar.date.getFullYear();
	   var m = calendar.date.getMonth(); // INTEGER, 0..11
	   var d = calendar.date.getDate(); // INTEGER, 1..31

	   var data_evento = d + "-" + (m+1) + "-" + y;

	   window.location = "wsmical0.mostra_evento?p_data="+data_evento+"&p_lingua='||p_lingua||'";

	}
};



function valida_campos (objecto, lingua)
{
  for (i=0;i<objecto.length;i++)
    {
  	var tempobj=objecto.elements[i];
  	     
    	if (tempobj.name == "p_email")
  	{
  	  if(tempobj.value=="" )
	   {
	   if (lingua == "pt")
		{
		  alert("O E-Mail deve ser preenchido");
		}
	   else if (lingua == "en")
		{
	 	  alert("Email must be filled in");
		}
	   else if (lingua == "de")
		{
		  alert("Das E-mail muss ausgefüllt werden");
		}
	else if (lingua == "fr")
		{
		  alert("O E-Mail deve ser preenchido");
		}
	   
	   return false;
	   }
  	}
  	else if ((tempobj.name == "p_nome")  && tempobj.value==""  )
	{
	  if (lingua == "pt")
	  {
		alert("O Nome deve ser preenchido");
	  }
	  else if (lingua == "en")
	  {
		alert("Name must be filled in");
	  }
	  else if (lingua == "de")
	 {
		alert("Das Name muss ausgefüllt werden");
	 }
	  else if (lingua == "fr")
	 {
	   alert("O Nome deve ser preenchido");
	 }
				
	  return false;
	}
    		  	
    }
  objecto.submit();
  return true;
  
}	