// Utility and global javascript methods for the IEEDRL site // 


//javascript check for quick search box

function jump2form() {
	document.search_form.possible1.select();
	document.search_form.possible1.focus();
}

/*
function jump2form2() {
	document.search_form.queryText.select();
	document.search_form.queryText.focus();
}
*/

function isblank(s) {
	for(var i = 0; i < s.length; i++) {
		var c = s.charAt(i);
		if ((c != ' ') && (c != '\n') && (c != '\t')) {
			return false;
		}
	}
	return true;
}

function searchformcheck() {
	var d = document.search_form.pjournals.options.selected;
	var e = document.search_form.possible1.value;
	if ((e == null) || (e == "") || (e == "Enter Any Word") || isblank(e)) {
		alert("Please enter word and click 'Go'.");
		jump2form();
	}
	else {
		return true;
	}
	return false;
}

/*
function searchformcheck2() {
	//var d = document.search_form.pjournals.options.selected;
	var e = document.search_form.queryText.value;
	if ((e == null) || (e == "") || (e == "Enter Any Word") || isblank(e)) {
		alert("Please enter word and click 'Go'.");
		jump2form2();
	}
	else {
		return true;
	}
	return false;
}
*/


function keywordFilled() {
	var s = document.search_form.possible1.value;
	if (s == "Enter Any Word")			
	document.search_form.possible1.value = "";
}


/*
function keywordFilled2() {
	var s = document.search_form.queryText.value;
	if (s == "Enter Any Word")			
	document.search_form.queryText.value = "";
}


function updateValue() {
if (document.search_form.pjournals.options[document.search_form.pjournals.selectedIndex].value == '<%=coden%>' ) {
document.search_form.ACROSSASCE.value = '';
} else {
document.search_form.ACROSSASCE.value = 'YES';
}
} 
*/
//**********************************************//





//Used to open a printer friendly window 
function openPrinterFriendlyWindow(url) { 
// openPrinterFriendly spawns a window with the printer friendly version of this page 
var x = 660; var y = 480; 

if (navigator.appVersion.indexOf("Mac") > 0) { 
openWindow(url, "width=" + x + ",height=" + y + ",toolbar=yes,resizable=yes,scrollbars=yes"); 
} else { openWindow(url, "width=" + x + ",height=" + y + ",status=yes,menubar=yes,toolbar=yes,resizable=yes,scrollbars=yes"); 
} 
} 

//Opens a window 

function openWindow(url, optionString) { 
window.open(url, "", optionString); 
} 
//closes a window 

function closeWindow() { 
window.close(); 
} 




