//Text Controller & Heading placer

var titletxtwidth=325;

function PositionTitle(){
	var txtObj=eval(doc+'["txttitle"]'+sty);
	var newleft;
	if(screen_width>titletxtwidth)newleft=(screen_width/2)-(titletxtwidth/2);
	else newleft=0;
	txtObj.left=newleft;
	txtObj.visibility="visible";
}

function TextControl(defaultblock, toppxposition, pixelstep){
	this.currentblock=defaultblock;	//default or home page text block is a text value
	this.top_y=toppxposition;	//the 'y' position for start of txt (as in x,y)
	this.step=pixelstep;		//the amount to move the text up or down in an iteration
	this.uploop=false;
	this.downloop=false;

	this.SwitchBlock=SwitchTextBlock;
	this.ScrollUp=ScrollTextUp;
	this.ScrollDown=ScrollTextDown;
	this.Top=ScrollTextTop;
};

function SwitchTextBlock(blockname){	//block==the css name of the divblock
	var oldObj=eval(doc+"['"+this.currentblock+"']"+sty);
	oldObj.visibility='hidden';
	var newObj=eval(doc+"['"+blockname+"']"+sty);
	this.Top();		//to set page back to start poistion
	newObj.visibility='visible';
	this.currentblock=blockname;
}
function ScrollTextUp(){
	if(this.uploop==true){
		var textBlock=eval(doc+ "['"+this.currentblock +"']"+sty);
		var cur_pos=parseInt(textBlock.top);
		var new_pos=cur_pos-this.step;
		textBlock.top=new_pos;
		setTimeout("txtcontrol.ScrollUp();", 50);
	}
};
function ScrollTextDown(){
	if(this.downloop==true){	//or else it wont stop
		var textBlock=eval(doc+ "['"+this.currentblock +"']"+sty);
		var cur_pos=parseInt(textBlock.top);
		var new_pos=0;
		if(cur_pos>(this.top_y - this.step))new_pos=this.top_y;
		else new_pos=cur_pos+this.step;
		textBlock.top=new_pos;
		setTimeout("txtcontrol.ScrollDown();", 50);
	}
};
function ScrollTextTop(){
	var textBlock=eval(doc+ "['"+this.currentblock +"']"+sty);
	textBlock.top=this.top_y;
};


