nombresMes = Array("","Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Aout","Septembre","Octobre","Novembre","Décembre");
var ns4=document.layers;
var ie4=document.all;
var ns6=document.getElementById&&!document.all;
var anoInicial = 1999;
var anoFinal = 2012;
var fecha;
var ano;
var mes;
var dia;
var campoDeRetorno;
var titulo;
var valide;
valide=false;
function diasDelMes(ano,mes) {
if ((mes==1)||(mes==3)||(mes==5)||(mes==7)||(mes==8)||(mes==10)||(mes==12)) dias=31
else if ((mes==4)||(mes==6)||(mes==9)||(mes==11)) dias=30
else if ((((ano % 100)==0) && ((ano % 400)==0)) || (((ano % 100)!=0) && ((ano % 4)==0))) dias = 29
else dias = 28;
return dias;
};
function crearSelectorMes(mesActual) {
var selectorMes = "";
selectorMes = "\r\n";
return selectorMes;
}
function crearSelectorAno(anoActual) {
var selectorAno = "";
selectorAno = "";
return selectorAno;
}
function crearTablaDias(numeroAno,numeroMes)
{
var tabla = "
\r\n
";
var fechaInicio = new Date();
fechaInicio.setYear(numeroAno);
fechaInicio.setMonth(numeroMes-1);
fechaInicio.setDate(1);
ajuste = fechaInicio.getDay();
var tJoursFeries=Array("01/01/2002","01/04/2002","01/05/2002","08/05/2002","09/05/2002","20/05/2002","14/07/2002","15/08/2002","01/11/2002","11/11/2002","25/12/2002","01/01/2003","20/04/2003","21/04/2003","01/05/2003","08/05/2003","29/05/2003","08/06/2003","09/06/2003","14/07/2003","15/08/2003","01/11/2003","11/11/2003","25/12/2003","01/01/2004","11/04/2004","01/05/2004","08/05/2004","20/05/2004","30/05/2004","31/05/2004","14/07/2004","15/08/2004","01/11/2004","11/11/2004","25/12/2004");
var tLibFeries=Array("JOUR DE L'AN","LUNDI DE PAQUES","FETE DU TRAVAIL","ANNIVERSAIRE 1945","ASCENSION","LUNDI DE PENTECOTE","FETE NATIONALE","ASSOMPTION","TOUSSAINT","ARMISTICE 1918","NOEL","JOUR DE L'AN","PAQUES","LUNDI DE PAQUES","FETE DU TRAVAIL","ARMISTICE 1945","ASCENSION","PENTECOTE","LUNDI DE PENTECOTE","FETE NATIONALE","ASSOMPTION","TOUSSAINT","ARMISTICE 1918","NOEL","JOUR DE L'AN","PAQUES","FETE DU TRAVAIL","ARMISTICE","ASCENSION","PENTECOTE","LUNDI DE PENTECOTE","FETE NATIONALE","ASSOMPTION","TOUSSAINT","ARMISTICE 1918","NOEL");
var tJCongres=Array("09/05/2002","11/05/2002","12/05/2002","12/05/2002","07/06/2002","07/06/2002","08/06/2002","08/06/2002","08/06/2002","15/06/2002","22/06/2002","22/06/2002","27/09/2002","28/09/2002","11/10/2002","12/10/2002","12/10/2002","15/11/2002","25/11/2002","30/11/2002","06/12/2002","07/12/2002","10/01/2003","11/01/2003","24/01/2003","09/05/2003","20/10/2005","09/01/2006","06/03/2006","30/03/2007","31/03/2007","29/09/2007","06/12/2007","12/06/2008","11/10/2008","17/01/2009","24/01/2009","31/01/2009","07/02/2009","21/03/2009","06/06/2009");
tabla = tabla + "
Dim
Lun
Mar
Mer
Jeu
Ven
Sam
";
for (var j=1; j<=ajuste; j++)
{
tabla = tabla + "
";
}
for (var i=1; i<=diasDelMes(numeroAno,numeroMes); i++)
{
tabla = tabla + "
";
//tabla = tabla + ">";
//";
if (((i+ajuste) % 7)==0) tabla = tabla + "
";
}
tabla = tabla + "
";
return tabla;
}
function dibujarMes(numeroAno,numeroMes)
{
var html = "";
html = html + "";
html = html +"";
html=html+"" + titulo + "
";
if (ns4){
html = html +'';
html = html +'';
html = html +'';
}
else if (ie4||ns6){
html = html +'';
}
html = html +"";
//}
html = html + "";
ventana = window.open("","Calendrier","width=230,height=220,status=yes,url=yes");
ventana.document.open();
ventana.document.writeln(html);
ventana.document.close();
ventana.focus();
}
function anoHoy()
{
var iAnnee;
annee=this.ccc[2];
if (annee.length>4) annee=annee.substring(0,3);
iAnnee=parseInt(annee);
if (iAnnee<100)
{
if (iAnnee==99)
iAnnee=iAnnee+1900;
else
iAnnee=iAnnee+2000;
}
return iAnnee;
}
function mesHoy() {
//var fecha = new Date(this.ccc[2], this.ccc[1], this.ccc[0]);
//return fecha.getMonth();
var iMois;
if (this.ccc[1].substring(0,1)=="0")
iMois=parseInt(this.ccc[1].substring(1,2));
else
iMois=parseInt(this.ccc[1]);
return iMois;
}
function diaHoy() {
//var fecha = new Date(this.ccc[2], this.ccc[1], this.ccc[0]);
//return fecha.getDate();
return parseInt(this.ccc[0]);
}
function pedirFecha(campoTexto,nombreCampo)
{
fech = campoTexto.value;
if (fech=='')
{
var datejour= new Date();
fech=datejour.getDate()+"/"+(datejour.getMonth()+1)+"/"+datejour.getYear();
}
else {
//alert(fech);
}
var ccc = new Array(3);
this.ccc = this.fech.split("/");
ano = anoHoy();
mes = mesHoy();
dia = diaHoy();
campoDeRetorno = campoTexto;
titulo = nombreCampo;
dibujarMes(ano,mes);
}
function escribirFecha()
{
if (valide)
{
var str=new String;
str=dia;
str=str+' ';
if (str.length<3) {dia="0"+dia;}
str=mes;
str=str+' ';
if (str.length<3) {mes="0"+mes;}
campoDeRetorno.value = dia + "/" + mes + "/" + ano;
}
}
function Change_objet(nNS4,nObjet,nContenu,nLeft,nTop) {
if (ns4) {
document.eval(nNS4).document.eval(nObjet).top=nTop;
document.eval(nNS4).document.eval(nObjet).left=nLeft;
document.eval(nNS4).document.eval(nObjet)
.document.write(nContenu);
document.eval(nNS4).document.close();
document.eval(nNS4).visibility='show'
}
else if (ns6) {
document.getElementById(nObjet).innerHTML = nContenu;
document.getElementById(nObjet).style.left=nLeft;
document.getElementById(nObjet).style.top =nTop;
}
else if (ie4) {
eval(nObjet).innerHTML = nContenu;
eval(nObjet).style.pixelLeft=nLeft;
eval(nObjet).style.pixelTop=nTop;
}
}
function roll(txt)
{
Change_objet('parent','monLayer',txt,1,1)
}