var px = 5;//mehr=schneller
var timer;

function scrollGal(val,speed){
clearTimeout(timer);
x=d.scrollLeft;
if(val==1)x-=speed;
if(val==2)x+=speed;
if(x<=d.scrollWidth-d.offsetWidth+px&&x>=0-speed){
d.scrollLeft=x;
timer=setTimeout('scrollGal('+val+','+speed+')',2);
}
if(x<0||x>d.scrollWidth-d.offsetWidth){
clearTimeout(timer);
if(val==1){
	val=2;
}else{
	val=1;
}
timer=setTimeout('selfScrollGal('+val+',1)',100);
}
}

document.write("<style>#galpics{overflow-x:auto; overflow-y:hidden;}</style>");

function selfScrollGal(val,speed){
clearTimeout(timer);
x=d.scrollLeft;
if(val==1)x-=speed;
if(val==2)x+=speed;
if(x<=d.scrollWidth-d.offsetWidth+px&&x>=0-speed){
d.scrollLeft=x;
timer=setTimeout('selfScrollGal('+val+','+speed+')',20);
}
if(x<0||x>d.scrollWidth-d.offsetWidth){
clearTimeout(timer);
if(val==1){
	val=2;
}else{
	val=1;
}
timer=setTimeout('selfScrollGal('+val+','+speed+')',100);
}
}
