// Model view functionsvar viewdir = '';var viewpage;var viewleft = new Array();var activecolor = 1; var activeview = 1;function switchview(whichview) {	if (whichview != activeview) {		if (activeview != 0) {			document.getElementById('viewimg' + activeview).src = '../../../../../images/products/motorcycles/viewsnav/view_' + activeview + '_off.jpg';		}		document.getElementById('viewimg' + whichview).src = '../../../../../images/products/motorcycles/viewsnav/view_' + whichview + '_active.jpg';		activeview = whichview;		document.getElementById('viewlargerdiv').style.left = viewleft[activeview] + 'px';		document.getElementById('mainphoto').src = viewdir + 'mainphoto_color' + activecolor + '_view' + activeview + '.jpg';	}}function switchcolor(whichcolor) {	if (whichcolor != activecolor) {		if (activecolor != 0) {			document.getElementById('colorimg' + activecolor).src = viewdir + 'color_' + activecolor + '_off.jpg';		}		document.getElementById('colorimg' + whichcolor).src = viewdir + 'color_' + whichcolor + '_active.jpg';		activecolor = whichcolor;		document.getElementById('mainphoto').src = viewdir + 'mainphoto_color' + activecolor + '_view' + activeview + '.jpg';		document.getElementById('colortext').src = viewdir + 'color' + activecolor + '.jpg';	}}function openlargeview() {	popwin(viewpage + '?photo=' + activeview + '&color=' + activecolor,'photogallery',700,400,'no','no');}// Model features functionsvar featureimages = new Array();var activefeature = 0;function buildfeaturetext(numfeatures) {	var featstylestring = '<style type="text/css">\n';	for (i = 1; i < (numfeatures + 1); i++) {		featstylestring += '#featuretext_' + i + ' { visibility: hidden; display: none; }\n';	}	featstylestring += '<\/style>';	document.write(featstylestring);}function activatefeatureimg(whichimg) {	var imgsrc = new String(whichimg.src);	alert(imgsrc);	imgsrc = imgsrc.replace(new RegExp('features_','g'),'featuresvisited_');	whichimg.src = imgsrc;}function switchfeature(whichfeature) {	if (whichfeature != activefeature) {		document.getElementById('featuredetailphoto').src = featureimages[whichfeature];		document.getElementById('featuretext_' + activefeature).style.visibility = 'hidden';		document.getElementById('featuretext_' + activefeature).style.display = 'none';		if (activefeature != 0) {			document.getElementById('featureimg' + activefeature).src = '../../../../../images/products/motorcycles/featuresnav/featuresvisited_' + activefeature + '_off.jpg';		}		document.getElementById('featuretext_' + whichfeature).style.visibility = 'visible';		document.getElementById('featuretext_' + whichfeature).style.display = 'block';		document.getElementById('featureimg' + whichfeature).src = '../../../../../images/products/motorcycles/featuresnav/features_' + whichfeature + '_active.jpg';		activefeature = whichfeature;	}}// Model gallery functionsvar galleryimages = new Array();var activegallery = 1;var wallpaperpage;var wallpaperimages = new Array();function switchgallery(whichgallery) {	if (whichgallery != activegallery) {		document.getElementById('galleryphotoimage').src = galleryimages[whichgallery];		if (activegallery != 0) {			document.getElementById('galleryimg' + activegallery).src = gallerydir + 'gallery_' + activegallery + '_off.jpg';		}		document.getElementById('galleryimg' + whichgallery).src = gallerydir + 'gallery_' + whichgallery + '_active.jpg';		activegallery = whichgallery;	}}function checkwallpaperlink() {	var wallpaperlink = false;	if (wallpaperimages[activegallery] != null) {		wallpaperlink = true;	}	if (wallpaperlink) {		document.getElementById('wallpaperlink').style.visibility = 'visible';		document.getElementById('wallpaperlink').style.display = 'block';	} else {		document.getElementById('wallpaperlink').style.visibility = 'hidden';		document.getElementById('wallpaperlink').style.display = 'none';	}}function openwallpaper() {	popwin('../../wallpaper_popup.asp?model=' + wallpapermodel + '&wpset=' + activegallery,'wallpaper',500,400,'yes','no');}function openlargegallery() {	popwin(gallerypage + '?photo=' + activegallery,'photogallery',700,400,'no','no');}