//------------Splash Navigation Swap-------------------//
function swap_images1(imgname, status){
	document.images[imgname].src="images/splash/"+imgname+status+".gif";
	}


//------------Inside Navigation Swap-------------------//
function swap_images(imgname, status){
	document.images[imgname].src="images/interface/"+imgname+status+".gif";
	}

//Fitting part number generator
function fp(action){
	id=document.ftparts.size.selectedIndex;
	if(id==0 && action==1){warning(); return false;}
	code=document.ftparts.size.options[id].value;
	int_code=document.ftparts.size.options[id].value;
	report="Nominal Size: "+document.ftparts.size.options[id].text+"\n";
	
	id=document.ftparts.ansi.selectedIndex;
	if(id==0 && action==1){warning(); return false;}
	code+=document.ftparts.ansi.options[id].value;
	int_code+="-"+document.ftparts.ansi.options[id].value;
	report+="ANSI Rating: "+document.ftparts.ansi.options[id].text+"\n";

	id=document.ftparts.facing.selectedIndex;
	if(id==0 && action==1){warning(); return false;}
	code+=document.ftparts.facing.options[id].value;
	int_code+="-"+document.ftparts.facing.options[id].value;
	report+="Flange Facing: "+document.ftparts.facing.options[id].text+"\n";

	id=document.ftparts.model.selectedIndex;
	if(id==0 && action==1){warning(); return false;}
	code+=document.ftparts.model.options[id].value;
	int_code+="-"+document.ftparts.model.options[id].value;
	report+="Model: "+document.ftparts.model.options[id].text+"\n";

	id=document.ftparts.pipebore.selectedIndex;
	if(id==0 && action==1){warning(); return false;}
	code+=document.ftparts.pipebore.options[id].value;
	int_code+="-"+document.ftparts.pipebore.options[id].value;
	report+="Bore Schedule: "+document.ftparts.pipebore.options[id].text+"\n";

	id=document.ftparts.trim.selectedIndex;
	if(id==0 && action==1){warning(); return false;}
	code+=document.ftparts.trim.options[id].value;
	int_code+="-"+document.ftparts.trim.options[id].value;
	report+="Trim: "+document.ftparts.trim.options[id].text+"\n";

	id=document.ftparts.valveseal.selectedIndex;
	if(id==0 && action==1){warning(); return false;}
	code+=document.ftparts.valveseal.options[id].value;
	int_code+="-"+document.ftparts.valveseal.options[id].value;
	report+="Valve Seal Type: "+document.ftparts.valveseal.options[id].text+"\n";

	id=document.ftparts.bodyspec.selectedIndex;
	if(id==0 && action==1){warning(); return false;}
	code+=document.ftparts.bodyspec.options[id].value;
	int_code+="-"+document.ftparts.bodyspec.options[id].value;
	report+="Body Material Spec: "+document.ftparts.bodyspec.options[id].text+"\n";

	id=document.ftparts.agaedition.selectedIndex;
	if(id==0 && action==1){warning(); return false;}
	code+=document.ftparts.agaedition.options[id].value;
	int_code+="-"+document.ftparts.agaedition.options[id].value;
	report+="Specification: "+document.ftparts.agaedition.options[id].text+"\n";

	id=document.ftparts.endconf.selectedIndex;
	if(id==0 && action==1){warning(); return false;}
	code+=document.ftparts.endconf.options[id].value;
	int_code+="-"+document.ftparts.endconf.options[id].value;
	report+="End Connect Configuration: "+document.ftparts.endconf.options[id].text+"\n";

	id=document.ftparts.telemeter.selectedIndex;
	if(id==0 && action==1){warning(); return false;}
	code+=document.ftparts.telemeter.options[id].value;
	int_code+="-"+document.ftparts.telemeter.options[id].value;
	report+="Taps: "+document.ftparts.telemeter.options[id].text;

	document.ftparts.full_specs.value=report;

	document.ftparts.fin_code.value=code;
	return true;
}

function warning(){
	alert("All fields are required!");
}

