function hotLikeMe(ele) {
try {
ele.style.backgroundColor = "#b46958";
}
catch (error) {
handleError(error,"hotLikeMe("+ele+")","MINOR");
}
}
function coldAsHell(ele) {
try {
ele.style.backgroundColor = "#9d3c26";
}
catch (error) {
handleError(error,"coldAsHell("+ele+")","MINOR");
}
}
var activetab = new Array;
function setSuccessMessage(contents) {
$('successmsg').innerHTML = contents
}
var loadPageInProc = false;
function loadPage(url,animMethod,rshRecord) {
try {
if (loadPageInProc) {
setTimeout("loadPage('"+url+"','"+animMethod+"')",1000);
}
else {
if (rshRecord) {
addToHistory(url);
}
unLoadScriptIfIncluded();
userSelectedSide = "";
activetab['a']='text';
activetab['b']='text';
setSuccessMessage("
");
var reportUrl = url.replace(/\/loadpage/,"");
sendToGA(reportUrl);
loadPageInProc = true;
if (animMethod=='updown' || animMethod == undefined || animMethod == null || animMethod == '') {
$('loadinganim').style.display="none";
var easearray = makeMovementArray(1000,1.70,true);
var top = 0;
var k=0;
for (var i=0; i -1; w--) {
updnAr[g] = updnAr[w];
if (lftOvr == 1) {
updnAr[w] = updnAr[w] + 1;
lftOvr = 0;
}
g++;
}
return updnAr;
}
catch (error) {
handleError(error,"makeMovementArray("+lft+","+pct+","+onlyEvens+")","MINOR");
}
}
function makeAwesome(id) {
try {
$(id).style.backgroundImage="url(/images/entries-mouse-over-bg.gif)";
}
catch (error) {
handleError(error,"makeAwesome("+id+")","MINOR");
}
}
function makeLame(id) {
try {
$(id).style.background="none";
}
catch (error) {
handleError(error,"makeLame("+id+")","MINOR");
}
}
/* KILL THESE AND DO THIS RIGHT EVENTUALLY - shr 10/28/2008 */
function makeTAwesome(id) {
try {
$(id).style.backgroundImage="url(/images/tourney-entries-mouse-over-bg.gif)";
}
catch (error) {
handleError(error,"makeAwesome("+id+")","MINOR");
}
}
function makeTLame(id) {
try {
$(id).style.backgroundImage="url(/images/tourney-entries-bg.gif)";
// $(id).style.background="none";
}
catch (error) {
handleError(error,"makeLame("+id+")","MINOR");
}
}
var userSelectedSide = "";
var currentEntryComplete = false;
function makeEntryAwesome(side) {
try {
if (currentEntryComplete) {
//this entry is complete, no more voting
return;
}
if ( userSelectedSide == "" ) {
var rl = ( side=='b' ) ? "right" : "left";
$('entry'+side).style.backgroundImage = "url(/images/item-bg-" + rl + "-over.gif)";
$('thumbsup'+side).style.display="block";
}
}
catch (error) {
handleError(error,"makeEntryAwesome("+side+")","MINOR");
}
}
function makeEntryLame(side) {
try {
if (currentEntryComplete) {
//this entry is complete, no more voting
return;
}
if ( userSelectedSide == "" ) {
var rl = ( side=='b' ) ? "right" : "left";
$('entry'+side).style.backgroundImage = "url(/images/item-bg-" + rl + ".gif)";
$('thumbsup'+side).style.display="none";
}
}
catch (error) {
handleError(error,"makeEntryLame("+side+")","MINOR");
}
}
function hideEntryTabs(side) {
$('entrytextbox'+side).style.display='none';
$('entrytexttab'+side).style.backgroundColor='#CCCCCC';
$('entrytexttab'+side).style.borderBottom='1px solid #999999';
$('entrystatsbox'+side).style.display='none';
$('entrystatstab'+side).style.backgroundColor='#CCCCCC';
$('entrystatstab'+side).style.borderBottom='1px solid #999999';
$('entrycommentbox'+side).style.display='none';
$('entrycommenttab'+side).style.backgroundColor='#CCCCCC';
$('entrycommenttab'+side).style.borderBottom='1px solid #999999';
$('entryinfobox'+side).style.display='none';
$('entryinfotab'+side).style.backgroundColor='#CCCCCC';
$('entryinfotab'+side).style.borderBottom='1px solid #999999';
$('entrywatchbox'+side).style.display='none';
$('entrywatchtab'+side).style.backgroundColor='#CCCCCC';
$('entrywatchtab'+side).style.borderBottom='1px solid #999999';
}
activetab['a']='text';
activetab['b']='text';
function showEntryTab(side,item) {
try {
hideEntryTabs(side);
$('entry'+item+'box'+side).style.display = 'block';
$('entry'+item+'tab'+side).style.backgroundColor = '#FFFFFF';
$('entry'+item+'tab'+side).style.borderBottom='1px solid #FFFFFF';
activetab[side]=item;
}
catch (error) {
handleError(error,"showEntryTab("+side+","+item+")","MINOR");
}
}
overEntryInfoBox = false;
var rl = new Array();
rl['a'] = 'left';
rl['b'] = 'right';
function registerVote(aoid,side,choiceArId) {
try {
if (currentEntryComplete) {
//this entry is complete, no more voting
return;
}
if (overEntryInfoBox) {
return;
}
$('successmsg').innerHTML = "
";
//alert( "aoid:"+aoid+", side:"+side+", choiceArId:" + choiceArId);
var oside = ( side=='b' ) ? "a" : "b";
userSelectedSide = side;
$('entry'+side).style.backgroundImage = "url(/images/item-bg-" + rl[side] + "-selected.gif)";
$('entry'+oside).style.backgroundImage = "url(/images/item-bg-" + rl[oside] + "-not.gif)";
var pars = "OPTION=RECORDVOTEANDCOMPLETE";
pars += "&PAGE=vote-response";
pars += "&ao.id=" + aoid;
pars += "&choice-ar.id=" + choiceArId;
var url = "/za/AWE";
var myAjax = new Ajax.Request( url, { method: 'post', parameters: pars, onComplete: voteResponse});
sendToGA('/goals/uservoted/');
}
catch (error) {
handleError(error,"registerVote("+aoid+","+side+","+choiceArId+")","MINOR");
}
}
function voteResponse(or) {
try {
if ( or.responseText.indexOf("WINNER-A") > -1 ) {
$('successmsg').innerHTML = "this match is over";
weHaveAWinner("a");
}
else if ( or.responseText.indexOf("WINNER-B") > -1 ) {
$('successmsg').innerHTML = "this match is over";
weHaveAWinner("b");
}
else if ( or.responseText.indexOf("SUCCESS-INSERT") > -1 ) {
$('successmsg').innerHTML = "vote recorded";
blinkSuccessMsg(4);
showNextAndStats();
}
else if ( or.responseText.indexOf("SUCCESS-UPDATE-FROMGUEST") > -1 ) {
$('successmsg').innerHTML = "guest vote replaced";
blinkSuccessMsg(4);
//alert("Your vote has been updated. Thanks!");
showNextAndStats();
}
else if ( or.responseText.indexOf("SUCCESS-UPDATE") > -1 ) {
$('successmsg').innerHTML = "vote updated";
blinkSuccessMsg(4);
//alert("Your vote has been updated. Thanks!");
showNextAndStats();
}
else if ( or.responseText.indexOf("SAMEIPDIFFANON") > -1 ) {
alert(":-( Sorry, your vote was not recorded\n because someone else at your location has\n already voted on this AwesomeOff.\n\n If you would also like to vote,\n simply create an account and you will\n have full voting privileges! \n\n");
$('successmsg').innerHTML = "duplicate igored";
blinkSuccessMsg(4);
}
else if ( or.responseText.indexOf("LOGINTOUPDATE") > -1 ) {
alert(":-( Sorry, your vote was not recorded.\n\n You or someone else at your location has\n already voted on this match.\n\n Please log in to update your vote.\n\n");
$('successmsg').innerHTML = "log in to vote";
blinkSuccessMsg(4);
}
/* else if ( or.responseText.indexOf("LOGOUT") > -1 ) {
alert(" Sorry, it appears you are not currently\n logged in. You must be logged in to vote.\n\n Your vote could not be saved.\n Please log in and try again.\n\n");
$('successmsg').innerHTML = "please log in";
loadPage('/za/AWE?PAGE=login','updown',true);
} */
else if ( or.responseText.indexOf("NOAOID") > -1 || or.responseText.indexOf("NOAB") > -1 || or.responseText.indexOf("BAD-AOID") > -1 || or.responseText.indexOf("BAD-SEASON") > -1 || or.responseText.indexOf("NOT-ACTIVE-SEASON") > -1 ) {
$('successmsg').innerHTML = "oops";
alert( ":-( Sorry, something very bad and technical\n happened while recording your\n vote. We will try to correct\n this asap. Please try again.\n\n"+or.responseText);
}
else if ( or.responseText.indexOf("AO-COMPLETE") > -1 || or.responseText.indexOf("HAS-WINNER") > -1) {
$('successmsg').innerHTML = "match complete";
//TODO change this to get back the same option vals and act as though the order was completed
alert(":-( Sorry, your vote was not recorded,\n because this match has already been\n\n decided. The page will now refresh so you\n can see the winner.\n\n"+or.responseText);
}
else if ( or.responseText.indexOf("DUPLICATE") > -1 ) {
$('successmsg').innerHTML = "re-vote igored";
blinkSuccessMsg(4);
showNextAndStats();
//alert(":-( Thanks for your vote.\n It appears we already had it on file!\n\n"+or.responseText);
}
else if ( or.responseText.indexOf("INSERT-FAIL") > -1 || or.responseText.indexOf("UPDATE-FAIL") > -1 ) {
$('successmsg').innerHTML = "oops";
alert(":-( Sorry, your vote was not recorded,\n A technical issue has prevented us\n from recording it the database.\n\n Please try again.\n\n"+or.responseText);
}
else {
$('successmsg').innerHTML = "oops";
alert(":-( Sorry, your vote was not recorded,\n A technical issue has prevented us\n from recording it the database.\n\n Please try again.\n\n"+or.responseText);
}
if ( or.responseText.indexOf("GUESTVOTE") > -1 ) {
setTimeout("advertiseLogin()",3000);
}
}
catch (error) {
handleError(error,"voteResponse("+or+")","MINOR");
}
}
function advertiseLogin() {
$('successmsg').innerHTML = "login to triple your vote power";
blinkSuccessMsg(12);
}
function blinkSuccessMsg(xt) {
var onoff=true;
var y = 0;
for ( var x=1; x < xt; x++ ) {
y = x*300;
if ( onoff ) {
setTimeout("$('successmsg').style.visibility='hidden'",y);
onoff=false;
}
else {
setTimeout("$('successmsg').style.visibility='visible'",y);
onoff=true;
}
}
setTimeout("$('successmsg').style.visibility='visible'",y+300);
}
function showNextAndStats() {
//$('nextnav').style.display="block";
}
var barTopStart = 57;
function showAllBars() {
try {
var i = 0;
while ( $('bar-'+i+'-a-pct') ) {
var apct = parseInt($('bar-'+i+'-a-pct').value);
var bpct = parseInt($('bar-'+i+'-b-pct').value);
if ( apct > 0 ) {
var m = 1;
for ( var k = barTopStart; k > Math.round(barTopStart-(50*(apct/100))); k--) {
setTimeout("$('bara"+i+"').style.top='" + k + "px'",m*10);
m++;
}
}
if ( bpct > 0 ) {
var m = 1;
for ( var k = barTopStart; k > Math.round(barTopStart-(50*(bpct/100))); k--) {
setTimeout("$('barb"+i+"').style.top='" + k + "px'",m*10);
m++;
}
}
i++;
}
}
catch (error) {
handleError(error,"showAllBars()","MINOR");
}
}
var savfWorking = false;
function showAddCommentForm(bottop) {
try {
if (savfWorking) {
return;
}
savfWorking = true;
var k = 1;
for (var i = $('entriescomments').scrollTop; i > 0; i=i-10 ) {
setTimeout("$('entriescomments').scrollTop="+i,k*10);
k++;
if (i<10) {
i = 0;
setTimeout("$('entriescomments').scrollTop="+i,k*10);
}
}
k++;
setTimeout("showTheForm('"+bottop+"')",k*10);
}
catch (error) {
handleError(error,"showAddCommentForm("+bottop+")","MINOR");
}
}
function showTheForm(bottop) {
try {
var topbot = (bottop == "top") ? "bot" : "top";
if ($('matchupcomment'+topbot).innerHTML != "" ) {
var temp = "";
temp=$('matchupcomment'+topbot).innerHTML;
$('matchupcomment'+topbot).innerHTML='';
$('matchupcomment'+bottop).innerHTML=temp;
}
savfWorking=false;
}
catch (error) {
handleError(error,"showTheForm("+bottop+")","MINOR");
}
}
var currentFormLoc = "commentreplysource";
function showCommentReply(idx,replyto,commentId) {
try {
var temp = "";
temp=$(currentFormLoc).innerHTML;
$(currentFormLoc).innerHTML='';
$('replytocomment'+idx).innerHTML=temp;
$('replytocomment'+idx).style.display="block";
$(currentFormLoc).style.display="none";
currentFormLoc = 'replytocomment'+idx;
document.forms['addcommentreplyform'].elements['article.description'].value = "Reply to comment: " + commentId;
document.forms['addcommentreplyform'].elements['relatedto'].value = "COMMENT-" +commentId;
$('commentreplylabel').innerHTML = "You say (in reply to: " + replyto + ")";
}
catch (error) {
handleError(error,"showCommentReply("+idx+","+replyto+","+commentId+")","MINOR");
}
}
var lastAOCommentedOn = "";
function submitComment(theForm,nextUrl) {
try {
var theText = document.forms[theForm].elements['comment'].value;
theText = escape(theText);
var url = "/za/AWE";
var pars;
if ( document.forms[theForm].elements['currentuserid'].value == "GUEST" ) {
pars = "PAGE=save-comment";
pars += "&post-login-ao=" + document.forms[theForm].elements['ao.id'].value;
pars += "&last-comment=" + theText;
pars += "&last-form=" + theForm;
var myAjax = new Ajax.Request( url, { method: 'post', parameters: pars, onComplete: goToLogin});
return;
}
pars = "OPTION=INSERTCOMMENT";
pars += "&PAGE=comment-response";
pars += "&za_article_type-1=COMMENT";
pars += "&za_attr_names-1=USERID,ANONID,RELATED_TO,POST_DATETIME";
pars += "&za_copy_names-1=COMMENT";
pars += "&za_status_code-1=ACTIVE";
pars += "&za_descr-1=" + document.forms[theForm].elements['article.description'].value;
pars += "&za_attr.ANONID-1=" + '835938401283852634590';
pars += "&za_attr.RELATED_TO-1=" + document.forms[theForm].elements['relatedto'].value;
pars += "&COMMENT=" + theText;
lastAOCommentedOn = document.forms[theForm].elements['ao.id'].value;
currentFormLoc = "commentreplysource";
//alert(pars);
//$('commentcore-'+idx).innerHTML = "
Saving comments";
var myAjax = new Ajax.Request( url, { method: 'post', parameters: pars, onComplete: function(response) { checkSubmitComment(response,nextUrl); } } );
}
catch (error) {
handleError(error,"submitComment("+theForm+")","MINOR");
}
}
function goToLogin() {
try {
loadPage('/za/AWE?PAGE=login&tried-comment=TRUE','updown',true);
}
catch (error) {
handleError(error,"goToLogin()","MINOR");
}
}
function checkSubmitComment(or,nextUrl) {
try {
//alert(or.responseText);
if ( or.responseText.indexOf("LOGOUT") > -1 ) {
alert(":-( Sorry, it appears your browser\n session has timed out.\n\n You comment could not be saved.\n Please log in and try again.");
loadPage('/za/AWE?PAGE=login','updown',true);
}
else if ( or.responseText.indexOf("COMMENTEMPTY") > -1 ) {
alert(":-( Sorry, the text you submitted\n was blank. \n\n What gives?");
}
else if ( or.responseText.indexOf("SUCCESS") > -1 ) {
if ( lastAOCommentedOn ) {
loadPage('/za/AWE?PAGE=awesomeoff&ao.id='+lastAOCommentedOn,'updown',true);
}
else if ( nextUrl ) {
loadPage(nextUrl,'updown',true);
}
else {
loadPage('/za/AWE?PAGE=entries','updown',true);
}
}
else {
alert(":-( Sorry, there was a problem\n submitting your comment.\n\n That is really not so awesome,\n we will try harder next time.")
}
}
catch (error) {
handleError(error,"checkSubmitComment("+or+")","MINOR");
}
}
function highlightSubmit() {
try {
$('invisiblesubmit').src = "/images/login-submit.jpg";
}
catch (error) {
handleError(error,"highlightSubmit()","MINOR");
}
}
function unHighlightSubmit() {
try {
$('invisiblesubmit').src = "/images/clear.gif";
}
catch (error) {
handleError(error,"unHighlightSubmit()","MINOR");
}
}
var loader = new Image;
loader.src = '/images/ajax-loader.gif';
function weHaveAWinner(ab) {
try {
currentEntryComplete=true;
if (ab=="a") {
$('xoutb').innerHTML = "
";
$('xoutb').style.display="block";
$('winnerloserlabela').innerHTML = "
";
$('winnerloserlabelb').innerHTML = "
";
$('entrya').style.backgroundImage = "url(/images/item-bg-left-winner.gif)";
$('entryb').style.backgroundImage = "url(/images/item-bg-right-not.gif)";
$('thumbsupa').style.display="block";
$('thumbsupb').style.display="none";
}
else {
$('xouta').innerHTML = "
";
$('xouta').style.display="block";
$('winnerloserlabelb').innerHTML = "
";
$('winnerloserlabela').innerHTML = "
";
$('entrya').style.backgroundImage = "url(/images/item-bg-left-not.gif)";
$('entryb').style.backgroundImage = "url(/images/item-bg-right-winner.gif)";
$('thumbsupb').style.display="block";
$('thumbsupa').style.display="none";
}
$('winnerloserlabela').style.display='block';
$('winnerloserlabelb').style.display='block';
if( $('entryvideoa') ) { $('entryvideoa').style.display="none"; }
if( $('entryvideob') ) { $('entryvideob').style.display="none"; }
var j=500;
while (j < 10500) {
setTimeout("$('winnerloserlabel"+ab+"').style.display='none'",j);
j = j + 500;
setTimeout("$('winnerloserlabel"+ab+"').style.display='block'",j);
j = j + 500;
}
}
catch (error) {
handleError(error,"weHaveAWinner("+ab+")","MINOR");
}
}
function setRandomLoading() {
var r = Math.round(Math.random() * 16 );
if (r==0) { r++; }
var ii = new Image;
ii.src = "/images/loading/loading" + r + ".gif";
$("loadinganimimg").src = ii.src;
}
function isEmpty(v) {
if (v == undefined) { return true; }
if (v == null) { return true; }
if (v == "") { return true; }
return false;
}
var mains = new Array;
var mainup = new Array;
var slideTime = 4000;
var slideonoff = new Array;
function initSlide(arId,imgct) {
mains[arId]=imgct;
mainup[arId]=1;
if (imgct > 1) {
slideonoff[arId]="off";
setTimeout("slide('"+arId+"')",slideTime);
}
}
var nextz = 10;
function slide(arId) {
try {
if (!isEmpty(slideonoff[arId])) {
if (slideonoff[arId]=="off") {
slideonoff[arId]=="on";
var next = mainup[arId]+1;
if (next > mains[arId]) {
next = 1;
}
if ( $('mainimg'+arId+''+next) && $('mainimg'+arId+''+mainup[arId]) && $('mainimg'+arId+'2') ) {
changeOpac(0,'mainimg'+arId+''+next);
$('mainimg'+arId+''+next).style.zIndex = nextz;
nextz++;
$('mainimg'+arId+''+next).style.display = 'block';
opacity('mainimg'+arId+''+next, 0, 100, 20, function() {
setTimeout("slide('"+arId+"')",slideTime);
slideonoff[arId]=="off";
}, true);
mainup[arId] = next;
}
}
}
}
catch (error) {
handleError(error,"slide("+arId+")","MINOR");
}
}
/**********************************************************************************/
/* */
/* Scripts from Florian Seeger and Seth Henry Roberts of the Zaneray Group */
/* All Right Reserved - ZaneRay.com - Copyright 1999-2008 The ZaneRay Group */
/* */
/* change the opacity for different browsers, hide png images if ie sucky browser */
/* */
/**********************************************************************************/
function changeOpac(opacity, id) {
try {
if ($(id)) {
var object = $(id).style;
object.opacity = (opacity / 100);
object.MozOpacity = (opacity / 100);
object.KhtmlOpacity = (opacity / 100);
object.filter = "alpha(opacity=" + opacity + ")";
}
}
catch (error) {
handleError(error,"changeOpac("+opacity+","+id+")","MINOR");
}
}
var ie=document.all;
function opacity(id, opacStart, opacEnd, millisec, onCompleteAction, clearFilterBl) {
try {
var k=1;
/* determine the direction for the blending, if start and end are the same nothing happens */
if(opacStart > opacEnd) {
for (var h=opacStart; h>(opacEnd-.1); h=h-10) {
setTimeout("changeOpac(" + h + ",'" + id + "')",millisec*k);
k++;
}
}
else if(opacStart < opacEnd) {
for (var h=opacStart; h<(opacEnd+.1); h=h+5) {
setTimeout("changeOpac(" + h + ",'" + id + "')",millisec*k);
k++;
}
}
if (!isEmpty(onCompleteAction)) {
setTimeout(onCompleteAction,(25*k));
}
/* clearFilter(id, 25*(k+1)); */
}
catch (error) {
handleError(error,"opacity("+id+","+opacStart+","+opacEnd+","+millisec+","+onCompleteAction+","+clearFilterBl+")","MINOR");
}
}
function handleError(errorMsg,scriptLoc,intensity) {
/* Intensities include: */
/* MINOR - not a biggie, log error, silently move on */
/* BAD - not good, we need to hear about it, try to move on */
/* MEGA - really bad, refresh page, email us, show error to user */
try {
var out = "Error\n---------------------\n";
out += errorMsg + "\n\n";
out += "ScriptLoc: " + scriptLoc + "\n";
out += "Intensity: " + intensity + "\n\n";
out += "User Information\n---------------------\n";
out += "UserAgent:" + navigator.userAgent +"\n";
out += "UserId: GUEST\n";
out += "AnonId: 835938401283852634590\n";
}
catch (error) {
/* ZRTODO, what to do with this error? */
}
}
var accImgSelIdx="";
function selectThumbnail(newFilename,origSelIdx,newSelIdx) {
//alert( "selectThumbnail("+newFilename+","+origSelIdx+","+newSelIdx+")");
document.formuno.elements['za_attr.PROFILE-IMAGE-1'].value=newFilename;
$('acccurrentimgname').innerHTML=newFilename;
$('accthumbs'+newSelIdx).className='accaprofileimgselected';
if ( accImgSelIdx == "") {
$('accthumbs'+origSelIdx).className = "accaprofileimg";
}
else {
$('accthumbs'+accImgSelIdx).className='accaprofileimg';
}
accImgSelIdx = newSelIdx;
}
function sendToGA(path) {
if(window.pageTracker != undefined) {
try {
pageTracker._trackPageview(path);
}
catch (error) {
handleCoreError(error,"sendToGA("+path+")","BOGUS");
}
}
}
function emailPassword() {
$('forgotpassresponse').innerHTML = "";
var url = "/za/AWE";
if ( isEmpty($F('wdsuserlogin'))) {
alert(" To retrieve your password, please enter\n" +
" your email address into the Email field\n" +
" tatooed in this man's back, then click\n" +
" \"Forgot Password?\" again.\n");
}
else {
pars = "PAGE=forgot-password";
pars += "&emailpasswordto=" + $F('wdsuserlogin');
var myAjax = new Ajax.Request( url, { method: 'post', parameters: pars, onComplete: emailPasswordResponse });
}
}
function emailPasswordResponse(or) {
$('forgotpassresponse').innerHTML = or.responseText;
}
function makeWatchHot(i) {
i.style.backgroundColor = '#DDD';
}
function makeWatchCold(i) {
i.style.backgroundColor = '#EFEFEF'
}
function makeWatched(zaid) {
$('watchbutton-'+zaid).style.backgroundColor = '#EFEFEF'
$('watchinstr-'+zaid).innerHTML = "You are watching this entry";
$('watchinstr-'+zaid).style.color = "#006600";
$('watchbutton-'+zaid).onclick = function () { watchUnwatchEntry(zaid,false); }
}
function makeUnWatched(zaid) {
$('watchbutton-'+zaid).style.backgroundColor = '#EFEFEF'
$('watchinstr-'+zaid).innerHTML = "Click to begin watching this entry";
$('watchinstr-'+zaid).style.color = "#000000";
$('watchbutton-'+zaid).onclick = function () { watchUnwatchEntry(zaid,true); }
}
var nextWatchArId = "";
function watchUnwatchEntry(zaid,watchUnWatch) {
try {
var url = "/za/AWE";
var pars;
pars = "OPTION=WATCHENTRY";
pars += "&PAGE=watch-response";
pars += "&za.id=" + zaid;
if ( watchUnWatch ) {
pars += "&WATCH=TRUE";
}
else {
pars += "&WATCH=FALSE";
}
pars += "&r=" + Math.random();
nextWatchArId = zaid;
var myAjax = new Ajax.Request( url, { method: 'post', parameters: pars, onComplete: checkSubmitWatch });
}
catch (error) {
handleError(error,"watchUnwatchEntry("+zaid+","+watchUnWatch+")","MINOR");
}
}
function checkSubmitWatch(or) {
try {
//alert(or.responseText);
if ( or.responseText.indexOf("GUEST") > -1 ) {
alert(":-( Sorry, it appears your browser\n session may have timed out.\n\n Please log in and try again.");
loadPage('/za/AWE?PAGE=login','updown',true);
return;
}
if ( or.responseText.indexOf("INSERTED") > -1 || or.responseText.indexOf("EXISTS") > -1 ) {
makeWatched(nextWatchArId);
nextWatchArId = "";
return;
}
if ( or.responseText.indexOf("DELETED") > -1 || or.responseText.indexOf("NOEXISTS") > -1 ) {
makeUnWatched(nextWatchArId);
nextWatchArId = "";
return;
}
}
catch (error) {
handleError(error,"checkSubmitWatch("+or+")","MINOR");
}
}
var udtLoading = new Image;
udtLoading.src = "/images/loading/comment-user-loading.gif";
var udtOpen = new Array();
function showCommentUserDetails(idx,userId,commRec) {
if ( isEmpty(udtOpen['idx'+idx]) ) {
udtOpen['idx'+idx] = 'open';
$(commRec+'userdetails-'+idx).appendChild(udtLoading);
$(commRec+'userdetails-'+idx).style.display='block';
$(commRec+'userdetails-'+idx).appendChild(udtLoading);
var url = "/za/AWE";
var pars;
pars += "&PAGE=comment-user-details";
pars += "&user.id=" + userId;
pars += "&r=" + Math.random();
var myAjax = new Ajax.Request( url, { method: 'get', parameters: pars, onComplete: function(response) { placeCommentUserDetails(response,idx,commRec); } });
}
else {
$(commRec+'userdetails-'+idx).innerHTML = '';
$(commRec+'userdetails-'+idx).style.display='none';
udtOpen['idx'+idx] = null;
}
}
function placeCommentUserDetails(response,idx,commRec) {
$(commRec+'userdetails-'+idx).innerHTML = response.responseText;
}
var nextIsLoaded = false;
function nextHistSlideItem() {
try {
if (nextIsLoaded == true) {
opacity('slideshowbox', 100, 0, 25, 'swapHistSlideItems()', false);
}
else {
setTimeout("nextHistSlideItem()",1000);
}
}
catch (error) {
handleError(error,"nextHistSlideItem()","MINOR");
}
}
function swapHistSlideItems() {
try {
$('slideshowbox').innerHTML = $('nextslideshowitem').innerHTML;
nextIsLoaded = false;
opacity('slideshowbox', 0, 100, 40, '', false);
loadNextHistSlideItem();
setTimeout("nextHistSlideItem()",7000);
}
catch (error) {
handleError(error,"swapHistSlideItems()","MINOR");
}
}
function loadNextHistSlideItem() {
try {
var url = "/za/AWE";
var pars;
pars += "&PAGE=slide-show-item";
pars += "&r=" + Math.random();
var myAjax = new Ajax.Request( url, { method: 'get', parameters: pars, onComplete: function(response) { placeHistSlideItem(response); } });
}
catch (error) {
handleError(error,"loadNextHistSlideItem()","MINOR");
}
}
function placeHistSlideItem(response) {
try {
$('nextslideshowitem').innerHTML = response.responseText;
nextIsLoaded = true;
}
catch (error) {
handleError(error,"placeHistSlideItem(response)","MINOR");
}
}