
var mnu_text = new Array();
var submnu_text = new Array();

var mnu_1 = new Array();
var mnu_2 = new Array();
var mnu_3 = new Array();
var mnu_4 = new Array();

mnu_1[0] = new Array('The class Arachnida', 'about_a.php');
mnu_1[1] = new Array('Mites are everywhere', 'about_b.php');

mnu_2[0] = new Array('DECOMPOSERS OF THE FOREST LITTER', 'useful_a.php');
mnu_2[1] = new Array('REGULATORS OF PLANTS PARASITES', 'useful_b.php');
mnu_2[2] = new Array('FLAVOUR ENHANCERS FOR CHEESE', 'useful_c.php');
mnu_2[3] = new Array('CRIME SOLVERS', 'useful_d.php');
mnu_2[4] = new Array('SURVIVORS OF EXTREMY LOW TEMPERATURES', 'useful_e.php');

mnu_3[0] = new Array('HOUSE DUST MITES: AGENTS OF ALLERGY', 'pest_a.php');
mnu_3[1] = new Array('TICKS: BLOOD SUCKERS', 'pest_b1.php');
mnu_3[2] = new Array('SCABIES: SKIN DIGGERS', 'pest_c.php');
mnu_3[3] = new Array('HARVEST MITES', 'pest_d.php');
mnu_3[4] = new Array('INHABITANTS OF HAIR FOLLICLES', 'pest_e.php');
mnu_3[5] = new Array('FOOD STOCK DESTROYERS', 'pest_f.php');
mnu_3[6] = new Array('CROPS DESTROYERS', 'pest_g1.php');

mnu_4[0] = new Array('Acknowledgments', 'ac_a.php');
mnu_4[1] = new Array('PRESS', 'ac_b.php');

var subMenu_3_1 = new Array();
subMenu_3_1[0] = new Array('HARD&nbsp;TICKS', 'pest_b1.php');
subMenu_3_1[1] = new Array('SOFT&nbsp;TICKS', 'pest_b2.php');
subMenu_3_1[2] = new Array('VAMPIRE&nbsp;OF&nbsp;CHICKENS', 'pest_b3.php');
subMenu_3_1[3] = new Array('VAMPIRE&nbsp;OF&nbsp;BEES', 'pest_b4.php');

var subMenu_3_6 = new Array();
subMenu_3_6[0] = new Array('GALL&minus;MITES', 'pest_g1.php');
subMenu_3_6[1] = new Array('BROAD&nbsp;MITES', 'pest_g2.php');
subMenu_3_6[2] = new Array('SPIDER&minus;MITES', 'pest_g3.php');
subMenu_3_6[3] = new Array('PEACOCK&nbsp;MITES&nbsp;AND&nbsp;FLAT&nbsp;MITES', 'pest_g4.php');


resetMenuText(mnu_1, 0);
resetMenuText(mnu_2, 1);
resetMenuText(mnu_3, 2);
resetMenuText(mnu_4, 3);

resetSubMenuText(subMenu_3_1, 0);
resetSubMenuText(subMenu_3_6, 1);




/*function resetMenuText(mnuArray, ind)
{
	mnu_text[ind] = '';
	var newInd = ind + 1;
	for(var i = 0; i < mnuArray.length; i++)
	{
		mnuArray[i][0] = mnuArray[i][0].toUpperCase();
		mnuArray[i][0] = mnuArray[i][0].replace(/ /g,'&nbsp;') ;
		mnu_text[ind] += '<div class="itemMnu"><a href="' + mnuArray[i][1] + '" onmouseout="hideMenuTimer(); bgChange(this.parentNode);" onmouseover="keepMenu(); bgChange_(this.parentNode);">&raquo;&nbsp;&nbsp;' + mnuArray[i][0] + '</a></div>';
	}
}*/

function resetSubMenuText(mnuArray, ind)
{
	submnu_text[ind] = '';
	var newInd = ind + 1;
	for(var i = 0; i < mnuArray.length; i++)
	{
		mnuArray[i][0] = mnuArray[i][0].toUpperCase();
		//mnuArray[i][0] = mnuArray[i][0].replace(/ /g,'&nbsp;') ;
		submnu_text[ind] += '<div class="itemSubMnu"><a href="' + mnuArray[i][1] + '" onmouseout="hideSubMenuTimer(); bgSChange(this.parentNode);" onmouseover="keepSubMenu(); bgSChange_(this.parentNode);">&bull;&nbsp;&nbsp;' + mnuArray[i][0] + '</a></div>';
	}
}

function resetMenuText(mnuArray, ind)
{
mnu_text[ind] = '';
var newInd = ind + 1;
for(var i = 0; i < mnuArray.length; i++)
{
var testSubMnu = false;
var subMnu;
mnuArray[i][0] = mnuArray[i][0].toUpperCase();
mnuArray[i][0] = mnuArray[i][0].replace(/ /g,'&nbsp;') ;
mnu_text[ind] += '<div class="itemMnu"><a href="' + mnuArray[i][1] + '" onmouseout="hideMenuTimer(); bgChange(this.parentNode);" onmouseover="keepMenu(); bgChange_(this.parentNode);">&raquo;&nbsp;&nbsp;' + mnuArray[i][0] + '</a></div>';
eval('testSubMnu = (typeof(subMenu_' + newInd + '_' + i + ') == "undefined")? false: true;');
if(testSubMnu)
{
eval('subMnu = subMenu_' + newInd + '_' + i);
for(var j = 0; j < subMnu.length; j++)
{
mnu_text[ind] += '<div class="itemMnu2"><a href="' + subMnu[j][1] + '" onmouseout="hideMenuTimer(); bgChange(this.parentNode);" onmouseover="keepMenu(); bgChange_(this.parentNode);">&raquo;&nbsp;&nbsp;' + subMnu[j][0] + '</a></div>';
}
}
}
}



function $(obj)
{
	return document.getElementById(obj);
}

var timerMenu = 0;
var timerMenuSub = 0;

function hideMenuTimer()
{
	clearTimeout(timerMenu);
	timerMenu = setTimeout("hideMenu()", 700);
}

function hideSubMenuTimer()
{
	clearTimeout(timerMenuSub);
	timerMenuSub = setTimeout("hideSubMenu()", 700);
}

function hideMenu()
{
	$('mnu_1').innerHTML = '';
	$('mnu_2').innerHTML = '';
	$('mnu_3').innerHTML = '';
	$('mnu_4').innerHTML = '';
}

function hideSubMenu()
{
	$('subMenuIn').innerHTML = '';
}

function keepMenu()
{
	clearTimeout(timerMenu);
}
function keepSubMenu()
{
	clearTimeout(timerMenuSub);
}

function showMenu(mnu, ind)
{
	hideMenu();
	clearTimeout(timerMenu);
	$(mnu).innerHTML = mnu_text[ind];
}

function showSubMenu(mnu, ind)
{
	hideSubMenu();
	clearTimeout(timerMenuSub);
	$(mnu).innerHTML = submnu_text[ind];
}


function bgChange(obj)
{
	obj.style.backgroundColor="#c7c29e"
}

function bgChange_(obj)
{
	obj.style.backgroundColor="#736e70"
}



function bgSChange(obj)
{
	obj.style.backgroundColor="#c7c29e"
}

function bgSChange_(obj)
{
	obj.style.backgroundColor="#9d9899"
}

function showPic(src)
{
	$('shPic').innerHTML = '<a id="xclose" href="#" onclick="$(\'shPic\').innerHTML = \'\';">x</a><img src="' + src + '">';
}







