//<!--
//-----------------------------------------------------------------
// validacoes.js
//
// DETECTOR DE FLASH
//
// copyright (c) 2000 UEBE - Servicos e comunicação, Lda 
//-----------------------------------------------------------------

var flashVersion = VBGetFlashControlVersion();
	if (flashVersion == 3.0008){
		var serverVersion = VBGetFlashVersionByTrialAndError();
			if (serverVersion > flashVersion) { 
				flashVersion = 4.0000; 
			}
	}
	else if (flashVersion == 0) { 
		flashVersion = VBGetFlashVersionByTrialAndError(); 
	}
	else if (flashVersion == 4) { 
		flashVersion = 4.0015; 
	}
	else if (flashVersion == 5) { 
		flashVersion = 5.0042; 
	}

var mfBanners = [
['<PARAM NAME="movie" VALUE="peskador.swf"><PARAM NAME=quality VALUE=high><PARAM NAME=bgcolor VALUE=#FFFFFF><EMBED WIDTH=446 HEIGHT=61 SRC="peskador.swf" TYPE="application/x-shockwave-flash"></EMBED>'],
['<PARAM NAME="movie" VALUE="boasfestas.swf"><PARAM NAME=quality VALUE=high><PARAM NAME=bgcolor VALUE=#FFFFFF><EMBED WIDTH=446 HEIGHT=61 SRC="boasfestas.swf" TYPE="application/x-shockwave-flash"></EMBED>']
];
var mfIe = false;
if( document.all) {
mfIe = true;
}
var mfBannerIndex = 0;

function mfBannerChange()
{
var htmlString = mfBanners[mfBannerIndex][0];
var a = mfBannerIndex;
if( mfIe) {
if (a == 1)
{
document.all.imagen1.hidden = false;
document.all.imagen0.hidden = true;
}
else if (a == 0)
{
document.all.imagen0.hidden = false;
document.all.imagen1.hidden = true;
}

}
else {
document.layers["nome"].document.open();
document.layers["nome"].document.write(htmlString);
document.layers["nome"].document.close();
}
if(mfBannerIndex < mfBanners.length - 1)
mfBannerIndex++;
else
mfBannerIndex = 0;

}
// 

