
function playVideo(k,autoplay){var video=videos[k];if(autoplay)
video.embed_url+='&autoplay=1';var attrs=['duration','created','title','description'];for(var i=0;i<attrs.length;i++)
$('cwplayer-'+attrs[i]).innerHTML=video[attrs[i]];var a=$('cwplayer-creator');a.href="http://www.youtube.com/user/"+video.creator;a.innerHTML=video.creator;$('cwplayer-object').innerHTML=fixEmbeddedVideo("\
 <object width='480' height='295'>\
  <param id='cwplayer-id1' name='movie' value='"+video.embed_url+"'></param>\
  <param name='allowFullScreen' value='true'></param>\
  <param name='allowscriptaccess' value='always'></param>\
  <embed id='cwplayer-id2' src='"+video.embed_url+"' type='application/x-shockwave-flash' allowscriptaccess='always' allowfullscreen='true' width='480' height='295'></embed>\
 </object>\
 ");window.scrollTo(0,125);if($defined(location))
location.hash=video.youtube_key;return false;}
function fixEmbeddedVideo(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;}}
window.addEvent('domready',function(){if($defined(location)&&$defined(location.hash)&&location.hash!=''){for(var i=0;i<videos.length;i++){if('#'+videos[i].youtube_key==location.hash){playVideo(i,false);}}}});