function openwindow(where, w, h, menu, location, scroll, toolbar, status, screenX, screenY) {
	var win = window.open(where, 'ChildWin', 'dependent=no,height=' + h + ',width=' + w + ',menubar=' + menu + ',location=' + location + ',scrollbars=' + scroll + ',toolbar=' + toolbar + ',status=' + status + ',screenX=' + screenX + ',screeny=' + screenY + ',left=' + screenX + ',top=' + screenY);
}

function openWin(oLink, w, h, menu, location, scroll, toolbar, status, screenX, screenY) {
	
	if (screen.width < w) {
		w = screen.width;
		scroll = 1;
	}
	
	if (screen.height < h) {
		h = screen.height;
		scroll = 1;
	}
	
	window.open(oLink.href, 'ChildWin', 'dependent=no,height=' + h + ',width=' + w + ',menubar=' + menu + ',location=' + location + ',scrollbars=' + scroll + ',toolbar=' + toolbar + ',status=' + status + ',screenX=' + screenX + ',screeny=' + screenY + ',left=' + screenX + ',top=' + screenY);
	return false;
}

/* Shared library functions */

function getElement(sId) {
	if (document.layers)
		return document.layers[sId];
	else if (document.all)
		return document.all[sId];
	else if (document.getElementById)
		return document.getElementById(sId);
}

Array.prototype.search = function(y) {
	for (x in this) {
		if (this[x] == y) {
			return true; 
		}
	}
	return false;
}

/* Fragment jumping functions */

function frag_init() {

	for (i in document.links) {
		if (document.links[i].hash) {
			var sHash = document.links[i].hash.substring(1);
			if (!_FADE_EXCLUDE.search(sHash)) {
				var sFunct = "jumpTo('" + sHash + "')";
				var fFunct = new Function(sFunct);
				
				document.links[i].onclick = fFunct;
			}
		}
	}
}

function jumpTo(sHash) {
	waitToFade(sHash);
	return true;
}

function waitToFade(sId) {
	setTimeout("fadeIn(" + _FADE_COLORS.length + ", '" + sId + "', '')", 250);
}

function fadeIn(iCurrIdx, sId, origColor) {

	oElem = getElement(sId);

	if (iCurrIdx == _FADE_COLORS.length) {
		origColor = oElem.style.backgroundColor;
	}
	
	if (iCurrIdx > 0) {
		oElem.style.backgroundColor = '#' + _FADE_COLORS[iCurrIdx - 1];
		setTimeout("fadeIn(" + (--iCurrIdx) + ",'" + sId + "', '" + origColor + "')", 200);
	} else {
		oElem.style.backgroundColor = origColor;
	}
}