function FNenviarVar(peli,variable,args){
//   var sendText = args.value;
//	alert(args +" _ "+peli+" _ "+variable);
   eval("window.document."+peli).SetVariable(variable.toString(), args);
   
}

function FNpopup(p_url,p_id,p_ancho,p_alto,p_carac){
	car="width="+p_ancho+",height="+p_alto+",left="+((screen.width/2)-(parseInt(p_ancho)/2))+",top="+((screen.height/2)-(parseInt(p_ancho)/2))+","+p_carac
	window.open(p_url,p_id,car)
}

function FNprecargaIMG() {
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=FNprecargaIMG.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 FNrestaura_img() {
  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 FNbusca_obj(n, d) {
  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=FNbusca_obj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function FNintercambia_img() {
  var i,j=0,x,a=FNintercambia_img.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=FNbusca_obj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
FNprecargaIMG('img/cab/mp1.gif')
FNprecargaIMG('img/cab/mp2.gif')
FNprecargaIMG('img/cab/mp3.gif')
FNprecargaIMG('img/cab/mp4.gif')


function FNvalidar(formulario){
	form_ok=true
	msg=""
	n=0;while(formulario[n]){
		nombres_campo=formulario[n].name
		c_campo=eval("formulario."+nombres_campo)
		switch (nombres_campo){
			case "t_nombre_e":
					if(c_campo.value==""){;form_ok=false;msg+="· 'Tu nombre'\n"}
					break;
			case "t_mail_e":
					if(c_campo.value=="" || c_campo.value.indexOf("@")==-1){;form_ok=false;msg+="· 'Tu e-mail'\n"}
					break;
			case "t_nombre_r":
					if(c_campo.value==""){;form_ok=false;msg+="· 'Nombre del destinatario'\n"}
					break;
			case "t_mail_r":
					if(c_campo.value=="" || c_campo.value.indexOf("@")==-1){;form_ok=false;msg+="· 'E-mail del destinatario'\n"}
					break;
			default:
		}
		n++
	}
	if(!form_ok){
		alert("Para utilizar este servicio debes rellenar correctamente los siguientes campos:\n\n"+msg)
	}else{
		formulario.submit()
	}
//return (form_ok)
}

