﻿/********************************************************************************/
/*                                                                              */
/*  solar.js - Solar Date Utility Functions                                     */
/*  Copyright(C) 2002-2003 Mahmood Shafiee Zargar, all rights reserved.         */
/*                                                                              */
/*  sobh@softhome.net                                                           */
/*  http://sobh.netfirms.com                                                    */
/*                                                                              */
/*  Original Pascal Code By Kambiz R. Khojaste                                  */
/*                                                                              */
/*  This file is provided "AS IS" without any warranty of any  kind, either     */
/*  express or implied. The entire  risk as to the quality  and performance     */
/*  of the functions provided in this  unit are with you. The author is NOT     */
/*  liable for  any DAMAGES resulting from the use  and misuse of the unit,     */
/*  especially he is NOT liable for DAMAGES that were caused BY ANY VERSION     */
/*  WHICH HAS NOT BEEN PROGRAMMED BY THE AUTHOR HIMSELF.                        */
/*                                                                              */
/********************************************************************************/

/********************************************************************************/
/*                                                                              */
/*  Usage:                                                                      */
/*                                                                              */
/*  ConvertDateTag(DateStr, Format)                                             */
/*  DateStr: A date string formatted as "m/d/yyyy" or "mm/dd/yyyy".             */
/*  Format: An optional number between 0 and 9 that appoints output format.     */
/*    Default is 0.		       													*/
/*  Returns a date string formatted in one of ten provided formats.             */
/*                                                                              */
/*  ConvertArchiveTag(DatesStr, Format)                                         */
/*  DatesStr: A string containing two dates formatted as "m/d/yyyy - m/d/yyyy"  */
/*    or "mm/dd/yyyy - mm/dd/yyyy".                                             */
/*  Format: An optional number between 0 and 9 that appoints output format.     */
/*    Default is 0.		       													*/
/*  Returns a string containing two dates formatted in one of ten provided      */
/*    formats, separated by " - ".                                              */
/*                                                                              */
/*  * If you want to change the input format, you should make changeds in       */
/*      ConvertStr function.                                                    */
/*  * ConvertStr function uses GregorianToSolar function to do the date         */
/*      convertion. There is also a SolarToGregorian function which can be used */
/*      to convert Solar dates into Gregorian dates. (May be applied into date  */
/*      entry forms.) Both of these methods are complete in implementation and  */
/*      the only reason of not implenting a ConvertStr for the reverse          */
/*      functionality was the lack of usage for myself. Feel free to use it if  */
/*      needed.                                                                 */
/*                                                                              */
/********************************************************************************/

var dkSolar = 0;
var dkGregorian = 1;

var DaysOfMonths = new Array();
var LeapMonth = new Array();
var DaysToMonth = new Array();

DaysOfMonths = [[31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29], [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]];
LeapMonth = [12, 2];
DaysToMonth = [[0, 31, 62, 93, 124, 155, 186, 216, 246, 276, 306, 336, 365], [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365]];

function Integer(val)
{
  this.value = val;
}

function IsLeapYear(DateKind, Year)
{
	if (DateKind == dkSolar) 
		return ((((Year + 38) * 31) % 128) <= 30);
	else
		return (((Year % 4) == 0) && (((Year % 100) != 0) || ((Year % 400) == 0)));
}

function DaysOfMonth(DateKind, Year, Month)
{
	var Result;
	if ((Year != 0) && ((Month <= 12) && (Month >= 1))) 
	{
		Result = DaysOfMonths[DateKind][Month - 1];
		if ((Month == LeapMonth[DateKind]) && IsLeapYear(DateKind, Year)) Result++;
	}
	else
		Result = 0;
	return Result;
}

function IsDateValid(DateKind, Year, Month, Day)
{
	return ((Year!= 0) && (Month >= 1) && (Month <= 12) && (Day >= 1) && Day <= (DaysOfMonth(DateKind, Year, Month)));
}

function DaysToDate(DateKind, Year, Month, Day)
{
	var Result;
	if (IsDateValid(DateKind, Year, Month, Day))
	{
		Result = DaysToMonth[DateKind][Month - 1] + Day;
		if ((Month > LeapMonth[DateKind]) && IsLeapYear(DateKind, Year)) Result++;
	}
	else
		Result = 0;
	return Result;
}

