var randLooping=false;var PKIpswd="";function certGen(){var f=document.form;var a=document.applets["ckcryptoapplet"];var i=0;if(a==null){return;}if(extractCookie("ckprngpool").length==0){if(confirm("Would you like strong random numbers?","")){strongRandom();return false;}}while(PKIpswd.length==0&&i++<3){PKIpswd=prompt("Enter password for decryption.","");}if(PKIpswd.length==0)return false;f.javacert.value=a.genKeyPair(PKIpswd);f.submit();return false;}function extractCookie(key){var f=document.form;var a=document.applets["ckcryptoapplet"];var cook=document.cookie,i;if(a==null){return;}arr=cook.split(";");for(i=0;i<arr.length;i++){if(arr[i].indexOf(key+"=")==0)return arr[i].substring(key.length+1,arr[i].length);}return "";}function oldStartHere(){}function startHere(){if(oldStartHere!=null)setTimeout("oldStartHere()",100);var f=document.form;var a=document.applets["ckcryptoapplet"];var pool=extractCookie("ckprngpool");if(a==null){return;}if(pool.length!=0){a.setRandPool(pool);document.cookie="ckprngpool="+a.getRandPool()+";path=/";}}function strongRandom(){var f=document.form;var a=document.applets["ckcryptoapplet"];if(a==null){return;}randLooping=true;a.launchRand();setTimeout("randDoneLoop()",250);}function randDoneLoop(){var f=document.form;var a=document.applets["ckcryptoapplet"];if(a==null){return;}if(a.randDone()){document.cookie="ckprngpool="+a.getRandPool()+";path=/";certGen();}else{setTimeout("randDoneLoop()",250);}}function copyPersToTech(){var f=document.form;e="name email phone street city province country postal".split(" ");for(var i=0;i<e.length;i++){eval("f.admin"+e[i]+".value=f.personal"+e[i]+".value");}}function copyPersToBill(){var f=document.form;e="name email phone street city province country postal".split(" ");for(var i=0;i<e.length;i++){eval("f.bill"+e[i]+".value=f.personal"+e[i]+".value");}}function copyTechToBill(){var f=document.form;e="name email phone street city province country postal".split(" ");for(var i=0;i<e.length;i++){eval("f.bill"+e[i]+".value=f.admin"+e[i]+".value");}}oldStartHere=window.onload;window.onload=startHere;