my_menuTools = {}
my_menuTools.opened = null;
my_menuTools.openedimgId = null;
my_menuTools.openedimg = null;
my_menuTools.closedimg = null;




my_menuTools.fix_menu = function (){
		//alert('start');
					var nameEQ = "m_open";
					var ca = document.cookie.split(';');
					for(var i=0;i < ca.length;i++) {
						var c = ca[i];
						while (c.charAt(0)==' ') c = c.substring(1,c.length);
						var cb = c.split('=');
						
						if (cb[0].indexOf(nameEQ) == 0) {
							//alert(cb[1]);
							var cc = cb[1].split('///');
							if(cc.length == 4){
								my_menuTools.expandcloseMenu(cc[0],cc[1],cc[2],cc[3]);
							}
						}
					}
	
	
	
}
my_menuTools.backImg= function (menu){
	if(my_menuTools.opened != menu){
	
			MM_swapImgRestore()
	}
}

my_menuTools.createCookie= function (name,value,days) {
					if (days) {
						var date = new Date();
						date.setTime(date.getTime()+(days*24*60*60*1000));
						var expires = "; expires="+date.toGMTString();
					}
					else var expires = "";
					document.cookie = name+"="+value+expires+"; path=/";
	}
	
my_menuTools.eraseCookie = function (name) {
					my_menuTools.createCookie(name,"",-1);
	}
my_menuTools.expandcloseMenu= function (menu,imgID,srcimg,srcoimg){
	mObj = document.getElementById(menu);
	if(mObj){
		if(my_menuTools.opened == null){
		
			mObj.style.display = 'block';
			my_menuTools.opened = menu;
				
				oImg = document.getElementById(imgID);
				if(oImg){
					oImg.src = srcoimg;
					my_menuTools.openedimg =srcoimg;
					my_menuTools.closedimg =srcimg;
					my_menuTools.openedimgId = imgID;
				}
				
				my_menuTools.createCookie('m_open',menu+'///'+imgID+'///'+srcimg+'///'+srcoimg,1);
		}else if(my_menuTools.opened == menu){
			mObj.style.display = 'none';
			
				
				oImg = document.getElementById(imgID);
				if(oImg){
					oImg.src = srcimg;
					
					my_menuTools.opened = null;
					
				}
			my_menuTools.eraseCookie('m_open');
		}else{
				oImgOld = document.getElementById(my_menuTools.openedimgId);
				if(oImgOld){
					oImgOld.src = my_menuTools.closedimg;
					
					
				}
			document.getElementById(my_menuTools.opened).style.display = 'none';
			document.getElementById(my_menuTools.opened).src = my_menuTools.closedimg;
			mObj.style.display = 'block';
			my_menuTools.opened = menu;
			my_menuTools.createCookie('m_open',menu+'///'+imgID+'///'+srcimg+'///'+srcoimg,1);
				oImg = document.getElementById(imgID);
				if(oImg){
					oImg.src = srcoimg;
					my_menuTools.openedimg =srcoimg;
					my_menuTools.closedimg =srcimg;
					my_menuTools.openedimgId = imgID;
				}
		}
	}
	
}
my_menuTools.gotoURLcombo= function (combid){
	myCombo = document.getElementById(combid);
	if(myCombo && myCombo.options[myCombo.selectedIndex].value != 'null')document.location.href= myCombo.options[myCombo.selectedIndex].value;
	
}