increase_out=new Image();
increase_out.src="increase_out.gif";
increase_in=new Image();
increase_in.src="increase_in.gif";
decrease_out=new Image();
decrease_out.src="decrease_out.gif";
decrease_in=new Image();
decrease_in.src="decrease_in.gif";

function submitQuery() {

if (isNaN(document.forms[0].elements["record_group"].value)) {
	alert ("You must specify a numeric page number")
	document.forms[0].elements["record_group"].value = "1"
	document.forms[0].elements["record_group"].focus()
	return false
} else if (document.forms[0].elements["batch_number"].value.length != 7) {
	alert ("If you change the batch number it must be 7 characters long starting with a letter")
	window.opener.setfocusQ()
	document.forms[0].elements["batch_number"].focus()
	return false
} else {
checkForMac()
window.opener.setSurname(document.forms[0].elements["last_name"].value)
window.opener.setSpousename(document.forms[0].elements["spouses_last_name"].value)
// alert("Please note that since the recent 'upgrade' the IGI has had intermittent problems often saying 'Due to the current level of activity on the site, your search cannot be processed at this time. Please try again later'. \n\nIf your search encounters these problems please do not report them to me as there is nothing I can do about them and I cannot reply to such reports. \n\nThis warning message will be removed once the IGI appears to have settled down. \n\nThanks\n\nHugh Wallis")
return true
}
}
function getFocus() {
//window.opener.setfocusQ()
//document.forms[0].elements["last_name"].focus()
setTimeout('finalFocus()',1000)
}
function finalFocus(){

// New Stuff

if (document.forms.length < 1 ) {
	setTimeout('finalFocus()',500)
	return
}
//if (document.forms[0].length < 20) {
//	setTimeout('finalFocus()',500)
//	return
//}
//alert('Rootsweb has changed their advertising technology so this page is unstable and may not work properly - please bear with us while we attempt to fix the problem'
// )
bnum = window.opener.batch_number
document.forms["query"].elements["batch_number"].value = bnum
document.forms["query"].elements[0].value = window.opener.surname
if (bnum.substring(0,1) == "M" || bnum.substring(0,1) == "E") {
	document.forms["query"].elements[1].value = window.opener.spousename
}
// End of new stuff
document.forms["query"].elements[0].focus()
}
function checkForMac () {

surname = document.forms[0].elements["last_name"].value
Mac = false
if (surname.substring(0,3).toUpperCase() == "MAC") {
	Mac = true
	prefix = surname.substring(0,3) }
else if (surname.substring(0,2).toUpperCase() == "MC") {
	Mac = true
	prefix = surname.substring(0,2) }
	if (Mac) {
		alert("If your query for '" + surname + "' returns no results, hit the back button on your browser and try again omitting the '" + prefix + "'.\nSometimes the IGI search engine appears to need only the part after the '"  + prefix + "' prefix.")
	}

}
function rgdown() {
if (document.forms[0].elements["record_group"].value > 1 ) { document.forms[0].elements["record_group"].value -- }
}
function rgup() {
document.forms[0].elements["record_group"].value++
}
function buttonOut(imgName) {
        if (document.images) {
            document[imgName].src = eval(imgName + "out.src");
        }
}

function buttonIn(imgName) {
        if (document.images) {
            document[imgName].src = eval(imgName + "in.src");
        }
}