//npl.js ----- Versió 25-01-06 Nascuts per llegir | Mod. David Maniega -----

function linkexterno() { 
 if (!document.getElementsByTagName) return; 
 var anchors = document.getElementsByTagName("a"); 
 for (var i=0; i<anchors.length; i++) { 
   var anchor = anchors[i]; 
   if (anchor.getAttribute("href") && 
       anchor.getAttribute("rel") == "external") 
     anchor.target = "_blank"; 
 } 
} 
window.onload = linkexterno;


function posadata(){
data = new Date();
Mes = data.getMonth();
mesos = new Array ("de gener","de febrer","de mar&ccedil;","d'abril","de maig","de juny","de juliol","d'agost","de setembre","d'octubre","de novembre","de desembre");
Dia = data.getDay();
if (Dia == 0) DiaN = "Diumenge, ";
else{   if (Dia == 1) DiaN = "Dilluns, ";
else{   if (Dia == 2) DiaN = "Dimarts, ";
else{   if (Dia == 3) DiaN = "Dimecres, ";
else{   if (Dia == 4) DiaN = "Dijous, ";
else{   if (Dia == 5) DiaN = "Divendres, ";
else{   if (Dia == 6) DiaN = "Dissabte, ";
}}}}}}
var any = data.getYear();
if (any < 2000) 
any = any + 1900;
document.write( DiaN + data.getDate() + "&nbsp;" + mesos[Mes] + "&nbsp;de&nbsp;" + any + "&nbsp;&nbsp;&nbsp;");
}

function copyr() {
dades = new Date();
var anycurs = dades.getYear();
if (anycurs < 2000) 
anycurs = anycurs + 1900;
document.write(anycurs);
}

function ExplorerFix() {
for (a in document.links) document.links[a].onfocus = document.links[a].blur; }
if (document.all) {
document.onmousedown = ExplorerFix; 
}

function getWinNm() {
  var now = new Date();
  var hr = new String(now.getHours());
  var mn = new String(now.getMinutes());
  var sc = new String(now.getSeconds());
  var winNm = hr + mn + sc;
  return winNm;
}

function mouseOver(quin) {
self.status=quin;
}

function mouseOut() {
self.status="Nascuts per llegir";
}

function imprime(){
bV = parseInt(navigator.appVersion)
if (bV >= 4) window.print()
}

function doPDF(pdf,ti){
	var x = 750;
	var y = 550;
	var ah = screen.availHeight - 30;
    var aw = screen.availWidth - 10;
    var posx = (aw - x) / 2;
    var posy = (ah - y) / 2;
	mem=pdf;
	tituloi=ti;
	features = "resizable=1,width="+x+",height="+y+",screenX="+posx+",screenY="+posy+",left="+posx+",top="+posy;	
	window.open("http://www.nascutsperllegir.org/pdf.html",x+y,features);
}

function doNPL(url){
	var x = 700;
	var y = 500;
	var ah = screen.availHeight - 30;
    var aw = screen.availWidth - 10;
    var posx = (aw - x) / 2;
    var posy = (ah - y) / 2;
	var winNm = getWinNm();
	var cgi = 'http://www.nascutsperllegir.org/' + url;
	var recurs = window.open(cgi, 
winNm,'resizable=1,toolbar=1,location=0,directories=0,status=1,menubar=0,scrollbars=1,width='+x+',height='+y+',left='+posx+',top='+posy+'');
}

function doPILOT(url){
	var x = 400;
	var y = 400;
	var ah = screen.availHeight - 30;
    var aw = screen.availWidth - 10;
    var posx = (aw - x) / 2;
    var posy = (ah - y) / 2;
	var winNm = getWinNm();
	var cgi = 'http://www.nascutsperllegir.org/pilots/' + url;
	var recurs = window.open(cgi, 
winNm,'resizable=0,toolbar=1,location=0,directories=0,status=1,menubar=0,scrollbars=1,width='+x+',height='+y+',left='+posx+',top='+posy+'');
}

function darrercanvi() {
ultimcanvi = new Date(document.lastModified) 
mes = ultimcanvi.getMonth() + 1
dia = ultimcanvi.getDate()
if (dia<10) {dia = "0" + dia}
if (mes<10) {mes = "0" + mes}

any = ultimcanvi.getYear()
if (any < 2000) 
any = any + 1900;
document.writeln(dia + "/" + mes + "/" + any) 
}

function colorA(src,color_entrada) {
src.bgColor=color_entrada;
src.style.cursor="hand";
}

function colorB(src,color_default) {
src.bgColor=color_default;
src.style.cursor="default";
}