	$(function()
	{		
		var common_speed = .1;
		var w1 = $("#a_extContainer").width();
		var w2 = $("#anons_table").width() - 10;
		var w2_w1 = w2-w1;
		var scr_width = $(".line").width() - 10;
		
		var speed1 = w2_w1 / common_speed;
		var speed2 = scr_width / common_speed;
		
		var toLeft = "-"+w2_w1+"px";
		
		$("#a_Container").css({left : toLeft});
		$(".pimpa").css({left : scr_width+"px"});
		
		$("#arr_r_id").mousedown(function()
		{
			$("#a_Container").animate({left : toLeft}, speed1);
			$(".pimpa").animate({left : scr_width+"px"}, speed2);
		});
		$("#arr_r_id").mouseup(function()
		{
			$("#a_Container").stop();
			$(".pimpa").stop();
		});
		$("#arr_l_id").mousedown(function()
		{
			$("#a_Container").animate({left : "0px"}, speed1);
			$(".pimpa").animate({left : "0px"}, speed2);
		});
		$("#arr_l_id").mouseup(function()
		{
			$("#a_Container").stop();
			$(".pimpa").stop();
		});
		
		$("#anons_developers_b").toggle(
			function()
			{
				$("#anons_integrators").hide();
				$("#anons_developers").show();
			},
			function()
			{
				$("#anons_developers").hide();
			}
		);
		
		$("#anons_integrators_b").toggle(
			function()
			{
				$("#anons_developers").hide();
				$("#anons_integrators").show();
			},
			function()
			{
				$("#anons_integrators").hide();
			}
		);
		
		$(document).click(function()
		{
			if(this.tagName != ".dropdown")
			{
				$(".dropdown").hide();
			}
			
		});
		
		$(".anonsDropdown").toggle(
			function(e)
			{
				$(".popup").hide();
				
				var blockX = $("#popup").width();
				var blockY = $("#popup").height();				
				var XXX = e.pageX;
				var YYY = e.pageY - 40;				
				var centerX = $(window).width() / 2;
				var centerY = $(window).height() / 2 + $(window).scrollTop();
				
				if(XXX <= centerX && YYY <= centerY){	XXX = XXX; YYY = YYY + 50; }
				if(XXX <= centerX && YYY > centerY){	XXX = XXX; YYY = YYY - blockY; }
				if(XXX > centerX && YYY <= centerY){	XXX = XXX - blockX-40; YYY = YYY + 50; }
				if(XXX > centerX && YYY > centerY){	XXX = XXX - blockX-40; YYY = YYY - blockY; }
				
				
				$.ajax(
				{
  					url: $(this).attr("aj_attr"),
  					cache: false,
  					success: function(html)
  					{
    					$("#popup").html(html);
    					$("#popup").css({"left" : XXX+"px", "top" : YYY + "px"}).show();
  					}
				});
			},
			function()
			{
				$(".popup").hide();
			}
		);
		
		$("#popup").click(function()
		{
			$(this).fadeOut(1000);
		});
		
		
		$(".dd_arrow").toggle(
			function()
			{
				$(".dropdown").hide();
				
				var parObj = $(this).parents(".select1");
				var obJ = parObj.children("div.dropdown");
				obJ.show();
			},
			function()
			{
				$(this).parents(".select1").children("div.dropdown").hide();
			}
		);
		
		$(".dropdown > ul > li > a").click(function()
		{
			var inputBox = $(this).parents(".select1").find("td.inputTD > :text");
			inputBox.attr({"value" : $(this).attr("text")});
		});
		
		$("#search_b").click(function()
		{
			$("#extended_search").submit();
		});
	});
	
	
	
