// Forrest Gump, a.s. (c) 1996-2002

// window status function
function ws(txt) {
	window.status = txt;
	return true;
}

// open new win func
function openWin( name, path, width, height ) {
	var win = window.open(path, name,'scrollbars=yes,resizable=yes,resize=no,width='+width+',height='+height+',screenX='+getCenterW(width)+',screenY='+getCenterH(height)+',top='+getCenterH(height)+',left='+getCenterW(width) );
	win.focus();
	return win;
}
function openHardWin( name, path, width, height ) {
	var win = window.open(path, name,'scrollbars=no,resizable=no,resize=no,width='+width+',height='+height+',screenX='+getCenterW(width)+',screenY='+getCenterH(height)+',top='+getCenterH(height)+',left='+getCenterW(width)+',locationbar=no,directories=no' );
	win.focus();
	return win;
}

function getCenterW(width) {
	return parseInt( eval( (screen.availWidth-parseInt(width))/2 ) );
}

function getCenterH(height) {
	return parseInt( eval( (screen.availHeight-parseInt(height))/2 ) );
}

// call menu frame rollover
function sectionActive( sec )	{
	for (i=1;i<8;i++)	{
		parent.frames.menu.sc.set(i);
	}
	parent.frames.menu.sc.set(sec,'act');
	parent.frames.menu.mn.dis(sec);
}

// rollover object
function rollOver ( path, name, first, last )	{
	// properties
	this.path = path;
	this.name = name;
	this.extension = "gif";
	this.first = first;
	this.last = last;
	this.active = first-1;
	// methods
	this.preloadImages = preloadImages;
	this.preload = preload;
	this.roll = roll;
	this.set = set;
	this.dis = dis;
}
// rollover public method
function preloadImages( ext ) {
	var nameOver = (null!=ext)?'_'+ext:'';
	for (num=this.first; num<=this.last; num++) {
		this.preload( this.name + '_' + num + nameOver );
	}
}

function preload(imgSrc) {
	if (document.images) {
		eval(imgSrc+' = new Image()');
		eval(imgSrc+'.src = "' +this.path + '/' + imgSrc + '.' + this.extension + '"');
	}
}
// rollover public method - set active item
function set (num,over,pic) {
	this.active = num+1;
	this.roll(num,over,pic);
	this.active = num;
}
// rollover public method - disable item
function dis (num,over,pic) {
	this.active = num;
}
// rollover public method - roll item
function roll(num,over,pic) {
	pic = (null != pic)?pic:num;
	over = (null != over)?over:'';
	if (num == this.active)	{
		return false;
	}
	if (document.images) {
		var imgObj;
		if (over != '') {
			imgObj = this.name + '_' + num + '_' + over;
		}
		else {
			imgObj = this.name + '_' + num;
		}
		var imgName = this.name + '_' + pic;
		document.images[imgName].src = eval(imgObj+".src");
	}
}
