 $().ready(function() { 
  enterClocks();
  // ---------------------------------------------------  
  $('.newsText').jTruncate({  
   length: 200,  
   minTrail: 0,  
   moreText: "[далее]",  
   lessText: "[свернуть]",  
   ellipsisText: " ... ",  
   moreAni: "fast",  
   lessAni: "fast"  
  });
  // --------------------------------------------------
 // $(".accordion h3:first").addClass("active");
   // $(".accordion p:not(:first)").hide();
   $(".accordion p").hide();
    $(".accordion h3").click(function(){
        $(this).next("p").slideToggle("slow")
        .siblings("p:visible").slideUp("slow");
        $(this).toggleClass("active");
        $(this).siblings("h3").removeClass("active");
     });
  //---------------------------------------------------
     $('#order input#date').attachDatepicker({dateFormat: 'dd.mm.yy', showOn: 'button', buttonImage: '/images/calendar.png', buttonImageOnly: true },'','',"disabled");
	 $('#user_profile input#age').attachDatepicker({dateFormat: 'dd.mm.yy', showOn: 'button', buttonImage: '/images/calendar.png', buttonImageOnly: true, minDate: "-100y", maxDate: "+0", yearRange: "-100:0"},'','',"disabled");
  // ----------------------------------------------------	 
	 $("#cost").keypress(function (e)
	 {
        if( e.which != 8 && e.which != 0 && (e.which < 48 || e.which > 57) && e.which != 46)
		{
        return false;
		}
	});
  //--------------------------------------------------------
  // task_info
  $('.show_task_info').click(function(){
	id_task = $(this).attr('id_task');
	$('.task_info[id_task!='+id_task+']').fadeOut("slow");
	$('#task_info_'+id_task).fadeIn("slow");
	$.post(
		'ajax/get_task_info.php',
		{
			id_task: id_task,
			action: 'action'
		},
		function (data) {
			if (data==0) {
				$('#task_info_'+id_task+' > td').html('При загрузке данных возникла ошибка!');
			} if(data==1) {
				$('#task_info_'+id_task+' > td').html('Недостаточно прав для просмотра информации! Необходима авторизация!');
			} else {
				$('#task_info_'+id_task+' > td').css('vertical-align','top').css('text-align','left').css('padding-left','20px');
				$('#task_info_'+id_task+' > td').html(data);
			}
		}
	);
	return false;
  });

   $('.hide_task_info').live("click",function(){
	$('.task_info').fadeOut("slow");
	return false;
   });
  // -------------------------
	$("#users").dataTable({
  		"oLanguage": {
			"sUrl": "javascript/language/ru_RU.txt"
		},
		"aaSorting": [[ 0, "asc" ]],
		"aoColumns": [
			{ "sType": "html" },
			null,
			{ "sType": "htmln" },
			null,
			null,
			{ "sType": "date" },
			{ "sType": "date" }
		]
  	});
   // ----------------------
   $('ul.tabs li').css('cursor', 'pointer');

	$('ul.tabs.tabs1 li').click(function(){
		var thisClass = this.className.slice(0,2);
		$('div.t1').css({opacity: 0}).hide();
		$('div.t2').css({opacity: 0}).hide();
		$('div.t3').css({opacity: 0}).hide();
		$('div.t4').css({opacity: 0}).hide();
		$('div.' + thisClass).animate({opacity: 1}, 500).show();
		$('ul.tabs.tabs1 li').removeClass('tab-current');
		$(this).addClass('tab-current');
		});
	// ------------------------
	 $('#user_profile').submit(function() { 
        $(this).ajaxSubmit({
			beforeSubmit: function () {
				$('#ajax_status').hide().removeClass('error');
				$('#ajax_loading').show();
			},
			success: function (data) {
				$('#ajax_loading').hide();
				if (data==1) {
					$('#ajax_status').show().html('Изменения успешно сохранены!');
				} else {
					$('#ajax_status').show().addClass('error').html('Изменения не были сохранены!');
				}
			}
		});
        return false; 
    });
	$('#change_password').submit(function() { 
        $(this).ajaxSubmit({
			beforeSubmit: function () {
				$('#ajax_status_3').hide().removeClass('error');
				$('#ajax_loading_3').show();
			},
			success: function (data) {
				$('#ajax_loading_3').hide();
				if (data==1) {
					$('#ajax_status_3').show().html('Пароль успешно изменен!');
				} else {
					data_arr = data.split('|');
					$('#ajax_status_3').show().addClass('error')
					if (data_arr[1]) {
						$('#ajax_status_3').html(data_arr[1]);
					} else {
						$('#ajax_status_3').html('Пароль не был изменен!');
					}		
				}
			}
		});
        return false; 
    });
	$('#change_settings').submit(function() { 
        $(this).ajaxSubmit({
			beforeSubmit: function () {
				$('#ajax_status_2').hide().removeClass('error');
				$('#ajax_loading_2').show();
			},
			success: function (data) {
				$('#ajax_loading_2').hide();
				if (data==1) {
					$('#ajax_status_2').show().html('Настройки успешно сохранены!');
				} else {
					$('#ajax_status_2').show().addClass('error').html('Настройки не были сохранены!');		
				}
			}
		});
        return false; 
    });
	$('#change_photo').submit(function() { 
        $(this).ajaxSubmit({
			beforeSubmit: function () {
				$('#ajax_status_4').hide().removeClass('error');
				$('#ajax_loading_4').show();
			},
			success: function (data) {
				$('#ajax_loading_4').hide();
				data = str_replace('<pre>','',data);
				data = str_replace('</pre>','',data);
				data = str_replace('<PRE>','',data);
				data = str_replace('</PRE>','',data);
				if (data!=0) {
					$('#ajax_status_4').show().html('Фотография загружена!');
					$('#user_photo').attr('src','/'+data+'?'+Math.random());
				} else {
					$('#ajax_status_4').show().addClass('error').html('Фотография не загружена!');		
				}
			}
		});
        return false; 
    });
	$('#delete_photo').submit(function() { 
        if (confirm('Вы действительно хотите удалить вашу фотографию?')) {
			$(this).ajaxSubmit({
				beforeSubmit: function () {
					$('#ajax_status_5').hide().removeClass('error');
					$('#ajax_loading_5').show();
				},
				success: function (data) {
					$('#ajax_loading_5').hide();
					if (data!=0) {
						$('#ajax_status_5').show().html('Фотография удалена!');
						$('#user_photo').attr('src','/user_photos/no_photo.jpg');
					} else {
						$('#ajax_status_5').show().addClass('error').html('Фотография не удалена!');		
					}
				}
			});
	        return false;
		} else return false;	
    });
	
	$('a[act=check_all]').click(function() {
		$('.checkRazdel').attr('checked',true);
		return false;
	});
	$('a[act=uncheck_all]').click(function() {
		$('.checkRazdel').attr('checked',false);
		return false;
	});
	$('select[name=email_notice_chat]').change(function() {
		if ($(this).val()=='1') {
			$('#tr_ect').fadeIn();
		} else {
			$('#tr_ect').fadeOut();
		}
	});
	$('select[name=icq_notice_chat]').change(function() {
		if ($(this).val()=='1') {
			$('#tr_ict').fadeIn();
		} else {
			$('#tr_ict').fadeOut();
		}
	});
	$('select[name=icq_notice]').change(function() {
		if ($(this).val()=='1') {
			if ($('select[name=email_notice]').val()==2) {
					$('#tr_razdels').fadeIn();
				}	
		} else {
			if ($('select[name=email_notice]').val()==2) {
				$('#tr_razdels').fadeOut();
			}	
		}
	});
	$('select[name=email_notice]').change(function() {
		if ($(this).val()=='1') {
			if ($('select[name=icq_notice]').val()==2) {
				$('#tr_razdels').fadeIn();
			}	
		} else {
			if ($('select[name=icq_notice]').val()==2) {
				$('#tr_razdels').fadeOut();
			}	
		}
	});
	// -------------------------------------
	$('#rsp_form').submit(function() { 
		if ($('#form_rsp_text').val().length==0) {
			$('#ajax_status').show().addClass('error').html('Вы не ввели текст отзыва!');
			return false;
		} else {
			$(this).ajaxSubmit({
				beforeSubmit: function () {
					$('#ajax_status').hide().removeClass('error');
					$('#ajax_loading').show();
				},
				success: function (data) {
					$('#ajax_loading').hide();
					data = data.split('|');
					if (data[0]==1) {
						$('#ajax_status').show().html('Отзыв успешно добавлен!');
						$('#new_rsp_title').html('<a href="/index.php?p=10&showuser=' + data[2] + '">' + data[1] + '</a><span class="rsp_date"> / ' + data[3] + '</span>');
						$('#new_rsp_text').html($('#form_rsp_text').val());
						$('#rsp_no').hide();
						$('#form_rsp_text').val('');
						$('#new_rsp').show('slow');
						$('#rsp_form_place').hide('slow');
					} else {
						$('#ajax_status').show().addClass('error').html('Отзыв не был добавлен!');		
					}
				}
			});
	        return false;
		}	
    });
	// -------------------------------------
	$('#make_written').click(function() {
		$('#make_written_place').addClass('ajax_status_action');
		$('#make_written_place').html('<img src="/images/ajax-loader-4.gif" style="width:12px;position:relative;top:2px;"> пожалуйста, подождите...');
		$.post(
			'/ajax/make_written.php',
			{
				action: 'action'
			},
			function (data) {
				if (data==0) {
					$('#make_written_place').html('Ошибка операции!');
				} else {
					$('#make_written_place').html('Сообщения были сделаны прочитанными!');
				}
			}
		);
		return false;
	});
	
	$('#close_ip_check').click(function() {
		$('#success').hide('slow');
		return false;
	});
	
	$('#ip_check').click(function() {
		$('#success').show('slow');
		$('#ip_info').html('<img src="/images/ajax-loader-2.gif">');
		$.post(
			'/ajax/get_info_ip.php',
			{
				id_user: $(this).attr('id_user'),
				action: 'action'
			},
			function (data) {
				if (data==0) {
					$('#ip_info').html('При получении информации возникла ошибка!');
				} else {
					$('#ip_info').html(data);
				}
			}
		);
		return false;
	});	
	// --------------------------------------
	$('#task_cat').change(function(){
		cat = $(this).val();
		if (cat=='number') {
			$('.filter_num').show();
			$('.filter_razd').hide();
		} else {
			$('.filter_num').hide();
			$('.filter_razd').show();
		}
	});
	$('#apply_filter_btn').click(function(){
		if ($('#tf_razd').val()=='') {
			$('#tf_razd').attr('disabled','disabled');
		};
		if ($('.filter_num').css('display')=='none') {
			$('#tf_id_task').attr('disabled','disabled');
		}
		if ($('.filter_razd').css('display')=='none') {
			$('#tf_razd').attr('disabled','disabled');
		}
		$('#apply_task_filter').submit();
		return false;
	});
	$('.chat_infobox_open').click(function(){
		$('#chat_infobox').show();
		return false;
	});
	$('.chat_infobox_close').click(function(){
		$('#chat_infobox').hide();
		return false;
	});
	$('.donate_infobox_open').click(function(){
		$('#donate_infobox').show();
		return false;
	});
	$('.donate_infobox_close').click(function(){
		$('#donate_infobox').hide();
		return false;
	});
	// -------------------------------------
	/*if ($('#newMessagesCount').html()!=null && $('#newMessagesCount').html()!=0) {
		$('#newMessages').modal({
			containerCss: {
				height: '300px'
			}
		});
		if (window.opera != undefined) { // opera
			$('#simplemodal-container').css('left','50%').css('margin-left','-29%');
		}
		
	}*/
	//$('#simplemodal-container').css('height','300px');
	if (window.opera != undefined) { // opera
		setTimeout('open_newMessages()',500);
	} else {
		open_newMessages();
	}
	// -------------------------------------
	$("abbr").easyTooltip();
	// ---------------------------------------
	$('#auto_part').change(function() {
		razdel = $(this).get(0).options[$(this).get(0).selectedIndex].value;
		$('#ajax_status').hide().removeClass('error');
		if (razdel!=0) {
			$('#loading').css("display","inline");
			$.post(
			'/ajax/get_auto_themes.php',
			{
				razdel: razdel, 	
				action: 'action'
			},
			function (data) {
				$("#auto_theme").removeAttr("disabled"); 
				$('#loading').css("display","none");
				$('#auto_theme').html(data);
			}
			);
		} else {
		    $("#auto_theme").attr("disabled","disabled");  
			$('#auto_theme').html("<option value='0'>Выберите раздел</option>");
		}
		$("#auto_type").attr("disabled","disabled");  
		$('#auto_type').html("<option value='0'>Выберите тему</option>");
		//***$("#auto_text").attr("disabled","disabled");
		//***$('#auto_text').html('');
		$('#auto_objects').hide();
		$('#auto_restriction').html('');
		$('#auto_comments').html('');
		$('#auto_cost_visible').html('');
		$("#auto_text_check").attr("disabled","disabled");
		$('#after_auto_check').hide();
	});
	$('#auto_theme').change(function() {
		theme = $(this).get(0).options[$(this).get(0).selectedIndex].value;
		$('#ajax_status').hide().removeClass('error');
		if (theme!=0) {
			$('#loading_2').css("display","inline");
			$.post(
			'/ajax/get_auto_types.php',
			{
				theme: theme, 	
				action: 'action'
			},
			function (data) {
				$("#auto_type").removeAttr("disabled"); 
				$('#loading_2').css("display","none");
				$('#auto_type').html(data);
			}
			);
		} else {
		    $("#auto_type").attr("disabled","disabled");  
			$('#auto_type').html("<option value='0'>Выберите тему</option>");
		}
		//***$("#auto_text").attr("disabled","disabled");
		//***$('#auto_text').html('');
		$('#auto_objects').hide();
		$('#auto_restriction').html('');
		$('#auto_comments').html('');
		$('#auto_cost_visible').html('');
		$("#auto_text_check").attr("disabled","disabled");
		$('#after_auto_check').hide();	
	});
	$('#auto_type').change(function() {
		type = $(this).get(0).options[$(this).get(0).selectedIndex].value;
		$('#ajax_status').hide().removeClass('error');
		if (type!=0) {
			$('#loading_3').css("display","inline");
			$.post(
			'/ajax/get_auto_type.php',
			{
				type: type, 	
				action: 'action'
			},
			function (data) {
				data_s = data.split('~');
				//***$("#auto_text").removeAttr("disabled"); 
				$('#loading_3').css("display","none");
				//$('#auto_text').val(data_s[0]);
				$('#auto_restriction').html(data_s[1]);
				$('#auto_comments').html(data_s[2]);
				$('#auto_cost_visible').html(data_s[3]+' RUR');
				$('#auto_objects').show();
				$('#auto_objects').html(data_s[4]);
				$("abbr").easyTooltip();
				$("#auto_text_check").removeAttr("disabled");
				$('#after_auto_check').hide();
			}
			);
		} else {
		    //$("#auto_type").attr("disabled","disabled");  
			//$('#auto_type').html("<option value='0'>Выберите тему</option>");
			//***$("#auto_text").attr("disabled","disabled");
			$('#auto_objects').hide();
			//***$('#auto_text').html('');
			$('#auto_restriction').html('');
			$('#auto_comments').html('');
			$('#auto_cost_visible').html('');
			$("#auto_text_check").attr("disabled","disabled");
			$('#after_auto_check').hide();	
		}
	});
	$('#auto_order').submit(function() {
		$(this).ajaxSubmit({
			beforeSubmit: function () {
				$('#ajax_status').hide().removeClass('error');
				$('#ajax_loading').show();
			},
			success: function (data) {
				$('#ajax_loading').hide();
				if (data!=0) {
					data_s = data.split('~');
					$('#ajax_status').show().html('Условие загружено!');
					$('#auto_condition').html('<img src="/auto_tmp/'+data_s[0]+'.gif">');
					$('#after_auto_check').show();
					if (data_s[1]==0) {
						$('#ajax_status_2').hide().removeClass('error');
						$('#add_auto_order_space').show();
						$('#after_auto_check_p').show();
						$('#auto_id').val(data_s[0]);
						$('#auto_part_after').val(data_s[2]);
						$('#auto_type_after').val($('#auto_type').val());
					} else {
						$('#add_auto_order_space').hide();
						$('#after_auto_check_p').hide();
					}
				} else {
					$('#ajax_status').show().addClass('error').html('Ошибка при загрузке!');
					$('#after_auto_check').hide();	
				}
			}
		});
        return false; 
	});
	$('#add_auto_order').submit(function() {
		$(this).ajaxSubmit({
			beforeSubmit: function () {
				$('#ajax_status_2').hide().removeClass('error');
				$('#ajax_loading_2').show();
			},
			success: function (data) {
				$('#ajax_loading_2').hide();
				if (data==1) {
					$('#ajax_status_2').show().html('Решение выполнено!');
					//$('#auto_condition').html('<img src="/auto_tmp/'+data+'.gif">');
					setTimeout("window.location='/?p=3'",1000);
				} else if (data==2) {
					$('#ajax_status_2').show().addClass('error').html('Ошибка: недостаточно средств на балансе!');		
				} else {
					$('#ajax_status_2').show().addClass('error').html('Ошибка!');		
				}
			}
		});
        return false; 
	});
	$('#auto_method').live("change",function(){
		id_method = $(this).val();
		$('.method').hide();
		$('.method input, .method textarea').attr('disabled','disabled');
		$('.method[id_method='+id_method+']').show();
		$('.method[id_method='+id_method+'] input, .method[id_method='+id_method+'] textarea').removeAttr('disabled');
    });
	// ---------------------------------------
	$('#logo').click(function() {
		window.location = '/';
	});
	$('#logo_footer').click(function() {
		window.location = '/';
	});
	// --------------------------------------------
	$('#rsp_id_user').change(function() {
		id_user = $(this).get(0).options[$(this).get(0).selectedIndex].value;
		window.location = '/index.php?p=14&id_user='+id_user;
	});
	// --------------------------------------------
	$('#coop_form').submit(function() { 
		$(this).ajaxSubmit({
			beforeSubmit: function () {
				$('#ajax_status').hide().removeClass('error');
				$('#ajax_loading').show();
			},
			success: function (data) {
				$('#ajax_loading').hide();
				data = data.split('|');
				if (data[0]==1) {
					$('#ajax_status').show().html('Заявка была успешно отправлена!');
					$('#coop_submit').attr('disabled','disabled');
				} else {
					$('#ajax_status').show().addClass('error').html('Ошибка: '+data[1]);		
				}
			}
		});
		return false;	
    });
	// -----------------------------------
	$('.sorting').click(function() {
		req = window.location.search;
		order_by = $(this).attr('order_by');
		order_type = $(this).attr('order_type');
		if ((s_pos = strpos(req,'&order_by')) !== false) {
			if ((f_pos = strpos(req,'&',s_pos+1))!== false) { // not final parametre
				url = substr(req,0,s_pos) + '&order_by=' + order_by + substr(req,f_pos);
			} else {
				url = substr(req,0,s_pos) + '&order_by=' + order_by;
			}
		} else url = req + "&order_by=" + order_by;
		req = url;
		if ((s_pos = strpos(req,'&order_type')) !== false) {
			if ((f_pos = strpos(req,'&',s_pos+1))!== false) { // not final parametre
				url = substr(req,0,s_pos) + '&order_type=' + order_type + substr(req,f_pos);
			} else {
				url = substr(req,0,s_pos) + '&order_type=' + order_type;
			}
		} else url = req + "&order_type=" + order_type;
		window.location = "/" + url;
		return false;
	});
	// ------------------------------------
	$('.trTask').click(function() {
		
	});
	/*if ($("#uploadify").length) {
		$("#uploadify").uploadify({
			'uploader'       : '/javascript/uploadify.swf',
			'script'         : '/ajax/uploadify.php',
			'cancelImg'      : '/images/cancel_up.png',
			'folder'         : 'uploads',
			'queueID'        : 'fileQueue',
			'auto'           : true,
			'multi'          : true,
			'fileDesc'   	 : 'jpg;gif;pdf;rar;zip;png;',
            'fileExt'   	 : '*.jpg;*.gif;*.pdf;*.rar;*.zip;*.png;',
			'onAllComplete'  : function(event,data) {
				$.post(
				'/ajax/get_files.php',
				{ 	
					action: 'action'
				},
				function (data) {
					if (data!=0) {
						$('#filesContent').html(data);
					}
				}
				);
			}
		});
		$('#uploadifyCancelAll').click(function() {
			$('#uploadify').uploadifyClearQueue();
			return false;
		});
	}*/
	$('#upload_file').submit(function() { 
        $(this).ajaxSubmit({
			beforeSubmit: function () {
				$('#ajax_status_4').hide().removeClass('error');
				$('#ajax_loading_4').show();
			},
			success: function (data) {
				$('#ajax_loading_4').hide();
				data = str_replace('<pre>','',data);
				data = str_replace('</pre>','',data);
				data = str_replace('<PRE>','',data);
				data = str_replace('</PRE>','',data);
				if (data==1) {
					$('#ajax_status_4').show().html('Файл загружен!');
					$('#Filedata').val('');
						$.post(
						'/ajax/get_files.php',
						{ 	
							action: 'action'
						},
						function (data_content) {
							if (data_content!=0) {
								$('#filesContent').html(data_content);
							}
						}
						);
					$('#user_photo').attr('src',data+'?'+Math.random());
				} else {
					$('#ajax_status_4').show().addClass('error').html(data);		
				}
			}
		});
        return false; 
    });
	$("a[act='deleteFile']").live('click',function(){
		id = $(this).attr('id');
		if (confirm('Вы действительно хотите удалить этот файл?')) {
			$.post(
			'/ajax/delete_file.php',
			{
				id: id, 	
				action: 'action'
			},
			function (data) {
				if (data==1) {
					if ($('.fileWrap:visible').length == 1) {
						$('#filesContent').prepend('У вас нет загруженных файлов');
					}
					$('.fileWrap[id='+id+']').hide('slow');
				}
			}
			);
		}	
		return false;
	});
	$("input[name='exclusive'][value='1']").click(function(){
		$('#exclusive_for').show();
	});
	$("input[name='exclusive'][value='0']").click(function(){
		$('#exclusive_for').hide();
	});
	$("#change_type").change(function(){
		if ($(this).val()=='cost') {
			$('#td_cost').show();
			$('#td_date').hide();
		} else if ($(this).val()=='date') {
			$('#td_cost').hide();
			$('#td_date').show();
		}
	});
	$('form.change_task').submit(function() { 
		$(this).ajaxSubmit({
			beforeSubmit: function () {
				$('#ajax_status').hide().removeClass('error');
				$('#ajax_loading').show();
			},
			success: function (data) {
				$('#ajax_loading').hide();
				data = data.split('|');
				if (data[0]==1) {
					$('#ajax_status').show().html('Предложение успешно добавлено!');
					new_change = $('#rsp_template > .rsp').clone().appendTo('#rsp_content');
					new_change.attr('id_change',data[2]);
					$(".rsp[id_change='"+data[2]+"'] > .rsp_title").html('Ваше предложение<span class="rsp_date"> / не просмотрено [<a href="#" act="del_change" id_change="'+data[2]+'">удалить</a>]</span>');
					$(".rsp[id_change='"+data[2]+"'] > .rsp_text").html(data[1]);
					
				} else {
					$('#ajax_status').show().addClass('error').html('Предложение не было добавлено!');		
				}
			}
		});
		return false;	
    });
	$('a[act="del_change"]').live('click',function(){
		if (confirm('Вы действительно хотите удалить это предложение?')) {
			id = $(this).attr('id_change');
			$.post(
			'/ajax/delete_change.php',
			{
				id: id, 	
				action: 'action'
			},
			function (data) {
				if (data==1) {
					$(".rsp[id_change='"+id+"']").hide('slow');
				} else alert('Ошибка удаления предложения!');
			}
			);
		}		
		return false;
	});
	$('a[act="agree_change"]').click(function(){
		c_span = $(this).parent();
		id = $(this).attr('id_change');
		c_status = $(this).attr('c_status');
		$.post(
		'/ajax/agree_change.php',
		{
			id: id,
			status: c_status,	
			action: 'action'
		},
		function (data) {
			if (data==1) {
				if (c_status==1) {
					text = ' / принято';
				} else if (c_status==2) {
					text = ' / отказано';
				}
				c_span.html(text);
			} else alert('Ошибка при изменении статуса предложения!');
		}
		);		
		return false;
	});
	// --------------------------------
	$('#stat_tab').click(function() {
		var val = $('#jqplot_activity_values').html();
		line1 = new Array();
		line1 = val.split('|');
		for (var key in line1) {
			var val = line1[key];
			line1[key] = Number(val);
		}	
		plot1 = $.jqplot('jqplot_activity', [line1], {
		    title:'Средняя активность за 2 недели по времени суток',
		    stackSeries: true,
			seriesDefaults: {
		      renderer: $.jqplot.BarRenderer,
		      rendererOptions: { barMargin: 10 },
			  pointLabels: { stackedValue: true }
		    },
			series:[
		        {label:'Кол-во заходов', renderer:$.jqplot.BarRenderer}, 
		    ],
		    axes:{
		        xaxis:{renderer:$.jqplot.CategoryAxisRenderer,
				ticks:['0',1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23]}, 
		        yaxis:{min:0}
		    }
		});
		
		/*var val2 = $('#jqplot_term_values').html();
		line2 = new Array();
		data = val2.split('|');
		line2[0] = ['Вовремя',Number(data[1])];
		line2[1] = ['Просрочено',Number(data[0])];			
		plot2 = $.jqplot('jqplot_term', [line2], {
		    title:'Соотношение просроченных и выполненных в срок задач',
			seriesDefaults:{renderer:$.jqplot.PieRenderer, rendererOptions:{sliceMargin:20}},
			legend:{show:true}
		});*/
	});
 });