function convertEnToFaNumbers(x) {
	var faStr = '';
	for (i = 0; i < x.length; i++) {
		if (x.charAt(i) >= '0' && x.charAt(i) <= '9') {
			faStr += String.fromCharCode(x.charCodeAt(i) + 1728);
		}
	}
	return faStr;
}

function showCounter(){
	if(document.getElementById('counterPlace').getAttribute("counternum") !=0){
		var showing = true;
		var x = document.getElementById('counterPlace').getAttribute("counternum");
		document.getElementById('counterPlace').setAttribute("counternum",0);
		var refreshIntervalId = setInterval(function(){
			if(document.getElementById('counterPlace') == null){		
				clearInterval(refreshIntervalId);
				showing = false;
			}
			if(showing == true){
				if(document.getElementById('counterPlace').getAttribute("dir") == "rtl"){
					document.getElementById('counterPlace').innerHTML= convertEnToFaNumbers(String(x));
				}else{
					document.getElementById('counterPlace').innerHTML= x;
				}					
				if (x > 0) {
					x--;
				}
			}
		}, 1000);
	}
}