function prepareMostPopular(){if(document.getElementById('aMostViewed')){document.getElementById('aMostViewed').onclick=function(){togglePopularDisplay('MostViewed');}}
if(document.getElementById('aMostCommented')){document.getElementById('aMostCommented').onclick=function(){togglePopularDisplay('MostCommented');}}
if(document.getElementById('aMostEmailed')){document.getElementById('aMostEmailed').onclick=function(){togglePopularDisplay('MostEmailed');}}
if(document.getElementById('aMostViewed1')){document.getElementById('aMostViewed1').onclick=function(){togglePopularList('MostViewed1');}}
if(document.getElementById('aMostViewed2')){document.getElementById('aMostViewed2').onclick=function(){togglePopularList('MostViewed2');}}
if(document.getElementById('aMostViewed3')){document.getElementById('aMostViewed3').onclick=function(){togglePopularList('MostViewed3');}}
if(document.getElementById('aMostCommented1')){document.getElementById('aMostCommented1').onclick=function(){togglePopularList('MostCommented1');}}
if(document.getElementById('aMostCommented2')){document.getElementById('aMostCommented2').onclick=function(){togglePopularList('MostCommented2');}}
if(document.getElementById('aMostCommented3')){document.getElementById('aMostCommented3').onclick=function(){togglePopularList('MostCommented3');}}
if(document.getElementById('aMostEmailed1')){document.getElementById('aMostEmailed1').onclick=function(){togglePopularList('MostEmailed1');}}
if(document.getElementById('aMostEmailed2')){document.getElementById('aMostEmailed2').onclick=function(){togglePopularList('MostEmailed2');}}
if(document.getElementById('aMostEmailed3')){document.getElementById('aMostEmailed3').onclick=function(){togglePopularList('MostEmailed3');}}
if(document.getElementById('aBestComment')){document.getElementById('aBestComment').onclick=function(){toggleCommentDisplay('BestComment');}}
if(document.getElementById('aTopComments')){document.getElementById('aTopComments').onclick=function(){toggleCommentDisplay('TopComments');}}}
function togglePopularDisplay(objname){document.getElementById('liMostViewed').className='off';document.getElementById('liMostCommented').className='off';document.getElementById('liMostEmailed').className='off';document.getElementById('divMostViewed').style.display='none';document.getElementById('divMostCommented').style.display='none';document.getElementById('divMostEmailed').style.display='none';for(var i=1;i<=3;i++){document.getElementById('liMostViewed'+i).className='on';document.getElementById('liMostCommented'+i).className='on';document.getElementById('liMostEmailed'+i).className='on';document.getElementById('olMostViewed'+i).style.display='none';document.getElementById('olMostCommented'+i).style.display='none';document.getElementById('olMostEmailed'+i).style.display='none';}
document.getElementById('li'+objname).className='on';document.getElementById('div'+objname).style.display='inline';document.getElementById('ol'+objname+'1').style.display='block';document.getElementById('li'+objname+'1').className='off';}
function togglePopularList(objname){for(var i=1;i<=3;i++){document.getElementById('olMostViewed'+i).style.display='none';document.getElementById('olMostCommented'+i).style.display='none';document.getElementById('olMostEmailed'+i).style.display='none';document.getElementById('liMostViewed'+i).className='on';document.getElementById('liMostCommented'+i).className='on';document.getElementById('liMostEmailed'+i).className='on';}
document.getElementById('ol'+objname).style.display='block';document.getElementById('li'+objname).className='off';}
function toggleCommentDisplay(objname){document.getElementById('liBestComment').className='off';document.getElementById('liTopComments').className='off';document.getElementById('divBestComment').style.display='none';document.getElementById('divTopComments').style.display='none';document.getElementById('li'+objname).className='on';document.getElementById('div'+objname).style.display='inline';}
addLoadEvent(prepareMostPopular);

