
function valida_modificacionpassword()
{
	if (document.datos.password_act.value=="")
	{
		alert ("Debe introducir la CONTRASEÑA ACTUAL");
	}
	else if (document.datos.password_new.value=="")
	{
		alert ("Debe introducir la NUEVA CONTRASEÑA");
	}
	else if (document.datos.password_new2.value=="")
	{
		alert ("Debe REPETIR la NUEVA CONTRASEÑA");
	}
	else if (document.datos.password_new2.value!=document.datos.password_new.value)
	{
		alert ("Las NUEVAS CONTRASEÑAS no coinciden");
	}
	else
	{
		document.datos.submit();
	}
}


function opiniones_transparente()
{
	jQuery('.opcion_menu_central').fadeTo(0, 0.5);
	jQuery('.opcion_menu_izq').fadeTo(0, 0.5);
	jQuery('.opcion_menu_der').fadeTo(0, 0.5);
	jQuery('#opcion_seleccionada_iz').fadeTo(1, 1);
	jQuery('#opcion_seleccionada_ce').fadeTo(1, 1);
	jQuery('#opcion_seleccionada_de').fadeTo(1, 1);
}

function visitas_borrar()
{
	if (confirm("¿Desea borrar TODAS las Visitas?"))
	{
	location.href="visitas_baja.php";
	}
}

function opiniones_borrar(enlace, codigo)
{
	if (confirm("¿Desea borrar la Opinion de '"+enlace+"'?"))
	{
	location.href="opiniones_baja.php?id="+codigo;
	}
}

function clientes_borrar(enlace, codigo)
{
	if (confirm("¿Desea borrar el Cliente '"+enlace+"'?"))
	{
	location.href="clientes_baja.php?id="+codigo;
	}
}

function borrar_galeria(codigo)
{
	if (confirm("¿Desea borrar la imagen Seleccionada'?"))
	{
	location.href="galeria_baja.php?id="+codigo;
	}
}

function opiniones_alta()
{
	if (document.datos.nombre.value=="")
	{
		alert ("Debe introducir el Nombre");
	}
	else if (document.datos.fecha.value=="")
	{
		alert ("Debe seleccionar la Fecha");
	}
	else if (document.datos.empresa.value=="")
	{
		alert ("Debe introducir la Empresa");
	}
	else if (document.datos.opinion.value=="")
	{
		alert ("Debe introducir la Opinion");
	}
	else
	{
		document.datos.submit();
	}
}

function clientes_alta()
{
	if (document.datos.nombre.value=="")
	{
		alert ("Debe introducir el Nombre");
	}
	else if (document.datos.imagen.value=="")
	{
		alert ("Debe introducir el Logotipo del Cliente");
	}
	else
	{
		document.datos.submit();
	}
}

function clientes_detalle()
{
	if (document.datos.nombre.value=="")
	{
		alert ("Debe introducir el Nombre");
	}
	else
	{
		document.datos.submit();
	}
}

function fechacambia()
{
	document.datos.fecha2.value=document.datos.fecha.value;
}


function valida_formulario()
{
	if (document.presupuesto.nombre.value=="")
	{
		alert ("Debe introducir su Nombre.");
	}
	else if (document.presupuesto.telefono.value=="")
	{
		alert ("Debe introducir su Telefono de Contacto.");
	}
	else if (document.presupuesto.email.value=="")
	{
		alert ("Debe introducir su E-mail de Contacto.");
	}
	else if (document.presupuesto.personas.value=="")
	{
		alert ("Debe introducir el Numero de Personas.");
	}
	else if (document.presupuesto.tmptxt.value=="")
	{
		alert ("Debe introducir el Texto de la Imagen de Seguridad.");
	}
	else
	{
		document.presupuesto.submit();
	}
}


function nueva_imagen()
{
	contador=parseInt(document.datos.contador_imagenes.value);
	contador_new=contador+1;
	var capa=document.getElementById("div_imagenes_"+contador);
	capa.innerHTML="Imagen:&nbsp;&nbsp;&nbsp;<input type='file' name='imagen_"+contador+"' size='40'  onChange='javascript:nueva_imagen();'><br>Top Ten:&nbsp;&nbsp;<select name='topten_"+contador+"'><option value='1'>SI</option><option value='0' selected>NO</option></select><br><br><div id='div_imagenes_"+contador_new+"'></div>";
	document.datos.contador_imagenes.value=contador_new;
}

function esconde_imagen()
{
	jQuery('#derecha_foto_int').fadeOut(1000);
}


function cambia_imagen(imagen_actual)
{
	array_imagenes=document.imagenes_detacadas.txt_imagenes.value.split("----");
	
	total=array_imagenes.length;
	
	imagen_siguiente=imagen_actual+1;
	
	if (imagen_siguiente>(total-1))
	{
		imagen_siguiente=1;	
	}
	
	
	MM_preloadImages(array_imagenes[imagen_siguiente]);
	
	var capa=document.getElementById('derecha_foto_int');
	imagen=array_imagenes[imagen_actual].replace("..",".");
	imagen_grande=imagen.replace("thumbs",".");
	imagen=imagen.replace("thumbs","media");

	//galeria-imagenes-team-building.php
	capa.innerHTML="<a href='"+imagen_grande+"' rel='lightbox' title='Outdoor Madrid - Team Building y Eventos Ludicos de Incentivo para Empresas'><img src='"+imagen+"' alt='Outdoor Madrid - Team Building y Eventos Ludicos de Incentivo para Empresas' border='0'></a>";
	capa.innerHTML="<a href='galeria-imagenes-team-building.php' title='Outdoor Madrid - Team Building y Eventos Ludicos de Incentivo para Empresas'><img src='"+imagen+"' alt='Outdoor Madrid - Team Building y Eventos Ludicos de Incentivo para Empresas' border='0'></a>";
}

function muestra_imagen()
{
	jQuery('#derecha_foto_int').fadeIn(1600);	
}

function navega(imagen_actual)
{
	pausa=1;
	if (imagen_actual>1)
	{
		pausa=900;
		esconde_imagen();
	}
	
		
	//cambia_imagen(imagen_actual);
	window.setTimeout("cambia_imagen("+imagen_actual+");", pausa);
	muestra_imagen();
	pausa=pausa+500;
	
	
	//window.setTimeout("muestra_imagen();", pausa);
	
	pausa=pausa+2500;
	
	
	
	array_imagenes=document.imagenes_detacadas.txt_imagenes.value.split("----");
	
	total=array_imagenes.length;
	imagen_actual=imagen_actual+1;
	
	if (imagen_actual>(total-1))
	{
		imagen_actual=1;	
	}
	
	
	window.setTimeout("navega("+imagen_actual+")", pausa);
	
	
}

function video()
{
	var so = new SWFObject("video_paintball.swf", "mymovie", "321", "279", "8", "");
	so.addParam("menu", "false");
	so.addParam("wmode", "transparent");
	so.write("reproductor_home");
}

function video_big()
{
	var so = new SWFObject("swf/video_paintball.swf", "mymovie", "321", "279", "8", "");
	so.addParam("menu", "false");
	so.addParam("wmode", "transparent");
	so.write("reproductor_home");
}