function borrar_textoposicionamiento(id)
{
	if (confirm("¿Desea borrar el registro seleccionado?"))
	{
		location.href="textosposicionamiento_baja.php?id="+id;
	}
}

function verificaemail(email)
{
	var ind1, ind2, ind3;
	ind1 = email.indexOf('@');
	ind2 = email.indexOf('.');
	ind3 = email.lastIndexOf('@');
	ind4 = email.lastIndexOf('.');
	
	if ((ind1<=0) || (ind4<ind1) || (ind3 != ind1))
	return false;
	else
	return true;
}


function verificatelefono(telefono)
{
	if (telefono.length==9)
	{
		if (isNaN(telefono))
		{
			return false;
		}
		else
		{
			return true;
		}
	}
	else
	{
		if (telefono.length!=12)
		{
			return false;
		}
		else
		{
			if (telefono.substr(0,1)!="+")
			{
				return false;
			}
			else
			{
				if (isNaN(telefono.substr(1,11)))
				{
					return false;
				}
				else
				{
					return true;
				}
			}
		}
	}
	
	
}

function solicita_presupuesto()
{
	if (document.datos.nombre.value=="")
	{
		alert ("Debes indicar tu Nombre");
	}
	else if (document.datos.nombre.value=="Nombre")
	{
		alert ("Debes indicar tu Nombre");
	}
	else if (document.datos.num_pax.value=="")
	{
		alert ("Debes indicar el Numero de Personas");
	}
	else if (document.datos.num_pax.value=="Número de Personas")
	{
		alert ("Debes indicar el Numero de Personas");
	}
	else if (document.datos.telefono.value=="")
	{
		alert ("Debes indicar tu Telefono de Contacto");
	}
	else if (document.datos.telefono.value=="Teléfono de Contacto")
	{
		alert ("Debes indicar tu Telefono de Contacto");
	}
	else if (verificatelefono(document.datos.telefono.value)==false)
	{
		alert ("Debes indicar un Telefono de Contacto Correcto");
	}
	else if (document.datos.email.value=="")
	{
		alert ("Debes indicar tu Email de Contacto");
	}
	else if (verificaemail(document.datos.email.value)==false)
	{
		alert ("Debes indicar un Email de Contacto Correcto");
	}
	else if (document.datos.email.value=="E-mail")
	{
		alert ("Debes indicar tu Email de Contacto");
	}
	else
	{
		document.datos.submit();
	}
	
	
}

function valida_opinion()
{
	if (document.datos2.nombre2.value=="")
	{
		alert ("Debes indicar tu Nombre");
	}
	else if (document.datos2.edad.value=="")
	{
		alert ("Debes indicar tu Edad");
	}
	else if (document.datos2.email.value=="")
	{
		alert ("Debes indicar tu E-mail");
	}
	else if (verificaemail(document.datos2.email.value)==false)
	{
		alert ("Debes indicar un Email de Contacto Correcto");
	}
	else if (document.datos2.conocido.value=="")
	{
		alert ("Debes indicar Como nos has Conocido");
	}
	else if (document.datos2.calificacion.value=="0")
	{
		alert ("Debes indicar la Calificacion");
	}
	else if (document.datos2.opinion.value=="")
	{
		alert ("Debes indicar tu Opinion sobre nosotros");
	}
	else
	{
		document.datos2.submit();
	}
	
}

function progressbar()
{
	var capa=document.getElementById("progressbar");
	capa.innerHTML="<center>Cargando video...<br /><br /></center><img src='../img/progreso.gif' />";
}

function visualizarvideo(video)
{
	
	var vdeo=video;
	var so = new SWFObject(vdeo, 'mymovie', '400', '345', '7', '#336699');
	so.addParam('wmode', 'transparent');
	so.addParam('scale', 'noscale');
	so.write('reproductor');
	
}

function rutodromo(){
var capa=document.getElementById("mapa");
capa.innerHTML="<center><img src='../img/comollegar.jpg' border='0'></center>";
}

function animacion(){
var capa=document.getElementById("mapa");
capa.innerHTML="<object border='0' classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' width='393' height='420' id='mapa_carretera' align='middle'><param name='allowScriptAccess' value='sameDomain' /><param name='movie' value='mapa/mapa.swf' /><param name='loop' value='false' /><param name='quality' value='high' /><param name='wmode' value='transparent' /><param name='bgcolor' value='#ffffff' /><embed src='mapa/mapa.swf' loop='false' quality='high' wmode='transparent' bgcolor='#ffffff' width='393' height='420' name='mapa_carretera' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' /></object>";
}

function abreImagen(imagen)
{
	var winattributes="width=800px,height=650px,resizable=no,top=100px,left=150px";
	window.open(imagen,"", winattributes)	
}

function abreImagenRiesgos(imagen)
{
	var winattributes="width=670px,height=400px,resizable=no,top=100px,left=150px";
	window.open(imagen,"", winattributes)	
}

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 borrar_galeria(codigo)
{
	if (confirm ("¿Desea borrar la imagen seleccionada?"))
	{
		location.href="galeria_baja.php?id="+codigo;
	}
}

function video_home()
{
	//var so = new SWFObject("video_paintball.swf", "mymovie", "239", "205", "8", "");
	var so = new SWFObject("video_paintball.swf", "mymovie", "238", "205", "8", "");
	so.addParam("menu", "false");
	so.addParam("wmode", "opaque");
	so.write("reproductor_home");
}