// comment box
function addVideo() {
	document.getElementById('video_container').style.display='';
	document.getElementById('addVideo').innerHTML='Video:';
}

function closeVideo() {
	document.getElementById('video_container').style.display='none';
	document.getElementById('addVideo').innerHTML='Video?';
	document.conversationform.video.value='';
}


function showVideo(id,video,width,height){

	document.getElementById('video-'+id).style.display='';
	document.getElementById('show-video-'+id).style.display='none';

	var params = { allowScriptAccess: "always" };
	var atts = { id: "myytplayer-$id" };
	swfobject.embedSWF("http://www.youtube.com/v/"+video+"&enablejsapi=1&playerapiid=ytplayer",
	                   "ytapiplayer-"+id, width,height, "8", null, null, params, atts);



}

function showVideoUni(video,width,height){

    document.getElementById("vid-container").innerHTML = '<div id="ytapiplayer">You need Flash player 8+ and JavaScript enabled to view this video.</div>';

	var params = { allowScriptAccess: "always" };
	var atts = { id: "myytplayer" };
	swfobject.embedSWF("http://www.youtube.com/v/"+video+"&enablejsapi=1&playerapiid=ytplayer",
	                   "ytapiplayer", width,height, "8", null, null, params, atts);

    document.getElementById('video-show').style.display='block';

}

function hiddenVideo(id){

	document.getElementById('video-'+id).style.display='none';
	document.getElementById('show-video-'+id).style.display='';
	stop(id);
}

function hiddenVideoUni(){

    document.getElementById('video-show').style.display='none';
	stopUni();
}


function stop(id) {
   var ytplayer = document.getElementById("myytplayer-"+id);
   if (ytplayer) {
            ytplayer.stopVideo();
   }
}

function stopUni() {
   var ytplayer = document.getElementById("myytplayer");
   if (ytplayer) {
            ytplayer.stopVideo();
   }
}

function play(id) {

   var ytplayer = document.getElementById("myytplayer-"+id);
   if (ytplayer) {
            ytplayer.playVideo();
   }


}

google.load("swfobject", "2.1");

