var newview= '';
var newview2= '';


function select_based_query()
	{

var xMax = 640, yMax=480; // default

		if (!newview)
		{	
		
		
		newview =  eval(window.open('blank.pl','newview','width=' + xMax + ',height=' + yMax + ',toolbar=yes,scrollbars=yes,resizable=1'));
		
		
		newview.focus();
		
		}
		else if ((!newview.closed))
		{	
			newview.focus();
		}
		else
		{	
			newview =  eval(window.open('blank.pl','newview','width=' + xMax + ',height=' + yMax + ',toolbar=yes,scrollbars=yes,resizable=1'));
			newview.focus();
		
		}
	
	
      		newview.moveTo(0,0);
      		newview.outerHeight = (screen.availHeight-100);
      		newview.outerWidth = screen.availWidth;
	


}
function self_submit()
	{	
		
		 var xMax = 640, yMax=480; // default

		if (!newview)
		{	
		//var place = '../crep-cgi/query_tree_results_frameset.pl';
		var place = '../crep-cgi/generic_tree_right.pl';
		
		newview =  eval(window.open(place,'main','width=' + xMax + ',height=' + yMax + ',toolbar=yes,scrollbars=yes,resizable=1'));
		if (newview.opener == null) newview.opener = self;
		
		newview.focus();
		
		}
		else if ((!newview.closed) && (sp == spo))
		{	
	
			var place = '../crep-cgi/generic_spots.pl';
			if(spo == "ON")
			{
				newview.frames['results_spots'].location.href = place;
			}
			newview.focus();
		}
		else
		{	//var place = '../crep-cgi/query_results_frameset.pl';
		

			var place = '../crep-cgi/generic_tree_right.pl';
			newview =  eval(window.open(place,'main','width=' + xMax + ',height=' + yMax + ',toolbar=yes,scrollbars=yes,resizable=1'));
			newview.focus();
		
		}
	
	
      		newview.moveTo(0,0);
      		newview.outerHeight = (screen.availHeight-100);
      		newview.outerWidth = screen.availWidth;
	}

function help_window(url,name,xxx,yyy)
{      
	glossary_window = window.open(url, name, 'width=' + xxx +  ',height=' + yyy + ',screenX=0,screenY=0,top=0,left=0,scrollbars=yes,resizable=yes');
	
	
}
