
	// base level javascript, see simpleRollOvers.js for row roll over behaviors


// highlight color for submit button text
var highlightColor = "C14646";
//

// highlight for navigation submit button text;
var navHighlightColor = "111111";
//

// highlight color and holder for row highlights 
var rowhighlightColor = "#f3f3f3"; //"#F8F1EB";
var rowdefaultColor;
//

// highlight color and holder for first cell of row highlights
var cellonehiColor = "#e4e4e4";//"#F1E7D8";
var cellonedefColor;
//

// highlight color and holder for nav tabs
var tabHighlightColor = "888888";
var tabColorBuffer;
//

//instructions for use of table javascript, should only be displayed if javascript is working correctly
var table_note_text = "* (click to retain highlight / roll over for column)";
//

// roll over function for submit buttons, currently only changes text color
function buttonRollOn(which) {
	if (which.style) {
		colorBuffer = which.style.color;
		borderHighBuffer = which.style.borderTopColor;
		borderShadBuffer = which.style.borderBottomColor;
		which.style.color = '#' + highlightColor;
		which.style.borderTopColor = '#EEEEEE';
		which.style.borderLeftColor = '#EEEEEE';
		which.style.borderBottomColor = '#CCCCCC';
		which.style.borderRightColor = '#CCCCCC';
		backBuffer = which.style.backgroundColor;
		which.style.backgroundColor = '#EFEFEF';
	}
}
//

// roll off function for submit buttons, currently only changes text color
function buttonRollOff(which) {
	if (which.style) {
		which.style.color = colorBuffer;
		which.style.borderTopColor = borderHighBuffer;
		which.style.borderLeftColor = borderHighBuffer;
		which.style.borderBottomColor = borderShadBuffer;
		which.style.borderRightColor = borderShadBuffer;
		which.style.backgroundColor = backBuffer;
	}
}
//

// roll over function for submit buttons, currently only changes text color
function navRollOn(which) {
	if (which.style) {
		navColorBuffer = which.style.color;
		which.style.color = '#' + navHighlightColor;
	}
}
//

// roll off function for submit buttons, currently only changes text color
function navRollOff(which) {
	if (which.style) {
		which.style.color = navColorBuffer;
	}
}
//

// roll over function for nav tabs
function tabOver(which) {
	if (which.style) {
		tabColorBuffer = which.style.backgroundColor;
		which.style.backgroundColor = '#' + tabHighlightColor;
	}
}
//

// roll off function for navtabs
function tabOff(which) {
	if (which.style) {
		which.style.backgroundColor = tabColorBuffer;
	}
}
//

//status roll over for nav
function statusOn(which){
	if (which.style) {
		status="Go to: " + which.innerHTML;
		return true;
	}
}
//

//status roll off for nav
function statusOff(){
	status="";
	return true;
}
//

// validates account information
function validate(x, page)
{

if(page == "create")
	{
		if(!x.policyRead.Checked)
			{
				alert("You haven't checked the box indicating you've read the acceptable use policy");
				return false;
			}
	}
if(page == "edit")
	{

		if(x.Email.value=="")
			{
				alert("I'm sorry, you need to provide an Email Adress.");
				x.Email.focus();
				return false;
			}
		else
			{
			validated = x.Email.value.indexOf("@");
				if (validated == -1) 
					{
						alert("I'm sorry, your email adress is not valid.");
						x.Email.focus();
						return false;
					}
			}
		if (x.Fname.value == "")
			{
				alert("I'm sorry, you must fill in the First Name field.");
				x.Fname.focus();
				return false;
			}
		if(x.Lname.value == "")
			{
				alert("I'm sorry, you must fill in the Last Name field.");
				x.Lname.focus();
				return false;
			}
		if(x.Addr1.value == "")
			{
				alert("I'm sorry, you must enter an Address.");
				x.Addr1.focus();
				return false;
			}
		if(x.City.value == "")
			{
				alert("I'm sorry, you must enter a City.");
				x.City.focus();
				return false;
			}
		if(x.State.value == "")
			{
				alert("I'm sorry, you must select a State or Province.");
				x.State.focus();
				return false;
			}
		if(x.Zip.value == "")
			{
				alert("I'm sorry, you must enter a Zip Code.");
				x.Zip.focus();
				return false;
			}
		if(x.Country.value == "")
			{
				alert("I'm sorry, you must enter a Country.");
				x.Country.focus();
				return false;
			}
		if(x.Phone.value == "")
			{
				alert("I'm sorry, you must provide a Phone Number.");
				x.Phone.focus();
				return false;
			}
		if(x.Password.value == "")
			{
				alert("No password was provided.");
				x.Password.focus();
				return false;
			}
		if(x.Password.value != x.ConfirmPassword.value)
			{
				alert("Your confirmation does not match your password.");
				x.ConfirmPassword.focus();
				return false;
			}
	}
}
//

function confirm_switch_to_html()
{
input_box=confirm("Switching to the HTML editor will cause you to lose your changes to HTML content.");
if (input_box==true)
	{ 
		return true;
	}
else
	{
		return false;
	}
}

function confirm_switch_to_raw()
{
input_box=confirm("Switching to edit HTML directly will cause you to lose your changes to HTML content.");
if (input_box==true)
	{ 
		return true;
	}
else
	{
		return false;
	}
}

function confirm_template_back()
{
input_box=confirm("Choosing a new template will cause you to lose your changes to this template.");
if (input_box==true)
	{ 
		return true;
	}
else
	{
		return false;
	}
}