function checkSearchWindow() {
	
	if (window.searchWindow) {
		if (window.searchWindow.closed) {
			openSearchWindow();
		} else {
			searchWindow.focus();
		}
	} else {
		openSearchWindow();
	}
	
}

function initializeSearchWindow() {

	var width = 250;
	var height = screen.height - 100;
	var left = ((screen.width - width) - 14);
	var top = 0;
	var toolbar = 0;
	var menubar = 0;
	var scrollbars = 1;
	var resizable = 1;
	var windowFeatures = null;
	
	windowFeatures =
		"width = " + width + "," +
		"height = " + height + "," +
		"left = " + left + "," +
		"top = " + top + "," +
		"toolbar = " + toolbar + "," +
		"menubar = " + menubar + "," +
		"scrollbars = " + scrollbars + "," +
		"resizable = " + resizable;
		
	return windowFeatures;

}

function openSearchWindow() {

	var pageName = "/infopro/smartindexing/stl/src/smartIndexing.asp";
	var windowName = "searchWindow";
	var windowFeatures = null;
	
	windowFeatures = initializeSearchWindow();
	window.open(pageName, windowName, windowFeatures);

}

function validateSearchCriteria() {

	if (document.searchForm.searchBox.value.search(/^\s*$/) == -1) {
		document.body.style.cursor = 'wait';
		document.searchForm.searchBox.style.cursor = 'wait';
		return true;
	} else {
		document.searchForm.searchBox.value = "";
		document.searchForm.searchBox.focus();
		return false;
	}

}

function displayScope(currentSubject, imageName) {
	
	var termData = document.getElementById(currentSubject).style;
	
	if (termData.display == "none") {
		termData.display = "block";
		document.images[imageName].src = '../img/collapse.jpg';
	} else {
		termData.display = "none";
		document.images[imageName].src = '../img/expand.jpg';
	}
	
}

function displayScopeIND(currentSubject, imageName) {
	
	var termData = document.getElementById(currentSubject + '_ind').style;
	
	if (termData.display == "none") {
		termData.display = "block";
		document.images[imageName].src = '../img/collapse.jpg';
	} else {
		termData.display = "none";
		document.images[imageName].src = '../img/expand.jpg';
	}
	
}

function displayScopePL(currentSubject, imageName) {
	
	var termData = document.getElementById(currentSubject + '_pl').style;
	
	if (termData.display == "none") {
		termData.display = "block";
		document.images[imageName].src = '../img/collapse.jpg';
	} else {
		termData.display = "none";
		document.images[imageName].src = '../img/expand.jpg';
	}
	
}