function DateOfDay(DateKind, Days, Year, Month, Day)
{
	var LeapDay = 0;
	Month.value = 0;
	Day.value = 0;
	for (var m = 2; m <= 13; m++) 
	{
		if ((m > LeapMonth[DateKind]) && (IsLeapYear(DateKind, Year))) LeapDay = 1;
		if (Days <= (DaysToMonth[DateKind][m - 1] + LeapDay))
		{
			Month.value = m - 1;
			if (Month.value <= LeapMonth[DateKind]) LeapDay = 0;
			Day.value = Days - (DaysToMonth[DateKind][Month.value - 1] + LeapDay);
			break;
		}
	}
	return IsDateValid(DateKind, Year, Month.value, Day.value);
}

function GregorianToSolar(Year, Month, Day)
{

	var	LeapDay, Days, PrevGregorianLeap, Result;
	if (IsDateValid(dkGregorian, Year.value, Month.value, Day.value))
	{
		PrevGregorianLeap = IsLeapYear(dkGregorian, Year.value - 1);
		Days = DaysToDate(dkGregorian, Year.value, Month.value, Day.value);
		Year.value -= 622;
		if (IsLeapYear(dkSolar, Year.value)) LeapDay = 1
		else LeapDay = 0;
		if (PrevGregorianLeap && (LeapDay == 1)) Days += 287
		else Days += 286;
		if (Days > (365 + LeapDay))
		{
			Year.value++;
			Days -= (365 + LeapDay);
		}
		Result = DateOfDay(dkSolar, Days, Year.value, Month, Day);
	}
	else Result = false;
	return Result;
}
/*
function SolarToGregorian(Year, Month, Day)
{
	var LeapDay, Days, PrevSolarLeap, Result;
	if (IsDateValid(dkSolar, Year.value, Month.value, Day.value))
	{
    	PrevSolarLeap = IsLeapYear(dkSolar, Year.value - 1);
    	Days = DaysToDate(dkSolar, Year.value, Month.value, Day.value);
	    Year.value += 621;
    	if (IsLeapYear(dkGregorian, Year.value)) LeapDay = 1
	    else LeapDay = 0;
	    if (PrevSolarLeap && (LeapDay = 1)) Days += 80
	    else Days += 79;
	    if (Days > (365 + LeapDay))
	    {
			Year.value++;
			Days -= (365 + LeapDay);
		}
		Result = DateOfDay(dkGregorian, Days, Year.value, Month, Day);
	}
	else Result = false;
	return Result;
}
*/

