var link = '<aid="'+openerId+'"href="#"class="btn">'+
var link = '<aid="'+openerId+'"href="#"class="generated btn">'+
'<divstyle="text-align: center"><imgsrc="<?phpechoapi_get_path(WEB_CODE_PATH).'img/play-circle-8x.png';?>"/><br/>If video does not work, try clicking here.</div></a>';
var embed = $("iframe").contents().find("#"+this.id).find('embed').first();
var w = window.open(completeUrl, "Video", "width="+width+", "+"height="+height+"");
w = window.document.title = 'Video';
});
});
var iframes = $("iframe").contents().find('iframe');
iframes.each(function (value, obj) {
var randLetter = String.fromCharCode(65 + Math.floor(Math.random() * 26));
var uniqid = randLetter + Date.now();
var openerId = uniqid +'_opener';
var link = '<aid="'+openerId+'"class="generated"href="#">If iframe does not work, try clicking here. <imgsrc="<?phpechoapi_get_path(WEB_CODE_PATH).'img/link-external.png';?>"/></a>';
var embed = $(this);
var height = embed.attr('height');
var width = embed.attr('width');
var src = embed.attr('src');
var completeUrl = url + 'width='+embed.attr('width')+
'&height='+height+
'&type=iframe'+
'&id='+uniqid+
'&src='+src+
'&width='+width;
var result = $("iframe").contents().find('#'+openerId);