// JavaScript Document


var gameList = new Array(16);
// Jeu creo
gameList[0]=new Array("http://www.pc.gc.ca/apprendre-learn/jeunes-youths/sec1/pa-bff/index_E.asp",810,760,"entete_logo_parc_canada.jpg","http://www.pc.gc.ca","Visit the Parks Canada Website","hits/jeux/externe/parc_canada/mission_rescape","hits/partenaires/parcs_canada");
gameList[1]=new Array("http://www.sayansi.ca",1050,600,"","","","hits/jeux/interne/sayansi","");
gameList[2]=new Array("http://www.gameforscience.ca/mars",1050,600,"","","","hits/jeux/interne/mars","");
gameList[3]=new Array("http://www.scienceenjeu.ca/debrouillards/demo/bin/index.html",850,700,"","","","hits/jeux/interne/demo_debs3",""); //FRENCH ONLY
gameList[4]=new Array("http://www.2k40.com/2K40.asp?langue=en",780,660,"header_logo_isci.jpg","http://www.centredessciencesdemontreal.com/en/index2.htm","Visit the Montr&eacute;al Science Centre Website","hits/jeux/externe/isci/2k40","hits/partenaires/centre_isci");
gameList[5]=new Array("http://uneepaveraconte.net/english/index.htm",780,540,"entete_logo_pointeacalliere.jpg","http://www.pacmusee.qc.ca/index.aspx?lang=EN-CA","Visit the Pointe-&Agrave;-Calli&egrave;re Museum Website","hits/jeux/externe/pointe_a_calliere/epave_raconte","hits/partenaires/pointe_a_calliere");
gameList[6]=new Array("http://www.gameforscience.ca/forestia/bin/forestia.php",1050,600,"","","","hits/jeux/interne/forestia",""); 
//Jeu Musée Armand-Frappier
gameList[7]=new Array("http://www.musee-afrappier.qc.ca/en/index.php?gameid=1 ",754,565,"header_logo_maf.jpg","http://www.musee-afrappier.qc.ca/en/","Visit the Armand-Frappier Museum's website","hits/jeux/externe/armand_frappier/bacterie_debutant","hits/partenaires/armand_frappier"); //Mise en ligne le 22 avril 2009
gameList[8]=new Array("http://www.musee-afrappier.qc.ca/en/index.php?gameid=2",754,565,"header_logo_maf.jpg","http://www.musee-afrappier.qc.ca/en/","Visit the Armand-Frappier Museum's website","hits/jeux/externe/armand_frappier/drfrappier_debutant","hits/partenaires/armand_frappier"); //Mise en ligne le 28 avril 2009
gameList[9]=new Array("http://www.musee-afrappier.qc.ca/en/index.php?gameid=3",754,565,"header_logo_maf.jpg","http://www.musee-afrappier.qc.ca/en/","Visit the Armand-Frappier Museum's website","hits/jeux/externe/armand_frappier/colonisateurs_debutant","hits/partenaires/armand_frappier"); //Mise en ligne le 6 mai 2009
gameList[10]=new Array("http://www.musee-afrappier.qc.ca/en/index.php?gameid=7",754,565,"header_logo_maf.jpg","http://www.musee-afrappier.qc.ca/en/","Visit the Armand-Frappier Museum's website","hits/jeux/externe/armand_frappier/sante_publique","hits/partenaires/armand_frappier"); //Mise en ligne le 12 mai 2009
gameList[11]=new Array("http://www.musee-afrappier.qc.ca/en/index.php?gameid=8",754,565,"header_logo_maf.jpg","http://www.musee-afrappier.qc.ca/en/","Visit the Armand-Frappier Museum's website","hits/jeux/externe/armand_frappier/rescousse","hits/partenaires/armand_frappier"); //Mise en ligne le 20 mai 2009
gameList[12]=new Array("http://www.musee-afrappier.qc.ca/en/index.php?gameid=9",754,565,"header_logo_maf.jpg","http://www.musee-afrappier.qc.ca/en/","Visit the Armand-Frappier Museum's website","hits/jeux/externe/armand_frappier/adn","hits/partenaires/armand_frappier"); //Jeu utilisé pour le démo (31 janvier 2009)
gameList[13]=new Array("http://www.musee-afrappier.qc.ca/en/index.php?gameid=4 ",754,565,"header_logo_maf.jpg","http://www.musee-afrappier.qc.ca/en/","Visit the Armand-Frappier Museum's website","hits/jeux/externe/armand_frappier/bacterie_intermediaire","hits/partenaires/armand_frappier"); //Mise en ligne le 22 avril 2009
gameList[14]=new Array("http://www.musee-afrappier.qc.ca/en/index.php?gameid=5",754,565,"header_logo_maf.jpg","http://www.musee-afrappier.qc.ca/en/","Visit the Armand-Frappier Museum's website","hits/jeux/externe/armand_frappier/drfrappier_intermediaire","hits/partenaires/armand_frappier"); //Mise en ligne le 28 avril 2009
gameList[15]=new Array("http://www.musee-afrappier.qc.ca/en/index.php?gameid=6",754,565,"header_logo_maf.jpg","http://www.musee-afrappier.qc.ca/en/","Visit the Armand-Frappier Museum's website","hits/jeux/externe/armand_frappier/colonisateurs_intermediaire","hits/partenaires/armand_frappier"); //Mise en ligne le 6 mai 2009

