function strrev(str) {
var i=str.length;
var b = '';
i=i-1;
for (var x = i; x >=0; x--) b = b + str.charAt(x);
return b;
}

