//BROWSER SNIFFER

function Is() {
    this.ie4 = document.all && !document.getElementById;
	this.ns4 = document.layers;
	this.ie5 = document.all && document.getElementById;
	this.ns6 = document.getElementById && !document.all;
}

var is = new Is()

if(is.ns4) {
	doc = "document";
	sty = "";
	htm = ".document"
}
else if(is.ie4 || is.ie5) {
	doc = "document.all";
	sty = ".style";
	htm = ""
}
else if(is.ns6) {
	doc = "document.getElementById(";
	sty = ").style";
	htm = ""
}

//PRELOADER
function preLoad() 
{


}

function showLayer(layer)
{
	showLyr = eval(doc + '["' + layer + '"]' + sty);
	showLyr.visibility = "visible";
}

function hideLayer(layer)
{
	hideLyr = eval(doc + '["' + layer + '"]' + sty);
	hideLyr.visibility = "hidden";
}

var win=null;
function NewWindow(mypage, name)
{
	settings='top=0,left=0,scrollbars=yes,location=yes,directories=yes,status=yes,menubar=yes,toolbar=yes,resizable=yes';
	win=top.open(mypage, name);
}

var clipTop = 0;
//var clipWidth = 212;
var clipBottom = 160;
//var topper = 300;
var lyrheight = 0;
function prepLyr()
{
	textLyr = eval(doc + '["text"]' + sty);
	if (is.ns4)
	{
		lyrheight = textLyr.clip.bottom;
		lyrheight += 20;
		textLyr.clip.top = clipTop;
		textLyr.clip.left = 0;
		textLyr.clip.right = 212;
		textLyr.clip.bottom = clipBottom;
	}
	else
	{
		if(is.ns6)
			lyrheight = document.getElementById("text").offsetHeight;
		else
			lyrheight = text.offsetHeight;
			
		textLyr.clip = 'rect('+clipTop+' 212 '+clipBottom+' 0)'
	}
	textLyr.visibility = "visible";
}

var loop = false;
//var direction = "up";
var timer1 = null;
function scroll(dir)
{
	textLyr = eval(doc + '["text"]' + sty);
	//lyrheight = text.offsetHeight;
    direction = dir;
    speed = 1;
    var y_pos = parseInt(textLyr.top);
    //var x_pos = parseInt(textLyr.left);
	if(direction == "down") 
	{
		if(clipBottom > lyrheight)
			return;
		textLyr.top = (y_pos-(speed));
		clipTop += speed;
		clipBottom  += speed;
		if (is.ns4)
		{
			textLyr.clip.top = clipTop;
			textLyr.clip.bottom = clipBottom;
			//alert(textLyr.clip.top);
		}
		else
		{
			clipstring = 'rect('+clipTop+' 212 '+clipBottom+' 0)';
			textLyr.clip = clipstring;
		}
		clearTimeout(timer1);
		timer1 = setTimeout("scroll(direction,speed)", 2);
	} 
	else if(direction == "up") 
	{
		if(y_pos > 136)
			return;
		textLyr.top = (y_pos+(speed));
		clipTop -= speed;
		clipBottom  -= speed;
		if (is.ns4)
		{
			textLyr.clip.top = clipTop;
			textLyr.clip.bottom = clipBottom;
			//alert(textLyr.clip.top);
		}
		else
		{
			clipstring = 'rect('+clipTop+' 212 '+clipBottom+' 0)';
			textLyr.clip = clipstring;
			//textLyr.top = topper;
		}
		clearTimeout(timer1);
		timer1 = setTimeout("scroll(direction,speed)", 2);
	}
	return;
}	

function stopScroll()
{
	if (timer1) clearTimeout(timer1);
}

var step=1
var whichimage=1
function slideit(){
	if (!document.images)
		return
	//If the browser is IE 4.x
	if (document.all)
		slide.filters.blendTrans.apply()
	if(!is.ns4)
		document.slide.src=eval("image"+step+".src")
	//If the browser is IE 4.x
	if (document.all)
		slide.filters.blendTrans.play()
	whichimage=step
	if (step<3)
		step++
	else
		step=1
	setTimeout("slideit()",5000)
}

