function createFrame(url) {
var s = '<iframe name="mainFrame" scrolling="auto" frameborder="0" src="' + url + '" style="width:100%;height:100%;"></iframe>';
return s;
}
function addTab(subtitle, url) {
var jq = top.jQuery;
if (!jq('#tabs', top.document).tabs('exists', subtitle)) {
jq('#tabs', top.document).tabs('add', {
title: subtitle,
content: createFrame(url),
closable: true,
width: $('#mainPanle').width() - 10,
height: $('#mainPanle').height() - 26
});
} else {
jq('#tabs', top.document).tabs('select', subtitle);
var selTab = jq('#tabs', top.document).tabs('getSelected');
jq('#tabs', top.document).tabs('update', {
tab: selTab,
options: {
content: createFrame(url)
}
})
}
}