document.attachEvent("onresize", "resizer()");

function init()
	{
	if (!brow.dom)
		return;
	writeMenus();
	}

function resizer()
	{
	if (winMenu && winMenu.activeButton)
		{
		resetButton(winMenu.activeButton);
		winMenu.activeButton = null;
		}
	}

proto.clipOpen = function(mode){
	clearTimeout(this.timer);
	if(mode){
		if(this.clip[3] > 0){
			this.clippedOpen = 1;
			this.clipTo(0, this.w, this.clip[2], this.clip[3] - 20);
			this.timer = setTimeout('document.dhtml["'+this.id+'"].clipOpen(1)', 50);
		};
	}else{
		if(this.clip[3] < 100){
			this.clippedOpen = 0;
			this.clipTo(0, this.w, this.clip[2], this.clip[3] + 20);
			this.timer = setTimeout('document.dhtml["'+this.id+'"].clipOpen(0)', 50);
		};
	};
};

function setCookie(CookieName,ValueString)
	{
	now = new Date();
	years = now.getYear()+1910;
	Expire = new Date(years,11,31);
	ValueString = escape(ValueString);
	document.cookie = CookieName+"="+ValueString+"; path=/; expires="+Expire.toGMTString();
	}

function enlargeImage(filename)
	{
	var myWindow = window.open(filename,'carville_image','resize=1,resizable=yes,toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,copyhistory=0,width=500,height=500,top=50,left=50');
	myWindow.focus();
	return false;
	}

var speed = 1;
var move = 1;
var row_height = 86;
var win_height = row_height * 4;
var t = 0;
var rows;
var max;
var scrollTop;

var userAgent = window.navigator.appVersion.toUpperCase();
if (userAgent.indexOf('MSIE 6.0') > -1)
	{scrollTop = 17;}
else if (userAgent.indexOf('MSIE 7.0') > -1)
	{scrollTop = 120;}
else
	{scrollTop = 120;}

function f_clientHeight() {
	return f_filterResults (
		window.innerHeight ? window.innerHeight : 0,
		document.documentElement ? document.documentElement.clientHeight : 0,
		document.body ? document.body.clientHeight : 0
	);
}
function f_filterResults(n_win, n_docel, n_body) {
	var n_result = n_win ? n_win : 0;
	if (n_docel && (!n_result || (n_result > n_docel)))
		n_result = n_docel;
	return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result;
}



function moveIt() {
	var m = document.getElementById('menu');
	t = t + (speed * move);

	if (t > max) {t = 0;}
	if (t < 0  ) {t = max;}

	//window.status=t + '/' + max;

	m.style.clip = 'rect(' + (t) + 'px 250px ' + (t+win_height) + 'px 0px)';
	m.style.top = (scrollTop-t) + 'px';
	
	//if(document.documentElement.scrollHeight > 500) { document.documentElement.scrollHeight = 500; }
	
	window.status = document.documentElement.scrollHeight;	
	
}

function timer()
	{
	max = rows * row_height;
	if (document.getElementById)
		{setInterval('moveIt()',50);}
	}
