/* 
openYouTube
Written by: Matteo Gattei
(C) 2009 Gattei.com - www.gattei.com
Uso:
Inserire nella pagina subito dopo il tag BODY un DIV come in questo esempio:
<div id="video" style="display:none"></div>

Per richiamarli basta un DIV come questo:
<div class="video" onclick="openYouTube('video','qZM5H1AuH5I',425,344);">Runaway</div>

*/ 
    function openYouTube(container,videocode,width,height)
	  {
		var myDiv=document.getElementById(container);
		myDiv.style.position='absolute';
		myDiv.style.width=width+"px";
		myDiv.style.height=height+20+"px";
		myDiv.style.background='#000000';
		myDiv.style.zIndex=10000;
		myDiv.style.top='50%';
		myDiv.style.left='50%';
		myDiv.style.border='10px solid #cccccc';
		var marginTOP=parseInt(width/2);
		marginTOP=marginTOP-marginTOP*2+10;
		myDiv.style.marginTop=marginTOP+"px";
		var marginLEFT=parseInt(width/2);
		marginLEFT=marginLEFT-marginLEFT*2+10;
		myDiv.style.marginLeft=marginLEFT+"px";
		myDiv.innerHTML='<div class="video_close"><a href="#" onclick="document.getElementById(\''+container+'\').style.display=\'none\'; document.getElementById(\''+container+'\').innerHTML=\'\'; ">Close</a></div><object width="'+width+'" height="'+height+'"><param name="movie" value="http://www.youtube.com/v/'+videocode+'&autoplay=1&hl=it&fs=1&rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/'+videocode+'&autoplay=1&hl=it&fs=1&rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="'+width+'" height="'+height+'"></embed></object>';
// SENZA SCRIPTACULOUS
		//myDiv.style.display='block';
// CON SCRIPTACULOUS
		Effect.SlideDown(container, { duration: 2.0 });
	  }
