/***********************************************************************
*  FAMILIES.JS
*
*  by Brent Gustafson - (C) 2003 walkerart.org
***********************************************************************/


function popup(url,width,height) {
	var properties = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=" + width + ",height=" + height;
	var myPopup = window.open(url, "myPopup", properties);
	myPopup.focus();
}


/***********************************************************************
* ASM SCROLLER 3.0 - (c) 2000-2003 Brent Gustafson, Walker Art Center
*
* Original script from http://assembler.org
***********************************************************************/

/** The only code you should ever need to change here are the following 2 vars **/
var newsId = new Array("leftCol", "hilites");	//name of the news div
var speed = new Array(7,5);	//speed at which the news scrolls

var mutex = new Array();
var yplace = new Array();
var ymax = new Array();
var ymin = new Array();
var xplace = new Array();
var newsHeight = new Array();
var newsClipId = new Array();

for (i=0;i<newsId.length;i++) {
	newsClipId[i] = newsId[i] + "Clip";
	mutex[i] = yplace[i] = ymax[i] = ymin[i] = xplace[i] = newsHeight[i] = 0;
}

function shiftTo(obj, x, y) {
	obj.style.left = x + "px";
	obj.style.top = y + "px";
}

function getObject(obj) {
	var theObj = eval("document.getElementById(\"" + obj + "\")");
	return theObj;
}

function getItem(item) {
	for (i=0;i<newsId.length;i++) {
		if (item == newsId[i]) return i;
	}
}

function scrollUp(n) {
  if (mutex[n] == 1) {
    var theObj = getObject(newsId[n]);
    if (yplace[n] < ymax[n]) {
      yplace[n] = yplace[n] + speed[n];
      if (yplace[n] > ymax[n]) yplace[n] = ymax[n];
      shiftTo(theObj, xplace[n], yplace[n]);
      setTimeout("scrollUp(" + n + ")",25);
    }
  }
}
  
function scrollDown(n) {
  if (mutex[n] == 2) {
    var theObj = getObject(newsId[n]);
    if (yplace[n] > ymin[n]) {
      yplace[n] = yplace[n] - speed[n];
      if (yplace[n] < ymin[n]) yplace[n] = ymin[n];
      shiftTo(theObj, xplace[n], yplace[n]);
      setTimeout("scrollDown(" + n + ")",25);
    }
  }
}

function scrollIt(item, dir, msg) {
	var n = getItem(item);
	if (msg) window.status = msg;
  mutex[n] = dir;
  if (mutex[n] == 1) scrollUp(n);
  else if (mutex[n] == 2) scrollDown(n);
}

function scrollInit() {
	for (i=0;i<newsId.length;i++) {
		var theObj = getObject(newsClipId[i]);
		newsHeight[i] = parseInt(theObj.offsetHeight);
		theObj = getObject(newsId[i]);
		ymin[i] = (parseInt(theObj.offsetHeight) - newsHeight[i]) * -1;
	}
}


/***********************************************************************
* END OF LINE
***********************************************************************/

function funswap(curLink,number){
	document.getElementById("rolled").style.display = "block";
	document.online_fun.src = [curLink];
	document.getElementById('funinfo').innerHTML = desc[number] + " ";
}

function hideroll(){
	document.getElementById("rolled").style.display = "none";
}