﻿document.write('<script type="text/javascript" src="/js/motionpack.js"></script>');
document.write('<script type="text/javascript" src="/docs/accueil/tourists.js"></script>');

var bottomInformationTablesDisplayed = false;

function MM_ajaxLoader(theURL, elementId) {
	el = elementId;
	document.getElementById(el).innerHTML = '<div style="text-align: center;"><img src="/img/anim_wait.gif" border="0" alt="" style="margin: 20px;" /></div>';
	if (document.getElementById) {
		var x = (window.ActiveXObject) ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
	}
	if (x) {
		x.onreadystatechange = function() {
			if (x.readyState == 4 && x.status == 200) {
				el = document.getElementById(elementId);
				
				el.innerHTML = x.responseText;
				setAndExecute(elementId, el.innerHTML);
			}
		}
	x.open("GET", theURL, true);
	x.send(null);
	}
}

function setAndExecute(divId, innerHTML) {  
	var div = document.getElementById(divId);
	div.innerHTML = innerHTML;
	var x = div.getElementsByTagName("script");
	for(var i=0;i<x.length;i++) {
        jsToEval = x[i].text;
        if (jsToEval.indexOf("<!--") >= 0) {
            jsToEval = jsToEval.replace("<!--", "");
        }
        if (jsToEval.indexOf("//-->") >= 0) {
            jsToEval = jsToEval.replace("//-->", "");
        }
        eval(jsToEval);
	}
}

function schedulePublication(startDate, finishDate, content) {
	// schedulePublication(new Date(AAAA, M, J, H, M, S), "JavaScript");
	dateNow = new Date();
	startDate.setMonth(startDate.getMonth() - 1);
	finishDate.setMonth(finishDate.getMonth() - 1);
	amountStartDate = startDate.getTime() - dateNow.getTime();
	amountFinishDate = finishDate.getTime() - dateNow.getTime();
	delete dateNow;
	if (amountStartDate < 0) {
		if (amountFinishDate > 0) {
			eval(content);
		}
	}
}

function backToTop() {
    var x1 = x2 = x3 = 0;
    var y1 = y2 = y3 = 0;

    if (document.documentElement) {
        x1 = document.documentElement.scrollLeft || 0;
        y1 = document.documentElement.scrollTop || 0;
    }

    if (document.body) {
        x2 = document.body.scrollLeft || 0;
        y2 = document.body.scrollTop || 0;
    }

    x3 = window.scrollX || 0;
    y3 = window.scrollY || 0;

    var x = Math.max(x1, Math.max(x2, x3));
    var y = Math.max(y1, Math.max(y2, y3));

    window.scrollTo(Math.floor(x / 2), Math.floor(y / 2));

    if (x > 0 || y > 0) {
        window.setTimeout("backToTop();", 10);
    }
}

function MM_getElementWidth(elementId) {
	var returnValue = 0;
	while (document.getElementById(elementId) != null ) {
		returnValue += document.getElementById(elementId).offsetWidth;
		elementId = document.getElementById(elementId).offsetParent;
	}
	return returnValue;
}

function MM_getElementHeight(elementId) {
	var returnValue = 0;
	while (document.getElementById(elementId) != null ) {
		returnValue += document.getElementById(elementId).offsetHeight;
		elementId = document.getElementById(elementId).offsetParent;
	}
	return returnValue;
}

function MM_getElementX(oElement)
{
	var iReturnValue = 0;
	while (document.getElementById(oElement) != null) {
		iReturnValue += document.getElementById(oElement).offsetLeft;
		oElement = document.getElementById(oElement).offsetParent;
	}
	return iReturnValue;
}

function MM_getElementY(oElement)
{
	var iReturnValue = 0;
	while (document.getElementById(oElement) != null) {
		iReturnValue += document.getElementById(oElement).offsetTop;
		oElement = document.getElementById(oElement).offsetParent;
	}
	return iReturnValue;
}

function MM_openWindow(theURL, winName, features) {
    window.open(theURL, winName, features);
}

function MM_maximizeWindow() {
    window.moveTo(0, 0);
    window.resizeTo(window.screen.availWidth, window.screen.availHeight);
}

function MM_closeWindow() {
    if (self.parent.frames.length != 0) { self.parent.close(); }
    else { window.close(); }
}

function queryString(qs) {
	this.params = new Object()
	this.get=queryString_get
	
	if (qs == null)
		qs=location.search.substring(1,location.search.length)

	if (qs.length == 0) return

	qs = qs.replace(/\+/g, ' ')
	var args = qs.split('&')
	
	for (var i=0;i<args.length;i++) {
		var value;
		var pair = args[i].split('=')
		var name = unescape(pair[0])

		if (pair.length == 2)
			value = unescape(pair[1])
		else
			value = name
		
		this.params[name] = value
	}
}

