var imgTNav = new Array();
var curTNavName;
var curTNavIndex;
var curTNavIndex2;

function initTNav(lang)
{
	imgTNav[0] = new Image();
	imgTNav[0].src = "/site/images/menu/home_"+ lang +"_0.gif";
	imgTNav[1] = new Image();
	imgTNav[1].src = "/site/images/menu/home_"+ lang +"_1.gif";
	imgTNav[2] = new Image();
	imgTNav[2].src = "/site/images/menu/home_"+ lang +"_2.gif";
	imgTNav[3] = new Image();
	imgTNav[3].src = "/site/images/menu/machine_"+ lang +"_0.gif";
	imgTNav[4] = new Image();
	imgTNav[4].src = "/site/images/menu/machine_"+ lang +"_1.gif";
	imgTNav[5] = new Image();
	imgTNav[5].src = "/site/images/menu/machine_"+ lang +"_2.gif";
	imgTNav[6] = new Image();
	imgTNav[6].src = "/site/images/menu/trybuy_"+ lang +"_0.gif";
	imgTNav[7] = new Image();
	imgTNav[7].src = "/site/images/menu/trybuy_"+ lang +"_1.gif";
	imgTNav[8] = new Image();
	imgTNav[8].src = "/site/images/menu/trybuy_"+ lang +"_2.gif";
	imgTNav[9] = new Image();
	imgTNav[9].src = "/site/images/menu/about_"+ lang +"_0.gif";
	imgTNav[10] = new Image();
	imgTNav[10].src = "/site/images/menu/about_"+ lang +"_1.gif";
	imgTNav[11] = new Image();
	imgTNav[11].src = "/site/images/menu/about_"+ lang +"_2.gif";
	imgTNav[12] = new Image();
	imgTNav[12].src = "/site/images/menu/support_"+ lang +"_0.gif";
	imgTNav[13] = new Image();
	imgTNav[13].src = "/site/images/menu/support_"+ lang +"_1.gif";
	imgTNav[14] = new Image();
	imgTNav[14].src = "/site/images/menu/support_"+ lang +"_2.gif";
	imgTNav[15] = new Image();
	imgTNav[15].src = "/site/images/menu/press_"+ lang +"_0.gif";
	imgTNav[16] = new Image();
	imgTNav[16].src = "/site/images/menu/press_"+ lang +"_1.gif";
	imgTNav[17] = new Image();
	imgTNav[17].src = "/site/images/menu/press_"+ lang +"_2.gif";
}

function swapImgTNav(name, index)
{
	if(name != curTNavName && (index != curTNavIndex || index != curTNavIndex2))
	{
		document.images[name].src = imgTNav[index].src;
	}
}

var img = new Array(6);
var cur_sel = NaN;

function init(lang)
{
	for(i = 0; i < img.length; i++)
	{
		img[i] = new Array();
		img[i][0] = new Image();
		img[i][0].src = "/site/images/Nav_Top_" + lang + "/nav_" + (i + 1) + "_1.gif";
		img[i][1] = new Image();
		img[i][1].src = "/site/images/Nav_Top_" + lang + "/nav_" + (i + 1) + "_2.gif";
		img[i][2] = new Image();
		img[i][2].src = "/site/images/Nav_Top_" + lang + "/nav_" + (i + 1) + "_3.gif";
		img[i][3] = new Image();
		img[i][3].src = "/site/images/Nav_Top_" + lang + "/nav_" + (i + 1) + "_4.gif";
	}
}

function swapImg(name, arrIndex, index)
{

	if(arrIndex+1 == cur_sel && index == 0)
		index = 2;
	if(arrIndex+1 == cur_sel && index == 1)
		index = 3;
	if(arrIndex == cur_sel && index == 0)
		index = 1;
	if(arrIndex == cur_sel && index == 2)
		index = 3;
	if(arrIndex != cur_sel || (arrIndex == cur_sel && (index == 1 || index == 3)))
		document.images[name].src = img[arrIndex][index].src;
	
}
