/* 
 * newWin(URL,w,h,scroll) 
 *	   URL = destination URL
 *	     w = width 
 *       h = height
 *  scroll = scrollbar switch; 0=off, 1=on
 *
 * Opens a new browser window with specified size and destination
 *
*/
function newWin(URL,w,h,scroll,toolbar) {
	if(scroll == '')
	{
		scroll=0;
	}
	if (toolbar == '') 
	{
	    toolbar = 0;
	}
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar='+ toolbar +',scrollbars='+scroll+',location=0,statusbar=0,menubar=0,resizable=1,width="+w+",height="+h+",left = 0,top = 0');");
}


/*
 * newPositionedWindow(URL,w,h,scroll,left,top)
 *	   URL = destination URL
 *	     w = width 
 *       h = height
 *  scroll = scrollbar switch; 0=off, 1=on
 *    left = position of window relative to left edge of screen
 *     top = position of window relative to top edge of screen
 * 
 * Opens a new browser window with specified size and destination at a specific location on screen
*/
function newPositionedWindow(URL,w,h,scroll,left,top){
	if (scroll == ''){
		scroll=0;
	}
	day= new Date();
	id= day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars='+scroll+',location=0,statusbar=0,menubar=0,resizeable=1,width="+w+",height="+h+",left="+left+",top="+top+"');");
}


/* 
 * openDelayedWindow(thisDelayInSeconds, thisFile, thisHeight, thisWidth, thisTop, thisLeft, thisScroll)
 *	   thisDelayInSeconds = delay time in seconds
 *	             thisFile = url or file to open 
 *                     
 *						      odw_H = height of new window
 *							    odw_W = width of new window
 *							    odw_Y = position of window relative to top edge of screen
 *							    odw_X = position of window relative to left edge of screen
 *							    odw_S = scrollbar switch; 0=off, 1=on
 * Opens a new browser window with specified destination after a specified number of seconds
 *
*/
var odw_H = 200;
var odw_W = 200;
var odw_Y = 200;
var odw_X = 200;
var odw_S = 0;
var odw_File = "";
function openDelayedWindow(thisDelayInSeconds, thisFile, thisHeight, thisWidth, thisTop, thisLeft, thisScroll){
	odw_H = thisHeight;
	odw_W = thisWidth;
	odw_Y = thisTop;
	odw_X = thisLeft;
	odw_S = thisScroll;
	odw_File = thisFile;
	var w = setTimeout("newPositionedWindow(odw_File,odw_W,odw_H,odw_S,odw_X,odw_Y)", thisDelayInSeconds * 1000);
}


/*
 * redirectParent(thisUrl)
 *       thisUrl = destination URL for the the parent window
 *
 * Redirects the parent window to a specified URL, then close this window
 *
*/
function redirectParent(thisUrl){
		var myParent = window.opener;
		myParent.location = thisUrl;
		window.close();
}


