function Arroba(sString){
	var str = sString.value
	// Return false if e-mail field does not contain a '@' and '.' .   
	if (str.indexOf ('@',0) == -1 || str.indexOf ('.',0) == -1)
		{
		alert('Introduzca correctamente el E-mail')
		sString.focus()
		return false 
	}
	else
		{
		return true;      
		}
}

function isDescrip(valor,total) {
	if (valor.value.length > total) {
		alert ("Debe introducir una CONSULTA más corta.(Max. "+total+" caracteres).");
		valor.focus ();
		return false;
	} else return true; 
}

function Mostrar(nombreCapa){ 
yy_ml=(event.clientX + document.body.scrollLeft);
yy_mt=(event.clientY + document.body.scrollTop);
document.getElementById(nombreCapa).style.left=yy_ml - 100; 
document.getElementById(nombreCapa).style.top=yy_mt - 350; 
document.getElementById(nombreCapa).style.visibility="visible"; 
} 
function Ocultar(nombreCapa){ 
document.getElementById(nombreCapa).style.visibility="hidden"; 
} 

function es_num(v){
   var t=/^[0-9]\d*$/
   return t.test(v);
}

function cadena_letras(v){
   var t=/^[á|é|í|ó|ú|ñ|Ñ|Á|É|Í|Ó|Ú|a-zA-Z\s]*$/;
   return t.test(v);
}

function es_telefono(v){
    var t=/^(6|8|9)\d{8}$/
    return t.test(v);
 }

function es_cp(v){
   var t=/^[0-9]\d*$/
   return t.test(v);
}

function VisulizacionImg(vImage,capa){
	vRuta='http://www.chopperbikes.es' + vImage;
	if (vImage.value != "") 
		{	//alert(document.body.scrollTop)
			p=document.getElementById('Contenido')
			p.style.visibility="visible";
			p.style.top = document.body.scrollTop + 50;
			frames.previewImagesBicis.location =  vRuta
		}
		 
		else { frames.previewImagesBicis.location = 'about:blank';}
}

function NoVisulizacionImg(){
	p=document.getElementById('Contenido')
	p.style.visibility="hidden";
}

function ValidaReserva(){
	
	if(frmReserva.fmNombre.value == ""){
		alert("Introduce tu Nombre.");
		frmReserva.fmNombre.focus();
		return false;
	}

	if(frmReserva.fmEmail.value == ""){
		alert("Introduce tu Email.");
		frmReserva.fmEmail.focus();
		return false;
	}
			
	if(frmReserva.fmTelefono.value == ""){
					alert("Introduce tu Teléfono.");
					frmReserva.fmTelefono.focus();
					return false;
	}
	else{
		if (!es_num(frmReserva.fmTelefono.value)){
			alert ('Debes escribir un Teléfono correcto');
			frmReserva.fmTelefono.focus();
			return false;
		}
	}
	
	if(frmReserva.fmEdad.value != ""){
		if (!es_num(frmReserva.fmEdad.value)){
				alert ('Debes escribir tu edad correctamente.');
				frmReserva.fmEdad.focus();
				return false;
		}
	}
		
	if(frmReserva.fmDireccion.value == ""){
		alert("Introduce tu Dirección.");
		frmReserva.fmDireccion.focus();
		return false;
	}	
	
	if(frmReserva.fmCP.value == ""){
		alert("Introduce tu Código Postal.");
		frmReserva.fmCP.focus();
		return false;
	}
	else{
		if(frmReserva.fmCP.value.length!=5){
			msgErr="El Código Postal debe de ser un número de cinco cifras";
			alert(msgErr);
			frmReserva.fmCP.focus();
			return false;
		}	
		else{
			if(!es_num(frmReserva.fmCP.value)){
				msgErr="El Código Postal debe de ser un número de cinco cifras";
				alert(msgErr);
				frmReserva.fmCP.focus();
				return false;
			}
		}
	}
			
	if(frmReserva.fmMunicipio.value == ""){
		alert("Selecciona tu Municipio.");
		frmReserva.fmMunicipio.focus();
		return false;
	}
				
	if(frmReserva.fmProvincia.value == ""){
		alert("Selecciona tu Provincia.");
		frmReserva.fmProvincia.focus();
		return false;
	}
}

