var arrSections = new Array("", "General Survey", "Detailed Survey", "Compounding Process", "Employee Training", "Facility Process", "TPN/ACD", "CSP Handling, Storage, and Education", "Quality Assurance", "Security and Loss Prevention");

function goSurvey(pint, pstr){
	if (document.getElementById("actionForm")){
		var frm = document.getElementById("actionForm");
		frm.fid.value = pint;
		frm.fname.value = pstr;
		frm.submit();
	}
}

function goReport(pint, pstr){
	if (document.getElementById("reportForm")){
		var frm = document.getElementById("reportForm");
		frm.fid.value = pint;
		frm.fname.value = pstr;
		frm.submit();
	}
}

function goWord(pint, pstr){
	if (document.getElementById("wordForm")){
		var frm = document.getElementById("wordForm");
		frm.fid.value = pint;
		frm.fname.value = pstr;
		frm.submit();
	}
}

function goExcel(pint, pstr){
	if (document.getElementById("excelForm")){
		var frm = document.getElementById("excelForm");
		frm.fid.value = pint;
		frm.fname.value = pstr;
		frm.submit();
	}
}

function goFacAgg(pint, pstr){
	if (document.getElementById("facAggForm")){
		var frm = document.getElementById("facAggForm");
		frm.fid.value = pint;
		frm.fname.value = pstr;
		frm.submit();
	}
}

function goAggReport(){
	if (document.getElementById("aggForm")){
		var frm = document.getElementById("aggForm");
		frm.submit();
	}
}

function goHome(){
	location.href = "/home.asp";
}

function changeStatus(pint){
	if (document.getElementById("status" + pint)){
		document.getElementById("status" + pint).value = 1;
	}
}

function exportToExcel() {
	strConfirm =	"The Excel report requires Excel XP (2002) or newer. If you do not meet this requirement, click 'Cancel'.\n" + 
		"\n" +
		"After you click 'OK', the report will generate, then you will be presented with two options:\n" +
		"\n" +
		"     Open:\tClick this to immediately view the spreadsheet in your browser. You may then save the file to\n" +
		"     \tyour computer by clicking 'File' -> 'Save As' in the spreadsheet window.\n" +
		"\n" +
		"     Save:\tClick this to choose where you would like to save the spreadsheet. You will then need to launch\n" +
		"     \tExcel and open the report from there.";

	if (confirm(strConfirm)) {
		//--Customize-----
		var page	= "/excelReport.asp";
		var name	= "excel";
		var width	= 800;
		var height	= 450;
		//--End-----------
		
		var left;
		var top;
		var settings;
		var win;
		
		left	= (screen.width - width)	/ 2;
		top		= (screen.height - height)	/ 2;

		settings = "height=" + height + ",width=" + width + ",top=" + top + ",left=" + left;
		settings += ",scrollbars=yes,toolbar=no,location=no,status=no,menubar=yes,resizable=yes,dependent=no";
		
		win = window.open(page, name, settings)
		win.focus();
	}
}
			
function exportToWord() {
	strConfirm =	"The Word report requires Word 2000 or newer. If you do not meet this requirement, click 'Cancel'.\n" + 
					"\n" +
					"Click 'OK' to generate the report as a Word document. You will be presented with two options:\n" +
					"\n" +
						"     Open:\tClick this to immediately view the document in your browser. You may then save the file to\n" +
						"     \tyour computer by clicking 'File' -> 'Save As' in the document window.\n" +
						"\n" +
						"     Save:\tClick this to choose where you would like to save the document. You will then need to launch\n" +
						"     \tWord and open the report from there.";
	
	if (confirm(strConfirm)) {
		//--Customize-----
		var page	= "/wordReport.asp";
		var name	= "word";
		var width	= 800;
		var height	= 450;
		//--End-----------
		
		var left;
		var top;
		var settings;
		var win;
		
		left	= (screen.width - width)	/ 2;
		top		= (screen.height - height)	/ 2;

		settings = "height=" + height + ",width=" + width + ",top=" + top + ",left=" + left;
		settings += ",scrollbars=yes,toolbar=no,location=no,status=no,menubar=yes,resizable=yes,dependent=no";
		//alert("calling the window "+page+" name "+ name+" settings "+ settings);
		win = window.open(page, name, settings)
		win.focus();
	}
}