<!--
/* BODY WOOD */
function changeTonewood(){
	var tonewood = document.bodyConfiguration.selectTonewood[document.bodyConfiguration.selectTonewood.selectedIndex].value;
	var finish = document.bodyConfiguration.selectFinish[document.bodyConfiguration.selectFinish.selectedIndex].value;
	addMatchingHeadstock();
	changeFinish();
	if(finish == "none"){
		document.getElementById('body').innerHTML = '<img alt="" src="img/bodies/' + tonewood + '.png" width="289" height="228" />';
	}
	document.getElementById('body-back').innerHTML = '<img alt="" src="img/bodies/' + tonewood + '-back.png" width="289" height="228" />';
}
/* BODY CONTOUR RADIUS */
function changeContour(){
	var contourRadius = document.bodyConfiguration.selectContour[document.bodyConfiguration.selectContour.selectedIndex].value;
	document.getElementById('body-contour').innerHTML = '<img alt="" src="img/bodies/' + contourRadius + '.png" width="289" height="228" />';
}
/* NECK */
function addNeck(){
	var neck = document.bodyConfiguration.selectNeck[document.bodyConfiguration.selectNeck.selectedIndex].value;
	if(neck != "none"){
		document.getElementById('neck').innerHTML ='<img alt="" src="img/fretboards/' + neck + '.png" width="290" height="36" />';
		document.getElementById('neck-back').innerHTML ='<img alt="" src="img/necks/' + neck + '-back.png" width="305" height="39" />';
		addMatchingHeadstock();
		document.getElementById('logo').innerHTML ='<img alt="" src="img/headstocks/delta-logo.png" width="32" height="30" />';
		document.bodyConfiguration.matchingHeadstock.disabled = false;
		document.getElementById('matchingHeadstockLabel').style.color = '#000000';
	} else {
		document.getElementById('neck').innerHTML ='';
		document.getElementById('neck-back').innerHTML ='';
		document.getElementById('headstock').innerHTML ='';
		document.getElementById('headstock-back').innerHTML ='';
		document.getElementById('logo').innerHTML ='';
		document.bodyConfiguration.matchingHeadstock.disabled = true;
		document.bodyConfiguration.matchingHeadstock.checked = false;
		document.getElementById('matchingHeadstockLabel').style.color = '#999999';
	}
}
/* BODY FINISHES */
function changeFinish(){
	var finish = document.bodyConfiguration.selectFinish[document.bodyConfiguration.selectFinish.selectedIndex].value;
	addMatchingHeadstock();
	//changeTonewood();
	if(finish != "none"){
		if(finish.indexOf("see-through") == 0 || finish.indexOf("sunburst") == 0 || finish.indexOf("oiled") == 0 || finish.indexOf("mary-kay") == 0){
			var tonewood = document.bodyConfiguration.selectTonewood[document.bodyConfiguration.selectTonewood.selectedIndex].value;
			finish = finish + '-' + tonewood;
			document.bodyConfiguration.matchingHeadstock.disabled = true;
			document.bodyConfiguration.matchingHeadstock.checked = false;
		} else {
			document.bodyConfiguration.matchingHeadstock.disabled = false;
		}
		document.getElementById('finish').innerHTML = '<img alt="" src="img/finishes/' + finish + '.png" width="289" height="228" />';
		/* document.getElementById('finish-back').innerHTML = '<img alt="" src="img/finishes/' + finish + '-back.png" width="289" height="228" />'; */
	} else {
		document.getElementById('finish').innerHTML = '';
		document.getElementById('finish-back').innerHTML = '';
	}
}
/* MATCHING HEADSTOCK */
function addMatchingHeadstock(){
	var finish = document.bodyConfiguration.selectFinish[document.bodyConfiguration.selectFinish.selectedIndex].value;
	var neck = document.bodyConfiguration.selectNeck[document.bodyConfiguration.selectNeck.selectedIndex].value;
	if(neck != "none"){
		if(document.bodyConfiguration.matchingHeadstock.checked && finish != "none" &&
			finish.indexOf("see-through") != 0 && finish.indexOf("sunburst") != 0 && finish.indexOf("oiled") != 0){
			document.getElementById('headstock').innerHTML ='<img alt="" src="img/headstocks/' + finish +'.png" width="102" height="73" />';
			document.getElementById('headstock-back').innerHTML ='<img alt="" src="img/headstocks/maple-back.png" width="102" height="73" />';
		} else {
			document.getElementById('headstock').innerHTML ='<img alt="" src="img/headstocks/maple.png" width="102" height="73" />';
			document.getElementById('headstock-back').innerHTML ='<img alt="" src="img/headstocks/maple-back.png" width="102" height="73" />';
		}
	}
}
/* BODY PICKUPS ROUTING*/
function addBridgePU(){
	var PUtype = document.bodyConfiguration.selectBridgePU[document.bodyConfiguration.selectBridgePU.selectedIndex].value;
	if(PUtype == "sc"){
		var PUvariant = "-bridge";
	} else {
		var PUvariant = "-body";
	}
	if(PUtype != "none"){
		document.getElementById('bridgePU').innerHTML = '<img alt="" src="img/pickups/' + PUtype + PUvariant + '.png" width="26" height="60" />';
	} else {
		document.getElementById('bridgePU').innerHTML = '';
	}
}
function addMiddlePU(){
	var PUtype = document.bodyConfiguration.selectMiddlePU[document.bodyConfiguration.selectMiddlePU.selectedIndex].value;
	if(PUtype != "none"){
		document.getElementById('middlePU').innerHTML = '<img alt="" src="img/pickups/' + PUtype + '-body.png" width="26" height="60" />';
	} else {
		document.getElementById('middlePU').innerHTML = '';
	}
}
function addNeckPU(){
	var PUtype = document.bodyConfiguration.selectNeckPU[document.bodyConfiguration.selectNeckPU.selectedIndex].value;
	var SPV1material = document.bodyConfiguration.selectScratchplateV1[document.bodyConfiguration.selectScratchplateV1.selectedIndex].value;
	var SPV2material = document.bodyConfiguration.selectScratchplateV1[document.bodyConfiguration.selectScratchplateV2.selectedIndex].value;
	if((SPV1material == "none" || SPV1material == "clear") && (SPV2material == "none" || SPV2material == "clear")){
		var PUvariant = "-body";
	} else {
		var PUvariant = "-scratchplate";
	}
	if(PUtype != "none"){
		document.getElementById('neckPU').innerHTML = '<img alt="" src="img/pickups/' + PUtype + PUvariant + '.png" width="26" height="60" />';
	} else {
		document.getElementById('neckPU').innerHTML = '';
	}
}
/* FOREARM CONTOUR / TUMMY CUT */
function addArmCut(){
	var armCut = document.bodyConfiguration.selectArmCut[document.bodyConfiguration.selectArmCut.selectedIndex].value;
	if(armCut != "none"){
		document.getElementById('armCut').innerHTML = '<img alt="" src="img/bodies/' + armCut + '.png" width="180" height="118" />';
	} else {
		document.getElementById('armCut').innerHTML = '';
	}
}
function addTummyCut(){
	var tummyCut = document.bodyConfiguration.selectTummyCut[document.bodyConfiguration.selectTummyCut.selectedIndex].value;
	if(tummyCut == "tummy-cut"){
		document.getElementById('tummyCut').innerHTML = '<img alt="" src="img/bodies/' + tummyCut + '.png" width="289" height="228" />';
	} else {
		document.getElementById('tummyCut').innerHTML = '';
	}
}
/* SEMI-HOLLOW */
function addFHole(){
	var fHole = document.bodyConfiguration.selectSemiHollow[document.bodyConfiguration.selectSemiHollow.selectedIndex].value;
	if(fHole != "none"){
		document.getElementById('fHole').innerHTML = '<img alt="" src="img/bodies/' + fHole + '.png" width="84" height="39" />';
		//document.getElementById('throughHole-back').innerHTML = '<img alt="" src="img/bodies/' + throughHole + '-back.png" width="84" height="39" />';
	} else {
		document.getElementById('fHole').innerHTML = '';
		//document.getElementById('throughHole-back').innerHTML = '';
	}
}

