function popwin(loc,winname,w,h,scroll,resize) {
	eval('var newwin = window.open("' + loc + '","' + winname + '","width=' + w + ',height=' + h + ',top=' + ((screen.height - h) / 2) + ',left=' + ((screen.width - w) / 2) + ',location=no,scrollbars=' + scroll + ',menubar=no,toolbar=no,resizable=' + resize + '")');
}

function locator() {
    popwin('http://www.ridersedge.com/locator/start.htm','locator',635,500,'yes','yes');
}

function survey() {
    popwin('http://www.surveymonkey.com/s.asp?u=57811443964','survey',635,400,'yes','yes');
}

function module() {
    popwin('Fleet_Learn.htm','FleetLearn',675,425,'no','no');
}

function openURL()
{

      // grab index number of the selected option
      selInd = document.theForm.aaa.selectedIndex;

      // get value of the selected option
      goURL = document.theForm.aaa.options[selInd].value;

      // redirect browser to the grabbed value (hopefully a URL)
      top.location.href = goURL;

}

// Universal image rollover functions
var akamai = false;

function checkforakamai() {
	mainloop:for (i = 0; i < document.images.length; i++) {
		var imgsrc = document.images[i].src;
		if (imgsrc.indexOf('akamai.net') != -1) {
			akamai = true;
			break mainloop;
		}
	}
}

function replaceakamai(whichstring) {
	if (akamai) {
		whichstring = whichstring.replace(new RegExp('http://[a-zA-Z0-9/.\-?=_\*]*www\.buell\.com','g'),'http://www.buell.com');
	}
	return whichstring;
}

function imghighlight(whichimg) {
	var imgsrc = new String(whichimg.src);
	imgsrc = replaceakamai(imgsrc);
	imgsrc = imgsrc.replace(new RegExp('_off\.','g'),'_on\.');
	whichimg.src = imgsrc;
}

function imgnohighlight(whichimg) {
	var imgsrc = new String(whichimg.src);
	imgsrc = replaceakamai(imgsrc);
	imgsrc = imgsrc.replace(new RegExp('_on\.','g'),'_off\.');
	whichimg.src = imgsrc;
}


