This is the nearest I have been able to get:
var myId="771240583";
var script='<script type="text/javascript" src="
http://ad.leadbolt.net/show_app_ad.js?section_id='+myId+'"></script>'
var layTop,layMid,layBot,ads,lastUrl;
//Called when application is started.
function OnStart()
{
app.SetOrientation("Portrait");
//Create a layout with objects vertically centered.
var layMain = app.CreateLayout( "absolute", "" );
layTop = app.CreateLayout( "linear", "Horizontal,Top,Center" ); ;
layMid = app.CreateLayout( "linear", "VCenter" );
layBot = app.CreateLayout( "linear", "Horizontal,Bottom,Center" );
layMain.AddChild(layTop);
layMain.AddChild(layMid);
layMain.AddChild(layBot);
layPos();
var txtT=app.CreateText("Text Top");
layTop.AddChild(txtT);
var btnT=app.CreateButton("Top");
layTop.AddChild(btnT);
var txtM=app.CreateText("Middle",-1,-1,"AutoScale");
layMid.AddChild(txtM);
ads=app.CreateWebView(0.8,0.1,"IgnoreErrors,NoScrollbars");
ads.SetOnProgress(adsOnProgress);
ads.LoadHtml(script)
//ads.LoadUrl("
http://www.google.com");
layBot.AddChild(ads);
var btn=app.CreateButton("[fa-arrows-alt]",-1,-1,"fontawesome");
btn.SetOnTouch(bigger);
layBot.AddChild(btn);
//Add layout to app.
app.AddLayout( layMain );
layTop.SetBackGradient("#ff222266","#ff2222aa");
layMid.SetBackColor("#ff666666");
layBot.SetBackColor("#ff222288");
}
function adsOnProgress()
{
var schemes=["market","https","http"]
var url=this.GetUrl();
var schemePos=url.indexOf("://");
var scheme;
// don't check the same url again
// or a url with no scheme
if(url===lastUrl||schemePos === -1) return;
lastUrl=url;
scheme=url.slice(0,schemePos);
//check schene is in our list
if(schemes.indexOf(scheme) > -1)
{
//reload webview to clear error message
//this.LoadHtml(script);
//send url to browser
app.OpenUrl(url);
}
else app.ShowPopup(url)
}
function layPos()
{
var high=110/app.GetScreenHeight();;
layTop.SetPosition(0,0,1,high);
layMid.SetPosition(0,high,1,1-high*2.5);
layBot.SetPosition(0,1-high*1.5,1,high*1.5);
}
function bigger()
{
if(ads.GetHeight()<0.7)
{
layBot.SetPosition(0,0.05,1,0.8);
ads.SetSize(0.8,0.8);
}
else
{
ads.SetSize(0.8,0.1);
layPos();
}
}