document.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\" />");

var txthomeon= new Image()
txthomeon.src = "images/txt_home_on.gif"
var txthomeoff= new Image()
txthomeoff.src = "images/txt_home_off.gif"

// The following 4 lines were added on July 6, 2009 to link to the french site
// Brian Devet
var txtlangon= new Image()
txtlangon.src = "images/txt_lang_on.gif"
var txtlangoff= new Image()
txtlangoff.src = "images/txt_lang_off.gif"

var txtgenworthon= new Image()
txtgenworthon.src = "images/txt_genworth_on.gif"
var txtgenworthoff= new Image()
txtgenworthoff.src = "images/txt_genworth_off.gif"

var txthabitaton= new Image()
txthabitaton.src = "images/txt_habitat_on.gif"
var txthabitatoff= new Image()
txthabitatoff.src = "images/txt_habitat_off.gif"

var txtcontacton= new Image()
txtcontacton.src = "images/txt_contact_on.gif"
var txtcontactoff= new Image()
txtcontactoff.src = "images/txt_contact_off.gif"

var tabstudenton= new Image()
tabstudenton.src = "images/nav_student_on.gif"
var tabstudentoff= new Image()
tabstudentoff.src = "images/nav_student_off.gif"

var tabparenton= new Image()
tabparenton.src = "images/nav_parent_on.gif"
var tabparentoff= new Image()
tabparentoff.src = "images/nav_parent_off.gif"

var tabteacheron= new Image()
tabteacheron.src = "images/nav_teacher_on.gif"
var tabteacheroff= new Image()
tabteacheroff.src = "images/nav_teacher_off.gif"

var tabconteston= new Image()
tabconteston.src = "images/nav_contest_on.gif"
var tabcontestoff= new Image()
tabcontestoff.src = "images/nav_contest_off.gif"

var tabcommunityon= new Image()
tabcommunityon.src = "images/nav_community_on.gif"
var tabcommunityoff= new Image()
tabcommunityoff.src = "images/nav_community_off.gif"

var butmoreinfoon= new Image()
butmoreinfoon.src = "images/but_moreinfo_on.gif"
var butmoreinfooff= new Image()
butmoreinfooff.src = "images/but_moreinfo_off.gif"

var butenteron= new Image()
butenteron.src = "images/but_enter_on.gif"
var butenteroff= new Image()
butenteroff.src = "images/but_enter_off.gif"

var butsubmiton= new Image()
butsubmiton.src = "images/but_submit_on.gif"
var butsubmitoff= new Image()
butsubmitoff.src = "images/but_submit_off.gif"

var butcancelon= new Image()
butcancelon.src = "images/but_cancel_on.gif"
var butcanceloff= new Image()
butcanceloff.src = "images/but_cancel_off.gif"

var tabreferon= new Image()
tabreferon.src = "images/nav_refer_on.gif"
var tabreferoff= new Image()
tabreferoff.src = "images/nav_refer_off.gif"

var tabmediaon= new Image()
tabmediaon.src = "images/nav_media_on.gif"
var tabmediaoff= new Image()
tabmediaoff.src = "images/nav_media_off.gif"

var tabwinnerson= new Image()
tabwinnerson.src = "images/nav_winners_on.gif"
var tabwinnersoff= new Image()
tabwinnersoff.src = "images/nav_winners_off.gif"


//Vithushan N
//June 17, 2011
//
//selected shows which of the four tabs is selected
var selected = "submit";

submit = new Image();
submit.src = 'images/btn_HowToSubmit.gif'
submit_RO = new Image();
submit_RO.src = 'images/btn_HowToSubmit_over.gif'
submit_ON = new Image();
submit_ON.src = 'images/btn_HowToSubmit_on.gif'

rules = new Image();
rules.src = 'images/btn_ContestRules.gif'
rules_RO = new Image();
rules_RO.src = 'images/btn_ContestRules_over.gif'
rules_ON = new Image();
rules_ON.src = 'images/btn_ContestRules_on.gif'

dates = new Image();
dates.src = 'images/btn_ContestDates.gif'
dates_RO = new Image();
dates_RO.src = 'images/btn_ContestDates_over.gif'
dates_ON = new Image();
dates_ON.src = 'images/btn_ContestDates_on.gif'

