$(window).load(function()
{
	var th=$('.mdlThumbs'), root=$('.layRoot'), area=$('.mdlArea');
	th.append('<div class="mdlView"></div>');
	var view=$('.mdlView');
	
	var s=area.width() / th.width();
	var w1=root.width() / (2 * s);
	view.css({width: (2*w1-4)+'px', height: (th.height()-4)+'px' });
	th.mousemove(function(e)
	{
		if(e.clientX < w1) e.clientX = w1;
		if(e.clientX > th.width()-w1) e.clientX=th.width()-w1;
		area.css({'left': -(e.clientX-w1)*s+'px'});
		view.css({'left': (e.clientX-w1)+'px'});
	});
});