var MonthNames = new Array();
var WeekDayNames = new Array();
var MonthDayNames = new Array();
/*MonthNames = ["&#1601;&#1585;&#1608;&#1585;&#1583;&#1740;&#1606;", "&#1575;&#1585;&#1583;&#1740;&#1576;&#1607;&#1588;&#1578;", "&#1582;&#1585;&#1583;&#1575;&#1583;", "&#1578;&#1740;&#1585;", "&#1605;&#1585;&#1583;&#1575;&#1583;", "&#1588;&#1607;&#1585;&#1740;&#1608;&#1585;", "&#1605;&#1607;&#1585;", "&#1570;&#1576;&#1575;&#1606;", "&#1570;&#1584;&#1585;", "&#1583;&#1740;", "&#1576;&#1607;&#1605;&#1606;", "&#1575;&#1587;&#1601;&#1606;&#1583;"];
WeekDayNames = ["&#1740;&#1705;&#1588;&#1606;&#1576;&#1607;", "&#1583;&#1608;&#1588;&#1606;&#1576;&#1607;", "&#1587;&#1607; &#1588;&#1606;&#1576;&#1607;", "&#1670;&#1607;&#1575;&#1585; &#1588;&#1606;&#1576;&#1607;", "&#1662;&#1606;&#1580; &#1588;&#1606;&#1576;&#1607;", "&#1580;&#1605;&#1593;&#1607;", "&#1588;&#1606;&#1576;&#1607;"];
MonthDayNames = ["&#1575;&#1608;&#1604;", "&#1583;&#1608;&#1605;", "&#1587;&#1608;&#1605;", "&#1670;&#1607;&#1575;&#1585;&#1605;", "&#1662;&#1606;&#1580;&#1605;", "&#1588;&#1588;&#1605;", "&#1607;&#1601;&#1578;&#1605;", "&#1607;&#1588;&#1578;&#1605;", "&#1606;&#1607;&#1605;", "&#1583;&#1607;&#1605;", "&#1740;&#1575;&#1586;&#1583;&#1607;&#1605;", "&#1583;&#1608;&#1575;&#1586;&#1583;&#1607;&#1605;", "&#1587;&#1740;&#1586;&#1583;&#1607;&#1605;", "&#1670;&#1607;&#1575;&#1585;&#1583;&#1607;&#1605;", "&#1662;&#1575;&#1606;&#1586;&#1583;&#1607;&#1605;", "&#1588;&#1575;&#1606;&#1586;&#1583;&#1607;&#1605;", "&#1607;&#1601;&#1583;&#1607;&#1605;", "&#1607;&#1580;&#1583;&#1607;&#1605;", "&#1606;&#1608;&#1586;&#1583;&#1607;&#1605;", "&#1576;&#1740;&#1587;&#1578;&#1605;", "&#1576;&#1740;&#1587;&#1578; &#1608; &#1740;&#1705;&#1605;", "&#1576;&#1740;&#1587;&#1578; &#1608; &#1583;&#1608;&#1605;", "&#1576;&#1740;&#1587;&#1578; &#1608; &#1587;&#1608;&#1605;", "&#1576;&#1740;&#1587;&#1578; &#1608; &#1670;&#1607;&#1575;&#1585;&#1605;", "&#1576;&#1740;&#1587;&#1578; &#1608; &#1662;&#1606;&#1580;&#1605;", "&#1576;&#1740;&#1587;&#1578; &#1608; &#1588;&#1588;&#1605;", "&#1576;&#1740;&#1587;&#1578; &#1608; &#1607;&#1601;&#1578;&#1605;", "&#1576;&#1740;&#1587;&#1578; &#1608; &#1607;&#1588;&#1578;&#1605;", "&#1576;&#1740;&#1587;&#1578; &#1608; &#1606;&#1607;&#1605;", "&#1587;&#1740; &#1575;&#1605;", "&#1587;&#1740; &#1608; &#1740;&#1705;&#1605;"];
*/
MonthNames = ["فروردین", "اردیبهشت", "خرداد", "تیر", "مرداد", "شهریور", "مهر", "آبان", "آذر", "دی", "بهمن", "اسفند"];
WeekDayNames = ["یکشنبه", "دوشنبه", "سه شنبه", "چهارشنبه", "پنج شنبه", "جمعه", "شنبه"];
MonthDayNames = ["اول", "دوم", "سوم", "چهارم", "پنجم", "ششم", "هفتم", "هشتم", "نهم", "دهم", "&#1740;&#1575;&#1586;&#1583;&#1607;&#1605;", "&#1583;&#1608;&#1575;&#1586;&#1583;&#1607;&#1605;", "&#1587;&#1740;&#1586;&#1583;&#1607;&#1605;", "&#1670;&#1607;&#1575;&#1585;&#1583;&#1607;&#1605;", "&#1662;&#1575;&#1606;&#1586;&#1583;&#1607;&#1605;", "&#1588;&#1575;&#1606;&#1586;&#1583;&#1607;&#1605;", "&#1607;&#1601;&#1583;&#1607;&#1605;", "&#1607;&#1580;&#1583;&#1607;&#1605;", "&#1606;&#1608;&#1586;&#1583;&#1607;&#1605;", "&#1576;&#1740;&#1587;&#1578;&#1605;", "&#1576;&#1740;&#1587;&#1578; &#1608; &#1740;&#1705;&#1605;", "&#1576;&#1740;&#1587;&#1578; &#1608; &#1583;&#1608;&#1605;", "&#1576;&#1740;&#1587;&#1578; &#1608; &#1587;&#1608;&#1605;", "&#1576;&#1740;&#1587;&#1578; &#1608; &#1670;&#1607;&#1575;&#1585;&#1605;", "&#1576;&#1740;&#1587;&#1578; &#1608; &#1662;&#1606;&#1580;&#1605;", "&#1576;&#1740;&#1587;&#1578; &#1608; &#1588;&#1588;&#1605;", "&#1576;&#1740;&#1587;&#1578; &#1608; &#1607;&#1601;&#1578;&#1605;", "&#1576;&#1740;&#1587;&#1578; &#1608; &#1607;&#1588;&#1578;&#1605;", "&#1576;&#1740;&#1587;&#1578; &#1608; &#1606;&#1607;&#1605;", "&#1587;&#1740; &#1575;&#1605;", "&#1587;&#1740; &#1608; &#1740;&#1705;&#1605;"];