function ValidaContacto(){
	
	if(frmContacto.fmNombre.value == ""){
		alert("Introduce tu Nombre.");
		frmContacto.fmNombre.focus();
		return false;
	}

	if(frmContacto.fmEmail.value == ""){
		alert("Introduce tu Email.");
		frmContacto.fmEmail.focus();
		return false;
	}
	
	if(frmContacto.fmTelefono.value == ""){
		alert("Introduce el Teléfono.");
		frmContacto.fmTelefono.focus();
		return false;
	}
	else{
		if (!es_num(frmContacto.fmTelefono.value)){
			alert ('Debes escribir un Teléfono correcto');
			frmContacto.fmTelefono.focus();
			return false;
		}
	}
	
	if(frmContacto.fmProvincia.value == ""){
		alert("Selecciona tu Provincia.");
		frmContacto.fmProvincia.focus();
		return false;
	}
}

function ValidaContactoInmobiliario(){
	
	if(frmContacto.fmNombre.value == ""){
		alert("Introduce tu Nombre.");
		frmContacto.fmNombre.focus();
		return false;
	}

	if(frmContacto.fmEmail.value == ""){
		alert("Introduce tu Email.");
		frmContacto.fmEmail.focus();
		return false;
	}
	
	if(frmContacto.fmTelefono.value == ""){
		alert("Introduce el Teléfono.");
		frmContacto.fmTelefono.focus();
		return false;
	}
	else{
		if (!es_num(frmContacto.fmTelefono.value)){
			alert ('Debes escribir un Teléfono correcto');
			frmContacto.fmTelefono.focus();
			return false;
		}
	}
}

function ValidaEmpresa(){
	
	if(frmAltaEmpresas.fmNombre.value == ""){
		alert("Introduce el Nombre de la Empresa.");
		frmAltaEmpresas.fmNombre.focus();
		return false;
	}

	if(frmAltaEmpresas.fmDireccion.value == ""){
		alert("Introduce la Dirección de la Empresa.");
		frmAltaEmpresas.fmDireccion.focus();
		return false;
	}

	if(frmAltaEmpresas.fmCP.value == ""){
		alert("Introduce tu Código Postal.");
		frmAltaEmpresas.fmCP.focus();
		return false;
	}
	else{
		if(frmAltaEmpresas.fmCP.value.length!=5){
			msgErr="El Código Postal debe de ser un número de cinco cifras";
			alert(msgErr);
			frmAltaEmpresas.fmCP.focus();
			return false;
		}	
		else{
			if(!es_num(frmAltaEmpresas.fmCP.value)){
				msgErr="El Código Postal debe de ser un número de cinco cifras";
				alert(msgErr);
				frmAltaEmpresas.fmCP.focus();
				return false;
			}
		}
	}
			
	if(frmAltaEmpresas.fmMunicipio.value == ""){
		alert("Selecciona tu Municipio.");
		frmAltaEmpresas.fmMunicipio.focus();
		return false;
	}
				
	if(frmAltaEmpresas.fmProvincia.value == ""){
		alert("Selecciona tu Provincia.");
		frmAltaEmpresas.fmProvincia.focus();
		return false;
	}
	
	if(frmAltaEmpresas.fmPais.value == ""){
		alert("Selecciona tu País.");
		frmAltaEmpresas.fmPais.focus();
		return false;
	}
	
	if(frmAltaEmpresas.fmTelefono.value == ""){
		alert("Introduce el Teléfono.");
		frmAltaEmpresas.fmTelefono.focus();
		return false;
	}
	else{
		if (!es_num(frmAltaEmpresas.fmTelefono.value)){
			alert ('Debes escribir un Teléfono correcto');
			frmAltaEmpresas.fmTelefono.focus();
			return false;
		}
	}
	if(frmAltaEmpresas.fmEmail.value == ""){
		alert("Introduce tu Email.");
		frmAltaEmpresas.fmEmail.focus();
		return false;
	}
}

