function openWindow(name, url, width, height, scrolling)	{
	var left = (screen.width  - width)  / 2;
	var top = (screen.height - height) / 3;
	window.open(url, name, "width="+width+", height="+height+", top="+top+", left="+left+", toolbar=no, location=no, menubar=no, resizable=no, scrollbars="+scrolling);
}
function selectAll(myForm) {
	for (i = 0; i < myForm.elements.length; i++) {
		if (myForm.elements[i].name.substr(0, 2) == 'id') {
			myForm.elements[i].checked = myForm.sample.checked;
		}
	}
}
function changeAction(myForm, action) {
	message = 'Are you sure you want to delete it?';
	myForm.elements[0].value = action;
	if (action.indexOf('delete') == -1) myForm.submit();
	else if (confirm(message)) myForm.submit();
}
function checkSelected(myForm) {
	i = 0;
	flag = false;
	while (i<myForm.elements.length && !flag) {
		if (myForm.elements[i].name.substr(0, 2) == 'id' && myForm.elements[i].checked == true) flag=true;
		i++;
	}
	if (!flag) alert('No object was selected for removal or update!');
	return flag;
}
function showHideAdditionalInfo() {
	var titleObj	= document.getElementById('additionalInfoTitle');
	var infoObj		= document.getElementById('additionalInfo');

	if (infoObj.style.display == 'none') {
		infoObj.style.display		= 'block';
		titleObj.innerHTML			= 'Hide additional info';
	} else {
		infoObj.style.display	= 'none';
		titleObj.innerHTML		= 'Show additional info';
	}
}