nereidFadeObjects = new Object();
nereidFadeTimers = new Object();


var onload_functions = new Array();
var onunload_functions = new Array();


function nereidFade(object, destOp, rate, delta){
if (!document.all)
return
    if (object != "[object]"){  
        setTimeout("nereidFade("+object+","+destOp+","+rate+","+delta+")",0);
        return;
    }
        
    clearTimeout(nereidFadeTimers[object.sourceIndex]);
    
    diff = destOp-object.filters.alpha.opacity;
    direction = 1;
    if (object.filters.alpha.opacity > destOp){
        direction = -1;
    }
    delta=Math.min(direction*diff,delta);
    object.filters.alpha.opacity+=direction*delta;

    if (object.filters.alpha.opacity != destOp){
        nereidFadeObjects[object.sourceIndex]=object;
        nereidFadeTimers[object.sourceIndex]=setTimeout("nereidFade(nereidFadeObjects["+object.sourceIndex+"],"+destOp+","+rate+","+delta+")",rate);
    }
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function rand_number(n)
{
	var x;
	x=Math.round(Math.random()*100);
	x%=n;
	return x;
}
function banner()
{
	var img = new Array();
	img[0]='<a href="http://www.parisjo2012.fr/" target="_blank"><img src="imgs/paris2012/escrime.jpg" border=0 alt="Paris 2012 - L\'amour des jeux"></a>';
	img[1]='<a href="http://www.parisjo2012.fr/" target="_blank"><img src="imgs/paris2012/natation.jpg" border=0 alt="Paris 2012 - L\'amour des jeux"></a>';
	img[2]='<a href="http://www.parisjo2012.fr/" target="_blank"><img src="imgs/paris2012/courses.jpg" border=0 alt="Paris 2012 - L\'amour des jeux"></a>';
	img[3]='<a href="http://www.parisjo2012.fr/" target="_blank"><img src="imgs/paris2012/relais.jpg" border=0 alt="Paris 2012 - L\'amour des jeux"></a>';
	var n=rand_number(4); 
	document.write(img[n]);
}


function ChangeUrl(formulaire)
	{
	if (formulaire.ListeUrl.selectedIndex != 0)
		{
		location.href = formulaire.ListeUrl.options[formulaire.ListeUrl.selectedIndex].value;
	 	}
	else 
		{
		alert('Veuillez faire un choix');
		}
	}
	
function emoticon(text) {
	var txtarea = document.post.message;
	text = ' ' + text + ' ';
	if (txtarea.createTextRange && txtarea.caretPos) {
		var caretPos = txtarea.caretPos;
		caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text;
		txtarea.focus();
	} else {
		txtarea.value  += text;
		txtarea.focus();
	}
}

function emoticon1(text) {
	var txtarea = document.guestbook.commentaire;
	text = ' ' + text + ' ';
	if (txtarea.createTextRange && txtarea.caretPos) {
		var caretPos = txtarea.caretPos;
		caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text;
		txtarea.focus();
	} else {
		txtarea.value  += text;
		txtarea.focus();
	}
}




// Check for Browser & Platform for PC & IE specific bits
// More details from: http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html
var clientPC = navigator.userAgent.toLowerCase(); // Get client info
var clientVer = parseInt(navigator.appVersion); // Get browser version

var is_ie = ((clientPC.indexOf('msie') != -1) && (clientPC.indexOf('opera') == -1));
var is_win = ((clientPC.indexOf('win') != -1) || (clientPC.indexOf('16bit') != -1));

var baseHeight;
onload_functions.push('initInsertions()');

/**
* Fix a bug involving the TextRange object. From
* http://www.frostjedi.com/terra/scripts/demo/caretBug.html
*/ 
function initInsertions() 
{
	var doc;

	if (document.forms[form_name])
	{
		doc = document;
	}
	else 
	{
		doc = opener.document;
	}

	var textarea = doc.forms[form_name].elements[text_name];

	if (is_ie && typeof(baseHeight) != 'number')
	{
		textarea.focus();
		baseHeight = doc.selection.createRange().duplicate().boundingHeight;

		if (!document.forms[form_name])
		{
			document.body.focus();
		}
	}
}
/**
* Insert text at position
*/
function insert_text(text, spaces, popup)
{
	var textarea;
	
	if (!popup)
	{
		textarea = document.forms[form_name].elements[text_name];
	}
	else
	{
		textarea = opener.document.forms[form_name].elements[text_name];
	}

	if (spaces)
	{
		text = ' ' + text + ' ';
	}

	if (!isNaN(textarea.selectionStart))
	{
		var sel_start = textarea.selectionStart;
		var sel_end = textarea.selectionEnd;

		mozWrap(textarea, text, '')
		textarea.selectionStart = sel_start + text.length;
		textarea.selectionEnd = sel_end + text.length;
	}	
	
	else if (textarea.createTextRange && textarea.caretPos)
	{
		if (baseHeight != textarea.caretPos.boundingHeight) 
		{
			textarea.focus();
			storeCaret(textarea);
		}
		var caret_pos = textarea.caretPos;
		caret_pos.text = caret_pos.text.charAt(caret_pos.text.length - 1) == ' ' ? caret_pos.text + text + ' ' : caret_pos.text + text;
		
	}
	else
	{
		textarea.value = textarea.value + text;
	}

	if (!popup)
	{
		textarea.focus();
	}

}

/**
* Insert at Caret position. Code from
* http://www.faqts.com/knowledge_base/view.phtml/aid/1052/fid/130
*/
function storeCaret(textEl)
{
	if (textEl.createTextRange)
	{
		textEl.caretPos = document.selection.createRange().duplicate();
	}
}

function PopupCentrer(page,largeur,hauteur,options) {
  var top=(screen.height-hauteur)/2;
  var left=(screen.width-largeur)/2;
  window.open(page,"","top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);
}


function go_to_page_button()
{
	if(liste.destination.selectedIndex == -1) 
		alert('Choisissez une destination !');
	else 
		window.location.href=liste.destination.options[liste.destination.selectedIndex].value;
}


function go_button()
{
	if(liste.destination.options[liste.destination.selectedIndex].value != -1) 
		//alert('Choisissez une destination !');
	//else 
		/*window.location.href='http://www.votre_site.com/repertoire/'+liste.destination.options[liste.destination.selectedIndex].value;*/
		window.location.href=liste.destination.options[liste.destination.selectedIndex].value;
}

function go_button1()
{
	if(liste1.destination1.options[liste1.destination1.selectedIndex].value != -1) 
		//alert('Choisissez une destination !');
	//else 
		/*window.location.href='http://www.votre_site.com/repertoire/'+liste.destination.options[liste.destination.selectedIndex].value;*/
		window.location.href=liste1.destination1.options[liste1.destination1.selectedIndex].value;
}

function go_button2()
{
	if(liste2.destination2.options[liste2.destination2.selectedIndex].value != -1) 
	window.location.href=liste2.destination2.options[liste2.destination2.selectedIndex].value;
}

function go_button3()
{
	if(liste3.destination3.options[liste3.destination3.selectedIndex].value != -1) 
	window.location.href=liste3.destination3.options[liste3.destination3.selectedIndex].value;
}

function go_button4()
{
	if(liste4.destination4.options[liste4.destination4.selectedIndex].value != -1) 
	window.location.href=liste4.destination4.options[liste4.destination4.selectedIndex].value;
}

function go_button5()
{
	if(jeu.destination5.options[jeu.destination5.selectedIndex].value != -1) 
	window.location.href=jeu.destination5.options[jeu.destination5.selectedIndex].value;
}

function go_button6()
{
	if(liste6.destination6.options[liste6.destination6.selectedIndex].value != -1) 
	window.location.href=liste6.destination6.options[liste6.destination6.selectedIndex].value;
}

function go_button7()
{
	if(liste7.destination7.options[liste7.destination7.selectedIndex].value != -1) 
	window.location.href=liste7.destination7.options[liste7.destination7.selectedIndex].value;
}

function process(form)
{
var choix1=form.choix1.options[form.choix1.selectedIndex].value;
var choix2=form.choix2.options[form.choix2.selectedIndex].value;
var adresse=choix1+choix2+".htm";
top.location.href=adresse
}


Maintenant = new Date;
TempMaintenant = Maintenant.getTime();
Future = new Date(2005, 6, 06);
TempFuture = Future.getTime();
DiffSec = Math.floor((TempFuture-TempMaintenant)/1000);
DiffMin = Math.floor(DiffSec/60);
Diffheure = Math.floor(DiffMin/60);
DiffJour = Math.floor(Diffheure/24);
while (DiffMin>=60)
		{
		DiffMin = DiffMin-60;
		}
while (Diffheure>=24)
		{
		Diffheure = Diffheure-24;
		}
while (DiffSec>=60)
		{
		DiffSec = DiffSec-60;
		}