function queryString_get(key, default_) {
	if (default_ == null) default_ = null;
	
	var value=this.params[key]
	if (value==null) value=default_;
	
	return value;
}

function createCookie(name, value, days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}

function setActiveStyleSheet(title) {
	var i, a, main;
	for (i=0; (a = document.getElementsByTagName("link")[i]); i++) {
		if (a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
			a.disabled = true;
			if (a.getAttribute("title") == title) a.disabled = false;
		}
	}
}

var opaque = false;

function toggleImage(src, imageWidth, imageHeight) {
	if (document.getElementById("divToggleWindowImage")) {
		document.getElementById("divToggleWindowImage").src = "/img/transparent.gif";
		document.getElementById("divToggleWindowImage").src = src;
		if (imageWidth != "" && imageHeight != "") {
			document.getElementById("divToggleWindowImage").style.width = imageWidth + "px";
			document.getElementById("divToggleWindowImage").style.height = imageHeight + "px";
		}
		toggleOpaque("divToggleWindow");
	}
	else {
		window.open(src);
	}
}

function toggleOpaque(div, position){
	if(!document.getElementById("divToggleWindowOpaqueBackground")) {
		var oDivOpaque = document.createElement("div");
		oDivOpaque.setAttribute("id", "divToggleWindowOpaqueBackground");
		var ele = document.getElementsByTagName("body")[0].appendChild(oDivOpaque);
	}
	var ele = document.getElementById("divToggleWindowOpaqueBackground");
	if (!opaque){
		ele.style.width = document.body.scrollWidth;
		ele.style.height = document.body.scrollHeight;
		setOpacity(ele, 0);
		ele.style.display = "block";
		fadeIn("divToggleWindowOpaqueBackground", 0, 60, 10);
		opaque = true;
		if (position != "rel") {
			setPosition(div);
		}
	}
	else {
		fadeOut("divToggleWindowOpaqueBackground", 60, 0, 15);
		opaque = false;
	}
}

function fadeIn(objId, opacity, maxOpacity, transitionTime) {
	obj = document.getElementById(objId);
	if (opacity <= maxOpacity) {
		setOpacity(obj, opacity, false);
		opacity += transitionTime;
		setTimeout("fadeIn('"+objId+"',"+opacity+","+maxOpacity+","+transitionTime+")", 50);
	}
}

function fadeOut(objId, opacity, minOpacity, transitionTime) {
	obj = document.getElementById(objId);
	if (opacity >= minOpacity) {
		setOpacity(obj, opacity, false);
		opacity -= transitionTime;
		setTimeout("fadeOut('"+objId+"',"+opacity+","+minOpacity+","+transitionTime+")", 50);
	}else{
		obj.style.display = "none";
		anim = false;
	}
}

function setPosition(div){
	var ele = document.getElementById(div);
	ele.style.display = "block";
	var w = document.body.scrollWidth;
	var h = document.body.scrollHeight;
	var divWidth = ele.clientWidth;
	var divHeight = ele.clientHeight;
	ele.style.position = "absolute";
	var posX = w / 2 - divWidth / 2;
	var dsoctop = document.all ? document.documentElement.scrollTop : pageYOffset;
	ele.style.left = posX + "px";
	ele.style.top = dsoctop + 50 + "px";
}

function closeWindow(div) {
	divEl = document.getElementById(div);
	divEl.style.display = "none";
	toggleOpaque(div);
}


function setOpacity(obj, opacity, notDisplay) {
	obj.style.filter = "alpha(opacity:"+opacity+")";
	obj.style.KHTMLOpacity = opacity / 100;
	obj.style.MozOpacity = opacity / 100;
	obj.style.opacity = opacity / 100;
	if (notDisplay) { obj.style.display = "none"; }
}

