// inici imatges enllaços
function FP_preloadImgs() {//v1.0
 var d=document,a=arguments; if(!d.FP_imgs) d.FP_imgs=new Array();
 for(var i=0; i<a.length; i++) { d.FP_imgs[i]=new Image; d.FP_imgs[i].src=a[i]; }
}

function FP_swapImg() {//v1.0
 var doc=document,args=arguments,elm,n; doc.$imgSwaps=new Array(); for(n=2; n<args.length;
 n+=2) { elm=FP_getObjectByID(args[n]); if(elm) { doc.$imgSwaps[doc.$imgSwaps.length]=elm;
 elm.$src=elm.src; elm.src=args[n+1]; } }
}

function FP_getObjectByID(id,o) {//v1.0
 var c,el,els,f,m,n; if(!o)o=document; if(o.getElementById) el=o.getElementById(id);
 else if(o.layers) c=o.layers; else if(o.all) el=o.all[id]; if(el) return el;
 if(o.id==id || o.name==id) return o; if(o.childNodes) c=o.childNodes; if(c)
 for(n=0; n<c.length; n++) { el=FP_getObjectByID(id,c[n]); if(el) return el; }
 f=o.forms; if(f) for(n=0; n<f.length; n++) { els=f[n].elements;
 for(m=0; m<els.length; m++){ el=FP_getObjectByID(id,els[n]); if(el) return el; } }
 return null;
}

// fi imatges enllaços

function clic(i){
  var navegador = navigator.appName; 
  if (navegador == "Microsoft Internet Explorer"){ 	 
     if (event.button==2) 
		 		alert("ContaGratis.com");
  } else {
		 		document.oncontextmenu = new Function("return false");
	}
}	

function BarraEstat() {
	var txt = 'ContaGratis.com';
	window.status = txt;
}

function preferits(){
  if (navigator.appName == "Microsoft Internet Explorer"){
		 window.external.AddFavorite("http://www.contagratis.com","ContaGratis.com: Contabilidad Gratis.");	
  } else {alert("Para añadir esta página a Marcadores o Bookmarks pulsa [Ctrl][D]."); }				
}	


function subs_enviar(){			// subscripció
  if (document.forms.Subs.Correu.value.length==0) {
    	alert('Por favor, introduzca su dirección de correo electrónico.');
    	document.forms.Subs.Correu.focus();
  } else if (document.forms.Subs.Correu.value.length>0){
      var Byte="";
      var Arroba=0;
      var Punto=0;
      for (var i=0;i<document.forms.Subs.Correu.value.length;i++) {
        Byte=document.forms.Subs.Correu.value.substring(i,i+1);
        if(Byte=="@")
          Arroba=Arroba+1;
        if (Byte==".")
          Punto=Punto+1;  
      }
      if (Arroba!=1 || Punto==0) {
        alert ("La dirección de e-mail no es correcta.");
        document.forms.Subs.Correu.focus();  
      } else {
				if (Arroba==1 && Punto>0) {
					 document.forms.Subs.submit();
				}
			}
  }
}	



document.onselectstart=new Function ('return false');
document.onmousedown=clic;
document.onmouseover=BarraEstat;
document.onmousemove=BarraEstat;

