(function($)
{
if (!$.fn.spritehover) {
	$._spritehover_thread = function (options)
	{
		this._tickDelegate = Function.CreateDelegate(this, this.tick);
		this.first=options.first;
		this.width=options.width;
		this.total=options.total;
		this.wait=options.wait;
		this.cycle=options.cycle;
		this.pause=options.pause;
	};

	$._spritehover_thread.prototype = {
		tick: function (){
			if(this.cycle==1)
			{
				if(this.first>this.total)
				{
					this.first=0;
	
					if(this.pause>0)
					{
						this.timer_id=setTimeout(this._tickDelegate,this.pause);
						return;
					};
				};
			} else {
/*
					if(this.first>this.total)
					{
						this.timer_id=-1;
						return;
					};
					if(this.first<0)
					{
						this.timer_id=-1;
						return;
					};
*/
			};

			var ths=this;


			this.obj.each(function(){
				$(this).css("background-Position","-"+ths.width*ths.first+"px 0px");
			});

			this.first+=this.dir;
			this.timer_id=setTimeout(this._tickDelegate,this.wait);
		}
	};

	$.fn.spritehover = function (options)
	{
		var options = $.extend({
			first: 1,
			width: 28,
			total: 5,
			wait: 100,
			cycle: 0,
			pause: 0
		},options);

		options.first--;
		options.total--;

//		return this.each(function() {
		$.fn.spritehover.sys.arr[$.fn.spritehover.sys.cnt]=new $._spritehover_thread(options);
		var sa=$.fn.spritehover.sys.arr[$.fn.spritehover.sys.cnt];
		$.fn.spritehover.sys.cnt++;
		
		sa.obj=this;

		if(options.cycle==1)
		{
			sa.dir=1;
			sa.timer_id=setTimeout(sa._tickDelegate, options.wait);
		} else {
/*
			$(this).hover(
				function(){
					if(sa.first<0)
						sa.first=0;
					sa.dir=1;
					sa.timer_id=setTimeout(sa._tickDelegate, options.wait);
				},
				function(){
					if(sa.first>sa.total)
						sa.first=sa.total;
					sa.dir=-1;
					sa.timer_id=setTimeout(sa._tickDelegate, options.wait);
				}
			);
*/
		};
//		});
	};
	$.fn.spritehover.sys = {
		arr: {},
		cnt: 0
        };
};
	if (!Function.CreateDelegate) {
		Function.CreateDelegate = function(instance, method) {
			return function() {
				method.apply(instance, arguments);
			}
		}
	};
})(jQuery);


function setCookie (name, value, expires, path, domain, secure) {
      document.cookie = name + "=" + escape(value) +
        ((expires) ? "; expires=" + expires : "") +
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");
}
function getCookie(name) {
	var cookie = " " + document.cookie;
	var search = " " + name + "=";
	var setStr = null;
	var offset = 0;
	var end = 0;
	if (cookie.length > 0) {
		offset = cookie.indexOf(search);
		if (offset != -1) {
			offset += search.length;
			end = cookie.indexOf(";", offset)
			if (end == -1) {
				end = cookie.length;
			}
			setStr = unescape(cookie.substring(offset, end));
		}
	}
	return(setStr);
}

var total_h=680;
var total_width=1920;
var h_naezd=110;
var h_delta=20; // сколько убирается сверху в пользу низа
var speed_motion=30; // чем больше, тем медленнее движение параллакса
var speed_divby=3;
var t_flag=0;
var curx=0;
var tflag2=2;

var pleft_page=100;
var ptop_page=100;

var button_width=250;
var button_height=450;
var button_delta=0;

var cur_mouse_x=-1;

