//////////////////////////////////////////////////////////
// Fonctions de POPUP player
// Jean-Baptiste Landry  avril 2004
function popPlayer(titre, emission, video) {
	
	// relative links 
	// -------------------
	if (video.toString().substring(0,7) != "http://") {
		if (video.toString().substring(0,1) == "/") {
			video = "http://" + window.location.host + video;
		} else {
			var pathname = '';
			var splitParam = window.location.pathname.toString().split("/");

			for (i=0; i<(splitParam.length-1); i++) {
			    pathname = pathname + splitParam[i] + "/";
			}
						
			video = "http://" + window.location.host + pathname + video;
		}	    
	}


	// from other servers
	// --------------------
	if (emission == "mysterecanoecom") {
		playerDomain = "tva.canoe.com";
	} else {
	   playerDomain = window.location.host;
	}
	
	
	// base parameters
	// -------------------
	url = 'http://'+playerDomain+'/cgi-bin/player/player.pl?titre='+escape(titre)+'&emission='+escape(emission)+'&video='+escape(video)
	width  = 460;
	height = 350;

		
	// custom
	// -------------------
	if (emission == "deuxfilleslematin") {
		width  = 348;
		height = 400;
	}
		
	if (emission == "pourlemeilleuretpourlepire") {
		url = "http://ads5.canoe.ca/event.ng/Type=click&FlightID=12168&AdID=22179&TargetID=1973&Segments=2371,3502,4176,4788,7005&Targets=439,1973&Values=31,43,51,60,72,85,91,100,110,150,155,213,224,266,332,334,353,379,380,392,490,493,659,722,1086,1286,1315,1379,1380,1444,1467,1545,1549,1551,1567,1570,1620,1946,2234,2293,2307,2553,2670,2686,2698,2700,2702,2703,2788&RawValues=USERID%2Cc0a8dccd-11176-1094842570-1&Redirect="+url;
		width  = 519;
		height = 453;
	}


	popPlayerWin = window.open(url, emission, 'scrollbars=no,width='+width+',height='+height+',top=200,left=200' );
	setTimeout('popPlayerWin.focus();',250);
}