gameList[16]=new Array("http://www.grandstar.tv/jeu.html",1024,706,"logo_entete_grand_star.jpg","http://www.grandstar.tv","Visit the Grand star Website","hits/jeux/externe/trinome/compagnie_glaces","hits/partenaires/trinome/compagnie_glaces");

gameList[24]=new Array("http://www.pc.gc.ca/apprendre-learn/jeunes-youths/sec1/habille-dress/p1_e.asp",800,650,"entete_logo_parc_canada.jpg","http://www.pc.gc.ca","Visit the Parks Canada website.","hits/jeux/externe/parc_canada/habille_canada","hits/partenaires/parcs_canada");
gameList[25]=new Array("http://www.pc.gc.ca/apprendre-learn/jeunes-youths/sec1/eh-be/p1_E.asp",800,600,"entete_logo_parc_canada.jpg","http://www.pc.gc.ca","Visit the Parks Canada website.","hits/jeux/externe/parc_canada/exploratuer_herbe","hits/partenaires/parcs_canada");
gameList[26]=new Array("http://www.pc.gc.ca/apprendre-learn/jeunes-youths/sec1/fhc-wch/p1_E.asp?qs_1=0&qs_2=0&qs_3=0&qs_4=0&qs_5=0&no=1",800,600,"entete_logo_parc_canada.jpg","http://www.pc.gc.ca","Visit the Parks Canada website.","hits/jeux/externe/parc_canada/femmes_canada","hits/partenaires/parcs_canada");
gameList[27]=new Array("http://www.pc.gc.ca/apprendre-learn/jeunes-youths/sec1/on-bb/p1_E.asp",800,600,"entete_logo_parc_canada.jpg","http://www.pc.gc.ca","Visit the Parks Canada website.","hits/jeux/externe/parc_canada/ours_noir","hits/partenaires/parcs_canada");

gameList[28]=new Array("http://www.pc.gc.ca/apprendre-learn/jeunes-youths/sec1/Haliotide-Abalone/p1_E.asp",800,600,"entete_logo_parc_canada.jpg","http://www.pc.gc.ca","Visit the Parks Canada website.","hits/jeux/externe/parc_canada/sos_pie","hits/partenaires/parcs_canada");
gameList[29]=new Array("http://www.pc.gc.ca/apprendre-learn/jeunes-youths/sec1/lde-ew/p1_E.asp",800,700,"entete_logo_parc_canada.jpg","http://www.pc.gc.ca","Visit the Parks Canada website.","hits/jeux/externe/parc_canada/loup_est","hits/partenaires/parcs_canada");

