//Null init function for pages that don't have init() declared
function init() {
	/* init
		ABOUT:				When init is called on every page, this null function prevents errors on those pages that don't offer a local version of init
		BUGS:				none known
		TODO:				none
		PARAMETERS:			none
		RETURNED VALUES:	none
			CHANGE LOG:
		200?.??.??   ???   Created.
	*/
}

function unobRadioCheckboxOnClick(fn) {
	/* unobRadioCheckboxOnClick
		ABOUT:				Unobtrusively adds onclick events to radio buttons and checkboxes.
		BUGS:				none known
		TODO:				none
		PARAMETERS:			function to be attached to onclick event
		RETURNED VALUES:	none
			CHANGE LOG:
		2006.04.18   JEM   Created.
	*/
	var f = document.forms;
	var i,j,e;
	for (i=0; i<f.length; i++) { // loop all forms
		for (j=0; j<f[i].length; j++) { // loop all elements within the form
			e = f[i].elements[j];
			if (e.type == "radio" || e.type == "checkbox") {
				e.onclick = fn; // attach function
			}
		}
	}
}

function $(ojbId) {
	/* $ shortcut function
		ABOUT:				Shortcut for document.getElementById(objId).  Idea from Prototype JavaScript library.
		BUGS:				None known
		TODO:				Consider upgrading to Prototype's actual function in the future.
		PARAMETERS:			objId - string of desired element's ID attribute.
		RETURNED VALUES:	reference to object with desired ID.
			CHANGE LOG:
		2006.04.11   JEM   Created.
	*/
	var el = document.getElementById(ojbId);
	return el;
}

function validEmailableForm() {
	/* validEmailableForm
		ABOUT:				Provides basic validation of the required fields necessary in order to send an email using the cf_processEmail custom tag.
		BUGS:				none known
		TODO:				none
		PARAMETERS:			none
		RETURNED VALUES:	boolean indicating valid form
			CHANGE LOG:
		2006.04.11   JEM   Created.
		2006.04.27   JEM   Changed validation method for email addresses from elIsNotNull to emailCheck.
	*/
	var validSName = elIsNotNull($("sName"));
	var validSMail = emailCheck($("sMail").value);
	var validTMail = emailCheck($("tMail").value);
	var validForm = validSName && validSMail && validTMail;
	return validForm;
}

function elIsNotNull(el) {
	/* elIsNotNull
		ABOUT:				If element exists, returns true if not null; returns false if null or not defined.
		BUGS:				none known
		TODO:				none
		PARAMETERS:			el - object reference to desired element
		RETURNED VALUES:	boolean false if null or not defined, else true
			CHANGE LOG:
		2006.04.11   JEM   Created.
	*/
	var isValid = false;
	if (el) { // if el is defined
		isValid = el.value != "" ? true : false;
	}
	return isValid;
}

