// JavaScript Document

	$(document).ready(function(){
		$('.panview').each(function(){
			$(this).load( $(this).attr('rel'),function(){
				$(this).prepend('<div class="turner"></div>')
				c = $(this).find('img').length
				n = Math.round(0.5*c)
				$(this).find('img:nth-child('+n+')').show()
//				$(this).find('img').show()
				$(this).attr('count',c)
/*				$(this).css({
					width:$(this).find('img').first().width(),
					height:$(this).find('img').first().height()
				})
*/
			})
		}).mousemove(function(data){
			p = $(this).offset();
			x = data.pageX - p.left
			y = data.pageY - p.top
			c = $(this).attr('count')
			w = $(this).width()
			n = Math.round((x/w)*c)
			if(n <= 1)n = 2
			$(this).find('img').hide();
			$(this).find('img:nth-child('+n+')').show()
		})
	})

