function checkPause() {
	//Find value of ticker speed
	for (var i=0; i < document.tboptions.rspeed.length; i++) {
   		if (document.tboptions.rspeed[i].checked) {
      		var speed_val = document.tboptions.rspeed[i].value;
      		}
   		}
	//Find pause value of ticker
	for (var i=0; i < document.tboptions.rpause.length; i++) {
   		if (document.tboptions.rpause[i].checked) {
      		var pause_val = document.tboptions.rpause[i].value;
      		}
   		}
	if ((speed_val == "veryfast" || speed_val == "fast"|| speed_val == "medium") && pause_val == "1") {
		alert("Ticker Speed must be set to 'Slow' when the Ticker Pause option is set to 'No Pause'\ror else it's a bit pointless running the toolbar - savvy? ;-)\r\rThe ticker speed will now be reset to 'Slow'.");
		document.tboptions.rspeed[3].checked = true;
		}
	}

//Function used in tb_options.php
function hlfToggleColors(memory) {
	if (document.tboptions.freerolls.checked == true) {
		document.tboptions.hlf[memory].checked = true; // default to green if not used
		}
	else {
		document.tboptions.hlf[0].checked = true;
		}	
	}
	
//Function used in tb_options.php
function hltToggleColors() {
	if (document.tboptions.highlight.value) {
		for (var b = 0; b < document.tboptions.hlt.length; b++)
			document.tboptions.hlt[b].disabled = false;
		}
	else {
		for (var b = 0; b < document.tboptions.hlt.length; b++)
			document.tboptions.hlt[b].disabled = true;
		}	
	}
	
function validateField(field,type) {
	var val = field.value;
	if (!isHex(val) && type == "hex") {
		alert ('Background color must be alpha-numeric 0-9,A-F');
		var ln = val.length - 1;
		val = val.substr(0,ln);
		field.value = val;
		}
	else if (!isNumeric(val) && type == "numeric") {
		alert ('Value must be a whole number in the range 0 - 99999');
		var ln = val.length - 1;
		val = val.substr(0,ln);
		field.value = val;
		}
	}
	
function isHex(txt) {
	return ValidString(txt,'ABCDEFabcdef0123456789');
	}
	
function isNumeric(txt) {
	return ValidString(txt,'0123456789');
	}
	
function ValidString(ChkString,ValidString) {
	for (i=0; i<ChkString.length; i++) {
		if (ValidString.indexOf(ChkString.substring(i,i+1)) == -1) return false;
		}
	return true;
	}
	
function extraOptionsValidation() {
	if (parseInt(document.tboptions.buyinmin.value) > parseInt(document.tboptions.buyinmax.value)) {
		alert("Maximum Buy-in value cannot be greater than Minimum Buy-in value.\r\rPlease correct this and re-submit filters.");
		return;
		}
	}