function emailCheck (emailStr) {
	/*
	V1.1.3: Sandeep V. Tamhankar (stamhankar@hotmail.com) 
	Original:  Sandeep V. Tamhankar (stamhankar@hotmail.com) 
	Changes:
	1.1.4: Fixed a bug where upper ASCII characters (i.e. accented letters
	international characters) were allowed.
	
	1.1.3: Added the restriction to only accept addresses ending in two
	letters (interpreted to be a country code) or one of the known
	TLDs (com, net, org, edu, int, mil, gov, arpa), including the
	new ones (biz, aero, name, coop, info, pro, museum).  One can
	easily update the list (if ICANN adds even more TLDs in the
	future) by updating the knownDomsPat variable near the
	top of the function.  Also, I added a variable at the top
	of the function that determines whether or not TLDs should be
	checked at all.  This is good if you are using this function
	internally (i.e. intranet site) where hostnames don't have to 
	conform to W3C standards and thus internal organization e-mail
	addresses don't have to either.
	Changed some of the logic so that the function will work properly
	with Netscape 6.
	
	1.1.2: Fixed a bug where trailing . in e-mail address was passing
	(the bug is actually in the weak regexp engine of the browser; I
	simplified the regexps to make it work).
	
	1.1.1: Removed restriction that countries must be preceded by a domain,
	so abc@host.uk is now legal.  However, there's still the 
	restriction that an address must end in a two or three letter
	word.
	
	1.1: Rewrote most of the function to conform more closely to RFC 822.
	
	1.0: Original  */
	
	/* The following variable tells the rest of the function whether or not
	to verify that the address ends in a two-letter country or well-known
	TLD.  1 means check it, 0 means don't. */
	
	var checkTLD=1;
	
	/* The following is the list of known TLDs that an e-mail address must end with. */
	
	var knownDomsPat=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/;
	
	/* The following pattern is used to check if the entered e-mail address
	fits the user@domain format.  It also is used to separate the username
	from the domain. */
	
	var emailPat=/^(.+)@(.+)$/;
	
	/* The following string represents the pattern for matching all special
	characters.  We don't want to allow special characters in the address. 
	These characters include ( ) < > @ , ; : \ " . [ ] */
	
	var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]";
	
	/* The following string represents the range of characters allowed in a 
	username or domainname.  It really states which chars aren't allowed.*/
	
	var validChars="\[^\\s" + specialChars + "\]";
	
	/* The following pattern applies if the "user" is a quoted string (in
	which case, there are no rules about which characters are allowed
	and which aren't; anything goes).  E.g. "jiminy cricket"@disney.com
	is a legal e-mail address. */
	
	var quotedUser="(\"[^\"]*\")";
	
	/* The following pattern applies for domains that are IP addresses,
	rather than symbolic names.  E.g. joe@[123.124.233.4] is a legal
	e-mail address. NOTE: The square brackets are required. */
	
	var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;
	
	/* The following string represents an atom (basically a series of non-special characters.) */
	
	var atom=validChars + '+';
	
	/* The following string represents one word in the typical username.
	For example, in john.doe@somewhere.com, john and doe are words.
	Basically, a word is either an atom or quoted string. */
	
	var word="(" + atom + "|" + quotedUser + ")";
	
	// The following pattern describes the structure of the user
	
	var userPat=new RegExp("^" + word + "(\\." + word + ")*$");
	
	/* The following pattern describes the structure of a normal symbolic
	domain, as opposed to ipDomainPat, shown above. */
	
	var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");
	
	/* Finally, let's start trying to figure out if the supplied address is valid. */
	
	/* Begin with the coarse pattern to simply break up user@domain into
	different pieces that are easy to analyze. */
	
	var matchArray=emailStr.match(emailPat);
	
	if (matchArray==null) {
		/* Too many/few @'s or something; basically, this address doesn't
		even fit the general mould of a valid e-mail address. */
		alert("Email address seems incorrect (check @ and .'s)");
		return false;
	}
	var user=matchArray[1];
	var domain=matchArray[2];
	
	// Start by checking that only basic ASCII characters are in the strings (0-127).
	
	for (i=0; i<user.length; i++) {
		if (user.charCodeAt(i)>127) {
			alert("Ths username contains invalid characters.");
			return false;
		}
	}

	for (i=0; i<domain.length; i++) {
		if (domain.charCodeAt(i)>127) {
			alert("Ths domain name contains invalid characters.");
			return false;
		}
	}
	
	// See if "user" is valid 
	
	if (user.match(userPat)==null) {
		// user is not valid
		alert("The username doesn't seem to be valid.");
		return false;
	}
	
	/* if the e-mail address is at an IP address (as opposed to a symbolic
	host name) make sure the IP address is valid. */
	
	var IPArray=domain.match(ipDomainPat);
	if (IPArray!=null) {
		
		// this is an IP address
		
		for (var i=1;i<=4;i++) {
			if (IPArray[i]>255) {
				alert("Destination IP address is invalid!");
				return false;
			}
		}
		return true;
	}
	
	// Domain is symbolic name.  Check if it's valid.
	 
	var atomPat=new RegExp("^" + atom + "$");
	var domArr=domain.split(".");
	var len=domArr.length;
	for (i=0;i<len;i++) {
		if (domArr[i].search(atomPat)==-1) {
			alert("The domain name does not seem to be valid.");
			return false;
		}
	}
	
	/* domain name seems valid, but now make sure that it ends in a
	known top-level domain (like com, edu, gov) or a two-letter word,
	representing country (uk, nl), and that there's a hostname preceding 
	the domain or country. */
	
	if (checkTLD && domArr[domArr.length-1].length!=2 && domArr[domArr.length-1].search(knownDomsPat)==-1) {
		alert("The address must end in a well-known domain or two letter " + "country.");
		return false;
	}
	
	// Make sure there's a host name preceding the domain.
	
	if (len<2) {
		alert("This address is missing a hostname!");
		return false;
	}
	
	// If we've gotten this far, everything's valid!
	return true;
}

