function validate()
{
fr = document.tsform
nombre = fr.nom.value
email = fr.mail.value
texto = fr.men.value
aviso01= "El nombre está en blanco (Max. 25 letras)"
aviso02= "El nombre no debe tener más de 25 letras"
aviso03= "El campo e-mail no puede estar vacío"
aviso04= "El texto mensaje, o comentario está blanco"
aviso05= "Hay una palabra demasiado larga, o faltan espacios"
aviso06= "Hay palabras que pueden molestar a alguien "
aviso07= "Carácter no válido "

if (nombre.length == 0){
alert(aviso01)
return false
}
if (nombre.length >= 26){
alert(aviso02)
return false
}
/*if (ema.length == 0  || f.tf02 == " "){
//alert("")
//return false
}*/


if (texto.length == 0){
alert(aviso04)
return false
}
if (texto == " "){
alert(aviso04)
return false
}
if (texto.length >= 2000){
alert("Has puesto demasiado texto en el mensaje. Max.2000 letras y hay: " + texto.length) 
return false
}
c=0,b=0
for (i=0; i <= texto.length; i++){
	c++
	if (texto.charAt(i) == " "){
	c=0
	b++
	}
	if (c >= 50){
		alert(aviso05)
                return false
	}


	if (b == texto.length){
		alert(aviso04)
		return false
		}
	
	
	if (texto.charAt(i) == "<" ||  texto.charAt(i)== ">" ||  texto.charAt(i)== "[" ||  texto.charAt(i)== "]"){
	 alert(aviso07 + '"' + texto.charAt(i) + '"')
         return false
	}
	

     }
}

function validforos()
{
fr = document.tsform
tema = fr.asunto.value
texto = fr.text.value

aviso01= "Debes poner un título de referencia para tu opinión o mensaje"
aviso03= "El campo título no puede tener más de 40 carácteres"
aviso04= "El texto mensaje, o comentario está blanco"
aviso05= "Hay una palabra demasiado larga, o faltan espacios"
aviso06= "Hay palabras que pueden molestar a alguien "
aviso07= "Carácter no válido "

if (tema.length >= 40){
alert(aviso03)
return false
}

if (tema.length == 0){
alert(aviso01)
return false
}

if (texto.length == 0){
alert(aviso04)
return false
}

if (texto.length >= 5000){
alert("Has puesto demasiado texto en el mensaje. Max.5000 letras y hay: " + texto.length) 
return false
}
c=0,b=0
for (i=0; i <= texto.length; i++){
	c++
	if (texto.charAt(i) == " "){
	c=0
	b++
	}
	if (c >= 50){
		alert(aviso05)
                return false
	}


	if (b == texto.length){
		alert(aviso04)
		return false
		}
	
	
	
	if (texto.charAt(i) == "<" ||  texto.charAt(i)== ">" ||  texto.charAt(i)== "[" ||  texto.charAt(i)== "]"){
	 alert(aviso07 + '"' + texto.charAt(i) + '"')
         return false
	}
	

     }
}

function validic()
{
fr = document.tsform
nombre = fr.nom.value
email = fr.ema.value
texto = fr.men.value
aviso01= "El nombre está en blanco (Max. 30 letras)"
aviso02= "El nombre no debe tener más de 30 letras"
aviso03= "No hay tema seleccionado"
aviso04= "El texto definición de palabra o refrán está vacío"
aviso05= "En el campo definción hay una palabra demasiado larga"
aviso06= "Hay palabras que pueden molestar a alguien"

if (nombre.length == 0){
alert(aviso01)
return false
}
if (nombre.length >= 30){
alert(aviso02)
return false
}
if (email.length == 0 ){
alert(aviso03)
return false
}
if (texto.length == 0){
alert(aviso04)
return false
}
if (texto == " "){
alert(aviso04)
return false
}
c=0
for (i=0; i <= texto.length; i++){
	c++
	if (texto.charAt(i) == " "){
	c=0
	}
	if (c >= 40){alert(aviso05)
                return false
	}
     }
}

function nw(d,f,e)
{path= "/" + d + "/" + f + "." + e;   window.open(path,"","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1, resizable=0,copyhistory=1,width=450,height=500") }


function nw300(d,f,e)
{path= "http://www.sayago.com/" + d + "/" + f + "." + e;   window.open(path,"","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0, resizable=0,copyhistory=1, width=300,height=300") }

function nw400(f,e)
{path= f + "." + e;   window.open(path,"","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0, resizable=0,copyhistory=1, width=400,height=320") }

function reg(d,f,e)
{path= "../" + d + "/" + f + "." + e;   window.open(path,"","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0, resizable=0,copyhistory=1, width=370,height=400") }

function nwf(d,f,e)
{path= "http://www.sayago.com/" + d + "/" + f + "." + e;          
window.open(path,"","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,copyhistory=1,width=460,height=380")
          }

function localimg(f){
    p= "images/" + f + "." + "jpg";
    document.picture.src = p
          }

function fotogal(d,f){
    p= "http://personales.ya.com/sayago/" + d + "/" + f + "." + "jpg";
    document.picture.src = p
          }

function ventana(d,f){
    p= d + "/" + f + "." + "jpg";
    document.picture.src = p
          }

function localvideo(f){
    p= "media/videos" + f + "." + "flv";
    document.video.filename = p
	
          }
function localaudio(f){
    p= "media/audios" + f + "." + "mp3";
    document.video.filename = p
          }
function imagetext(f,t){
    p= "jugadores/" + f + "." + "jpg";
    q= "jugadores/" + t + "." + "gif";
    document.foto.src = p;
    document.nombre.src = q
          }
function info(t){
    p= "textos/" + t + "." + "gif";
    document.texto.src = p
          }


function fotogal2(pb,d,f){
    p= "/pueblos/" + pb +"/" + d + "/" + f + "." + "jpg";
    document.picture.src = p
//alert(p)
          }

function fotopueb(d,f,e){
    p= "http://www.sayago.com/pueblos/" + d + "/" + f + "." + e;
    document.picture.src = p
          }
function cr()
{ return('© Copyright Tierras de Sayago, www.sayago.com') }

function leerme_cds()
  {
  alert("Este foro quiere ser un espacio abierto para que nuestra comarca sea vista con más interés también desde el aspecto deportivo. Cuidando las formas de hacer los comentarios evitaremos que otros nos vean como no somos.")
  }

function calog()
{path= "calog.htm";  window.open(path,"","toolbar=0,location=0,directories=0,status=0,menubar=0, scrollbars=1,resizable=0,copyhistory=1,width=400,height=400") }


pix = new Array("f01","f02","f03","f04",
"f05","f06","f07","f08","f09","f10",
"f11","f12","f13","f14",
"f15","f16","f17","f18","f19","f20",
"f21","f22","f23","f24","f25","f26",
"f27","f28","f29","f30","f31","f32",
"f33","f34","f35","f36","f37","f38",
"f39","f40","f41","f42","f43","f44",
"f45","f46")
thisPic = 0
p="http://personales.ya.com/sayago/fariza/"
imgCt = pix.length -1
function Previous() {
if (document.images && thisPic > 0) {
thisPic--
document.picture.src = p + pix[thisPic] + ".jpg"
 }
}
function Next()
  {
	if (document.images && thisPic < imgCt) {
	thisPic++
	document.picture.src = p + pix[thisPic] + ".jpg"

  }
}

