if(!lastoneAMS ) { var lastoneAMS=1;} else {lastoneAMS=lastoneAMS+1;}