/*
 * Function popUpPage() opens an html file in a 
 * new browser window and centers the window on the user's computer screen.
 * This function is passed to it:
 * path - the URL of the HTML page to open.
 * name - the name to give the browser window.
 * scroll - the option of scroll bars on the browser window, yes or no.
*/

function popUpPage(path, name, scroll) {
	var w = (500);  // if width not given, define width of the popup page.
	var h = (670);  // if height not given, definte height of the popup page.
	var win2X = (screen.width/2 - w/2); // Center popup page offset by it's width.
	var win2Y = 15; // Top of the popup page on the screen.
	winprops2 = 'height='+h+',width='+w+',top='+win2Y+',left='+win2X+',scrollbars='+scroll+',resizable'// properties of the browser window.
	win2 = window.open(path, name, winprops2) // Opens the new browser window.
	if (parseInt(navigator.appVersion) >= 4) { win2.window.focus(); } // Give the new browser widow focus.
}


//------------------------------

/*
 * Function MM_jumpMenu() opens a new web page in a specified window.
 * It is used by selecting an option on the drop down navigation forms.
 * This function is passed to it:
 * targ - window location (i.e.: this, _blank, _parent, etc)
 * selObj - name of the selection object that holds the options
 * restore - if true, dropdown menu will reset to original state after selection is made
 */

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='" + selObj.options[selObj.selectedIndex].value + "'");
  if (restore) { selObj.selectedIndex=0; }
}


//------------------------------


/*
 * Function update_frame() opens a new web page in the current browser widow.
 * It is used by selecting an option on the drop down navigation forms.
 * This function is passed to it:
 * myoptions - object containing the URL of the HTML page to open.
 */

function update_frame(myoptions) {
	destination=myoptions[myoptions.selectedIndex].value;
	if(destination=="null"){
		return true; 
	}
	window.open(destination, '_self'); // Opens the new browser window.
	myoptions.selectedIndex=0; 
	return true;
}

//------------------------------


/*
 * Function myVoid() does nothing.  It is used when the anchor tag has an event
 * such as OnMouseOver that uses a function.  We want the function to be called
 * rather than the URL in the anchor tag called.
 */

function myVoid(){}


//------------------------------

function FeatureWindow(mypage, myname, w, h, scroll) {
var winl = 0;
var wint = 0;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+''
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}


//------------------------------


// This funciton verifies the zip code when the comic form is submitted.		 
function ValidateZip()
{

  if (document.search.Zip.value == "")
  {
    alert("Please enter a value for the \"Zip\" field.");
    document.search.Zip.focus();
    return (false);
  }

  if (document.search.Zip.value.length < 5)
  {
    alert("Please enter at least 5 characters in the \"Zip\" field.");
    document.search.Zip.focus();
    return (false);
  }

  if (document.search.Zip.value.length > 7)
  {
    alert("Please enter at most 7 characters in the \"Zip\" field.");
    document.search.Zip.focus();
    return (false);
  }
  return (true);
}