gameList[30]=new Array("http://www.pc.gc.ca/apprendre-learn/jeunes-youths/sec1/tm-bt/p1_E.asp",800,600,"entete_logo_parc_canada.jpg","http://www.pc.gc.ca","Visit the Parks Canada website.","hits/jeux/externe/parc_canada/tortue_mouchetee","hits/partenaires/parcs_canada");

gameList[39]=new Array("http://nature.ca/sila/qz/qzmnpg_e.cfm",800,600,"entete_lgo_mcn.jpg","http://www.nature.ca/nature_e.cfm","Canadian museum of nature","hits/jeux/externe/mcn/sila","hits/partenaires/mcn");

gameList[41]=new Array("http://nature.ca/ukaliq/030act/010_gms_e.cfm",800,600,"entete_lgo_mcn.jpg","http://www.nature.ca/nature_e.cfm","Canadian museum of nature","hits/jeux/externe/mcn/trouvez_lievre","hits/partenaires/mcn");

/*
//Concours Génomia TEMPORAIRE  - Mise en ligne le 12 juin 2009
if(noref == "undefined") var noref = 0;
gameList[100]=new Array("http://www.game-for-science.ca/concourgenomia/index.php?noref=" + noref,800,600,"","","","hits/concours/genomia/eureka_2009","");
*/


var gameWindow = 0;

var animEdumediaList = new Array();
animEdumediaList[0]=new Array("edumedia/sink-or-float.swf","entete_logo_edumedia.jpg","http://www.edumedia-sciences.com/en/","Visit the eduMedia Website","hits/contenu/edumedia","hits/partenaires/edumedia");



/*Cette fonction élimine le popup blocker*/
var mywin;
function openGame(id) {
	var heightIFrame = gameList[id][2];
	
    var width = gameList[id][1];
    var height = gameList[id][2] + 83;
	
	//Vérifie la grandeur de l'écran de l'usager et réduit en conséquence la fenêtre de jeu.
	if(height > screen.availHeight){
		//Si la fenêtre est plus longue que l'écran du joueur
		//Réduit la fenêtre
		height = screen.availHeight -40;
		heightIFrame = height -83; //Réduction hauteur du iFrame
		var top = 0;
	}else{		
   		var top = parseInt((screen.availHeight/2) - (height/2));
	}
	
	if(width > screen.width){
		//Si la fenêtre est plus longue que l'écran du joueur
		//Réduit la fenêtre
		width = screen.width - 20;
		var left = 0;
	}else{		
   		var left = parseInt((screen.availWidth/2) - (width/2));
	}
	
	
    var windowFeatures = "width=" + width + ",height=" + height +
        ",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,left=" + left + ",top=" + top +
        ",screenX=" + left + ",screenY=" + top;
    mywin = window.open('', id, windowFeatures);
	mywin.focus();
	mywin.document.write('<html>');
	mywin.document.write('<head>');
	mywin.document.write('<title>Game for science - Game</title>');
	mywin.document.write('</head>');
	mywin.document.write('<body style="margin: 0; padding: 0;background-color: #000000;background-image:url(images/header_game.jpg);background-repeat:no-repeat;">');
	mywin.document.write('<div style="margin-top:0px;width:100%;height:83px;">');
	if(gameList[id][3]){
		mywin.document.write('<a href="'+gameList[id][4]+'" title="'+gameList[id][5]+'" alt="'+gameList[id][5]+'" target="_blank" onClick=javascript:pageTracker._trackPageview("'+ gameList[id][7] +'") ><img src="images/'+gameList[id][3]+'" border="0" style="float:right;margin-top:5px;margin-right:20px;"/></a>');
	}
	mywin.document.write('<a href="http://www.creo.ca" target="_blank"  title="Visit the Creo inc, game for science Website" alt="Visit the Creo inc, game for science Website" onClick=javascript:pageTracker._trackPageview("hits/creo") ><img src="images/pixel.gif" width="104" height="82" border="0"/></a>');
	mywin.document.write('</div>');
	mywin.document.write('<iframe id="iframegame" src="'+gameList[id][0]+'" width='+width+' height='+heightIFrame+' scrolling=auto frameborder=0></iframe>');
	mywin.document.write('<script type="text/javascript">var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src=\'" + gaJsHost + "google-analytics.com/ga.js\' type=\'text/javascript\'%3E%3C/script%3E"));</script>');
	mywin.document.write('<script type="text/javascript">try { var pageTracker = _gat._getTracker("UA-8973460-1"); pageTracker._trackPageview("'+gameList[id][6]+'");} catch(err) {}</script>');
	mywin.document.write('</body>');
	mywin.document.write('</html>');
}

