// JavaScript Document

var empezar = false
var ancla = "ancla"
var capas = new Array("c1")
var retardo 
var ocultar

	function muestra_enviar()
	{ 
	   xShow('ampliacion'); 
	} 
	function cerrar_ampliacion()
	{ 
		xHide('ampliacion'); 
	}


if (top.location != self.location)top.location = self.location;
	ns=document.layers
	ie=document.all
function esconde() {
  if (ie) precarga.style.visibility="hidden";
  if(ns) document.pregarga.visibility="hide";
}
if(ie || ns) document.write('<div id="precarga" style="padding-left:330"><img src="images/cargando.gif"></div>');

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_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

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 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];}
}




var xVersion='3.15.2',xNN4,xOp7,xOp5or6,xIE4Up,xIE4,xIE5,xMac,xUA=navigator.userAgent.toLowerCase();
if (window.opera){
  xOp7=(xUA.indexOf('opera 7')!=-1 || xUA.indexOf('opera/7')!=-1);
  if (!xOp7) xOp5or6=(xUA.indexOf('opera 5')!=-1 || xUA.indexOf('opera/5')!=-1 || xUA.indexOf('opera 6')!=-1 || xUA.indexOf('opera/6')!=-1);
}
else if (document.all && xUA.indexOf('msie')!=-1) {
  xIE4Up=parseInt(navigator.appVersion)>=4;
  xIE4=xUA.indexOf('msie 4')!=-1;
  xIE5=xUA.indexOf('msie 5')!=-1;
}
else if (document.layers) {xNN4=true;}
xMac=xUA.indexOf('mac')!=-1;

function xGetElementById(e) {
  if(typeof(e)!='string') return e;
  if(document.getElementById) e=document.getElementById(e);
  else if(document.all) e=document.all[e];
  else e=null;
  return e;
}
function xParent(e,bNode){
  if (!(e=xGetElementById(e))) return null;
  var p=null;
  if (!bNode && xDef(e.offsetParent)) p=e.offsetParent;
  else if (xDef(e.parentNode)) p=e.parentNode;
  else if (xDef(e.parentElement)) p=e.parentElement;
  return p;
}
function xDef() {
  for(var i=0; i<arguments.length; ++i){if(typeof(arguments[i])=='undefined') return false;}
  return true;
}
function xStr(s) {
  for(var i=0; i<arguments.length; ++i){if(typeof(arguments[i])!='string') return false;}
  return true;
}
function xNum(n) {
  for(var i=0; i<arguments.length; ++i){if(typeof(arguments[i])!='number') return false;}
  return true;
}
function xShow(e) {
  if(!(e=xGetElementById(e))) return;
  if(e.style && xDef(e.style.visibility)) e.style.visibility='visible';
}
function xHide(e) {
  if(!(e=xGetElementById(e))) return;
  if(e.style && xDef(e.style.visibility)) e.style.visibility='hidden';
}
function xZIndex(e,uZ) {
  if(!(e=xGetElementById(e))) return 0;
  if(e.style && xDef(e.style.zIndex)) {
    if(xNum(uZ)) e.style.zIndex=uZ;
    uZ=parseInt(e.style.zIndex);
  }
  return uZ;
}
function xMoveTo(e,iX,iY) {
  xLeft(e,iX);
  xTop(e,iY);
}
function xLeft(e,iX) {
  if(!(e=xGetElementById(e))) return 0;
  var css=xDef(e.style);
  if (css && xStr(e.style.left)) {
    if(xNum(iX)) e.style.left=iX+'px';
    else {
      iX=parseInt(e.style.left);
      if(isNaN(iX)) iX=0;
    }
  }
  else if(css && xDef(e.style.pixelLeft)) {
    if(xNum(iX)) e.style.pixelLeft=iX;
    else iX=e.style.pixelLeft;
  }
  return iX;
}
function xTop(e,iY) {
  if(!(e=xGetElementById(e))) return 0;
  var css=xDef(e.style);
  if(css && xStr(e.style.top)) {
    if(xNum(iY)) e.style.top=iY+'px';
    else {
      iY=parseInt(e.style.top);
      if(isNaN(iY)) iY=0;
    }
  }
  else if(css && xDef(e.style.pixelTop)) {
    if(xNum(iY)) e.style.pixelTop=iY;
    else iY=e.style.pixelTop;
  }
  return iY;
}
function xOffsetLeft(e) {
  if (!(e=xGetElementById(e))) return 0;
  if (xDef(e.offsetLeft)) return e.offsetLeft;
  else return 0;
}
function xOffsetTop(e) {
  if (!(e=xGetElementById(e))) return 0;
  if (xDef(e.offsetTop)) return e.offsetTop;
  else return 0;
}

function Validar_Email(EmailCampo, NombreEmail)
{
	var Email = document.all[EmailCampo].value;
	var cadena = "Dirección de correo " + NombreEmail + " es no válida: " + Email + "\n" + "Por favor, introduzca la dirección correcta";
	if( Email.indexOf('@',0) <= 0  || Email.indexOf(',',0) != -1
   		|| Email.indexOf(' ',0) != -1 || Email.indexOf('/',0) != -1
   		|| Email.indexOf(';',0) != -1 || Email.indexOf('<',0) != -1
   		|| Email.indexOf('>',0) != -1 || Email.indexOf('*',0) != -1
   		|| Email.indexOf('|',0) != -1 || Email.indexOf('`',0) != -1
   		|| Email.indexOf('&',0) != -1 || Email.indexOf('$',0) != -1
   		|| Email.indexOf('!',0) != -1 || Email.indexOf('"',0) != -1
   		|| Email.indexOf(':',0) != -1 || Email.indexOf('.',0) <= 0 )
	{ alert(cadena); return false; }
	else return true;
}

function Validar() {
  	var Campo1 = "nombre";
  	var CampoTexto1 = "Tu Nombre";
  	var Campo2 = "emailRtte";
  	var CampoTexto2 = "Tu E-Mail";
  	var Campo3 = "emailDesti";
  	var CampoTexto3 = "E-mail Destinatario";

	
	if (
    Validar_CampoNoNulo(Campo1, CampoTexto1) 
	&& Validar_Email(Campo2, CampoTexto2)
	&& Validar_Email(Campo3, CampoTexto3) 
	)
	{
		return true
	}
	else
	{
		return false
	}
}
function ValidarContactenos() {
  	var Campo1 = "nombre";
  	var CampoTexto1 = "Nombre";
  	var Campo2 = "emailRtte";
  	var CampoTexto2 = "E-Mail";
	var Campo3 ="comentario"
  	var CampoTexto3 = "Comentario";

	
	if (
    Validar_CampoNoNulo(Campo1, CampoTexto1) 
	&& Validar_Email(Campo2, CampoTexto2)
	&& Validar_CampoNoNulo(Campo3, CampoTexto3)
	)
	{
		return true
	}
	else
	{
		return false
	}
}

function Validar_CampoNoNulo(Campo, NombreCampo){
  	
  	var cadena = "Debe ingresar un valor no nulo en: " + NombreCampo;
  
	var campovalor = document.all[Campo].value;
	
	if (campovalor != "")
		{ return true; }
	else
		{alert(cadena);
		document.all[Campo].focus(); 
		return false;}

}

