function blink_td(td) {
	td.style.backgroundColor = "#0A6FA5";
}

function notBlink_td(td) {
	td.style.backgroundColor = "";
}

function editBB(id) {
	window.open('albumbebe_edit.php?id='+id,'_self');
}

function addBB() {
	window.open('albumbebe_edit.php?id=novo','_self');
}

function reg_del() {
	return confirm('Deseja realmente deletar esse registro?');
}

function go_pag(num,nomev) {
	window.open('albumbebe.php?pag='+num+'&nome='+nomev,'_self');
}

function FormataData(Campo,teclapres) {
	var tecla = teclapres.keyCode;

	vr = event.srcElement.value; vr = vr.replace( ".", "" );
	vr = vr.replace( "/", "" );  vr = vr.replace( "/", "" );
	vr = vr.replace( ":", "" );  vr = vr.replace( " ", "" );
	tam = vr.length + 1;

	if ( tecla != 9 && tecla != 8 ){
		if ( tam > 2 && tam < 5 ) //Dia
			event.srcElement.value = vr.substr( 0, tam - 2  ) + '/' + vr.substr( tam - 2, tam );

		if ( tam >= 5 && tam <= 10 ) //Mês
			event.srcElement.value = vr.substr( 0, 2 ) + '/' + vr.substr( 2, 2 ) + '/' + vr.substr( 4, 4 );
			
		if ( tam >= 10 && tam < 12 ) //Ano
			event.srcElement.value = vr.substr( 0, 2 ) + '/' + vr.substr( 2, 2 ) + '/' + vr.substr( 4, 4 ) + ' ' + vr.substr( 8, 2 );
			
		if ( tam >= 12 && tam <= 15 ) //Hora
			event.srcElement.value = vr.substr( 0, 2 ) + '/' + vr.substr( 2, 2 ) + '/' + vr.substr( 4, 4 ) + ' ' + vr.substr( 8, 2 ) + ':' + vr.substr( 10, 2 );

	}
}

function isNumeric(teclapres) {
	var tecla = teclapres.keyCode;
	if (tecla == 9 || tecla == 8 || tecla == 13)
		return true;
	if ((tecla >= 48 && tecla <= 57) || (tecla >= 96 && tecla <= 105))
		return true;
	if ((tecla >= 33 && tecla <= 40) || tecla == 45 || tecla == 46)
		return true;
	return false;
}

function isDouble(teclapres) {
	var tecla = teclapres.keyCode;
	if (tecla == 9 || tecla == 8 || tecla == 13 || tecla == 110)
		return true;
	if ((tecla >= 48 && tecla <= 57) || (tecla >= 96 && tecla <= 105))
		return true;
	if ((tecla >= 33 && tecla <= 40) || tecla == 45 || tecla == 46)
		return true;
	return false;
}