function ValidaPromo(){
	
	if(frmAltaPromo.fmNombre.value == ""){
		alert("Introduce tu Nombre.");
		frmAltaPromo.fmNombre.focus();
		return false;
	}

	if(frmAltaPromo.fmDireccion.value == ""){
		alert("Introduce tu Dirección.");
		frmAltaPromo.fmDireccion.focus();
		return false;
	}

	if(frmAltaPromo.fmCP.value == ""){
		alert("Introduce tu Código Postal.");
		frmAltaPromo.fmCP.focus();
		return false;
	}
	else{
		if(frmAltaPromo.fmCP.value.length!=5){
			msgErr="El Código Postal debe de ser un número de cinco cifras";
			alert(msgErr);
			frmAltaPromo.fmCP.focus();
			return false;
		}	
		else{
			if(!es_num(frmAltaPromo.fmCP.value)){
				msgErr="El Código Postal debe de ser un número de cinco cifras";
				alert(msgErr);
				frmAltaPromo.fmCP.focus();
				return false;
			}
		}
	}
			
	if(frmAltaPromo.fmMunicipio.value == ""){
		alert("Selecciona tu Municipio.");
		frmAltaPromo.fmMunicipio.focus();
		return false;
	}
				
	if(frmAltaPromo.fmProvincia.value == ""){
		alert("Selecciona tu Provincia.");
		frmAltaPromo.fmProvincia.focus();
		return false;
	}
	
	if(frmAltaPromo.fmPais.value == ""){
		alert("Selecciona tu País.");
		frmAltaPromo.fmPais.focus();
		return false;
	}
	
	if(frmAltaPromo.fmTelefono.value == ""){
		alert("Introduce el Teléfono.");
		frmAltaPromo.fmTelefono.focus();
		return false;
	}
	else{
		if (!es_num(frmAltaPromo.fmTelefono.value)){
			alert ('Debes escribir un Teléfono correcto');
			frmAltaPromo.fmTelefono.focus();
			return false;
		}
	}
	if(frmAltaPromo.fmEmail.value == ""){
		alert("Introduce tu Email.");
		frmAltaPromo.fmEmail.focus();
		return false;
	}
}

function ValidaAltaUsuario(){	
	if(frmAltaUsuario.fmEmail.value == ""){
		alert("Introduce tu Email.");
		frmAltaUsuario.fmEmail.focus();
		return false;
	}
}

function ValidaEnvioAmigo(){
	
	if(frmEnviarAmigo.fmNombre.value == ""){
		alert("Introduce tu Nombre.");
		frmEnviarAmigo.fmNombre.focus();
		return false;
	}

	if(frmEnviarAmigo.fmEmail.value == ""){
		alert("Introduce tu Email.");
		frmEnviarAmigo.fmEmail.focus();
		return false;
	}
	
	if(frmEnviarAmigo.fmProvincia.value == ""){
		alert("Selecciona tu Provincia.");
		frmEnviarAmigo.fmProvincia.focus();
		return false;
	}
	
	if(frmEnviarAmigo.fmEmail2.value == ""){
		alert("Introduce el Email destinatario.");
		frmEnviarAmigo.fmEmail2.focus();
		return false;
	}
}