$(document).ready(function(){
/*
	$.reject({  
	        reject: {  
		    opera9: true, opera7: true, opera8: true, opera10: false, msie7: true, firefox: true,firefox1: true,firefox2: true,
	            konqueror: true, // Konqueror (Linux)  
	            unknown: true // Everything else  
	        }  ,
		display: ['firefox','chrome','opera','msie'],
		close: false,
	        header: 'ВНИМНИЕ! Вы используете устаревший браузер', // Header Text  
	        paragraph1: 'Данный сайт построен на передовых, современных технологиях и не поддерживает устаревшие браузеры. Настоятельно Вам рекомендуем выбрать и установить любой из современных браузеров. Это бесплатно и займет несколько минут.', // Paragraph 1  
	        paragraph2: 'Устаревший браузер является не просто браузером старой версии, а устаревшим браузером, браузером старого поколения. Он не может предоставить все возможности, которые могут предоставить современные браузеры, а скорость его работы в несколько раз ниже!' //
	}); // Customized Browsers  
*/

	var win_w=parseInt($(window).width());
	var win_h=parseInt($(window).height());

	total_h=win_h;

	$(".winMain,.winFooter,.winHeader").css({width: win_w+"px"});
	var h1=(win_h-total_h)/2;
	var w1=win_w/2;

	h1=40;

	// наведение на левую стрелку
	$(".left_button").hover(function () {
		$(this).find("div").css({backgroundPosition:"right bottom"});
		}, function() {
		$(this).find("div").css({backgroundPosition:"left bottom"});
	});
	
	// наведение на правую стрелку
	$(".right_button").hover(function () {
		$(this).find("div").css({backgroundPosition:"right bottom"});
		}, function() {
		$(this).find("div").css({backgroundPosition:"left bottom"});
	});
	
	$(".winHeader").css({height: (h1+h_naezd-h_delta)+"px"});

	$(".top_menu").css({top: (h1+h_naezd-h_delta-65)/2 + "px"}); // позиционируем верхнее меню по вертикали	
	$(".top_menu_contacts").css({top: (h1+h_naezd-h_delta-15)/2 + "px"});
	$(".winMain").css({marginTop: h1+"px"});

	if((total_h+h1-h_naezd-h_delta-50)>595){
		$(".winFooter").css({top: 595+"px"});
		$(".winFooter").css({height: (h1+h_naezd+h_delta+((total_h+h1-h_naezd-h_delta-50)-595))+"px"});
	} else {
		$(".winFooter").css({top: (total_h+h1-h_naezd-h_delta-50)+"px"});
		$(".winFooter").css({height: (h1+h_naezd+h_delta)+"px"});
	};

	$(".bar_wrapper").css({width: (win_w-250)+"px"});

	var static_w=1000;
	var static_h=win_h-ptop_page*1.5;
	pleft_page=(win_w-static_w)/2;

	$("#static_page").css({top: ptop_page, left: pleft_page, width: static_w+"px", height: static_h+"px"}); // позиционируем статический контейнер 
	$("#static_page .static_content").css({height: (static_h-110)+"px"});

	$(".office2").css({marginLeft: (-(total_width-win_w)/2)+"px"});
	
	$(".loader").css({left: (win_w/2-16)+"px",top: (win_h/2-16)+"px"});

	$(".pre_office").bind("load",function(){
		$(".left_button").css({left: (button_delta), top: (win_h-button_height)/2, display: "block"});
		$(".right_button").css({left: (win_w-button_width-button_delta), top: (win_h-button_height)/2, display: "block"});

		$(".loader").css({display: "none"});
		$(".office").css({marginLeft: (-(total_width-win_w)/2)+"px"}).show();

		if($(".random_button").attr("show")=="yes")
		{
			$(".random_button").css({display: "block", left: (win_w-200)+"px", top: (h1+total_h-122)+"px"});
		} else {
			$(".random_button").css({display: "none"});
		};

		$(".plashka_info").css({display: "block", left: (win_w/2-160)+"px", top: (h1+70)+"px"});
		setTimeout(function(){
			if($.support.opacity)
			{
				$(".plashka_info").fadeOut(1000);
			} else {
				$(".plashka_info").css({display: "none"});
			};
		},1500);
	
		$(".obj").each(function(){
			var imgs=$(this).attr("imgsrc").split(",");
			var cnt = Math.round((Math.random() * (imgs.length - 1)));
			var imgs1=imgs[cnt].split(":");
		
			var im=$("<img src='"+imgs1[0]+"' border='0' pos_left='"+imgs1[1]+"' pos_top='"+imgs1[2]+"' />");		
			im.appendTo($(this));
			im.load(function(){	
				var par=$(this).parent();
				
				par.attr("pos_left",$(this).attr("pos_left"));
				par.attr("pos_top",$(this).attr("pos_top"));

				var tx=parseInt(par.attr("pos_left"));
				if(tx>0){
					par.css({left: (win_w+600)+"px", top: (h1+parseInt(par.attr("pos_top")))+"px", display: "block"});		
				} else {
					par.css({left: "-600px", top: (h1+parseInt(par.attr("pos_top")))+"px", display: "block"});		
				}
			
				par.animate({left: (win_w/2+tx)+"px"},500,function(){tflag2=0;});
			});
		});

		$("img.imgloader2").each(function(){
			$(this).attr("src",$(this).attr("hsrc"));
		});
	});	

	$(".pre_office").attr("src",$(".pre_office").attr("hsrc"))

	$("div#bar img.barimg").load(function(){
		$(this).show();
		$(this).attr("swidth",parseInt($(this).width()));
		$(this).attr("sheight",parseInt($(this).height()));
	});

	$("div#bar img.barimg").live('click',function(){
		var cur_door=$(this);
		var coord1=$(this).offset();

		if($(this).next().attr("eid")==144)
		{
			window.location="/about/aero.php";
		};

		$(".doors").html("<div style='display: none'>"+$(this).next().html()+"</div>");

		var str2=$(this).attr("price");
		var str3=$(this).attr("tname");

		var arr2=str2.split(" ");

		$(".doors_price").html("Заказать <br />"+arr2[0]+"<br />"+arr2[1]+" руб");
		$(".doors_tname").html(str3);

		$(".doors").fadeOut(400,function(){
			var coord=cur_door.offset();
			
			$(this).css({opacity: 0.5, background: "#aaaaaa", marginTop: coord.top, marginLeft: (coord.left-win_w/2+960), width: cur_door.width(), height: cur_door.height(),display: "block"}).animate({marginTop: "101px", marginLeft: "870px", width: "158px", height: "322px"},500,function(){
				$(this).css({opacity: 1, border: "none", background: "url('"+cur_door.attr("big")+"') no-repeat left top"});
			});
		});
	});

	$(".doors_price").click(function(){
		$(".doors").trigger("click");
	});

	$(".doors").click(function(){
		var static_w=1000;
		var static_h=win_h-100;
		pleft_page=(win_w-static_w)/2;

		var h2=static_h-105;

		$(".doors img.imgloader").each(function(){
			$(this).attr("src",$(this).attr("hsrc"));
		});

		$("#static_page2").css({display: "block", top: 50, left: pleft_page, width: static_w+"px", height: static_h+"px"}).find(".static_content").css({height: h2+"px"}).html($(".doors").find("div").html()); // позиционируем статический контейнер 
		$("#static_page2").find(".passport_bar").html($(".passport_list_doors").html());

		$("#static_page2 img.imgloader").each(function(){
			$(this).attr("src",$(this).attr("hsrc"));
		});

	});

	$("#static_page2 .static_close_button").click(function(){
		$("#static_page2").hide(400);
	});

	$("#static_page .static_close_button").click(function(){
		window.location="/";
	});

	if($.support.opacity){
		$("div#bar").mousemove(function(event){
			curx=event.pageX;
			imw=get_width_img();
	
			$("div#bar img.barimg").each(function(){
				var coor=$(this).offset().left;
				var cc=1;
	
				var sw=parseInt($(this).attr("swidth"));
				var sh=parseInt($(this).attr("sheight"));
	
				var sh1=sh;
				var t=0;
	
				if(Math.abs(coor+35-curx)<70)
				{
					sw=sw*(1+(70-Math.abs(coor+35-curx))/70/4);
					sh=sh*(1+(70-Math.abs(coor+35-curx))/70/4);
					t=20*(1+(70-Math.abs(coor+35-curx))/70/4)-20;
				};
				$(this).css({width: sw+"px", height: sh+"px", marginTop: -(sh-sh1)+"px"});
			});
		});
	
		$("div#bar").mouseout(function(event){
			$("div#bar img.barimg").each(function(){
				var sw=parseInt($(this).attr("swidth"));
				var sh=parseInt($(this).attr("sheight"));
	
				$(this).css({width: sw+"px", height: sh+"px", marginTop: 0+"px"});
			});
		});

		$(".winFooter").mouseleave(function(){
			$("#bar img.barimg").each(function(){
				var sw=parseInt($(this).attr("swidth"));
				var sh=parseInt($(this).attr("sheight"));
	
				$(this).animate({width: sw+"px", height: sh+"px",marginTop: "0px"},200);
			});
		});
	};

	$(".bar_wrapper_left,.bar_wrapper_right").hover(function(){
		if(!$(this).hasClass("disabled"))
		{
			$(this).css("background-position","-82px 0px");
		};
	},function(){
		if(!$(this).hasClass("disabled"))
		{
			$(this).css("background-position","0px 0px");
		};
	});

	$(".bar_wrapper_left").click(function(){
		if(!$(this).hasClass("disabled"))
		{
			var ml=parseInt($("#bar").css("marginLeft"));
			ml+=100;
			if(ml>0){
				ml=0;
				$(this).css("background-Position","0px -82px").addClass("disabled");
			} else {
				$(this).css("background-Position","-82px 0px").removeClass("disabled");
				$(".bar_wrapper_right").css("background-Position","0px 0px").removeClass("disabled");
			};
			$("#bar").stop().animate({marginLeft: ml+"px"},200);
		};
	});
	$(".bar_wrapper_right").click(function(){
		if(!$(this).hasClass("disabled"))
		{
			var t=get_width_bar()-parseInt($(".bar_wrapper").width());
			var ml=parseInt($("#bar").css("marginLeft"))-100;

			if((t+ml)<0){
				$(this).css("background-Position","0px -82px").addClass("disabled");
			} else {
				$(this).css("background-Position","-82px 0px").removeClass("disabled");
				$(".bar_wrapper_left").css("background-Position","0px 0px").removeClass("disabled");
			};

			$("#bar").stop().animate({marginLeft: ml+"px"},200);
		};
	});

	$("#bar,.barimg,.bar_wrapper,.winFooter").bind('mousedown',function(){return false;})
	$("#bar,.barimg,.bar_wrapper,.winFooter").bind('selectstart',function(){return false;})

	$(".static_content .passport_bar_left,.static_content .passport_bar_right").live('hover',function(){
		if(!$(this).hasClass("disabled"))
		{
			$(this).css("background-position","-41px 0px");
		};
	},function(){
		if(!$(this).hasClass("disabled"))
		{
			$(this).css("background-position","0px 0px");
		};
	});
	$(".static_content .passport_bar_left").live('click',function(){
		if(!$(this).hasClass("disabled"))
		{
			var ml=parseInt($(".static_content .passport_bar").css("marginLeft"));
			ml+=100;
			if(ml>0){
				ml=0;
				$(this).css("background-Position","0px -41px").addClass("disabled");
			} else {
				$(this).css("background-Position","-41px 0px").removeClass("disabled");
				$(".static_content .passport_bar_right").css("background-Position","0px 0px").removeClass("disabled");
			};
			$(".static_content .passport_bar").stop().animate({marginLeft: ml+"px"},200);
		};
	});
	$(".static_content .passport_bar_right").live('click',function(){
		if(!$(this).hasClass("disabled"))
		{
			var t=get_width_bar2()-parseInt($(".static_content .passport_bar_wrapper").width());
			var ml=parseInt($(".static_content .passport_bar").css("marginLeft"))-100;

			if((t+ml)<0){
				$(this).css("background-Position","0px -41px").addClass("disabled");
			} else {
				$(this).css("background-Position","-41px 0px").removeClass("disabled");
				$(".static_content .passport_bar_left").css("background-Position","0px 0px").removeClass("disabled");
			};

			$(".static_content .passport_bar").stop().animate({marginLeft: ml+"px"},200);
		};
	});
	$(".pasport_thumb,.passport_bar_left,.passport_bar_right,.passport_bar,.passport_bar_wrapper").bind('selectstart',function(){return false;})
	$(".pasport_thumb,.passport_bar_left,.passport_bar_right,.passport_bar,.passport_bar_wrapper").bind('mousedown',function(){return false;})

	$(".buy_button").live('click',function(){
		window.location="/contacts";
	});

	$(".filter_button").click(function(){
		var cat_id=$(this).attr("cat_id");

		if(cat_id=="-1")
		{
			$("#bar .barimg").show(0);
		} else {
			$("#bar .barimg").hide(0);
			$("#bar .barimg[cat_id='"+cat_id+"']").show(0);
		};

		var t=get_width_bar()-(win_w-250);
		$(".bar_wrapper_left").css("background-Position","0px -82px").addClass("disabled");

		if(t<=0)
		{
			$(".bar_wrapper_right").css("background-Position","0px -82px").addClass("disabled");

			t=get_width_bar()-80;
			$(".bar_wrapper").width(t);
			$(".bar_wrapper_left").css("marginLeft",(win_w-t-150)/2);
		
		} else {
			$(".bar_wrapper_right").css("background-Position","-82px 0px").removeClass("disabled");
			$(".bar_wrapper_left").css("marginLeft","20px");
			$(".bar_wrapper").css({width: (win_w-250)+"px"});
                };

		$("#bar").stop().animate({marginLeft: "0px"},200);

		$(".filter_button").removeClass("filter_selected");
		$(this).addClass("filter_selected");
	});
});



