var browserOK = false;
var inExplorer = false;
var scrollTime = 20;
var loop, timer;

function openNewWindow(url)
{
	window.open(url,"3RD_FLOOR_MINISTRIES")
}

function openVerseWindow(url)
{
	//ow = (screen.availWidth - 450)/2);
	//oh = (screen.availHeight - 190)/2) - 50;
	ow = 100
	oh = 200

	window.open(url,"3RD_FLOOR_MINISTRIES","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,width=450,height=300,resizable=yes,left="+ow+",top="+oh)
}

function openImageWindow(url, width, height)
{
	//ow = (screen.availWidth - width)/2);
	//oh = (screen.availHeight - height)/2) - 50;
	ow = 100
	oh = 200

	window.open(url,"3RD_FLOOR_MINISTRIES","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,width="+width+",height="+height+",resizable=0,left="+ow+",top="+oh)
}

function getBrowser()
{
	if (navigator.appName.indexOf("Netscape") != -1) {return "Netscape";}
	if (navigator.appName.indexOf("Explorer")!= -1) {return "Explorer";}
	return "Unknown";
}

function getBrowserVersion()
{
	return parseFloat(navigator.appVersion);
}

function checkBrowser()
{	
	var browserName = getBrowser();
	var browserVersion = getBrowserVersion();

	if (browserName == "Explorer")
	{
		inExplorer = true;
	}

	if (browserVersion >= 4)
	{
		browserOk = true;
	}
}

function createDivObj(obj,cont)
{	
	if (inExplorer)
	{
		this.css = document.all[obj].style;
		this.scrollHeight=document.all[obj].offsetHeight;
		this.clipHeight=document.all[obj].offsetHeight;
		this.visibility=document.all[obj].visibility;
	}
	else
	{
		if (cont != '')
		{
			cont = 'window.document.' + cont + '.';
		}
		else
		{
			cont = 'window.';
		}
		this.css = eval(cont + 'document.' + obj);
		this.scrollHeight = this.css.document.height;
		this.clipHeight = this.css.clip.height;
		this.visibility = this.css.visibility;
	}
	
	this.negativeScroll = negativeScroll;
	this.positiveScroll = positiveScroll;
	this.reposition = reposition;
	this.x = 0;
	this.y = 0;

	eval (this.obj + ' = this');
	return this;
}

function moveDiv()
{
	if (inExplorer)
	{
		containerTop = (document.body.clientHeight/2)-135;
		containerLeft = (document.body.clientWidth/2)-39;
	}
	else
	{
		containerTop = (window.innerHeight/2)-135;
		containerLeft = (window.innerWidth/2)-39;
	}
	if (containerTop < 120)
	{
		containerTop = 117;
	}
	if (containerLeft < 336)
	{
		containerLeft = 336;
	}
	Container.reposition(containerLeft, containerTop);
}

function moveWideDiv()
{
	if (inExplorer)
	{
		containerTop = (document.body.clientHeight/2)-100;
		containerLeft = (document.body.clientWidth/2)-320;
	}
	else
	{
		containerTop = (window.innerHeight/2)-100;
		containerLeft = (window.innerWidth/2)-320;
	}
	if (containerTop < 184)
	{
		containerTop = 184;
	}
	if (containerLeft < 70)
	{
		containerLeft = 70;
	}
	Container.reposition(containerLeft, containerTop);
}

function reposition(x,y)
{
	this.x=x;
	this.y=y;
	this.css.left=this.x
	this.css.top=this.y
}

function positiveScroll(scrollUnit)
{
if (this.y < 0)
	{
		this.reposition(0, this.y+scrollUnit);
		if (loop) setTimeout (this.object + ".positiveScroll("+scrollUnit+")",scrollTime);
	}
}

function negativeScroll(scrollUnit)
{
	if (this.y > Container.clipHeight - this.scrollHeight)
	{
		this.reposition (0, this.y+scrollUnit);
		if (loop) setTimeout (this.object + ".negativeScroll("+scrollUnit+")",scrollTime);
	}
}

function scrollDiv(scrollUnit)
{
	loop = true;
	if (scrollUnit > 0) Text.positiveScroll(scrollUnit);
	else Text.negativeScroll(scrollUnit);
}

function stopDiv()
{
	loop = false;
	if (timer) clearTimeout(timer);
}