var cesta;
var domainname="http://localhost/postart/";

function jsStart()
{
	jsCalculate();
	jsBinder();
	jsDDListDeliverySelectedIndexChanged();
	jsSelectPaymentMethodSelectedIndexChanged();
	try
	{document.getElementById("divsum3").style.display="";}
	catch(e)
	{}
}
function jsAddItem(gid)
{	
	try
	{atilekt.WebForm1.csAddItem(gid);}
	catch(e)
	{}
	var tt=window.showModalDialog( domainname + "cart.aspx","Dialog Box Arguments # 1","dialogHeight: 600px; dialogWidth: 900px; dialogTop: px; dialogLeft: px; edge: Raised; center: Yes; resizable: Yes; status: No;");
	if(tt!=null)
	{
		window.location=tt;
	}
}
function jsDeleteItem(gid)
{
try{
	atilekt.WebForm1.csDeleteItem(gid);
	Form1.submit();
	jsCalculate();}
	catch(e){}
	try{
	postart.meteor.controls.cesta.csDeleteItem(gid);
	var CestaPid=postart.meteor.controls.cesta.csGoCesta().value;
	self.location=domainname+ "page_pid_" + CestaPid + ".aspx";
	jsCalculate();}
	catch(e){}
}
function jsStartOrdering()
{
	var CestaPid=atilekt.WebForm1.csGoCesta().value;
	if( window.parent != null )
	{
	window.parent.returnValue = domainname+ "page_pid_" + CestaPid + ".aspx";
	window.parent.close();
	}
	self.close();
}
function jsCloseCesta()
{
	self.close();
}


function jsChangeCestaQuontity(row)
{
try{
	var val=document.getElementById("InputCestaQ"+row).value;
	atilekt.WebForm1.csChangeCestaRowsQuontityValue(row,val);
	jsCalculate();
	}
	catch(e){}
	try{
	var val=document.getElementById("InputCestaQ"+row).value;
	postart.meteor.controls.cesta.csChangeCestaRowsQuontityValue(row,val);
	jsCalculate();
	var tempx=document.getElementById("SelectDelivery").selectedIndex;
	if(tempx==0)
	{
		
	}
	if(tempx==1)
	{
		document.getElementById("ShowDeliveryWeight").style.display="none";
		/*document.getElementById("SpanDeliveryWeight").innerHTML=postart.meteor.controls.cesta.csGetDeliveryWeight(2).value;*/
	}
	if(tempx==3)
	{
		if(document.getElementById("SelectDestinationCountry")!=null)
		{
			var t0=document.getElementById("SelectDestinationCountry").selectedIndex;
			jsBindSelectDestinationCountry();
			document.getElementById("SelectDestinationCountry").selectedIndex=t0;
			var t1=document.getElementById("SelectDestinationCountry").selectedIndex;
			var t2=document.getElementById("SelectDestinationCountry").options[t1].value;
			document.getElementById("ShowSelectDestinationCountry").innerHTML="составляет&nbsp;&nbsp;"+t2+" руб.";
		}
		document.getElementById("ShowDeliveryWeight").style.display="";
		document.getElementById("SpanDeliveryWeight").innerHTML=postart.meteor.controls.cesta.csGetDeliveryWeight(1).value;
		jsRefreshSum();
	}
	}
	catch(e){}
}