/* INSERTS */
function changeInserts(){
	var insertType = document.bodyConfiguration.selectInserts[document.bodyConfiguration.selectInserts.selectedIndex].value;
	if(insertType == "bigsby-b5"){
		document.getElementById('bigsbyInserts').innerHTML = '<img alt="" src="img/inserts/' + insertType + '.png" width="68" height="55" />';
		document.getElementById('bridgeInserts').innerHTML = '<img alt="" src="img/inserts/bridge.png" width="40" height="63" />';
	} else if(insertType != "none"){
		document.getElementById('bridgeInserts').innerHTML = '<img alt="" src="img/inserts/' + insertType + '.png" width="40" height="63" />';
				document.getElementById('bigsbyInserts').innerHTML = '';
	} else {
		document.getElementById('bridgeInserts').innerHTML = '';
		document.getElementById('bigsbyInserts').innerHTML = '';
	}
	if(insertType == "bridge-through-holes"){
		document.getElementById('bridgeInserts-back').innerHTML = '<img alt="" src="img/inserts/' + insertType + '-back.png" width="14" height="63" />';
	} else {
		document.getElementById('bridgeInserts-back').innerHTML = '';
	}
}
/* BODY SWITCH HOLE / ROUTING */
function addSwitchRouting(){
	var switchRouting = document.bodyConfiguration.selectSwitchRouting[document.bodyConfiguration.selectSwitchRouting.selectedIndex].value;
	var switchHole = "toggle-switch";
	if(document.bodyConfiguration.selectScratchplateV1.selectedIndex == 0){
		var SPV1selected = "no";
	} else {
		var SPV1selected = "yes";
	}
	if(document.bodyConfiguration.selectScratchplateV2.selectedIndex == 0){
		var SPV2selected = "no";
	} else {
		var SPV2selected = "yes";
	}
	if(switchRouting != "none"){
		document.getElementById('switchHole').innerHTML = '<img alt="" src="img/bodies/' + switchHole + '.png" width="38" height="38" />';
		document.getElementById('switchHole-back').innerHTML = '<img alt="" src="img/bodies/' + switchHole + '.png" width="38" height="38" />';
		if(SPV1selected == "yes" && document.bodyConfiguration.selectScratchplateV1.disabled == false){
			document.getElementById('switchRouting-back').innerHTML = '';
			document.getElementById('switchRouting').innerHTML = '<img alt="" src="img/bodies/' + switchRouting + '.png" width="38" height="28" />';
			document.getElementById('switchHole-back').innerHTML = '';
			document.getElementById('routing-info').innerHTML = 'front routing';
		} else if(SPV2selected == "yes" && document.bodyConfiguration.selectScratchplateV2.disabled == false){
			document.getElementById('switchRouting').innerHTML = '';
			document.getElementById('switchRouting-back').innerHTML = '<img alt="" src="img/bodies/' + switchRouting + '.png" width="38" height="28" />';
			document.getElementById('routing-info').innerHTML = 'back routing';
		} else {
			document.getElementById('switchRouting').innerHTML = '';
			document.getElementById('switchRouting-back').innerHTML = '<img alt="" src="img/bodies/' + switchRouting + '.png" width="38" height="28" />';
			document.getElementById('routing-info').innerHTML = 'back routing';
		}
	} else {
		document.getElementById('switchRouting').innerHTML = '';
		document.getElementById('switchRouting-back').innerHTML = '';
		document.getElementById('switchHole').innerHTML = '';
		document.getElementById('switchHole-back').innerHTML = '';
		document.getElementById('routing-info').innerHTML = '';
	}
}
/* CONTROL HOLE(S) */
function addControlHole(holeNumber){
	var switchHole = "toggle-switch";
	if(document.bodyConfiguration.hole[holeNumber].checked){
		document.getElementById('controlHole' + holeNumber + '-back').innerHTML = '<img alt="" src="img/bodies/' + switchHole + '.png" width="38" height="38" />';
		document.getElementById('controlHole' + holeNumber).innerHTML = '<img alt="" src="img/bodies/' + switchHole + '.png" width="38" height="38" />';
	} else {
		document.getElementById('controlHole' + holeNumber + '-back').innerHTML = '';
		document.getElementById('controlHole' + holeNumber).innerHTML = '';
	}
}
/* SCRATCHPLATE V1 */
function addScratchplateV1(){
	var SPmaterial = document.bodyConfiguration.selectScratchplateV1[document.bodyConfiguration.selectScratchplateV1.selectedIndex].value;
	var PUtype = document.bodyConfiguration.selectNeckPU[document.bodyConfiguration.selectNeckPU.selectedIndex].value;
	var switchRouting = document.bodyConfiguration.selectSwitchRouting[document.bodyConfiguration.selectSwitchRouting.selectedIndex].value;
	var switchHole = "toggle-switch";
	document.bodyConfiguration.selectScratchplateV1.disabled = false;
	if(PUtype != "none"){ addNeckPU(PUtype); }
	if(SPmaterial != "none"){
		document.getElementById('scratchplate').innerHTML = '<img alt="" src="img/scratchplates/' + SPmaterial + '.png" width="150" height="170" />';
		document.getElementById('scratchplateScrews').innerHTML = '<img alt="" src="img/scratchplates/screws.png" width="150" height="170" />';
		//document.bodyConfiguration.selectMiddlePU.disabled = true;
		document.bodyConfiguration.selectScratchplateV2.disabled = true;
		//document.getElementById('middlePUinfoLabel').style.color = '#999999';
		// document.getElementById('universalRouting').disabled = false; //
		//document.getElementById('middlePU').innerHTML = '';
		if(switchRouting != "none"){
			document.getElementById('switchHole-back').innerHTML = '';
			document.getElementById('switchRouting').innerHTML = '<img alt="" src="img/bodies/' + switchRouting + '.png" width="38" height="28" />'
			document.getElementById('switchRouting-back').innerHTML = '';
			document.getElementById('routing-info').innerHTML = 'front routing ';
		}
	} else {
		document.getElementById('scratchplate').innerHTML = '';
		document.getElementById('scratchplateScrews').innerHTML = '';
		document.getElementById('SProuting').innerHTML = '';
		document.bodyConfiguration.selectMiddlePU.disabled = false;
		document.bodyConfiguration.selectScratchplateV2.disabled = false;
		document.getElementById('middlePUinfoLabel').style.color = '#000000';
		/* document.getElementById('universalRouting').disabled = true; */
		if(switchRouting != "none"){
			document.getElementById('switchHole').innerHTML = '<img alt="" src="img/bodies/' + switchHole + '.png" width="38" height="38" />';
			document.getElementById('switchHole-back').innerHTML = '<img alt="" src="img/bodies/' + switchHole + '.png" width="38" height="38" />';
			document.getElementById('switchRouting').innerHTML = ''
			document.getElementById('switchRouting-back').innerHTML = '<img alt="" src="img/bodies/' + switchRouting + '.png" width="38" height="28" />';
			document.getElementById('routing-info').innerHTML = 'back routing';
		}
		addMiddlePU();
	}
}
/* SCRATCHPLATE V2 */
function addScratchplateV2(){
	var SPmaterial = document.bodyConfiguration.selectScratchplateV2[document.bodyConfiguration.selectScratchplateV2.selectedIndex].value;
	var PUtype = document.bodyConfiguration.selectNeckPU[document.bodyConfiguration.selectNeckPU.selectedIndex].value;
	var switchRouting = document.bodyConfiguration.selectSwitchRouting[document.bodyConfiguration.selectSwitchRouting.selectedIndex].value;
	var switchHole = "toggle-switch";
	document.bodyConfiguration.selectScratchplateV2.disabled = false;
	if(PUtype != "none"){ addNeckPU(PUtype); }
	if(SPmaterial != "none"){
		document.getElementById('scratchplate').innerHTML = '<img alt="" src="img/scratchplates/' + SPmaterial + '.png" width="150" height="170" />';
		document.bodyConfiguration.selectMiddlePU.disabled = true;
		document.bodyConfiguration.selectScratchplateV1.disabled = true;
		document.getElementById('middlePUinfoLabel').style.color = '#999999';
		/* document.getElementById('universalRouting').disabled = false; */
		document.getElementById('middlePU').innerHTML = '';
		if(switchRouting != "none"){
			document.getElementById('switchHole-back').innerHTML = '<img alt="" src="img/bodies/' + switchHole + '.png" width="38" height="38" />';
			document.getElementById('switchRouting').innerHTML = '';
			document.getElementById('switchRouting-back').innerHTML = '<img alt="" src="img/bodies/' + switchRouting + '.png" width="38" height="28" />';
			document.getElementById('routing-info').innerHTML = 'back routing ';
		}
	} else {
		document.getElementById('scratchplate').innerHTML = '';
		document.getElementById('SProuting').innerHTML = '';
		document.bodyConfiguration.selectMiddlePU.disabled = false;
		document.bodyConfiguration.selectScratchplateV1.disabled = false;
		document.getElementById('middlePUinfoLabel').style.color = '#000000';
		/* document.getElementById('universalRouting').disabled = true; */
		if(switchRouting != "none"){
			document.getElementById('switchHole').innerHTML = '<img alt="" src="img/bodies/' + switchHole + '.png" width="38" height="38" />';
			document.getElementById('switchHole-back').innerHTML = '<img alt="" src="img/bodies/' + switchHole + '.png" width="38" height="38" />';
			document.getElementById('switchRouting').innerHTML = ''
			document.getElementById('switchRouting-back').innerHTML = '<img alt="" src="img/bodies/' + switchRouting + '.png" width="38" height="28" />';
			document.getElementById('routing-info').innerHTML = 'back routing';
		}
		addMiddlePU();
	}
}
/* PREVIEW POP-UP */
function previewInnerHtml(){
	var config = document.getElementById('preview-front').innerHTML;
	document.previewForm.hiddenConfig.value = config;
	document.previewForm.submit();
}
-->
