function replace_pic_with_youtube_vid(vidID, videoArea, videopluginLink, videopluginText, videopluginArea){

var fixEmbeddedVideo = function(embedCode) {
   if(embedCode && embedCode.toLowerCase().indexOf('classid') == -1) {
      var objPos = embedCode.toLowerCase().indexOf('object') + 'object'.length;
      return embedCode.substr(0, objPos) + 'classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ' + embedCode.substr(objPos);
   } else {
      return embedCode;
   }
}

	//var vidID="jy7gIDiSIYc"; //Maor Daniel CP24 Video
	var height="260";
	var width="320";
	var allowFullScreen="true";
	var allowscriptaccess="always";
	var autoplay="1"; // yes to autoplay
	var fs="1";
	var hl="en";
	var pageTrackerText=videopluginText.replace(' ', '_');

	pageTracker._trackPageview(pageTrackerText + '_video.htm?src='+RefPage());

	//var videoArea="videoplugin";
	var videoDescription="stickynotes";
	
	var vid="<object width=\"" + width + "\" height=\"" + height + "\" >" + 
	"<param name=\"movie\" value=\"http://www.youtube.com/v/" + vidID + "&hl=" + hl + "&fs=" + fs + "&autoplay=" + autoplay + "\"></param>" + 
	"<param name=\"allowFullScreen\" value=\"" + allowFullScreen + "\"><" + "/param>" + 
	"<param name=\"allowscriptaccess\" value=\"" + allowscriptaccess + "\"><" + "/param>" + 
	"<embed src=\"http://www.youtube.com/v/" + vidID + "&hl=" + hl + "&fs=" + fs + "&autoplay=" + autoplay + "\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"" + allowscriptaccess + "\" allowfullscreen=\"" + allowFullScreen + "\" width=\"" + width + "\" height=\"" + height + "\"><" + "/embed>" + 
	"</object>";
	
	var callFunc="replace_pic_with_youtube_vid('" + vidID + "', '" + videoArea + "', '" + videopluginLink + "', '" + videopluginText + "', '" + videopluginArea + "')";
	
	document.getElementById(videoDescription).innerHTML="";
	document.getElementById(videoArea).innerHTML=fixEmbeddedVideo(vid);
	var IE = /*@cc_on!@*/false;
	var video_caption='<a id="videopluginlink" onclick="'+callFunc+'">'+videopluginText+'</a>';
	if(IE)
	{
		$("#"+videopluginLink).html(video_caption);
	}
	else
	{
		document.getElementById("videopluginlink").innerHTML=video_caption;
		document.getElementById("videopluginlink").onclick=callFunc;
	}
	
	return false;
}