// JavaScript Document
var runContent=true;
function moveContentBox(direction,speed){
W=document.getElementById('contentBox').offsetWidth;
P=document.getElementById('content').style.left;
P=P.replace('px','');
P=parseInt(P);
//alert((P));
if(direction=='r'){
if((P-W)>((document.getElementById('content').offsetWidth)*-1)&&runContent==true){
CM= setInterval('mcR(\''+W+'\',\''+P+'\',\''+speed+'\')',10);
runContent=false;
}
}else{
if((P+W)<=0&&runContent==true){
CM= setInterval('mcL(\''+W+'\',\''+P+'\',\''+speed+'\')',10);
runContent=false;
}
}
}

function mcR(W,P,speed){
P=parseInt(P);
W=parseInt(W);
NP=document.getElementById('content').style.left;
NP=NP.replace('px','');
NP=parseInt(NP);
if(NP>(P-W)){
document.getElementById('content').style.left=(NP-speed)+'px';
}else {
clearInterval(CM);
runContent=true;
//alert(document.getElementById('content').style.left);
}
}

function mcL(W,P,speed){
P=parseInt(P);
W=parseInt(W);
speed=parseInt(speed);
NP=document.getElementById('content').style.left;
NP=NP.replace('px','');
NP=parseInt(NP);
if(NP<(P+W)){
document.getElementById('content').style.left=(NP+speed)+'px';
}else {
clearInterval(CM);
runContent=true;
}
}
