// *************************************************************
// Codigo javascript
// Escrito por: E-Pulse S.C.
// Todo el código aqui presente es propriedad de E-Pulse S.C
// *************************************************************

function overTD(td,color){td.style.cursor='default';td.bgColor=color;}
function outTD(td,color){td.style.cursor='default';td.bgColor=color;}
function clickTD(td){td.children.tags('A')[0].click();}

function confirmLink(theText)
{
    return confirm(theText);
}

function ChangeImage(img_name, img_src)
{
	document.images[img_name].src=img_src;
}

function imgopen(img_link)
{

	// Centramos la ventana en la pantalla
	var wleft = (screen.width - 700) / 2;
	var wtop = (screen.height - 550) / 2;

	popup = window.open ('', 'Imagen',
	'toolbar=0,location=0,directories=0,status=0,menubar=0,' +
	'left='+wleft+',top='+wtop+','+
	'scrollbars=0,resizable=0,width=700,height=550'
	);		
	
	popup.document.write('<html>');
	popup.document.write('<head>');
	popup.document.write('<title>ArtSurfCamp.com :: Imagen ampliada</title>');
	popup.document.write('<link rel=\"stylesheet\" href=\"../style/imgopen.css\" type=\"text/css\">');
	popup.document.write('</head>');
	popup.document.write('<body>');
	popup.document.write('<div align=\"center\">');
	
	popup.document.write('<img src=\"' + img_link +'\"><p>');
	
	popup.document.write('<a href=\"javascript:window.close();\">cerrar ventana</a>');
	
	popup.document.write('</div></body></html>');
	popup.focus()

}

function Preload()
 {

  if (document.images)
   {
	 var host_name = "http://artsurfcamp.com/";
	 
     var link_portada=new Image(126,26);
     link_portada.src=host_name + "imagenes/btn-portada.gif";
     link_portada_over=new Image(126,26);
     link_portada_over.src=host_name + "imagenes/btn-portada-on.gif";

     var link_cursos=new Image(126,26);
     link_cursos.src= host_name + "imagenes/btn-cursos.gif";
     link_cursos_over=new Image(126,26);
     link_cursos_over.src= host_name + "imagenes/btn-cursos-on.gif";
     
     var link_monitores=new Image(126,26);
     link_monitores.src= host_name + "imagenes/btn-monitores.gif";
     link_monitores_over=new Image(126,26);
     link_monitores_over.src= host_name + "imagenes/btn-monitores-on.gif";
     
     var link_fotos=new Image(92,26);
     link_fotos.src= host_name + "imagenes/btn-fotos.gif";
     link_fotos_over=new Image(92,26);
     link_fotos_over.src= host_name + "imagenes/btn-fotos-on.gif";
	 
	 var link_videos=new Image(92,26);
     link_videos.src= host_name + "imagenes/btn-videos.gif";
     link_videos_over=new Image(92,26);
     link_videos_over.src= host_name + "imagenes/btn-videos-on.gif";
     
     var link_tienda=new Image(126,26);
     link_tienda.src= host_name + "imagenes/btn-tienda.gif";
     link_tienda_over=new Image(126,26);
     link_tienda_over.src= host_name + "imagenes/btn-tienda-on.gif";

   }

 }
 
function CheckFormulario(obj)
{

	if (obj.tNombre.value == "")
    {
		alert("Debes poner tu nombre para poder continuar");
		obj.tNombre.focus();
        return false;
    }

	if (obj.tApellidos.value == "")
    {
		alert("Debes indicar tu apellido");
		obj.tApellidos.focus();
        return false;
    }

	if (obj.tTelefono.value == "" && obj.tMail.value == "")
    {
		alert("Es necesario que indiques un teléfono o un E-mail de contacto antes de continuar");
		obj.tTelefono.focus();
        return false;
    }

	if (obj.tTexto.value == "")
    {
		alert("No has escrito ningún texto para enviar!");
		obj.tTexto.focus();
        return false;
    }
    
    return true;

} 

