$(document).ready(function() {

	$("a.pimages").fancybox({
		'zoomOpacity'			: true,
		'overlayShow'			: false,
		'zoomSpeedIn'			: 300,
		'zoomSpeedOut'			: 0
	});

	
	$("#vote_wnd_show").click(function () {
		
		$("#vote_wnd_overly").hide();
		$("#vote_wnd").hide();
		$("#vote_wnd .padder").empty();
		
		
		
		$("#vote_wnd_overly").show();
		$("<div />").attr("style","text-align: center").html("Загрузка...").appendTo("#vote_wnd .padder");
		
		$("#vote_wnd").fadeIn(500, function(){
		
			$.post(
				'/ru/clients/questioning/',
				function(data){
					$("#vote_wnd .padder").empty();
					$("#vote_wnd .padder").html(data);
				}
			);
			
		});
		
		return false;
		
	});
	
	
	$("#vote_wnd_close").click(function () {
		
		$("#vote_wnd_overly").hide();
		$("#vote_wnd").fadeOut(300, function (){
			
			$("#vote_wnd .padder").empty();
			
		});
		
		return false;
		
	});
		
	$('.qtoolip').each(function()
	{
		$(this).qtip({
			content: "<b>Цена при подключении</b><br />" + $(this).find('span').html(), // Use the tooltip attribute of the element for the content
			style: {

				padding: 5,
				background: '#EAEFD6',
				color: '#5F5F5F',
				border: {
					width: 7,
					radius: 5,
					color: '#EAEFD6'
				},
				name: 'dark',  // Inherit the rest of the attributes from the preset dark style
				tip: 'bottomLeft'
			},
			position: { corner: { target: 'topRight', tooltip: 'bottomLeft' } }
		});
	});


    $("#toggle").click(function () {
      $("#toggleblock").slideToggle("300");
    });    

	//$('#marquee').marquee();
	
});

	function vote_push () {
		
		var vote_id = $("input[name='vot_id']").attr("value");
		var option_id = $("input[name='vot_opt']:checked").attr("value");
		
		$("#vote_wnd .padder").empty();
		$("<div />").attr("style","text-align: center").html("Загрузка...").appendTo("#vote_wnd .padder");
			
		$.post(
			'/ru/clients/questioning/',
			{action: "vote", vot_id: vote_id, vot_opt: option_id},
			function(data){
				$("#vote_wnd .padder").empty();
				$("#vote_wnd .padder").html(data);
			}
		);
		
		return false;
		
	};