var cgi_dir;
if (parent['using_FWK']) {
	window.using_FWK=1;
	cgi_dir='/cgi-bin';
} else {
	window.using_FWK=0;
	cgi_dir='/cgi';
}
function fr2_open() { fr2_size(170); }
function fr2_open_small() { fr2_size(30); }
function fr2_close() { fr2_size(0); if(parent.fr1) parent.fr1.focus(); }

function fr2_size(height) {
	var fs = document.getElementById('ttframeset');
	if (fs) {
		var rowSpl=fs.rows.split(',');
		var t=rowSpl[0];
		var f3=rowSpl[3];
		fs.rows=t+',*,'+height+','+f3+',0,0';
	} else if (parent != window) {
		try {
			parent.fr2_size(height);
		} catch(e) {}
	}
}

function fr3_open() { fr3_size(170); }
function fr3_close() { fr3_size(0); if (parent.fr1) parent.fr1.focus(); }

function fr3_size(height) {
	var fs = document.getElementById('ttframeset');
	if (fs) {
		var rowSpl=fs.rows.split(',');
		var t=rowSpl[0];
		var f2=rowSpl[2];
		fs.rows=t+',*,'+f2+','+height+',0,0';
	} else if (parent != window) {
		try {
			parent.fr3_size(height);
		} catch(e) {}
	}
}

function isitframed(writeto) {
	document.forms[0].elements[writeto].value=''; 

	if (parent.mainframe=="[object]") 
		document.forms[0].elements[writeto].value='framed';
}

function new_frameset(sz, srcB, src1, src2, bnrscroll, path) {
	if (srcB == null || srcB == '') srcB="/blank.html";
	if (src1 == null || src1 == '') src1="/blank.html";
	if (src2 == null || src2 == '') src2="/blank.html";
	if (bnrscroll == null || bnrscroll == '') bnrscroll="no";
	if (path == null) path="";
	if (path) path +="/";

	document.writeln("<frameset id=ttframeset rows="+sz+",*,0,0,0,0 frameborder=no name=mainframe cellpadding=0 border=0 scrolling=yes ttid1='' ttid2='' ttid3='' ttid4='' ttid5=''>");
	document.writeln("<frame name=banner src='"+srcB+"' bgcolor=ffffff marginheight=0 scrolling='"+bnrscroll+"' marginwidth=0 border=0 noresize cellpadding=0>");
	document.writeln("<frame name=fr1 src='"+src1+"' bgcolor=ffffff marginheight=0 scrolling=auto marginwidth=0 border=0 cellpadding=0 frameborder=no width=100%>");
	document.writeln("<frame name=fr2 src='"+src2+"' bgcolor=ffffff scrolling=auto marginheight=1 marginwidth=0 border=1 frameborder=yes resize>");
	document.writeln("<frame name=fr3 src=/blank.html bgcolor=ffffff scrolling=auto marginheight=1 marginwidth=0 border=1 frameborder=yes resize>");
	document.writeln("<frame name=hb src=/blank.html bgcolor=ffffff scrolling=no marginheight=0 marginwidth=0 border=0 noresize frameborder=0 cellpadding=0>");
	document.writeln("<frame name=ref src="+path+"ref.html bgcolor=ffffff scrolling=no marginheight=0 marginwidth=0 border=0 noresize frameborder=0 cellpadding=0>");
	document.writeln("</frameset>");
}

// WL ONLY fr2_close();
function chngq(pq) {
	if (pq == null) pq="";
	var popupWin = window.open(cgi_dir+"/u/dreport?file=Fusers&rec=1&format=chngqual_new&parent_qual="+pq,"fr1","status,resizable,width=300,height=100,left=20,top=20");
}

function chngqFEAT(ft) {
	if (ft == null) ft="";
	var popupWin = window.open(cgi_dir+"/u/dreport?file=Fusers&sel=lowrec&format=chngqFEAT&feature="+ft,"fr1","status,resizable,width=300,height=100,left=20,top=20");
}

function new_frameset_FWK() {
	window.using_FWK=1;
	document.writeln("<frameset id=ttframeset rows=*,0,0 frameborder=no name=mainframe cellpadding=0 border=0 scrolling=auto ttid1='' ttid2='' ttid3='' ttid4='' ttid5=''>");
	document.writeln("<frame name=FWK src='/p/FWK_session?reload=1' bgcolor=ffffff marginheight=0 scrolling=no marginwidth=0 border=0 cellpadding=0 frameborder=no width=100%>");
	document.writeln("<frame name=FWK_hb src=/blank.html bgcolor=ffffff scrolling=no marginheight=0 marginwidth=0 border=0 noresize frameborder=0 cellpadding=0>");
	document.writeln("<frame name=ref src=/blank.html bgcolor=ffffff scrolling=no marginheight=0 marginwidth=0 border=0 noresize frameborder=0 cellpadding=0>");
	document.writeln("</frameset>");
}
