
var scrtxt = "Bienvenue sur boîtesdenuit.ca!  "; //texte de la statusbar
var length = scrtxt.length;
var width = 100;
var position = -(width + 2);

function test()
{
	alert("Function running well!.")
}
function scroll()
{
	position++;
	var scroller = "";
	if (position == length)
		position = -(width + 2);
	if (position < 0)
	{
	    for (var i = 1; i <= Math.abs(position); i++)
	      	scroller = scroller + " ";

	    scroller = scroller + scrtxt.substring(0, width - i + 1);
	}
	else
		scroller = scroller + scrtxt.substring(position, width + position);

	window.status = scroller;  //assigner le texte à la statusbar
	setTimeout("scroll()", 75);  //rappel de la fonction toutes les 130 milliseconds
}
function popUpConcours(URL)
{
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1,width=480,height=530,left = 62,top = 59');");
}
function popUpDetails(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 popUp(URL)
{
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1,width=390,height=400,left = 62,top = 59');");
}
function popUp2(URL)
{
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1,width=440,height=500,left = 62,top = 59');");
}
function popUp44(URL)
{
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1,width=850,height=550,left = 62,top = 59');");
}
function popUp4(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 popUp8(URL)
{
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1,width=595,height=500,left = 1,top = 1');");
}
function popUp88(URL)
{
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1,width=925,height=500,left = 1,top = 1');");
}
function popUp7(URL)
	{
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1,width=595,height=500,left = 1,top = 1');");
}
function popUpD7(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 popUpD8(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 pop_it(the_form)
{
   my_form = eval(the_form)
   window.open("wait.php", "popup", "height=570,width=810,menubar=0,toolbar=0,location=0,status=1,scrollbars=1, resizable=1");
   my_form.target = "popup";
   my_form.submit();
}
function pop_it2(the_form)
{
   my_form = eval(the_form)
   window.open("wait.php", "popup2", "height=580,width=780,menubar=0,toolbar=0,location=0,status=1, scrollbars=1, resizable=1");
   my_form.target = "popup2";
   my_form.submit();
}

// POP-UP PARAMÉTRÉ DES IMAGES
function afficheMaxi(chemin)
{
    i1 = new Image();
    i1.src = chemin;

    html = '<HTML><HEAD><TITLE>Logo</TITLE></HEAD><BODY LEFTMARGIN=0 MARGINWIDTH=0 TOPMARGIN=0 MARGINHEIGHT=0 body bgcolor="#360002"><CENTER><IMG SRC="'+chemin+'" BORDER=0 NAME=imageTest onLoad="window.resizeTo(document.imageTest.width+29,document.imageTest.height+62)"></CENTER></BODY></HTML>';
    popupImage = window.open('','_blank','toolbar=0,location=0,directories=0,menuBar=0,scrollbars=1,resizable=1, width=500, height=375, left=250, top=125');
    popupImage.document.open();
    popupImage.document.write(html);
    popupImage.document.close()
}
function afficheMaxi2(chemin)
{
    i1 = new Image();
    i1.src = chemin;

    html = '<HTML><HEAD><TITLE>Logo</TITLE></HEAD><BODY LEFTMARGIN=0 MARGINWIDTH=0 TOPMARGIN=0 MARGINHEIGHT=0 body bgcolor="#360002"><CENTER><IMG SRC="'+chemin+'" WIDTH=450 BORDER=0 NAME=imageTest onLoad="window.resizeTo(document.imageTest.width+29,document.imageTest.height+62)"></CENTER></BODY></HTML>';
    popupImage = window.open('','_blank','toolbar=0,location=0,directories=0,menuBar=0,scrollbars=1,resizable=1, width=500, height=375, left=250, top=125');
    popupImage.document.open();
    popupImage.document.write(html);
    popupImage.document.close()
}

// =======================================
// Le code suivant va apprendre la balise blink à IE
function blink_show()
{
	if(document.all.tags('blink'))
	{
		blink_tags  = document.all.tags('blink');
		blink_count = blink_tags.length;
		for ( i = 0; i < blink_count; i++ )
		{
			blink_tags[i].style.visibility = 'visible';
		}
		window.setTimeout( 'blink_hide()', 700 );
	}
}
function blink_hide()
{
	if(document.all.tags('blink'))
	{
		blink_tags  = document.all.tags('blink');
		blink_count = blink_tags.length;
		for ( i = 0; i < blink_count; i++ )
		{
			blink_tags[i].style.visibility = 'hidden';
		}
		window.setTimeout( 'blink_show()', 250 );
	}
}

if(document.all)
	window.onload = blink_show;

// =======================================

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_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_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];}
}
