

function openOne( loc1 ) {
	top.frames[ 0 ].location = loc1;
}

function openTwo( loc1, loc2 ) {

	top.frames[ 0 ].location = loc1;
	top.frames[ 1 ].location = loc2;

}

function onload() {
//	document.body.onclick = rotate;
//	document.body.onkeypress = handleKeys;
}


function doYaleOnLoad( ) {
	parent.document.title = document.title;
}

function showCorrespondents( docNum ) {
	top.controlFrame.location = "control?doc=" + docNum;	
}

// User entered text in correspondents window

function updateCorrList( always ) {

	window.dump( "calling updateCorrList" );
	
	var patt = document.forms[ "corrForm" ].pattern.value;

	if ( always == false && patt.length < 3 )
		return false;
	

	var p = new RegExp( patt, "i" );

	var ps = patt.split( /\s+/ );
	
	var list = document.getElementById( "corrList" );
	var newList = list.cloneNode( false );

	var vid, li, link, text;

	var listElement = document.createElement( "li" );
	
	for ( var i = 0; i < listOfNames.length; ++i ) {
		var hit = listOfNames[ i ];
		var isOne = true;
		
// 		for ( var j = 0; j < ps.length; ++j ) {
// 			if ( hit.search( new RegExp( ps[ j ], "i" ) ) == -1 ) {
// 				isOne = false;
// 				break;
// 			}
// 		}
		if ( isOne == true ) {
			vid = listOfIDs[ i ];
			li = listElement.cloneNode( false );
//			link = document.createElement( "a" );
//			link.setAttribute( "href", "control?id=" + vid );
//			link.setAttribute( "target", "controlFrame" );
			text = document.createTextNode( hit );
//			link.appendChild( text );
//			li.appendChild( link );
			li.appendChild( text );
			newList.appendChild( li );
		}

	}

	var parent = list.parentNode;
	parent.replaceChild( newList, list );
	
	return false;
}

function getListNode( hit, vid ) {

	var result = document.createElement( "li" );
	var link = document.createElement( "a" );
	link.setAttribute( "href", "control?id=" + vid );
	link.setAttribute( "target", "controlFrame" );
	var text = document.createTextNode( hit );
	link.appendChild( text );
	result.appendChild( link );
	return result;
}