function ConvertStr(DateStr, Format)
{
	var Result;
	var ObjDate = new Date();
	
	var SplDate = DateStr.split("/");			
	var M = new Integer(parseInt(SplDate[0]));
	var D = new Integer(parseInt(SplDate[1]));
	var Y = new Integer(parseInt(SplDate[2]));
	ObjDate.setFullYear(Y.value);
	ObjDate.setMonth(M.value - 1);
	ObjDate.setDate(D.value);
	var W = ObjDate.getDay();
	
	if (GregorianToSolar(Y, M, D))
	{
		switch (Format)
		{
		case 0:
			Result = D.value + "/" + M.value + "/" + Y.value;
			break;
		case 1:
			Result = D.value + "/" + M.value + "/" + (Y.value - Math.floor(Y.value / 100) * 100);
			break;
		case 2:
			Result = (D.value + " " + MonthNames[M.value - 1] + " " + Y.value);
			break;
		case 3:
			Result = (MonthDayNames[D.value - 1] + " " + MonthNames[M.value - 1] + " " + Y.value);
			break;
		case 4:
			Result = (MonthDayNames[D.value - 1] + " " + MonthNames[M.value - 1] + " &#1605;&#1575;&#1607; " + Y.value);		
			break;
		case 5:
			Result = WeekDayNames[W] + "&#1548; " + D.value + "/" + M.value + "/" + Y.value;
			break;
		case 6:
			Result = WeekDayNames[W] + "&#1548; " + D.value + "/" + M.value + "/" + (Y.value - Math.floor(Y.value / 100) * 100);
			break;
		case 7:
			Result = WeekDayNames[W] + "، " + (D.value + " " + MonthNames[M.value - 1] + " " + Y.value);
			break;
		case 8:
			Result = WeekDayNames[W] + "&#1548; " + (MonthDayNames[D.value - 1] + " " + MonthNames[M.value - 1] + " " + Y.value);
			break;
		case 9:
			Result = WeekDayNames[W] + "&#1548; " + (MonthDayNames[D.value - 1] + " " + MonthNames[M.value - 1] + " &#1605;&#1575;&#1607; " + Y.value);		
			break;
		default:
			Result = D.value + "/" + M.value + "/" + Y.value;
			break;
		}
		}
	else
		Result = "Error converting date.";
	return Result;
}	

function ConvertDateTag(DateStr, Format)
{
	return "<div align=right dir=rtl>" + ConvertStr(DateStr, Format) + "</div>";
}

function getSolarDay(DateStr)
{
	var ObjDate = new Date();
	var SplDate = DateStr.split("/");			
	var M = new Integer(parseInt(SplDate[0]));
	var D = new Integer(parseInt(SplDate[1]));
	var Y = new Integer(parseInt(SplDate[2]));
	ObjDate.setFullYear(Y.value);
	ObjDate.setMonth(M.value - 1);
	ObjDate.setDate(D.value);
	var W = ObjDate.getDay();

	if (GregorianToSolar(Y, M, D))
		return D.value;
	else return -1;
		

}
function getSolarMonth(DateStr)
{
	
	var ObjDate = new Date();
	var SplDate = DateStr.split("/");			
	var M = new Integer(parseInt(SplDate[0]));
	var D = new Integer(parseInt(SplDate[1]));
	var Y = new Integer(parseInt(SplDate[2]));
	ObjDate.setFullYear(Y.value);
	ObjDate.setMonth(M.value - 1);
	ObjDate.setDate(D.value);
	var W = ObjDate.getDay();
	if (GregorianToSolar(Y, M, D))
		return M.value;
	else
		return -1;
}
/*
function ConvertArchiveTag(DatesStr, Format)
{
	var Dates = new Array();
	Dates = DatesStr.split("-");
	var Result = ConvertStr(Dates[0], Format) + " - " + ConvertStr(Dates[1], Format);
	return "<div align=right dir=rtl>" + Result + "</div>";
	
}
*/

function getFormattedCurrentDateString()
{
	var today=new Date(document.lastModified);
	var month=today.getMonth()+1;
	return month+"/"+today.getDate()+"/"+today.getFullYear();
}

