function doInnerHTML(fieldname,html) {
var searchFields = document.getElementsByTagName("span");
for (i = 0; i < searchFields.length; i++) {
if (searchFields[i].className == fieldname) {
searchFields[i].innerHTML = html;
}
}
}
var showTrustVotes = function (oXml) {
var strIn = oXml.responseText;
showTrustVotesFinal(strIn);
}
function showTrustVotesFinal(strIn) {
var strResponseArray = new Array();
strResponseArray = strIn.split('|');
if (strIn != '') {
doInnerHTML(strResponseArray[0]+"_SPAN_YES_VOTES",strResponseArray[1]);
doInnerHTML(strResponseArray[0]+"_SPAN_NO_VOTES",strResponseArray[2]);
if (strResponseArray[3] == 1) {
doInnerHTML(strResponseArray[0]+"_SPAN_YES_VOTE",'YES ');
doInnerHTML(strResponseArray[0]+"_SPAN_YES_VOTE_MEDIUM",'YES ');
doInnerHTML(strResponseArray[0]+"_SPAN_NO_VOTE",'NO ');
doInnerHTML(strResponseArray[0]+"_SPAN_NO_VOTE_MEDIUM",'NO ');
}
else if (strResponseArray[3] == 2){
doInnerHTML(strResponseArray[0]+"_SPAN_YES_VOTE",'YES ');
doInnerHTML(strResponseArray[0]+"_SPAN_YES_VOTE_MEDIUM",'YES ');
doInnerHTML(strResponseArray[0]+"_SPAN_NO_VOTE",'NO ');
doInnerHTML(strResponseArray[0]+"_SPAN_NO_VOTE_MEDIUM",'NO ');
}
else {
doInnerHTML(strResponseArray[0]+"_SPAN_YES_VOTE",'YES ');
doInnerHTML(strResponseArray[0]+"_SPAN_YES_VOTE_MEDIUM",'YES ');
doInnerHTML(strResponseArray[0]+"_SPAN_NO_VOTE",'NO ');
doInnerHTML(strResponseArray[0]+"_SPAN_NO_VOTE_MEDIUM",'NO ');
}
}
}
function doTrustVote(trustUser,trusted) {
var strURL = 'https://www.pornusers.com/ajax.html';
var strSubmit = 'trustUser='+escape(trustUser)+'&trusted='+escape(trusted)+'&userid=0'+'&anonymous='+'&sess=';
var myConn = new XHConn();
myConn.connect(strURL, "POST", strSubmit, showTrustVotes);
}