prizes = new Image();
prizes.src = 'images/btn_Prizes.gif'
prizes_RO = new Image();
prizes_RO.src = 'images/btn_Prizes_over.gif'
prizes_ON = new Image();
prizes_ON.src = 'images/btn_Prizes_on.gif'

enter = new Image();
enter.src = 'images/btn_EnterNow.gif'
enter_RO = new Image();
enter_RO.src = 'images/btn_EnterNow_over.gif'

function showImage(fname) {
iname=eval(fname + "on.src");
document[fname].src = iname;}

function hideImage(fname) {
iname=eval(fname + "off.src");
document[fname].src = iname;}


function OpenForm(link)
  {
window.open(link,'Screen','menubar=no,scrollbars=no,toolbars=no,resizable=no,location=no,width=700,height=600')
  }
  
function OpenGame(link)
  {
window.open(link,'Game','menubar=no,scrollbars=no,toolbars=no,resizable=no,location=no,width=800,height=600')
  }

//Rollovers and onclick images are image sprites. Three images into one. Show the top 43px for the off state, the middle 43xp for rollover state
//and show the last 43px for the on state. 
function onMouseOverHandler(id)
{
	if (selected != id) {
		if (id == 'submit') document.getElementById(id).src = submit_RO.src;
		else if (id == 'rules') document.getElementById(id).src = rules_RO.src;
		else if (id == 'dates') document.getElementById(id).src = dates_RO.src;		
		else if (id == 'prizes') document.getElementById(id).src = prizes_RO.src;
		else if (id == 'enter') document.getElementById(id).src = enter_RO.src;
	}
		
}

