/* Live Date Script*/
/* © Dynamic Drive*/
/* Software licenced under a modified X11 licence, see documentation or authors website for more details */

function getCurrDate() {
	navvers = navigator.appVersion.substring(0,1);
	if (navvers > 3) {
		navok = true;
	} else {
		navok = false;
	}
	today = new Date;
	jour = today.getDay();
	numero = today.getDate();
	if (numero<10) {
		numero = "0"+numero;
	}
	mois = today.getMonth();
	if (navok) {
		annee = today.getFullYear();
	} else {
		annee = today.getYear();
	}
	TabJour = new Array("dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi");
	TabMois = new Array("janvier","f&eacute;vrier","mars","avril","mai","juin","juillet","aout","septembre","octobre","novembre","d&eacute;cembre");

	sec = today.getSeconds();
	if (sec < 10) {
		sec0 = "0";
	} else {
		sec0 = "";
	}
	min = today.getMinutes();
	if (min < 10) {
		min0 = "0";
	} else {
		min0 = "";
	}
	heure = today.getHours();
	if (heure < 10) {
		heure0 = "0";
	} else {
		heure0 = "";
	}
	messageHeure = heure0 + heure + ":" + min0 + min + ":" + sec0 + sec;

	messageDate  = "Bienvenue ! Nous sommes le " + TabJour[jour] + " " + numero + " " + TabMois[mois] + " " + annee + " il est " + messageHeure;

	return messageDate;
}
function getDateNewsFormat(addDay) {
	var today = new Date();
	var month = today.getMonth()+1;
	var day = today.getDate()+addDay;
	if(day<10) day = "0" + day;
 	if(month<10) month= "0" + month;
 	
 	return day+"/"+month;
}
function getCurrDateNewsFormat() {
	return getDateNewsFormat(0); 	
}
function majCurrDate() {
	document.getElementById("FormatDateTime").innerHTML=getCurrDate();
}
function StopError() {
	return true;
}

function ResizeGeneralBox(new_size) {
	document.getElementById(htmlPresentation).style.height = new_size;
}

window.onerror=StopError;

//Intervalle de mise à jour de la date et de l'heure     
setInterval("majCurrDate()", 1000);

//*************************************************
var markW=0;
var markH=0;
var markX=50;
var markY=50;
var posX,posY,barH,barW=0;
var wMark;
var navDOM;

function loadDialbox(myMessage) {
	try {		
		if(document.all||document.getElementById) {
			up=document.getElementById(htmlDialBox);
			markW=document.getElementById(htmlDialBox).offsetWidth;
			markH=document.getElementById(htmlDialBox).offsetHeight;
		}
		if(document.layers) {
	   		document.all=document;
	   		document.all[htmlDialBox].style=document.all[htmlDialBox];
			markW=document.all[htmlDialBox].width;
			markH=document.all[htmlDialBox].height;
	   	}
		
		wMark=(!document.all)?up.style:document.all[htmlDialBox].style;
		/*
		wMark.width=markW;
		wMark.height=markH;
		*/
		wMark.width=350;
		wMark.height=100;
		
		navDOM=window.innerHeight;
		
		markMe();
		window.onload=markMe;
	} catch(eee) {
		wMark.visibility='visible';
		document.getElementById(htmlDialBoxMess).innerHTML = myMessage;
	}
}

function unloadDialbox() {
	try {
		wMark.visibility='hidden';
	} catch (eee) {}
}

function setVals() {
   barW=barH=0;
   if(navDOM) {
      if(document.height>innerHeight) barW=20;
      if(document.width>innerWidth) barH=20;
   } else {
      innerWidth=document.body.clientWidth;
      innerHeight=document.body.clientHeight;
   }
   posX=((innerWidth-markW)-barW)*(markX/100);
   posY=((innerHeight-markH)-barH)*(markY/100);
}

function wRefresh() {
	wMark.left=posX+(navDOM?pageXOffset:document.body.scrollLeft);
	wMark.top=posY+(navDOM?pageYOffset:document.body.scrollTop);
	wMark.visibility='visible';
}

function markMe(){
   setVals();
   window.onresize=setVals;
   wRefresh();
   //setInterval('wRefresh()',100);
}
