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


//javascript check for quick search box
function jump2form() {
	document.search_form.possible1.select();
	document.search_form.possible1.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 if ((e!=null) && (!e=="") && (e.indexOf("1061")>=1)){
		document.search_form.possible1.value = e.replace(/[(/)]/g, " ");
		return true;
	} 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 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';
}

} 
function updateSearchValue() {
if (document.search_form.pjournals.options[document.search_form.pjournals.selectedIndex].value == 'ASCECP') {
document.search_form.fromvolume.value = "247";
document.search_form.tovolume.value = "247";
// window.location.reload(false);
}
}
//**********************************************//





//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(); 
} 

