/***************************************************************************
* Pop-up Handler
* Modeled on Ian Loyd's 'Perfect Pop-Up Handler'
* See details at:
* http://www.sitepoint.com/article/perfect-pop-up
*
*
* Here's an example call to this function:
*
* <a href="my-pop-up-window.htm" onclick="popUp(this.href,'console',400,200);return false;" target="_blank">This is my link</a>
*
***************************************************************************/

var newWin = null;
function popUp(strURL, winName, strType, strHeight, strWidth) {
 
 self.name = "main"; // names current window as "main"

 if (newWin != null && !newWin.closed)
   newWin.close();
 var strOptions="";
 if (strType=="console") {
   strOptions="resizable,height="+strHeight+",width="+strWidth;
 }
 if (strType=="fixed") {
   strOptions="status,height="+strHeight+",width="+strWidth;
 }
 if (strType=="elastic") {
   strOptions="toolbar,menubar,scrollbars,"+"resizable,location,height="+strHeight+",width="+strWidth;
 }
 if (strType=="bareelastic") {
   strOptions="scrollbars,resizable,"+"height="+strHeight+",width="+strWidth;
 }
 if (strType=="barebones") {
     strOptions="height="+strHeight+",width="+strWidth;
 }
 newWin = window.open(strURL, winName, strOptions);
 //newWin.focus();
}


/***************************************************************************
* Select "Jump" Lists
* See details at:
* http://www.bio.psu.edu/toolbox/toolbox/development_tool/jumplist/
***************************************************************************/
function jumpList(jump_form) {
var URL = document.jump_form.jump_select.options[document.jump_form.jump_select.selectedIndex].value;
window.location.href = URL;
}


/***************************************************************************
* funtction selectJump
* (The Semantic Version)
* Can be be used with any select on the site to use as navigation without
* also using a submit button in a form
***************************************************************************/
	//receive which window is to be used to display the result (targetWindow), which select was utilized 
	//by the user (select), and what option to be selected by default if the select is being re-rendered (defaultSelected)
	function SelectJump (targetWindow,select,defaultSelected) {
		//eval determines whether or not the argument is a valid string, then parses the string and executes the code it finds
		//what will be executed is a redirection of the target window to the value selected by the user
		eval (targetWindow+".location='?"+select.name+"="+select.options[select.selectedIndex].value+"'");
		//this will set the selects default-selected option 
		if (defaultSelected) {select.selectedIndex=defaultSelected};
	}