var d = document;
var ns = d.layers;
var app = navigator.appVersion;
var tresholdWidth = 985;
var tresholdHeight = 610;

window.onload = function(){ AdjustWidth( ); setTimeout("ap_showWaitMessage('waitDiv', 0);", 1000); }
window.onresize = function(){ AdjustWidth( ); }

/*WaitBox Script Begin*/
var DHTML = (document.getElementById || document.all || document.layers);

function ap_getObj(name)
{
	if (document.getElementById) { return document.getElementById(name).style; }
	else if (document.all) { return document.all[name].style; }
	else if (document.layers) { return document.layers[name]; }
}
function ap_showWaitMessage(div, flag)
{
	if (!DHTML) 
		return; 
	var x = ap_getObj(div); x.visibility = (flag) ? 'visible':'hidden';
	
	if( !document.getElementById) 
		if(document.layers) 
			x.left=280/2; 
			
	return true;
}
ap_showWaitMessage('waitDiv',1);

function AdjustWidth( )
{	
	var w = 0;
	var h = 0;
	if (document.all)
	{
		if (document.compatMode && document.compatMode != "BackCompat")
		{
			w = document.documentElement.clientWidth;
	     	h = document.documentElement.clientHeight;
		}
		else
		{
			w = document.body.clientWidth;
			h = document.body.clientHeight;
		}
	}
	else
	{
		w = window.innerWidth;
		h = window.innerHeight;
	}

	if( w < tresholdWidth )
	{
		var s = ap_getObj("texte_defilant");
		s.display = "none";
		
		var s = ap_getObj("copyright_center");
		s.display = "block";
		var s = ap_getObj("copyright_left");
		s.display = "none";
		
		var s = ap_getObj("table_semo");
		s.marginLeft = "auto";
	}
	else
	{
		var s = ap_getObj("texte_defilant");
		s.display = "block";
		
		var s = ap_getObj("copyright_center");
		s.display = "none";
		var s = ap_getObj("copyright_left");
		s.display = "block";
	
		var s = ap_getObj("table_semo");
		
		s.marginLeft = "7px";
		s.marginRight = "auto";
	}
	/*
	if(h > tresholdHeight)
	{
		var s = ap_getObj("main_frame");
		s.height = eval((h - tresholdHeight) + 385) + "px";
	}*/
}

//Fonction tableau compatible JavaScript 1.0
function months()
{
	this[0]		= "janvier";
	this[1]		= "février";
	this[2]		= "mars";
	this[3]		= "avril";
	this[4]		= "mai";
	this[5]		= "juin";
	this[6]		= "juillet";
	this[7]		= "août";
	this[8]		= "septembre";
	this[9]		= "octobre";
	this[10]	= "novembre";
	this[11]	= "décembre";
}

//Fonction tableau compatible JavaScript 1.0
function days()
{
	this[0] = "Dimanche";
	this[1] = "Lundi";
	this[2] = "Mardi";
	this[3] = "Mercredi";
	this[4] = "Jeudi";
	this[5] = "Vendredi";
	this[6] = "Samedi";
}

function get_date()
{
	var mois 		= new months();
	var jour 		= new days();
	var time 		= new Date();
	var fr_jour_s 	= jour[time.getDay()];	//Jour de la semaine
	var jour_m 		= time.getDate();	//Jour du mois
	var fr_mois 	= mois[time.getMonth()]; //le mois
	var annee 		= time.getFullYear();// annee de forme XXXX
	
	return fr_jour_s + " le " + jour_m + " " + fr_mois + " " + annee;
}