function detectflash(){

var thearray=0
var arraylen=0	

//banner aleatório
//var how_many_ads = 3;
var how_many_ads = 1;
var now = new Date()
var sec = now.getSeconds()
var ad = sec % how_many_ads;
ad +=1;
/*if (ad==1) {
	banner="images/uebeq.swf";
}
if (ad==2) {	
	banner="images/netpartner.swf";
}*/
if (ad==1) {	
	banner="images/noites.biz_flash.swf";
}

if (navigator.appName.indexOf('Microsoft')!=-1)
{	
	//alert("FlashVersion=" + flashVersion);
	if ((flashVersion <5 ) || !flashVersion)
	{
		//document.write("<a href='http://www.neoclassica.pt' target=blank><img border=0 src=images/banner_neo.gif WIDTH=148 HEIGHT=60></a>");
		//document.write("<a href='http://blogaveiro.blogspot.com' target=blank><img border=0 src=images/logo_blog.gif></a>");
		document.write("<a href='http://www.bedigital.tv/' target=blank><img border=0 src=images/banner_pg.gif WIDTH=150 HEIGHT=61></a>");
		document.write("<img src='images/transp.gif' width=2>");
		//document.write("<a href='http://www.vlm-consultores.pt' target=blank><img border=0 src='images/pub_neo2.gif' WIDTH=446 HEIGHT=61></a>");
		//document.write("<a href='http://www.diarioaveiro.pt/' target=blank><img border=0 src='banners/da_0.jpg' WIDTH=446 HEIGHT=57></a>");		
		//document.write("<a href='http://uebeq.pontoc.pt/' target=blank><img border=0 src='bannerin.jpg' WIDTH=446 HEIGHT=57></a>");
		//banner cabovisao
		document.write("<a href='http://www.uebeq.com' target=blank><img border=0 src='images/uebeq.gif' WIDTH=468 HEIGHT=60></a>");
		//document.write("<a href='http://www.cabovisao.pt' target=blank><img border=0 src='banner_cv.gif' WIDTH=468 HEIGHT=60></a>");
		//document.write("<img border=0 src='images/banner20050323.gif' WIDTH=468 HEIGHT=60>");
		//document.write("<a href='http://www.jb.pt/download/campanha.jpg' target=blank><img border=0 src='banners/banner_corgo.gif' WIDTH=468 HEIGHT=60></a>");
		document.write("<img src='images/transp.gif' width=2>");
		document.write("<img border=0 src=images/banner60x148.jpg>");
	}
	else 
	{
		//document.write("<OBJECT codebase='http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0' ID=flash WIDTH=156 HEIGHT=116><PARAM NAME=movie VALUE='peskador.swf'><PARAM NAME=quality VALUE=high><PARAM NAME=bgcolor VALUE=#FFFFFF><EMBED src='peskador.swf' quality=high WIDTH=446 HEIGHT=61 TYPE='application/x-shockwave-flash'></EMBED></OBJECT>");
		//document.write("<PARAM NAME='movie' VALUE='banner02a.swf'><PARAM NAME=quality VALUE=high><PARAM NAME=bgcolor VALUE=#FFFFFF><EMBED WIDTH=148 HEIGHT=60 SRC='banner02a.swf' TYPE='application/x-shockwave-flash'></EMBED>");
		//document.write("<img src='images/transp.gif' width=160 height=61>");
		//document.write("<a href='http://blogaveiro.blogspot.com' target=blank><img border=0 src=images/logo_blog.gif></a>");		
		document.write("<PARAM NAME='movie' VALUE='banner02bp.swf'><PARAM NAME=quality VALUE=high><PARAM NAME=bgcolor VALUE=#FFFFFF><EMBED WIDTH=148 HEIGHT=60 SRC='banner02bp.swf' TYPE='application/x-shockwave-flash'></EMBED>");		
		document.write("<img src='images/transp.gif' width=2>");
		document.write('<embed src=\"' + banner + '\" WIDTH=468 HEIGHT=60></embed>')
		//document.write("<a href='http://www.jb.pt/download/campanha.jpg' target=blank><img border=0 src='banners/banner_corgo.gif' WIDTH=468 HEIGHT=60></a>");
		
		//document.write("<EMBED SRC='bannerin.swf' value='bannerin.swf' WIDTH=446 HEIGHT=61 name='imagen0' TYPE='application/x-shockwave-flash'></EMBED>");
		
		//document.write("<EMBED SRC='banner01i.swf' value='banner01i.swf' WIDTH=446 HEIGHT=61 name='imagen0' TYPE='application/x-shockwave-flash'></EMBED>");
		//document.write("<EMBED SRC='boasfestas.swf' value='boasfestas.swf' WIDTH=446 HEIGHT=61 name='imagen1' TYPE='application/x-shockwave-flash'></EMBED>");

		//setInterval("mfBannerChange()", 5000);			

//document.write("<EMBED SRC='banner_cv.swf' value='banner_cv.swf' WIDTH=468 HEIGHT=60 name='imagen0' TYPE='application/x-shockwave-flash'></EMBED>");

		document.write("<img src='images/transp.gif' width=2>");
		document.write("<img border=0 src=images/banner60x148.jpg>");			
		//document.write("<img src='images/transp.gif' width=160 height=61>");
		//document.write("<PARAM NAME='movie' VALUE='banner02bp.swf'><PARAM NAME=quality VALUE=high><PARAM NAME=bgcolor VALUE=#FFFFFF><EMBED WIDTH=148 HEIGHT=60 SRC='banner02bp.swf' TYPE='application/x-shockwave-flash'></EMBED>");
	}		
}
else
{
	//alert("Netscape");
	   thearray = navigator.plugins
		arraylen = thearray.length
		flshExists=false;
			
	   for (var i=0; i < arraylen; i++)
		{
		  theplugin = thearray[i]
		  thename   = theplugin.name
		  thedesc   = theplugin.description			
		  if (thename == "Shockwave Flash")
		  {
				flshExists=true;
		  }
		}		

	if (flshExists)
	{
		//alert("tem flashVersion=" + flshExists);			
		//document.write("<PARAM NAME='movie' VALUE='banner02a.swf'><PARAM NAME=quality VALUE=high><PARAM NAME=bgcolor VALUE=#FFFFFF><EMBED WIDTH=148 HEIGHT=60 SRC='banner02a.swf' TYPE='application/x-shockwave-flash'></EMBED>");
		//document.write('<a href="http://blogaveiro.blogspot.com" target="blank"><img border="0" src="images/logo_blog.gif" WIDTH="120" HEIGHT="60"></a>');
		document.write('<EMBED WIDTH=148 HEIGHT=60 SRC="banner02bp.swf"></EMBED>');
		document.write("<img src='images/transp.gif' width=2>");
		//document.write("<a href='http://www.jb.pt/download/campanha.jpg' target=blank><img border=0 src='banners/banner_corgo.gif' WIDTH=468 HEIGHT=60></a>");
		document.write('<embed src=\"' + banner + '\" WIDTH=446 HEIGHT=61></embed>')
		document.write("<img src='images/transp.gif' width=2>");
		document.write("<img src='images/banner60x148.jpg'>");
		//document.write('<EMBED WIDTH=148 HEIGHT=60 SRC="banner02bp.swf"></EMBED>');
	}
	else
	{
		//alert("flashVersion=" + flshExists);
		//document.write("<a href='http://www.neoclassica.pt' target=blank><img border=0 src=images/banner_neo.gif WIDTH=148 HEIGHT=60></a>");
		//document.write("<a href='http://blogaveiro.blogspot.com' target=blank><img border=0 src=images/logo_blog.gif></a>");
		document.write("<a href='http://www.bedigital.tv/' target=blank><img border=0 src=images/banner_pg.gif WIDTH=148 HEIGHT=60></a>");
		document.write("<img src='images/transp.gif' width=2>");
		//document.write("<a href='http://www.vlm-consultores.pt' target=blank><img border=0 src=images/pub_neo2.gif WIDTH=446 HEIGHT=61></a>");
		//document.write("<a href='http://www.diarioaveiro.pt/' target=blank><img border=0 src='banners/da_0.jpg' WIDTH=446 HEIGHT=57></a>");				
		//document.write("<a href='http://uebeq.pontoc.pt/' target=blank><img border=0 src='bannerin.jpg' WIDTH=446 HEIGHT=57></a>");
		//banner cabovisao
		document.write("<a href='http://www.uebeq.com' target=blank><img border=0 src='images/uebeq.gif' WIDTH=468 HEIGHT=60></a>");
		//document.write("<a href='http://www.cabovisao.pt/' target=blank><img border=0 src='banner_cv.gif' WIDTH=468 HEIGHT=60></a>");
		//document.write("<a href='http://www.jb.pt/download/campanha.jpg' target=blank><img border=0 src='banners/banner_corgo.gif' WIDTH=468 HEIGHT=60></a>");
		//document.write("<a href='http://www.uebeq.com' target=blank><img border=0 src='images/banner0701.gif' WIDTH=468 HEIGHT=60></a>");
		document.write("<img src='images/transp.gif' width=2>");
		document.write("<img src='images/banner60x148.jpg'>");
		//document.write("<a href='http://www.bedigital.tv/' target=blank><img border=0 src=images/banner_pg.gif WIDTH=148 HEIGHT=60></a>");
	}			
}

}


