﻿// JScript File

function gridCheck(checkboxName, state)
{
	var re;
	var elm;
	var i;

	//re = new RegExp(":" + checkboxName + "$");  //generated control name starts with a colon
	re = new RegExp(checkboxName);
	
	for(i = 0; i < document.forms[0].elements.length; i++) {
		elm = document.forms[0].elements[i];
	
		if (elm.type == "checkbox") {
			if (re.test(elm.name)) {
			    elm.checked = state;
			}
		}
	}	
}

function openWindow(url, width, height, resizable, scroll, status)
{
    var top,left;
	left=(screen.width-width)/2;
	top=(screen.height-height)/2;
	
	var settings = "width=" + width + ",height=" + height + ",scrollbars=" + scroll + ",status=" + status + ",resizable=" + resizable + ",left=" + left + ",top=" + top;
	
    window.open(url, "", settings)
}


