width_default = 430;
height_default = 300;
seconds_default = 0;
refreshTo_default = getFilename();

function getFilename()
{
	path_file = location.href;
	/*slash_position = path_file.lastIndexOf('/');	//THIS DOESN"T WORK when there are slashes in the query string
	file = path_file.substring(slash_position+1,1000);
	return file;*/
	return location.href;
}

/*if ("#attributes.refreshTo#" != "")
{
	refreshTo_default = "#attributes.refreshTo#";
}
else
{
	refreshTo_default = getFilename();
}*/

function popUpWin(page, w, h, scroll, winName)
{
	//if w input, set width to it; else set to width_default
	if (w)
		width = w;
	else
		width = width_default;
	//if h input, set height to it; else set to height_default
	if (h)
		height = h;
	else
		height = height_default;
	//pop up window after delay of seconds
	if (scroll)
		otherSpecs = 'scrollbars';
	else
		otherSpecs = '';
	if (winName)
		windowName = winName;
	else
		windowName = 'editWin'; //used to be 'editWin' - Chaim 8/26/02 //changed back to editWin -- dg 10/29/02
	eW = window.open(page,windowName,'width='+width+',height='+height+','+otherSpecs);
	eW.focus();
}
function finishedWithPopUpWin(s, rt)
{
	//if s input, set seconds to it; else set to seconds_default
	if (s){
		//alert(s*1000);
		seconds = s;}
	else
		seconds = seconds_default;
	//if rt input, set refreshTo to it; else set to refreshTo_default
	if (rt)
		refreshTo = rt;
	else
		refreshTo = refreshTo_default;
	//close window
	//alert(s*1000);
	//setTimeout('eW.close();', seconds*1000);
	//setTimeout('alert()', seconds*1000);
	//setTimeout("location.href='likrat_shabbat.cfm';", 4000);
	if (eW) {
		setTimeout(" location.href=refreshTo; eW.close()", s*1000);
	}
	//eW.close();
	//eW.close();
	//alert();
	//location.href='likrat_shabbat.cfm';
	//location.href = refreshTo;	//refresh this page
}

