closetime = 0; // Close window after __ number of seconds?

function Start(URL, WIDTH, HEIGHT) {
  windowprops = "left=50,top=50,width=" + WIDTH + ",height=" + HEIGHT;
  preview = window.open(URL, "preview", windowprops);
  if (closetime) setTimeout("preview.close();", closetime*1000);
}

function doPopup() {
  url = "http://www.brainhunter.com/99/popup/index.html";
  width = 450;  // width of window in pixels
  height = 274; // height of window in pixels
  delay = 0;    // time in seconds before popup opens
  timer = setTimeout("Start(url, width, height)", delay*1000);
}

function newWindow2() {
  var newWindow2 = window.open("../html/hover_help.html","New","height=320,width=480,scrollbars=0");
}

CSStopExecution = false;

function CSAction(array) {
	return CSAction2(CSAct, array);
}

function CSAction2(fct, array) {
	var result;
	for (var i=0;i<array.length;i++) {
		if(CSStopExecution) return false;
		var actArray = fct[array[i]];
		var tempArray = new Array;
		for(var j=1;j<actArray.length;j++) {
			if((actArray[j] != null) && (typeof(actArray[j]) == "object") && (actArray[j].length == 2)) {
				if(actArray[j][0] == "VAR") {
					tempArray[j] = CSStateArray[actArray[j][1]];
				}
				else {
					if(actArray[j][0] == "ACT") {
						tempArray[j] = CSAction(new Array(new String(actArray[j][1])));
					}
				else
					tempArray[j] = actArray[j];
				}
			}
			else
				tempArray[j] = actArray[j];
		}
		result = actArray[0](tempArray);
	}
	return result;
}

CSAct = new Object;
CSAg = window.navigator.userAgent; CSBVers = parseInt(CSAg.charAt(CSAg.indexOf("/")+1),10);

function IsIE() { return CSAg.indexOf("MSIE") > 0;}

function CSIEStyl(s) { return document.all.tags("div")[s].style; }

function CSNSStyl(s) { return CSFindElement(s,0); }

function CSFindElement(n,ly) { if (CSBVers < 4) return document[n];
	var curDoc = ly ? ly.document : document; var elem = curDoc[n];
	if (!elem) { for (var i=0;i<curDoc.layers.length;i++) {
		elem = CSFindElement(n,curDoc.layers[i]); if (elem) return elem; }}
	return elem;
}

function CSSetImageURL(action) {
	var img = null;
	if (document.images) {
		if (!IsIE()) img = CSFindElement(action[1],0);
		else img = document.images[action[1]];
		if (img) img.src = action[2];
	}
}

