/**
 * Sets/unsets the pointer in browse mode
 *
 * @param   object   the table row
 * @param   object   the color to use for this row
 *
 * @return  boolean  whether pointer is set or not
 */
function setPointer(theRow, thePointerColor)
{
    if (typeof(theRow.style) == 'undefined' || typeof(theRow.cells) == 'undefined') {
        return false;
    }

    var row_cells_cnt           = theRow.cells.length;
    for (var c = 0; c < row_cells_cnt; c++) {
        theRow.cells[c].bgColor = thePointerColor;
    }

    return true;
} // end of the 'setPointer()' function


// Spawn a popup window using the given url, optional window name, and size
// centering near the refposx and refposy on screen.
function popupwin(URL,windowname, sizex, sizey, refposx, refposy)
{
	var left, top;

	if ( IsBlank( windowname ) )
    {	day = new Date();
		id = day.getTime();
        windowname = "page" + id;
    }
    if ( IsBlank( refposx ) )
	{	// Center if no provided coordinate
    	left = ((screen.width - sizex) / 2);
    	top = ((screen.height - sizey) / 2);
    }
    else
    {	left = refposx;
    	top = refpoxy;
    }

    var remote =window.open(URL, windowname,
    	 "'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0," +
         "width=" + sizex + ",height=" + sizey + "," +
         "left = " + left + ",top = " + top + "'");
    var remote = eval("window.open(URL, '" + windowname +
    	 "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=" +
         sizex + ",height=" + sizey + ",left = " + left + ",top = "+top+"');");
	if (remote.opener == null) // if something went wrong
	    remote.opener = window;
    remote.opener.name = window.name;
    remote.focus();

	return remote;
}
// Default popup
function popup(URL)
{
	popupwin(URL, "popup", 250, 250, null, null);
}

function $() {
	var elements = [];
	for (var i = 0; i < arguments.length; i++) {
		var element = arguments[i];
		if (typeof element == 'string'){
			element = document.getElementById(element);
		}
		if (arguments.length == 1){
			return element;
		}
		elements.push(element);
	}
	return elements;
}

// toggle( parentElementToToggle1, [parentElementToToggle2...] ) - Visibility toggler
function toggle() {
	for ( var i=0; i < arguments.length; i++ ) {
		$(arguments[i]).style.display = ($(arguments[i]).style.display != 'none' ? 'none' : '' );
	}
}

// itoggle( elementID, imageBefore, imageAfter ) - Image toggler
function itoggle() {
	$(arguments[0]).src = ($(arguments[0]).src != arguments[1] ? arguments[1] : arguments[2]);
}


/*
var userAgent=navigator.appName + " " + navigator.appVersion;
var agentInfo=userAgent.substring(0, 12);
if(agentInfo >= "Netscape 4.0")
{
window.captureEvents(Event.MOUSEMOVE);
// Logo animation
var yBase = window.innerHeight/2;
var xBase = window.innerWidth/2;
var delay = 15;
var yAmpl = 10;
var yMax = 40;
var step = .2;
var ystep = .5;
var currStep = 0;
var tAmpl=1;
var Xpos = 50;
var Ypos = 50;
var j = 0;

function MoveHandler(evnt) {
  Xpos = evnt.pageX ;
  Ypos = evnt.pageY ;
}

window.onMouseMove = MoveHandler;

function animateLogo() {
  yBase = window.innerHeight/4 ;
  xBase = window.innerWidth/4;
  for ( j = 0 ; j < 3 ; j++ ) {
    document.layers[j].top = Ypos +

Math.cos((20*Math.sin(currStep/(20+j)))+j*70)*yBase*(Math.sin(10+currStep/10)+0.2)*Math.cos((currStep + j*25)/10);
    document.layers[j].left =Xpos +

Math.sin((20*Math.sin(currStep/20))+j*70)*xBase*(Math.sin(10+currStep/(10+j))+0.2)*Math.cos((currStep + j*25)/10);
  }
  currStep += step;
  setTimeout("animateLogo()", delay) ;
}
animateLogo()
}

*/
