<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>External Widget</title>

<style type="text/css">
body { 	
    margin: 0;
    padding: 0;
    text-align: center;
}
</style>


<script type="text/javascript">
    var bodyHeight = 0;
    var bodyWidth = 0;
    var wid = '';
    var code = '';

    function showWidget(){
        var url = window.location.search;
        var args = url.split("&");

        wid = args[0].split("=")[1];
        code = args[1].split("=")[1];

        document.write(decodeURIComponent(code));

        var updateSize = function() {
            if(document.height > 0) {
                bodyHeight = document.height;
                bodyWidth = document.width;
            } else if(document.body.offsetHeight > 0) {
                bodyHeight = document.body.offsetHeight;
                bodyWidth = document.body.offsetWidth;
            }

            if(bodyHeight > 0) {
                var w = parent.kernel.getWidget(wid);
                if(w) {
                    w.updateIframeSize(bodyWidth, bodyHeight);
                }
            }
            return false;
        }
        window.setInterval(updateSize, 1000); 
    }
</script>

</head>
<body>

<script type="text/javascript">
	showWidget();
</script>

</body>
</html>