// array to hold instances of child windows
if (cmsPopup=='undefined');
	{var cmsPopup = new Array();}

function showcenteredpopup(url,title,wsize,hsize,rsize,scroll,status,toolbar,location)
{
// get top and left positions based on user's resolution so hint window is centered.
var leftpos = (window.screen.width/2) - ((wsize/2) + 10); // half the screen width minus half the new window width (plus 5 pixel borders).
var toppos = (window.screen.height/2) - ((hsize/2) + 50); // half the screen height minus half the new window height (plus title and status bars).
var popup=window.open(url,title,'height=' + hsize + ',width=' + wsize + ',left=' + leftpos + ',top=' + toppos + ',screenX=' + leftpos + ',screenY=' + toppos + ',resizable=' + rsize + ',scrollbars=' + scroll + ',status=' + status + ',toolbar=' + toolbar + ',location=' + location);
} 
	
function showselectorpopup(url,title,wsize,hsize,rsize,scroll,status,toolbar,location,id_obj,str_obj)
{
var id_objvalue=id_obj.value;
var id_objname=id_obj.name;
var id_objform=id_obj.form.name;

var str_objvalue=str_obj.value;
var str_objname=str_obj.name;
var str_objform=str_obj.form.name;

url += '?requestTimeout=60&formname='+ id_objform + '&IDformobj=' + id_objname + '&STRformobj=' + str_objname;
if (id_objvalue.length != 0) url+='&recordID=' + id_objvalue;

// get top and left positions based on user's resolution so window is centered.
var leftpos = (window.screen.width/2) - ((wsize/2) + 10); // half the screen width minus half the new window width (plus 5 pixel borders).
var toppos = (window.screen.height/2) - ((hsize/2) + 50); // half the screen height minus half the new window height (plus title and status bars).
//launch popup with specified params
cmsPopup[cmsPopup.length]=window.open(url,title,'height=' + hsize + ',width=' + wsize + ',left=' + leftpos + ',top=' + toppos + ',screenX=' + leftpos + ',screenY=' + toppos + ',resizable=' + rsize + ',scrollbars=' + scroll + ',status=' + status + ',toolbar=' + toolbar + ',location=' + location);
}

// this function selects the pre-selected checkboxes on the page to be opened
function setselected(obj,fromobj)
{
var idarray=fromobj.split(',');
for (i=0;i<idarray.length;i++)
	{
	for (j=0;j<obj.length;j++)
		{
		if (obj[j].value.split('|')[0]==idarray[i])
			obj[j].checked=true;
		}
	}
}
