$(document).ready(function(){
    $.ajaxSetup({
        cache: false,
        timeout: !!!AJAX_TIMEOUT!!!
        //headers: { "Connection": "Keep-Alive" }
    });
	var count_error=0;
	$.ajaxSetup({timeout: !!!AJAX_TIMEOUT!!!})
	var set_interval_variable;
	function set_interval_function(){
	    set_interval_variable =  setInterval(function() {
	        clearInterval(set_interval_variable);
            $.get("!!!URL!!!", function(data){
                $("#!!!ELEMENT_ID!!!").html(data);
                count_error=0;
            }).fail(function() {
                count_error++;
                if (count_error>=!!!ERROR_COUNT!!!){
                    $("#!!!ELEMENT_ID!!!").html('!!!ERROR_MESSAGE!!!');
                }
                else {
                    set_interval_function();
                }
            }).done(function() {
                set_interval_function();
            })
        }, 500);
	};
	set_interval_function();
});