mov1 = new Move1;
//add_load(init_move);
function init_move1(id){
	id = 'slider_content';
	div = document.getElementById(id);
	div_child = div.getElementsByTagName('ul');
	col = div_child.length;
	width = div_child.item(0).offsetWidth + 33;;
	div.style.width = width*col+'px';
	mov1.set(col,id,width);
}
/*****  START class  *****/
function Move1(){
	this.position = 0;
	this.col;
	this.id;
	this.width;
	this.start;
	this.end;
	this.max;
	this.sped = 30;
	this.start_sped = this.sped;
	this.i = 0;
	this.next = function(){clearTimeout(mov1.tim);if(this.position < (this.col-1)){this.position++;this.end = this.position*this.width;movs_next1();}}
	this.back = function(){clearTimeout(mov1.tim);if(this.position > 0){this.position--;this.end = this.position*this.width;movs_buk1();}}
	this.set = function(col,id,width){
		this.position = 0;
		this.col = col;
		this.id = id;
		this.div = document.getElementById(id);
		this.start = 0;
		this.width = width;
		this.max = width*col;
		}
}
function movs_buk1(){
	mov1.i = mov1.i-mov1.sped;  //alert(mov1.end+' : '+mov1.i);
	mov1.div.style.marginLeft = '-'+mov1.i+'px';
	mov1.tim = setTimeout(movs_buk1,'0.1');
	if((mov1.i - mov1.end) < mov1.start_sped ){mov1.sped = 1;}
	if(mov1.i <= mov1.end || mov1.i < 0){
		//mov1.div.style.marginLeft = '-'+mov1.end+'px';
		mov1.sped = 30;
		clearTimeout(mov1.tim);
	}
}
function movs_next1(){
	mov1.i = mov1.i+mov1.sped;   //alert(mov1.end+' : '+mov1.i);
	mov1.div.style.marginLeft = '-'+mov1.i+'px';
	mov1.tim = setTimeout(movs_next1,'0.1');
	if((mov1.end - mov1.i) < mov1.start_sped ){mov1.sped = 1;}
	if(mov1.i >= mov1.end || mov1.i > mov1.max){
		//mov1.div.style.marginLeft = '-'+mov1.end+'px';
		mov1.sped = 30;
		clearTimeout(mov1.tim);
	}
}
/*****  END class  *****/
addHandler(window,'load',init_move1);