function CheckFormularioEspera(obj)
{	
	if(!obj.acepta.checked)
	{
		alert('Debe aceptar las condiciones de alta');		
		return false;
	}
	if (obj.tNombre.value == "")
    {
		alert("Debes poner tu nombre para poder continuar");
		obj.tNombre.focus();
        return false;
    }

	if (obj.tApellidos.value == "")
    {
		alert("Debes indicar tu apellido");
		obj.tApellidos.focus();
        return false;
    }

	if (obj.tTelefono.value == "")
    {
		alert("Es necesario que indiques un teléfono de contacto antes de continuar");
		obj.tTelefono.focus();
        return false;
    }
	if (obj.tNombreCont.value == "")
    {
		alert("Es necesario que indiques el nombre de la persona de contacto");
		obj.tNombreCont.focus();
        return false;
    }
	if (obj.tFecha.value == "")
    {
		alert("Es necesario que indiques tu fecha de nacimiento");
		obj.tFecha.focus();
        return false;
    }
	return true;
}
function CheckFormularioAlta(obj)
{
	if (obj.tNombre.value == "")
    {
		alert("Debes poner tu nombre para poder continuar");
		obj.tNombre.focus();
        return false;
    }
	if (obj.tTelefono.value == "" && obj.tMail.value == "")
    {
		alert("Debes escribir un teléfono o un E-mail de contacto");
		obj.tTelefono.focus();
        return false;
    }
	
	return false();
}

function CheckFormLibro(obj)
{
	if (obj.txtNombre.value == "")
    {
		alert("Debes poner tu nombre para poder continuar");
		obj.txtNombre.focus();
        return false;
    }

	if (obj.txtDirec.value == "")
    {
		alert("Debes indicar tu direccion");
		obj.txtDirec.focus();
        return false;
    }
	if (obj.txtComent.value == "")
    {
		alert("Debes escribir un comentario");
		obj.txtComent.focus();
        return false;
    }
	return true;
}
function CheckReserva(obj)
{

	if (obj.tNombre.value == "")
    {
		alert("Debes poner tu nombre para poder continuar");
		obj.tNombre.focus();
        return false;
    }

	if (obj.tApellidos.value == "")
    {
		alert("Debes indicar tu apellido");
		obj.tApellidos.focus();
        return false;
    }

	if (obj.tDni.value == "")
    {
		alert("Debes indicar tu DNI");
		obj.tDni.focus();
        return false;
    }
    
	if (obj.tEdad.value == "")
    {
		alert("Debes indicar tu edad");
		obj.tEdad.focus();
        return false;
    }
    
	if (obj.tPoblacion.value == "")
    {
		alert("Debes indicar tu población");
		obj.tPoblacion.focus();
        return false;
    }
    
	if (obj.tCodPostal.value == "")
    {
		alert("Debes indicar el código postal");
		obj.tCodPostal.focus();
        return false;
    }
    
	if (obj.tProvincia.value == "")
    {
		alert("Debes indicar tu provincia");
		obj.tProvincia.focus();
        return false;
    }
    
	if (obj.tPais.value == "")
    {
		alert("Debes indicar tu país");
		obj.tPais.focus();
        return false;
    }
    
	if (obj.tTelefono.value == "")
    {
		alert("Debes indicar tu teléfono");
		obj.tTelefono.focus();
        return false;
    }
    
	if (obj.tEmail.value == "")
    {
		alert("Debes indicar tu Email");
		obj.tEmail.focus();
        return false;
    }
    
	if (obj.tPeso.value == "")
    {
		alert("Debes indicar tu peso");
		obj.tPeso.focus();
        return false;
    }
    
	if (obj.tEstatura.value == "")
    {
		alert("Debes indicar tu estatura en centímetros");
		obj.tEstatura.focus();
        return false;
    }

    
	if (obj.tTransporte.value == "")
    {
		alert("Debes indicar como vas a llegar, la hora y la fecha para que podamos recojerte");
		obj.tTransporte.focus();
        return false;
    }
    
    // Si todo ha ido bien, mostramos la barra de proceso
    document.getElementById('td_formulario').style.display='none';   // Ocultamos el formulario
    document.getElementById('td_procesando').style.display='';       // Mostramos la barra de progreso (FAKE!)

	return true;

}