function ValidaPublicidad(){
	
	if(frmPublicidad.fmTipoEmpresa.value == ""){
		alert("Introduce el Tipo de la Empresa.");
		frmPublicidad.fmTipoEmpresa.focus();
		return false;
	}
	
	if(frmPublicidad.fmEmpresa.value == ""){
		alert("Introduce el Nombre de la Empresa.");
		frmPublicidad.fmEmpresa.focus();
		return false;
	}

	if(frmPublicidad.fmEmail.value == ""){
		alert("Introduce el Email.");
		frmPublicidad.fmEmail.focus();
		return false;
	}
			
	if(frmPublicidad.fmTelefono.value == ""){
		alert("Introduce el Teléfono.");
		frmPublicidad.fmTelefono.focus();
		return false;
	}
	else{
		if (!es_num(frmPublicidad.fmTelefono.value)){
			alert ('Debes escribir un Teléfono correcto');
			frmPublicidad.fmTelefono.focus();
			return false;
		}
	}
			
	if(frmPublicidad.fmDireccion.value == ""){
		alert("Introduce tu Dirección.");
		frmPublicidad.fmDireccion.focus();
		return false;
	}	
	
	if(frmPublicidad.fmCP.value == ""){
		alert("Introduce tu Código Postal.");
		frmPublicidad.fmCP.focus();
		return false;
	}
	else{
		if(frmPublicidad.fmCP.value.length!=5){
			msgErr="El Código Postal debe de ser un número de cinco cifras";
			alert(msgErr);
			frmPublicidad.fmCP.focus();
			return false;
		}	
		else{
			if(!es_num(frmPublicidad.fmCP.value)){
				msgErr="El Código Postal debe de ser un número de cinco cifras";
				alert(msgErr);
				frmPublicidad.fmCP.focus();
				return false;
			}
		}
	}
			
	if(frmPublicidad.fmMunicipio.value == ""){
		alert("Introduce tu Municipio.");
		frmPublicidad.fmMunicipio.focus();
		return false;
	}
				
	if(frmPublicidad.fmProvincia.value == ""){
		alert("Selecciona tu Provincia.");
		frmPublicidad.fmProvincia.focus();
		return false;
	}
}

function AbrirEnvioAmigo(Url,Param) {
  vUrl="/Include/EnvioAmigo.asp?Url=" + Url + "&Param=" + Param
  window.open(vUrl,'','toolbar=no,location=no,resizable=no,directories=no,status=no,menubar=no,copyhistory=no,scrollbars=no,width=400,height=350,top=130,left=250');
}
function AbrirVentana(Url,Param) {
  vUrl=Url
  window.open(vUrl,'','toolbar=no,location=no,resizable=no,directories=no,status=no,menubar=no,copyhistory=no,scrollbars=no,width=400,height=350,top=130,left=250');
}
function AbrirEjemploDossier(Param) {
  vUrl="/Include/EjemploDossier.asp?CdServicio=" + Param
  window.open(vUrl,'','toolbar=no,location=no,resizable=no,directories=no,status=no,menubar=no,copyhistory=no,scrollbars=yes,width=810,height=600,top=130,left=250');
}

function AbrirVentanaLegal(){
window.open('/Legal/IndexBody.asp','','toolbar=no,location=no,resizable=no,directories=no,status=no,menubar=no,copyhistory=no,scrollbars=yes,width=568,height=380');
}

function ImprimirReportaje(Reportaje) {
  win = window.open('ImprimirReportaje.asp?Reportaje='+ Reportaje, 'Imprimir', 'width=700, height=600,top=0,left=100, directories=0,resizable=0,location=0,status=0,scrollbars=1,toolbar=0,menubar=0,titlebar=0');
  win.print();
}

function PopCentrado(theURL,winName,features) 
{ //v2.0
	ventana=window.open(theURL,winName,features);
	ventana.focus()
	ventana.moveTo(Math.round((screen.availWidth-550)/2),Math.round((screen.availHeight-550)/2))
	return ventana
}

// Función para comprobar si existe contenido del editor de texto
function RevisaContents(fmConsulta) {
var oEditor = FCKeditorAPI.GetInstance(fmConsulta) ;
var texto = "";
var texto = oEditor.GetXHTML( true );
   if  ((texto) == ""){
	return false;
	}
	
}
// Función para comprobar el tamaño contenido del editor de texto
function RevisaContentsLong(fmConsulta, long) {
var oEditor = FCKeditorAPI.GetInstance(fmConsulta) ;
var texto = "";
var texto = oEditor.GetXHTML( true );
var len = texto.length;	

if (len > long){
	
	return false;
	}	
}


// Función para comprobar los contenidos del editor de texto

