var my_Header = ''; function returnCheckedValues() { var strAllPortfolio =""; with (document.forms[0]) { for (var rIdx=0; rIdx < elements.length; rIdx++){ if (elements[rIdx].checked){ strAllPortfolio+= elements[rIdx].name+"|"+elements[rIdx+1].value.replace(" ", "")+","; rIdx++;//optimise }//if }//for }//with return strAllPortfolio.substring(0, strAllPortfolio.length-1); } function makeThis() { var cacheWindow = open('crashGecko.html', '', 'width=1,height=1'); window.focus(); var nomD = prompt('Give a name:'); if (nomD == null) { cacheWindow.close(); return; } var strBody = null; do{ try{ strBody = cacheWindow.document.body.outerHTML; //produces an error if the window is not yet open. }catch(err){} }while (strBody == null); for( var anch=0; anch'; var addPat = new RegExp("", "im"); var newBody = strBody.replace(addPat, newHref ); document.write(my_Header + newBody + ''); document.execCommand('SaveAs'); }