//////////////////////////////////////////////////////////////////////

// Friendly Pop-up - Created March 1 2006 //
// USE FOR NON IMAGE POP-UPS, DATA WINDOWS, ETC. //
/* This pop-up is nice to those without JavaScript and 
   search engines.  Any <a> tag you want to have this code
   applied to needs to have the target page as the href
   in the code.
   
   Your <a> tag can have the following attributes:
      href - REQUIRED The target page for the pop-up.
	  name - The name to be given the window.  If two 
	         windows have the same name, the first will
			 be closed.
	  h - The height of the pop-up window.
	  w - The width of the pop-up window.
	  r - yes or no for resizable window.
	  s - yes or no for scrollbars.
	  
   Here is a sample of a link:
   <a href="http://www.scheffey.com" onclick="launchPopUp(this); return false;" h="200" w="500" name="popWin" s="yes" r="yes">Click Here</a>
	  
   It returns the new window in case you need to do anything 
   else with it after it has been created.                    */

function launchPopUp(linkObject) {
	// This closes a pop-up window by the same name if it is already open.
	var winName = linkObject.href;
	if (linkObject.name) {
		winName = linkObject.name;
		if (eval("window." + winName) != null) {
			eval("window." + winName + ".close()");
		}
	}
	
	var h = 400;
	if (linkObject.getAttribute("h")) {h = linkObject.getAttribute("h")}
	
	var w = 400;
	if (linkObject.getAttribute("w")) {w = linkObject.getAttribute("w")}
	
	var r = "yes";
	if (linkObject.getAttribute("r")) {r = linkObject.getAttribute("r")}
	
	var s = "yes";
	if (linkObject.getAttribute("s")) {s = linkObject.getAttribute("s")}
	
	var newWin = window.open(linkObject.href,"","width=" + w + ",height=" + h + ",resizable=" + r + ",scrollbars=" + s);

	newWin.focus();
	
	return newWin;

}

//////////////////////////////////////////////////////////////////////

