window.onload = function() {
	var htmlStyle = document.getElementsByTagName('html')[0].style;
	var bodyStyle = document.body.style;
	bodyStyle.scrollbarFaceColor = htmlStyle.scrollbarFaceColor = '#e4e4e4';
	bodyStyle.scrollbarArrowColor = htmlStyle.scrollbarArrowColor = '#cccc99';
	bodyStyle.scrollbarTrackColor = htmlStyle.scrollbarTrackColor = '#efefef';
	bodyStyle.scrollbarShadowColor = htmlStyle.scrollbarShadowColor = '#cccc99';
	bodyStyle.scrollbarHighlightColor = htmlStyle.scrollbarHighlightColor = '#e4e4e4';
	bodyStyle.scrollbar3dlightColor = htmlStyle.scrollbar3dlightColor = '#e4e4e4';
	bodyStyle.scrollbarDarkshadowColor = htmlStyle.scrollbarDarkshadowColor = '#607C8C';
}

function openWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function showMore(varA1, varB1){
	var123 = ('varXYZ' + (varA1));
	varABC = ('varP' + (varA1));
	if( document.getElementById ) {
		if( document.getElementById(var123).style.display ) {
			if( varB1 != 0 ) {
				document.getElementById(var123).style.display = "block";
				document.getElementById(varABC).style.display = "none";
			} else { document.getElementById(var123).style.display = "none";
				document.getElementById(varABC).style.display = "block"; }
			} else { location.href = varB1;
			return true; 
		}
	} else { location.href = varB1;
		return true; 
	}
}

function doBold() {
	txt = prompt("Text to make bold:", "");
	if (txt != null) {
		theText = "<b>" + txt + "<\/b>";
		addText(theText);
	}
}
function doItalic() {
	txt = prompt("Text to make italic:", "");
	if (txt != null) {
		theText = "<i>" + txt + "<\/i>";
		addText(theText);
	}
}
function doQuote() {
	txt = prompt("Text to quote:", "");
	if (txt != null) {
		theText = "<\/p><blockquote>" + txt + "<\/blockquote><p>";
		addText(theText);
	}
}

function doParagraph() {	
			theText = "<p></p>";
			addText(theText);
}

function doLink() {
	url = prompt("Enter the URL for the link:", "");
	if (url != null) {
		txt = prompt("Enter the text description for the link:", "");
		if (txt != null) {
			theText = "<a" + " h" + "r" + "e" + "f" + "=" + "\"" + url + "\">" + txt + "<\/a>";
			addText(theText);
		}
	} 
}
function doLinkNew() {
	url = prompt("Enter the URL for the link:", "");
	if (url != null) {
		txt = prompt("Enter the text description for the link:", "");
		if (txt != null) {
			theText = "<a" + " h" + "r" + "e" + "f" + "=" + "\"" + url + "\" target=\"_blank\">" + txt + "<\/a>";
			addText(theText);
		}
	} 
}

function addText(theText) {
	document.commentsForm.comments.value += theText;
	document.commentsForm.comments.focus();
}

function textCounter(theField, charsLeft, maxChars) {
	if (theField.value.length > maxChars) {
		theField.value = theField.value.substring(0, maxChars);
	} else {
		charsLeft.value = maxChars - theField.value.length;
	}
}
function isEmail(string) {
	if (string.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1) {
		return true;
	} else {
		return false;
	}
}	
		
function trim(str) {
  	return str.replace(/^\s+|\s+$/g, '');
}

function landing_submit(theForm) {
	var valid = true;

 if(trim(theForm.email.value) == "") {
		alert("Email can not be blank.");
		valid = false;
	} 

	else if(!isEmail(theForm.email.value)) {
		alert("Please enter a valid email.");
		valid = false;
	}
	
	
		
	if(valid) {
		theForm.submit();
	}
	else return false;
}