<?php

/**
 * include some common code (like we did in the 90s)
 * People still do this? ;)
 */
$rep = $_REQUEST['rep'];
include_once dirname(__FILE__).'/'.$rep.'/config.php';
// configuration 
include 'common.php';

// todo : 
// - gestion du parent.document.location mediafragment
// - limite taille vertical embed 
// - ajouter la polemic timline en dessous de la video 

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>RSLN  - Polemic player embed page</title>
	
	<!-- JAVASCRIPT -->
	<script type="text/javascript" src="<?php echo(registry_url('jquery','js'))?>"></script>
	<script type="text/javascript">	
		$.noConflict();
	</script>	
	<script type="text/javascript" src="<?php echo(registry_url('jquery-ui','js'))?>"></script>
	<script type="text/javascript" src="<?php echo(registry_url('raphael','js'))?>"></script>
	
	<!-- FONT -->
	<link href='<?php echo(registry_url('PT-Sans_Narrow','font'))?>' rel='stylesheet' type='text/css'>
	<link href='<?php echo(registry_url('PT-Sans','font'))?>' rel='stylesheet' type='text/css'>
	<link href='<?php echo(registry_url('Geo','font'))?>' rel='stylesheet' type='text/css'>

	<style type="text/css"> 
		body{
			padding:0px;
			margin:0px;
		}
		.tooltip{
			 z-index: 10000000000;
		}
		#tip{
			 position : absolute;
			 padding : 3px;
			 z-index: 10000000000;
			 max-width: 200px;
		}	
		#tip {
			display: none;
			background: transparent url("<?php echo(URL_ROOT);?>images/white_arrow_long.png");
			font-size: 12px;
			height: 125px;
			width: 180px;
			padding: 10px;
			padding-left: 15px;
			padding-top: 15px;
			padding-right: 15px;
			color: black;
			z-index: 10000000000;
			font-family: "Trebuchet MS", "Helvetica", "Arial", "Verdana", "sans-serif";
			overflow:hidden;
		}
		#chartTimeline{
			z-index: 9;
			position : absolute;
		}

	</style>
	<script type="text/javascript">
	
	  var _gaq = _gaq || [];
	  _gaq.push(['_setAccount', 'UA-23581291-1']);
	  _gaq.push(['_trackPageview']);
	  _gaq.push(['_setAllowAnchor', true]); 
	
	
	  (function() {
	    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
	    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
	    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
	  })();
	
	</script>
  </head>
  
  <script type="text/javascript">
  	// Configuration Polemical Timeline
	var config = {
					target:"chartTimeline",
					x:8,
					y:418,
					width:<?php echo($config['player_width']); ?>,
					height:<?php echo($config['player_height']); ?>,
					heightmax:<?php echo($config['player_height']); ?>,
					duration:<?php echo($config['duration']); ?>,
					metadata:"<?php echo($config['metadata']); ?>"
					}
  </script>
  <script type='text/javascript' src='<?php echo(URL_ROOT);?>res/metadataplayer.polemic/src/js/polemic.js'></script>
  
  <body>
  <!-- tooltip --> 
  <div id="tip">
  <div id="tipcolor" style="height:10px;width:10px"></div>
  <div id="tiptext"></div>
  </div>
  
	  <div class="root" >
		<div class="videoLivePlayer">
		<div id="chartTimeline"> </div>	
		<script type="text/javascript">
			var paper = Raphael(document.getElementById("chartTimeline"),config.width, config.height);
		</script>
		<script type='text/javascript' src='<?php echo(URL_ROOT.$config['player']);?>'></script>
		<script type="text/javascript">
		jQuery.extend(__IriSP.lib,{
			jQueryToolTip:"<?php echo(registry_url('jquery-tools','js'));?>",
			jQueryUI:"<?php echo(registry_url('jquery-ui','js'));?>",
			swfObject:"<?php echo(registry_url('swfobject','js'));?>",
			cssjQueryUI:"<?php echo(registry_url('jquery-ui','css'));?>"			
		});
		</script>
		<div id="player_project_843fff80-6b50-11e0-8aef-00145ea49a02_embed" class="iri_player_embed"> </div>
		
			<script type="text/javascript">
				var configMP = {
						metadata:{
							format:'cinelab',
							src:'<?php echo($config['metadata']); ?>',
							load:'jsonp'},
						gui:{
							width:<?php echo($config['player_width']); ?>,
							height:<?php echo($config['player_height']); ?>,
							mode:'video',
							container:'player_project_843fff80-6b50-11e0-8aef-00145ea49a02_embed',
							debug:false,
							css:'<?php echo(URL_ROOT);?>res/css/LdtPlayer.css'},
	
						player:{
							type:'jwplayer',
							src:'<?php echo(URL_ROOT);?>res/mediaplayer/player.swf'}
					};
				__IriSP.init(configMP);     
			</script>
		</div>	
	  </div>	
  </body>
</html>