function submitMe(singleFormObj) {
	/* submitMe
		ABOUT:				Submit all forms on the page unless one is specified to ajaxForm
		BUGS:				none known
		TODO:				none
		PARAMETERS:			singleFormObj - (optional) object reference to a form element to be passed
		RETURNED VALUES:	none
			CHANGE LOG:
		2006.04.11   JEM   Created.
	*/
	var newUrl = "?email=true";
	var params;
	if (validEmailableForm()) {
		if (singleFormObj) { // if only one form is requested
			params = paramTheForm(singleFormObj); // get the parameters of that one form
		} else {
			params = paramAllForms(); // otherwise get all of the forms as a parameter
		}
		//document.getElementById('content').innerHTML += params; // for debugging; comment out by default
		ajaxForm(newUrl, params);
	} else {
		alert ("Please enter all of the required information.");
	}
}

function paramTheForm(formId) {
	/* paramTheForm
		ABOUT:				Loops all form fields and turns them into a single parameters variable that is returned.  Useful for AJAX POST commands
		BUGS:				none known
		TODO:				none
		PARAMETERS:			formId - either ID string or object reference of the form to be parameterized
		RETURNED VALUES:	Form fields as parameters
			CHANGE LOG:
		200?.??.??   YB    Created.
		2006.04.11   JEM   Changed formId parameter to accept either an ID string or object reference for increased compatibility.  Updated to $() notation.  Added regexps to replace CF-problematic strings.  Declared i in for loop.  Syntax clean-up.  Deleted apparently unused code (regarding fieldName and fieldValues arrays).
	*/
	var formVar;
	if (typeof(formId) == 'object') {
		formVar = formId;
	} else {
		formVar = $(formId);
	}
	var parameters = "";
	
	for (var i=0; i<formVar.length; i++) {
		if (formVar.elements[i].type == "radio") {
			if (formVar.elements[i].checked) {
				  parameters += formVar.elements[i].name + "=" + formVar.elements[i].value + "&";
			}
		}
		if (formVar.elements[i].type == "checkbox") {
			if (formVar.elements[i].checked) {
				parameters += formVar.elements[i].name + "=" + formVar.elements[i].value + "&";
			} else {
				parameters += formVar.elements[i].name + "=&";
			}
		}
		if (formVar.elements[i].tagName == "SELECT") {
			var sel = formVar.elements[i];
			parameters += sel.name + "=" + sel.options[sel.selectedIndex].value + "&";
		}
		if (formVar.elements[i].type == "text" || formVar.elements[i].type == "textarea" || formVar.elements[i].type=="hidden") {
			parameters += formVar.elements[i].name + "=" + formVar.elements[i].value.replace(new RegExp(/&/g),"and").replace(new RegExp(/%/g),"percent ").replace(new RegExp(/\n/g),"<br />") + "&";
		}
	}	
	
	return parameters;
}

function paramAllForms() {
	/* paramAllForms
		ABOUT:				Loops all forms on the page and collects their element's values as a parameter.
		BUGS:				none known
		TODO:				none
		PARAMETERS:			none
		RETURNED VALUES:	All form fields from all forms on the page as parameters.
			CHANGE LOG:
		2006.04.11   JEM   Created.
	*/
	var parameters = "";
	for (var j=0; j<document.forms.length; j++) {
		parameters += paramTheForm(document.forms[j]);
	}
	return parameters;
}