//----------------------------------

//<script language="javascript" type="text/javascript">
//<!--
function calcPrayertime()
{
	//var i = document.getElementById("cities").selectedIndex;
	//if(i==0)
		//return

	//var m=document.getElementById("month").selectedIndex+1;
	//var d=eval(document.getElementById("day").value);
	//var lg=eval(document.getElementById("longitude").value);
	//var lat=eval(document.getElementById("latitude").value);
	
	var m= getSolarMonth(getFormattedCurrentDateString());
	var d= getSolarDay(getFormattedCurrentDateString());
	
	var lg=55.316667;
	var lat=25.266667;
	var ep=sun(m,d,4,lg)
	
	var zr=ep[0];
	delta=ep[1];
	ha=loc2hor(108.0,delta,lat)
	var t1=Round(zr-ha,24)
	ep=sun(m,d,t1,lg)
	zr=ep[0];
	delta=ep[1];
	ha=loc2hor(108.0,delta,lat)
	var t1=Round(zr-ha,24)
	document.getElementById("tt1").innerHTML=hms(t1);
//
//   t2= Sun rise
//
	ep=sun(m,d,6,lg)
	zr=ep[0];
	delta=ep[1];
	ha=loc2hor(90.833,delta,lat)
	var t2=Round(zr-ha,24)
	ep=sun(m,d,t2,lg)
	zr=ep[0];
	delta=ep[1];
	ha=loc2hor(90.833,delta,lat)
	t2=Round(zr-ha,24)
	document.getElementById("tt2").innerHTML=hms(t2);
//	
//	zr=Zohr
//
	ep=sun(m,d,12,lg)
	ep=sun(m,d,ep[0],lg)
	zr=ep[0];
	document.getElementById("tzr").innerHTML=hms(zr);
//
//   t2= Sun set
//
	ep=sun(m,d,18,lg)
	zr=ep[0];
	delta=ep[1];
	ha=loc2hor(90.833,delta,lat)
	var t3=Round(zr+ha,24)
	ep=sun(m,d,t3,lg)
	zr=ep[0];
	delta=ep[1];
	ha=loc2hor(90.833,delta,lat)
	t3=Round(zr+ha,24)
	document.getElementById("tt3").innerHTML=hms(t3);
//
//   t2= Maghreb
//
	ep=sun(m,d,18.5,lg)
	zr=ep[0];
	delta=ep[1];
	ha=loc2hor(94.3,delta,lat)
	var t4=Round(zr+ha,24)
	ep=sun(m,d,t4,lg)
	zr=ep[0];
	delta=ep[1];
	ha=loc2hor(94.3,delta,lat)
	t4=Round(zr+ha,24)
	document.getElementById("tt4").innerHTML=hms(t4);
	
}
function sun(m,d,h,lg)
{
	if(m<7)
		d= 31*(m-1)+d+h/24;
	else
		d=6+30*(m-1)+d+h/24;
	var M=74.2023+0.98560026*d;
	var L=-2.75043+0.98564735*d;
	var lst=8.3162159+0.065709824*Math.floor(d)+1.00273791*24*(d%1)+lg/15;	
	var e=0.0167065;
	var omega=4.85131-0.052954*d;
	var ep=23.4384717+0.00256*cosd(omega);
	var ed=180.0/Math.PI*e;
	var u=M;
	for(var i=1;i<5;i++)
		u=u-(u-ed*sind(u)-M)/(1-e*cosd(u));
	var v=2*atand(tand(u/2)*Math.sqrt((1+e)/(1-e)));
	var theta=L+v-M-0.00569-0.00479*sind(omega);
	var delta=asind(sind(ep)*sind(theta));
	var alpha=180.0/Math.PI*Math.atan2(cosd(ep)*sind(theta),cosd(theta));
	if(alpha>=360)
		alpha-=360;
	var ha=lst-alpha/15;
	var zr=Round(h-ha,24);
	return ([zr,delta])
}
/*function init()
{
		lgs= [0,49.70,48.30,45.07,51.64,48.68,46.42,57.33,56.29,50.84,59.21,46.28,51.41,48.34,49.59,60.86,48.50,53.06,53.39,47.00,50.86,52.52,50.00,50.88,57.06,47.09,54.44,59.58,48.52,51.59,54.35];
		lats=[0,34.09,38.25,37.55,32.68,31.32,33.64,37.47,27.19,28.97,32.86,38.08,35.70,33.46,37.28,29.50,36.68,36.57,35.58,35.31,32.33,29.62,36.28,34.64,30.29,34.34,36.84,36.31,34.80,30.67,31.89];
}*/
function coord()
{
	var c=document.getElementById("tcities");
	var i = c.selectedIndex;
	if(i==0)
	{
		document.getElementById("tlongitude").value="";
		document.getElementById("tlatitude").value="";
	}
	else
	{
		document.getElementById("tlongitude").value=lgs[i].toString()
		document.getElementById("tlatitude").value=lats[i].toString()
	}
}
function sind(x){return(Math.sin(Math.PI/180.0*x));}
function cosd(x){return(Math.cos(Math.PI/180.0*x));}
function tand(x){return(Math.tan(Math.PI/180.0*x));}
function atand(x){return(Math.atan(x)*180.0/Math.PI);}
function asind(x){return(Math.asin(x)*180.0/Math.PI);}
function acosd(x){return(Math.acos(x)*180.0/Math.PI);}
function sqrt(x){return(Math.sqrt(x));}
function frac(x){return(x%1);}
function floor(x){return(Math.floor(x));}
function ceil(x){return(Math.ceil(x));}
function loc2hor(z,d,p){
	return(acosd((cosd(z)-sind(d)*sind(p))/cosd(d)/cosd(p))/15);
}
function Round(x,a){
	var tmp=x%a;
	if(tmp<0)
		tmp+=a;
	return(tmp)
}
function hms(x)
{
	x=Math.floor(3600*x+1800);
	h=Math.floor(x/3600);
	mp=x-3600*h;
	m=Math.floor(mp/60);
	s=Math.floor(mp-60*m);
	return(((h<10)? "۰" : "")+toFarsiNumfromString( h.toString())+":"+((m<10)? "۰" : "")+toFarsiNumfromString(m.toString())+":"+((s<10)? "۰" : "")+toFarsiNumfromString(s.toString()))
}
function main()
{
	
	//calcPrayertime();
//	document.getElementById("tcurrentdate").innerHTML=ConvertStr((getFormattedCurrentDateString(),7);
	//document.write(ConvertStr((getFormattedCurrentDateString(),0));
	document.getElementById("tcurrentdate").innerHTML=toFarsiNumfromString(ConvertStr(getFormattedCurrentDateString(),7));
	calcPrayertime();
}

