function getObject(obj_name) {
	return document.getElementById(obj_name);
}

var TIMING = 50;
var MOVEMENT = 20;

var ct;
var cn;

var tmr;

function startMovingUp(content,contanier){
	ct = getObject(content);
	cn = getObject(contanier);
	
	tmr = window.setInterval("moveContentUp()",TIMING);
}
function startMovingDown(content,contanier){
	ct = getObject(content);
	cn = getObject(contanier);
	
	tmr = window.setInterval("moveContentDown()",TIMING);
}

function startMovingLeft(content,contanier){
	ct = getObject(content);
	cn = getObject(contanier);
	
	tmr = window.setInterval("moveContentLeft()",TIMING);
}
function startMovingRight(content,contanier){
	ct = getObject(content);
	cn = getObject(contanier);
	
	tmr = window.setInterval("moveContentRight()",TIMING);
}

function getTop(){
	alert("t:" + ct.style.top + "\n" + "h:" + ct.style.height + "\nh+t:" + (parseInt(ct.style.top) + parseInt(ct.style.height)) + "px");
}
function moveContentUp(){
	if ( ( parseInt(ct.style.top)+parseInt(ct.style.height) - MOVEMENT ) >= parseInt(cn.style.height) )
		ct.style.top = (parseInt(ct.style.top) - MOVEMENT) + "px";
}
function moveContentDown(){
	if ( (parseInt(ct.style.top) + MOVEMENT) <= parseInt(cn.style.top) )
		ct.style.top = (parseInt(ct.style.top) + MOVEMENT) + "px";
}


function moveContentLeft(){
	if ( ( parseInt(ct.style.left) + MOVEMENT ) <= 0 )
		ct.style.left = (parseInt(ct.style.left) +MOVEMENT) + "px";
}
function moveContentRight(){
	left_cn = (parseInt(ct.style.width) + parseInt(ct.style.left)) * -1;

	if ( (parseInt(ct.style.left) - MOVEMENT) >= left_cn )
		ct.style.left = (parseInt(ct.style.left) - MOVEMENT) + "px";
}

function moveContentLeftNPoints(pts){
	if ( ( parseInt(ct.style.left) + pts ) <= 0 )
		ct.style.left = (parseInt(ct.style.left) +pts) + "px";
}
function moveContentRightNPoints(pts){
	left_cn = (parseInt(ct.style.width) + parseInt(ct.style.left)) * -1;

	if ( (parseInt(ct.style.left) - pts) >= left_cn )
		ct.style.left = (parseInt(ct.style.left) - pts) + "px";
}


function stopMoving(){
	window.clearInterval(tmr);
}