var req;
function ajaxForm(url,parameters) {
	/* ajaxForm
		ABOUT:				Code-forks to initialize an AJAX connection to the server.
		BUGS:				none known
		TODO:				Consider Prototype implementation, instead (once IE 5.5 support is dropped)
		PARAMETERS:			url - URL address to submit to; parameters - parameters to submit
		RETURNED VALUES:	none
			CHANGE LOG:
		2005.??.??   YB    Created.
		2006.04.27   JEM   var'd req to prevent errors; cleaned-up code.
	*/
	// window.location = url + "&" + parameters; // useful for debugging in place of AJAX; commented out by default
	// document.getElementById('content').innerHTML += parameters; // useful for debugging; commented out by default
	// document.getElementById('content').innerHTML += url; // useful for debugging; commented out by default
	if (window.XMLHttpRequest) {	// branch for native XMLHttpRequest object
		req = new XMLHttpRequest();
		req.onreadystatechange = processReqChange;
		req.open("POST", url, true);
		req.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); 
		req.send(parameters);
	} else if (window.ActiveXObject) {	// branch for IE/Windows ActiveX version
		req = new ActiveXObject("Microsoft.XMLHTTP");
		if (req) {
			req.onreadystatechange = processReqChange;
			req.open("POST", url, true);
			req.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); 
			req.send(parameters);
		}
	}
}
function processReqChange() {
	/* processReqChange
		ABOUT:				Event handler for change in the readystate property of the AJAX request.
		BUGS:				none known
		TODO:				Possibly add "sending" status notifier.
		PARAMETERS:			none
		RETURNED VALUES:	none
			CHANGE LOG:
		200?.??.??   YB    Created.
		2006.04.11   JEM   Minor code clean-up.  Modified for Fitness For Life's specific AJAX needs.
	*/
	if (req.readyState == 1) {
		// retrieving data state.
	}
	if (req.readyState == 4) { // only if req shows "complete"
		if (req.status == 200) {
			alert ("E-mail sent!");
		} else {
			alert("There was a problem retrieving the XML data: " + req.statusText);
			document.getElementById('content').innerHTML += req.responseText;
		}
	}
}

function basicValidation() {
	/* basicValidation
		ABOUT:				Requires all textareas to contain non-null values
		BUGS:				none known
		TODO:				none
		PARAMETERS:			none
		RETURNED VALUES:	boolean regarding validity of textareas.
			CHANGE LOG:
		2006.04.11   JEM   Created.
	*/
	var els = document.getElementsByTagName('textarea');
	var valid = true;
	for (var i=0; i<els.length; i++) {
		if (els[i].value == "") {
			valid = false;
		}
	}
	if (!valid) {
		alert ("Please answer each question on this page to continue.");
		return false;
	}
	return true;
}

function refreshPage() {
	window.location = window.location;
}

function changeSrc(el, newSrc) {
	el.src = newSrc;
	}

function generateEl(parentEl) {
	if (parentEl) {
		var theParent = document.getElementById(parentEl);
	} else {
		var theParent = document.getElementsByTagName("body").item(0);
	}
	var elToAdd = document.createElement("div");
	var theEl = theParent.appendChild(elToAdd);
	return theEl;
}

function construction () {
     alert("This feature is currently under construction.");
}

function actionNotice() {
     alert("Click the Submit button to see your feedback.");
}

function dndFeedback(){
setTimeout(dndFeedbackExecute,1000);
}// end dndFeedback
function dndFeedbackExecute(){
	switch(FBLocation){
	case ("FBOnPage"):
		changeClassById("dndPosFb", "on");
		break;
	case ("FBNextPage"):
		myFileName = getFileName (window.location.toString()); // get the file name
		myFileExt = getFileExtension (window.location.toString()); // get the file extension
		pageAdvance("p");
		break;
	}
}

