// JavaScript Document

var fullscreenvideo = false;


function StartVideo(){
  //var IE = navigator.appName.indexOf("Microsoft") != -1;
  //var oggetto = IE ? window.mainMovie : window.document.mainMovie;
  var oggetto;
  oggetto = document.getElementById("my_video");
  //alert(oggetto);
  oggetto.Play();
}

function setFullScreen(full){
	var box_video;
	var	barra_resize;
	height_pagina = document.body.clientHeight;
//	alert("height_pagina: " + height_pagina);
	width_pagina = document.body.clientWidth;
//	alert("width_pagina: " + width_pagina);
	height_top = document.getElementById("top");
	height_top = height_top.style.top;
	height_top = 180;

	if(full == true){
		//setto il fullscreen
		fullscreenvideo = true;
		
		box_video = document.getElementById("layervideo");
		box_video.style.top = 0 + 'px';
		box_video.style.left = 0 + 'px';
		box_video.style.width = '100%';
		box_video.style.height = (height_pagina - 40) + 'px';
		
		//nascondo label "SET FULL SCREEN"
		hide_it();
		
		barra_resize = document.getElementById("barra_resize_video");
		barra_resize.style.top = (height_pagina - height_top - 30) + 'px';
		barra_resize.style.visibility = 'visible';
	}else{
		//torno alla visualizzazione piccola
		fullscreenvideo = false;

		box_video = document.getElementById("layervideo");
		new_l = parseInt(width_pagina/2 + 55);
		if(new_l<0)
			new_l = 0;
		box_video.style.left = new_l + 'px';
		box_video.style.top = 320 + 'px';
		box_video.style.width = 258 + 'px';
		box_video.style.height = 172 + 'px';

		barra_resize = document.getElementById("barra_resize_video");
		barra_resize.style.visibility = 'hidden';
	}
}

function show_fullscreen(){
	if(fullscreenvideo == false){
	  var oggetto;
	  oggetto = document.getElementById("testo_video");
	  oggetto.style.visibility = 'visible';	
	}  
}

function hide_fullscreen(){
		setTimeout("hide_it()",3000); 
}

function hide_it(){
  var oggetto;
  oggetto = document.getElementById("testo_video");
  oggetto.style.visibility = 'hidden';	
}