function GetContents(fmConsulta) {
	// Get the editor instance that we want to interact with.
	var oEditor = "";
	var oEditor = FCKeditorAPI.GetInstance(fmConsulta) ;
	// Get the editor contents in XHTML.
	var texto = "";
	var texto = oEditor.GetXHTML( true );
	
	if  (DPTelefono(texto) == true)
		{alert("No se permite la introdución de teléfonos en el contenido del Anuncio");
		 oEditor.Commands.GetCommand( 'SelectAll' ).Execute();
		 return false;}
	
	if  (DPVinculo(texto) == true)
		{alert("No se permite la introdución de hipervínculos en el contenido del Anuncio");
		 oEditor.Commands.GetCommand( 'SelectAll' ).Execute();
		 return false;}
	
	if  (DPEmail(texto) == true)
		{alert("No se permite la introdución de direcciones de correo en el contenido del Anuncio");
		 oEditor.Commands.GetCommand( 'SelectAll' ).Execute();
		 return false;}
	
	oEditor.SetHTML( texto ) ;
	return true;  

}
// Función para controlar que el contenido del editor sean espacios en blanco
function GetLength(fmConsulta)
{
	var oEditor = FCKeditorAPI.GetInstance(fmConsulta) ;
	var oDOM = oEditor.EditorDocument ;
	var iLength=0 ;

	if ( document.all ){		// If Internet Explorer.
		iLength = oDOM.body.innerText.length ;
		valor = oDOM.body.innerText; 
	}else{					// If Firefox.
		iLength = oDOM.body.textContent.length ;
		valor = oDOM.body.textContent; 
	}
	if ((vacio(valor) == false)){
	 
	  return false;
	}else{
	  return true;
	}
}
function vacio(q){	
	for(i = 0; i < q.length; i++){ 
		if ((escape(q.charAt(i))!="%A0") ){ 		
			if((escape(q.charAt(i))!="%20") ){
				
				return true ;
			}
		} 
	} 
	return false ;
}
// Fin Función para controlar que el contenido del editor sean espacios en blanco

//Función Validación Formulario de Opinión
function ValidaOpinion(){
	var msg;
  
      // Llamadas a las funciones propias del editor
	if ((RevisaContents("fmOpinion") == false)){
	  alert("Introduce tu opinion.");
	  return false;
	}
	
	if ((GetLength("fmOpinion") == false)){
	 alert("Introduce tu opinion.");
	  return false;
	}

	if ((RevisaContentsLong("fmOpinion", 1500) == false)){
	 alert("El contenido de la opinion no debe superar los 1500 caracteres.");
	  return false;
	}
   if(frmOpinion.fmNombre.value == ""){
      alert("Introduce tu nombre.");
      frmOpinion.fmNombre.focus();
      return false;
   }
   else{
      if(cadena_letras(frmOpinion.fmNombre.value)==false){
         alert("En el nombre no se pueden introducir caracteres numericos.");
         frmOpinion.fmNombre.focus();
         return false;
      }
   }   
          
	 if(frmOpinion.fmEmail.value == ""){
      alert("Introduce tu email.");
      frmOpinion.fmEmail.focus();
      return false;
   }

	// Fin de llamadas a las funciones propias del editor

}

function ValidaEvento(){
	var msg;
  	if(frmAltaEventos.fmTitulo.value == ""){
      alert("Introduce el Título del Evento. Máximo 160 caracteres.");
      frmAltaEventos.fmTitulo.focus();
      return false;
   	}
    if(frmAltaEventos.fmLugar.value == ""){
      alert("Introduce el Lugar donde se celebrará el Evento.");
      frmAltaEventos.fmLugar.focus();
      return false;
   	}
    if(frmAltaEventos.fmInicio.value == ""){
      alert("Introduce la fecha de Inicio del Evento.");
      frmAltaEventos.fmInicio.focus();
      return false;
   	}
      // Llamadas a las funciones propias del editor
	if ((RevisaContents("fmTexto") == false)){
	  alert("Introduce el texto del Evento. Máximo de 4000 caracteres.");
	  return false;
	}
	
	if ((GetLength("fmTexto") == false)){
	 alert("Introduce el texto del Evento. Máximo de 4000 caracteres.");
	  return false;
	}

	if ((RevisaContentsLong("fmTexto", 4000) == false)){
	 alert("El contenido del evento no debe superar los 4000 caracteres.");
	  return false;
	}
	// Fin de llamadas a las funciones propias del editor

}