function mrp(action){
	id=document.mrparts.size.selectedIndex;
	if(id==0 && action==1){warningm(); return false;}
	code="M"+document.mrparts.size.options[id].value;
	int_code=document.mrparts.size.options[id].value;
	report="Pipe: "+document.mrparts.size.options[id].text+" ";
	
	id=document.mrparts.schedule.selectedIndex;
	if(id==0 && action==1){warningm(); return false;}
	code+=document.mrparts.schedule.options[id].value;
	int_code+="-"+document.mrparts.schedule.options[id].value;
	report+="Sch. "+document.mrparts.schedule.options[id].text+" ";

	id=document.mrparts.material.selectedIndex;
	if(id==0 && action==1){warningm(); return false;}
	code+=document.mrparts.material.options[id].value;
	int_code+="-"+document.mrparts.material.options[id].value;
	report+=document.mrparts.material.options[id].text+" ";
	
	id=document.mrparts.grade.selectedIndex;
	if(id==0 && action==1){warningm(); return false;}
	code+=document.mrparts.grade.options[id].value+"-";
	int_code+="-"+document.mrparts.grade.options[id].value;
	report+=document.mrparts.grade.options[id].text+" 0/L(inches) ";

	
	if(document.mrparts.overall_lenght.value.replace(/(^\s*)|(\s*$)/g,'')=="" && action==1){warningm(); return false;}
	report+=document.mrparts.overall_lenght.value+"\n";

	//--------------------------------------------------
	id=document.mrparts.rating.selectedIndex;
	if(id==0 && action==1){warningm(); return false;}
	code+=document.mrparts.rating.options[id].value;
	int_code+="-"+document.mrparts.rating.options[id].value;
	report+="Flange: "+document.mrparts.rating.options[id].text+"ANSI ";

	id=document.mrparts.facing.selectedIndex;
	if(id==0 && action==1){warningm(); return false;}
	code+=document.mrparts.facing.options[id].value;
	int_code+="-"+document.mrparts.facing.options[id].value;
	report+=document.mrparts.facing.options[id].text+" ";

	id=document.mrparts.fmaterial.selectedIndex;
	if(id==0 && action==1){warningm(); return false;}
	code+=document.mrparts.fmaterial.options[id].value+"-";
	int_code+="-"+document.mrparts.fmaterial.options[id].value;
	report+=document.mrparts.fmaterial.options[id].text+"\n\n";

	//--------------------------------------------------

	id=document.mrparts.aga.selectedIndex;
	if(id==0 && action==1){warningm(); return false;}
	code+=document.mrparts.aga.options[id].value+"-";
	int_code+="-"+document.mrparts.aga.options[id].value;
	//report+="Body Material Spec: "+document.mrparts.aga.options[id].text+"\n";

	//--------------------------------------------------

	id=document.mrparts.fittconf.selectedIndex;
	if(id==0 && action==1){warningm(); return false;}
	code+=document.mrparts.fittconf.options[id].value;
	int_code+="-"+document.mrparts.fittconf.options[id].value;
	//report+="Specification: "+document.mrparts.fittconf.options[id].text+"\n";

	id=document.mrparts.upstream.selectedIndex;
	if(id==0 && action==1){warningm(); return false;}
	code+=document.mrparts.upstream.options[id].value;
	int_code+="-"+document.mrparts.upstream.options[id].value;
	report+="Outer Up-Stream: "+document.mrparts.upstream.options[id].text+", ";

	id=document.mrparts.downstream.selectedIndex;
	if(id==0 && action==1){warningm(); return false;}
	code+=document.mrparts.downstream.options[id].value+"-";
	int_code+="-"+document.mrparts.downstream.options[id].value;
	report+="Dn-Stream: "+document.mrparts.downstream.options[id].text+"\n";

	//--------------------------------------------------

	id=document.mrparts.dsoutlets.selectedIndex;
	if(id==0 && action==1){warningm(); return false;}
	code+=document.mrparts.dsoutlets.options[id].value;
	int_code+="-"+document.mrparts.dsoutlets.options[id].value;
	report+="Outlets: "+document.mrparts.dsoutlets.options[id].text+", ";

	id=document.mrparts.dsoutlets_1.selectedIndex;
	if(id==0 && action==1){warningm(); return false;}
	code+=document.mrparts.dsoutlets_1.options[id].value;
	int_code+="-"+document.mrparts.dsoutlets_1.options[id].value;
	report+=document.mrparts.dsoutlets_1.options[id].text+", ";

	id=document.mrparts.dsoutlets_2.selectedIndex;
	if(id==0 && action==1){warningm(); return false;}
	code+=document.mrparts.dsoutlets_2.options[id].value;
	int_code+="-"+document.mrparts.dsoutlets_2.options[id].value;
	report+=document.mrparts.dsoutlets_2.options[id].text+", ";

	id=document.mrparts.dsoutlets_3.selectedIndex;
	if(id==0 && action==1){warningm(); return false;}
	code+=document.mrparts.dsoutlets_3.options[id].value+"-";
	int_code+="-"+document.mrparts.dsoutlets_3.options[id].value;
	report+=document.mrparts.dsoutlets_3.options[id].text+"\n";

	//--------------------------------------------------

	id=document.mrparts.flowcond.selectedIndex;
	if(id==0 && action==1){warningm(); return false;}
	code+=document.mrparts.flowcond.options[id].value+"-";
	int_code+="-"+document.mrparts.flowcond.options[id].value;
	report+=document.mrparts.flowcond.options[id].text+"\n";

	//--------------------------------------------------

	id=document.mrparts.treatexam.selectedIndex;
	if(id==0 && action==1){warningm(); return false;}
	code+=document.mrparts.treatexam.options[id].value;
	int_code+="-"+document.mrparts.treatexam.options[id].value;
	report+=document.mrparts.treatexam.options[id].text+", ";

	id=document.mrparts.treatexam_1.selectedIndex;
	if(id==0 && action==1){warningm(); return false;}
	code+=document.mrparts.treatexam_1.options[id].value;
	int_code+="-"+document.mrparts.treatexam_1.options[id].value;
	report+=document.mrparts.treatexam_1.options[id].text+", ";

	id=document.mrparts.treatexam_2.selectedIndex;
	if(id==0 && action==1){warningm(); return false;}
	code+=document.mrparts.treatexam_2.options[id].value;
	int_code+="-"+document.mrparts.treatexam_2.options[id].value;
	report+=document.mrparts.treatexam_2.options[id].text+", ";

	id=document.mrparts.treatexam_3.selectedIndex;
	if(id==0 && action==1){warningm(); return false;}
	code+=document.mrparts.treatexam_3.options[id].value;
	int_code+="-"+document.mrparts.treatexam_3.options[id].value;
	report+=document.mrparts.treatexam_3.options[id].text+"\n";
	
	report+="Includes Hydro Test, MTR 's, Canalta Inspection Report & \n";
	report+="Canalta Standard Paint Procedure \n";
	report+="** Price included with fitting **\n";

	document.mrparts.full_specs.value=report;

	document.mrparts.fin_code.value=code;
	
	document.mrparts.internal_code.value=int_code;
	return true;
}

function warningm(){
	alert("All fields are required!");
}
//-----------------------------