/*
	top.js
*/

//----------------------------------------
//	youtubeボタン別画像ラップ
//----------------------------------------
$(function(){
	

    var params	= { allowScriptAccess: "always" };
    var atts	= { id: "smovie" };
    // side
	swfobject.embedSWF("http://www.youtube.com/v/VKSE73wqdDQ?enablejsapi=1&playerapiid=smovie", 
                       "smovie", "190", "131", "8", null, null, params, atts);
    
	
	// main
	var params2	= { allowScriptAccess: "always" };
	var atts2	= { id: "mflash" };
	swfobject.embedSWF("swf/top.swf", "mflash", "954", "309", "8", null, null, params2, atts2);

	
});


// /*youtubeの再生準備ができたら*/
function onYouTubePlayerReady(playerId)
{
	if( playerId == "smovie" )
	{
		var smovie = document.getElementById("smovie");
		$("#smovie").css('visibility','hidden');
		$("#smovie").css('display','block');
		//alert(smovie);
		/*if( isIE(6) == true )
		{
			tgt_elm = '.movie embed';
			$(tgt_elm).css('filter','alpha(opacity=0)');
			$(tgt_elm).css('opacity','0.0');
		}*/
		
		/*var tgt_elm = ".movie object";
		$(".movie").mouseover(function(){
			$(this).css('filter','alpha(opacity=80)');
			$(this).css('opacity','0.8');
		});
		$(".movie").mouseout(function(){
			$(this).css('filter','alpha(opacity=100)');
			$(this).css('opacity','1.0');
		});
		$(".movie").click(function(){
			$(this).css('background', 'none');
			$(tgt_elm).css('filter','alpha(opacity=100)');
			$(tgt_elm).css('opacity','1.0');
			
			$(this).unbind('mouseover');
			$(this).unbind('mouseout');
			smovie.playVideo();
		});*/
		var tgt_elm = ".movie #smovie";
		$(".movie").mouseover(function(){
			$(this).css('filter','alpha(opacity=80)');
			$(this).css('opacity','0.8');
		});
		$(".movie").mouseout(function(){
			$(this).css('filter','alpha(opacity=100)');
			$(this).css('opacity','1.0');
		});
		$(".movie").click(function(){
			$(this).css('background', 'none');
			$(tgt_elm).css('visibility','visible');
			
			$(this).unbind('mouseover');
			$(this).unbind('mouseout');
			smovie.playVideo();
		});
	}
	
}