function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "external") {
	   	anchor.target = "_blank";
	} else {
	   	anchor.target = "_self";
	}
 }
}

// Add an eventListener to browsers that can do it somehow.
// Originally by the amazing Scott Andrew.
function addEvent(obj, evType, fn){
  if (obj.addEventListener){
    obj.addEventListener(evType, fn, true);
    return true;
  } else if (obj.attachEvent){
	var r = obj.attachEvent("on"+evType, fn);
    return r;
  } else {
	return false;
  }
}
addEvent(window, "load", externalLinks);



function changeClassOfParent(el, newClass) {
/*
+===========================================-===========================================+
|                                    VERSION HISTORY                                    |
| 1.0.00  2004.08.30  JEM  Initial version.                                             |
|                                        SUMMARY                                        |
| Given an element and the desired class, change the class of the element's parent.     |
|                                       PARAMETERS                                      |
| el - usually a 'this' reference; reference to the element that called this function.  |
| newClass - the desired class to assign to the element's parent.                       |
|                                  DEPENDANT FUNCTIONS                                  |
| changeClassById.                                                                      |
|                                     EXAMPLE USAGE                                     |
| <div id="els1"><a href="#" onclick="changeClassOfParent(this,'off'); return false;">  |
| Linked text or image</a></div>                                                        |
+===========================================-===========================================+
*/
            changeClassById(el.parentNode.id, newClass);
}
function changeClassById(id, newClass){
/* +===============================================================================================================+
   | Given the ID attribute of the desired HTML element and the newClass to which the element should change,       |
   | do just that and assign newClass to the class property of the element ID.                                     |
   +===============================================================================================================+ */

identity=document.getElementById(id);  // This is required for Mozilla-based browsers (including NS)
identity.className=newClass;  // Change the element's class to newClass
} // end change()

function anchorById(id){
	document.getElementById(id).scrollIntoView();
}

function anchorClassChange(id, newClass){
/* +======================================================================+
   | Change an elements class and anchor to said Element.                 |
   | Using "changeClassById" function to change an elements id            |
   | in some fashion and then anchor the window to that location.         |
   | Needless to say, but should be used for elements being made visible. |
   +======================================================================+*/
	changeClassById(id, newClass);
	document.getElementById(id).scrollIntoView();
}//end anchor

 
/*
 * FlashObject embed
 * http://blog.deconcept.com/2004/10/14/web-standards-compliant-javascript-flash-detect-and-embed/
 *
 * by Geoff Stearns (geoff@deconcept.com, http://www.deconcept.com/)
 * modified by Jason Mock -- added writeDOM method.
 *
 * v1.0.7.1 - 12-15-2004 - jem
 *
 * Create and write a flash movie to the page, includes detection
 *
 * Usage:
 *
 *	myFlash = new FlashObject("path/to/swf.swf", "swfid", "width", "height", flashversion, "backgroundcolor");
 *	myFlash.altTxt = "Upgrade your Flash Player!";                // optional
 *	myFlash.addParam("wmode", "transparent");                     // optional
 *	myFlash.addVariable("varname1", "varvalue");                  // optional
 *	myFlash.addVariable("varname2", getQueryParamValue("myvar")); // optional
 *	myFlash.write();
 *
 */

var FlashObject = function(swf, id, w, h, ver, c) {
	this.swf = swf;
	this.id = id;
	this.width = w;
	this.height = h;
	this.version = ver || 6; // default to 6
	this.align = "middle"; // default to middle
	this.redirect = "";
	this.sq = document.location.search.split("?")[1] || "";
	this.altTxt = "Please <a href='http://www.macromedia.com/go/getflashplayer'>upgrade your Flash Player</a>.";
	this.bypassTxt = "<p>Already have Flash Player? <a href='?detectflash=false&"+ this.sq +"'>Click here if you have Flash Player "+ this.version +" installed</a>.</p>";
	this.params = new Object();
	this.variables = new Object();
	if (c) this.color = this.addParam('bgcolor', c);
	this.addParam('quality', 'high'); // default to high
	this.doDetect = getQueryParamValue('detectflash');
}