function update_name(value){
	document.getElementById('avatarName').innerHTML = value;
}

function openVideo(){
	/*Ouvre la pub sur YouTube */
	var d = document.getElementById("openOver");
	d.style.display = "block";	
}


function openAnimEdumedia(id){
	var heightWindow = 442 + 83;
    var width = 600;
    var height = heightWindow;
    var left = parseInt((screen.availWidth/2) - (width/2));
    var top = parseInt((screen.availHeight/2) - (height/2));
    var windowFeatures = "width=" + width + ",height=" + height +
        ",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,left=" + left + ",top=" + top +
        ",screenX=" + left + ",screenY=" + top;
    mywin = window.open('', "Jeu", windowFeatures);
	mywin.focus();
	mywin.document.write('<html>');
	mywin.document.write('<head>');
	mywin.document.write('<title>Game for science - Sink or float ?</title>');
	mywin.document.write('<link rel="stylesheet" type="text/css" href="css/cmv.css">');
	mywin.document.write('</head>');
	mywin.document.write('<body style="margin: 0; padding: 0;background-color: #ffffff;background-image:url(images/header_game.jpg);background-repeat:no-repeat;">')
	mywin.document.write('<div style="margin-top:0px;width:100%;height:83px;">');
	mywin.document.write('<a href="http://www.creo.ca" target="_blank"  title="Visit the Creo inc, game for science Website" alt="Visit the Creo inc, game for science Website" onClick=javascript:pageTracker._trackPageview("hits/creo") ><img src="images/pixel.gif" width="104" height="82" border="0" style="float:left;margin-top:5px;margin-left:0px;"/></a>');
	mywin.document.write('<a href="'+animEdumediaList[id][2]+'" title="'+animEdumediaList[id][3]+'" alt="'+animEdumediaList[id][3]+'" target="_blank" onClick=javascript:pageTracker._trackPageview("'+ animEdumediaList[id][5] +'") ><img src="images/'+animEdumediaList[id][1]+'" border="0" style="float:left;margin-top:5px;margin-left:360px;"/></a>');mywin.document.write('<div style="margin-top:0px;width:600px;text-align:center">');
	mywin.document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="550" height="442"> <param name="movie" value="'+animEdumediaList[id][0]+'"><param name="quality" value="high"><param name="wmode" value="opaque"><embed src="'+animEdumediaList[id][0]+'" align="center" wmode="opaque" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="550" height="442"></embed></object>');
	mywin.document.write('<script type="text/javascript">var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src=\'" + gaJsHost + "google-analytics.com/ga.js\' type=\'text/javascript\'%3E%3C/script%3E"));</script>');
	mywin.document.write('<script type="text/javascript">try { var pageTracker = _gat._getTracker("UA-8973460-1"); pageTracker._trackPageview("'+animEdumediaList[id][4]+'");} catch(err) {}</script>');
	mywin.document.write('</div>');
	mywin.document.write('</body>');

	mywin.document.write('</html>');
}

