var isIE=(navigator.appName=="Microsoft Internet Explorer");

function FSfncCheckNumber(FormField,TheMessage,AllowBlank,PositiveOnly,IntegerOnly) {
	// AllowBlank, PositiveOnly, and IntegerOnly are optional
	if ((isNaN(FormField.value)) || (FormField.value.search(/\s/g)>-1)) {alert(TheMessage); FormField.focus(); return false}
	if ((AllowBlank==false) && (FormField.value=="")) {alert(TheMessage); FormField.focus(); return false}
	if ((PositiveOnly) && (FormField.value<0)) {alert(TheMessage); FormField.focus(); return false}
	if ((IntegerOnly) && (FormField.value.indexOf(".")>-1)) {alert(TheMessage); FormField.focus(); return false}
	return true;
	}

function FSfncCheckString(FormField,TheMessage,AllowBlank,MaxLength) {
	// MaxLength is optional, when not provided the string is only checked for being blank.
	if ((AllowBlank==false) && (FormField.value=="")) {alert(TheMessage); FormField.focus(); return false}
	if ((MaxLength!="") && (FormField.value.length>MaxLength)) {alert(TheMessage); FormField.focus(); return false}
	return true;
	}

// for the post-its

function FSfncReadCookie(key) {
	var cookie_string='' + document.cookie;
	var cookie_array=cookie_string.split('; ');
	for (var i=0; i<cookie_array.length; i++) {
		var single_cookie=cookie_array[i].split('=');
		if (single_cookie.length!=2) {continue}
		if (key==unescape(single_cookie[0])) {return unescape(single_cookie[1])}
		}
	return '';
	}

function FSfncSetCookie(name,value,expires,path,domain,secure) {
	document.cookie=name + '=' + escape(value) + ((expires == null) ? '' : ('; expires=' + expires.toGMTString())) + ((path == null) ? '' : ('; path=' + path)) + ((domain == null) ? '' : ('; domain=' + domain)) + ((secure == true) ? '; secure' : '');
	}

function FSfncCheckShowNote(strNoteID) {if (FSfncReadCookie(strNoteID)=='') {FSfncToggleNote(strNoteID,true)}}

function FSfncToggleNote(strNoteID,state) {
	if (document.getElementById) {
		var elemNote=document.getElementById(strNoteID);
		if (isIE) {elemNote.filters.blendTrans.Apply()}
		elemNote.style.visibility=state ? "visible" : "hidden";
		if (isIE) {elemNote.filters.blendTrans.play()}
		FSfncSetCookie(strNoteID,(state ? "" : "No"));
		}
	}

function FSfncSetupNotes() {
	if (FSblnOncePerSession) {var FSfncDisplayNote=FSfncCheckShowNote} else {var FSfncDisplayNote=FSfncToggleNote}
	if (document.getElementById) {FSfncDisplayNote("postit1",true)}
	}