FlashObject.prototype.addParam = function(name, value) {
	this.params[name] = value;
}

FlashObject.prototype.getParams = function() {
    return this.params;
}

FlashObject.prototype.getParam = function(name) {
    return this.params[name];
}

FlashObject.prototype.addVariable = function(name, value) {
	this.variables[name] = value;
}

FlashObject.prototype.getVariable = function(name) {
    return this.variables[name];
}

FlashObject.prototype.getVariables = function() {
    return this.variables;
}

FlashObject.prototype.getParamTags = function() {
    var paramTags = "";
    for (var param in this.getParams()) {
        paramTags += '<param name="' + param + '" value="' + this.getParam(param) + '" />';
    }
    if (paramTags == "") {
        paramTags = null;
    }
    return paramTags;
}

FlashObject.prototype.getHTML = function() {
    var flashHTML = "";
    if (window.ActiveXObject && navigator.userAgent.indexOf('Mac') == -1) { // PC IE
        flashHTML += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="' + this.width + '" height="' + this.height + '" id="' + this.id + '" align="' + this.align + '">';
        flashHTML += '<param name="movie" value="' + this.swf + '" />';
        if (this.getParamTags() != null) {
            flashHTML += this.getParamTags();
        }
        if (this.getVariablePairs() != null) {
            flashHTML += '<param name="flashVars" value="' + this.getVariablePairs() + '" />';
        }
        flashHTML += '</object>';
    }
    else { // Everyone else
        flashHTML += '<embed type="application/x-shockwave-flash" src="' + this.swf + '" width="' + this.width + '" height="' + this.height + '" id="' + this.id + '" align="' + this.align + '"';
        for (var param in this.getParams()) {
            flashHTML += ' ' + param + '="' + this.getParam(param) + '"';
        }
        if (this.getVariablePairs() != null) {
            flashHTML += ' flashVars="' + this.getVariablePairs() + '"';
        }
        flashHTML += '></embed>';
    }
    return flashHTML;	
}


FlashObject.prototype.getVariablePairs = function() {
    var variablePairs = new Array();
    for (var name in this.getVariables()) {
        variablePairs.push(name + "=" + escape(this.getVariable(name)));
    }
    if (variablePairs.length > 0) {
        return variablePairs.join("&");
    }
    else {
        return null;
    }
}

FlashObject.prototype.write = function(elementId) {

	if(detectFlash(this.version) || this.doDetect=='false') {
		if (elementId) {
			document.getElementById(elementId).innerHTML = this.getHTML();
		} else {
			document.write(this.getHTML());
		}
	} else {
		if (this.redirect != "") {
			document.location.replace(this.redirect);
		} else {
			if (elementId) {
				document.getElementById(elementId).innerHTML = this.altTxt +""+ this.bypassTxt;
			} else {
				document.write(this.altTxt +""+ this.bypassTxt);
			}
		}
	}		
}

FlashObject.prototype.writeDOM = function(el) {

	if(detectFlash(this.version) || this.doDetect=='false') {
		el.innerHTML = this.getHTML();
	} else {
		if (this.redirect != "") {
			document.location.replace(this.redirect);
		} else {
			el.innerHTML = this.altTxt +""+ this.bypassTxt;
		}
	}		
}

function getFlashVersion() {
	var flashversion = 0;
	if (navigator.plugins && navigator.plugins.length) {
		var x = navigator.plugins["Shockwave Flash"];
		if(x){
			if (x.description) {
				var y = x.description;
	   			flashversion = y.charAt(y.indexOf('.')-1);
			}
		}
	} else {
		result = false;
	    for(var i = 15; i >= 3 && result != true; i--){
   			execScript('on error resume next: result = IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.'+i+'"))','VBScript');
   			flashversion = i;
   		}
	}
	return flashversion;
}

function detectFlash(ver) {	
	if (getFlashVersion() >= ver) {
		return true;
	} else {
		return false;
	}
}

