//creator:Allauddin
//Date:9/72015
$(document).ready(function(){
//Replace the text here if you'd like a different default message if no items were found
var emptyResults = "
There are no current Items.
";
//var maxVal = 0;
var toShow = false;
//var heightTemp = 0;
var count=0;
//alert("start Informasi");
$().SPServices({
operation: "GetListItems",
async: false,
//Change the list name here if you aren't using an Announcements list
listName: "statistic",
CAMLViewFields:"",
CAMLQuery: "",
completefunc: function(xData, Status){
var itemCount = $(xData.responseXML).SPFilterNode('rs:data').attr("ItemCount");
var x = Math.floor(itemCount*Math.random());
if(itemCount > 0){
//alert(itemCount);
toShow = true;
$(xData.responseXML).SPFilterNode("z:row").each( function () {
if(count < itemCount){
//alert(count);
var img = $(this).attr("ows_FileLeafRef");
if(img.length == 13)
{
var imgL=img.substring(3,250);
}
if(img.length == 14)
{
var imgL=img.substring(4,250);
}
if(img.length == 15)
{
var imgL=img.substring(5,250);
}
var imgA= new Array ();
imgA[count] = "/en/statistic/"+imgL;
var size = imgA.length
// alert(imgA[count]);
$('#Trade_Statistik').attr('src',imgA[x]);
$('#tradepic').attr('href',imgA[x]);
if (count != x)
{
var imgstatistic = "";
$('#rightNavBox_statistik').append(imgstatistic);
}
count+=1;
}
});
}
else{
document.getElementById( 'rightNavBox_statistik' ).style.display = 'none';
}
}
});
});