function limitText(formObj,maxChars) {
	var s = formObj.value;
   	if (s.length >= maxChars) {
   		alert("The description you entered is too long. Please make sure your text, including spaces, is less than "+maxChars);
		formObj.value = s.substring(0,maxChars-1);
	}
}

function openRateList() {
 	var newurl='/proprietor/rates.html';
	popup =	window.open(newurl, "_blank", 'width=500,height=400,dependent=no,resizable=no,toolbar=no,status=no,directories=no,menubar=no,scrollbars=yes',false);
	popup.moveTo(400,200);
}

function openTermspopup(id,playMode) {
 	var newurl='/splash/terms.html';
	popup =	window.open(newurl, "_blank", 'width=450,height=400,dependent=no,resizable=no,toolbar=no,status=no,directories=no,menubar=no,scrollbars=0',false);
	popup.moveTo(300,200);
}

function openHelppopup(id,playMode) {
 	var newurl='/comber/help.html';
	popup =	window.open(newurl, "_blank", 'width=600,height=400,dependent=no,resizable=yes,toolbar=no,status=no,directories=no,menubar=no,scrollbars=yes',false);
	popup.moveTo(300,200);
}

function openContextHelpPopup(screen) {
 	var newurl='/comber/help/' + screen + '.html';
	popup =	window.open(newurl, "_blank", 'width=350,height=700,dependent=no,resizable=no,toolbar=no,status=no,directories=no,menubar=no,scrollbars=yes',false);
	popup.moveTo(300,200);
}


function openManualDownloadPopup() {
 	var newurl='/comber/equipment/manualinstructions.html';
	popup =	window.open(newurl, "_blank", 'width=500,height=400,dependent=no,toolbar=no,status=no,directories=no,menubar=no,scrollbars=yes',false);
	popup.moveTo(100,100);
}

function openStatsPolicyPopup() {
	var newUrl = '/policy.html';
	popup = window.open(newUrl, "_blank", 'width=450,height=400,dependent=no,resizable=no,toolbar=no,status=no,directories=no,menubar=no,scrollbars=yes', false);
	popup.moveTo(300, 200);
}

function checkAll(parent) {
	var ii = 0;
	var input;
	if (parent == null) parent = document;
	var list = parent.getElementsByTagName("input");
	
	for (ii = 0; ii < list.length; ii++) {
		input = list[ii];
		if (input.type == "checkbox" && !input.disabled) input.checked = true;
	}
}

function unCheckAll(parent) {
	var ii = 0;
	var input;
	if (parent == null) parent = document;
	var list = parent.getElementsByTagName("input");
	
	for (ii = 0; ii < list.length; ii++) {
		input = list[ii];
		if (input.type == "checkbox" && !input.disabled) input.checked = false;
	}
}

function doaction(arg) {
	document.forms[0].action = arg;
	document.forms[0].submit();
}