function onClickHandler(id)
{

		
	selected = id;
	onMouseOutHandler('submit');
	onMouseOutHandler('rules');
	onMouseOutHandler('dates');
	onMouseOutHandler('prizes');
	
    //depending on which tab is selected change the colour of the content box and the text to match the selected tab
	if (selected == 'submit') {
		document.getElementById(id).src = submit_ON.src;
	    document.getElementById('contentBox').style.background = "url(images/ContentBox_HowToSubmit.gif) no-repeat";
	    document.getElementById('contentText').innerHTML = "<tr><td ><p class='subText'><font color='FF931E'><b>En ligne:</b></font> Clique sur « Participer maintenant »</p><p class='subText'><font color='FF931E'><b>Par la poste:</b> </font>Envoie ta soumission avec ton nom, adresse et numéro de téléphone à : </p><p class='subText'>Concours de rédaction <br />« Le sens d’un chez-soi »<br />CP 4446, STN. Industrial Park<br />Markham, Ontario L3R 6G9</p><p class='subText'> Les bulletins de participation doivent être envoyés entre le 3 octobre et le <br />14 novembre 2011 </p> </td></tr>  ";

	}	

	if (selected == 'rules') {
		document.getElementById(id).src = rules_ON.src;
	    document.getElementById('contentBox').style.background = "url(images/ContentBox_rules.gif) no-repeat";
		document.getElementById('contentText').innerHTML =  "<tr><td><p class='subText'> Tu dois être un ou une élève canadien de 4<span class='sup'>e</span>, 5<span class='sup'>e</span> ou 6<span class='sup'>e</span> année résidant au Canada au moment du concours.</p><p class='subText'>Écris un court texte, un essai ou un poème (entre 50 et 300 mots) exprimant ce qu’un chez-soi signifie pour toi et remplis le bulletin de participation en ligne ou envoie-le nous par la poste dans une enveloppe. Les bulletins de participation doivent être envoyés entre le 3 octobre et le 14 novembre 2011.</p><p class='subText'><a  href='entry.html'><b><u><font color='7AC943'>En savoir plus...</font></u></b></a></p></td></tr>"; 

	}	 

	if (selected == 'dates') {
		document.getElementById(id).src = dates_ON.src;
	    document.getElementById('contentBox').style.background = "url(images/ContentBox_dates.gif) no-repeat";
	    document.getElementById('contentText').innerHTML = "<tr><td><p class='subText'>Le concours débute à 12 h 01 HE le 3 octobre 2011 et se poursuit jusqu’à 23 h 59 HE le 14 novembre 2011.</p><p class='subText'>À compter de la semaine du 28 novembre 2011, un jury sélectionnera 24 demi-finalistes parmi tous les bulletins de participation admissibles reçus durant la Période du concours.</p><p class='subText'>À compter de la semaine du 12 decembre à 12 h 01 HE, les bulletins de participation des 24 demi-finalistes seront affichés ici pour consultation. </p><p class='subText'><a  href='entry.html'><b><u><font color='2461AA'>En savoir plus...</font></u></b></a></p></td></tr>";
	}	
	if (selected == 'prizes') {
		document.getElementById(id).src = prizes_ON.src;
		document.getElementById('contentBox').style.background = "url(images/ContentBox_Prizes.gif) no-repeat";
		document.getElementById('contentText').innerHTML = "<tr><td ><ul style='margin:0px;padding-left:15px;height:13px'><a class='prizeLinkOn' href='javascript://null' onClick='grandprize()'>Grand prix</a> | <a class='prizeLink' href='javascript://null' onClick='secondprize()'>2<sup>e</sup> prix</a> | <a class='prizeLink' href='javascript://null' onClick='thirdprize()'>3<sup>e</sup> prix</a> | <a class='prizeLink' href='javascript://null' onClick='allprize()'>Tous les prix</a><br/><br /><li>Un iPad 2 Apple de 64 Go avec Wi-Fi</li><li>Un clavier sans fil Apple</li><li>Une station de travail Origami d’Incase</li><li>Une fête pizza pour toute l’école <br> du gagnant</li><br />Nous ferons également un don de 60 000 $ pour la construction d’une maison Habitat pour l’humanité neuve dans la communauté de ton choix! <br /><br /><a class='prizeLink'  href='entry.html'><b><u><font color='3FA9F5'>En savoir plus...</font></u></b></a></ul>";
	}	 


}

	function grandprize() {
		document.getElementById('contentText').innerHTML = "<tr><td ><ul style='margin:0px;padding-left:15px;height:13px'><a class='prizeLinkOn' href='javascript://null' onClick='grandprize()'>Grand prix</a> | <a class='prizeLink' href='javascript://null' onClick='secondprize()'>2<sup>e</sup> prix</a> | <a class='prizeLink' href='javascript://null' onClick='thirdprize()'>3<sup>e</sup> prix</a> | <a class='prizeLink' href='javascript://null' onClick='allprize()'>Tous les prix</a><br/><br /><li>Un iPad 2 Apple de 64 Go avec Wi-Fi</li><li>Un clavier sans fil Apple</li><li>Une station de travail Origami d’Incase</li><li>Une fête pizza pour toute l’école <br> du gagnant</li><br />Nous ferons également un don de 60 000 $ pour la construction d’une maison Habitat pour l’humanité neuve dans la communauté de ton choix! <br /><br /><a class='prizeLink'  href='entry.html'><b><u><font color='3FA9F5'>En savoir plus...</font></u></b></a></ul>";
	}	
	
	function secondprize() {
		document.getElementById('contentText').innerHTML = "<tr><td ><ul style='margin:0px;padding-left:15px;height:13px'><a class='prizeLink' href='javascript://null' onClick='grandprize()'>Grand prix</a> | <a class='prizeLinkOn' href='javascript://null' onClick='secondprize()'>2<sup>e</sup> prix</a> | <a class='prizeLink' href='javascript://null' onClick='thirdprize()'>3<sup>e</sup> prix</a> | <a class='prizeLink' href='javascript://null' onClick='allprize()'>Tous les prix</a><br /><br /><li>Un iPod Touch Apple de 8 Go</li><li>Une fête pizza pour ta classe</li><br />Nous ferons également un don de 5 000 $ à un organisme affilié à Habitat pour l’humanité pour aider à construire une nouvelle maison dans cette communauté.<br /><br /><a class='prizeLink'  href='entry.html'><b><u><font color='3FA9F5'>En savoir plus...</font></u></b></a>";
	}
	
	function thirdprize() {
		document.getElementById('contentText').innerHTML = "<tr><td ><ul style='margin:0px;padding-left:15px;height:13px'><a class='prizeLink' href='javascript://null' onClick='grandprize()'>Grand prix</a> | <a class='prizeLink' href='javascript://null' onClick='secondprize()'>2<sup>e</sup> prix</a> | <a class='prizeLinkOn' href='javascript://null' onClick='thirdprize()'>3<sup>e</sup> prix</a> | <a class='prizeLink' href='javascript://null' onClick='allprize()'>Tous les prix</a><br /><br />Il y a dix-huit troisième prix à gagner, chacun d’entre eux consistant en <br> un (1) Inukshuk.<br /><br /><a class='prizeLink'  href='entry.html'><b><u><font color='3FA9F5'>En savoir plus...</font></u></b></a>";
	}
	function allprize() {
		document.getElementById('contentText').innerHTML = "<tr><td ><ul style='margin:0px;padding-left:15px;height:13px'><a class='prizeLink' href='javascript://null' onClick='grandprize()'>Grand prix</a> | <a class='prizeLink' href='javascript://null' onClick='secondprize()'>2<sup>e</sup> prix</a> | <a class='prizeLink' href='javascript://null' onClick='thirdprize()'>3<sup>e</sup> prix</a> | <a class='prizeLinkOn' href='javascript://null' onClick='allprize()'>Tous les prix</a><br /><br />Chaque bulletin de participation admissible reçu dans le cadre du Concours recevra 5 $ sous forme de don qui sera remis à l’organisme Habitat pour l’humanité le plus proche du code postal ou de la ville de résidence de chacun des participants, en leur nom. Six mille (6 000) bulletins de participation admissibles (un total de 30 000 $CAN!)  seront admissibles pour un don à Habitat pour l’humanité.<br /><br /><a  href='entry.html'><b><u><font color='3FA9F5'>En savoir plus...</font></u></b></a>";
	}	
	
	
