var _comblock = []; var _comon = true; 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 += 'SHARE YOUR THOUGHTS +'; } 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) + ' '; } } if(!_comon){ 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); } } } function talk_addform (targetdiv,isreply,idx) { proceed = true; if(document.getElementById('_commentform')){ if(_comformchange){ if(!confirm('Are you sure you want to start a new comment?')){ proceed = false; } } if(proceed){ $("#_commentform").remove(); } } if(proceed){ _comformchange = false; var formdiv = document.createElement("div"); formdiv.setAttribute("id","_commentform"); document.getElementById(targetdiv).appendChild(formdiv); var output = '
SHARE YOUR THOUGHTS'; output += ''; output += ''; output += ' '; output += 'In order to foster a civil and literate discussion that respects all participants, FRONTLINE has the following guidelines for commentary. By submitting comments here, you are consenting to these rules:

Readers\' comments that include profanity, obscenity, personal attacks, harassment, or are defamatory, sexist, racist, violate a third party\'s right to privacy, or are otherwise inappropriate, will be removed. Entries that are unsigned or are "signed" by someone other than the actual author will be removed. We reserve the right to not post comments that are more than 400 words. We will take steps to block users who repeatedly violate our commenting rules, terms of use, or privacy policies. You are fully responsible for your comments.
'; output += ''; output += '<\/form>
' $("#_commentform").html(output); $("#_commentform").css( { display:"none" }); $("#_commentform").fadeIn(); } } function talk_overlay (ison) { if(ison){ var overlaydiv = document.createElement("div"); overlaydiv.className ="_comment_overlay"; overlaydiv.setAttribute("id","_commentover"); document.body.appendChild(overlaydiv); $("#_commentover").css( { display:"none", height: $(document).height() }); $("#_commentover").fadeIn(); } else { $("#_commentover").fadeOut("slow", function () { $("#_commentover").remove(); }); } } function talk_addcomment () { var pass = true; var errmsg = ''; if(document.getElementById("_comemail").value.length < 3 || document.getElementById("_comemail").value.indexOf("@") == -1){ pass = false; errmsg = 'Please verify your e-mail address.'; } if(document.getElementById("_commessage").value.length < 1){ pass = false; if(errmsg.length > 0){ errmsg += '\n'; } errmsg += 'Please enter a message.'; } if(pass){ var overlaydiv = document.createElement("div"); overlaydiv.className ="_comment_overlay"; overlaydiv.setAttribute("id","_commentover"); document.getElementById('_commentfrmouter').appendChild(overlaydiv); $("#_commentover").html(''); $("#_commentover").css( { marginTop: (0 - $('#_commentfrmouter').height()) - 9, height: $('#_commentfrmouter').height(), width: $('#_commentfrmouter').width() }); $("#_comloadimg").css( { marginTop: ($('#_commentfrmouter').height() / 2) - 16 }); $(window).resize( function () { $("#_commentover").css( { width: $('#_commentfrmouter').width() }); }); talk_transmit(); } else { alert('Please correct the following:\n' + errmsg); } return false; } function talk_transmit(){ var overlaydiv = document.createElement("div"); overlaydiv.setAttribute("id","_commentbridge"); document.body.appendChild(overlaydiv); overlaydiv.innerHTML = 'sending comment...'; var e = {}; _comformchange = false; e.centryid = _comeid; e.sendnow = true; e.cname = encodeURIComponent(document.getElementById('_comauthor').value); e.cemail = encodeURIComponent(document.getElementById('_comemail').value); e.cbody = encodeURIComponent(document.getElementById('_commessage').value); _papobject.embedSWF('http://www.pbs.org/wgbh/pages/frontline/includes/swf/commentmt.swf',"_commentbridge","10","10","9",null,e,{allowScriptAccess:"always",wmode:"opaque"},{ id:'combridgeid',name:'_combridgena' }); } function talkreceived (stat) { $("#_commentover").html("

We appreciate your comment. Please be aware that not all comments are posted.<\/p>"); var x = setTimeout(talkfade,10000); document.getElementById('_comauthor').value = ''; document.getElementById('_comemail').value = ''; document.getElementById('_commessage').value = ''; } function talkfade () { $("#_commentover").fadeOut("slow", function (){ document.getElementById('_commentfrmouter').removeChild(document.getElementById('_commentover')); }); }