


function choose_order(order_type)
{
	var req = new JsHttpRequest();
	ShowLoadingScreen();
	
	req.onreadystatechange = function()
	{
		if(req.readyState == 4)
		{
			document.body.style.cursor = '';
			
			HideLoadingScreen();
			
			$('#order_field').html(req.responseJS.result);
			
			if(order_type != 2)
				doSetLocation(document.getElementById('country').value, './');
			else
				doSetCityArea(1, './');
		}
	}
	
	req.open(null, './?choose_order=' + order_type, true);
	req.send(null);
	document.body.style.cursor = "wait";

}

function GetDeliveryByCity(city_id)
{
	var req = new JsHttpRequest();
	ShowLoadingScreen();
	
	req.onreadystatechange = function()
	{
		if(req.readyState == 4)
		{
			document.body.style.cursor = '';
			
			HideLoadingScreen();
			
			$('#tod').html(req.responseJS.result);
            $sistem = sistem_pay();
             
		}
	}
	
	req.open(null, './?choose_city=' + city_id, true);
	req.send(null);
	document.body.style.cursor = "wait";
}


function GetDeliveryByLocation(location_id)
{

    var req = new JsHttpRequest();
    ShowLoadingScreen();
    
    req.onreadystatechange = function()
    {
        if(req.readyState == 4)
        {
            document.body.style.cursor = '';
            
            HideLoadingScreen();
            
            $('#tod').html(req.responseJS.result);
            var sistem = sistem_pay();
            
        }
    }
    
    req.open(null, './?choose_location=' + location_id, true);
    req.send(null);
    document.body.style.cursor = "wait";
    
    
}



function GetDeliveryByCityArea(sel_city_area)
{

    var req = new JsHttpRequest();
    ShowLoadingScreen();
    
    req.onreadystatechange = function()
    {
        if(req.readyState == 4)
        {
            document.body.style.cursor = '';
            
            HideLoadingScreen();
            
            $('#todCityArea').html(req.responseJS.result);
            var sistem = sistem_pay();  
        }
    }
    
    req.open(null, './?choose_city_area=' + sel_city_area, true);
    req.send(null);
    document.body.style.cursor = "wait";
}



function make_short_order()
{
	var name = $("form input[name=site_users_name]").val();
	var address = $("form input[name=full_address]").val();
	var email = $("form input[name=site_users_email]").val();
	
	if(name.length == 0 || address.length == 0 || email.length == 0)
	  jAlert('Все поля отмеченные звездочкой обязательны для заполнения!', 'Быстрый заказ');
	else
	  $("#make_order").submit();
}













 

