// this is a little trick to show the overlay on vimeo videos autoembedded by tumblr
// coded by me, pino ceniccola in june 2008 - http://me.pinit.it
function videotrick(){
var vids = document.getElementsByTagName("object");
for (var i=0; i<vids.length; i++) {
	thedata = vids[i].getAttribute("data"); 
	if (thedata>""&&thedata.indexOf('vimeo.com') != -1) {
		vids[i].setAttribute("style", "display:none");
		var regexS = "[\\?&]"+'clip_id'+"=([^&#]*)";
		var regex = new RegExp( regexS );
		var results = regex.exec(thedata);
		theembed = vids[i].lastChild.cloneNode(true);
		theembed.setAttribute("wmode", "opaque");
		theembed.setAttribute("src", "http://vimeo.com/moogaloop.swf?clip_id="+results[1]+"&fullscreen=1&show_title=0&show_byline=0&show_portrait=0"); 
		theid = vids[i].parentNode.getAttribute('id');
		x = document.getElementById(theid);
		x.replaceChild(theembed, vids[i]);
		vids[i] = theembed;
	} 
	vids[i].setAttribute("style", "display:block");
}
}

function onContent(f){//(C)webreflection.blogspot.com (with this we can fire functions when DOM is loaded. ps: never ask him if is the best way to do that, 'cause he is so touchy)
var a,b=navigator.userAgent,d=document,w=window,
c="__onContent__",e="addEventListener",o="opera",r="readyState",
s="<scr".concat("ipt defer src='//:' on",r,"change='if(this.",r,"==\"complete\"){this.parentNode.removeChild(this);",c,"()}'></scr","ipt>");
w[c]=(function(o){return function(){w[c]=function(){};for(a=arguments.callee;!a.done;a.done=1)f(o?o():o)}})(w[c]);
if(d[e])d[e]("DOMContentLoaded",w[c],false);
if(/WebKit|Khtml/i.test(b)||(w[o]&&parseInt(w[o].version())<9))
(function(){/loaded|complete/.test(d[r])?w[c]():setTimeout(arguments.callee,1)})();
else if(/MSIE/i.test(b))d.write(s);
};
IE=false;
/*@cc_on IE=true; @*/
ispost = window.location.href.indexOf('post/');
if (!IE&&ispost<0){onContent(videotrick);}