function detectflash01(){

var thearray=0
var arraylen=0		
	if (navigator.appName.indexOf('Microsoft')!=-1)
	{	
		//alert("FlashVersion=" + flashVersion);
		if ((flashVersion <5 ) || !flashVersion)
		{
			document.write('<a href="http://www.oln.pt/index.asp?secc=5"><img border="0" src="images/fcasa.jpg" WIDTH="100" HEIGHT="100"></a>');
		}
		else 
		{
			document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"  codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="100" HEIGHT="100"><param NAME="movie" VALUE="fcasa.swf"><param NAME="quality" VALUE="high"><param NAME="bgcolor" VALUE="#FFFFFF"><embed src="fcasa.swf" quality="high" bgcolor="#FFFFFF" WIDTH="100" HEIGHT="100" ALIGN TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></object>');				
		}		
	}
	else
	{
		//alert("Netscape");
		   thearray = navigator.plugins
			arraylen = thearray.length
			flshExists=false;
			
		   for (var i=0; i < arraylen; i++)
			{
			  theplugin = thearray[i]
			  thename   = theplugin.name
			  thedesc   = theplugin.description			
			  if (thename == "Shockwave Flash")
			  {
					flshExists=true;
			  }
			}		

		if (flshExists)
		{
			document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"  codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="100" HEIGHT="100"><param NAME="movie" VALUE="fcasa.swf"><param NAME="quality" VALUE="high"><param NAME="bgcolor" VALUE="#FFFFFF"><embed src="fcasa.swf" quality="high" bgcolor="#FFFFFF" WIDTH="100" HEIGHT="100" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></object>');		
		}
		else
		{
			document.write('<a href="http://www.oln.pt/index.asp?secc=5"><img border="0" src="images/fcasa.jpg" WIDTH="100" HEIGHT="100"></a>');
		}			
	}

}
//Barra da esquerda
function detectflash02(){

var thearray=0
var arraylen=0		
	if (navigator.appName.indexOf('Microsoft')!=-1)
	{	
		//alert("FlashVersion=" + flashVersion);
		if ((flashVersion <5 ) || !flashVersion)
		{
			document.write('<a href="http://www.cabovisao.pt"><img border="0" src="images/banner_cv2.gif" WIDTH="100" HEIGHT="123"></a>');
		}
		else 
		{
			document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"  codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="100" HEIGHT="123"><param NAME="movie" VALUE="banner_cv2.swf"><param NAME="quality" VALUE="high"><param NAME="bgcolor" VALUE="#FFFFFF"><embed src="banner_cv2.swf" quality="high" bgcolor="#FFFFFF" WIDTH="100" HEIGHT="123" ALIGN TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></object>');				
		}		
	}
	else
	{
		//alert("Netscape");
		   thearray = navigator.plugins
			arraylen = thearray.length
			flshExists=false;
			
		   for (var i=0; i < arraylen; i++)
			{
			  theplugin = thearray[i]
			  thename   = theplugin.name
			  thedesc   = theplugin.description			
			  if (thename == "Shockwave Flash")
			  {
					flshExists=true;
			  }
			}		

		if (flshExists)
		{
			document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"  codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="100" HEIGHT="123"><param NAME="movie" VALUE="banner_cv2.swf"><param NAME="quality" VALUE="high"><param NAME="bgcolor" VALUE="#FFFFFF"><embed src="banner_cv2.swf" quality="high" bgcolor="#FFFFFF" WIDTH="100" HEIGHT="123" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></object>');		
		}
		else
		{
			document.write('<a href="http://www.cabovisao.pt"><img border="0" src="images/banner_cv2.gif" WIDTH="100" HEIGHT="123"></a>');
		}			
	}

}

