/* ####################### start of code ####################### */

//new Option("text","value")
//this code changes menus



function nullOptions(aMenu){
var tot=aMenu.options.length
for (i=0;i<tot;i++)
{
aMenu.options[i]=null
}
aMenu.options.length=0;
}

/* ####################### DEBITARE ####################### */

function DEB(aMenu){
nullOptions(aMenu)
with (aMenu){
//Rewrites the text and values
options[0]=new Option("Select the machine type","none");
options[1]=new Option("Portable angle grinders","1");
options[2]=new Option("Fixed machines","2");
options[0].selected=true
}
//Netscape likes a refresh, but Microsoft doesn't
if (navigator.appName.indexOf("Netscape")>-1)
history.go(0)
}


/* ####################### DEBAVURARE ####################### */

function DEBAV(aMenu){
nullOptions(aMenu)
with (aMenu){
//Rewrites the text and values
options[0]=new Option("Select the machine type","none");
options[1]=new Option("Portable angle grinders","1"); 
options[0].selected=true
}
//Netscape likes a refresh, but Microsoft doesn't
if (navigator.appName.indexOf("Netscape")>-1)
history.go(0)
}
 
 
 

/* ####################### DEBITARE Portable angle grinders ####################### */

function DEBmasPort(aMenu){
nullOptions(aMenu)
with (aMenu){
//Rewrites the text and values
options[0]=new Option("Select the disc type","none");
options[1]=new Option("Wheels reinforced with inserts","1");
 
options[0].selected=true
}
//Netscape likes a refresh, but Microsoft doesn't
if (navigator.appName.indexOf("Netscape")>-1)
history.go(0)
}


function DEBmasFixe(aMenu){
nullOptions(aMenu)
with (aMenu){
//Rewrites the text and values
options[0]=new Option("Select the disc type","none");
options[1]=new Option("Wheels reinforced with inserts","1");
options[2]=new Option("Wheels without reinforcement","2");
options[0].selected=true
}
//Netscape likes a refresh, but Microsoft doesn't
if (navigator.appName.indexOf("Netscape")>-1)
history.go(0)
}


function DEBAVmasPort(aMenu){
nullOptions(aMenu)
with (aMenu){
//Rewrites the text and values
options[0]=new Option("Select the disc type","none");
options[1]=new Option("Wheels reinforced with inserts","1");
options[0].selected=true
}
//Netscape likes a refresh, but Microsoft doesn't
if (navigator.appName.indexOf("Netscape")>-1)
history.go(0)
}



function DEBmasPortARM(aMenu){
nullOptions(aMenu)
with (aMenu){
//Rewrites the text and values
options[0]=new Option("Select the disc form","none");
options[1]=new Option("1TRS","1");
options[2]=new Option("27TR","2");
options[0].selected=true
}
//Netscape likes a refresh, but Microsoft doesn't
if (navigator.appName.indexOf("Netscape")>-1)
history.go(0)
}


function DEBmasFixeARM(aMenu){
nullOptions(aMenu)
with (aMenu){
//Rewrites the text and values

options[0]=new Option("1TRS","1");
options[0].selected=true
}
//Netscape likes a refresh, but Microsoft doesn't
if (navigator.appName.indexOf("Netscape")>-1)
history.go(0)
}


function DEBmasFixeNEARM(aMenu){
nullOptions(aMenu)
with (aMenu){
//Rewrites the text and values
options[0]=new Option("1TR","3");
options[0].selected=true
}
//Netscape likes a refresh, but Microsoft doesn't
if (navigator.appName.indexOf("Netscape")>-1)
history.go(0)
}



function DEBAVmasPortARM(aMenu){
nullOptions(aMenu)
with (aMenu){
//Rewrites the text and values
options[0]=new Option("Select the disc form","none");
options[1]=new Option("27E","4");
options[2]=new Option("29","5");
options[0].selected=true
}
//Netscape likes a refresh, but Microsoft doesn't
if (navigator.appName.indexOf("Netscape")>-1)
history.go(0)
}



/* ####################### go() ####################### */

function go(aMenu){
if (aMenu.options.value!="none")
{
location=aMenu.options[aMenu.selectedIndex].value
} 
else
aMenu.options[0].selected=true;

}

/* ####################### setUp ####################### */

function setUp(){
if (navigator.appName.indexOf("Microsoft")>-1)
{
document.formMenu.operatia.options[0].selected=true;
document.formMenu.tipmasina.options[0].selected=true;
document.formMenu.tipdisc.options[0].selected=true;
document.formMenu.forma.options[0].selected=true;
}
}

