/********************************************************

 CHANGE CSS CLASS

 takes an existing html element and changes its current

 class to the new class passed with the element id.

********************************************************/

function changeCSSClass(id, newClass) {

	document.getElementById(id).className = newClass;

	return;

}



/********************************************************

 VALIDATE FORM INFO

 validates fields, ensuring correct information is entered

********************************************************/

function start_over(form) {

	if (confirm("WARNING! All information will be lost!\n\nAre you sure you want to start over?")) {

		document.getElementById(form).reset();

	}

}



/********************************************************

 POP-UP WINDOWS

********************************************************/

popupWins = new Array();



function windowOpener(url, name, args) {



	/**

	 * the popupWins array stores an object reference for

	 * each separate window that is called, based upon

 	 * the name attribute that is supplied as an argument

 	**/



	if ( typeof( popupWins[name] ) != "object" ){

		popupWins[name] = window.open(url,name,args);

	} else {

		if (!popupWins[name].closed){

			popupWins[name].location.href = url;

		} else {

			popupWins[name] = window.open(url, name,args);

		}

	}

	popupWins[name].focus();

}



/********************************************************

  NEW BROWSER WINDOW

  use this function to recreate the tarbet=_blank effect

********************************************************/

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") == "newwin")

    			anchor.target = "_blank";

	}

}

window.onload = externalLinks;


/********************************************************

  TOGGLE DISPLAY

  show/hide the bios and lists

********************************************************/

function togDisplay(id){ 
//document.getElementById(id).style.display = 'none'; 
document.getElementById(id).style.display = (document.getElementById(id).style.display=="block") ? "none":"block";
} 
