var _comblock = []; var _comon = false; var _comlive = false; var _comratingon = false; var _comtotal = 0; var _comincrement = 50; var _comeid = 0; var _comformchange = false; var _comswf = 'http://www.pbs.org/wgbh/pages/frontline/includes/swf/commentbridge.swf'; function talk_rendercallback (inhash) { _comblock = inhash.discussion; _comon = (inhash.enabled == "1")? true:false; _comlive = (inhash.islive == "1")? true:false; _comtotal = inhash.total; _comeid = inhash.eid; talk_renderpage(0); } function talk_commentrate (isup,idx){ _comblock[idx].israted = true; if(isup){ _comblock[idx].rs = parseInt(_comblock[idx].rs) + 1; } else { _comblock[idx].rs = parseInt(_comblock[idx].rs) - 1; } var thisrate = parseInt(_comblock[idx].rs); if(-9 > thisrate){ document.getElementById('flcom'+idx).className = (_comblock[idx].rt == '')? '_comment _commentbad':'_comment_r _commentbad'; } else { document.getElementById('flcom'+idx).className = (_comblock[idx].rt == '')? '_comment':'_comment_r'; } var output = ' Rating ('; if(thisrate > 0){ output += '+'; } output += thisrate + ')'; document.getElementById('flcomrt'+idx).innerHTML = output; } function talk_intrender (idx){ var output = '
' + _comblock[idx].pt + ''; if(_comblock[idx].er != undefined){ var elresponse = decodeURIComponent(_comblock[idx].er); if(elresponse.indexOf('"') != -1){ var elp = elresponse.split('"'); elresponse = ''; for(var x = 0; x < elp.length; x++){ elresponse += elp[x]; if(x != (elp.length - 1)){ elresponse += '"'; } } } output += 'FRONTLINE\'s Editors Respond:
' + talk_brwork(elresponse) + '
'; } output += ''; if(_comblock[idx].rt == '' && _comon && _comblock[idx].cc != "1"){ output += 'Respond'; } if(_comratingon){ output += ''; if(!_comblock[idx].israted){ output += ' '; } output += ' Rate This ('; if(thisrate > 0){ output += '+'; } output += thisrate + ')'; } output += '
'; return output; } function talk_brwork (intext) { var outtext = new String(); if(intext.indexOf('\n') != -1){ var elp = intext.split('\n'); for(var x = 0; x < elp.length; x++){ outtext += elp[x]; if(x != (elp.length - 1)){ outtext += '
'; } } } else { outtext = intext; } return outtext; } function talk_renderpage (offset) { var activateform = false; if(document.getElementById('commentarea')){ var output = '
'; if(_comon && _comtotal > 0){ output += '

COMMENTS ON THIS PAGE ARE ARCHIVED. SHARE YOUR THOUGHTS HERE

'; } var counttext = ''; if(_comtotal == 0){ counttext += 'comments'; } else { counttext += '' + _comtotal + ''; counttext += (_comtotal > 1)? " comments":"comment"; } if(_comtotal > _comincrement){ counttext += ' / PAGES '; for(var cp = 0; (cp * _comincrement) < _comtotal; cp++){ counttext += ((cp * _comincrement) == offset)? '' + (cp + 1) + ' ':'' + (cp + 1) + ' '; } } counttext += ' (comments closed)'; counttext += ''; output += counttext; if(_comtotal > 0){ var thisinc = _comblock.length; if(_comblock.length > _comincrement){ thisinc = _comincrement; if((offset + _comincrement) > _comblock.length){ thisinc = _comblock.length - offset; } } thisinc += offset; for(var x = offset; x < thisinc; x++){ output += talk_intrender(x); } } else { activateform = true; } if(_comtotal > 10){ activateform = true; } if(_comtotal > _comincrement){ output += counttext; } output += '
'; document.getElementById('commentarea').innerHTML = output; if(_comon){ talk_addform('comment_top',false); } } }