function openURL(url ) {
	var height = screen.availHeight-83;
	var heightWindow = height + 83;
	
    var width = screen.availWidth;
    var widthWindow = screen.availWidth;
	
    var left = parseInt((screen.availWidth/2) - (width/2));
    var top = parseInt((screen.availHeight/2) - (height/2));
    var windowFeatures = "width=" + widthWindow + ",height=" + heightWindow +
        ",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,left=" + left + ",top=" + top +
        ",screenX=" + left + ",screenY=" + top;
	
    mywin = window.open('', "Science en Jeu", windowFeatures);
	mywin.focus();
	mywin.document.write('<html>');
	mywin.document.write('<head>');
	mywin.document.write('<title>Science en Jeu</title>');
	mywin.document.write('</head>');
	mywin.document.write('<body style="margin: 0; padding: 0;background-color: #000000;background-image:url(images/entete_jeu.jpg);background-repeat:no-repeat;">');
	mywin.document.write('<div style="margin-top:0px;width:100%;height:83px;">');
	mywin.document.write('<a href="http://www.creo.ca" target="_blank"  title="Visit the Creo inc, game for science Website" alt="Visit the Creo inc, game for science Website" onClick=javascript:pageTracker._trackPageview("hits/creo") ><img src="http://www.gameforscience.ca/images/pixel.gif" width="104" height="82" border="0"/></a>');
	mywin.document.write('</div>');
	
	mywin.document.write('<iframe id="iframegame" class="float:right;" src="'+url+'" width='+width+' height='+height+' scrolling=no frameborder=0></iframe>');

	mywin.document.write('<script type="text/javascript">var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src=\'" + gaJsHost + "google-analytics.com/ga.js\' type=\'text/javascript\'%3E%3C/script%3E"));</script>');
	mywin.document.write('<script type="text/javascript">try { var pageTracker = _gat._getTracker("UA-8973460-1"); pageTracker._trackPageview("' + url + '");} catch(err) {}</script>');
	mywin.document.write('</body>');
	mywin.document.write('</html>');
}


function openContactForm(sujet, absolutePath){
	
	if(absolutePath == null) var absolutePath = "";
	var heightWindow = 365 + 83;
    var width = 488;
    var height = heightWindow;
    var left = parseInt((screen.availWidth/2) - (width/2));
    var top = parseInt((screen.availHeight/2) - (height/2));
    var windowFeatures = "width=" + width + ",height=" + height +
        ",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,left=" + left + ",top=" + top +
        ",screenX=" + left + ",screenY=" + top;
    mywin = window.open('', "Contact", windowFeatures);
	mywin.focus();
	mywin.document.write('<html>');
	mywin.document.write('<head>');
	mywin.document.write('<title>Game for science - Contact form</title>');
	mywin.document.write('</head>');
	mywin.document.write('<body style="margin: 0; padding: 0;background-color: #000000;background-image:url('+absolutePath+'images/header_game.jpg);background-repeat:no-repeat;">')
	mywin.document.write('<div style="margin-top:0px;width:100%;height:83px;">');
	mywin.document.write('<a href="http://www.creo.ca" target="_blank"  title="Visit the Creo inc, game for science Website" alt="Visit the Creo inc, game for science Website" onClick=javascript:pageTracker._trackPageview("hits/creo") ><img src="'+absolutePath+'images/pixel.gif" width="104" height="82" border="0" style="float:left;margin-top:5px;margin-left:0px;"/></a>');	
	mywin.document.write('</div>');
	mywin.document.write('<iframe id="iframegame" src="'+absolutePath+'contact.php?sujet='+sujet+'" width='+width+' height='+height+' scrolling=no frameborder=0></iframe>');
	mywin.document.write('</body>');
	mywin.document.write('</html>');
}

