var myCount = 0;
var myMove = 0;

function slideRight(number, whocalled) {
	if (document.getElementById && ((10 - myCount) > number)) {
	
	
		//myObjectt = document.getElementById("slider-topics");
		
		//myObjectt = whocalled.up(1).down('#slider-topics');
		
	myObject = jQuery(whocalled).parent().parent().find('#slider-topics')[0];
	//console.log('jQUERY: '+myObject[0]);
		
		//console.log('IDIDID: '+myObjectt);
		
		//.down('#slider-topics')
		//'#other-topics-slider'
		
		myObject.style.left = myCount * - 111 + 'px';
		myCount += number;
		myMove = number * 111;
		
		moveRight();
	}
}

function moveRight() {
	if (myMove > 0) {
		var move = Math.floor(myMove/20) + 1;
		myObject.style.left = parseInt(myObject.style.left) - move + 'px';
		myMove-=  move;
		setTimeout(moveRight, 20);
	} 
}

function slideLeft(number, whocalled) {
	if (document.getElementById && (myCount > 0)) {
		//myObject = document.getElementById("slider-topics");
		
			myObject = jQuery(whocalled).parent().parent().find('#slider-topics')[0];

		
		myObject.style.left = myCount * - 111 + 'px';
		myCount -= number;
		myMove = number * 111;
		moveLeft();
	}
}

function moveLeft() {
	if (myMove > 0) {
		var move = Math.floor(myMove/20) + 1;
		myObject.style.left = parseInt(myObject.style.left) + move + 'px';
		myMove-=  move;
		setTimeout(moveLeft, 20);
	} 
}

function show(object) {
	if (document.getElementById) {
		myObject = document.getElementById(object);
		myObject.style.display = "block"
	}
}
		
function hide(object) {
	if (document.getElementById) {
		myObject = document.getElementById(object);
		myObject.style.display = "none"
	}
}