/* ####################### end of setup ####################### */



/* ####################### change operatia ####################### */
function ChangeOperatia(){
aMenu=document.formMenu.operatia;
aMenu2=document.formMenu.tipmasina;
aMenu3=document.formMenu.tipdisc;
aMenu4=document.formMenu.forma;

with  (aMenu){

switch (selectedIndex) {
  
case 1:  
//debitare
nullOptions(aMenu2)
nullOptions(aMenu3)
nullOptions(aMenu4)
aMenu2.options[0]=
new Option("Here you will see the operations","none")
aMenu2.options[0].selected=true;
DEB(aMenu2)  
break       
case 2:  
//debavurare
nullOptions(aMenu2)
nullOptions(aMenu3)
nullOptions(aMenu4)
aMenu2.options[0]=
new Option("Here you will see the operations","none")
aMenu2.options[0].selected=true;
DEBAV(aMenu2)  
break          
 
}
}

}

/* ####################### end of change domenii ####################### */



/* ####################### changeDomeniu ####################### */

function ChangeTipMasina(){
aMenu=document.formMenu.operatia;
aMenu2=document.formMenu.tipmasina;
aMenu3=document.formMenu.tipdisc;
aMenu4=document.formMenu.forma;
/* ####################### operatiile pentru benzi late / operatii (pentru fiecare domeniu) ####################### */

if (aMenu.selectedIndex==1)
{
with  (aMenu2){

switch (selectedIndex) {
case 0:
nullOptions(aMenu3)
aMenu2.options.length=0;
aMenu2.options[0]=
new Option("Here you will see the operations","none")
aMenu2.options[0].selected=true;
history.go(0)
break   
case 1:  
DEBmasPort(aMenu3)  
//benzi late / operatia 1 
break       
case 2:  
DEBmasFixe(aMenu3)  
//benzi late / operatia 2 
break       
     
 
}
}
}

/* ####################### operatiile pentru benzi inguste / operatii (pentru fiecare domeniu) ####################### */
if (aMenu.selectedIndex==2)
{
with  (aMenu2){

switch (selectedIndex) {
case 0:
nullOptions(aMenu3)
aMenu2.options.length=0;
aMenu2.options[0]=
new Option("Here you will see the operations","none")
aMenu2.options[0].selected=true;
history.go(0)
break   
case 1:  
DEBAVmasPort(aMenu3)  
//benzi late / operatia 1 
break       
 
}
}
}

 


}


/* ####################### end of code ####################### */



/* ####################### changeOperatia ####################### */

function ChangeTipDisc(){
aMenu=document.formMenu.operatia;
aMenu2=document.formMenu.tipmasina;
aMenu3=document.formMenu.tipdisc;
aMenu4=document.formMenu.forma;




/* ####################### suporturile pentru benzi late / fiecare domeniu / fiecare operatie ####################### */

if (aMenu.selectedIndex==1)
{

if (aMenu2.selectedIndex==1)
{

	with  (aMenu3){
	switch (selectedIndex) {
	case 0:
	aMenu4.options.length=0;
	aMenu4.options[0]=
	new Option("Here you will see the operations","none")
	aMenu4.options[0].selected=true;
	history.go(0)
	break   
	case 1:  
	DEBmasPortARM(aMenu4)  
	break       
       
	}
	}

}

if (aMenu2.selectedIndex==2)
{

	with  (aMenu3){
	switch (selectedIndex) {
	case 0:
	aMenu4.options.length=0;
	aMenu4.options[0]=
	new Option("Here you will see the operations","none")
	aMenu4.options[0].selected=true;
	history.go(0)
	break   
	case 1:  
	DEBmasFixeARM(aMenu4)  
	break       
    	case 2:  
	DEBmasFixeNEARM(aMenu4)  
	break     
	}
	}

}
  
}



/* ####################### suporturile pentru benzi inguste / fiecare domeniu / fiecare operatie ####################### */

if (aMenu.selectedIndex==2)
{

if (aMenu2.selectedIndex==1)
{


	with  (aMenu3){
	switch (selectedIndex) {
	case 0:
	aMenu4.options.length=0;
	aMenu4.options[0]=
	new Option("Here you will see the operations","none")
	aMenu4.options[0].selected=true;
	history.go(0)
	break   
	case 1:  
	DEBAVmasPortARM(aMenu4)  
	break       
	     
	}
	}

}
    
 
}

 




}
