function mOver(obj)
{
	id=String(obj.id);
	name=id.substr(0,id.indexOf('_'));
	if (name+"_img"!=current_id)
	{
	  obj.src='/img/menu/'+name+'-over.gif';
	}
	if(inArray(name,sub_menus)){
		active_name=name;
		if(document.getElementById('home_td').offsetLeft > 0){
			document.getElementById(active_name+'_left_img').style.width=document.getElementById(active_name+'_td').offsetLeft;
		} else {
			document.getElementById(active_name+'_left_img').style.width=event.clientX-30;
		}
		document.getElementById(active_name+'_div').style.visibility='visible';
	}
}
function mOut(obj,type)
{
	if((active_name=='')&&(!type)){
		id=String(obj.id);
		name=id.substr(0,id.indexOf('_'));
		obj.src='/img/menu/'+name+'.gif';
	}
	if (type==1)
	{
	  id=String(obj.id);
		name=id.substr(0,id.indexOf('_'));
	  obj.src='/img/menu/'+name+'-this.gif';
	}
}
function testOut(mX,mY)
{
  an='';
	if(active_name!=''){
		ol=document.getElementById(active_name+'_left').offsetWidth;
		ow=document.getElementById(active_name+'_width').offsetWidth;
		ot=document.getElementById(active_name+'_width').offsetTop+47+20;
		bl=document.getElementById(active_name+'_td').offsetLeft;
		bw=document.getElementById(active_name+'_td').offsetWidth;
		if( ((mX < ol) || (mX > (ol+ow)) || (mY < 47) || (mY > ot))&&((mX < bl) || (mX > (bl+bw)) || (mY < 1) || (mY > 48)) ){
			document.getElementById(active_name+'_div').style.visibility='hidden';
			document.getElementById(active_name+'_img').src='/img/menu/'+active_name+'.gif';
			an=active_name;
			active_name='';
		}
		if (an+'_img'==current_id)
		{
		  document.getElementById(an+'_img').src='/img/menu/'+an+'-this.gif';
		}
	}
}
function inArray(str,arr){
	for(i=0;i<arr.length;i++){
		if(arr[i]==str){
			return 1;
		}
	}
	return 0;
}
function subOver(x)
{
	document.getElementById(x).style.backgroundColor='#ffedc9';
}
function subOut(x)
{
	document.getElementById(x).style.backgroundColor='#ffffff';
}
