var move = 0,
	moveend = 1;

function scroller() {
if (moveend == 1){
    move=1;
$("#scr img:first-child").animate({marginLeft: "-=20px" },200,"linear",function () {
	marg1=-$("#scr img:first-child").css("margin-left").substring(0,$("#scr img:first-child").css("margin-left").length-2);
	width1=$("#scr img:first-child").width()+10;
	if (marg1>=width1+10){
		var curimg = $("#scr img:first-child");
		marg1=width1-marg1;
		$("#scr").remove("img:first-child");
		$("#scr img:nth-child(2)").css('margin-left', marg1);	
		curimg.css('margin-left', '0px');
		curimg.appendTo("#scr");}
	scroller();
  });}
else{moveend=1;
move=0;}
}
function scroller_l() {
if (moveend == 1){
    move=1;
    marg1=$("#scr img:first-child").css("margin-left").substring(0,$("#scr img:first-child").css("margin-left").length-2);
    if(marg1<=0){
	if(marg1>-20){
	var curimg = $("#scr img:last-child");
    	$("#scr").remove("img:last-child");
	marg1=curimg.width()-marg1+10;
    	curimg.css('margin-left', -marg1);
	$("#scr img:first-child").css('margin-left',0);
	curimg.prependTo("#scr");}}
  $("#scr img:first-child").animate({marginLeft: "+=20px" },200,"linear",function () {
  scroller_l();
  });}
else{moveend=1;
move=0;}
}  
function scr_stop(){
	moveend=0;
	}
/*
$(document).ready(function() {
  scroller();
});*/