function toFarsiNumfromString(inputStr)
{
	var x=new String(inputStr);
	//var newStr=new String();
	/*for(pos=0;pos<x.length;pos++)
	{
		var currchar=x.charAt(pos);
		if(currchar=="&")
		{
			newStr=newStr+x.charAt(pos)+x.charAt(pos+1)+x.charAt(pos+2)+x.charAt(pos+3)+x.charAt(pos+4)+x.charAt(pos+5);
			pos=pos+6;
			continue;
			//document.write("AMP");
		}
		newStr=newStr+toFarsiNum(currchar);
	}*/
	x=x.replace(/1/g,"۱");

	//document.write(x);
	x=x.replace(/2/g,"۲");
	x=x.replace(/3/g,"۳");
	x=x.replace(/4/g,"۴");
	x=x.replace(/5/g,"۵");
	x=x.replace(/6/g,"۶");
	x=x.replace(/7/g,"۷");
	x=x.replace(/8/g,"۸");
	x=x.replace(/9/g,"۹");
	
	x=x.replace(/0/g,"۰");
	x=x.replace(/:/g,":");
	return x;//newStr;
}

function toFarsiNum(number)
{
	
	
	if(number==0)
	{
		return "۰";
	}
	else if(number==1)
	{
			return "۱";
	}
	else if(number==2)
	{
			return "۲";
	}
	else if(number==3)
	{
			return "۳";
	}
	else if(number==4)
	{
			return "۴";
	}
	else if(number==5)
	{
			return "۵";
	}
	else if(number==6)
	{
			return "۶";
	}
	else if(number==7)
	{
			return "۷";
	}
	else if(number==8)
	{
			return "۸";
	}
	else if(number==9)
	{
			return "۹";
	}
	else return number;
}
//-->
//</script>
