function preview(a) { if(a.innerHTML == '[Preview]') { var ifr = document.createElement('IFRAME'); a.parentNode.insertBefore(ifr,a.nextSibling); a.parentNode.insertBefore(document.createElement('BR'),ifr); ifr.src=sites[a.id]; ifr.style.width='60%'; a.innerHTML = '[Close Preview]'; } else { a.parentNode.removeChild(a.nextSibling); a.parentNode.removeChild(a.nextSibling); a.innerHTML='[Preview]'; } }