function parseYouTube(vStr) {
	vStr=vStr.replace(/\"/gi,"'");
	var pos=vStr.indexOf("http://www.youtube.com");
	if (pos<0) pos=vStr.indexOf("http://www.youtube-nocookie.com");
	if (pos<0) {
		return false;
	} else if (pos==0) {
		vStr=vStr.replace("/watch?v=","/v/");
		vStr=vStr.replace("/watch_popup?v=","/v/");
	} else if (pos>0) {
		vStr=vStr.substring(pos);
		vStr=vStr.substring(0,vStr.indexOf("'"));
	}
	return vStr;
}
function embedYouTube(vStr, width, height, autoplay, loop) {
	var str="<object type='application/x-shockwave-flash' data='"+vStr+"&autoplay="+autoplay+"&loop="+loop+"' width='"+width+"' height='"+height+"' style='outline:none;'>";
	str+="<param name='movie' value='"+vStr+"&autoplay="+autoplay+"&loop="+loop+"'></param>";
	str+="<param name='allowFullScreen' value='true'></param>";
	str+="<param name='allowscriptaccess' value='always'></param>";
	str+="<param name='wmode' value='opaque'></param>";
	str+="<embed src='"+vStr+"&autoplay="+autoplay+"&loop="+loop+"' type='application/x-shockwave-flash' allowFullScreen='true' allowscriptaccess='always' wmode='opaque' width='"+width+"' height='"+height+"'></embed>";
	str+="</object>";
	return str;
}
function imgYouTube(vStr) {
	var imgSrc=vStr.substring(vStr.indexOf("/v/")+3);
	var pos=imgSrc.indexOf("?");
	if (pos>0) imgSrc=imgSrc.substring(0,pos);
	pos=imgSrc.indexOf("&");
	if (pos>0) imgSrc=imgSrc.substring(0,pos);
	imgSrc="http://img.youtube.com/vi/"+imgSrc+"/0.jpg";
	return imgSrc;
}