function ValidaAnuncio(){
	var msg;
  	if(frmAnuncio.fmTitulo.value == ""){
      alert("Introduce el Título del Anuncio. Máximo 200 caracteres.");
      frmAnuncio.fmTitulo.focus();
      return false;
   	}
    if ((GetLength("fmTexto") == false)){
	 alert("Introduce el texto del Anuncio. Máximo de 1000 caracteres.");
	  return false;
	}
	if ((RevisaContentsLong("fmTexto", 1000) == false)){
	 alert("El contenido del Anuncio no debe superar los 1000 caracteres.");
	  return false;
	}	
	if(frmAnuncio.fmCategoria.value == ""){
      alert("Introduce la Categoría correspondiente al Anuncio.");
      frmAnuncio.fmCategoria.focus();
      return false;
   	}
    if(frmAnuncio.fmNombre.value == ""){
		alert("Introduce tu Nombre.");
		frmAnuncio.fmNombre.focus();
		return false;
	}
	if(frmAnuncio.fmEmail.value == ""){
		alert("Introduce tu Email.");
		frmAnuncio.fmEmail.focus();
		return false;
	}	
	if(frmAnuncio.fmProvincia.value == ""){
		alert("Selecciona tu Provincia.");
		frmAnuncio.fmProvincia.focus();
		return false;
	}
	if(frmAnuncio.fmDuracion.value == ""){
      alert("Introduce la duracion de visibilidad del Anuncio.");
      frmAnuncio.fmDuracion.focus();
      return false;
   	}
	// Fin de llamadas a las funciones propias del editor

}

function ValidaEditor(){
	var msg;
  	if(frmAltaEditor.fmUsuario.value == ""){
      alert("Introduce un Usuario de Acceso. Máximo 8 caracteres.");
      frmAltaEditor.fmUsuario.focus();
      return false;
   	}
    if(frmAltaEditor.fmPassword.value == ""){
      alert("Introduce un Password de Acceso. Máximo 8 caracteres.");
      frmAltaEditor.fmPassword.focus();
      return false;
   	}
    if(frmAltaEditor.fmNombre.value == ""){
		alert("Introduce tu Nombre.");
		frmAltaEditor.fmNombre.focus();
		return false;
	}
	if(frmAltaEditor.fmEmail.value == ""){
		alert("Introduce tu Email.");
		frmAltaEditor.fmEmail.focus();
		return false;
	}	
	if(frmAltaEditor.fmProvincia.value == ""){
		alert("Selecciona tu Provincia.");
		frmAltaEditor.fmProvincia.focus();
		return false;
	}
	if ((RevisaContentsLong("fmTexto", 3000) == false)){
	 alert("El contenido de Otros Datos no debe superar los 3000 caracteres.");
	  return false;
	}	
	// Fin de llamadas a las funciones propias del editor

}

function ValidaConsultaAnuncio(){
	var msg;
  	if(frmConsultaAnuncio.fmNombre.value == ""){
		alert("Introduce tu Nombre.");
		frmConsultaAnuncio.fmNombre.focus();
		return false;
	}
	if(frmConsultaAnuncio.fmEmail.value == ""){
		alert("Introduce tu Email.");
		frmConsultaAnuncio.fmEmail.focus();
		return false;
	}	
	if(frmConsultaAnuncio.fmProvincia.value == ""){
		alert("Selecciona tu Provincia.");
		frmConsultaAnuncio.fmProvincia.focus();
		return false;
	}
	if ((GetLength("fmConsulta") == false)){
	 alert("Introduce el texto de la Consulta. Máximo de 1000 caracteres.");
	  return false;
	}
	if ((RevisaContentsLong("fmConsulta", 1000) == false)){
	 alert("El contenido de la Consulta no debe superar los 1000 caracteres.");
	  return false;
	}	
	// Fin de llamadas a las funciones propias del editor

}

