function fechaYhora(){
	Stamp = new Date();
	year = Stamp.getYear();
	if (year< 2000) year = 1900 + year;
	document.write(Stamp.getDate()+ "/"+ (Stamp.getMonth() + 1) + "/"+ year);
	var Hours;
	var Mins;
	var Time;
	Hours = Stamp.getHours();
	if (Hours >= 12) { Time = " PM"; } else { Time = " AM"; }
	if (Hours >12) { Hours -= 12; } if (Hours == 0) { Hours = 12; }
	Mins = Stamp.getMinutes();
	if (Mins< 10) { Mins = "0" + Mins; }
	document.write(Hours + ":" + Mins + Time);
}

function validar_formulario_cyv(){

var errores_formu=""
var retorn=true

/********************NOMBRE****************************/
nomb=document.formu.nombre

	if(!isNaN(nomb.value) || nomb.value.length< 3){
		
		errores_formu+="- Introduzca un nombre \n"
		
		retorn=false
		
	}
/******************************************************************/
/********************APELLIDO****************************/
apell=document.formu.apellido

	if(!isNaN(apell.value) || apell.value.length< 3){
		
		errores_formu+="- Introduzca un apellido \n"
		
		retorn=false
		
	}
/******************************************************************/
/////////////////////////E_MAIL////////////////////////////////////////
var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
var email = document.getElementById("idemail").value

if(email.length==0){

	errores_formu+="- Ingrese un e-mail \n"
	retorn=false
	
		}else{
			
			if(reg.test(email) == false) {
				errores_formu+="- E-mail mal ingresado \n"
				retorn=false
			}
}
/********************************************************************************************/
///////////////////////////CIUDAD////////////////////////////////////////////////
ciud=document.formu.ciudad

	if(ciud.value==0){

		errores_formu+="- Deve introducir una Ciudad \n"
		retorn=false
	}
///////////////////////////LOCALIDAD////////////////////////////////////////////////
local=document.formu.localidad

	if(local.value.length<=1){

		errores_formu+="- Deve introducir una Localidad o Barrio \n"
		retorn=false
	}
	
/*************************************************************************************************/	
///////////////////////////TEL////////////////////////////////////////////////
tele=document.formu.telefono.value;
var phone2 = /(^[0-9\s\-\+\#\*]{3,})$/; 
if (!tele.match(phone2) && !tele.length==0) {
	errores_formu+="- El numero de telefono no es correcto \n"
	retorn=false
}
///////////////////////////MOVIL////////////////////////////////////////////////
mov=document.formu.movil.value;
var movil2 = /(^[0-9\s\-\+\#\*]{3,})$/; 
if (!mov.match(movil2) && !mov.length==0) {
	errores_formu+="- El numero de movil no es correcto"
	retorn=false
}
/*************************************************************************************************/			
				if(retorn==false){
					
					alert('Datos Obligatorios:\n\n'+errores_formu)
				
				}

	return retorn
}


//////////////////////////////////////////////////////////////////////////////////
function validar_busqueda(){
var retorn=true
///////////////////////////BUSCAR////////////////////////////////////////////////
busq=document.busqueda.buscar

	if(busq.value.length<=0){

		retorn=false
	}

	return retorn
}
/////////////////////////////////////////////////////////////////////////////////////


/////////////////////////////////////////////////////////////////////////////////////
function validar_formulario(){

var errores_formu=""
var retorn=true

/********************NOMBRE****************************/
nomb=document.formu.nombre

	if(!isNaN(nomb.value) || nomb.value.length< 3){
		
		errores_formu+="- Introduzca un nombre\n"
		
		retorn=false
		
	}
/******************************************************************/
/////////////////////////E_MAIL////////////////////////////////////////

	email=document.getElementById("idemail").value
	arroba=email.indexOf("@")
	punto=email.lastIndexOf(".")
	e=document.formu.e_mail

		
		if(email.length==0){

		errores_formu+="- Ingrese e-mail\n"
		retorn=false
		
			}else{
					
				if(arroba<3 || punto<(arroba+2)){

						errores_formu+="- E-mail mal ingresado\n"
						retorn=false
				}
		}
	
/********************************************************************************************/
///////////////////////////COMENTARIOS////////////////////////////////////////////////
coment=document.formu.comentario

	if(coment.value.length<=0){

		errores_formu+="- Deve introducir un mensaje\n"
		retorn=false
	}
	
/*************************************************************************************************/	
///////////////////////////TEL////////////////////////////////////////////////
tele=document.formu.tel

	if(isNaN(tele.value)){
		
		errores_formu+="- Introduzca un numero de telefono\n"
		
		retorn=false
		
	}
	
/*************************************************************************************************/			
				if(retorn==false){
					
					alert('Datos Requeridos:\n\n'+errores_formu)
				
				}

	return retorn
}



function validar_busqueda(){
var retorn=true
///////////////////////////BUSCAR////////////////////////////////////////////////
busq=document.busqueda.buscar

	if(busq.value.length<=0){

		retorn=false
	}

	return retorn
}
