{% extends 'layout/default.html' %}
{% block body %}
	<h1>Utilities</h1>

<!-- Chrono -->

<div class="row">
<div class="col s6">
<h3>Chronomètre</h3>
<form action="" method="post" name="formu" id="formu">
  <p align="center"> 
    <input name="heure" type="text" id="heure" value="00 : 00 : 00">
  </p>

    <input class="btn {{ buttonColor }}" type="button" name="Submit" value="Start" onClick="Chrono();">
    <input class="btn {{ buttonColor }}" type="button" name="Submit2" value="Stop" onClick="window.clearTimeout(chrono);">
    <input class="btn {{ buttonColor }}" type="button" name="Submit3" value="Reset" onClick="if (confirm('Souhaitez vous mettre le compteur à zéro?')){s=0;m=0;j=0;h=0;ss=0; window.status = '00 : 00 : 00' ; document.formu.heure.value ='00 : 00 : 00';document.formu.seco.value='0'+0;}">
</form>
</div>



<!-- Chrono -->

<div class="col s6">
<h3>Randomizer</h3>

	<iframe src="https://www.random.org/widgets/integers/iframe.php" style="border:0px #FFFFFF none;" name="random" scrolling="no" frameborder="1" marginheight="0px" marginwidth="0px" height="200px" width="160px"></iframe>

</div>

<div class="col s12">
<h3>Convertisseur</h3>

<div id='gcw_mainFrtIe0oOc' class='gcw_mainFrtIe0oOc'></div>
<script>function reloadFrtIe0oOc(){ var sc = document.getElementById('scFrtIe0oOc');if (sc) sc.parentNode.removeChild(sc);sc = document.createElement('script');sc.type = 'text/javascript';sc.charset = 'UTF-8';sc.async = true;sc.id='scFrtIe0oOc';sc.src = 'http://freecurrencyrates.com/fr/widget-horizontal-editable?iso=EURGBP&df=2&p=FrtIe0oOc&v=it&source=yahoo&width=600&width_title=200&firstrowvalue=1&thm=cccccc,F9F9F9,A3A3A3,333333,eeeeee,cccccc,ffffff,222222,000000&title=Currency%20Converter&tzo=-120';var div = document.getElementById('gcw_mainFrtIe0oOc');div.parentNode.insertBefore(sc, div);} reloadFrtIe0oOc(); </script>
</div>


<div class="col s4">
<h3>Programme TV</h3>
<a href="{{ url_for('tv') }}" class="btn {{ buttonColor }}">Voir le programme TV</a>
</div>

<div class="col s4">
<h3>Wiki</h3>
<a href="{{ url_for('wiki') }}" class="btn {{ buttonColor }}">Wiki</a>
</div>

<div class="col s4">
<h3>Traduction</h3>
<a href="{{ url_for('translate') }}" class="btn {{ buttonColor }}">Traduction</a>
</div>

<div class="col s4">
<h3>Transports en commun</h3>
<a href="{{ url_for('transport') }}" class="btn {{ buttonColor }}">RATP</a>
	</div>
</div>

{% endblock %}

{% block script %}


<script language='JavaScript'>
	ss=0;
	s=00;
	m='0'+0;
	h='0'+0;
	j=0;
	window.status = h + ' : '  + m + ' : ' + s ; 
	function Chrono() {
		if (m==0) {m='00'}
		if(h==0) {h='00'}
		if (ss<10){ss='0'+ss;}
		if (s<10){s='0'+s;}
		 window.status = h + ' : '  + m + ' : ' + s ; 
		document.formu.heure.value =h + ' : ' + m + ' : ' + s ;
		s++;
		ss++;
		if (h==24){h='0'+0;j++;}
		if (s==60){s=0;s=0; m++;if(m<10){m='0'+m;}}
		if (m==60){m='0'+0;h++;if(h<10){h='0'+h;}}
	chrono=window.setTimeout("Chrono();",1000);
	}
</script>




{% endblock %}
