/*
// by Sitsanlis Ilias
*/

var startLabel="Έναρξη",pauseLabel="Παύση",dtSlowFactor=.1;function toggleFullScreen(){var t=window.document,e=t.documentElement,o=e.requestFullscreen||e.mozRequestFullScreen||e.webkitRequestFullScreen||e.msRequestFullscreen,n=t.exitFullscreen||t.mozCancelFullScreen||t.webkitExitFullscreen||t.msExitFullscreen;t.fullscreenElement||t.mozFullScreenElement||t.webkitFullscreenElement||t.msFullscreenElement?n.call(t):o.call(e)}function checSlowMotion(){dt=(dtSlow=$("#slowMotion").is(":checked")?dtInitial*dtSlowFactor:dtInitial,dtSlow)}function playMovieStartClick(){framePlay=!1,playMovie=!0}function playMoviePauseClick(){framePlay=!1,playMovie=!1}function stopButtonCkick(){playMovie=!1,dt=dtSlow,restart()}$(document).ready(function(t){var e=$("#refresh");"yes"==e.val()?location.reload(!0):e.val("yes")}),$(function(){$("#fullScreen").button({text:!1,label:"Πλήρης Οθόνη",icons:{primary:"ui-icon-extlink"}}).click(function(){toggleFullScreen()})}),$(function(){$("#beginning").button({text:!1,icons:{primary:"ui-icon-seek-first"}}).bind("touchstart mousedown",function(t){dt=-dtSlow,playMovie=!0,framePlay=!0}).bind("touchend mouseup",function(t){playMovie=!1,framePlay=!1,dt=dtSlow,$("#play").button("option",{label:"Έναρξη",icons:{primary:"ui-icon-play"}})}),$("#end").button({text:!1,icons:{primary:"ui-icon-seek-end"}}).click(function(){playMovie=!0,framePlay=!0,$("#play").button("option",{label:startLabel,icons:{primary:"ui-icon-play"}})}),$("#rewind").button({text:!1,icons:{primary:"ui-icon-seek-prev"}}).mousedown(function(){playMovie=!0,dt=-dtSlow*factor}).bind("touchstart",function(t){playMovie=!0,dt=-dtSlow*factor,t.preventDefault()}).bind("touchend mouseup",function(t){dt=dtSlow,playMovie=!1,$("#play").button("option",{label:startLabel,icons:{primary:"ui-icon-play"}})}),$("#forward").button({text:!1,icons:{primary:"ui-icon-seek-next"}}).mousedown(function(){playMovie=!0,dt=dtSlow*factor}).bind("touchstart",function(t){playMovie=!0,dt=dtSlow*factor,t.preventDefault()}).bind("touchend mouseup",function(t){dt=dtSlow,playMovie=!1,$("#play").button("option",{label:startLabel,icons:{primary:"ui-icon-play"}})}),$("#play").button({text:!1,label:startLabel,icons:{primary:"ui-icon-play"}}).click(function(){var t=playMovie?(playMoviePauseClick(),{label:startLabel,icons:{primary:"ui-icon-play"}}):(playMovieStartClick(),{label:pauseLabel,icons:{primary:"ui-icon-pause"}});$(this).button("option",t).button("refresh")}),$("#stop").button({text:!1,icons:{primary:"ui-icon-arrowrefresh-1-e"}}).click(function(){stopButtonCkick(),$("#play").button("option",{label:startLabel,icons:{primary:"ui-icon-play"}})}),$("#slowMotion").button({text:!1}).click(function(){checSlowMotion()})}),screen.orientation.addEventListener("change",function(){location.reload(!0)});