<!--

function confirmDelete(url) {

	var agree = confirm("You are about to delete this report, this action is irreversable. Are you sure you want to continue?\n\nClick 'Ok' to continue");
	if (agree) {
		window.location.href = url;
	} else {
		// nothing
	}
}

function confirmExport(url) {

	var agree = confirm("You are about the export these results to Acrobat PDF file format.\n\nPlease Note:\n1) This may take a few minutes depending on your connection speed.\n2) We limit the number of exported reports to 50 items.\n\n\nClick 'Ok' to proceed.");
	if (agree) {
		window.location.href = url;
	} else {
		// nothing
	}
}

function checkLength(ref, max, div)
{
	if (ref.value.length > max) {
		var orig_string = ref.value;
		crop = orig_string.substring(0, max);
		ref.value = crop;
	}
	rewriteDiv(max-ref.value.length, div);
}

function rewriteDiv(value, div) {
	value = "Chars Left: "+value;
	if (document.getElementById) {
		document.getElementById(div).innerHTML = value;
	} else if (document.all) {
		document.all[div].innerHTML = value;
	} else if (document.layers) {
		document.layers[div].document.open();
		document.layers[div].document.write(value);
		document.layers[div].document.close();
	} else {
		// nothing
	}
}

function toggleDiv(DivID) {
	if (isVisible(DivID)) {
		turnOff(DivID);
	} else {
		turnOn(DivID);
	}
}

function turnOff(DivID) {
	if (document.getElementById) { //gecko(NN6) & IE 5+
		document.getElementById(DivID).style.visibility = "hidden";
		document.getElementById(DivID).style.display = "none";
	} else if (document.all) { // IE 4+
		document.all[DivID].style.visibility = "hidden";
		document.all[DivID].style.display = "none";
	} else if (document.layers) { // NS4+
		document.layers[DivID].visibility = "hide";
		document.layers[DivID].display = "none";
	} else {
		// nothing
	}
}

function turnOn(DivID) {
	if (document.getElementById) { //gecko(NN6) & IE 5+
		document.getElementById(DivID).style.visibility = "visible";
		document.getElementById(DivID).style.display = "block";
	} else if (document.all) { // IE 4+
		document.all[DivID].style.visibility = "visible";
		document.all[DivID].style.display = "block";
	} else if (document.layers) { // NS4+
		document.layers[DivID].visibility = "show";
		document.layers[DivID].display = "block";
	} else {
		// nothing
	}
}

function isVisible(DivID) {
	if (document.getElementById) { //gecko(NN6) & IE 5+
		if (document.getElementById(DivID).style.visibility == "visible") {
			return true;
		} else {
			return false;
		}
	} else if (document.all) { // IE 4+
		if (document.all[DivID].style.visibility = "visible") {
			return true;
		} else {
			return false;
		}
	} else if (document.layers) { // NS4+
		if (document.layers[DivID].visibility = "show") {
			return true;
		} else {
			return false;
		}
	} else {
		// nothing
	}
}

//-->