function get_width_bar2()
{
	var w1=0;
	$(".static_content .passport_bar img").each(function(){
		w1+=parseInt($(this).width());
		w1+=10;
	});
	w1+=130;
	return w1;
};

function get_width_bar()
{
	var w1=0;
	$("#bar .barimg").each(function(){
		if($(this).is(':hidden')==false){
			w1+=parseInt($(this).width());
			w1+=10;
		};
	});
	w1+=130;
	return w1;
};

var width_imgs=0;

function get_width_img()
{
	width_imgs=0;
	$("#bar img.barimg").each(function(){
		width_imgs+=parseInt($(this).width());
	});
	return width_imgs;
};

$(document).resize(function(){
	var win_w=parseInt($(window).width());
	var win_h=parseInt($(window).height());
	var static_w=parseInt($("#static_page").width());
	var static_h=parseInt($("#static_page").height());
	
	total_h=win_h;

	$(".winMain,.winFooter,.winHeader").css({width: win_w+"px"});
	var h1=(win_h-total_h)/2;
	h1=40;
	$(".winHeader").css({height: (h1+h_naezd-h_delta)+"px"});
//	$(".winFooter").css({height: (h1+h_naezd+h_delta)+"px"});
	
	$(".top_menu").css({top: (h1+h_naezd-h_delta-15)/2 + "px"}); // позиционируем верхнее меню по вертикали	
	$(".top_menu_contacts").css({top: (h1+h_naezd-h_delta-15)/2 + "px"});
	$(".winMain").css({marginTop: h1+"px"});

	if((total_h+h1-h_naezd-h_delta-50)>595){
		$(".winFooter").css({top: 595+"px"});
		$(".winFooter").css({height: (h1+h_naezd+h_delta+((total_h+h1-h_naezd-h_delta-50)-595))+"px"});
	} else {
		$(".winFooter").css({top: (total_h+h1-h_naezd-h_delta-50)+"px"});
		$(".winFooter").css({height: (h1+h_naezd+h_delta)+"px"});
	};

//	$(".winFooter").css({top: (total_h+h1-h_naezd-h_delta-50)+"px"});

	$(".bar_wrapper").css({width: (win_w-250)+"px"});

	$(".office").css({marginLeft: (-(total_width-win_w)/2)+"px"});
	$(".office2").css({marginLeft: (-(total_width-win_w)/2)+"px"});

	if($(".random_button").attr("show")=="yes")
	{
		$(".random_button").css({display: "block", left: (win_w-200)+"px", top: (h1+total_h-215)+"px"});
	} else {
		$(".random_button").css({display: "none"});
	};

	$(".left_button").css({left: (button_delta), top: (win_h-button_height)/2, display: "block"});
	$(".right_button").css({left: (win_w-button_width-button_delta), top: (win_h-button_height)/2, display: "block"});

	var static_w=1000;
	var static_h=win_h-ptop_page*1.5;
	pleft_page=(win_w-static_w)/2;

	$("#static_page").css({top: ptop_page, left: pleft_page, width: static_w+"px", height: static_h+"px"}); // позиционируем статический контейнер 
	$("#static_page .static_content").css({height: (static_h-110)+"px"});

	$(".obj").each(function(){
		var tx=parseInt($(this).attr("pos_left"));
		$(this).css({left: (win_w/2+tx)+"px", top: (h1+parseInt($(this).attr("pos_top")))+"px"});
	});
});

