// Stroutspoint.com JavaScript Library:


// Send email:
function sendMail(address) {
	//document.URL = "mailto:" + address;
	//new 

}

// Retrieve values for web parameter from URL string, pass 
//	the parameter string (params) and the variable, returns theValue
function getWebParams(params,variable) {
	var startpos = 0;
	var endpos = 0;
	var theValue;
	var pos = params.indexOf(variable);
	if (pos!=-1) {
		startpos = pos + variable.length;
		endpos = params.indexOf("&",startpos);
		if (endpos==-1) endpos = params.length;
		theValue = params.substring(startpos,endpos);
	}
	return theValue;
}


var highlightImageName;

function setSidebarImage(searchString) {
	var theName;
	
	if (searchString.toLowerCase().indexOf("index") != -1 || searchString.toLowerCase().indexOf("history") != -1) theName = "home";
	else if (searchString.toLowerCase().indexOf("location") != -1) theName = "loc";
	else if (searchString.toLowerCase().indexOf("facilities") != -1) theName = "facilities";
	else if (searchString.toLowerCase().indexOf("honda") != -1) theName = "honda";
	else if (searchString.toLowerCase().indexOf("repair") != -1) theName = "repair";
	else if (searchString.toLowerCase().indexOf("summer") != -1) theName = "summer";
	highlightImageName = theName;
	
	img_act(theName);
	
} 


if (document.images) {                
	homeOn = new Image();         
	homeOn.src = "images/ButtonRedHome.gif";            
	locOn = new Image(42, 197); 
	locOn.src = "images/ButtonRedLocation.gif";
	facilitiesOn = new Image(42, 197);
	facilitiesOn.src = "images/ButtonRedFacilities.gif";
	hondaOn = new Image(42, 197); 
	hondaOn.src = "images/ButtonRedHonda.gif";
	repairOn = new Image(42, 197);
	repairOn.src = "images/ButtonRedRepair.gif";
	summerOn = new Image(42, 197); 
	summerOn.src = "images/ButtonRedSummer.gif";
	
	homeOff = new Image(42, 197);       
	homeOff.src = "images/ButtonBlueHome.gif";            
	locOff = new Image(42, 197);
	locOff.src = "images/ButtonBlueLocation.gif";
	facilitiesOff = new Image(42, 197);
	facilitiesOff.src = "images/ButtonBlueFacilities.gif";
	hondaOff = new Image(42, 197);
	hondaOff.src = "images/ButtonBlueHonda.gif";
	repairOff = new Image(42, 197);
	repairOff.src = "images/ButtonBlueRepair.gif";
	summerOff = new Image(42, 197);
	summerOff.src = "images/ButtonBlueSummer.gif";
}


function img_act(imgName) {
	imgOn = eval(imgName + "On.src");
	document[imgName].src = imgOn;
}

function img_inact(imgName) {
	if (!(imgName == highlightImageName)) {
	imgOff = eval(imgName + "Off.src");
	document[imgName].src = imgOff;
	}
}