function MM_downloadAdobeReader(culture) {
	if (culture == "fr-CA") {
		lblTitle = "Adobe Reader";
		lblDownload = "Certains documents sont en format PDF et nécessitent le téléchargement et l'installation du plugiciel gratuit Adobe Reader.";
		lblDownloadURL = "http://www.adobe.com/fr/products/acrobat/readstep2.html";
		lblDownloadLink = "Télécharger&nbsp;»";
	}
	else if (culture == "en-CA") {
		lblTitle = "Adobe Reader";
		lblDownload = "Some of these documents are in PDF format. You need to download and install the free Adobe Reader plugin to view these files.";
		lblDownloadURL = "http://www.adobe.com/products/acrobat/readstep2.html";
		lblDownloadLink = "Download&nbsp;»";
	}
	if (bottomInformationTablesDisplayed != true) { document.write("<hr style=\"clear: both;\" />"); bottomInformationTablesDisplayed = true; }
	document.write("<h3 style=\"clear: both;\">" + lblTitle + "</h3>");
	document.write("<p>");
	document.write("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
	document.write("<tr valign=\"top\">");
	document.write("<td><a href=\"/etc/link.asp?t=external&u=" + lblDownloadURL + "\" target=\"_blank\"><img src=\"/img/btn_download_adobereader.gif\" border=\"0\" width=\"88\" height=\"31\" alt=\"\" style=\"margin-right: 10px;\" /></a></td>");
	document.write("<td>" + lblDownload + "&nbsp;&nbsp;<a href=\"/etc/link.asp?t=external&u=" + lblDownloadURL + "\" target=\"_blank\">" + lblDownloadLink + "</a><img src=\"/img/icon_external_site_14x9.gif\" width=\"14\" height=\"9\" alt=\"\" style=\"margin-left: 4px;\" /></td>");
	document.write("</tr>");
	document.write("</table>");
	document.write("</p>");
}

function MM_downloadMicrosoftWindowsMediaPlayer(culture) {
	if (culture == "fr-CA") {
		lblTitle = "Microsoft Windows Media Player"
		lblDownload = "Certains contenus sont en format Microsoft Windows Media et nécessitent le téléchargement et l'installation du plugiciel gratuit Microsoft Windows Media Player.";
		lblDownloadURL = "http://www.microsoft.com/windows/windowsmedia/download/";
		lblDownloadLink = "Télécharger&nbsp;»";
	}
	else if (culture == "en-CA") {
		lblTitle = "Microsoft Windows Media Player"
		lblDownload = "Some content is in Microsoft Windows Media format. You need to download and install the free Microsoft Windows Media Player plugin to play these files.";
		lblDownloadURL = "http://www.microsoft.com/windows/windowsmedia/download/";
		lblDownloadLink = "Download&nbsp;»";
	}
	if (bottomInformationTablesDisplayed != true) { document.write("<hr style=\"clear: both;\" />"); bottomInformationTablesDisplayed = true; }
	document.write("<h3 style=\"clear: both;\">" + lblTitle + "</h3>");
	document.write("<p>");
	document.write("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
	document.write("<tr valign=\"top\">");
	document.write("<td><a href=\"/etc/link.asp?t=external&u=" + lblDownloadURL + "\" target=\"_blank\"><img src=\"/img/btn_download_mp11.gif\" border=\"0\" width=\"88\" height=\"31\" alt=\"\" style=\"margin-right: 10px;\" /></a></td>");
	document.write("<td>" + lblDownload + "&nbsp;&nbsp;<a href=\"/etc/link.asp?t=external&u=" + lblDownloadURL + "\" target=\"_blank\">" + lblDownloadLink + "</a><img src=\"/img/icon_external_site_14x9.gif\" width=\"14\" height=\"9\" alt=\"\" style=\"margin-left: 4px;\" /></td>");
	document.write("</tr>");
	document.write("</table>");
	document.write("</p>");
}

function MM_downloadAdobeFlashPlayer(culture) {
	if (culture == "fr-CA") {
		lblTitle = "Adobe Flash Player";
		lblDownload = "Certains fichiers nécessitent le téléchargement et l'installation du plugiciel gratuit Adobe Flash Player.";
		lblDownloadURL = "http://www.adobe.com/fr/products/flashplayer/";
		lblDownloadLink = "Télécharger&nbsp;»";
	}
	else if (culture == "en-CA") {
		lblTitle = "Adobe Flash Player";
		lblDownload = "You need to download and install the free Adobe Flash Player plugin to view these files.";
		lblDownloadURL = "http://www.adobe.com/products/flashplayer/";
		lblDownloadLink = "Download&nbsp;»";
	}
	if (bottomInformationTablesDisplayed != true) { document.write("<hr style=\"clear: both;\" />"); bottomInformationTablesDisplayed = true; }
	document.write("<h3 style=\"clear: both;\">" + lblTitle + "</h3>");
	document.write("<p>");
	document.write("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
	document.write("<tr valign=\"top\">");
	document.write("<td><a href=\"/etc/link.asp?t=external&u=" + lblDownloadURL + "\" target=\"_blank\"><img src=\"/img/btn_download_flash_player.gif\" border=\"0\" width=\"88\" height=\"31\" alt=\"\" style=\"margin-right: 10px;\" /></a></td>");
	document.write("<td>" + lblDownload + "&nbsp;&nbsp;<a href=\"/etc/link.asp?t=external&u=" + lblDownloadURL + "\" target=\"_blank\">" + lblDownloadLink + "</a><img src=\"/img/icon_external_site_14x9.gif\" width=\"14\" height=\"9\" alt=\"\" style=\"margin-left: 4px;\" /></td>");
	document.write("</tr>");
	document.write("</table>");
	document.write("</p>");
}

function MM_downloadMicrosoftSilverlight(culture) {
	if (culture == "fr-CA") {
		lblTitle = "Microsoft Silverlight";
		lblDownload = "Certains fichiers nécessitent le téléchargement et l'installation du plugiciel gratuit Microsoft Silverlight.";
		lblDownloadURL = "http://www.microsoft.com/silverlight/resources/install.aspx";
		lblDownloadLink = "Télécharger&nbsp;»";
	}
	else if (culture == "en-CA") {
		lblTitle = "Microsoft Silverlight";
		lblDownload = "You need to download and install the free Microsoft Silverlight plugin to view these files.";
		lblDownloadURL = "http://www.microsoft.com/silverlight/resources/install.aspx";
		lblDownloadLink = "Download&nbsp;»";
	}
	if (bottomInformationTablesDisplayed != true) { document.write("<hr style=\"clear: both;\" />"); bottomInformationTablesDisplayed = true; }
	document.write("<h3 style=\"clear: both;\">" + lblTitle + "</h3>");
	document.write("<p>");
	document.write("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
	document.write("<tr valign=\"top\">");
	document.write("<td><a href=\"/etc/link.asp?t=external&u=" + lblDownloadURL + "\" target=\"_blank\"><img src=\"/img/btn_download_silverlight.gif\" border=\"0\" width=\"88\" height=\"30\" alt=\"\" style=\"margin-right: 10px;\" /></a></td>");
	document.write("<td>" + lblDownload + "&nbsp;&nbsp;<a href=\"/etc/link.asp?t=external&u=" + lblDownloadURL + "\" target=\"_blank\">" + lblDownloadLink + "</a><img src=\"/img/icon_external_site_14x9.gif\" width=\"14\" height=\"9\" alt=\"\" style=\"margin-left: 4px;\" /></td>");
	document.write("</tr>");
	document.write("</table>");
	document.write("</p>");
}

function MM_moreInfoTable(culture, subTitle, webSiteURL, emailAddress, phoneNumber, faxNumber, address) {
	if (culture == "fr-CA") {
		lblTitle = "Pour de plus amples renseignements...";
		lblEmailAddress = "Courriel&nbsp;:&nbsp;";
		lblEmailAddressTo = "";
		lblPhoneNumber = "Téléphone&nbsp;:&nbsp;";
		lblFaxNumber = "Télécopieur&nbsp;:&nbsp;";
		lblAddress = "Adresse&nbsp;:&nbsp;";
		lblWebSite = "Site Web&nbsp;:&nbsp;";
	}
	else if (culture == "en-CA") {
		lblTitle = "For more information...";
		lblEmailAddress = "E-mail:&nbsp;";
		lblEmailAddressTo = "";
		lblPhoneNumber = "Phone:&nbsp;";
		lblFaxNumber = "Fax:&nbsp;";
		lblAddress = "Address:&nbsp;";
		lblWebSite = "Web site:&nbsp;";
	}
	if (bottomInformationTablesDisplayed != true) { document.write("<hr style=\"clear: both;\" />"); bottomInformationTablesDisplayed = true; }
	document.write("<h3 style=\"clear: both;\">" + lblTitle + "</h3>");
	document.write("<p>");
	document.write("<div style=\"font-size: 125%; margin: 0px 0px 4px 0px;\">" + subTitle + "</div>");
	document.write("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
	if (webSiteURL != "") { document.write("<tr valign=\"top\"><td><strong>" + lblWebSite + "&nbsp;</strong></td><td><a href=\"/etc/link.asp?t=external&u=" + webSiteURL + "\" target=\"_blank\">" + webSiteURL + "</a></td></tr>"); }
	if (emailAddress != "") { document.write("<tr valign=\"top\"><td><strong>" + lblEmailAddress + "&nbsp;</strong></td><td><a href=\"/page.asp?p=pour_nous_joindre/formulaire_courriel&e=" + emailAddress + "\">" + lblEmailAddressTo + subTitle + "</a></td></tr>"); }
	if (phoneNumber != "") { document.write("<tr valign=\"top\"><td><strong>" + lblPhoneNumber + "&nbsp;</strong></td><td>" + phoneNumber + "</td></tr>"); }
	if (faxNumber != "") { document.write("<tr valign=\"top\"><td><strong>" + lblFaxNumber + "&nbsp;</strong></td><td>" + faxNumber + "</td></tr>"); }
	if (address != "") { document.write("<tr valign=\"top\"><td><strong>" + lblAddress + "&nbsp;</strong></td><td>" + address + "</td></tr>"); }
	document.write("</table>");
	document.write("</p>");
}

function MM_socialNetworkingWebsites(culture) {
	if (culture == "fr-CA") {
		lblHeader = "La Ville en ligne";
		lblTitle = "Réseaux sociaux";
		lblDescription = "Voici la liste des réseaux sociaux sur lesquels la Ville diffuse de l'information&nbsp;:";
		lblLinks = '<p><a href="http://twitter.com/ville_gatineau" target="_blank" style="display: inline-block; min-height: 24px; background: url(/img/button_twitter_24x24.png) no-repeat 0px 0px; padding-left: 34px; font-weight: bold; text-align: left;">Adresse Twitter officielle de la Ville de Gatineau</a></p><p><a href="http://www.facebook.com/pages/Gatineau-QC/Ville-de-Gatineau/189141609842" target="_blank" style="display: inline-block; min-height: 24px; background: url(/img/button_facebook_24x24.png) no-repeat 0px 0px; padding-left: 34px; font-weight: bold; text-align: left;">Page Facebook officielle de la Ville de Gatineau</a></p>';
		lblTitle2 = "Abonnez-vous à <a href='/page.asp?p=guichet_municipal/infolettres/la_vie_la_ville'><em>La vie, la Ville</em></a>";
		lblDescription2 = "L'infolettre <em>La vie, la Ville</em> publie des capsules informatives sur divers sujets peu connus des citoyens.";
	}
	else if (culture == "en-CA") {
		lblHeader = "The City online";
		lblTitle = "Social networks";
		lblDescription = "The following is the list of social networks through which Gatineau is disseminating information:";
		lblLinks = '<p><a href="http://twitter.com/ville_gatineau" target="_blank" style="display: inline-block; min-height: 24px; background: url(/img/button_twitter_24x24.png) no-repeat 0px 0px; padding-left: 34px; font-weight: bold; text-align: left;">Gatineau\'s official Twitter site</a></p><p><a href="http://www.facebook.com/pages/Gatineau-QC/Ville-de-Gatineau/189141609842" target="_blank" style="display: inline-block; min-height: 24px; background: url(/img/button_facebook_24x24.png) no-repeat 0px 0px; padding-left: 34px; font-weight: bold; text-align: left;">Gatineau\'s official Facebook page</a></p>';
		lblTitle2 = "Subscribe to <a href='/page.asp?p=guichet_municipal/infolettres/la_vie_la_ville'><em>La vie, la Ville</em></a>";
		lblDescription2 = "The <em>La vie, la Ville</em> newsletter continues to publish informative capsules on different topics about which residents might not be aware.";
	}
	
	document.write('<p>&nbsp;</p>');
	document.write('<h1>' + lblHeader + '</h1>');
	document.write('<table border="0" cellspacing="0" cellpadding="0" width="100%" class="withoutborders">');
	document.write('<tr valign="top">');
	document.write('<td width="50%">');
	document.write("<h2>" + lblTitle + "</h2><p>" + lblDescription + "</p>" + lblLinks);
	document.write('</td>');
	document.write('<td valign="top" style="background: url(/img/separator_vertical.gif) repeat-y 10px 0px;" id="tdSeparator"><img src="/img/transparent.gif" width="21" height="1" /></td>');
	document.write('<td width="50%">');
	document.write('<h2>' + lblTitle2 + '</h2><p>' + lblDescription2 + '</p>');
	document.write('<script type="text/javascript" src="http://www.solutions-emailing.com/scripts/scripts.aspx"></script>');
	document.write('<script type="text/javascript">');
	document.write('solutionEmailingId = 2630;');
	if (culture == "fr-CA") {
		document.write('solutionEmailingLan = "fr";');
	}
	else if (culture == "en-CA") {
		document.write('solutionEmailingLan = "en";');
	}
	document.write('subscribe();');
	document.write('</script>');
	document.write('</td>');
	document.write('<tr>');
	document.write('</table>');
}