function onMouseOutHandler(id)
{
	if (selected != id) {
		if (id == 'submit') document.getElementById(id).src = submit.src;
		else if (id == 'rules') document.getElementById(id).src = rules.src;
		else if (id == 'dates') document.getElementById(id).src = dates.src;		
		else if (id == 'prizes') document.getElementById(id).src = prizes.src;
		else if (id == 'enter') document.getElementById(id).src = enter.src;
	}
}


//added by Long

if (document.images)
{

  order = new Image();
  order.src = "images/order popup/btn_order_fr.png";
  
  order_on = new Image();
  order_on.src = "images/order popup/btn_order_fr_on.png";
  
  close_btn = new Image();
  close_btn.src = "images/close.png";
  close_btn_on = new Image();
  close_btn_on.src = "images/close_OVER.png";
  
}

function onMouseOverHandler_lightbox(id) {
	if(id == "order"){
		document.getElementById(id).src = order_on.src;
	}
	else if(id == "close"){
		document.getElementById(id).src = close_btn_on.src;
	}
}

function onMouseOutHandler_lightbox(id) {
	if(id == "order"){
		document.getElementById(id).src = order.src
	}else if(id == "close"){
		document.getElementById(id).src = close_btn.src;
	}
}



//-->





function gradient(id, level)
{
	var box = document.getElementById(id);
	box.style.opacity = level;
	box.style.MozOpacity = level;
	box.style.KhtmlOpacity = level;
	box.style.filter = "alpha(opacity=" + level * 100 + ")";
	box.style.display="block";
	return;
}


function fadein(id) 
{
	var level = 0;
	while(level <= 1)
	{
		setTimeout( "gradient('" + id + "'," + level + ")", (level* 350) + 10);
		level += 0.01;
	}
}


// Open the lightbox


function openbox(formtitle, fadin)
{
  var box = document.getElementById('box'); 
 // document.getElementById('shadowing').style.display='block';

 // var btitle = document.getElementById('boxtitle');
 // btitle.innerHTML = formtitle;
  
  if(fadin)
  {
	 gradient("box", 0);
	 fadein("box");
  }
  else
  { 	
    box.style.display='block';
  }  	
}


// Close the lightbox

function closebox()
{
   document.getElementById('box').style.display='none';
   document.getElementById('shadowing').style.display='none';
}
