/* ####################### start of doublemenu code ####################### */

//new Option("text","value")
//this code changes menus



function nullOptionsDMA(aMenu){
var tot=aMenu.options.length
for (i=0;i<tot;i++)
{
aMenu.options[i]=null
}
aMenu.options.length=0;
}

function MySubjectDMA0(aMenu){
nullOptionsDMA(aMenu)

with (aMenu){

//Rewrites the text and values
options[0]=new Option("Select a page","none");
options[1]=new Option("Modern Living Room","http://www.homebox.co.th/2009/index.php?option=com_content&view=category&layout=blog&id=39&Itemid=62");
options[2]=new Option("Classic Living Room","http://www.homebox.co.th/2009/index.php?option=com_content&view=category&layout=blog&id=40&Itemid=63");
options[3]=new Option("All Living Room","http://www.homebox.co.th/2009/index.php?option=com_content&view=section&layout=blog&id=3&Itemid=58");
options[0].selected=true


}
}
function MySubjectDMA1(aMenu){
nullOptionsDMA(aMenu)

with (aMenu){

//Rewrites the text and values
options[0]=new Option("Select a page","none");
options[1]=new Option("Modern Bed Room","http://www.homebox.co.th/2009/index.php?option=com_content&view=category&layout=blog&id=43&Itemid=66");
options[2]=new Option("Classic Bed Room","http://www.homebox.co.th/2009/index.php?option=com_content&view=category&layout=blog&id=44&Itemid=67");
options[3]=new Option("All Bed Room","http://www.homebox.co.th/2009/index.php?option=com_content&view=section&layout=blog&id=7&Itemid=59");
options[0].selected=true


}
}
function MySubjectDMA2(aMenu){
nullOptionsDMA(aMenu)

with (aMenu){

//Rewrites the text and values
options[0]=new Option("Select a page","none");
options[1]=new Option("Modern Dining Room","http://www.homebox.co.th/2009/index.php?option=com_content&view=category&layout=blog&id=41&Itemid=64");
options[2]=new Option("Classic Dining Room","http://www.homebox.co.th/2009/index.php?option=com_content&view=category&layout=blog&id=42&Itemid=65");
options[3]=new Option("All Dining Room","http://www.homebox.co.th/2009/index.php?option=com_content&view=section&layout=blog&id=6&Itemid=57");
options[0].selected=true


}
}
function MySubjectDMA3(aMenu){
nullOptionsDMA(aMenu)

with (aMenu){

//Rewrites the text and values
options[0]=new Option("Select a page","none");
options[1]=new Option("Modern Studio Room","http://www.homebox.co.th/2009/index.php?option=com_content&view=category&layout=blog&id=49&Itemid=68");
options[2]=new Option("Classic Studio Room","http://www.homebox.co.th/2009/index.php?option=com_content&view=category&layout=blog&id=50&Itemid=69");
options[3]=new Option("All Studio Room","http://www.homebox.co.th/2009/index.php?option=com_content&view=section&layout=blog&id=10&Itemid=60");
options[0].selected=true


}
}
function MySubjectDMA4(aMenu){
nullOptionsDMA(aMenu)

with (aMenu){

//Rewrites the text and values
options[0]=new Option("Select a page","none");
options[1]=new Option("Modern Corner Room","http://www.homebox.co.th/2009/index.php?option=com_content&view=category&layout=blog&id=45&Itemid=70");
options[2]=new Option("Classic Corner Room","http://www.homebox.co.th/2009/index.php?option=com_content&view=category&layout=blog&id=48&Itemid=71");
options[3]=new Option("All Corner Room","http://www.homebox.co.th/2009/index.php?option=com_content&view=section&layout=blog&id=9&Itemid=61");
options[0].selected=true


}
}
function MySubjectDMA5(aMenu){
nullOptionsDMA(aMenu)

with (aMenu){

//Rewrites the text and values
options[0]=new Option("Select a page","none");
options[1]=new Option("Modern Bath Room","http://www.homebox.co.th/2009/index.php?option=com_content&view=category&layout=blog&id=46&Itemid=73");
options[2]=new Option("Classic Bath Room","http://www.homebox.co.th/2009/index.php?option=com_content&view=category&layout=blog&id=47&Itemid=74");
options[3]=new Option("All Bath Room","http://www.homebox.co.th/2009/index.php?option=com_content&view=section&layout=blog&id=8&Itemid=72");
options[0].selected=true


}
}

function MySubjectDMA6(aMenu){
nullOptionsDMA(aMenu)

with (aMenu){

//Rewrites the text and values
options[0]=new Option("Select a page","none");
options[1]=new Option("Modern Kitchen ","http://www.homebox.co.th/2009/index.php?option=com_content&view=category&layout=blog&id=57&Itemid=81");
options[2]=new Option("Classic Kitchen ","http://www.homebox.co.th/2009/index.php?option=com_content&view=category&layout=blog&id=56&Itemid=82");
options[3]=new Option("All Kitchen ","http://www.homebox.co.th/2009/index.php?option=com_content&view=section&layout=blog&id=14&Itemid=80");
options[0].selected=true


}
}
/* ####################### goDM() ####################### */

function goDMA(aMenu){
if (aMenu.options.value!="none")
{
location=aMenu.options[aMenu.selectedIndex].value
} 

}

/* ####################### setUp ####################### */

function setUpDMA(){
with (document.formDoubleMenuDMA) {
if (menuSubjectsDMA.selectedIndex==0){
menuSubjectsDMA.options[0].selected=true
menuFilesDMA.options[0].selected=true
}

if (menuSubjectsDMA.selectedIndex==1)
MySubjectDMA0(menuFilesDMA)
if (menuSubjectsDMA.selectedIndex==2)
MySubjectDMA1(menuFilesDMA)
if (menuSubjectsDMA.selectedIndex==3)
MySubjectDMA2(menuFilesDMA)
if (menuSubjectsDMA.selectedIndex==4)
MySubjectDMA3(menuFilesDMA)
if (menuSubjectsDMA.selectedIndex==5)
MySubjectDMA4(menuFilesDMA)
if (menuSubjectsDMA.selectedIndex==6)
MySubjectDMA5(menuFilesDMA)
if (menuSubjectsDMA.selectedIndex==7)
MySubjectDMA5(menuFilesDMA)

}
}

/* ####################### changeFiles ####################### */

function changeFilesDMA(){
aMenu=document.formDoubleMenuDMA.menuSubjectsDMA
aMenu2=document.formDoubleMenuDMA.menuFilesDMA
with  (aMenu){

switch (selectedIndex) {
case 0:
aMenu2.options.length=0;
aMenu2.options[0]=
new Option("Pages appear here","none")
aMenu2.options[0].selected=true;
history.go(0)
break    
case 1:  
MySubjectDMA0(aMenu2)  
aMenu2.options[0].text="Choose Style"
break       
case 2:  
MySubjectDMA1(aMenu2)  
aMenu2.options[0].text="Choose Style"
break       
case 3:  
MySubjectDMA2(aMenu2)  
aMenu2.options[0].text="Choose Style"
break       
case 4:  
MySubjectDMA3(aMenu2)  
aMenu2.options[0].text="Choose Style"
break       
case 5:  
MySubjectDMA4(aMenu2)  
aMenu2.options[0].text="Choose Style"
break 
case 6:  
MySubjectDMA5(aMenu2)  
aMenu2.options[0].text="Choose Style"
break     
case 7:  
MySubjectDMA6(aMenu2)  
aMenu2.options[0].text="Choose Style"
break   

}
}

}


/* ####################### end of doublemenu code ####################### */



