<![CDATA[ var queryString = ""; // Query to saveanswer1.php var queryStringNeg = ""; // Query to saveanswer.php var feedback_element = ""; // Third parameter to httppost var vote_bool = false; var neg = false; function voteanshelp(aid,qid,vote,answer_text,question_text) { // Add Form call here, be sure to get return value to add to qqs "survey_results=" queryString = 'cmd=voteanshelp&aid='+aid+'&txy='+(tempX+tempY)+'&vote='+vote+'&answer_text='+answer_text+'&qid='+qid+'&question_text='+question_text; vote_bool = true; var votematch = vote.match("N"); feedback_element = 'spanabuseans'+aid; if ( votematch == "N" ){ queryStringNeg = 'answerid=' + aid + '&txy='+(tempX+tempY)+'&cmd=abuseans'; neg = true; document.getElementById('aep_t').innerHTML = '‘; // document.domain;; document.getElementById(‘aep_prompt’).innerHTML = “
Report this answer
This answer should be removed because:”; document.getElementById(‘aep_text’).value = ”; document.getElementById(‘aep_ovrl’).style.display = document.getElementById(‘aep_ww’).style.display = ”; document.getElementById(‘aep_text’).focus(); document.getElementById(‘aep_text’).select(); return false; } // Vote is yes // Checks for empty values in 2-5, and disables the button if it’s empty neg = false; var group = document.getElementsByName(‘helpgroup’); var rad_val =”; for (var i=0; i < group.length; i++) { rad_val = group[i].value; if (rad_val==''){ group[i].disabled = true; group[i].style.display = 'none'; } } document.getElementById('helpful_t').innerHTML = '‘; // document.domain; document.getElementById(‘helpful_prompt’).innerHTML = “
Tell ’em how you feel!
“; document.getElementById(‘helpful_text’).value = ”; document.getElementById(‘helpful_ovrl’).style.display = document.getElementById(‘helpful_ww’).style.display = ”; document.getElementById(‘helpful_text’).focus(); document.getElementById(‘helpful_text’).select(); } function votecommenthelp(commid,vote) { queryString = ‘cmd=votecommenthelp&commid=’+commid+’&txy=’+(tempX+tempY)+’&vote=’+vote; vote_bool = true; var votematch = vote.match(“N”); feedback_element = ‘spanabusecomment’+commid; if ( votematch == “N” ){ neg = true; queryStringNeg = ‘commentid=’ + commid + ‘&txy=’+(tempX+tempY)+’&cmd=abusecomment’; document.getElementById(‘aep_t’).innerHTML = ‘‘; // document.domain;; document.getElementById(‘aep_prompt’).innerHTML = “
Report this comment
This comment should be removed because:”; document.getElementById(‘aep_text’).value = ”; document.getElementById(‘aep_ovrl’).style.display = document.getElementById(‘aep_ww’).style.display = ”; document.getElementById(‘aep_text’).focus(); document.getElementById(‘aep_text’).select(); return false; } // Vote is yes neg = false; var group = document.getElementsByName(‘helpgroup’); var rad_val =”; for (var i=0; i < group.length; i++) { rad_val = group[i].value; if ( (rad_val == '') && (group[i].id != "default") ){ group[i].disabled = true; group[i].style.display = 'none'; } } document.getElementById('helpful_t').innerHTML = '‘;// document.domain; document.getElementById(‘helpful_prompt’).innerHTML = “
Tell ’em how you feel!
“; document.getElementById(‘helpful_text’).value = ”; document.getElementById(‘helpful_ovrl’).style.display = document.getElementById(‘helpful_ww’).style.display = ”; document.getElementById(‘helpful_text’).focus(); document.getElementById(‘helpful_text’).select(); } function help_clk(m) { var group = document.getElementsByName(‘helpgroup’); var rad_val =”; for (var i=0; i < group.length; i++) { if (group[i].checked) { rad_val = group[i].value; group[i].checked = false; group[0].checked = true; //(rad_val); } } if ( rad_val == "Custom Reason" ) { var custom_reason = document.getElementById('custom_text'); rad_val = custom_reason.value; custom_reason.value = ''; } document.getElementById('helpful_ovrl').style.display = document.getElementById('helpful_ww').style.display = 'none'; if ((!m)||(rad_val=='default')||(rad_val=='X')||(rad_val=='')) return false; // user pressed cancel else queryString = queryString+'&survey_entry='+escape(rad_val); xmlhttpPost("saveanswer1.php",queryString,feedback_element,true); } function reportasabuse(id,aid,rid){ neg = true; vote_bool = false; feedback_element = 'spanabuse'; queryString = ""; queryStringNeg = 'answerid=' + aid + '&txy='+(tempX+tempY)+'&cmd=abuse'; document.getElementById('aep_t').innerHTML = '‘; // document.domain;; document.getElementById(‘aep_prompt’).innerHTML = “
Report this question
This question should be removed because:”; document.getElementById(‘aep_text’).value = ”; document.getElementById(‘aep_ovrl’).style.display = document.getElementById(‘aep_ww’).style.display = ”; document.getElementById(‘aep_text’).focus(); document.getElementById(‘aep_text’).select(); } function reportabuseans(id,aid,rid) { neg = true; vote_bool = false; feedback_element = ‘spanabuseans’+aid; queryString = “”; queryStringNeg = ‘answerid=’ + aid + ‘&txy=’+(tempX+tempY)+’&cmd=abuseans’; document.getElementById(‘aep_t’).innerHTML = ‘‘; // document.domain;; document.getElementById(‘aep_prompt’).innerHTML = “
Report this answer
This answer should be removed because:”; document.getElementById(‘aep_text’).value = ”; document.getElementById(‘aep_ovrl’).style.display = document.getElementById(‘aep_ww’).style.display = ”; document.getElementById(‘aep_text’).focus(); document.getElementById(‘aep_text’).select(); } function reportabusecomment(id,aid,rid) { neg = true; vote_bool = false; feedback_element = ‘spanabusecomment’+aid; // 28/01/2013 – fix wrong call to saveanswer.php queryString = “”; queryStringNeg = ‘commentid=’ + aid + ‘&txy=’+(tempX+tempY)+’&cmd=abusecomment’; document.getElementById(‘aep_t’).innerHTML = ‘‘; // document.domain;; document.getElementById(‘aep_prompt’).innerHTML = “
Report this comment
This comment should be removed because:”; document.getElementById(‘aep_text’).value = ”; document.getElementById(‘aep_ovrl’).style.display = document.getElementById(‘aep_ww’).style.display = ”; document.getElementById(‘aep_text’).focus(); document.getElementById(‘aep_text’).select(); } // This function is called when user presses OK(m=0) or Cancel(m=1) button // in the dialog. You should not call this function directly. function ae_clk(m) { var group = document.getElementsByName(‘group’); var rad_val =”; for (var i=0; i
<![CDATA[ var gnewform; var intervalID; var htext="xxx"; var htextpopup="xxx"; function showval(qid,uid,done,firstans) { var qstr; f1=document.getElementById("popup_savenew"+qid); if (f1.popup_newtext.value != htextpopup) { htextpopup = f1.popup_newtext.value; qstr = 'ans='+escape(f1.popup_newtext.value)+'&txy='+(tempX+tempY)+ '&qid='+qid+'&uid='+uid+'&cmd=evalanswer&done='+done+'&firstans='+firstans; xmlhttpPost(prevdir+"showval.php",qstr,'popup_spanresshowval'+qid,true); } f1=document.getElementById("savenew"+qid); if (f1 != null) { if (f1.newtext.value != htext) { htext = f1.newtext.value; qstr = 'ans='+escape(f1.newtext.value)+'&txy='+(tempX+tempY)+ '&qid='+qid+'&uid='+uid+'&cmd=evalanswer&done='+done+'&firstans='+firstans; xmlhttpPost(prevdir+"showval.php",qstr,'spanresshowval'+qid,true); } } } var hclose; function display_answer_box(answerspanid, questionid, answerid) { var searchstr = ''; var showvalstr = ''; if (document.getElementById(answerspanid).innerHTML.indexOf('Post Answer')<0) { //if ((!document.getElementById('newcomment_'+answerid))||((document.getElementById('newcomment_'+answerid))&&(document.getElementById('newcomment_'+answerid).value==""))) { if (document.getElementById("menu_"+answerspanid)) { hclose=document.getElementById("menu_"+answerspanid).innerHTML; document.getElementById("menu_"+answerspanid).innerHTML =""; } document.getElementById(answerspanid).style.display = ""; document.getElementById(answerspanid).innerHTML = '
‘; //’; //} } else { //if (document.getElementById(‘newcomment_’+answerid).value==””) { document.getElementById(answerspanid).innerHTML =””; document.getElementById(answerspanid).style.display = “none”; if (document.getElementById(“menu_”+answerspanid)) { document.getElementById(“menu_”+answerspanid).innerHTML=hclose; } //} } } function display_comment_box(answerspanid, answerid, questionid) { hideReplyForms(‘replyCom_’); var searchstr = ”; var showvalstr = ”; if (document.getElementById(answerspanid).innerHTML.indexOf(‘Add Comment’)<0) { if ((!document.getElementById('newcomment_'+answerid))||((document.getElementById('newcomment_'+answerid))&&(document.getElementById('newcomment_'+answerid).value==""))) { var socialbox = ' Facebook Twitter Subscribe '; socialbox=socialbox.replace('{aid}',answerid).replace('{aid}',answerid); if (document.getElementById("menu_"+answerspanid)) { hclose=document.getElementById("menu_"+answerspanid).innerHTML; document.getElementById("menu_"+answerspanid).innerHTML =""; } document.getElementById(answerspanid).style.display = ""; document.getElementById(answerspanid).innerHTML = ''+socialbox+'
‘; } } else { if (document.getElementById(‘newcomment_’+answerid).value==””) { document.getElementById(answerspanid).innerHTML =””; document.getElementById(answerspanid).style.display = “none”; if (document.getElementById(“menu_”+answerspanid)) { document.getElementById(“menu_”+answerspanid).innerHTML=hclose; } } } } var replyForms = []; function hideReplyForms(partialid) { // reset post to tw, fb postFB=postTW=0; if(replyForms.length == 0){ var re = new RegExp(partialid, ‘g’); var elems = document.getElementsByTagName(‘*’), i = 0, el; while (el = elems[i++]) { if (el.id.match(re)) { replyForms.push(el); } } } for(j=0;j<replyForms.length;j++){ el = replyForms[j]; el.innerHTML = ""; } } function display_reply_box_comment(answerspanid, answerid, questionid, parent, level) { var searchstr = ''; var showvalstr = ''; hideReplyForms('replyCom_'); var socialbox = ' Facebook Twitter Subscribe '; socialbox=socialbox.replace('{aid}',answerid).replace('{aid}',answerid); document.getElementById(answerspanid).innerHTML = ''+socialbox+''; document.getElementById('display_box_'+answerid).innerHTML = ''; } function display_reply_box(answerspanid, answerid, questionid) { hideReplyForms('replyCom_'); var searchstr = ''; var showvalstr = ''; if (document.getElementById(answerspanid).innerHTML.indexOf('Post Reply')<0) { if ((!document.getElementById('newcomment_'+answerid))||((document.getElementById('newcomment_'+answerid))&&(document.getElementById('newcomment_'+answerid).value==""))) { var socialbox = ' Facebook Twitter Subscribe '; socialbox=socialbox.replace('{aid}',answerid).replace('{aid}',answerid); if (document.getElementById("menu_"+answerspanid)) { hclose=document.getElementById("menu_"+answerspanid).innerHTML; document.getElementById("menu_"+answerspanid).innerHTML =""; } document.getElementById(answerspanid).style.display = ""; document.getElementById(answerspanid).innerHTML = ''+socialbox+''; } } else { if (document.getElementById('newcomment_'+answerid).value=="") { document.getElementById(answerspanid).innerHTML =""; document.getElementById(answerspanid).style.display = "none"; if (document.getElementById("menu_"+answerspanid)) { document.getElementById("menu_"+answerspanid).innerHTML=hclose; } } } } function showCommentPopupLogin() { $.modal(document.getElementById('signup_popup')); } function add_comment(type,questionid, answerid, comment_txt, parent, level,answerspanid) { //if (parent==undefined) parent=''; //if (level==undefined) level=''; postFB=document.getElementById('chkFB'+answerid).checked?1:0; postTW=document.getElementById('chkTW'+answerid).checked?1:0; var subscriber = true; if (document.getElementById("checkCommentSubscribe")) { subscriber = document.getElementById("checkCommentSubscribe").checked; } gsub = subscriber?'Y':'N'; if (document.getElementById('comments_table_'+answerid)){ var commenttable = document.getElementById('comments_table_'+answerid); /*var tBody = commenttable.getElementsByTagName('tbody')[0]; var newTR = document.createElement('tr'); var newTD = document.createElement('td'); newtdid = "newrow_" + parseInt((Math.random())*100); newTD.id = newtdid; newTD.innerHTML = 'Your Comment Added Successfully…'; newTR.style.background = '#f0f8cc'; newTR.appendChild (newTD); tBody.appendChild(newTR);*/ newtdid='comment_return_new_'+answerid; // clear old div var olddiv=document.getElementById(newtdid); if (olddiv) olddiv.id=''; // create new dix var newdiv = document.createElement('div'); newdiv.id=newtdid; newdiv.style.clear="both"; var pe = document.getElementById('newcomment_'+answerid); // find the span replyCom_xxx var ppe = pe.parentNode.parentNode.parentNode; if (level!='') { // get the parent div of the comment commenttable.insertBefore(newdiv, ppe.parentNode.parentNode.nextSibling); } else { // add new comment commenttable.appendChild(newdiv); } ppe.innerHTML=''; }else{ var newtdid = 'comment_return_'+answerid; } // 06/07/2012 – add popup login for comment gtext=comment_txt; comment_txt=comment_txt.replace(/+/g,'oo7oo'); qstr = "cmd=addcomment&qid="+questionid+'&txy='+(tempX+tempY)+"&aid="+answerid+"&comment="+escape(comment_txt)+"&type="+type+"&parent="+parent+"&level="+level+"&subscribed="+subscriber; if (''==''){ qstr += "&anon=1"; document.getElementById('hidAnswerID').value=answerid; } gqtitle=document.getElementById('qtitle'+answerid).value; gqdetail=document.getElementById('qdetail'+answerid).value; gqurl=document.getElementById('qurl'+answerid).value; xmlhttpPost(prevdir+"saveanswer.php",qstr,newtdid, true);//'comment_return_'+answerid,true); postToSocial(); document.getElementById('display_box_'+answerid).innerHTML=''; } // ajax to display hidden comment function showhidecomment(cid,action) { qstr = "cmd=showhidecomment&txy="+(tempX+tempY)+"&commentid="+cid+"&action="+action; xmlhttpPost(prevdir+"saveanswer.php",qstr,'comment_box_'+cid,true); } // vc – 26/09 – show popup for follow button not loggedin function dofollowanon(userid,org, aid) { document.getElementById('hidAnswerID').value = 'follow'; document.getElementById('hidCommentID').value = userid; $.modal(document.getElementById('signup_popup')); } function savecontact(new_contact,questionid) { qstr = "cmd=savecontact&new_contact="+escape(new_contact)+"&txy="+(tempX+tempY)+"&qid="+questionid; xmlhttpPost(prevdir+"saveanswer.php",qstr,'new_expert_return',true); } function remove_contact(questionid, contact_index) { qstr = "cmd=removecontact&contact_index="+contact_index+"&txy="+(tempX+tempY)+"&qid="+questionid; xmlhttpPost(prevdir+"saveanswer.php",qstr,'remove_expert_return',true); } function askifsure(qid1,qid2,q1,q2) { document.getElementById(qid2).innerHTML='
ALERT: This question may already have answers. Should we move answers for the question: “‘+unescape(q2)+'” to this question:”‘+unescape(q1)+'” Yes/No
‘; return false; } function telluser(qid2,msg) { document.getElementById(qid2).innerHTML=msg; return false; } function askifsure2(resid,qid1,qid2,q1,q2) { var img = ”; if (resid.indexOf(‘ansboxmerge’)>=0) { img = ”; } else { img = ‘‘; } document.getElementById(resid).innerHTML=’
‘+img+’ ALERT: Are you sure the question: “‘+unescape(q2)+'” is different from this question: “‘+unescape(q1)+'” Yes/No
‘; return false; } function askifsure4(resid,qid1,qid2,q1,q2,q3) { document.getElementById(resid).innerHTML=’
ALERT: Are you sure the question: “‘+unescape(q2)+'” is different from this question: “‘+unescape(q1)+'” Yes/No
‘; return false; } var rabusetype; var rabusedetail; function flagit2(aid) { var qstr = ‘aid=’+aid+’&txy=’+(tempX+tempY)+ ‘&abt=’+escape(rabusetype)+ ‘&abd=’+escape(rabusedetail)+’&cmd=answerabuse’; xmlhttpPost(prevdir+”saveanswer.php”,qstr,’ansflag’+aid,true); //alert(aid); } var raid=””; var target=””; var t1=””newtext=””; var t2=””&aid=””; var t3=””&qid=””; var cmdstr=””; var spanid=””; var taaid=””; var dodel=””; var qt=”””; var cmd=”&cmd=”; var hqid=””; function runit(taaid, raid, hqid, target, spanid, cmdstr) { var editdata = spanid != “” ? document.getElementById(taaid).value : spanid; var qstr = “newtext=” + editdata + “&aid=” + raid + “&qid=” + hqid + “&cmd=” + cmdstr; xmlhttpPost(target, qstr, spanid, true); } function rundelete(taaid, raid, hqid, target, spanid, cmdstr) { var qstr = “newtext=” + qt + dodel + qt + “&aid=” + raid + “&qid=” + hqid + “&cmd=” + cmdstr.replace(“update”,”delete”); xmlhttpPost(target, qstr, spanid, true); } function useredit(aid, cmdpassedin,call_player, qid) { cmdstr = cmdpassedin; taaid = “ta” + aid; raid = String(aid); hqid = String(qid); spanid = “spanres” + cmdstr + aid; target = “saveanswer.php”; var html = $(“#eid” + cmdpassedin + aid).html(); // replace youtube url with title while (true) { var myRe = new RegExp(“([^ 0) { atxt = atxt.substr(indx+5); } atxt = $.trim(atxt); if (cmdpassedin==”updatecomment”) { // remove “Reply” at the last atxt=atxt.replace(/Reply$/ig, ”); atxt=atxt.replace(/s+$/g,” “); } else if(cmdpassedin == “updateanswer”) { var vid_div = $(‘#’+aid+’_video_div’)[0]; if(vid_div) { var possible_youtube_link_that_was_parsed_out = vid_div.getElementsByTagName(‘iframe’)[0].src; possible_youtube_link_that_was_parsed_out = vid_div.getAttribute(‘directlink’); if(possible_youtube_link_that_was_parsed_out.length > 0) { atxt += ” ” +possible_youtube_link_that_was_parsed_out; } } } var newtxt = ” + atxt.replace(/
/ig, ‘n’) + ”; newtxt = newtxt + “Save”; newtxt = newtxt + ” | Delete”; newtxt = newtxt + “”; document.getElementById(‘eid’ + cmdstr + aid).innerHTML = newtxt; } function escChr(text){ return text.replace(/(rn|n|r)/gm,”\”).replace(/(“)/gm,”\””); } function askifsure3(aid) { var qt=”‘”; var rstr = ‘
]]> |
rstr = rstr+”;
rstr = rstr+”;
rstr = rstr+’Offensive’;
rstr = rstr+’Poor Quality’;
rstr = rstr+’Not Relavent’;
rstr = rstr+’Other’;
rstr = rstr+’/>
‘;
rstr = rstr+’
Details: Please explain to other users why you have flagged this answer. Other users will vote on whether they agree with you or not to remove this question so please explain your reasons as clearly as possible.
‘;
rstr = rstr+’
‘;
rstr = rstr+”;
rstr = rstr+’/>
‘; if (document.getElementById(‘ansflag’+aid).innerHTML==””) { document.getElementById(‘ansflag’+aid).innerHTML=rstr; } else { document.getElementById(‘ansflag’+aid).innerHTML=””; } return false; }
“; document.getElementById(“loginform”).innerHTML=fhtml; } function register() { fhtml_login=document.getElementById(“loginform”).innerHTML; var fhtml=””; fhtml+= “
“;
document.getElementById(“loginform”).innerHTML=fhtml;
}
function restoreloginform() {
document.getElementById(“loginform”).innerHTML = fhtml_login;
}
//– EC start —
//These functions are for the new popup
function dologin_popup(id, pass, qid) {
var qstr = “uid=” + escape(id.value) + “&pass=” + escape(pass.value) + “&qid=” + qid + “&txy=” + (tempX+tempY) + “&answer_text=” + document.getElementById(‘newtext’).value + “&cmd=login_popup”+”&aid=”+document.getElementById(“hidAnswerID”).value+”&commentid=”+document.getElementById(“hidCommentID”).value+”&postfb=”+postFB+”&posttw=”+postTW+”&subscriber=”+gsub;
xmlhttpPost(“saveanswer.php”, qstr, “passres_popup”, true);
return false;
}
function lostpass_popup() {
fhtml_login = document.getElementById(“openid_login_popup”).innerHTML;
var fhtml = “”;
var remail = “”;
fhtml += “
“; document.getElementById(“openid_login_popup”).innerHTML = fhtml; } function signin_popup() { fhtml_login = document.getElementById(“divNewUserForm”).innerHTML; var fhtml = “”; // fhtml += “