//Main
function detectflash03(){

var thearray=0
var arraylen=0		

//banner aleatório
//var how_many_ads = 3;
var how_many_ads = 2;
var now = new Date()
var sec = now.getSeconds()
var ad = sec % how_many_ads;
ad +=1;
if (ad==1) {
banner="images/APAMissao2009.swf";
}
if (ad==2) {
banner="images/APALog2009.swf";
}

	if (navigator.appName.indexOf('Microsoft')!=-1)
	{	
		//alert("FlashVersion=" + flashVersion);
		/*if ((flashVersion <5 ) || !flashVersion)
		{
			document.write('<a href="http://www.cm-oaz.pt/"><img border="0" src="images/banner_m.gif" WIDTH="468" HEIGHT="60"></a>');
		}
		else 
		{*/
			document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"  codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="468" HEIGHT="60"><param NAME="movie" VALUE=\"' + banner + '\"><param NAME="quality" VALUE="high"><embed src=\"' + banner + '\" quality="high" WIDTH="468" HEIGHT="60"  TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></object>');				
		//}		
	}
	else
	{
		//alert("Netscape");
		   thearray = navigator.plugins
			arraylen = thearray.length
			flshExists=false;
			
		   for (var i=0; i < arraylen; i++)
			{
			  theplugin = thearray[i]
			  thename   = theplugin.name
			  thedesc   = theplugin.description			
			  if (thename == "Shockwave Flash")
			  {
					flshExists=true;
			  }
			}		

		if (flshExists)
		{
			document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"  codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="468" HEIGHT="60"><param NAME="movie" VALUE=\"' + banner + '\"><param NAME="quality" VALUE="high"><embed src=\"' + banner + '\" quality="high" WIDTH="468" HEIGHT="60" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></object>');		
		}
		/*else
		{
			document.write('<a href="http://www.cm-oaz.pt/"><img border="0" src="images/banner_m.gif" WIDTH="468" HEIGHT="60"></a>');
		}*/	
	}

}

