			var Delimit = new String("^~#");
			var LineDelimit = new String("~^#");
			var ElementDelimit = new String("~,~");
			var Element2Delimit = new String("^,^");			

			function CristianDayCheker(txt_Day,KeyCode,txt_Month,WithSetFocus){
				if (NumberText(txt_Day,KeyCode,false)){
					if (KeyCode==13){
						if ((txt_Month.value=="04" || txt_Month.value=="06" || txt_Month.value=="09" || txt_Month.value=="11") && txt_Day.value=="31"){
							txt_Day.value="";
							if (WithSetFocus) txt_Day.focus();
						}
						if (txt_Month.value=="02" && txt_Day.value>"29"){
							txt_Day.value="";
							if (WithSetFocus) txt_Day.focus();
						}
						if (txt_Day.value > 31 || txt_Day.value == 0){
							txt_Day.value=""
						}
						else{
							if (txt_Day.value.length == 1){
								var Defaultval=new String();
								Defaultval=Defaultval.concat("0",txt_Day.value);
								txt_Day.value=Defaultval;
								window.event.returnValue=false;
								if (WithSetFocus) txt_Month.focus();
							}
							else if (txt_Day.value.length == 2 && WithSetFocus) txt_Month.focus();
						}
					}
				}
			}
			
			function CristianMonthCheker(txt_Month,KeyCode,txt_Year,txt_Day,WithSetFocus){
				if (NumberText(txt_Month,KeyCode,false)){
					if (KeyCode==13){
						if (txt_Month.value > 12  || txt_Month.value == 0){
							txt_Month.value=""
						}
						else{
							if (txt_Month.value.length == 1){
								var Defaultval=new String();
								Defaultval=Defaultval.concat("0",txt_Month.value);
								txt_Month.value=Defaultval
								window.event.returnValue=false;
								if (WithSetFocus) txt_Year.focus();
							}
							else if (txt_Month.value.length == 2 && WithSetFocus) txt_Year.focus();
						}
						if ((txt_Month.value=="04" || txt_Month.value=="06" || txt_Month.value=="09" || txt_Month.value=="11") && txt_Day.value=="31"){
							txt_Day.value="";
							if (WithSetFocus) txt_Day.focus();
						}
						if (txt_Month.value=="02" && txt_Day.value>"29"){
							txt_Day.value="";
							if (WithSetFocus) txt_Day.focus();
						}
					}
				}
			}
			
			function CristianYearCheker(txt_year,KeyCode,FocusObject,WithSetFocus){
				if (NumberText(txt_year,KeyCode,false)){
					if (KeyCode==13){
						var Filler = new String("2003")
						txt_year.value = Filler.substr(0,4-txt_year.value.length) + txt_year.value;
						window.event.returnValue = false;
						if (WithSetFocus) FocusObject.focus();
					}
				}
			}

			function DayCheker(txt_Day,KeyCode,txt_Month,WithSetFocus){
				if (NumberText(txt_Day,KeyCode,false)){
					if (KeyCode==13){
						if (txt_Day.value == 31){
							if (txt_Month.value.charAt(0)=="1" || txt_Month.value.charAt(0)=="0" && txt_Month.value.charAt(1)>="7") txt_Month.value="";
						}
						if (txt_Day.value > 31 || txt_Day.value ==0){
							txt_Day.value=""
							if (WithSetFocus) txt_Day.focus();
						}
						else{
							if (txt_Day.value.length == 1){
								var Defaultval=new String();
								Defaultval=Defaultval.concat("0",txt_Day.value);
								txt_Day.value=Defaultval;
								if (WithSetFocus) txt_Month.focus();
							}
							else if (txt_Day.value.length == 2  && WithSetFocus) txt_Month.focus();
						}
					}
				}
			}
			
			function MonthCheker(txt_Month,KeyCode,txt_Year,txt_Day,WithSetFocus){
				if (NumberText(txt_Month,KeyCode,false)){
					if (KeyCode==13){
						if (txt_Month.value > 12 || txt_Month.value ==0){
							txt_Month.value=""
						}
						else{
							if (txt_Month.value.length == 1){
								var Defaultval=new String();
								Defaultval=Defaultval.concat("0",txt_Month.value);
								txt_Month.value=Defaultval
								if (WithSetFocus) txt_Year.focus();
							}
							else if (txt_Month.value.length == 2 && WithSetFocus) txt_Year.focus();
						}
						if (txt_Month.value.charAt(0)=="1" || txt_Month.value.charAt(0)=="0" && txt_Month.value.charAt(1)>="7"){
							if (txt_Day.value=="31"){
								txt_Day.value="";
								if (WithSetFocus) txt_Day.focus();
							}
						}
					}
				}
			}
			
			function YearCheker(txt_year,KeyCode,FocusObject,WithSetFocus){
				if (NumberText(txt_year,KeyCode,false)){
					if (KeyCode==13){
						if (txt_year.value.length == 0) txt_year.value="1385";
						else if (txt_year.value.length == 1) txt_year.value="138"+txt_year.value;
						else if (txt_year.value.length == 2) txt_year.value="13"+txt_year.value;
						else if (txt_year.value.length == 3) txt_year.value="1"+txt_year.value;
						else if (txt_year.value.length == 4 && txt_year.value < 1300) txt_year.value="";
						if (WithSetFocus) FocusObject.focus();
					}
				}
			}
		
			function GetDate(YearObj,MonthObj,DayObj){
				var Filler = new String("1385")
				YearObj.value = Filler.substr(0,4-YearObj.value.length) + YearObj.value;
				if (MonthObj.value.length == 1) MonthObj.value = '0' + MonthObj.value;
				if (DayObj.value.length == 1) DayObj.value = '0' + DayObj.value;
				D = YearObj.value+MonthObj.value+DayObj.value;
				if (D.length == 8)	{return D;}
				else						return '';
			}

			function NumberText(Obj,KeyCode,HaveDecimal){
				if (KeyCode >= 96 && KeyCode <= 105 || KeyCode==16 || KeyCode >= 48 && KeyCode <= 57 || KeyCode==46 || KeyCode==9 ||KeyCode==13 || KeyCode==8 || KeyCode==37 || KeyCode==39){
					return true;
				}
				else {
					if ((KeyCode==190 || KeyCode==110) && HaveDecimal && Obj.value.indexOf(".",0) == -1){
						return true;
					}else{
						window.event.returnValue = false;
						return false;
					}
				}
			}

			function NumberWithComma(S){
				var i=0;
				var SSS = new String();
				var F = new String();
				var D = new String();

				S = S.toString ()
				for (i=1;i<20;i++)
					S = S.replace(",","");

				i = S.indexOf(".",0)
				if (i != -1)		{
					F = S.substr(i);
					D = S.substr (0,i);
				}
				else {
					F = "";
					D = S.substr (0);
				}

				SSS = D.substr(D.length-3)
				for (i=D.length-3; i>0 ; i=i-3)
					SSS = D.substring(i-3,i) + "," + SSS;
				
				D = SSS + F;
				if(D=='0')
					return ('');
				else
					return (D);
			}

			function SetAmount(Obj,Donegative,Decimal,Variable){
				var i,A,F='';
				if (Obj.value!='') A=Obj.value;
				else A=0;
				if (typeof(A)=="string"){
					for (i=1;i<20;i++)
						A = A.replace(",","");
						
					if (Decimal==0)
						F = '';
					else {
						i = A.indexOf(".",0)
						if (i != -1)
							F = A.substr(i,Decimal+1);
					}

					if (Donegative)
						A = -parseFloat(A);
					else
						A = parseFloat(A);
					if(eval(Variable)<0) A = -A
				}
				eval(Variable +'= A');
				A = parseInt(Math.abs(A)).toString();
				Obj.value = NumberWithComma(A+F,Decimal)
				return;
			}

			function AddLeadZero(Obj){
				var H = new String();
				H = '0000000000';
				Obj.value = H.substr(1,Obj.maxLength-Obj.value.length) + Obj.value
			}

			function DataToClipBoard(Container,HeaderRows){
				if (typeof(HeaderRows)=='undefined')	HeaderRows = 1;
				var i,Data='',r,FirstTable=true;
				for (i=0;i<Container.children.length;i++){
					if(Container.children.item(i).tagName=='TABLE'){
						Data = Data + MakeData(Container.children.item(i),FirstTable,HeaderRows);
						if(Container.children.item(i).id=='DataTable') FirstTable = false;
					}
				}
				window.clipboardData.clearData();
				r = window.clipboardData.setData ('Text',Data);
				if (r)
					alert('داده‌ها به Clipboard انتقال يافت.')
			}
			function MakeData(Table,FirstTable,HeaderRows){
				var i , j , s='';
				if (FirstTable)i=0;
				else i=HeaderRows;
				for (i=i;i<Table.rows.length-1;i++){
					for (j=0;j<Table.rows.item(i).cells.length;j++){
						s = s + Table.rows.item(i).cells.item(j).innerText + String.fromCharCode(9);
					}
					s = s + String.fromCharCode(13,10);
				}
				return s;
			}
			function FillDateDiv(YearInput , MonthInput , DayInput , strDate){
				if(strDate=='        ')  return false;
				DayInput.value = strDate.substr(6,2);
				MonthInput.value = strDate.substr(4,2);
				YearInput.value = strDate.substr(0,4);
			}