function ValidaAltaNoticia(){
	var msg;
  	if(FrmNoticiasEdit.fmTitulo.value == ""){
		alert("Introduce el Título de la Noticia.");
		FrmNoticiasEdit.fmTitulo.focus();
		return false;
	}
	if(FrmNoticiasEdit.fmEpigrafe.value == ""){
		alert("Introduce el Epígrafe de la Noticia.");
		FrmNoticiasEdit.fmEpigrafe.focus();
		return false;
	}	
	if ((GetLength("fmTexto") == false)){
	 alert("Introduce el texto de la Noticia. Máximo de 8000 caracteres.");
	  return false;
	}
	if ((RevisaContentsLong("fmTexto", 8000) == false)){
	 alert("El contenido de la Noticia no debe superar los 8000 caracteres.");
	  return false;
	}	
	if(FrmNoticiasEdit.fmArchivo.value == ""){
		alert("Adjunta una imagen con formato .gif, .jpg o .tif para la Noticia.");
		FrmNoticiasEdit.fmArchivo.focus();
		return false;
	}	
	// Fin de llamadas a las funciones propias del editor

}

function ValidaAltaInmueble(){
	var msg;
  	if(FrmInmobiliariasEdit.fmReferencia.value == ""){
		alert("Introduce la Referencia del Inmueble.");
		FrmInmobiliariasEdit.fmReferencia.focus();
		return false;
	}
	if(FrmInmobiliariasEdit.fmLocalizacion.value == ""){
		alert("Introduce la Localizacion del Inmueble.");
		FrmInmobiliariasEdit.fmLocalizacion.focus();
		return false;
	}	
	if(FrmInmobiliariasEdit.fmMetros.value == ""){
		alert("Introduce los Metros Cuadrados.");
		FrmInmobiliariasEdit.fmMetros.focus();
		return false;
	}
	else{
		if (!es_num(FrmInmobiliariasEdit.fmMetros.value)){
			alert ('Los Metros deben ser un dato numérico.');
			FrmInmobiliariasEdit.fmMetros.focus();
			return false;
		}
	}
	if(FrmInmobiliariasEdit.fmDormitorios.value != ""){		
		if (!es_num(FrmInmobiliariasEdit.fmDormitorios.value)){
			alert ('El número de Dormitorios deben ser un dato numérico.');
			FrmInmobiliariasEdit.fmDormitorios.focus();
			return false;
		}
	}
	if(FrmInmobiliariasEdit.fmPrecio.value == ""){
		alert("Introduce el Precio del Inmueble.");
		FrmInmobiliariasEdit.fmPrecio.focus();
		return false;
	}	
	if ((GetLength("fmTexto") == false)){
	 alert("Introduce el texto descriptivo. Máximo de 2000 caracteres.");
	  return false;
	}
	if ((RevisaContentsLong("fmTexto", 8000) == false)){
	 alert("El contenido del texto no debe superar los 2000 caracteres.");
	  return false;
	}	
	if(FrmInmobiliariasEdit.fmTotalArchivo.value == 0){
		if (FrmInmobiliariasEdit.fmArchivo.value == ""){
			alert("Adjunta una imagen con formato .gif, .jpg o .tif del Inmueble.");
			FrmInmobiliariasEdit.fmArchivo.focus();
			return false;
		}
	}	
	// Fin de llamadas a las funciones propias del editor

}

function CargarCategoriaProvincia() {
	location.href=document.frmCategoriasProvincias.Provincia.value;
}
function CargarCategoriaAnunciante() {
	location.href=document.frmCategoriasAnunciantes.Categoria.value;
}
function CargarCategoriaAnuncio() {
	location.href=document.frmCategoriasAnuncios.Provincia.value;
}


function createMarker(point, nombre) { 
      var marker = new GMarker(point); 
         GEvent.addListener(marker, 'click', function() { 
          marker.openInfoWindowHtml(nombre); 
       }); 
      return marker; 
}
	  
