var ns4 = (document.layers)? true:false
var ie4 = (document.all)? true:false
var sol1 = "1"

function Inicio() 
{
	Escritura ("divSol1",sol1,null)
}

function Escritura (id1,texto1,capaReferencia1)
{
    var capa1 
   
    if (ns4) 
    {
	if (capaReferencia1)
	    capa1 = eval ('document.'+capaReferencia1+'.document.'+id1+'.document')
	else
	    capa1 = document.layers[id1].document
		
	capa1.open()
	capa1.write(texto1)
	capa1.close()
    }
    else
	if (ie4) 
	    document.all[id1].innerHTML = '<span class="style29">'+texto1+'</span>'
		
}

function CambiaSol1(solucion1,numero1)
{
    if (solucion1 == 1)
    {
	Escritura1 ("divSol1",numero1,null)
	sol1 = numero1
    }
}





var ns4 = (document.layers)? true:false
var ie4 = (document.all)? true:false
var sol2 = "1"
function Inicio2() 
{
	Escritura ("divSol2",sol2,null)
}
function Escritura2 (id,texto,capaReferencia)
{
    var capa   
    if (ns4) 
    {
	if (capaReferencia)
	    capa = eval ('document.'+capaReferencia+'.document.'+id+'.document')
	else
	    capa = document.layers[id].document		
	capa.open()
	capa.write(texto)
	capa.close()
    }
    else
	if (ie4) 
	    document.all[id].innerHTML = '<span class="style29">'+texto+'</span>'
}

function CambiaSol2(solucion,numero)
{
    if (solucion == 1)
    {
	Escritura ("divSol2",numero,null)
	sol2 = numero
    }
}
<!-- Begin
function SwapImage1() {
  document.logo1.src="images/Logo_TeVes_over+.gif"
}
function SwapImage1Back() {
  document.logo1.src="images/Logo_TeVes.gif"
}
// End -->
<!-- Begin
function SwapImage2() {
  document.logo2.src="images/Logo_mariola_over.gif"
}
function SwapImage2Back() {
  document.logo2.src="images/logo_mariola.gif"
}
// End -->
<!-- Begin
function SwapImage3() {
  document.logo3.src="images/LOGO_TELEALICANTE_over.gif"
}
function SwapImage3Back() {
  document.logo3.src="images/LOGO_TELEALICANTE.gif"
}
// End -->



function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('Debe introducir un término de búsqueda.\n');
  document.MM_returnValue = (errors == '');
}


function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function verificar()
	{
	var txt=""; 
	if (document.envio.nombreapellidos.value=='') 
		{
		txt+='- Persona de contacto.'+String.fromCharCode(13);
		} 
	if (document.envio.telefono1.value=='' && document.envio.email.value=='') 
		{
		txt+='- Teléfono de contacto en Tfno1. o E-mail.'+String.fromCharCode(13); 
		if(document.envio.email.value!=''){
			if(!validarEmail(document.envio.email.value)) txt+='- Formato de E-mail incorrecto.\n';
			
		}
		}
	if (txt!="" )
		{alert("Debe rellenar los siguientes campos:\n\n"+txt);}
	else
		{document.envio.submit();}
	}
	function validarEmail(valor) {
		return (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(valor))
	}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


function swapText(what) {
document.getElementById("piedefoto").firstChild.nodeValue=what; //this will change the text in mydiv to the text you specified when calling the function
}

