//add comments

var nextComment=0;

var cellHTML="";

var scTexts=new Array();
var scIDs=new Array();
var scAuthors=new Array();

//sample: list arrays; list vars

scTexts[1]="I wonder my brother was likd a water melon eater like him";
scIDs[1]=531;
scAuthors[1]="Amey from India";

scTexts[2]="'I wonder if my teeth will grow so i can eat this melon before i have to go?'";
scIDs[2]=341;
scAuthors[2]="Joe from bristol, england";

var contentType=1;
var contentID=414;
var totalComments=2;

//VAR_CONTENT

var scCell=document.getElementById('commentCell');

if (totalComments==0)
	{
	cellHTML="Does a funny comment come to your mind for this image? Be the first to tag a smart one!<br>";
	writeCell();
	}
else
	{
	showComment(1);
	}
1;

function showComment(which)
{
nextComment=which+1;
if (nextComment > totalComments){nextComment=1;}
var c1="";
if (which==1 && totalComments>1){c1+="<b><font size=\"1\"color=\"#5B8CFF\">Smartest</font></b><font size=\"1\">";}else{c1="<font size=\"1\">Smart";}
c1+= " comment by " + scAuthors[which] + ":</font><br><b>&quot;" + scTexts[which] + "&quot;</b><br><font size=\"1\">";
c1+="Rate this comment: <a href=\"javascript:RateSC('" + scIDs[which] + "-up')\"><img border=\"0\" src=\"/images_site/thumbUp.gif\" width=\"17\" height=\"15\" align=\"absmiddle\"> Smart</a> <a href=\"javascript:RateSC('" + scIDs[which] + "-down')\"> <img border=\"0\" src=\"/images_site/thumbDown.gif\" width=\"17\" height=\"15\" align=\"absmiddle\"> Stupid</a><br>";
if (totalComments > 1){c1+="<a href=\"javascript:showComment("+nextComment+")\">Next comment &gt;&gt;</a> | </font>";}
cellHTML=c1;
writeCell();
}

function writeCell()
{
cellHTML+="<font size=\"1\"><a href=\"javascript:addComment('"+contentType+"-"+contentID+"')\">Add <b>Your</b> Smart Comment</a></font>";
scCell.innerHTML=cellHTML;
}

function addComment(contentRef)
{
var rateURL='http://www.ovao.com/cgi/addSmartComment.cgi?c='+contentRef;
var wnd=window.open(rateURL,'addSC','width=550,height=400,toolbar=no,status=no,menubar=no,scrollbars=yes,dependent=yes');
}

function RateSC(how)
{
var rateURL='http://www.ovao.com/cgi/rateSmartComment.cgi?rate='+how;
var wnd=window.open(rateURL,'rateSC','width=320,height=200,toolbar=no,status=no,menubar=no,scrollbars=yes,dependent=yes');
}