$(window).resize(function(){
	var win_w=parseInt($(window).width());
	var win_h=parseInt($(window).height());
	var static_w=parseInt($("#static_page").width());
	var static_h=parseInt($("#static_page").height());

	total_h=win_h;
	
	$(".winMain,.winFooter,.winHeader").css({width: win_w+"px"});
	var h1=(win_h-total_h)/2;
	h1=40;
	$(".winHeader").css({height: (h1+h_naezd-h_delta)+"px"});
//	$(".winFooter").css({height: (h1+h_naezd+h_delta)+"px"});
	
	$(".top_menu").css({top: (h1+h_naezd-h_delta-15)/2 + "px"}); // позиционируем верхнее меню по вертикали	
	$(".top_menu_contacts").css({top: (h1+h_naezd-h_delta-15)/2 + "px"});
	$(".winMain").css({marginTop: h1+"px"});

	if((total_h+h1-h_naezd-h_delta-50)>595){
		$(".winFooter").css({top: 595+"px"});
		$(".winFooter").css({height: (h1+h_naezd+h_delta+((total_h+h1-h_naezd-h_delta-50)-595))+"px"});
	} else {
		$(".winFooter").css({top: (total_h+h1-h_naezd-h_delta-50)+"px"});
		$(".winFooter").css({height: (h1+h_naezd+h_delta)+"px"});
	};

//	$(".winFooter").css({top: (total_h+h1-h_naezd-h_delta-50)+"px"});

	$(".bar_wrapper").css({width: (win_w-250)+"px"});

	$(".office").css({marginLeft: (-(total_width-win_w)/2)+"px"});
	$(".office2").css({marginLeft: (-(total_width-win_w)/2)+"px"});

	if($(".random_button").attr("show")=="yes")
	{
		$(".random_button").css({display: "block", left: (win_w-200)+"px", top: (h1+total_h-215)+"px"});
	} else {
		$(".random_button").css({display: "none"});
	};

	$(".left_button").css({left: (button_delta), top: (win_h-button_height)/2, display: "block"});
	$(".right_button").css({left: (win_w-button_width-button_delta), top: (win_h-button_height)/2, display: "block"});

	var static_w=1000;
	var static_h=win_h-ptop_page*1.5;
	pleft_page=(win_w-static_w)/2;

	$("#static_page").css({top: ptop_page, left: pleft_page, width: static_w+"px", height: static_h+"px"}); // позиционируем статический контейнер 
	$("#static_page .static_content").css({height: (static_h-110)+"px"});

	$(".obj").each(function(){
		var tx=parseInt($(this).attr("pos_left"));
		$(this).css({left: (win_w/2+tx)+"px", top: (h1+parseInt($(this).attr("pos_top")))+"px"});
	});
});

