var loading = '<center><div style="margin-top:150px;"><img src="images/ajax-loader_add_item.gif"></div></center>';
var main_sait = 'http://autoline24.com.ua/';
function comment_on()
{
    var comment_form = document.getElementById('comment_form');
    comment_form.style.display = 'block';
}
function translate (lang)
{
    var text = document.getElementById('lang_russian').value;
    var cont = document.getElementById('lang_' + lang);
    link = main_sait + "moduls/translate.php?lang=" + lang + "&text=" + text;
    var query = "";
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {  
                cont.value = http.responseText;
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
function popular_model_get_parts(file)
{
	var cont = document.getElementById('popular_model');
    cont.innerHTML = loading;  
    link = main_sait + "popular_models_parts.php?file=" + file;
    var query = "";
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {  
                cont.innerHTML = http.responseText;
		check_in_base();
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
function popular_model_get(file)
{
	var cont = document.getElementById('popular_model');
    cont.innerHTML = loading;  
    link = main_sait + "popular_models.php?file=" + file;
    var query = "";
    var http = createRequestObject();
    other_param = file;
    limit = -1;
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {  
                cont.innerHTML = http.responseText;
		check_in_base();
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
function get_model()
{
	var cont = document.getElementById('model');
	var mark = document.getElementById('mark').value;
    cont.innerHTML = loading;  
    link = main_sait + "moduls/parcer/add/autotrader_model.php";
    var query = "mark=" + mark;
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {  
                cont.innerHTML = http.responseText;
		check_in_base();
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
function set_main_id_edit(id)
{
    link = main_sait + "moduls/ajax/set_main_edit.php";
    var query = "id=" + id;
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {
		var button = document.getElementById('button_add_item');
		button.disabled = false;
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
function set_main_id(id)
{
    link = main_sait + "moduls/ajax/set_main.php";
    var query = "id=" + id;
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {  
		var button = document.getElementById('button_add_item');
		button.disabled = false;
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
function set_main_edit(id)
{
    var button = document.getElementById('button_add_item');
    button.disabled = true;
    var img_id = document.getElementById('img_id_' + id);
    var main_img = document.getElementById('main_img');
    id_old = main_img.value;
    if (id_old.length>0)
    {
	    var main_img_value = document.getElementById('img_id_' + id_old);
	    main_img_value.style.borderStyle = 'solid';
	    main_img_value.style.borderWidth = '0px';
	    main_img_value.style.borderColor = 'red';
    }
    img_id.style.borderStyle = 'solid';
    img_id.style.borderWidth = '3px';
    img_id.style.borderColor = 'red';
    main_img.value = id;
    set_main_id_edit(id);
    //var image_1 = document.getElementById('thumb_id_' + id);
    //var id_next = id-1;
    //var image_2 = document.getElementById('thumb_id_' + id_next);
    //var tmp = image_1.innerHTML;
    //image_1.id = 'thumb_id_' + id_next;
    //image_2.id = 'thumb_id_' + id;
    //image_1.innerHTML = image_2.innerHTML;
    //image_2.innerHTML = tmp;
}
function set_main(id)
{
	var button = document.getElementById('button_add_item');
	button.disabled = true;
	var img_id = document.getElementById('img_id_' + id);
	var main_img = document.getElementById('main_img');
	id_old = main_img.value;
	if (id_old.length>0)
	{
		var main_img_value = document.getElementById('img_id_' + id_old);
		main_img_value.style.borderStyle = 'solid';
		main_img_value.style.borderWidth = '0px';
		main_img_value.style.borderColor = 'red';
	}
	img_id.style.borderStyle = 'solid';
	img_id.style.borderWidth = '3px';
	img_id.style.borderColor = 'red';
	main_img.value = id;
	set_main_id(id);
	//var image_1 = document.getElementById('thumb_id_' + id);
	//var id_next = id-1;
	//var image_2 = document.getElementById('thumb_id_' + id_next);
	//var tmp = image_1.innerHTML;
	//image_1.id = 'thumb_id_' + id_next;
	//image_2.id = 'thumb_id_' + id;
	//image_1.innerHTML = image_2.innerHTML;
	//image_2.innerHTML = tmp;

}
function nagleg ()
{
	var catalog = document.getElementById('catalog').value;
	var sk = document.getElementById('sk').value;
	var kyrs = document.getElementById('kyrs').value;
	roztamogka = ((catalog-(catalog*sk))*0.33)*kyrs;
	var price_col = document.getElementById('price_col')
	price_col.value = Math.ceil(roztamogka);
}
function reply(id)
{
	var cont = document.getElementById(id);
	var div_block = document.getElementById('reply_html');
	reply_html.innerHTML = 'Ответ на сообщение под номером - ' + id;
	var reply_hidden = document.getElementById('reply');
	reply_hidden.value = id;
}
function save_works_parts(url)
{
	var cont = document.getElementById('vzyatki_html');
	var url_allegro = document.getElementById('url_allegro');
    cont.innerHTML = loading;
    link = url + '&url_allegro=' + url_allegro.value;
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('get', link);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {  
                cont.innerHTML = http.responseText;
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
function save_col(url)
{
	var cont = document.getElementById('vzyatki_html');
	var price_col = document.getElementById('price_col');
	var vzyatki = document.getElementById('vzyatki');
	var dostavka = document.getElementById('dostavka');
	var catalog = document.getElementById('catalog');
	var edit_or_add = document.getElementById('edit_or_add');
    cont.innerHTML = loading;
    link = url + '&price_col=' + price_col.value + '&vzyatki=' + vzyatki.value + '&dostavka=' + dostavka.value + '&catalog=' + catalog.value + '&edit_or_add=' + edit_or_add.value;
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('get', link);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {  
                cont.innerHTML = http.responseText;
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
function show_mark(url)
{
    var cont = document.getElementById('rubricator');
    cont.innerHTML = loading;  
    link = url
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('get', link);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {  
                cont.innerHTML = http.responseText;
                $('.bubbleInfo').each(function () {
                        var distance = 10;
                        var time = 250;
                        var hideDelay = 500;
                 
                        var hideDelayTimer = null;
                 
                        var beingShown = false;
                        var shown = false;
                        var trigger = $('.trigger', this);
                        var info = $('.popup', this).css('opacity', 0);
                 
                 
                        $([trigger.get(0), info.get(0)]).mouseover(function () {
                            if (hideDelayTimer) clearTimeout(hideDelayTimer);
                            if (beingShown || shown) {
                                // don't trigger the animation again
                                return;
                            } else {
                                // reset position of info box
                                beingShown = true;
                 
                                info.css({
                                    top: -40,
                                    left: -33,
                                    display: 'block'
                                }).animate({
                                    top: '-=' + distance + 'px',
                                    opacity: 1
                                }, time, 'swing', function() {
                                    beingShown = false;
                                    shown = true;
                                });
                            }
                 
                            return false;
                        }).mouseout(function () {
                            if (hideDelayTimer) clearTimeout(hideDelayTimer);
                            hideDelayTimer = setTimeout(function () {
                                hideDelayTimer = null;
                                info.animate({
                                    top: '-=' + distance + 'px',
                                    opacity: 0
                                }, time, 'swing', function () {
                                    shown = false;
                                    info.css('display', 'none');
                                });
                 
                            }, hideDelay);
                 
                            return false;
                        });
                    });
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
function show_search_page_with_container(url, conteiner)
{
    var cont = document.getElementById(conteiner);
    cont.innerHTML = loading;  
    link = url
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('get', link);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {  
                cont.innerHTML = parseScript(http.responseText);
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
function show_search_page(url)
{
    var cont = document.getElementById('pane');
    cont.innerHTML = loading;  
    link = url
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('get', link);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {  
                cont.innerHTML = parseScript(http.responseText);
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
function get_joy_value_in_search(id_parent, id)
{
    var parent_value = document.getElementById('param_' + id_parent).value;
    var cont = document.getElementById('param_' + id);
    cont.innerHTML = loading;  
    link = main_sait + "moduls/add_item/user_files/get_value_select_parent.php";
    var query = "id=" + id + "&id_parent=" + id_parent + "&parent_value=" + parent_value;
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {  
                cont.innerHTML = http.responseText;
		check_in_base();
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
function add_balance()
{
    var cont = document.getElementById('balance_html');
    var user_id = document.getElementById('user_id').value;
    var balance = document.getElementById('balance').value;
    var body = document.getElementById('body').value;
    link = main_sait + "moduls/save_balance.php";
    var query = "user_id=" + user_id + "&balance=" + balance + "&body=" + body;
    var http = createRequestObject();
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {
                cont.innerHTML = parseScript(http.responseText);
            } 
        }
        http.send(null);      
    }
    else   
    {  
        document.location = link;  
    }
}
function save_work()
{
    var cont = document.getElementById('to_email');
    var search_id = document.getElementById('search_id').value;
    var in_sait = document.getElementById('in_sait').value;
    var in_mail = document.getElementById('in_mail').value;
    var in_sms = document.getElementById('in_sms').value;
    link = main_sait + "moduls/save_work_email.php";
    var query = "search_id=" + search_id + "&in_sait=" + in_sait + "&in_mail=" + in_mail + "&in_sms=" + in_sms;
    var http = createRequestObject();
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {
                cont.innerHTML = parseScript(http.responseText);
            } 
        }
        http.send(null);      
    }
    else   
    {  
        document.location = link;  
    }
}
function delete_search(id)
{
    var cont = document.getElementById('search_' + id);
    link = main_sait + "moduls/delete_search.php";
    var query = "id=" + id;
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {
                cont.innerHTML = parseScript(http.responseText);
            } 
        }
        http.send(null);      
    }
    else   
    {  
        document.location = link;  
    }
}
function delete_video(id)
{
    var cont = document.getElementById('video_' + id);
    link = main_sait + "moduls/delete_video.php";
    var query = "id=" + id;
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {
                cont.innerHTML = parseScript(http.responseText);
            } 
        }
        http.send(null);      
    }
    else   
    {  
        document.location = link;  
    }
}
function remove_image_from_db(addid)
{
    var cont = document.getElementById('del_img_' + addid);
    link = main_sait + "moduls/remove_image_from_db.php";
    var query = "addid=" + addid;
    var http = createRequestObject();  
	count_upload_items_my = count_upload_items_my - 1;
	var upload_file_html = document.getElementById('upload_file_html');
	upload_file_html.innerHTML = 'Загружено ' + count_upload_items_my + ' файлов';
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {
                cont.innerHTML = parseScript(http.responseText);
            } 
        }
        http.send(null);      
    }
    else   
    {  
        document.location = link;  
    }
}
function remove_image_from_add(id)
{
    var cont = document.getElementById('del_img_' + id);
    link = main_sait + "moduls/remove_image_from_add.php";
    var query = "id=" + id;
    var http = createRequestObject();  
    count_upload_items_my = count_upload_items_my - 1;
    var upload_file_html = document.getElementById('upload_file_html');
    upload_file_html.innerHTML = 'Загружено ' + count_upload_items_my + ' файлов';
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {
                cont.innerHTML = parseScript(http.responseText);
            } 
        }
        http.send(null);      
    }
    else   
    {  
        document.location = link;  
    }
}
function delete_mail(id)
{
    var cont = document.getElementById('delete_mail_' + id);
    link = main_sait + "moduls/mailing/delete_mail.php";
    var query = "id=" + id;
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {
                cont.innerHTML = parseScript(http.responseText);
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
function notice_me_on_new_car(id)
{
    var cont = document.getElementById('notice_me');
    link = main_sait + "moduls/notice_me/notice_me_on_new_car.php";
    var query = "";
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {
                //alert (1000);
                cont.innerHTML = parseScript(http.responseText);
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
function check_mail()
{
    var cont = document.getElementById('notice_tmp');
    link = main_sait + "moduls/mailing/check_mail.php";
    var query = "";
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {
                //alert (1000);
                cont.innerHTML = parseScript(http.responseText);
            }  
        }  
        http.send(null);   
    }  
    else   
    {  
        document.location = link;  
    }
}
function send_mail()
{
    var cont = document.getElementById('mail_form');
    var id_user_to = document.getElementById('id_user_to').value;
    var name = document.getElementById('name').value;
    var email = document.getElementById('email').value;
    var phone = document.getElementById('phone').value;
    var body_mail = document.getElementById('body_mail').value;
    var id_user_from = document.getElementById('id_user_from').value;
    var theme = document.getElementById('theme').value;
    link = main_sait + "moduls/mailing/send_mail.php";
    
    var query = "id_user_to=" + id_user_to + "&name=" + name + "&email=" + email + "&phone=" + phone + "&body_mail=" + body_mail + "&id_user_from=" + id_user_from + "&theme=" + theme;
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {  
                cont.innerHTML = parseScript(http.responseText);
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
function delete_favorite(id)
{
    var cont = document.getElementById('item_' + id);
    link = main_sait + "moduls/delete_favorite.php";
    var query = "id=" + id;
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {  
                cont.innerHTML = parseScript(http.responseText);
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
function view_favorite()
{
    var cont = document.getElementById('contentBody_2');
    link = main_sait + "moduls/view_favorite.php";
    var query = "";
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {  
                cont.innerHTML = parseScript(http.responseText);
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
function add_to_my_europe_auto(id)
{
    var cont = document.getElementById('tmp_favorite');
    link = main_sait + "moduls/add_to_my_europe_auto.php";
    var query = "id=" + id;
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {  
                cont.innerHTML = parseScript(http.responseText);
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
function add_to_my_europe_auto_monitor(id)
{
    var cont = document.getElementById('tmp_favorite');
    link = main_sait + "moduls/add_to_my_europe_auto.php";
    var query = "id=" + id;
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {
                cont.innerHTML = parseScript(http.responseText);
		my_eu_car_refresh();
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
function add_favorite_full(id)
{
    var cont = document.getElementById('tmp_favorite');
    link = main_sait + "moduls/add_favorite.php";
    var query = "id=" + id;
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {  
                cont.innerHTML = parseScript(http.responseText);
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
function add_favorite_full_online_monitor(id)
{
    var cont = document.getElementById('tmp_favorite');
    link = main_sait + "moduls/add_favorite.php";
    var query = "id=" + id;
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)
            {
		my_parking_refresh();
                cont.innerHTML = parseScript(http.responseText);
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
function add_favorite(id)
{
    var cont = document.getElementById('tmp_favorite');
    link = main_sait + "moduls/add_favorite.php";
    var query = "id=" + id;
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {  
                cont.innerHTML = parseScript(http.responseText);
                view_favorite();
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
function online_full()
{
    var cont = document.getElementById('sait_main_conteiner');
    link = main_sait + "online_monitor.php";
    var query = "";
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {  
                cont.innerHTML = http.responseText;  
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
function registration_user_in_sait()
{
    var cont = document.getElementById('register_form');
    var mobile1 = document.getElementById('mobile1');
    var mobile2 = document.getElementById('mobile2');
    var user_email = document.getElementById('user_email').value;
    var user_name = document.getElementById('user_name');
    var country = document.getElementById('param_78');
    var obl = document.getElementById('param_80');
    var city = document.getElementById('param_81');
    if (mobile1.value.length > 10) {
        alert ("Нужно указать контактный телефон (в формате +380xxyyyyyyy).\n");
    } else {
        if (mobile2.value.length > 0)
        {
            if (mobile2.value.length != 13)
            {
                alert ("Нужно указать второй контактный телефон (в формате +380xxyyyyyyy).\n Или не указывайте вобще");
            }
        } else {
            if (user_name.value.length == 0)
            {
                alert ("Вы должны указать имя");
            } else {
                if (country.value == 'Выберите')
                {
                    alert ("Вы должны выбрать страну из списка");
                } else {
                    if (obl.value == 'Выберите')
                    {
                        alert ("Вы должны выбрать регион из списка");
                    } else {
                        if (city.value == 'Выберите')
                        {
                            alert ("Вы должны выбрать город из списка");
                        } else {
                            //alert ("Профит!!! Вы наконец заполнили форму правильно!!!");
                            cont.innerHTML = loading;  
                            link = main_sait + "moduls/ajax/registeruser_in_sait.php";
                            var query = "mobile1=" + mobile1.value + "&mobile2=" + mobile2.value + "&user_email=" + user_email + "&user_name=" + user_name.value + "&country=" + country.value + "&obl=" + obl.value + "&city=" + city.value;
                            var http = createRequestObject();  
                            if( http )   
                            {  
                                http.open('post', link, true);
                                http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
                                http.send(query);
                                http.onreadystatechange = function ()   
                                {  
                                    if(http.readyState == 4)   
                                    {  
                                        cont.innerHTML = http.responseText;
                                    }  
                                }  
                                http.send(null);      
                            }  
                            else   
                            {  
                                document.location = link;  
                            }
                        }
                    }
                }
            }
        }
    }
}
function go_register()
{
    var cont = document.getElementById('register_form');
    cont.innerHTML = loading;  
    link = main_sait + "moduls/ajax/register_form.php";
    var query = "";
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {  
                cont.innerHTML = http.responseText;  
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
function save_key(id)
{
    var user_key = document.getElementById('user_key').value;
    var cont = document.getElementById('user_key_loading');
    cont.innerHTML = loading;  
    link = main_sait + "moduls/add_item/save_key.php";
    var query = "user_key=" + user_key + "&id=" + id;
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {  
                cont.innerHTML = http.responseText;  
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
function check_value_form(array, array_yellow)
{
    for (var key in array_yellow) {
	var val = array_yellow [key];
	var cont = document.getElementById('param_' + val);
        if (cont.value.length == 0)
        {
            cont.style.border = "1px solid #FF9D00";
        } else {
            cont.style.border = "1px solid green";
        }
    }
    var error = 0;
    for (var key in array) {
	var val = array [key];
	var cont = document.getElementById('param_' + val);
        if (cont.value.length == 0)
        {
            cont.style.border = "1px solid red";
            notice(val, 0);
            error = 1;
        } else {
            cont.style.border = "1px solid green";
        }
    }
    if (error)
    {
        alert ('Не заполнено одно или несколько обязательных полей');
        scroll(0,0);
    } else {
        return true;
    }
}
function check_form_with_login()
{
    var tmp = document.getElementById('check');
    var user_login_online = document.getElementById('user_login_online').value;
    if (user_login_online==1)
    {
	document.cookie="user=1";
	document.getElementById('main_form').submit();        
    } else {
	var radio = $('input[name="contact_button"]:checked').val();
	if (radio==1)
	{
	    login_user();
	}
	if (radio==0)
	{
	    registration_user();
	}
    }
}
function check_form()
{
    var tmp = document.getElementById('check');
    var user_login_online = document.getElementById('user_login_online').value;
    if (user_login_online!=1)
    {
	var cont = document.getElementById('mobile1_html');
	var phone = document.getElementById('mobile1');
	link = main_sait + "moduls/ajax/check_phone.php";
	var mobile_phone_bad_phormat_html = document.getElementById('mobile_phone_bad_phormat_html');
	var query = "phone=" + phone.value + "&lost=1";
	mobile_phone_bad_phormat_html.style.display = 'none';
	var http = createRequestObject();
	if( http )   
	{  
	    http.open('post', link, true);
	    http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	    http.send(query);
	    http.onreadystatechange = function ()   
	    {  
		if(http.readyState == 4)   
		{
		    if (http.responseText.length>0)
		    {
			cont.innerHTML = http.responseText;
			var vhod_na_sait = document.getElementById('vhod_na_sait');
			vhod_na_sait.style.color = 'red';
			phone.value = '';
		    } else {
			if (user_login_online==1)
			{
			    document.cookie="user=1";
			    document.getElementById('main_form').submit();        
			} else {
			    var radio = $('input[name="contact_button"]:checked').val();
			    if (radio==1)
			    {
				login_user();
			    }
			    if (radio==0)
			    {
				registration_user();
			    }
			}
		    }
		}  
	    }  
	    http.send(null);      
	}  
	else   
	{  
	    document.location = link;  
	}
    } else {
	document.cookie="user=1";
	document.getElementById('main_form').submit(); 
    }
}
function registration_user()
{
    var cont = document.getElementById('check');
    var mobile1 = document.getElementById('mobile1');
    var mobile2 = document.getElementById('mobile2');
    var user_email = document.getElementById('user_email').value;
    var user_name = document.getElementById('user_name');
    var country = document.getElementById('param_78');
    var obl = document.getElementById('param_80');
    var city = document.getElementById('param_81');
    if (mobile1.value.length < 10) {
        alert ("Нужно указать контактный телефон (в формате +380xxyyyyyyy).\n");
    } else {
        if (mobile2.value.length > 0)
        {
            if (mobile2.value.length < 10)
            {
                alert ("Нужно указать второй контактный телефон (в формате +380xxyyyyyyy).\n Или не указывайте вобще");
            } else {
                if (user_name.value.length == 0)
                {
                    alert ("Вы должны указать имя");
                } else {
                    if (country.value == 'Выберите')
                    {
                        alert ("Вы должны выбрать страну из списка");
                    } else {
                        if (obl.value == 'Выберите')
                        {
                            alert ("Вы должны выбрать регион из списка");
                        } else {
                            if (city.value == 'Выберите')
                            {
                                alert ("Вы должны выбрать город из списка");
                            } else {
                                //alert ("Профит!!! Вы наконец заполнили форму правильно!!!");
                                cont.innerHTML = loading;  
                                link = main_sait + "moduls/add_item/registeruser.php";
                                var query = "mobile1=" + mobile1.value + "&mobile2=" + mobile2.value + "&user_email=" + user_email + "&user_name=" + user_name.value + "&country=" + country.value + "&obl=" + obl.value + "&city=" + city.value;
                                var http = createRequestObject();  
                                if( http )   
                                {  
                                    http.open('post', link, true);
                                    http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
                                    http.send(query);
                                    http.onreadystatechange = function ()   
                                    {  
                                        if(http.readyState == 4)   
                                        {  
                                            cont.innerHTML = http.responseText;
                                            var user_login_true = document.getElementById('user_login_true').value;
                                            if (user_login_true==1)
                                            {
                                                document.cookie="user=1";
                                                document.getElementById('main_form').submit(); 
                                            } else {
                                                cont.innerHTML = '<span style="color:red;">Логин и пароль или ключ не верный</span>';
                                            }
                                        }  
                                    }  
                                    http.send(null);      
                                }  
                                else   
                                {  
                                    document.location = link;  
                                }
                            }
                        }
                    }
                }
            }
        } else {
            if (user_name.value.length == 0)
            {
                alert ("Вы должны указать имя");
            } else {
                if (country.value == 'Выберите')
                {
                    alert ("Вы должны выбрать страну из списка");
                } else {
                    if (obl.value == 'Выберите')
                    {
                        alert ("Вы должны выбрать регион из списка");
                    } else {
                        if (city.value == 'Выберите')
                        {
                            alert ("Вы должны выбрать город из списка");
                        } else {
                            //alert ("Профит!!! Вы наконец заполнили форму правильно!!!");
                            cont.innerHTML = loading;  
                            link = main_sait + "moduls/add_item/registeruser.php";
                            var query = "mobile1=" + mobile1.value + "&mobile2=" + mobile2.value + "&user_email=" + user_email + "&user_name=" + user_name.value + "&country=" + country.value + "&obl=" + obl.value + "&city=" + city.value;
                            var http = createRequestObject();  
                            if( http )   
                            {  
                                http.open('post', link, true);
                                http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
                                http.send(query);
                                http.onreadystatechange = function ()   
                                {  
                                    if(http.readyState == 4)   
                                    {  
                                        cont.innerHTML = http.responseText;
                                        var user_login_true = document.getElementById('user_login_true').value;
                                        if (user_login_true==1)
                                        {
                                            document.cookie="user=1";
                                            document.getElementById('main_form').submit(); 
                                        } else {
                                            cont.innerHTML = '<span style="color:red;">Логин и пароль или ключ не верный</span>';
                                        }
                                    }  
                                }  
                                http.send(null);      
                            }  
                            else   
                            {  
                                document.location = link;  
                            }
                        }
                    }
                }
            }
        }
    }
}
function login_user()
{
    var cont = document.getElementById('check');
    var user_key = document.getElementById('user_key').value;
    var user_login = document.getElementById('user_login').value;
    var user_password = document.getElementById('user_password').value;
    cont.innerHTML = loading;  
    link = main_sait + "moduls/add_item/checkuser.php";
    var query = "user_key=" + user_key + "&user_login=" + user_login + "&user_password=" + user_password;
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {  
                cont.innerHTML = http.responseText;
                var user_login_true = document.getElementById('user_login_true').value;
                if (user_login_true==1)
                {
                    document.cookie="user=1";
                    document.getElementById('main_form').submit(); 
                } else {
                    tmp.innerHTML = '<span style="color:red;">Логин и пароль или ключ не верный</span>';
                }
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
function notice(id, action)
{
    if (action)
    {
        var element = document.getElementById('notice_' + id);
        element.style.display = 'block';
        var error = document.getElementById('notice_error_' + id);
        error.style.display = 'none';
    } else {
        var param = document.getElementById('param_' + id);
        if (param.value!='')
        {
            var element = document.getElementById('notice_' + id);
            element.style.display = 'none';
            var error = document.getElementById('notice_error_' + id);
            error.style.display = 'none';
            param.style.border = '1px solid green';
        } else {
            var element = document.getElementById('notice_' + id);
            element.style.display = 'none';
            var error = document.getElementById('notice_error_' + id);
            error.style.display = 'block';   
        }
    }
}
function isNumberOrPlusKey(evt)
{
	var charCode = (evt.which) ? evt.which : event.keyCode
	if (charCode > 31 && (charCode < 48 || charCode > 57) && charCode != 43 && charCode != 61)
		return false;
	return true;
}
function save_block_param(id)
{
    var cont = document.getElementById('block_save_' + id);
    var value = document.getElementById('block_id_' + id).value;
    cont.innerHTML = loading;  
    link = main_sait + "moduls/add_item/save_block_param.php";
    var query = "id=" + id + "&value=" + value;
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {  
                cont.innerHTML = http.responseText;  
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
function delete_param(id, id_block)
{
    var cont = document.getElementById('delete_' + id);
    cont.innerHTML = loading;  
    link = main_sait + "moduls/add_item/delete_param.php";
    var query = "id=" + id + "&id_block=" + id_block;
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {  
                cont.innerHTML = http.responseText;  
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
function contact_func(id)
{
    if (id == 0)
    {
        var cont_2 = document.getElementById('user_1');
        cont_2.style.display = 'none';
        var cont = document.getElementById('user_0');
        cont.style.display = 'block';
    } else {
        var cont_2 = document.getElementById('user_0');
        cont_2.style.display = 'none';
        var cont = document.getElementById('user_1');
        cont.style.display = 'block';
    }
}
function get_player(data)
{
    var cont = document.getElementById('loader');
    cont.innerHTML = loading;  
    link = main_sait + "moduls/add_item/player.php";
    var query = "data=" + data;
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {  
                cont.innerHTML = http.responseText;  
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
function changeImagePosition()
{
    
}
function delete_block(id)
{
    var cont = document.getElementById('delete_block_' + id);
    cont.innerHTML = loading;  
    link = main_sait + "moduls/add_item/user_files/delete_block.php";
    var query = "id=" + id;
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {  
                cont.innerHTML = http.responseText;  
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
function get_joy_value_edit_myautoline(id_parent, id, selected_id)
{
    var parent_value = document.getElementById('param_' + id_parent).value;
    var cont = document.getElementById('param_' + id);
    cont.innerHTML = loading;  
    link = main_sait + "moduls/add_item/user_files/get_value_select_parent.php";
    var query = "id=" + id + "&id_parent=" + id_parent + "&parent_value=" + parent_value + "&selected_id=" + selected_id;
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {  
                cont.innerHTML = http.responseText;
		second_passed();
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
function get_joy_value_edit(id_parent, id, selected_id)
{
    var parent_value = document.getElementById('param_' + id_parent).value;
    var cont = document.getElementById('param_' + id);
    cont.innerHTML = loading;  
    link = main_sait + "moduls/add_item/user_files/get_value_select_parent.php";
    var query = "id=" + id + "&id_parent=" + id_parent + "&parent_value=" + parent_value + "&selected_id=" + selected_id;
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {  
                cont.innerHTML = http.responseText;  
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
function get_joy_value(id_parent, id)
{
    var parent_value = document.getElementById('param_' + id_parent).value;
    var cont = document.getElementById('param_' + id);
    link = main_sait + "moduls/add_item/get_joy_value_get.php";
    var query = "id=" + id + "&id_parent=" + id_parent + "&parent_value=" + parent_value;
    link = link + "?" + query;
    var http = createRequestObject();  
    if( http )   
    {
        http.open('get', link);
        http.onreadystatechange = function ()   
        {
            if(http.readyState == 4)   
            {
                cont.innerHTML = http.responseText;
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
/*function get_joy_value(id_parent, id)
{
    var link = main_sait + "moduls/add_item/user_files/get_value_select_parent.php";
    var parent_value = document.getElementById('param_' + id_parent).value;
    var cont = document.getElementById('param_' + id);
    var http = createRequestObject();  
    if( http )   
    {  
	http.open('post', link, true);  
	http.onreadystatechange = function ()   
	{  
	    if(http.readyState == 4)   
	    {  
		cont.innerHTML = http.responseText;
		alert (http.responseText.length);
	    }  
	}  
	http.send(null);      
    }  
    else   
    {  
	document.location = link;  
    }  
}*/
function go_step_3(id_podcategory, id, id_prev)
{
    location.href = "http://autoline24.com.ua/add_new_items.php?id=" + id + "&id_prev=" + id_prev + "&id_podcategory=" + id_podcategory;
}
function go_step_2(id)
{
    var cont = document.getElementById('body_content_new');
    cont.innerHTML = loading;  
    link = main_sait + "moduls/add_item/user_files/step_2.php";
    var query = "id=" + id;
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {  
                cont.innerHTML = http.responseText;  
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
function go_step_1()
{
    var cont = document.getElementById('body_content_new');
    cont.innerHTML = loading;  
    link = main_sait + "moduls/add_item/user_files/step_1.php";
    var query = "";
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {  
                cont.innerHTML = http.responseText;  
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
function check_phone_bool(why)
{
    var cont = document.getElementById(why + '_html');
    var phone = document.getElementById(why).value;
    link = main_sait + "moduls/ajax/check_phone.php";
    var mobile_phone_bad_phormat_html = document.getElementById('mobile_phone_bad_phormat_html');
    var query = "phone=" + phone;
    mobile_phone_bad_phormat_html.style.display = 'none';
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {
		if (http.responseText.length>0)
		{
		    return(0);
		} else {
		    return(1);
		}
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
function check_phone(why)
{
    var cont = document.getElementById(why + '_html');
    var phone = document.getElementById(why).value;
    link = main_sait + "moduls/ajax/check_phone.php";
    var mobile_phone_bad_phormat_html = document.getElementById('mobile_phone_bad_phormat_html');
    var query = "phone=" + phone;
    mobile_phone_bad_phormat_html.style.display = 'none';
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {
		if (http.responseText.length>0)
		{
		    cont.innerHTML = http.responseText;
		    var register_button = document.getElementById('register_button_1');
		    register_button.style.display = 'none';
		    var lostpassword = document.getElementById('lostpassword');
		    lostpassword.style.display = 'block';
		} else {
		    cont.innerHTML = '';
		    var register_button = document.getElementById('register_button_1');
		    register_button.style.display = 'block';
		    var lostpassword = document.getElementById('lostpassword');
		    lostpassword.style.display = 'none';
		}
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
function register_user_in_autoline24(query, link)
{
    var cont = document.getElementById('register_form_new');
    cont.innerHTML = loading;  
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.onreadystatechange = function ()   
        {
            if(http.readyState == 4)   
            {  
                cont.innerHTML = http.responseText;  
            }  
        }  
        http.send(query);    
    }  
    else   
    {  
        document.location = link;  
    }
}
function register_new()
{
    var cont = document.getElementById('register_form_new');
    var error_captcha = document.getElementById('error_captcha');
    var user_name_html = document.getElementById('user_name_html');
    var recaptcha_challenge_field = document.getElementById('recaptcha_challenge_field');
    var recaptcha_response_field = document.getElementById('recaptcha_response_field');
    var user_name = document.getElementById('user_name');
    var mobile1 = document.getElementById('mobile1');
    var mobile2 = document.getElementById('mobile2');
    var email = document.getElementById('email');
    var country = document.getElementById('param_78');
    var region = document.getElementById('param_80');
    var city = document.getElementById('param_81');
    var mobile_phone_one_html = document.getElementById('mobile_phone_one_html');
    var mobile_phone_bad_phormat_html = document.getElementById('mobile_phone_bad_phormat_html');
    var link = main_sait + "moduls/ajax/check_captcha.php";
    var query = 'recaptcha_challenge_field=' + recaptcha_challenge_field.value + '&recaptcha_response_field=' + recaptcha_response_field.value;
    if (country.value.length>0)
    {
	var http = createRequestObject();  
	if( http )   
	{
	    http.open('POST', link, true);
	    http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	    //http.send(query);
	    http.onreadystatechange = function ()   
	    {  
		if(http.readyState == 4)   
		{
		    if (http.responseText.length>1)
		    {
			error_captcha.style.display = 'none';
			if (user_name.value.length>0)
			{
			    user_name_html.style.display = 'none';
			    if (mobile1.value.length>0)
			    {
				mobile_phone_one_html.style.display = 'none';
				if (mobile1.value.length>9)
				{
				    mobile_phone_bad_phormat_html.style.display = 'none';
				    query = "user_name=" + user_name.value + "&mobile1=" + mobile1.value + "&mobile2=" + mobile2.value + "&email=" + email.value + "&country=" + country.value + "&city=" + city.value + "&obl=" + region.value;
				    link = main_sait + "moduls/ajax/registeruser_in_sait.php";
				    register_user_in_autoline24(query, link);
				} else {
				    mobile_phone_bad_phormat_html.style.display = 'block';
				}
			    } else {
				mobile_phone_one_html.style.display = 'block';
			    }
			} else {
			    user_name_html.style.display = 'block';
			}
		    } else {
			error_captcha.style.display = 'block';
		    }
		}  
	    }  
	    http.send(query);      
	}  
	else   
	{  
	    document.location = link;  
	}
    } else {
	var country_empty = document.getElementById('param_78');
	country_empty.style.border = '2px solid red';
    }
}
function lostpassword_get_server(user_login)
{
    var cont = document.getElementById('register_form_new');
    cont.innerHTML = loading;  
    link = main_sait + "moduls/ajax/lostpassword_check.php";
    var query = "user_login=" + user_login;
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {  
                cont.innerHTML = http.responseText;  
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
function lost_password()
{
    var cont = document.getElementById('body_content_new');
    var captcha = document.getElementById('captcha');
    var user_login = document.getElementById('user_login_lost');
    var error_captcha = document.getElementById('error_captcha');
    link = main_sait + "moduls/ajax/check_captcha.php";
    var query = "captcha=" + captcha.value + "&tmp=1";
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {
		if (http.responseText.length>1)
		{
		    error_captcha.style.display = 'none';
		    lostpassword_get_server (user_login.value);
		} else {
		    error_captcha.style.display = 'block';   
		}
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
function notice_name()
{
    var cont = document.getElementById('notice_name_html');
    cont.style.display = 'block';
}
function notice_name_off()
{
    var cont = document.getElementById('notice_name_html');
    cont.style.display = 'none';
}
function notice_mobile1()
{
    var cont = document.getElementById('notice_mobile1_html');
    cont.style.display = 'block';
}
function notice_mobile1_off()
{
    var cont = document.getElementById('notice_mobile1_html');
    cont.style.display = 'none';
}
function notice_mobile2()
{
    var cont = document.getElementById('notice_mobile2_html');
    cont.style.display = 'block';
}
function notice_mobile2_off()
{
    var cont = document.getElementById('notice_mobile2_html');
    cont.style.display = 'none';
}
function notice_mail()
{
    var cont = document.getElementById('notice_mail_html');
    cont.style.display = 'block';
}
function notice_mail_off()
{
    var cont = document.getElementById('notice_mail_html');
    cont.style.display = 'none';
}
function notice_info_user(notice_id, id)
{
    var cont = document.getElementById(notice_id);
    if (id)
    {
	cont.style.display = 'none';
    } else {
	cont.style.display = 'block';
    }
}
var timeout    = 500;
var closetimer = 0;
var ddmenuitem = 0;

function jsddm_open()
{  jsddm_canceltimer();
   jsddm_close();
   ddmenuitem = $(this).find('ul').css('visibility', 'visible');}

function jsddm_close()
{  if(ddmenuitem) ddmenuitem.css('visibility', 'hidden');}

function jsddm_timer()
{  closetimer = window.setTimeout(jsddm_close, timeout);}

function jsddm_canceltimer()
{  if(closetimer)
   {  window.clearTimeout(closetimer);
      closetimer = null;}}

$(document).ready(function()
{  $('#jsddm > li').bind('mouseover', jsddm_open)
   $('#jsddm > li').bind('mouseout',  jsddm_timer)});






	(function($) {
				$.fn.thumbnailSlider = function(options) {
					var opts = $.extend({}, $.fn.thumbnailSlider.defaults, options);
					return this.each(function() {
						var $this 				= $(this),
							o 					= $.meta ? $.extend({}, opts, $pxs_container.data()) : opts;
						
						var $ts_container		= $this.children('.ts_container'),
							$ts_thumbnails		= $ts_container.children('.ts_thumbnails'),
							$nav_elems			= $ts_container.children('li').not($ts_thumbnails),
							total_elems			= $nav_elems.length,
							$ts_preview_wrapper	= $ts_thumbnails.children('.ts_preview_wrapper'),
							$arrow				= $ts_thumbnails.children('span'),
							$ts_preview			= $ts_preview_wrapper.children('.ts_preview');
						
						/*
						calculate sizes for $ts_thumbnails:
						width 	-> width thumbnail + border (2*5)
						height 	-> height thumbnail + border + triangle height(6)
						top		-> -(height plus margin of 5)
						left	-> leftDot - 0.5*width + 0.5*widthNavDot 
							this will be set when hovering the nav,
							and the default value will correspond to the first nav dot	
						*/
						var w_ts_thumbnails	= o.thumb_width + 2*5,
							h_ts_thumbnails	= o.thumb_height + 2*5 + 6,
							t_ts_thumbnails	= -(h_ts_thumbnails + 5),
							$first_nav		= $nav_elems.eq(0),
							l_ts_thumbnails	= $first_nav.position().left - 0.5*w_ts_thumbnails + 0.5*$first_nav.width();
						
						$ts_thumbnails.css({
							width	: w_ts_thumbnails + 'px',
							height	: h_ts_thumbnails + 'px',
							top		: t_ts_thumbnails + 'px',
							left	: l_ts_thumbnails + 'px'
						});
						
						/*
						calculate the top and left for the arrow of the tooltip
						top		-> thumb height + border(2*5)
						left	-> (thumb width + border)/2 -width/2
						*/
						var t_arrow	= o.thumb_height + 2*5,
							l_arrow	= (o.thumb_width + 2*5) / 2 - $arrow.width() / 2;
						$arrow.css({
							left	: l_arrow + 'px',
							top		: t_arrow + 'px'
						});
						
						/*
						calculate the $ts_preview width -> thumb width times number of thumbs
						*/
						$ts_preview.css('width' , total_elems*o.thumb_width + 'px');
						
						/*
						set the $ts_preview_wrapper width and height -> thumb width / thumb height
						*/
						$ts_preview_wrapper.css({
							width	: o.thumb_width + 'px',
							height	: o.thumb_height + 'px'
						});
						
						//hover the nav elems
						$nav_elems.bind('mouseenter',function(){
							var $nav_elem	= $(this),
								idx			= $nav_elem.index();
								
							/*
							calculate the new left
							for $ts_thumbnails
							*/
							var new_left	= $nav_elem.position().left - 0.5*w_ts_thumbnails + 0.5*$nav_elem.width();
							
							$ts_thumbnails.stop(true)
										  .show()	
										  .animate({
											left	: new_left + 'px'
										  },o.speed,o.easing);				  
							
							/*
							animate the left of the $ts_preview to show the right thumb 
							*/
							$ts_preview.stop(true)
									   .animate({
											left	: -idx*o.thumb_width + 'px'
									   },o.speed,o.easing);
							
							//zoom in the thumb image if zoom is true
							if(o.zoom && o.zoomratio > 1){
								var new_width	= o.zoomratio * o.thumb_width,
									new_height	= o.zoomratio * o.thumb_height;
								
								//increase the $ts_preview width in order to fit the zoomed image
								var ts_preview_w	= $ts_preview.width();
								$ts_preview.css('width' , (ts_preview_w - o.thumb_width + new_width)  + 'px');
								
								$ts_preview.children().eq(idx).find('img').stop().animate({
									width		: new_width + 'px',
									height		: new_height + 'px'
								},o.zoomspeed);
							}		
							
						}).bind('mouseleave',function(){
							//if zoom set the width and height to defaults
							if(o.zoom && o.zoomratio > 1){
								var $nav_elem	= $(this),
									idx			= $nav_elem.index();
								$ts_preview.children().eq(idx).find('img').stop().css({
									width	: o.thumb_width + 'px',
									height	: o.thumb_height + 'px'	
								});	
							}
							
							$ts_thumbnails.stop(true)
										  .hide();
										  
						}).bind('click',function(){
							var $nav_elem	= $(this),
								idx			= $nav_elem.index();
							
							o.onClick(idx);
						});
						
					});
				};
				$.fn.thumbnailSlider.defaults = {
					speed		: 100,//speed of each slide animation
					easing		: 'jswing',//easing effect for the slide animation
					thumb_width	: 75,//your photos width
					thumb_height: 75,//your photos height
					zoom		: false,//zoom animation for the thumbs
					zoomratio	: 1.3,//multiplicator for zoom (must be > 1)
					zoomspeed	: 15000,//speed of zoom animation
					onClick		: function(){return false;}//click callback
				};
			})(jQuery);















document.onclick = jsddm_close;
			$(function() {
				//demo1
				$('#demo1').thumbnailSlider();
				//demo2
				$('#demo2').thumbnailSlider({
					thumb_width	: 130,
					thumb_height: 87,
					easing		: 'easeOutExpo',//easeInBack
					speed		: 600
				});
				//demo3
				$('#demo3').thumbnailSlider({
					thumb_width	: 174,
					thumb_height: 260,
					speed		: 200
				});
				//demo4
				$('#demo4').thumbnailSlider({
					thumb_width	: 174,
					thumb_height: 260,
					speed		: 200,
					zoom		: true,
					zoomspeed	: 3000,
					zoomratio	: 1.7
				});
			});
jQuery.easing['jswing'] = jQuery.easing['swing'];

jQuery.extend( jQuery.easing,
{
	def: 'easeOutQuad',
	swing: function (x, t, b, c, d) {
		//alert(jQuery.easing.default);
		return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
	},
	easeInQuad: function (x, t, b, c, d) {
		return c*(t/=d)*t + b;
	},
	easeOutQuad: function (x, t, b, c, d) {
		return -c *(t/=d)*(t-2) + b;
	},
	easeInOutQuad: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t + b;
		return -c/2 * ((--t)*(t-2) - 1) + b;
	},
	easeInCubic: function (x, t, b, c, d) {
		return c*(t/=d)*t*t + b;
	},
	easeOutCubic: function (x, t, b, c, d) {
		return c*((t=t/d-1)*t*t + 1) + b;
	},
	easeInOutCubic: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t + b;
		return c/2*((t-=2)*t*t + 2) + b;
	},
	easeInQuart: function (x, t, b, c, d) {
		return c*(t/=d)*t*t*t + b;
	},
	easeOutQuart: function (x, t, b, c, d) {
		return -c * ((t=t/d-1)*t*t*t - 1) + b;
	},
	easeInOutQuart: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
		return -c/2 * ((t-=2)*t*t*t - 2) + b;
	},
	easeInQuint: function (x, t, b, c, d) {
		return c*(t/=d)*t*t*t*t + b;
	},
	easeOutQuint: function (x, t, b, c, d) {
		return c*((t=t/d-1)*t*t*t*t + 1) + b;
	},
	easeInOutQuint: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
		return c/2*((t-=2)*t*t*t*t + 2) + b;
	},
	easeInSine: function (x, t, b, c, d) {
		return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
	},
	easeOutSine: function (x, t, b, c, d) {
		return c * Math.sin(t/d * (Math.PI/2)) + b;
	},
	easeInOutSine: function (x, t, b, c, d) {
		return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
	},
	easeInExpo: function (x, t, b, c, d) {
		return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
	},
	easeOutExpo: function (x, t, b, c, d) {
		return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
	},
	easeInOutExpo: function (x, t, b, c, d) {
		if (t==0) return b;
		if (t==d) return b+c;
		if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
		return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
	},
	easeInCirc: function (x, t, b, c, d) {
		return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
	},
	easeOutCirc: function (x, t, b, c, d) {
		return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
	},
	easeInOutCirc: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
		return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
	},
	easeInElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
	},
	easeOutElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
	},
	easeInOutElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d/2)==2) return b+c;  if (!p) p=d*(.3*1.5);
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
		return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
	},
	easeInBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158;
		return c*(t/=d)*t*((s+1)*t - s) + b;
	},
	easeOutBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158;
		return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
	},
	easeInOutBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158; 
		if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
		return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
	},
	easeInBounce: function (x, t, b, c, d) {
		return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
	},
	easeOutBounce: function (x, t, b, c, d) {
		if ((t/=d) < (1/2.75)) {
			return c*(7.5625*t*t) + b;
		} else if (t < (2/2.75)) {
			return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
		} else if (t < (2.5/2.75)) {
			return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
		} else {
			return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
		}
	},
	easeInOutBounce: function (x, t, b, c, d) {
		if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
		return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
	}
});
function many_or_one(id)
{
    if (id)
    {
	var many_photo = document.getElementById('many_photo');
	var one_photo = document.getElementById('one_photo');
	var one_photo_id = document.getElementById('one_photo_id');
	var many_photo_id = document.getElementById('many_photo_id');
	one_photo_id.className = "button_photo";
	many_photo_id.className = "button_active";
	many_photo.style.display = 'block';
	one_photo.style.display = 'none';
    } else {
	var many_photo = document.getElementById('many_photo');
	var one_photo = document.getElementById('one_photo');
	var one_photo_id = document.getElementById('one_photo_id');
	var many_photo_id = document.getElementById('many_photo_id');
	one_photo_id.className = "button_active";
	many_photo_id.className = "button_photo";
	many_photo.style.display = 'none';
	one_photo.style.display = 'block';
    }
}
function order_form_block()
{
    var order_form = document.getElementById('order_form');
    order_form.style.display = 'block';
}
function test_function(order)
{
    var cont = document.getElementById('contentBody_2');
    var mark = document.getElementById('mark').value;
    var category = document.getElementById('category').value;
    var model = document.getElementById('model').value;
    var yearfrom = document.getElementById('yearfrom').value;
    var price_to = document.getElementById('price_to').value;
    var rst2 = document.getElementById('rst2').value;
    link = main_sait + "moduls/lite_search.php";
    var query = "trademark=" + mark + "&model=" + model + "&yearfrom=" + yearfrom + "&price_to=" + price_to + "&rst2=" + rst2 + "&order=" + order + "&category=" + category;
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {  
                cont.innerHTML = parseScript(http.responseText);
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
function test_function_with_limit(order, limit)
{
    var cont = document.getElementById('other_item_' + limit);
    var mark = document.getElementById('mark').value;
    var model = document.getElementById('model').value;
    var yearfrom = document.getElementById('yearfrom').value;
    var price_to = document.getElementById('price_to').value;
    var rst2 = document.getElementById('rst2').value;
    var category = document.getElementById('category').value;
    link = main_sait + "moduls/lite_search.php";
    var query = "trademark=" + mark + "&model=" + model + "&yearfrom=" + yearfrom + "&price_to=" + price_to + "&rst2=" + rst2 + "&order=" + order + '&limit=' + limit + "&category=" + category;
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {  
                cont.innerHTML = parseScript(http.responseText);
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
function mypage_items(order, limit, action)
{
    var cont = document.getElementById('other_item_' + limit);
    link = main_sait + "moduls/myautoline/moduls/my_item.php";
    var query = 'limit=' + limit + '&action=' + action;
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {  
                cont.innerHTML = parseScript(http.responseText);
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
function change_visible(id, status)
{
    var cont = document.getElementById('id_' + id);
    cont.innerHTML = '<center><div style="height:140px;"><img src="http://autoline24.com.ua/images/ajax-loader_myautoline.gif"></div></center>';
    link = main_sait + "moduls/myautoline/moduls/change_status.php";
    var query = 'id=' + id + '&status=' + status;
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {  
                cont.innerHTML = parseScript(http.responseText);
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
function myautoline_delete_item(id)
{
    var cont = document.getElementById('id_' + id);
    cont.innerHTML = '<center><div style="height:140px;"><img src="http://autoline24.com.ua/images/ajax-loader_myautoline.gif"></div></center>';
    link = main_sait + "moduls/myautoline/moduls/delete_item.php";
    var query = 'id=' + id;
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {  
                cont.innerHTML = parseScript(http.responseText);
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
function delete_from_my_eu_auto(id)
{
    var cont = document.getElementById('id_' + id);
    cont.innerHTML = '<center><div style="height:140px;"><img src="http://autoline24.com.ua/images/ajax-loader_myautoline.gif"></div></center>';
    link = main_sait + "moduls/myautoline/moduls/delete_eu_auto.php";
    var query = 'id=' + id;
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {  
                cont.innerHTML = parseScript(http.responseText);
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
function delete_from_my_eu_auto_online(id)
{
    link = main_sait + "moduls/myautoline/moduls/delete_eu_auto.php";
    var query = 'id=' + id;
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {  
                my_eu_car_refresh();
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
function delete_from_parkovka(id)
{
    var cont = document.getElementById('id_' + id);
    cont.innerHTML = '<center><div style="height:140px;"><img src="http://autoline24.com.ua/images/ajax-loader_myautoline.gif"></div></center>';
    link = main_sait + "moduls/myautoline/moduls/delete_parkovka.php";
    var query = 'id=' + id;
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {  
                cont.innerHTML = parseScript(http.responseText);
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
function delete_from_parkovka_online_monitor(id)
{
    var cont = document.getElementById('id_' + id);
    link = main_sait + "moduls/myautoline/moduls/delete_parkovka.php";
    var query = 'id=' + id;
    var http = createRequestObject();
    if( http )
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {  
                cont.innerHTML = parseScript(http.responseText);
		my_parking_refresh();
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
function go_prodano(id)
{
    var cont = document.getElementById('item_t_' + id);
    var controll_button_myautoline = document.getElementById('controll_button_myautoline');
    controll_button_myautoline.innerHTML = '';
    cont.innerHTML = '<center><div style="height:140px;"><img src="http://autoline24.com.ua/images/ajax-loader_myautoline.gif"></div></center>';
    link = main_sait + "moduls/myautoline/moduls/prodano_item.php";
    var query = 'id=' + id;
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {  
                cont.innerHTML = parseScript(http.responseText);
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
function reserve(id)
{
    var cont = document.getElementById('item_t_' + id);
    var controll_button_myautoline = document.getElementById('controll_button_myautoline');
    controll_button_myautoline.innerHTML = '';
    cont.innerHTML = '<center><div style="height:140px;"><img src="http://autoline24.com.ua/images/ajax-loader_myautoline.gif"></div></center>';
    link = main_sait + "moduls/myautoline/moduls/reserve_item.php";
    var query = 'id=' + id;
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {  
                cont.innerHTML = parseScript(http.responseText);
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
function give_item(id)
{
    var cont = document.getElementById('id_' + id);
    cont.innerHTML = '<center><div style="height:140px;"><img src="http://autoline24.com.ua/images/ajax-loader_myautoline.gif"></div></center>';
    link = main_sait + "moduls/myautoline/moduls/give_item.php";
    var query = 'id=' + id;
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {  
                cont.innerHTML = parseScript(http.responseText);
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
function go_no_prodano_save(id)
{
    var cont = document.getElementById('id_' + id);
    cont.innerHTML = '<center><div style="height:140px;"><img src="http://autoline24.com.ua/images/ajax-loader_myautoline.gif"></div></center>';
    link = main_sait + "moduls/myautoline/moduls/save_prodano.php";
    var query = 'id=' + id + '&prodano=0';
    var http = createRequestObject();  
    if( http )   
    {  
	http.open('post', link, true);
	http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	http.send(query);
	http.onreadystatechange = function ()   
	{  
	    if(http.readyState == 4)   
	    {  
		cont.innerHTML = parseScript(http.responseText);
	    }  
	}  
	http.send(null);      
    }  
    else   
    {  
	document.location = link;  
    }
}
function go_prodano_save(id)
{
    var cont = document.getElementById('id_' + id);
    var notes = document.getElementById('notes').value;
    cont.innerHTML = '<center><div style="height:140px;"><img src="http://autoline24.com.ua/images/ajax-loader_myautoline.gif"></div></center>';
    link = main_sait + "moduls/myautoline/moduls/save_prodano.php";
    var query = 'id=' + id  + '&notes=' + notes + '&prodano=1';
    var http = createRequestObject();  
    if( http )   
    {  
	http.open('post', link, true);
	http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	http.send(query);
	http.onreadystatechange = function ()   
	{  
	    if(http.readyState == 4)   
	    {  
		cont.innerHTML = parseScript(http.responseText);
	    }  
	}  
	http.send(null);      
    }  
    else   
    {  
	document.location = link;  
    }
}
function view_comment_reserve(id)
{
    var cont = document.getElementById('item_t_' + id);
    cont.innerHTML = '<center><div style="height:140px;"><img src="http://autoline24.com.ua/images/ajax-loader_myautoline.gif"></div></center>';
    link = main_sait + "moduls/myautoline/moduls/view_comment_reserve.php";
    var query = 'id=' + id;
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {  
                cont.innerHTML = parseScript(http.responseText);
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
function view_comment_prodano(id)
{
    var cont = document.getElementById('item_t_' + id);
    cont.innerHTML = '<center><div style="height:140px;"><img src="http://autoline24.com.ua/images/ajax-loader_myautoline.gif"></div></center>';
    link = main_sait + "moduls/myautoline/moduls/view_comment_prodano.php";
    var query = 'id=' + id;
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {  
                cont.innerHTML = parseScript(http.responseText);
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
function no_reservation(id)
{
    var cont = document.getElementById('id_' + id);
    cont.innerHTML = '<center><div style="height:140px;"><img src="http://autoline24.com.ua/images/ajax-loader_myautoline.gif"></div></center>';
    link = main_sait + "moduls/myautoline/moduls/no_reserve_item.php";
    var query = 'id=' + id;
    var http = createRequestObject();  
    if( http )   
    {  
	http.open('post', link, true);
	http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	http.send(query);
	http.onreadystatechange = function ()   
	{  
	    if(http.readyState == 4)   
	    {
		cont.innerHTML = parseScript(http.responseText);
	    }  
	}  
	http.send(null);      
    }  
    else   
    {  
	document.location = link;  
    }
}
function go_reservation(id)
{
    var cont = document.getElementById('id_' + id);
    var date_reserve = document.getElementById('date_reserve').value;
    var visible = document.getElementById('visible');
    var comment_reserve = document.getElementById('comment_reserve');
    if (visible.checked)
    {
	var visible_value = 1;
    } else {
	var visible_value = 0;
    }
    if (date_reserve.length>0)
    {
	cont.innerHTML = '<center><div style="height:140px;"><img src="http://autoline24.com.ua/images/ajax-loader_myautoline.gif"></div></center>';
	link = main_sait + "moduls/myautoline/moduls/reserve_item.php";
	var query = 'id=' + id + '&visible=' + visible_value + '&date_reserve=' + date_reserve + '&comment_reserve=' + comment_reserve.value;
	var http = createRequestObject();  
	if( http )   
	{  
	    http.open('post', link, true);
	    http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	    http.send(query);
	    http.onreadystatechange = function ()   
	    {  
		if(http.readyState == 4)   
		{  
		    cont.innerHTML = parseScript(http.responseText);
		}  
	    }  
	    http.send(null);      
	}  
	else   
	{  
	    document.location = link;  
	}
    } else {
	alert ('Введите дату.');
    }
}
function delete_comment_myautoline(id)
{
    var cont = document.getElementById('id_' + id);
    cont.innerHTML = '<center><div style="height:140px;"><img src="http://autoline24.com.ua/images/ajax-loader_myautoline.gif"></div></center>';
    link = main_sait + "moduls/myautoline/moduls/delete_comment.php";
    var query = 'id=' + id;
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {  
                cont.innerHTML = parseScript(http.responseText);
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
function send_chat_message(id_user)
{
    var message_block = document.getElementById('message_block');
    var message = document.getElementById('message');
    if (message.value.length>0)
    {
	message_block.style.display = 'none';
	var loading_chat = document.getElementById('loading_chat');
	loading_chat.style.display = 'block';
	link = main_sait + "moduls/myautoline/moduls/add_message.php";
	var query = 'id_user=' + id_user + '&message=' + message.value;
	message.value = '';
	var http = createRequestObject();  
	if( http )   
	{  
	    http.open('post', link, true);
	    http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	    http.send(query);
	    http.onreadystatechange = function ()   
	    {  
		if(http.readyState == 4)   
		{
		    loading_chat.style.display = 'none';
		    message_block.style.display = 'block';
		}  
	    }  
	    http.send(null);      
	}  
	else   
	{  
	    document.location = link;  
	}
    } else {
	alert ('Пустое сообщение отправить нельзя.')
    }
}
function online_users_refresh()
{
    var cont = document.getElementById('online_users');
    link = main_sait + "moduls/myautoline/moduls/online_users.php";
    var query = '';
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {  
                cont.innerHTML = parseScript(http.responseText);
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
function online_monitor_refresh()
{
    var cont = document.getElementById('item_id_monitor');
    var item_id_monitor = cont.value;
    var hidden_trucks = document.getElementById('hidden_trucks').value;
    var hidden_cars = document.getElementById('hidden_cars').value;
    var hidden_trailertrucks = document.getElementById('hidden_trailertrucks').value;
    link = main_sait + "moduls/myautoline/moduls/check_online_monitor.php";
    var query = "song[cars]=" + hidden_cars + "&song[trucks]=" + hidden_trucks + "&song[trailertrucks]=" + hidden_trailertrucks;
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {  
                cont.value = parseScript(http.responseText);
		if (item_id_monitor!=cont.value)
		{
		    get_new_item();
		}
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
function get_new_item()
{
    var cont = document.getElementById('monitor');
    var item_id_monitor = cont.value;
    var hidden_trucks = document.getElementById('hidden_trucks').value;
    var hidden_cars = document.getElementById('hidden_cars').value;
    var hidden_trailertrucks = document.getElementById('hidden_trailertrucks').value;
    link = main_sait + "moduls/myautoline/moduls/monitor.php";
    var query = "song[cars]=" + hidden_cars + "&song[trucks]=" + hidden_trucks + "&song[trailertrucks]=" + hidden_trailertrucks;
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {  
                cont.innerHTML = parseScript(http.responseText);
		last_add_online_monitor_refresh();
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
function last_add_online_monitor_refresh ()
{
    var cont = document.getElementById('last_add_online_monitor');
    var number_item = document.getElementById('last_add_online_number');
    var item_id_monitor = number_item.value;
    link = main_sait + "moduls/myautoline/moduls/last_add.php";
    var query = 'item_id_monitor=' + item_id_monitor;
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {  
                cont.innerHTML = parseScript(http.responseText);
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
function my_parking_refresh ()
{
    var cont = document.getElementById('parking_html');
    var number_item = document.getElementById('parking_number');
    var item_id_monitor = number_item.value;
    link = main_sait + "moduls/myautoline/moduls/parking.php";
    var query = 'item_id_monitor=' + item_id_monitor;
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {  
                cont.innerHTML = parseScript(http.responseText);
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
function my_eu_car_refresh ()
{
    var cont = document.getElementById('my_eu_auto');
    var number_item = document.getElementById('eu_number');
    var item_id_monitor = number_item.value;
    link = main_sait + "moduls/myautoline/moduls/my_eu_auto.php";
    var query = 'item_id_monitor=' + item_id_monitor;
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {  
                cont.innerHTML = parseScript(http.responseText);
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
function parking_go_next(type)
{
    if (type==1)
    {
	var number_item = document.getElementById('parking_number');
	number_item_new = parseInt(number_item.value) + 5;
	number_item.value = number_item_new;
	my_parking_refresh();
    } else {
	var number_item = document.getElementById('parking_number');
	number_item.value = 5;
	my_parking_refresh();
    }
}
function last_add_online_monitor_add(type)
{
    if (type==1)
    {
	var number_item = document.getElementById('last_add_online_number');
	number_item_new = parseInt(number_item.value) + 5;
	number_item.value = number_item_new;
	last_add_online_monitor_refresh();
    } else {
	var number_item = document.getElementById('last_add_online_number');
	number_item.value = 5;
	last_add_online_monitor_refresh();
    }
}
function visible_parking()
{
    var type = document.getElementById('type_visible_parking');
    if (type.value==1)
    {
	var parkovka_full_block = document.getElementById('parkovka_full_block');
	parkovka_full_block.style.display = 'block';
	type.value = 0;
    } else {
	var parkovka_full_block = document.getElementById('parkovka_full_block');
	parkovka_full_block.style.display = 'none';
	type.value = 1;
    }
}
function settings_online_monitor()
{
    var type = document.getElementById('type_settings_online_monitor');
    if (type.value==1)
    {
	var parkovka_full_block = document.getElementById('online_monitor_block_settings');
	parkovka_full_block.style.display = 'block';
	type.value = 0;
    } else {
	var parkovka_full_block = document.getElementById('online_monitor_block_settings');
	parkovka_full_block.style.display = 'none';
	type.value = 1;
    }
}
function comments_eu_auto_user(id)
{
    var cont = document.getElementById('comment_result');
    var comment = document.getElementById('comment_textarea');
    cont.innerHTML = '<center><div style="height:140px;"><img src="http://autoline24.com.ua/images/ajax-loader_myautoline.gif"></div></center>';
    link = main_sait + "moduls/preview/comments_add.php";
    var query = 'id=' + id + "&type=1&comment=" + comment.value;
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {
                cont.innerHTML = parseScript(http.responseText);
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
function my_chat_refresh()
{
    var cont = document.getElementById('chat_box');
    var last_id_chat = document.getElementById('last_id_chat');
    link = main_sait + "moduls/myautoline/moduls/chat.php";
    var query = "last_id_chat=" + last_id_chat.value;
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {
		if (http.responseText != 0)
		{
		    cont.innerHTML = parseScript(http.responseText);    
		}
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
function my_comments_refresh()
{
    var cont = document.getElementById('message_eu');
    var last_id_chat = document.getElementById('last_id_chat');
    var id_item_refresh = document.getElementById('id_item_refresh');
    link = main_sait + "moduls/preview/comments_eu.php";
    var query = "last_id_chat=" + last_id_chat.value + "&id=" + id_item_refresh.value;
    var http = createRequestObject();  
    if( http )   
    {
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {
		if (http.responseText != 0)
		{
		    var new_message = document.getElementById('new_message');
		    alert (new_message.value);
		    cont.innerHTML = parseScript(http.responseText);    
		}
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }
}
function quote(id)
{
    var item_comment = document.getElementById('item_comment_' + id).value;
    var message = document.getElementById('message');
    var message_html = '[quote=' + item_comment + "]\n";
    message.value = message_html;
}
function comment_chat(id)
{
    var message = document.getElementById('message');
    var message_html = '[item_comment=' + id + "]\n";
    message.value = message_html;
    document.getElementById('message').scrollIntoView();
}
function show_message_all(type, limit)
{
    var cont = document.getElementById('message_all');
    link = main_sait + "moduls/myautoline/moduls/message.php";
    var query = "type=" + type + "&limit=" + limit;
    var http = createRequestObject();  
    if( http )   
    {
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {
		cont.innerHTML = parseScript(http.responseText);    
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }   
}
function show_message_pm(id)
{
    var cont = document.getElementById('message_all');
    link = main_sait + "moduls/myautoline/moduls/show_one_message.php";
    var query = "id=" + id;
    var http = createRequestObject();  
    if( http )   
    {
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {
		cont.innerHTML = parseScript(http.responseText);    
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    }   
}
function pm_reply(id)
{
    var cont = document.getElementById('message_reply');
    var new_message = document.getElementById('new_message');
    link = main_sait + "moduls/myautoline/moduls/reply_message.php";
    var query = "id=" + id + "&new_message=" + new_message.value;
    var http = createRequestObject();  
    if( http )   
    {
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {
		cont.innerHTML = parseScript(http.responseText);    
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    } 
}
function new_pm()
{
    var cont = document.getElementById('new_pm_block');
    var theme = document.getElementById('theme');
    var message_body = document.getElementById('message_body');
    var user_to = document.getElementById('user_to');
    var submit_button = document.getElementById('submit_button');
    submit_button.style.display = 'none';
    link = main_sait + "moduls/myautoline/moduls/new_pm.php";
    var query = "message_body=" + message_body.value + "&user_to=" + user_to.value + "&theme=" + theme.value;
    var http = createRequestObject();  
    if( http )   
    {
        http.open('post', link, true);
        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        http.send(query);
        http.onreadystatechange = function ()   
        {  
            if(http.readyState == 4)   
            {
		cont.innerHTML = parseScript(http.responseText);    
            }
        }  
        http.send(null);      
    }  
    else   
    {  
        document.location = link;  
    } 
}
function save_user_status(id)
{
	var cont = document.getElementById('status_user_' + id);
	var status = document.getElementById('status_' + id);
	var query = "id=" + id + "&status=" + status.value
	link = main_sait + "moduls/ajax/save_user_status.php";
	var http = createRequestObject();  
	if( http )   
	{  
	    http.open('post', link, true);
	    http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	    http.send(query);
	    http.onreadystatechange = function ()   
	    {  
		if(http.readyState == 4)   
		{
		    cont.innerHTML = http.responseText;
		}  
	    }  
	    http.send(null);      
	}  
	else   
	{  
	    document.location = link;  
	}
}
function save_item_premium(id)
{
	var cont = document.getElementById('status_' + id);
	var id_item = document.getElementById('item_id_premium_' + id);
	var query = "id=" + id + "&id_item=" + id_item.value
	link = main_sait + "moduls/ajax/save_premium_item.php";
	var http = createRequestObject();  
	if( http )   
	{  
	    http.open('post', link, true);
	    http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	    http.send(query);
	    http.onreadystatechange = function ()   
	    {  
		if(http.readyState == 4)   
		{
		    cont.innerHTML = http.responseText;
		}  
	    }  
	    http.send(null);      
	}  
	else   
	{  
	    document.location = link;  
	}
}
function go_to_item(id, id_premium)
{
    document.location = 'preview.php?cmd=search&view=' + id + '&id_premium=' + id_premium;
}
function reservation_save_settings()
{
    var cont = document.getElementById('continue_reservation_button');
    var id_item = document.getElementById('id_item');
    var price = document.getElementById('price');
    var date_reservation = document.getElementById('date_reservation');
    var tel_prodavca = document.getElementById('tel_prodavca');
    var sost_tr_sredstva = document.getElementById('sost_tr_sredstva');
    var na_hody = document.getElementById('na_hody');
    var teh_osmotr = document.getElementById('teh_osmotr');
    var transit_nomer = document.getElementById('transit_nomer');
    var tam_oformlenie = document.getElementById('tam_oformlenie');
    var oplata_nds = document.getElementById('oplata_nds');
    var magnitola = document.getElementById('magnitola');
    var zapaska = document.getElementById('zapaska');
    var country = document.getElementById('country');
    var adres_zagruzki = document.getElementById('adres_zagruzki');
    var price_zadatok = document.getElementById('price_zadatok');
    if (price.value.length==0)
    {
	alert ('Введите оговоренную цену');
	price.style.border = '2px solid red';
    } else {
	price.style.border = '1px solid green';
	if (date_reservation.value.length==0)
	{
	    alert ('Введите дату до которой резервируете транспортное средство');
	    date_reservation.style.border = '2px solid red';
	} else {
	    date_reservation.style.border = '1px solid green';
	    if (tel_prodavca.value.length==0)
	    {
		alert ('Введите телефон продавца');
		tel_prodavca.style.border = '2px solid red';
	    } else {
		tel_prodavca.style.border = '1px solid green';
		cont.innerHTML = loading;
		var query = "id_item=" + id_item.value + "&price=" + price.value + "&date_reservation=" + date_reservation.value + "&tel_prodavca=" + tel_prodavca.value + "&sost_tr_sredstva=" + sost_tr_sredstva.value + "&na_hody=" + na_hody.value + "&teh_osmotr=" + teh_osmotr.value + "&transit_nomer=" + transit_nomer.value + "&tam_oformlenie=" + tam_oformlenie.value + "&oplata_nds=" + oplata_nds.value + "&magnitola=" + magnitola.value + "&zapaska=" + zapaska.value + "&country=" + country.value + "&price_zadatok=" + price_zadatok.value + "&adres_zagruzki=" + adres_zagruzki.value;
		link = main_sait + "moduls/reservation/save_settings_item.php";
		var http = createRequestObject();  
		if( http )   
		{  
		    http.open('post', link, true);
		    http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		    http.send(query);
		    http.onreadystatechange = function ()   
		    {  
			if(http.readyState == 4)   
			{
			    cont.innerHTML = http.responseText;
			}  
		    }  
		    http.send(null);      
		}  
		else   
		{  
		    document.location = link;  
		}
	    }
	}
    }
}
function visible_button_video()
{
    var buttonUpload = document.getElementById('buttonUpload');
    buttonUpload.style.display = "block"
}