function trocaImg(nmImg,srcImg){
document.images[nmImg].src = "images/" + srcImg; 
}
function clearField(field) 
  {
    field.value = "";
    field.focus();
  }


function abrejanela(URL) {
window.open( URL, 'teste', 'width=780, height=450, maximized=no, resizable=no,scrollbars=yes,status=no,menubar=no,top=10,left=10');
}

//-----------------------------------------------------------------
// validacoes.js
//
// funções auxiliares para validações de forms
//
// copyright (c) 2000 Ponto.C - Desenv. Sistemas de Informação, Lda 
//-----------------------------------------------------------------
//validar valores decimais
function check_decimal(value,intvalue,decvalue){
	var intpart,decpart,temp,pos;
	
	pos = value.indexOf('.');
	if(pos != -1){
		
		if(pos + 1 == value.length){
			return (false);                				
		}
		temp = value.substring(pos + 1);		
		
		if(temp.indexOf('.') != -1){
			return (false);
		}
		
		var separa = value.split('.');
		var intpart = separa[0];
		var decpart = separa[1];
  
		if (parseInt(intpart) >= parseInt(intvalue)){
			return (false);                
		} 
		if (parseInt(decpart) >= parseInt(decvalue)){
			return (false);
		} 
	}else{
		if(parseInt(value) >= parseInt(intvalue)){
			return (false);
		}
	}
	return(true);
}

function dif_hora(ini,fim) {

	var hini = ini.split(':');
	var hfim = fim.split(':');

	var horasini = hini[0];
	var minutosini = hini[1];
  
	var horasfim = hfim[0];
	var monutosfim = hfim[1];
  
	if (parseInt(horasini) > parseInt(horasfim)){
		return (false);                
	} 
	else if (parseInt(horasini) == parseInt(horasfim)){
		if (parseInt(minutosini) > parseInt(monutosfim)){
			return (false);                
		}     
	}   
	return (true);
}

// verifica se uma data e' maior que a outra
function dif_data(ini,fim) {

	var dateini = ini.split('/');
	var datefim = fim.split('/');

	var monthini = dateini[1];
	var dayini = dateini[2];
	var yearini = dateini[0];

	var monthfim = datefim[1];
	var dayfim = datefim[2];
	var yearfim = datefim[0];

	if (parseInt(monthfim) != parseInt(monthini)){
		return (false);                
	} 
	if (parseInt(dayfim) != parseInt(dayini)){
		return (false);                
	} 
	if (parseInt(yearfim) != parseInt(yearini)){
		return (false);                
	}         
   
	   /* -----------------------

   if (parseInt(yearfim) < parseInt(yearini)){
         return (false);
   }
    else if (parseInt(yearfim) == parseInt(yearini))
   {
       if (parseInt(monthfim) < parseInt(monthini)){
                    return (false);                
       } 
       else if (parseInt(monthfim) == parseInt(monthini))
       {
                if (parseInt(dayfim) < parseInt(dayini)){
                    return (false);                
                }
       }
   }
   
   if (parseInt(yearfim) > (parseInt(yearini) + 1)){
         return (false);
   }
   else {
        if (parseInt(monthfim) > (parseInt(monthini) + 1)){
              return (false);
        }
        if (parseInt(dayfim) > (parseInt(dayini) + 1)){
              return (false);                
        }      
   }

   if (parseInt(yearfim) == (parseInt(yearini) + 1) && parseInt(monthfim) == (parseInt(monthini) + 1) && parseInt(dayfim) == (parseInt(dayini) + 1)){
      if (parseInt(monthfim) == 1 && parseInt(monthini) == 12){
         if (parseInt(dayini) == 31){
		 
		 }
		 else{
			return (false);
		 }         
      }
      else{
        return (false);
      }
   }

	----------------------- */

  return (true);
}


//função para ver se encontrou o caracter ' ou |
function caracteres_esp(checkStr) {

	var checkOK = "'|";
	var i ;
	for (i = 0;  i < checkStr.length;  i++) {
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkOK.length;  j++)
		if (ch == checkOK.charAt(j)) {
			return (false);
		} 
	}
	return (true);
}


