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


//javascript check for quick search box

function jump2form() {
	document.search_form.possible1.select();
	document.search_form.possible1.focus();
	document.search_form.possible1.style.backgroundColor= '#FFFFF0';
}

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 e = document.search_form.possible1.value;
	if ((e == null) || (e == "") || (e == "Enter Any Word") || isblank(e)) {
		alert("Please enter any word and click 'Search'.");
		jump2form();
	}
	else {
		return true;
	}
	return false;
}

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


//**********************************************//





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



