
// Application Buttons //
var imgOnAppointment = new Image(390,48);
imgOnAppointment.src = '/images/bookService_over.gif';
var imgOffAppointment = new Image(390,48);
imgOffAppointment.src = '/images/bookService.gif';

var imgOnPartsRequest = new Image(390,48);
imgOnPartsRequest.src = '/images/partsRequest_over.gif';
var imgOffPartsRequest = new Image(390,48);
imgOffPartsRequest.src = '/images/partsRequest.gif';

var imgOnCreditApp = new Image(253,48);
imgOnCreditApp.src = '/images/image.php?file=buttons/ENG/credit_app2.gif';
var imgOffCreditApp = new Image(253,48);
imgOffCreditApp.src = '/images/image.php?file=buttons/ENG/credit_app1.gif';

var imgOnInfo = new Image(315,42);
imgOnInfo.src = '/images/image.php?file=info2.gif';
var imgOffInfo = new Image(315,42);
imgOffInfo.src = '/images/image.php?file=info1.gif';
			
function openWindow(url,width,height){
	newWin = window.open(url, 'viewWin', 'toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=1,left='+(screen.width-width)/2+',top='+(screen.height-height)/2+',width=' + width + ',height=' + height + '');
}		

function changeImg(imgName,imgPre) {
	if(document.images){
		document.images[imgName].src = eval(imgPre + '.src');
	}
}

function changeStyle(obj, new_style) {
    obj.className = new_style;
}
//Usage example: <td class="featurebox" onmouseover="changeStyle(this,'featureboxover')" onmouseout="changeStyle(this,'featurebox')">

//Testing for custom class changing
function getElementsByClassName(oElm, strTagName, strClassName){
	var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName);
	var arrReturnElements = new Array();
	strClassName = strClassName.replace(/\-/g, "\\-");
	var oRegExp = new RegExp("(^|\\s)" + strClassName + "(\\s|$)");
	var oElement;
	for(var i=0; i<arrElements.length; i++){
		oElement = arrElements[i];		
		if(oRegExp.test(oElement.className)){
			arrReturnElements.push(oElement);
		}	
	}
	return (arrReturnElements)
}
// Array support for the push method in IE 5
if(typeof Array.prototype.push != "function"){
	Array.prototype.push = ArrayPush;
	function ArrayPush(value){
		this[this.length] = value;
	}
}


//for dropdown menu and button rollovers to work in IE
var sfHover = function() {
//function sfHover() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
	//formbut
	var jtformbuts = getElementsByClassName(document, "input", "formbut");
	for (var i=0; i<jtformbuts.length; i++) {
		jtformbuts[i].onmouseover=function() {
			this.className="formbutHover";
		}
		jtformbuts[i].onmouseout=function() {
			this.className="formbut";
		}
	}
	//vsearch_button(s)
	var jtvsearch_buttons = getElementsByClassName(document, "input", "vsearch_button");
	for (var i=0; i<jtvsearch_buttons.length; i++) {
		jtvsearch_buttons[i].onmouseover=function() {
			this.className="vsearch_buttonHover";
		}
		jtvsearch_buttons[i].onmouseout=function() {
			this.className="vsearch_button";
		}
	}
	var jtvsearch_buttons2 = getElementsByClassName(document, "button", "vsearch_button");
	for (var i=0; i<jtvsearch_buttons2.length; i++) {
		jtvsearch_buttons2[i].onmouseover=function() {
			this.className="vsearch_buttonHover";
		}
		jtvsearch_buttons2[i].onmouseout=function() {
			this.className="vsearch_button";
		}
	}
	
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

//
function showStatus(sMsg) {
	//setTimeout("window.status = \'" + sMsg + "\';", 0);
    window.status = sMsg ;
    return true ;
}

//for testimonial page
function showComment(whichLayer)
{
	if (document.getElementById)
	{
		// this is the way the standards work
		var style2 = document.getElementById(whichLayer).style;
		style2.display = style2.display? "":"block";
	}
	else if (document.all)
	{
		// this is the way old msie versions work
		var style2 = document.all[whichLayer].style;
		style2.display = style2.display? "":"block";
	}
	else if (document.layers)
	{
		// this is the way nn4 works
		var style2 = document.layers[whichLayer].style;
		style2.display = style2.display? "":"block";
	}
}