//newwin function opens window of a particular size (sized to an image for example) then will open different sized window if called again. Very handy for lists of things like pictures or previews. Function takes three variables; full file name including path, width & height.

//Place in head on page: <SCRIPT LANGUAGE="JavaScript" SRC="/jscripts/newwin.js"></SCRIPT>
//sample call: <a href="javascript:newwin('harvclubb.jpg',250,350)">Text or image</a>

//Created by Robert Blakeley, http://www.akula.com/~blakeley, 4-28-00

var defwd=300;   //sets a default window width if no width is passed
var defht=200;    //sets a default window height if no height is passed
var padwd=20;   //sets extra padding for the width
var padht=25;    //sets extra padding for the height
var docloc="1";     //if set to an empty string, will toggle to load the HTML dynamically as set in bodycontent, otherwise it will load the file specified, presumedly an html page
//define html content to load on the fly below//////////////////////////////

var newwinpict=null;
function newwin(filename,wd,ht)
{
	if(wd==null)wd=defwd;else wd+=padwd;
	if(ht==null)ht=defht;else ht+=padht;
 	if(newwinpict && newwinpict.open && !newwinpict.closed)newwinpict.window.close();
	newwinpict = window.open(docloc,"newwin",'toolbar=no,location=no,directories=no,menuebar=no,width='+wd+',height='+ht+',resizable=yes,scrollbars=yes');
	if (newwinpict != null)newwinpict.opener = window;
	if(docloc=="")
	{
	writecontent='<html><body bgcolor="#ffffff">';
	
	///////////////////////Content here////////////////////////////////////////////////////////////
	var bodycontent='Place your content <b>here</b>';  //If docloc variable is set to empty string ("") function will write out this html in the body of the new window or you can replace the variable bodycontent below)

	writecontent+=bodycontent;     //You can also replace bodycontent with this kind of statement for image lists <img src="'+filename+'" border="0" alt="" width="'+wd+'" height="'+ht+'"> which could open a big picture from a thumbnail picture.
	writecontent+='</body></html>'
	newwinpict.document.write(writecontent);
	newwinpict.document.close();
	}
	else
	{
	newwinpict.location.href=filename;
	};
}




