Hi, you would need to use the object name specified at the 'id' parameter:
embedpano({swf:"VirtualTours/fatema/index.swf", id:"krpano", xml:"VirtualTours/fatema/index.xml", target:"pano", width:"516", height:"300"});
and
document.getElementById("krpano");