// get value of querystring param
function getQueryParamValue(param) {
	var q = document.location.search;
	var detectIndex = q.indexOf(param);
	var endIndex = (q.indexOf("&", detectIndex) != -1) ? q.indexOf("&", detectIndex) : q.length;
	if(q.length > 1 && detectIndex != -1) {
		return q.substring(q.indexOf("=", detectIndex)+1, endIndex);
	} else {
		return true;
	}
}

/* add Array.push if needed */
if(Array.prototype.push == null){
	Array.prototype.push = function(item){
		this[this.length] = item;
		return this.length;
	}
}

function selectConflict (series, start, end, me) {
var range=end-start; 
	for (var i=0;i<=range;i++) {
		myNum=start+i; 
		idToGet = series+myNum;
		thisEl = document.getElementById(idToGet);
		meEl = document.getElementById(me);
		if ((meEl.value == thisEl.value) && (meEl != thisEl)) {
			thisEl.value = '';
		}
	}
}
function printMe() {
	if (window.print){
		document.getElementById("content").style.height="auto";
		window.print();
	}else{
		alert("Sorry, this browser does not support this feature.  To print this page, please click on File at the top of your screen, and then choose Print.");
	}
}

//Tally the score of a form where the values of the form elements are numbers.
function tallyForm(submittedForm){
	var aFormScore = 0;
	if (!submittedForm){
		alert("Form not found");
		return false;
	}
	//tally score
	for(var i = 0; i < submittedForm.elements.length; i++){
		if(submittedForm.elements[i].checked){
			aFormScore += (submittedForm.elements[i].value*1);
		}
	}
	return aFormScore;
}

/*
ScoreObject Library
version: 1.0
Overview:
	Computate scores based on values of form elements.
	Can use multiple scores inside a single form.
Example:
var myScore = new ScoreObject("radio1","checkbox2","radio6","radio7");
myScore.setcallBackFunction = "getNumbers";
*/

var ScoreObject = function(){
	var args = ScoreObject.arguments;
	this.score = 0;
	this.items = new Array();
	this.callBack = "none";
	if(args){
		for (var i = 0; i<args.length; i++){
			if(args[i]){
				this.items[i] = args[i];
			}else{
				alert(args[i]+" not found in DOM.");
				break;
			}
		}
		if(this.items.length == args.length){
			for(var j = 0; j<this.items.length; j++){
				this.items[j].onClick = "evaluateScore("+this+");";
			}
		}
	}else{
		alert("Missing Parameter: Elements to track");
	}
}
var SOP = ScoreObject.prototype;

SOP.setCallBackFunction = function(evt){
if (typeof evt != "function"){
		evt = new Function(evt);
	}
	this.callBack = evt;
}

SOP.tallyScore = function(){
	if(evaluateScore(this)){
		if(this.callBack != "none"){
			this.callBack(this.score);
		}
	}
}

function evaluateScore(obj){
	var newScore = 0;
	if(obj.items){
		for(var k = 0; k<obj.items.length; k++){
			if(obj.items[k].checked){
				newScore += obj.items[k].value*1;
			}
		}
		obj.score = newScore;
		return true;
	}else{
		return false;
	}
}

function getAllScores(callBack){
	var args = getAllScores.arguments;
	//alert(args[1]);
	var fail = false;
	var scores = new Array();
	if(args){
		for(var l = 1; l<args.length; l++){
			if(args[l].score != null){
				evaluateScore(args[l]);
				scores[l-1] = args[l].score;
			}else{
				if(l == 1){
					alert("ScoreObject(s) not provided");
					fail = true;
					break;
				}else{
					alert("Cannot find: "+args[l]+" as a ScoreObject.");
					fail = true;
					break;
				}
			}
		}
		if(fail){
			//failed..can place alert here for debugging..or return false
		}else{
			if(typeof callBack != "function"){
				callBack = new Function(callBack);
			}
			callBack(scores);
			// return true;
		}
	}else{
		alert("Missing callBack parameter.");
	}
}
				