<!--//
var num		= "1234567890";
var numPlus	= "1234567890-,. ";
var alpha	= "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
var alphaPlus	= "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-.' ";
var alphaNum	= "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
var alphaNumPlus= "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_,.'@ ";

function logOut() {
	if (!confirm('Are you sure you want to log out?')){
		return false;
		}
	}
function delCol(uid,cid) {
	if (confirm('Are you sure you want to do this?')) {
		if (confirm('Are you REALLY, REALLY sure you want to do this?')) {
			self.location.href= pBaseHref + '/index.cfm?fn=delCol&uid=' + uid + '&cid=' + cid;
			}
		}
	}
function delLink(lid) {
	if (confirm('Are you sure you want to do this?')) {
		self.location.href= pBaseHref + '/index.cfm?fn=delLink&lid=' + lid;
		}
	}
function delComm(comID,colID) {
	if (confirm('Are you sure you want to do this?')) {
		self.location.href= pBaseHref + '/index.cfm?fn=delComm&comID=' + comID +'&colID=' + colID;
		}
	}

function addNew(fName,lFrom,lTo) {
	with (fName) {
		if (lFrom.value != '') {
			if (lTo.length == 6) {
				alert('You already have 6 answers.');
				}
			else {
				var newoption = new Option(lFrom.value, lTo.length, true, true);
				lTo.options[lTo.length] = newoption;
				lFrom.text = null;
				}
			}
		}
	}
function move(what,direction) {
	var moveIt = false;
	with (what) {
		if (options.length > 0) {
			var curIdx = selectedIndex;
			var curValue = new Option(options[curIdx].text, options[curIdx].value, true, true);
			if (direction == 'up') {
				var newIdx = selectedIndex - 1;
				if (curIdx > 0) var moveIt = true;
				}
			else {
				var newIdx = selectedIndex + 1;
				if (curIdx < options.length - 1) var moveIt = true;
				}
			if (moveIt) {
				var newValue = new Option(options[newIdx].text, options[newIdx].value, true, true);
				options[newIdx] = curValue;
				options[curIdx] = newValue;
				selectedIndex = newIdx;
				}
			}
		}
	}
function delItem(what) {
	with (what) {
		var index = selectedIndex;
		if (index > -1) options[index] = null;
		}
	}
function total(what,to) {
	var aList = '';
	with (what) {
		if (length > 0) {
			for (var i = 0; i < length; i++) {
				aList += options[i].text + '|';
				}
			to.value = aList;
			}
		else {
			alert('List Empty.');
			return false;
			}
		}
	}
function getBold(fE) {
	var bT = '';
	var fT = '';
	bT = prompt('Enter text to boldface','');
	if (bT.length > 0) {
		fT = '[b]' + bT + '[/b]';
		fE.value = fE.value + fT;
		}
	}
function getItal(fE) {
	var iT = '';
	var fT = '';
	iT = prompt('Enter text to italicize','');
	if (iT.length > 0) {
		fT = '[i]' + iT + '[/i]';
		fE.value = fE.value + fT;
		}
	}
function getStrike(fE) {
	var sT = '';
	var fT = '';
	sT = prompt('Enter text to strikethrough','');
	if (sT.length > 0) {
		fT = '[s]' + sT + '[/s]';
		fE.value = fE.value + fT;
		}
	}
function getURL(fE) {
	var lH = '';
	var lT = '';
	var fT = '';
	lH = prompt('Enter URL (ex. http://www.google.com/)','');
	if (lH.length > 0) {
		lT = prompt('Enter text to show for link (leave blank to show the URL)','');
		if (lT.length > 0) {
			fT = '[url=' + lH + ']' + lT + '[/url]';
			}
		else fT = '[url]' + lH + '[/url]';
		fE.value = fE.value + fT;
		}
	}
function getIMG(fE) {
	var lH = '';
	var fT = '';
	lH = prompt('Enter URL for image (ex. http://www.myserver.com/myimg.jpg)','');
	if (lH.length > 0) {
		fT = '[img]' + lH + '[/img]';
		fE.value = fE.value + fT;
		}
	}
function lenTest(element,iMin) {
	lMin = 1;					// default minimum length (1)
	msg = 'a required field is blank.';		// default message
	if (iMin) {					// is there a minimum length defined?
		lMin = iMin;				// if so, set the specified minimum length...
		msg = 'field value must be at least ' +	// ...and a different error message.
			lMin +' characters in length.';
		}
	if (element.value.length < lMin) {		// if the element's value is too short...
		alert(msg);				// display the error message...
		element.select();			// select any current input in the element...
		element.focus();			// focus the cursor on the element...
		return false;				// ..and return false to the 'submit' function.
		}
	}
function charTest(element,typeIn,custSet) {
	switch (typeIn) {
		case 'n':
			type = num;
			typMsg = "numbers.";
			break;
		
		case 'np':
			type = numPlus;
			typMsg = "numbers, commas, hyphens, and spaces.";
			break;
		case 'a':
			type = alpha;
			typMsg = "letters.";
			break;
		case 'ap':
			type = alphaPlus;
			typMsg = "letters, periods, apostrophes, hyphens, and spaces.";
			break;
		case 'an':
			type = alphaNum;
			typMsg = "letters and numbers.";
			break;
		case 'c':
			type = custSet;
			typMsg = custSet;
			break;
		default:
			type = alphaNumPlus;
			typMsg = "letters, numbers, commas, periods, apostrophes,\nhyphens, and spaces.";
		}
	for (var i=0; i< element.value.length; i++) {
		if (type.indexOf(element.value.charAt(i)) < 0) {
			alert('Invalid characters in field.  Valid characters include\n' + typMsg);
			element.select();
			element.focus();
			return false;
			}
		}
	}
//-->