function cargar(vLat,vLong,vNom,vDir,vMuni,vProv,vImg,vEst) {
	if (vEst == "N" || vImg==""){
		vImg="Dinaster.gif"
	}
	if (GBrowserIsCompatible()) {
		var map2 = new GMap2(document.getElementById("map2"));
		map2.setCenter(new GLatLng(vLat,vLong), 15);
		map2.addControl(new GMapTypeControl());
        map2.addControl(new GLargeMapControl());
        
		map2.addControl(new GScaleControl());
        map2.addControl(new GOverviewMapControl());
		//map2.setMapType(G_HYBRID_TYPE);
		var point = new GLatLng(vLat,vLong);
        map2.addOverlay(new GMarker(point));
		
		//function addtag(point, address) {
        	var address = '<img src="/Imagenes/Logos-Lujo-Mini/'+ vImg +'" width="144" align="absmiddle" height="67" border="0" class="FondoImagenes" /><br/><b>'+ vNom +'</b><br/><i>' + vDir + '</i><br>' + vMuni + ' (' + vProv + ')';
			var marker = new GMarker(point);
        	GEvent.addListener(marker, "click", function() {
			marker.openInfoWindowHtml(address); } );
        	//return marker;
        //	}
		//var point = new GLatLng(vLat,vLong);
		//var marker = addtag(point, address);
		map2.addOverlay(marker);
		marker.openInfoWindowHtml(address);
		 
	}
}

/* formexp.js compiled from X 4.0 with XC 0.27b. Distributed by GNU LGPL. For copyrights, license, documentation and more visit Cross-Browser.com */
var xOp7Up,xOp6Dn,xIE4Up,xIE4,xIE5,xNN4,xUA=navigator.userAgent.toLowerCase();
if(window.opera){var i=xUA.indexOf('opera');
if(i!=-1){var v=parseInt(xUA.charAt(i+6));xOp7Up=v>=7;xOp6Dn=v<7;}}
else if(navigator.vendor!='KDE' && document.all && xUA.indexOf('msie')!=-1){xIE4Up=parseFloat(navigator.appVersion)>=4;xIE4=xUA.indexOf('msie 4')!=-1;xIE5=xUA.indexOf('msie 5')!=-1;}
else if(document.layers){xNN4=true;}xMac=xUA.indexOf('mac')!=-1;
function xDef(){for(var i=0; i<arguments.length; ++i)
{if(typeof(arguments[i])=='undefined') return false;}return true;}
function xDisplay(e,s){if(!(e=xGetElementById(e))) return null;
if(e.style && xDef(e.style.display)) {if (xStr(s)) e.style.display = s;
return e.style.display;}return null;}
function xGetElementById(e){
if(typeof(e)!='string') return e;if(document.getElementById) e=document.getElementById(e);
else if(document.all) e=document.all[e];else e=null;return e;}
function xStr(s){for(var i=0; i<arguments.length; ++i)
{if(typeof(arguments[i])!='string') return false;}return true;}

function VerCapa(){
	capa1= 'capaEmail' 	
	xDisplay(capa1, 'block');
}

function NoVerCapa(){
	capa1= 'capaEmail' 	
	xDisplay(capa1, 'none');
}

function VerCapaTelefono(vCodCapa){
	capa1= 'iTelefono_' + vCodCapa;
	xDisplay(capa1, 'block');
}

function ValidaFeria(){
	
	if(frmFeria.fmEmpresa.value == ""){
		alert("Introduzca el Nombre de la Empresa.");
		frmFeria.fmEmpresa.focus();
		return false;
	}

	if(frmFeria.fmContacto.value == ""){
		alert("Introduzca la Persona de Contacto.");
		frmFeria.fmContacto.focus();
		return false;
	}

	if(frmFeria.fmEmail.value == ""){
		alert("Introduzca el Email.");
		frmFeria.fmEmail.focus();
		return false;
	}
	
	if(frmFeria.fmTelefono.value == ""){
		alert("Introduzca el Teléfono.");
		frmFeria.fmTelefono.focus();
		return false;
	}
	else{
		if (!es_num(frmFeria.fmTelefono.value)){
			alert ('Debes escribir un Teléfono correcto');
			frmFeria.fmTelefono.focus();
			return false;
		}
	}
}
