
var e_mail="info"+"@"+"fitecam"+"."+"org";
var e_mailBiz="info"+"@"+"fitecam"+"."+"biz";
var AsuntoBaja="No deseo recibir mas informacion de Fitecam";
var AsuntoInfo="Deseo recibir información de Fitecam";
var AsuntoGral="mensaje web";
var AsuntoBajaCurso="Deseo darme de baja en el curso";
var AsuntoPublicidad="Deseo recibir informarcion sobre como introducir publicidad";

function newWin(wnd,name)
{
var wndOpt='height=700,width=500,scrollbars=yes,dependent=yes,alwaysRaised=yes';
var popw=open(wnd,name,wndOpt);
popw.moveTo(window.screen.availWidth/2,0);
}

function newWinFormularioUsuariosRegistrados(wnd,name)
{
var wndOpt='height=650,width=550,scrollbars=yes,dependent=yes,alwaysRaised=yes';
var popw=open(wnd,name,wndOpt);
popw.moveTo(window.screen.availWidth/2,0);
}

function newWinSized(wnd,name,height,width)
{
var wndOpt='height='+height+',width='+width+',';
wndOpt+='scrollbars=yes,dependent=yes,alwaysRaised=yes';
var popw=open(wnd,name,wndOpt);
popw.moveTo(window.screen.availWidth/2,0);
}

function SendMyMail(Asunto)
{
if ((Asunto=="")||(Asunto==null))
	{window.location="mailto:"+e_mail;}
if (Asunto=="Deseo recibir informarción sobre como meter publicidad")
	{window.location="mailto:"+e_mailBiz+"?subject="+Asunto;}
else
	{window.location="mailto:"+e_mail+"?subject="+Asunto;}
}

function validatedata(df)
{
if (df.e_mail.value=="") {alert("Debe incluir su e_mail"); return false;}
else if (df.Nombre.value=="") {alert("Debe incluir su Nombre"); df.Nombre.focus(); return false;}
else if (df.Apellidos.value=="") {alert("Debe incluir sus Apellidos"); df.Apellidos.focus(); return false;}
else if (df.Provincia.selectedIndex==0) {alert("Debe seleccionar la Provincia"); df.Provincia.focus(); return false;}
return true;
}

function validateCuenta()
{
    var frm = document.forms["dataform"];
     if((frm.Cuenta.value.length == 10) && (frm.Banco.value.length == 4)&& (frm.Oficina.value.length == 4) && (frm.DC.value.length == 2))
    {
        frm.Provincia.value=frm.ProvForm[frm.ProvForm.selectedIndex].text;
        frm.oper.value='anadiendo';
        frm.submit();
    }
    else
    {
        alert("Asegurese de haber iintroducidodo correctamente los datos bancarios.\nEl campo Banco debe tener 4  digitos.\nEl campo Oficina debe tener 4 digitos.\nEl campo DC debe tener 2 digitos.\nEl campo Cuenta debe tener 10 digitos.");
        frm.oper.value='anadir';
        frm.submit();
    }

}

function sendmail(eform, Asunto)
{
if (eform.Nombre.value=="") {alert("Debe incluir su Nombre"); eform.Nombre.focus(); return false;}
else if (eform.Apellidos.value=="") {alert("Debe incluir sus Apellidos"); eform.Apellidos.focus(); return false;}
else if (eform.Provincia.selectedIndex==0) {alert("Debe seleccionar la Provincia"); eform.Provincia.focus(); return false;}
else
	{
	window.location="mailto:"+e_mail+"?subject="+Asunto+"&body="+eform.Nombre.value+", "+eform.Apellidos.value+", "+
				eform.Empresa.value+", "+eform.Provincia.value+", "+eform.Asociado.value+", "+eform.Comentarios.value;
	}

alert("Sus datos se han enviado correctamente");
return true;
}

function focusFirst()
{
if ((document.forms.length>0) && (document.forms[0].elements.length>0))
	{document.forms[0].elements[0].focus();}
}

function contador(frm,campo)
{
    if (campo.value.length==campo.maxLength)
    {
        next=campo.tabIndex+1;
        for(i=0;i<frm.elements.length;i++)
        {
            if(frm.elements[i].tabIndex==next)
            {frm.elements[i].focus();}
        }
    }
}

function confirmSubmit()
{
    var agree=confirm("¿Esta seguro?");
    if (agree) return true;
    else return false ;
}

// -- Tooltips

var theObj="";
function toolTip(text,me) 
{
   theObj=me;
   theObj.onmousemove=updatePos;
   document.getElementById('toolTipBox').innerHTML=text;
   document.getElementById('toolTipBox').style.display="block";
   window.onscroll=updatePos;
  }
function updatePos() 
{
  var ev=arguments[0]?arguments[0]:event;
  var x=ev.clientX;
  var y=ev.clientY;
  diffX=5;
  diffY=0;
  document.getElementById('toolTipBox').style.top  = y-2+diffY+document.body.scrollTop+ "px";
  document.getElementById('toolTipBox').style.left = x-2+diffX+document.body.scrollLeft+"px";
  theObj.onmouseout=hideMe;
}                                                

function hideMe() 
{
  document.getElementById('toolTipBox').style.display="none";
}

// -- Tooltips


/*
function contador(campo,limite)
{
    var frm = document.forms["dataform"];
    if(campo=='Banco')
    {
        if (frm.Banco.value.length > limite)
            frm.Banco.value = frm.Banco.value.substring(0, limite);
    }
    if(campo=='Oficina')
    {
        if (frm.Oficina.value.length > limite)
            frm.Oficina.value = frm.Oficina.value.substring(0, limite);
    }
    if(campo=='DC')
    {
        if (frm.DC.value.length > limite)
            frm.DC.value = frm.DC.value.substring(0, limite);
    }
    if(campo=='Cuenta')
    {
        if (frm.Cuenta.value.length > limite)
            frm.Cuenta.value = frm.Cuenta.value.substring(0, limite);
    }
}
*/