if($.support.opacity){
	$(document).mousemove(function(event){
		var win_w=parseInt($(window).width());

		if(t_flag==0)
		{
			cur_mouse_x=event.pageX;

			t_flag=1;
			curx=(event.pageX-win_w/2)/speed_motion;
			$(".office").stop().animate({marginLeft: (-(total_width-win_w)/2-curx)+"px"},300);	
		
			if(tflag2==0){
				$(".obj").each(function(){
					var tx=parseInt($(this).attr("pos_left"));
					$(this).stop().animate({left: (win_w/2+tx-curx*parseInt($(this).attr("motion"))/speed_divby)+"px"},300);
				});
			};
			
			setTimeout(function(){t_flag=2;},300)
		} else if(t_flag==2){
	
			if(Math.abs(cur_mouse_x-event.pageX)>400) // значение дельты – если больше, то происходит плавный сдвиг объектов 
			{
					t_flag=1;
				curx=(event.pageX-win_w/2)/speed_motion;
					
				if(tflag2==0){	
					$(".office").stop().animate({marginLeft: (-(total_width-win_w)/2-curx)+"px"},300);	
	
						$(".obj").each(function(){
						var tx=parseInt($(this).attr("pos_left"));
						$(this).stop().animate({left: (win_w/2+tx-curx*parseInt($(this).attr("motion"))/speed_divby)+"px"},300,function(){t_flag=2;});
					});
				};
			} else {
				curx=(event.pageX-win_w/2)/speed_motion;
			
				if(tflag2==0){
					$(".office").stop().css({marginLeft: (-(total_width-win_w)/2-curx)+"px"});	
	
					$(".obj").each(function(){
						var tx=parseInt($(this).attr("pos_left"));
						$(this).stop().css({left: (win_w/2+tx-curx*parseInt($(this).attr("motion"))/speed_divby)+"px"});
					});
				}
			};
		};
		cur_mouse_x=event.pageX;
	});
};
