var scrwidth = screen.availWidth;
var midpoint = screen.availWidth/2;

if((navigator.appName.indexOf("Netscape") != -1) && (navigator.appVersion.indexOf("4.") == 0)){
	n4 = true;
	ie = false;
}else{
	n4 = false;
	ie = true; 	
}

function buttonUp(which){
// 1 is bedroom/b - 2 is livingroom/r - 3 is diningroom/g
	switch(which){
		case 1:
           	document.images.bedroombtn.src="images/btnselbup.gif"
			break;
		case 2:
           	document.images.livroombtn.src="images/btnselrup.gif"
			break;
		case 3:
           	document.images.dinroombtn.src="images/btnselgup.gif"
	}

}


function buttonOut(which){
// 1 is bedroom - 2 is livingroom - 3 is diningroom
	switch(which){
		case 1:
    		document.images.bedroombtn.src="images/btnselbfl.gif"
			break;
		case 2:
           	document.images.livroombtn.src="images/btnselrfl.gif"
			break;
		case 3:
           	document.images.dinroombtn.src="images/btnselgfl.gif"
	}
}


function buttonDn(which){
// 1 is bedroom - 2 is livingroom - 3 is diningroom
	switch(which){
		case 1:
    		document.images.bedroombtn.src="images/btnselbdn.gif"    		
			break;
		case 2:
    		document.images.livroombtn.src="images/btnselrdn.gif"    		
			break;
		case 3:
    		document.images.dinroombtn.src="images/btnselgdn.gif"    		
	}
}


function raiseMenu(which){
which = which + 5;
document.amenu.src = imagesArray[which].src;
}

function lowerMenu(){
document.amenu.src = imagesArray[5].src;
}

theimg = 1;
function swapimg(){
document.telno.src = directory+"telnum1.gif";
}
function swapbck(){
document.telno.src = directory + "telnum.gif";
}

function cushionOver(which){
	switch(which){
		case 1:
			document.smallcushions.src = directory + "hsiconb.gif";	
			break;
		case 2:
			document.smallcushions.src = directory + "hsiconl.gif";	
			break;
		case 3:
			document.smallcushions.src = directory + "hsicond.gif";	

	}
	buttonUp(which);
}

function cushionOut(which){
			buttonOut(which);
			document.smallcushions.src = directory + "hsicons.gif";	
}

function setbedroom(t,m)
{

// if(navigator.appName == "Netscape"){
	setAll("Products");		
//		window.location="b"+document.menu.bedtype[t].value+"_"+document.menu.bedmaker[m].value+"_1.html";
//			alert("You have selected Bedroom page\n\nb"+t+"_"+m+"_1.html");
//        window.location="b"+t+"_"+m+"_1.html";
//}else{
//			alert("You have selected page\n\nb"+t+"_"+m+"_1.html");

         window.location="b"+t+"_"+m+"_1.html";
//}
}

function setlivingroom(t,m)
{
	setAll("Products");		
    window.location="l"+t+"_"+m+"_1.html";
//	if(navigator.appName == "Netscape"){
//			alert("You have selected Livingroom page\n\nl"+t+"_"+m+"_1.html");
//		window.location="l"+document.livprodppp.document.menu.livetype[t].value+"_"+document.livprodppp.document.menu.livemaker[m].value+"_1.html";
//	}else{
//			alert("You have selected Livingroom page\n\nl"+t+"_"+m+"_1.html");
      window.location="l"+t+"_"+m+"_1.html";
//	}
}

function setdiningroom(t,m)
{
	setAll("Products");		
    window.location="d"+t+"_"+m+"_1.html";
//	if(navigator.appName == "Netscape"){
//			alert("You have selected Diningroom page\n\nd"+t+"_"+m+"_1.html");
//		window.location="d"+document.dinprodppp.document.menu.dinetype[t].value+"_"+document.dinprodppp.document.menu.dinemaker[m].value+"_1.html";
//	}else{
//			alert("You have selected Diningroom page\n\nd"+t+"_"+m+"_1.html");
//		window.location="d"+document.menu.dinetype[t].value+"_"+document.menu.dinemaker[m].value+"_1.html";
//	}
}

function goback()
{
     window.history.back();
// the alternative Window funtion is "window.back()" but this does not seem to work
}

function setProducts(whichone){
	switch(whichone){
		case "bedtype":
			document.menu.livetype.options[0].text = "Products";
			document.menu.livemaker.options[0].text = "Made By";
			document.menu.dinetype.options[0].text = "Products";
			document.menu.dinemaker.options[0].text = "Made By";
			document.menu.livetype.options[0].selected = true;
			document.menu.livemaker.options[0].selected = true;
			document.menu.dinetype.options[0].selected = true;
			document.menu.dinemaker.options[0].selected = true;
            break;
		case "livetype":
			document.menu.bedtype.options[0].text = "Products";
			document.menu.bedmaker.options[0].text = "Made By";
			document.menu.dinetype.options[0].text = "Products";
			document.menu.dinemaker.options[0].text = "Made By";
			document.menu.bedtype.options[0].selected = true;
			document.menu.bedmaker.options[0].selected = true;
			document.menu.dinetype.options[0].selected = true;
			document.menu.dinemaker.options[0].selected = true;
            break;
		case "dinetype":
			document.menu.bedtype.options[0].text = "Products";
			document.menu.bedmaker.options[0].text = "Made By";
			document.menu.livetype.options[0].text = "Products";
			document.menu.livemaker.options[0].text = "Made By";
			document.menu.bedtype.options[0].selected = true;
			document.menu.bedmaker.options[0].selected = true;
			document.menu.livetype.options[0].selected = true;
			document.menu.livemaker.options[0].selected = true;

	}
}

