	function getReportCategories() {
		return 5;
	}

	function myPopup(url) {
		window.open( url, "report", "status=0, height=350, width=450, resizable=1" );
	}
	
	function setDropDown(elementId) {
		var type = document.getElementById(elementId);
		type.selected = true;
	}
	
    function refreshParent() {
	  if(window.opener.document.forms['categoryList'])
	  	window.opener.document.forms['categoryList'].submit();
    }
	
	function changeCheckboxes() {
		var checkButton = document.getElementById("checkboxbutton");
		
		if(checkButton.value == "Check all:")
			checkAll();
		else if(checkButton.value == "Uncheck all:")
			uncheckAll();
	}
	
	function checkAll() {
		var i = 1;
		var change = false;
		while(document.getElementById("switch"+i) != null) {
			document.getElementById("switch"+i).checked=true;
			change = true;
			i++;
		}
		if(change) {
			document.getElementById("checkboxbutton").setAttribute("value", "Uncheck all:");
		}
			
	}
	
	function uncheckAll() {
		var i = 1;
		var change = false;
		while(document.getElementById("switch"+i) != null) {
			document.getElementById("switch"+i).checked=false;
			change = true;
			i++;
		}
		if(change) {
			document.getElementById("checkboxbutton").setAttribute("value", "Check all:");
		}
	}
	
	function getCheckValues() {
		var c_value = "";
		var launch_popup = false;
		
		// check if there are any report entries
		if(document.reportsList.reportIds) {
		
			// if there are more than one entry (array if more than one)
			if(document.reportsList.reportIds.length) {
				
				// get the entries that has their checkbox checked
				for (var i=0; i < document.reportsList.reportIds.length; i++) {
   					if (document.reportsList.reportIds[i].checked) {
      					c_value = c_value + "reportIds[]=" + document.reportsList.reportIds[i].value + "&";
      					launch_popup = true;
      				}
   				}
			}
			// just one entry
			else {
				//check the checkbox
				if (document.reportsList.reportIds.checked) {
  					c_value = c_value + "reportIds[]=" + document.reportsList.reportIds.value + "&";
  					launch_popup = true;
  				}
			}
			
			// open the popup if any checkboxes were checked
   			if(launch_popup)
   				myPopup('/adminui/handlereport?' + c_value);
   			else
   				Dialogs.alert("No reports were checked!");
		}
		else {
			Dialogs.alert("There are no reports listed!");
		}
	}