//função para ver se encontrou caracteres não permitidos
function caracteres_inv(checkStr,checkOK) {

	var i ;
	for (i = 0;  i < checkStr.length;  i++) {
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkOK.length;  j++)
			if (ch == checkOK.charAt(j)) {
				return (false);
			} 
	}
	return (true);
}


//função para ver se encontrou caracteres não permitidos pelo programador
function scan(checkStr,checkOK) {

	for (i = 0;  i < checkStr.length;  i++) {
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkOK.length;  j++)
			if (ch == checkOK.charAt(j))
				break;
		if (j == checkOK.length)  {
			return (false);
			break;
		}
	}
	return (true);
}


//ver se é ano bisexto
function isLeapYear(y) {
	return (y % 4 == 0  && (y % 400 == 0 || y % 100 != 0))
}


//ver se tens caracteres permitidos
function data(checkStr,checkOK) {
	for (i = 0;  i < checkStr.length;  i++) {
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkOK.length;  j++)
			if (ch == checkOK.charAt(j))
				break;
		if (j == checkOK.length) {
			return (false);
			break;
		}
	}
	return (true);
}		


//validar data estilo dd/mm/yyyy
function validacao_data(checkStr) {

	var daysOfMonth = new Object();
	daysOfMonth ['Jan'] = daysOfMonth ['January']   = daysOfMonth [1] = 31;
	daysOfMonth ['Feb'] = daysOfMonth ['February']  = daysOfMonth [2] = 28;
	daysOfMonth ['Mar'] = daysOfMonth ['March']     = daysOfMonth [3] = 31;
	daysOfMonth ['Apr'] = daysOfMonth ['April']     = daysOfMonth [4] = 30;
	daysOfMonth ['May'] = daysOfMonth ['May']       = daysOfMonth [5] = 31;
	daysOfMonth ['Jun'] = daysOfMonth ['June']      = daysOfMonth [6] = 30;
	daysOfMonth ['Jul'] = daysOfMonth ['July']      = daysOfMonth [7] = 31;
	daysOfMonth ['Aug'] = daysOfMonth ['August']    = daysOfMonth [8] = 31;
	daysOfMonth ['Sep'] = daysOfMonth ['September'] = daysOfMonth [9] = 30;
	daysOfMonth ['Oct'] = daysOfMonth ['October']   = daysOfMonth [10] = 31;
	daysOfMonth ['Nov'] = daysOfMonth ['November']  = daysOfMonth [11] = 30;
	daysOfMonth ['Dec'] = daysOfMonth ['December']  = daysOfMonth [12] = 31;
		
	var date = checkStr.split('/');
	var num = date.length;
	if (num != 3)
		return (false);
  
	var month = date[1];
	var day = date[2];
	var year = date[0];

	if (month < 1 || month > 12 || month == ""){
		return (false);
        }
	if (day < 1  || day == "")
		return (false);
  
	if (month == 2 && isLeapYear(year))
		var dayLimit = 29;
	else 
		var dayLimit = daysOfMonth[month];
	
	if (day > dayLimit)
		return (false);
 
	if (year < 1000 || year == "")
		return (false);
			  
	return (true);
}					  


function hora(checkStr,checkOK)  {
	for (i = 0;  i < checkStr.length;  i++) {
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkOK.length;  j++)
			if (ch == checkOK.charAt(j))
				break;
		if (j == checkOK.length) {
			return (false);
			break;
		}
	}
	return (true);
}		


//validar hora
function validar_hora(checkStr,opt) {

	var date = checkStr.split(':');
	var num = date.length;

	if (opt == 1) {
		if (num < 1 || num > 2)
			return (false);       
		if (date[1] == ":")
			return (false);                      		                   
	}
	else {
		if (num != 2)
			return (false);       
		if (date[1] == ":")
			return (false);       
	}
                                
	var hora = date[0];
	var minutos = date[1];

	if (parseInt(hora) < 0 || parseInt(hora) > 23 || hora == "") {
		return (false);
	}
	if (parseInt(minutos) < 0  || parseInt(minutos) > 59 || minutos == "" ) {
		return (false);
	}
      	if (parseInt(hora) == 24 ) {
		if (parseInt(minutos) != 0 ) {
			return (false);
		}	  
	}        
	return (true);
}					  
//-->