var currTxt,currPos,stripWdth,winSz,scrlL,scrlR,imgStrp,capStrp;
currPos=0;
scrlL=0;
scrlR=0;
currTxt='welcome';
currCap='capAbou';
stripWdth=7362;

function showAndSlide(newTxt,newPos) {
	hide(currTxt,1);
	currTxt=newTxt;
	show(newTxt,'block');
	trimEndAndMove(newPos)
}
function trimEndAndMove(enL) {
	if (enL<(0-(stripWdth-winSz))) {
		tmpEnL=(0-(stripWdth-winSz));
	} else if (enL>0) {
		tmpEnL=0;
	} else {
		tmpEnL=enL
	}
	imgStrp.style.marginLeft=tmpEnL+'px';
	capStrp.style.marginLeft=tmpEnL+'px';
	currPos=tmpEnL;
}
function getWinSz() {
	winSz=document.body.clientWidth;
}
function scrollL() {
	scrlL=1;
	scrollLpL();
}
function scrollR() {
	scrlR=1;
	scrollLpR();
}
function stopScroll() {
	scrlL=0;
	scrlR=0;
}
function scrollLpL() {
	if (scrlL>0) {
		if (currPos>-14) {
			imgStrp.style.marginLeft=0+'px';
			capStrp.style.marginLeft=0+'px';
			currPos=0;
		} else {
			imgStrp.style.marginLeft=(currPos+13)+'px';
			capStrp.style.marginLeft=(currPos+13)+'px';
			currPos=currPos+13;
		}
		window.setTimeout('scrollLpL()',9);
	}
}
function scrollLpR() {
	if (scrlR>0) {
		if (currPos<(14-(stripWdth-winSz))) {
			imgStrp.style.marginLeft=(0-(stripWdth-winSz))+'px';
			capStrp.style.marginLeft=(0-(stripWdth-winSz))+'px';
			currPos=(0-(stripWdth-winSz));
		} else {
			imgStrp.style.marginLeft=currPos-13+'px';
			capStrp.style.marginLeft=currPos-13+'px';
			currPos=currPos-13;
		}
		window.setTimeout('scrollLpR()',9);
	}
}
function rtg() {
	getWinSz();
	imgStrp=document.getElementById('imgStrip');
	capStrp=document.getElementById('capSpc');
}
