add a single class for all three div and use this :
$('.singleclass a').on('click',function() {
var url = $(this).attr('href');
var height = $('#divid').height();
var width = $('#divid').width();
$('#divid').replaceWith( "'<object data="+url+" width="+width+" height="+height+"/>'" );
return false;
});