var C='Copyright Hy Bern August 2004';function detag(s){if(s)return(s?s.replace(/date$|link$|text$/,'').replace(/"/g,"'").replace(/^ +| +$|[\s]+$/g,''):'');};var adate=new Date();var lowbnd=(adate.getFullYear()*100+(adate.getMonth()+1))*100+adate.getDate();function Bon($a){$a.style.borderColor="red";};function Boff($a){$a.style.borderColor="purple";};function shy(i){document.getElementById(i).style.display=(document.getElementById(i).style.display!="block")?"block":"none"};function deblock(s){if(s)return s.replace(/"\);[^H]H\("|H\("|"\);|[\r\n]+$/g,'')||'';};function detagln(s){if(s)return detag(s.replace(/[\r\n]/g,''));};function xHB(){var i,s,t,d,ymd;if(!document.h.y.value){alert('Sorry, no headlines found!');return;};s=document.h.y.value.split('|');t='';for(i=0;i<s.length-2;i+=3)if(s[i]){t+=(!(s[i].match(/date$/))?' date tag':'')+(!(s[i+1].match(/link$/))?' link tag':'')+(!(s[i+2].match(/text$/))?' text tag':'');if(t){alert('Sorry, cannot process; noticed a problem around block '+(Math.floor(i/3)+1)+t+':\n'+s[i].substr(0.40)+'...\n|'+s[i+1].substr(0,40)+'...\n'+s[i+2].substr(0,40));return;}}document.h.y.value='';for(i=1;i<s.length-2;i+=3){t=detagln(s[i]);d=t.substr(0,10).split('/');ymd=parseInt(d[2]+(d[0].length>1?'':'0')+d[0]+(d[1].length>1?'':'0')+d[1]);if(ymd<lowbnd);else document.h.y.value+='H("'+ymd+'|'+escape(t.substr(11))+'|'+detagln(s[i+1])+'|'+escape(detag(s[i+2]))+'|");\n';}}function xText(){var i,s;if(!document.h.y.value){alert('Sorry, no headlines found!');return;}if(document.h.y.value.match(/\s*date\|/))return;s=deblock(document.h.y.value).split('|');document.h.y.value='';for(i=0;i<s.length-2;i+=4){if(parseInt(s[i])<lowbnd);else document.h.y.value+='date| '+ppd(s[i])+' '+unescape(s[i+1])+'\nlink| '+s[i+2]+'\ntext| '+unescape(s[i+3])+'\n\n';}}function ppd(X){var t,i;t='';if(!X)return '00/00/0000';X=detagln(X);if(X.length!=8){for(i=0;i<X.length;i++)t+=i+'='+X.substr(i,1)+' ';alert('ppd: X='+X+' ::'+t);}t=X.substr(4,2)+'/'+X.substr(6,2)+'/'+X.substr(0,4);return t;}var $b=new Array;function xHTML(){if(!document.h.y.value){alert('Sorry, no headlines found!');return;}if(document.h.y.value.match(/date\|/))xHB();var z,i,s,t;z='';s=deblock(document.h.y.value).split('|');for(i=0;i<s.length-2;i+=4){if(parseInt(s[i])<lowbnd);else{t=ppd(s[i])+' '+unescape(s[i+1]);if(s[i+2])z+='<a class="Ahy" href="'+s[i+2]+'"><br>'+t+' &#187;</a>';else if(!s[i+3])z+='<br>'+t+'<br>';else{z+='<a class="Ahy" href="javascript:{};" onClick="shy(\'hb'+i+'\');"><br>'+t+' &laquo;</a><div id="hb'+i+'" class="shy">'+unescape(s[i+3])+'</div>';$b[('hb'+i)]='';}}}return z;}function hyde(){for(var i in $b)document.getElementById(i).style.display="none";}function preview(l,s){var e,r,p;if(!document.h.y.value){alert('Sorry, no headlines found!');return;}if(document.all){document.all[l].innerHTML=s;}else if(document.layers){document[l].document.write(s);document[l].document.close();}else if(document.getElementById){e=document.getElementById([l]);r=document.createRange();r.setStartBefore(e);p=r.createContextualFragment(s);while(e.hasChildNodes())e.removeChild(e.lastChild);e.appendChild(p);}}var Hh='';function H(h){Hh+=h;}function HLoad(){document.h.y.value=Hh;}function ShowPage(){HLoad();preview('headlines',xHTML());hyde();xText();};function hyclick(e,adiv){if((e?e.which:window.event.button)!=1)shy("FEdit");return false;}