function jsCalculate()
{
	jsCalculate1();
	jsCalculate2();
}
function jsCalculate1()
{
	if(document.getElementById("sum")!=null)
	{
		try
		{document.getElementById("sum").innerHTML=atilekt.WebForm1.csCalculate().value+" руб.";}
		
		catch(e)
		{}
	}
}
function jsCalculate2()
{
	if(document.getElementById("sum3")!=null)
	{
		try
		{document.getElementById("sum3").innerHTML=postart.meteor.controls.cesta.csCalculate().value+" руб.";}
		catch(e)
		{}
	}
	if(document.getElementById("sum2")!=null)
	{
		try
		{
		jsRefreshSum();
		}
		catch(e)
		{}
	}
}
function jsEnableSum2()
{
	document.getElementById("divsum3").style.display="none";
	document.getElementById("divsum2_1").style.display="";
}
function jsDDListDeliverySelectedIndexChanged(id)
{
try{
	if(document.getElementById("ShowTextListDelivery")!=null)
	{
		var temp=document.getElementById("SelectDelivery").selectedIndex;
		document.getElementById("ShowTextListDelivery").innerHTML=postart.meteor.controls.cesta.csDDListDeliverySelectedIndexChanged(temp).value;
		
		if(temp==1)
		{
			jsBindSelectDestinationCity();
			jsSelectDestinationCityChanged();

			document.getElementById("DivSelectDestinationCity").style.display="";
			document.getElementById("ShowSelectDestinationCity").style.display="";
			document.getElementById("SpanDeliveryWeight").innerHTML=postart.meteor.controls.cesta.csGetDeliveryWeight(2).value;
			var tempy=document.getElementById("SelectDestinationCity").selectedIndex;
			document.getElementById("SpanDeliveryTime").innerHTML=postart.meteor.controls.cesta.csGetDeliveryTime(tempy).value;
			
			document.getElementById("ShowDeliveryTime").style.display="";
			
			document.getElementById("ShowTubusCheckBox").style.display="none";
			document.getElementById("DivSelectDestinationCountry").style.display="none";
			document.getElementById("ShowSelectDestinationCountry").style.display="none";
			document.getElementById("DivSelectDeliveryInMoscow").style.display="none";
			document.getElementById("ShowSelectDeliveryInMoscow").style.display="none";
			
			jsRefreshSum();
		}
		else
		{
			if(temp==3)
			{
				try
					{
						jsBindSelectDestinationCountry();
						jsSelectDestinationCountryChanged();
						
						document.getElementById("ShowDeliveryWeight").style.display="";
						document.getElementById("SpanDeliveryWeight").innerHTML=postart.meteor.controls.cesta.csGetDeliveryWeight(1).value;
						
						document.getElementById("DivSelectDestinationCountry").style.display="";
						document.getElementById("ShowSelectDestinationCountry").style.display="";

						document.getElementById("ShowDeliveryTime").style.display="none";
						document.getElementById("ShowTubusCheckBox").style.display="none";
						document.getElementById("DivSelectDestinationCity").style.display="none";
						document.getElementById("ShowSelectDestinationCity").style.display="none";
						document.getElementById("DivSelectDeliveryInMoscow").style.display="none";
						document.getElementById("ShowSelectDeliveryInMoscow").style.display="none";
			
						jsRefreshSum();
					}
				catch(e){}
			}
			else{
				try
					{
						document.getElementById("ShowTubusCheckBox").style.display="";
						
						document.getElementById("ShowDeliveryTime").style.display="none";
						document.getElementById("DivSelectDestinationCity").style.display="none";
						document.getElementById("ShowSelectDestinationCity").style.display="none";
						document.getElementById("DivSelectDestinationCountry").style.display="none";
						document.getElementById("ShowSelectDestinationCountry").style.display="none";
						document.getElementById("ShowDeliveryWeight").style.display="none";
						
						if(temp==0)
						{
							jsBindSelectDeliveryInMoscow();
							jsSelectDeliveryInMoscowChanged();
							
							document.getElementById("DivSelectDeliveryInMoscow").style.display="";
							document.getElementById("ShowSelectDeliveryInMoscow").style.display="";
						
							document.getElementById("TubusWordsForDeliveryInMoscow").style.display="";
							document.getElementById("TubusWordsForSamovivoz").style.display="none";
							document.getElementById("CheckboxTubus").checked=false;
						}
						if(temp==2)
						{
							document.getElementById("DivSelectDeliveryInMoscow").style.display="none";
							document.getElementById("ShowSelectDeliveryInMoscow").style.display="none";
							
							document.getElementById("TubusWordsForDeliveryInMoscow").style.display="none";
							document.getElementById("TubusWordsForSamovivoz").style.display="";
							document.getElementById("CheckboxTubus").checked=false;
						}
						jsRefreshSum();
					}
				catch(e){}
				}
		}
		jsBindSelectPaymentMethod(document.getElementById("SelectDelivery").options[temp].value);
	}
}
catch(e){}
}
function jsBinder()
{
var ar1=new Array();
var ar2=new Array();
var res;
var x;
var y=0;
	try
	{
		ar1=postart.meteor.controls.cesta.csGetListDeliveryAr1().value;
		ar2=postart.meteor.controls.cesta.csGetListDeliveryAr2().value;
		res="<select id=SelectDelivery onChange='jsDDListDeliverySelectedIndexChanged()' >";
		for (x in ar1)
		{
			if(y==0)
			{
			}
			else
			{
				if(y==1)
				{}
				else
				{	
					res+="<option value=" + ar1[x] + ">" + ar2[x] + "</option>";
				}
			}
			y=y+1;
		}
		res+="</select>";
	
	document.getElementById("DivSelectDelivery").innerHTML=res;
	
	}
	catch(e){}
}
function jsBindSelectDestinationCity()
{
var ar1=new Array();
var ar2=new Array();
var res;
var x;
var y=0;
	if(document.getElementById("DivSelectDestinationCity")!=null)
	{
		try
		{
			ar1=postart.meteor.controls.cesta.csGetListOFCityAr1().value;
			ar2=postart.meteor.controls.cesta.csGetListOFCityAr2().value;
			res="<select id=SelectDestinationCity onChange='jsSelectDestinationCityChanged()' >";
			for (x in ar1)
			{
				if(y==0)
				{
				}
				else
				{
					if(y==1)
					{}
					else
					{	
						res+="<option value=" + ar2[x] + ">" + ar1[x] + "</option>";
					}
				}
				y=y+1;
			}
			res+="</select>";
		
		document.getElementById("DivSelectDestinationCity").innerHTML="Доставка в город&nbsp;&nbsp;&nbsp;"+res;
		
		}
		catch(e){}
	}
}
function jsSelectDestinationCityChanged()
{
	if(document.getElementById("ShowSelectDestinationCity")!=null)
	{
		if(document.getElementById("SelectDestinationCity")!=null)
		{
			var temp=document.getElementById("SelectDestinationCity").selectedIndex;
			document.getElementById("ShowSelectDestinationCity").innerHTML="составляет&nbsp;&nbsp;"+postart.meteor.controls.cesta.csSelectDestinationCityChanged(temp).value+" руб.";
			
			document.getElementById("ShowDeliveryTime").style.display="";
			var tempy=document.getElementById("SelectDestinationCity").selectedIndex;
			document.getElementById("SpanDeliveryTime").innerHTML=postart.meteor.controls.cesta.csGetDeliveryTime(tempy).value;
		}
	}
	jsRefreshSum();
}
function jsBindSelectDestinationCountry()
{
var ar1=new Array();
var ar2=new Array();
var res;
var x;
var y=0;
	if(document.getElementById("DivSelectDestinationCountry")!=null)
	{
		try
		{
			ar1=postart.meteor.controls.cesta.csGetListOFCountryAr1().value;
			ar2=postart.meteor.controls.cesta.csGetListOFCountryAr2().value;
			res="<select id=SelectDestinationCountry onChange='jsSelectDestinationCountryChanged()' >";
			for (x in ar1)
			{
				if(y==0)
				{
				}
				else
				{
					if(y==1)
					{}
					else
					{	
						res+="<option value=" + ar2[x] + ">" + ar1[x] + "</option>";
					}
				}
				y=y+1;
			}
			res+="</select>";
		
		document.getElementById("DivSelectDestinationCountry").innerHTML="Доставка в страну&nbsp;&nbsp;&nbsp;"+res;
		
		}
		catch(e){}
	}
}
function jsSelectDestinationCountryChanged()
{
	/*document.getElementById("ShowPostPrice").style.display="";
	document.getElementById("SpanPostPrice").innerHTML=postart.meteor.controls.cesta.csGetDeliveryPrice(1).value;*/
						
	if(document.getElementById("ShowSelectDestinationCountry")!=null)
	{
		if(document.getElementById("SelectDestinationCountry")!=null)
		{
			var t1=document.getElementById("SelectDestinationCountry").selectedIndex;
			var t2=document.getElementById("SelectDestinationCountry").options[t1].value;
			document.getElementById("ShowSelectDestinationCountry").innerHTML="составляет&nbsp;&nbsp;"+t2+" руб.";
		}
	}
	jsRefreshSum();
}
function jsBindSelectDeliveryInMoscow()
{
var arr1=new Array();
var arr2=new Array();
var res;
var x;
var y=0;
	if(document.getElementById("DivSelectDeliveryInMoscow")!=null)
	{
		try
		{
			arr1=postart.meteor.controls.cesta.csGetListOFDeliveryInMoscowAr1().value;
			arr2=postart.meteor.controls.cesta.csGetListOFDeliveryInMoscowAr2().value;
			res="<select id=SelectDeliveryInMoscow onChange='jsSelectDeliveryInMoscowChanged()' >";
			for (x in arr1)
			{
				if(y==0)
				{
				}
				else
				{
					if(y==1)
					{}
					else
					{	
						res+="<option value=" + arr2[x] + ">" + arr1[x] + "</option>";
					}
				}
				y=y+1;
			}
			res+="</select>";
		
		document.getElementById("DivSelectDeliveryInMoscow").innerHTML="Доставка &nbsp;"+res;
		
		}
		catch(e){}
	}
}
function jsSelectDeliveryInMoscowChanged()
{
	/*document.getElementById("ShowPostPrice").style.display="";
	document.getElementById("SpanPostPrice").innerHTML=postart.meteor.controls.cesta.csGetDeliveryPrice(1).value;*/
						
	if(document.getElementById("ShowSelectDeliveryInMoscow")!=null)
	{
		if(document.getElementById("SelectDeliveryInMoscow")!=null)
		{
			var t1=document.getElementById("SelectDeliveryInMoscow").selectedIndex;
			var t2=document.getElementById("SelectDeliveryInMoscow").options[t1].value;
			document.getElementById("ShowSelectDeliveryInMoscow").innerHTML="составляет&nbsp;&nbsp;"+t2+" руб.";
		}
	}
	jsRefreshSum();
}
function jsSelectPaymentMethodSelectedIndexChanged()
{
	try
	{
		var t1=document.getElementById("SelectPaymentMethod").selectedIndex;
		var t2=document.getElementById("SelectPaymentMethod").options[t1].value;
		document.getElementById("ShowTextPaymentMethod").innerHTML=postart.meteor.controls.cesta.csSelectPaymentMethodSelectedIndexChanged(t2).value;
		//if(t2=="412")
		//{
			jsRefreshSum();
		//}
	}
	catch(e){}
}
function jsBindSelectPaymentMethod(pid)
{
var ar1=new Array();
var ar2=new Array();
var res;
var x;
var y=0;
	if(document.getElementById("DivSelectPaymentMethod")!=null)
	{
		try
		{
			ar1=postart.meteor.controls.cesta.csSelectPaymentMethodAr1(pid).value;
			ar2=postart.meteor.controls.cesta.csSelectPaymentMethodAr2(pid).value;
			res="<select id=SelectPaymentMethod onChange='jsSelectPaymentMethodSelectedIndexChanged()' >";
			for (x in ar1)
			{
				if(y==0)
				{
				}
				else
				{
					if(y==1)
					{}
					else
					{	
						res+="<option value=" + ar1[x] + ">" + ar2[x] + "</option>";
					}
				}
				y=y+1;
			}
			res+="</select>";
		
		document.getElementById("DivSelectPaymentMethod").innerHTML=res;
		
		}
		catch(e){}
	}
}
var total=0;
var s0="0";
var s1="0";
var s2="0";
var s3="0";
var s4="0";
var s5="0";
var d0=0;
var d1=0;
var d2=0;
var d3=0;
var d4=0;
var d5=0;
var d6=0;
function jsCountSum()
{
	try
		{document.getElementById("sum2").style.display="";}
	catch(e){}
	total=0;
	s0="0";s1="0";s2="0";s3="0";s4="0";s5="0";
	d0=0;d1=0;d2=0;d3=0;d4=0;d5=0;d6=0;
	var index=document.getElementById("SelectDelivery").selectedIndex;
	var index2=document.getElementById("SelectPaymentMethod").options[document.getElementById("SelectPaymentMethod").selectedIndex].value;

	try
		{var temp=postart.meteor.controls.cesta.csCalculate().value;
			if(temp!=null)
				{s1=temp;}}
	catch(e){}
	
	try
		{if(index==0)
			{var t1=document.getElementById("SelectDeliveryInMoscow").selectedIndex;
				s0=document.getElementById("SelectDeliveryInMoscow").options[t1].value;}}
	catch(e){}
	
	try
		{if(index==1)
			{if(document.getElementById("SelectDestinationCity")!=null)
				{var temp=document.getElementById("SelectDestinationCity").selectedIndex;
				s2=postart.meteor.controls.cesta.csSelectDestinationCityChanged(temp).value;}}}
	catch(e){}
	
	try
		{if(index==3)
			{if(document.getElementById("SelectDestinationCountry")!=null)
				{var t1=document.getElementById("SelectDestinationCountry").selectedIndex;
				s3=document.getElementById("SelectDestinationCountry").options[t1].value;}}}
	catch(e){}
	
	try
		{if(index==0)
			{if(document.getElementById("CheckboxTubus").checked==true)
				{s4=postart.meteor.controls.cesta.csGetTubusPrice().value;}}
		if(index==2)
			{if(document.getElementById("CheckboxTubus").checked==true)
				{s4=postart.meteor.controls.cesta.csGetTubusPrice().value;}}}
	catch(e){}
	
	d0=postart.meteor.controls.cesta.csConvert(s0).value;
	d1=postart.meteor.controls.cesta.csConvert(s1).value;
	d2=postart.meteor.controls.cesta.csConvert(s2).value;
	d3=postart.meteor.controls.cesta.csConvert(s3).value;
	d4=postart.meteor.controls.cesta.csConvert(s4).value;
	d5=postart.meteor.controls.cesta.csConvert(s5).value;
	total=parseFloat(d0)+parseFloat(d1)+parseFloat(d2)+parseFloat(d3)+parseFloat(d4)+parseFloat(d5);
	
	try
		{if(index2=="412")
			{var d66=postart.meteor.controls.cesta.csImplementNalozhenniPrice(total).value;
			d6=d66-total;
			total=d66;}}
	catch(e){}
}
function jsRefreshSum()
{
	try
		{jsCountSum();
		if(document.getElementById("sum2")!=null)
			{document.getElementById("sum2").innerHTML=postart.meteor.controls.cesta.csGoodDouble(total).value+" руб.";}}
	catch(e){}
	
	if(d0!=0)
		{try
			{document.getElementById("SpanDelMoscow1").style.display="";
			document.getElementById("SpanDelMoscow2").innerHTML=d0+" руб.";}
		catch(e){}}
	else
		{document.getElementById("SpanDelMoscow1").style.display="none";
		document.getElementById("SpanDelMoscow2").innerHTML="";}
	
	if(d1!=0)
		{try
			{document.getElementById("SpanSubTotal1").style.display="";
			document.getElementById("SpanSubTotal2").innerHTML=d1+" руб.";}
		catch(e){}}
	else
		{document.getElementById("SpanSubTotal1").style.display="none";
		document.getElementById("SpanSubTotal2").innerHTML="";}
	
	if(d2!=0)
		{try
			{document.getElementById("SpanDelCity1").style.display="";
			document.getElementById("SpanDelCity2").innerHTML=d2+" руб.";}
		catch(e){}}
	else
		{document.getElementById("SpanDelCity1").style.display="none";
		document.getElementById("SpanDelCity2").innerHTML="";}
	
	if(d3!=0)
		{try
		{
			document.getElementById("SpanDelPost1").style.display="";
			document.getElementById("SpanDelPost2").innerHTML=d3+" руб.";
		}
		catch(e){}
	}
	else
	{
		document.getElementById("SpanDelPost1").style.display="none";
		document.getElementById("SpanDelPost2").innerHTML="";
	}
	
	if(d4!=0)
	{
		try
		{
			document.getElementById("SpanDelInTubus1").style.display="";
			document.getElementById("SpanDelInTubus2").innerHTML=d4+" руб.";
		}
		catch(e){}
	}
	else
	{
		document.getElementById("SpanDelInTubus1").style.display="none";
		document.getElementById("SpanDelInTubus2").innerHTML="";
	}
	
	if(d6!=0)
	{
		try
		{var index2=document.getElementById("SelectPaymentMethod").options[document.getElementById("SelectPaymentMethod").selectedIndex].value;
		if(index2=="412")
			{document.getElementById("SpanWayNalo1").style.display="";
			document.getElementById("SpanWayNalo2").innerHTML=postart.meteor.controls.cesta.csGoodDouble(d6).value+" руб.";}}
		catch(e){}
	}
	else
	{
		document.getElementById("SpanWayNalo1").style.display="none";
		document.getElementById("SpanWayNalo2").innerHTML="";
	}
	
}
function jsCheck()
{
	jsCountSum();
	postart.meteor.controls.cesta.csSetSum(total);
	var a=new Array();
	a[0]=d1;
	if(d2!=0)
	{
	try{
		var temp=document.getElementById("SelectDestinationCity").selectedIndex;
		d2=postart.meteor.controls.cesta.csSelectDestinationCityChangedReturnId(temp).value;
		}
		catch(e){}
	}
	a[1]=d2;
	a[2]=d3;
	a[3]=d4;
	var t5=document.getElementById("SelectPaymentMethod").selectedIndex;
	var d5=document.getElementById("SelectPaymentMethod").options[t5].value;
	a[4]=d5;
	//var t6=document.getElementById("SelectPaymentMethod").selectedIndex;
	//var t7=document.getElementById("SelectPaymentMethod").options[t6].value;
	if(d5=="412")
	{
		a[5]=1;
	}
	else
	{
		a[5]=0;
	}
	a[6]=d0;
	postart.meteor.controls.cesta.csCestaAdd(a);

	var tt=showModalDialog( domainname + "check.aspx","Dialog Box Arguments # 1","dialogHeight: 600px; dialogWidth: 900px; dialogTop: px; dialogLeft: px; edge: Raised; center: Yes; resizable: Yes; status: No;");
	if(tt!=null)
	{
		window.location=tt;
	}
}
function jsSaveOrder(OkPid)
{
	if( window.parent != null )
	{
	window.parent.returnValue = domainname+ "page_pid_" + OkPid + ".aspx";
	window.parent.close();
	}
	self.close();
	
}
var ac0="Ваша Фамилия";
var ac1="Ваше Имя";
var ac2="Ваше Отчество";
var ac3="Электропочта";
var ac4="Адрес (улица, дом, корпус, этаж, квартира)";
var ac5="Телефон";
var ac6="Страна";
var ac7="Штат";
var ac8="Город";
var ac9="Почтовый индекс";
var ac10="Комментарий";
function jsWriteInfo()
{
	var a=new Array();
	var error=false;
var ac0="Ваша Фамилия";
var ac1="Ваше Имя";
var ac2="Ваше Отчество";
var ac3="Электропочта";
var ac4="Адрес (улица, дом, корпус, этаж, квартира)";
var ac5="Телефон";
var ac6="Страна";
var ac7="Штат";
var ac8="Город";
var ac9="Почтовый индекс";
var ac10="Комментарий";
	a[0]=document.getElementById("InputLastName").value;
	a[1]=document.getElementById("InputFirstName").value;
	a[2]=document.getElementById("InputMiddleName").value;
	a[3]=document.getElementById("InputEmail").value;
	a[4]=document.getElementById("InputAddress").value;
	a[5]=document.getElementById("InputPhone").value;
	a[6]=document.getElementById("InputCountry").value;
	a[7]=document.getElementById("InputState").value;
	a[8]=document.getElementById("InputCity").value;
	a[9]=document.getElementById("InputZip").value;
	a[10]=document.getElementById("TAcomment").value;
	document.getElementById("spanerror0").innerHTML="*";
	document.getElementById("spanerror1").innerHTML="*";
	//document.getElementById("spanerror2").innerHTML="*";
	document.getElementById("spanerror3").innerHTML="*";
	document.getElementById("spanerror4").innerHTML="*";
	document.getElementById("spanerror5").innerHTML="*";
	//document.getElementById("spanerror6").innerHTML="*";
	//document.getElementById("spanerror7").innerHTML="*";
	document.getElementById("spanerror8").innerHTML="*";
	document.getElementById("spanerror9").innerHTML="*";
	//document.getElementById("spanerror10").innerHTML="*";
	
	if(a[0]==ac0)
	{error=true;
	document.getElementById("spanerror0").innerHTML="* - Введите свое имя!";}
	if(a[1]==ac1)
	{error=true;
	document.getElementById("spanerror1").innerHTML="* - Введите свою фамилию!";}
	/*if(a[2]==ac2)
	{error=true;
	document.getElementById("spanerror2").innerHTML="* - Введите свое отчество!";}*/
	if(a[3]==ac3)
	{error=true;
	document.getElementById("spanerror3").innerHTML="* - Введите свой емейл!";}
	if(!postart.meteor.controls.cesta.csValidateEmail(a[3]).value)
	{error=true;
	document.getElementById("spanerror3").innerHTML="* - Неверный формат!";}
	if(a[4]==ac4)
	{error=true;
	document.getElementById("spanerror4").innerHTML="* - Введите свой адрес!";}
	if(a[5]==ac5)
	{error=true;
	document.getElementById("spanerror5").innerHTML="* - Введите свой телефон!";}
	/*if(a[6]==ac6)
	{error=true;
	document.getElementById("spanerror6").innerHTML="* - Введите свою страну!";}
	if(a[7]==ac7)
	{error=true;
	document.getElementById("spanerror7").innerHTML="* - Введите свой штат!";}*/
	if(a[8]==ac8)
	{error=true;
	document.getElementById("spanerror8").innerHTML="* - Введите свой город!";}
	if(a[9]==ac9)
	{error=true;
	document.getElementById("spanerror9").innerHTML="* - Введите почтовый индекс!";}

	if(!error)
	{
	jsEnableSum2();
	postart.meteor.controls.cesta.csSetInfo(a);
	document.getElementById("Step2").style.display="none";
	document.getElementById("Step3").style.display=""
	}
}

function jsGetInfo2()
{
	try
	{
		var a=new Array();
		if(postart.meteor.controls.cesta.csGetInfo().value!=null)
		{
			a=postart.meteor.controls.cesta.csGetInfo().value;
		}
		if(a.length>2)
		{
			ac0=a[0];
			ac1=a[1];
			ac2=a[2];
			ac3=a[3];
			ac4=a[4];
			ac5=a[5];
			ac6=a[6];
			ac7=a[7];
			ac8=a[8];
			ac9=a[9];
			ac10=a[10];
		}
	}
	catch(e){}
	document.getElementById("InputLastName").value=ac0;
	document.getElementById("InputFirstName").value=ac1;
	document.getElementById("InputMiddleName").value=ac2;
	document.getElementById("InputEmail").value=ac3;
	document.getElementById("InputAddress").value=ac4;
	document.getElementById("InputPhone").value=ac5;
	document.getElementById("InputCountry").value=ac6;
	document.getElementById("InputState").value=ac7;
	document.getElementById("InputCity").value=ac8;
	document.getElementById("InputZip").value=ac9;
	document.getElementById("TAcomment").value=ac10;
}
