<scRIPT type=text/javascript>
buildFlashObject("radio-zed", "http://assets.zattikka.com/games/radio-zed/radio-zed.swf?svrUrl=http://api.zattikka.com&utm_content=Sep-10-BH-radioZ-Mochi-World", 640, 480, "", "&svrUrl=http://api.zattikka.com&utm_content=Sep-10-BH-radioZ-Mochi-World");
scRIPT>
<scRIPT type=text/javascript>
function getPageCountPerSection() {
return 15;
}
function getTotalPages() {
return 1;
}
function getMidPageNum() {
return Math.round(getPageCountPerSection() / 2);
}
// Function to handle ajax.
function rateGame(theRating){
$.get(
"/GameRating.action?AjaxRateGame=",
// the parameters
{
gameId: "454",
gameCode: "radio-zed",
rating: theRating
},
//function that is called when server returns a value.
function(data){
var result = eval('('+ data +')');
if(result.status >
-1) {
var replacementHTML = '
' + result.overallRating + '
';
replacementHTML += '
';
replacementHTML += 'You rated this game ' + result.userRating;
replacementHTML += '
';
replacementHTML += '
';
if(result.ratingCount >
0) {
replacementHTML += result.ratingCount + ' ratings';
}
else replacementHTML += 'No ratings';
replacementHTML += '
';
$('#ratings-statement').html(replacementHTML);
}
},
//How you want the data formated when it is returned from the server.
"html"
);
}
function constructCommentBlock(comment, userCanGiveHiFive, pos) {
var output = "";
var portalInfo = new PortalInfo();
var userId = '';
output += '
';
output += '
';
return output;
}
function buildCommentsMarkup(result, userCanGiveHiFive, thePageNum) {
markup = "";
for(var i=0; i < result.comments.length; i++) {
markup += constructCommentBlock(result.comments[i], userCanGiveHiFive, (thePageNum-1) * 5);
}
return markup;
}
function buildPageNumbers(activePageNum, totalPageCount, userCanGiveHiFive) {
pageNumMarkup = '<a href="javascript:getComments(1,454,1, ' + userCanGiveHiFive + ')" class="prev">
Newest
';
pageNumMarkup += '
Oldest
';
pageNumMarkup += '
Page :
';
pageNumMarkup += '
';
output += '
';
output += '
';
output += '
';
output += '
';
output += '
';
output += '
';
output += '
';
output += '
';
output += '
' + comment.userName + '
';
output += '
(' + comment.formattedTimeSinceCreation + ')
';
output += '
';
output += '
';
if(userId == comment.userId) {
output += '
Delete
';
}
output += '
';
output += '
';
output += '
';
output += ''; if(comment.censored) { output += '*** REMOVED - Inappropriate comments may result in your account being banned ***'; } else { output += comment.commentText; } output += '
'; output += '-
';
var startIndex = 1;
var endIndex = getPageCountPerSection() + 1;
if(getTotalPages() >
getPageCountPerSection()) {
if(activePageNum - getMidPageNum() >
0) {
if(((activePageNum - getMidPageNum()) + getPageCountPerSection()) < getTotalPages()) {
startIndex = activePageNum - getMidPageNum();
endIndex = startIndex + getPageCountPerSection(); // + 1;
}
else {
startIndex = (getTotalPages() - getPageCountPerSection()) + 1;
endIndex = startIndex + getPageCountPerSection();
}
}
}
else endIndex = getTotalPages() + 1;
for(var i=startIndex; i < endIndex; i++) {
pageNumMarkup += "<li>
\n";
if(i != activePageNum) {
pageNumMarkup += "
";
pageNumMarkup += "
" + i + "
";
pageNumMarkup += "
";
}
else pageNumMarkup += " " + i + " ";
pageNumMarkup += "
";
}
pageNumMarkup += "