//======Tool Tip Routine======
// Tool Tip routine
// Insert within BODY tag: onmousemove="overhere()"    >>>Ex: <body onmousemove="overhere()" .....>
// Insert just after BODY tag: <div id="ToolTip"></div>
// Add wihtin the HREF A tag: 
//   onMouseover="EnterContent('ToolTip','Ici va le Titre','Ici va le Texte'); Activate();" onMouseout="deActivate()"
// The " ' " as in l'organisation, remplacez par: &#96;
// Within the text can be inserted: <br>, <b></b>, <u></u>, etc...

var ie = document.all ? 1 : 0
var ns = document.layers ? 1 : 0

if(ns){doc = "document."; sty = ""}
if(ie){doc = "document.all."; sty = ".style"}

var initialize = 0
var Ex, Ey, topColor, subColor, ContentInfo

if(ie){
Ex = "event.x"
Ey = "event.y"

topColor = "#808080"
subColor = "#E0E0E0"
}

if(ns){
Ex = "e.pageX"
Ey = "e.pageY"
window.captureEvents(Event.MOUSEMOVE)
window.onmousemove=overhere

topColor = "#808080"
subColor = "#C0C0C0"
}

function MoveToolTip(layerName, FromTop, FromLeft, e){
if(ie){eval(doc + layerName + sty + ".top = "  + (eval(FromTop) + document.body.scrollTop))}
if(ns){eval(doc + layerName + sty + ".top = "  +  eval(FromTop))}
eval(doc + layerName + sty + ".left = " + (eval(FromLeft) + 15))
}

function ReplaceContent(layerName){
if(ie){document.all[layerName].innerHTML = ContentInfo}
if(ns){
with(document.layers[layerName].document) 
{ 
   open(); 
   write(ContentInfo); 
   close(); 
}
}
}

function Activate(){initialize=1}
function deActivate(){initialize=0}

function overhere(e){
if(initialize){

MoveToolTip("ToolTip", Ey, Ex, e)
eval(doc + "ToolTip" + sty + ".visibility = 'visible'")
}

else{
MoveToolTip("ToolTip", 0, 0)
eval(doc + "ToolTip" + sty + ".visibility = 'hidden'")
}
}

function EnterContent(layerName, TTitle, TContent){

ContentInfo = '<table border="0" width="260" cellspacing="0" cellpadding="0">'+
'<tr><td width="100%" bgcolor="#000000">'+

'<table border="0" width="100%" cellspacing="1" cellpadding="0">'+
'<tr><td width="100%" bgcolor='+topColor+'>'+

'<table border="0" width="90%" cellspacing="0" cellpadding="0" align="center">'+
'<tr><td width="100%">'+

'<font class="tooltiptitle">&nbsp;'+TTitle+'</font>'+

'</td></tr>'+
'</table>'+

'</td></tr>'+

'<tr><td width="100%" bgcolor='+subColor+'>'+

'<table border="0" width="90%" cellpadding="0" cellspacing="1" align="center">'+

'<tr><td width="100%">'+

'<font class="tooltipcontent">'+TContent+'</font>'+

'</td></tr>'+
'</table>'+

'</td></tr>'+
'</table>'+

'</td></tr>'+
'</table>';

ReplaceContent(layerName)

}
//======END OF Tool Tip Routine======

//======Input character validations======
	function ckInputSpec(thechar)  //Allow only specific mentioned characters
	{
	var entry=String.fromCharCode(event.keyCode)
	if (thechar.indexOf(entry.charAt(0)) < 0) event.returnValue = false;
	}
	
	function ckInputAlphaNum()  //Allow only letters and numbers
	{
	var entry=String.fromCharCode(event.keyCode)
	if ('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'.indexOf(entry.charAt(0)) < 0) event.returnValue = false;
	}
	
	function ckInputAlpha()  //Allow only letters
	{
	var entry=String.fromCharCode(event.keyCode)
	if ('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.indexOf(entry.charAt(0)) < 0) event.returnValue = false;
	}
	
	function ckInputNum()  //Allow only numbers
	{
	var entry=String.fromCharCode(event.keyCode)
	if ('0123456789'.indexOf(entry.charAt(0)) < 0) event.returnValue = false;
	}
//======END OF Input character validation======

//======Validation of Canadian Postal Code======
	function ckPostalA()  //First part of Canadian Postal Code
	{
	var entry=FrontPage_Form1.postal1.value + String.fromCharCode(event.keyCode)
	if ('ABCDEFGHJKLMNPQRSTUVWXYZabcdefghjklmnpqrstuvwxyz'.indexOf(entry.charAt(0)) < 0) event.returnValue = false;
	if ('0123456789'.indexOf(entry.charAt(1)) < 0) event.returnValue = false;
	if ('ABCDEFGHJKLMNPQRSTUVWXYZabcdefghjklmnpqrstuvwxyz'.indexOf(entry.charAt(2)) < 0) event.returnValue = false;
	}
	
	function ckPostalB()  //Second part of Canadian Postal Code
	{
	var entry=FrontPage_Form1.postal2.value + String.fromCharCode(event.keyCode)
	if ('0123456789'.indexOf(entry.charAt(0)) < 0) event.returnValue = false;
	if ('ABCDEFGHJKLMNPQRSTUVWXYZabcdefghjklmnpqrstuvwxyz'.indexOf(entry.charAt(1)) < 0) event.returnValue = false;
	if ('0123456789'.indexOf(entry.charAt(2)) < 0) event.returnValue = false;
	}
//======END OF Validation of Canadian Postal Code======

//======Format and show Dates======
	function getDateWithSuffix(i, L)
	{
		var suffixVar = "";
		//English
		if (L == 0)
			if (i==1) suffixVar = "st";
			else if (i==21) suffixVar = "st";
			else if (i==31) suffixVar = "st";
			else if (i==2) suffixVar = "nd";
			else if (i==22) suffixVar = "nd";
			else if (i==3) suffixVar = "rd";
			else if (i==23) suffixVar = "rd";
			else suffixVar = "th";
		//French	
		else
			if (i==1) suffixVar = "er";
						
		return i + suffixVar;	
	}

	function printDate(Language)
	{
		var Mois = new Array("Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre");
		var Jours = new Array("Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi");
		var Months = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
		var Days = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
		var MyDate = new Date();
		var year = MyDate.getYear();

	// Fix the "year" variable for Y2K:
		if (year < 1900) { year += 1900; }
		
		//French
		if(Language == 1)
		{
			document.writeln(Jours[MyDate.getDay()]+", le "+getDateWithSuffix(MyDate.getDate(), 1)+" "+Mois[MyDate.getMonth()].toLowerCase()+" "+year);	
		}
		//English
		else
		{
			document.writeln(Days[MyDate.getDay()]+", "+Months[MyDate.getMonth()]+" "+getDateWithSuffix(MyDate.getDate(), 0)+", "+year);	
		}					
	}
//======END OF Format and show Dates======
