//arrays for rollovers

if (document.images){
nav1off = new Image
nav1on = new Image
nav2off = new Image
nav2on = new Image
nav3off = new Image
nav3on = new Image
nav4off = new Image
nav4on = new Image
nav5off = new Image
nav5on = new Image
nav6off = new Image
nav6on = new Image

nav1off.src = "images/nav1off.jpg"
nav1on.src = "images/nav1on.jpg"
nav2off.src = "images/nav2off.jpg"
nav2on.src = "images/nav2on.jpg"
nav3off.src = "images/nav3off.jpg"
nav3on.src = "images/nav3on.jpg"
nav4off.src = "images/nav4off.jpg"
nav4on.src = "images/nav4on.jpg"
nav5off.src = "images/nav5off.jpg"
nav5on.src = "images/nav5on.jpg"
nav6off.src = "images/nav6off.jpg"
nav6on.src = "images/nav6on.jpg"
}

//image rollover functions

function act(imgName){
	if (document.images){
		document[imgName].src = eval(imgName + "on.src")
	}
}

function inact(imgName){
	if (document.images){
		document[imgName].src = eval(imgName + "off.src")
	}
}

function jumpPage(newLoc){
	newPage = newLoc.options[newLoc.selectedIndex].value
	window.location.href= newPage	
}

function popper(pagename){ 
	window.open(pagename,'popWin','resize=yes,toolbar=no,status=no,scrollbars=0,height=200,width=500')
}

function jumpMenu(newLoc){
	newPage=newLoc.options[newLoc.selectedIndex].value
	
	if (newPage!=""){
		window.location.href=newPage
	}
}

//XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// Pop new window for supplier site.
//XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
function popSupplier(bid){
	pagename = 'SupplierSite.asp?bid=' + bid;
	window.open(pagename,'popWin','resize=yes,toolbar=no,status=no,scrollbars=yes,height=600,width=770')
}
//XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// Validate Contact Supplier Form
//XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
function validate(theForm){
	var totalpts=-1
	if (theForm.fName.value == ""){
		alert("Please enter your first name.");
		theForm.fName.focus();
		return (false);
	}
	if (theForm.sName.value == ""){
		alert("Please enter your surname.");
		theForm.sName.focus();
		return (false);
	}
	if (theForm.email.value == ""){
		alert("Please enter your current email address.");
		theForm.email.focus();
		return (false);
	}
	if (theForm.Phone.value == ""){
		alert("Please enter your day time phone number.");
		theForm.Phone.focus();
		return (false);
	}
	return(true);
}

//XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// Validate directory search form
//XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
function checkDirectoryForm(){
	if ((document.frmCatChanger.catID.value == '') && (document.frmCatChanger.searchStr.value == '')){
		alert('You must either select a category OR enter a keyword into the search text box.');
		return false;
	}
}
