//------------------ Функции для расчета доставки -----------------------
// Проверить, есть ли уже определения переменных weight и index, если нет, то раскомментировать
var weight=1;
var index=0;

//var DeliveryOptionsToCheckHash="10";
var DeliveryOptionsToCheckHash="1,2,3,4,5,6,7,8,9,10";

function DeliveryChanged1(){
	var DeliveryDiv = document.getElementById("DeliveryDiv");
	var shippmode = document.getElementById("shippmode");
	if (DeliveryDiv==null || shippmode==null)
		return true;
	var shippmodeValue = ","+shippmode.value+",";
	var DeliveryOption = new String(","+DeliveryOptionsToCheckHash+",");
	if (DeliveryOption.indexOf(shippmodeValue)==-1)
		DeliveryDiv.style.display="none";
	else
		DeliveryDiv.style.display="block";
	return true;
}

function check_area() {
	var country_set=null;
	var area_set=null;
	country_set=document.getElementById('country');
	area_set=document.getElementById('area');
	if (country_set.value=='Российская Федерация') area_set.disabled=false; else area_set.disabled=true;
}

function DeliveryPaymentCase() {
	var DeliveryMode = document.getElementById("DeliveryMode");
	var DeliveryDiv = document.getElementById("DeliveryDiv");
	var ShippMode = document.getElementById("ShippMode");
	var ShippmodeDiv = document.getElementById("ShippmodeDiv");
	
	if ( DeliveryDiv == null || ShippmodeDiv == null || DeliveryMode == null) return true;
	if ( DeliveryMode.value == 0 )
	{
		ShippmodeDiv.style.display = 'block';
		ShippMode.options[0] = null;
	}
}