/*图片相册及放大镜效果*/
var speed = 1; //速度，越大越慢
var spec = 56; //每次滚动的间距, 越大滚动越快
//var rHtml = '';
var MyMar;

function goleft() {document.getElementById('photos').scrollTop -= spec;}
function goright() {document.getElementById('photos').scrollTop += spec;}

window.onload = function(){	
	var p = document.getElementById('photos').getElementsByTagName('img');
	for (var i=0; i<p.length; i++) {
		p[i].onmouseover = function() {
			document.getElementById('mainphoto').src = this.getAttribute('src');
			document.getElementById('mainphoto').setAttribute('jqimg', this.getAttribute('jqimg'));
			document.getElementById('mainphoto').setAttribute('title', this.getAttribute('title'));
		}	
	}
	document.getElementById('goleft').style.cursor = 'pointer';
	document.getElementById('goright').style.cursor = 'pointer';
	document.getElementById('goleft').onmouseover = function() { MyMar=setInterval(goleft, speed);}
	document.getElementById('goleft').onmouseout = function() { clearInterval(MyMar);}
	document.getElementById('goright').onmouseover = function() { MyMar=setInterval(goright,speed);}
	document.getElementById('goright').onmouseout = function() { clearInterval(MyMar);}
}