<!-- 
function openWindow(theURL,winName,features) { // Open Pop Up
  window.open(theURL,winName,features);
}

function expandCollapse() { // expand/collapse layers
	for (var i=0; i<expandCollapse.arguments.length; i++) {
		var element = document.getElementById(expandCollapse.arguments[i]);
		element.style.display = (element.style.display == "none") ? "block" : "none";
	}
}

function checkAll() {
  for (var i = 0; i < document.myform.elements.length; i++) {
    if(document.myform.elements[i].type == 'checkbox'){
      document.myform.elements[i].checked = !(document.myform.elements[i].checked);
    }
  }
}

/*
  forum functions
  found and used graciously from: http://www.iceteks.com/articles.php/javascript/1
*/

//Variables for controlling opening and closing tags (function tag)
var b = 2;
var i = 2;
var u = 2;
var q = 2;
var c = 2;
var url = 2;
var email = 2;
var img = 2;

//Function for creating tags
function tag(v, tagadd, newbut, tagclose, oldbut, name) {
    if (eval(v)%2 == 0) {
        eval("window.document.editform."+name+".value = newbut;");
        var text = window.document.editform.text.value;
        window.document.editform.text.value = text + tagadd;
        window.document.editform.text.focus();
    } else {
        eval("window.document.editform."+name+".value = oldbut;");
        var text = window.document.editform.text.value;
        window.document.editform.text.value = text + tagclose;
        window.document.editform.text.focus();
    }
    eval(v+"++;");
}

//Function to confirm reset
function confirm_reset () {
	if(confirm("Click 'OK' to completely remove all text entered.\n\n Or click 'Cancel' to continue working on your post.")) {
		window.document.editform.text.value = '';
        window.document.editform.text.focus();
		return true;
	}
	else {
		return false;
	}
}

//Check the form submission for errors
function checkForm() {
	var text = document.editform.text;
	
	// Check to make sure post length is sensible
	if (text.value.length < 10) {
		alert("Message is too short (min. 10 characters)\n\n" + "Please go back and try again.");
		return false;
	}
	else {
		return true;
	}
}


// variable for holding contribution level labels and amounts
var contributionLevelLabels = new Array();
var contributionLevelAmounts = new Array();
var contributionLevels = new Array();

// function to add Contribution Level label and amount to levels array
function addContributionLevel() {
	var label = document.addform.contribution_level_label.value;
	var amount = document.addform.contribution_level_amount.value;
	
	if (label=="") {
		alert ("Please enter a contribution level label.");
		return false;
	} else if (amount=="") {
		alert ("Please enter a contribution level amount.");
		return false;
	} else {
		document.addform.contribution_levels.value = document.addform.contribution_levels.value + label + " - $" + amount + "\r\n";
		document.addform.contribution_level_label.value = "";
		document.addform.contribution_level_amount.value = "";
		contributionLevelLabels[contributionLevelLabels.length] = label;
		contributionLevelAmounts[contributionLevelAmounts.length] = amount;
		contributionLevels[contributionLevels.length] = label+':'+amount;
	}
	return true;
}

// function to turn Contribution Levels array into string to be processed by PHP $Post hidden variable
function setContributionLevels() {

	var labels = contributionLevelLabels.toString();
	var amounts = contributionLevelAmounts.toString();
	var levels = contributionLevels.toString();

	document.addform.contribution_level_labels.value = labels;
	document.addform.contribution_level_amounts.value = amounts;
	document.addform.contribution_levels_all.value = levels;
}

// function to get the page's embedded Domain ID to be used by google analytics
function getPageDomainID()
{
	var pageDomainField = document.getElementById('pageDomainID');

	if (pageDomainField)
	{
		if(pageDomainField.value != "")
		{
			return pageDomainField.value;
		}
	}
	return 1;
}

//-->

