function getRef(name) { return document.getElementById(name); }

	var speed = 0;
	var acc = 1;

	var box_positions = new Array();
	var max_boxes = -1;
	var position_num = 0;
	
	function do_move(direction) {
	speed = 0;
		if (direction == 'right' && position_num == 0) {
		movebox(box_positions[0],box_positions[max_boxes],'left');
		position_num = max_boxes;
		} else if (direction == 'left' && position_num == max_boxes) {
		movebox(box_positions[max_boxes],box_positions[0],'right');
		position_num = 0;
		} else {
		next_pos = (direction == 'left') ? position_num+1 : position_num-1;
		movebox(box_positions[position_num],box_positions[next_pos],direction);
		position_num = (direction == 'left') ? position_num+1 : position_num-1;
		}
	}
	
	
	function movebox(curX,endX,direction) {
		//only run scripts on DOM browsers
		if(!document.getElementById || !document.getElementsByTagName) return;
		
		//position box vertically
		getRef("recent_posts_boxes").style.top = 0 + "px";
		
		
		eval_cur = (direction == 'left') ? curX < endX : curX > endX;
		
		if (eval_cur) {	//finished animation
			getRef("recent_posts_boxes").style.left = endX + "px";
		
		} else {		//continue with animation
			speed += acc;	//accellerate
			getRef("recent_posts_boxes").style.left = curX + "px";
			calc_pos = (direction == 'left') ? curX-speed : curX+speed;
			setTimeout("movebox(" + (calc_pos) + "," + endX + ",'"+direction+"');",5);
		}
	}
	

	var comment_box_positions = new Array();
	var max_comment_boxes = -1;
	var comment_position_num = 0;
				

	function comments_do_move(direction) {
	speed = 0;
		if (direction == 'right' && comment_position_num == 0) {
		comments_movebox(comment_box_positions[0],comment_box_positions[max_comment_boxes],'left');
		comment_position_num = max_comment_boxes;
		} else if (direction == 'left' && comment_position_num == max_comment_boxes) {
		comments_movebox(comment_box_positions[max_comment_boxes],comment_box_positions[0],'right');
		comment_position_num = 0;
		} else {
		next_pos = (direction == 'left') ? comment_position_num+1 : comment_position_num-1;
		comments_movebox(comment_box_positions[comment_position_num],comment_box_positions[next_pos],direction);
		comment_position_num = (direction == 'left') ? comment_position_num+1 : comment_position_num-1;
		}
	}
	
	
	function comments_movebox(curX,endX,direction) {
		//only run scripts on DOM browsers
		if(!document.getElementById || !document.getElementsByTagName) return;
		
		//position box vertically
		getRef("recent_comments_boxes").style.top = 0 + "px";
		
		
		eval_cur = (direction == 'left') ? curX < endX : curX > endX;
		
		if (eval_cur) {	//finished animation
			getRef("recent_comments_boxes").style.left = endX + "px";
		
		} else {		//continue with animation
			speed += acc;	//accellerate
			getRef("recent_comments_boxes").style.left = curX + "px";
			calc_pos = (direction == 'left') ? curX-speed : curX+speed;
			setTimeout("comments_movebox(" + (calc_pos) + "," + endX + ",'"+direction+"');",5);
		}
	}
	


	var miscimg_box_positions = new Array();
	var max_miscimg_boxes = -1;
	var miscimg_position_num = 0;
				



	function miscimg_do_move(direction) {
	speed = 0;
		if (direction == 'right' && miscimg_position_num == 0) {
		miscimg_movebox(miscimg_box_positions[0],miscimg_box_positions[max_miscimg_boxes],'left');
		miscimg_position_num = max_miscimg_boxes;
		} else if (direction == 'left' && miscimg_position_num == max_miscimg_boxes) {
		miscimg_movebox(miscimg_box_positions[max_miscimg_boxes],miscimg_box_positions[0],'right');
		miscimg_position_num = 0;
		} else {
		next_pos = (direction == 'left') ? miscimg_position_num+1 : miscimg_position_num-1;
		miscimg_movebox(miscimg_box_positions[miscimg_position_num],miscimg_box_positions[next_pos],direction);
		miscimg_position_num = (direction == 'left') ? miscimg_position_num+1 : miscimg_position_num-1;
		}
	}
	
	
	function miscimg_movebox(curX,endX,direction) {
		
		if(!document.getElementById || !document.getElementsByTagName) return;
		
		//position box vertically
		getRef("miscimg_boxes").style.top = 0 + "px";
		
		
		eval_cur = (direction == 'left') ? curX < endX : curX > endX;
		
		if (eval_cur) {	//finished animation
			getRef("miscimg_boxes").style.left = endX + "px";
	//	alert('end');
		} else {		//continue with animation
			speed += acc;	//accellerate
			getRef("miscimg_boxes").style.left = curX + "px";
			calc_pos = (direction == 'left') ? curX-speed : curX+speed;
			setTimeout("miscimg_movebox(" + (calc_pos) + "," + endX + ",'"+direction+"');",5);
		}
	}
	


	var coords_box_positions = new Array();
	var max_coords_boxes = -1;
	var coords_position_num = 0;
				

	function coords_do_move(direction) {
	speed = 0;
		if (direction == 'right' && coords_position_num == 0) {
		coords_movebox(coords_box_positions[0],coords_box_positions[max_coords_boxes],'left');
		coords_position_num = max_coords_boxes;
		} else if (direction == 'left' && coords_position_num == max_coords_boxes) {
		coords_movebox(coords_box_positions[max_coords_boxes],coords_box_positions[0],'right');
		coords_position_num = 0;
		} else {
		next_pos = (direction == 'left') ? coords_position_num+1 : coords_position_num-1;
		coords_movebox(coords_box_positions[coords_position_num],coords_box_positions[next_pos],direction);
		coords_position_num = (direction == 'left') ? coords_position_num+1 : coords_position_num-1;
		}
	}
	
	
	function coords_movebox(curX,endX,direction) {
		//only run scripts on DOM browsers
		if(!document.getElementById || !document.getElementsByTagName) return;
		
		//position box vertically
		getRef("coordinates_boxes").style.top = 0 + "px";
		
		
		eval_cur = (direction == 'left') ? curX < endX : curX > endX;
		
		if (eval_cur) {	//finished animation
			getRef("coordinates_boxes").style.left = endX + "px";
		
		} else {		//continue with animation
			speed += acc;	//accellerate
			getRef("coordinates_boxes").style.left = curX + "px";
			calc_pos = (direction == 'left') ? curX-speed : curX+speed;
			setTimeout("coords_movebox(" + (calc_pos) + "," + endX + ",'"+direction+"');",5);
		}
	}
	