function setAll(whichone){

	switch(whichone){
		case "bedtype":
				document.menu.bedtype.options[0].text = "---All---";
				setProducts(whichone);				
			break;

		case "bedmaker":
				document.menu.bedmaker.options[0].text = "---All---";
				setProducts(whichone);
        	break;

		case "livetype":
				document.menu.livetype.options[0].text = "---All---";
				setProducts(whichone);
			break;
		case "livemaker":
				document.menu.livemaker.options[0].text = "---All---";
				setProducts(whichone);
        	break;

		case "dinetype":
				document.menu.dinetype.options[0].text = "---All---";
				setProducts(whichone);
			break;

		case "dinemaker":
				document.menu.dinemaker.options[0].text = "---All---";
				setProducts(whichone);
			break;
		case "Products":
			document.menu.bedtype.options[0].text = "Products";
			document.menu.bedmaker.options[0].text = "Made By";
			document.menu.livetype.options[0].text = "Products";
			document.menu.livemaker.options[0].text = "Made By";
			document.menu.dinetype.options[0].text = "Products";
			document.menu.dinemaker.options[0].text = "Made By";

	}
}

var imagesArray = new Array(23);

function loadimages(){
// 03-08-01 .JPGs have been changed to .GIFs to prevent image variations
// 03-08-01 image sizes altered to suit the Screen width

directory = "images/"
var pxlswide = 250;
var pxlshigh = 64;

if(scrwidth >= 1024){pxlswide = 320; pxlshigh = 77; directory="images10/"}

	imagesArray[0] = new Image(pxlshigh, pxlswide);
	imagesArray[0].src = directory+"ihlogo3.gif";

	imagesArray[1] = new Image(340, 1);
	imagesArray[1].src = directory+"spacer400.gif";


// 235 x 56 is for 1024 x 768  180 x 44 is for 800 x 600
	pxlswide = 180;
	pxlshigh = 165;

//	if(scrwidth >= 1024){pxlswide = 235; pxlshigh = 56;}
	if(scrwidth >= 1024){pxlswide = 230; pxlshigh = 211;}

	imagesArray[2] = new Image(pxlshigh, pxlswide);
	imagesArray[2].src = directory+"hsiconb.gif";

	imagesArray[3] = new Image(pxlshigh, pxlswide);
	imagesArray[3].src = directory+"hsicond.gif";

	imagesArray[4] = new Image(pxlshigh, pxlswide);
	imagesArray[4].src = directory+"hsiconl.gif";


// 220 x 200 is for 1024 x 768	  180 x 164 is for 800 x 600
	pxlswide = 180;
	pxlshigh = 164;

	if(scrwidth >= 1024){pxlswide = 220; pxlshigh = 200;}

	imagesArray[5] = new Image(pxlshigh, pxlswide);
	imagesArray[5].src = directory+"menu01.gif";

	imagesArray[6] = new Image(pxlshigh, pxlswide);
	imagesArray[6].src = directory+"menu1.gif";

	imagesArray[7] = new Image(pxlshigh, pxlswide);
	imagesArray[7].src = directory+"menu2.gif";

	imagesArray[8] = new Image(pxlshigh, pxlswide);
	imagesArray[8].src = directory+"menu3.gif";

	imagesArray[9] = new Image(pxlshigh, pxlswide);
	imagesArray[9].src = directory+"menu4.gif";

	imagesArray[10] = new Image(pxlshigh, pxlswide);
	imagesArray[10].src = directory+"menu5.gif";

	imagesArray[11] = new Image(pxlshigh, pxlswide);
	imagesArray[11].src = directory+"menu6.gif";

	directory = "images/";
	pxlswide = 163;
	pxlshigh = 32;

	imagesArray[12] = new Image(pxlshigh, pxlswide);
	imagesArray[12].src = directory+"btnselbfl.gif";	
	imagesArray[13] = new Image(pxlshigh, pxlswide);
	imagesArray[13].src = directory+"btnselbup.gif";
	imagesArray[14] = new Image(pxlshigh, pxlswide);
	imagesArray[14].src = directory+"btnselbdn.gif";	

	imagesArray[15] = new Image(pxlshigh, pxlswide);
	imagesArray[15].src = directory+"btnselrfl.gif";	
	imagesArray[16] = new Image(pxlshigh, pxlswide);
	imagesArray[16].src = directory+"btnselrup.gif";	
	imagesArray[17] = new Image(pxlshigh, pxlswide);
	imagesArray[17].src = directory+"btnselrdn.gif";	

	imagesArray[18] = new Image(pxlshigh, pxlswide);
	imagesArray[18].src = directory+"btnselgfl.gif";	
	imagesArray[19] = new Image(pxlshigh, pxlswide);
	imagesArray[19].src = directory+"btnselgup.gif";	
	imagesArray[20] = new Image(pxlshigh, pxlswide);
	imagesArray[20].src = directory+"btnselgdn.gif";	


	directory = "images/";
	pxlswide = 138;
	pxlshigh = 450;
	if(scrwidth >= 1024){directory="images10/"; pxlswide = 138; pxlshigh = 600;}

	imagesArray[21] = new Image(pxlshigh, pxlswide);
	imagesArray[21].src = directory+"telnum.gif";	
	imagesArray[22] = new Image(pxlshigh, pxlswide);
	imagesArray[22].src = directory+"telnum1.gif";	


//	directory = "images/";
//	pxlswide = 320;
//	pxlshigh = 125;

//	if(scrwidth >= 1024){pxlswide = 410; pxlshigh = 160; directory="images10/"}


}
