// Clear objects
function clearChildren(object) {
    if (object) {
        if (object.hasChildNodes()) {
            while (object.childNodes.length >= 1) {
                object.removeChild(object.firstChild);
            }
        }
    }
}
function ini()
{
    // Check iframe id exists
    if(!document.getElementById("iframe")){ return; }
    var subjectObject = document.getElementById("iframe");
    
    // grab href if exists
    if(!subjectObject.firstChild.firstChild.href){ return; }
    var iFrameHREF = subjectObject.firstChild.firstChild.href;
    // Create iframe and populate attributes
    
    // Browser detection
     var browsername=navigator.appName;

    if(!(browsername.indexOf("Microsoft")!=-1))
    {
        // Miles is king
        var iFrame = document.createElement("iframe");
        iFrame.setAttribute("id","iframe1");
        iFrame.setAttribute("frameborder","0");
        iFrame.setAttribute("border","0");
        iFrame.setAttribute("name","iframe1");
        iFrame.setAttribute("vspace","0");
        iFrame.setAttribute("hspace","0");
        iFrame.setAttribute("marginwidth","0");
        iFrame.setAttribute("scrolling","auto");
                iFrame.setAttribute("src",iFrameHREF);
        iFrame.setAttribute("src",iFrameHREF);
    }else{
        // Roger is king!
        var iFrame = document.createElement("<iframe border=\"0\" frameborder=\"0\" id=\"iframe1\" name=\"iframe1\" vspace=\"0\" hspace=\"0\" src=\""+iFrameHREF+"\" scrolling=\"auto\">Sorry your browser doesn't support iframes</iframe>");  
    }
    
    clearChildren(subjectObject);
    // add iframe to object
    subjectObject.appendChild(iFrame);
    

}

// attach onlaod event
window.onload = ini;