		var topall = new Array(2);
		var lownav = new Array(2);
		var lowpop = new Array(2);
		var rightnav = new Array(2);
		var rightpop = new Array(2);
		var x = 0;	// global menu level
		var way = 'h';
		var menu = null;
		var menus = null;
		var pop1 = new Array(2);

// -- IE specific code
	
function lock(num)
{
	// lock relies on a style which end with -l
	rollover = document.all["l" + num];
	if(rollover)
	{
  	cn = rollover.className
  	if((pos = cn.lastIndexOf("-")) != -1)
  	{
  		bcn = cn.substring(0,pos + 1);
  		scn = cn.substring(pos +1);
  		if(scn == "f" || scn == "o")
  		{
  			rollover.className = bcn + "l";
  		}
  	}
  }
}

function gotourl($url)
{
	window.location = $url;
}
function mailus(mbox,stub,subject)
{
	mail = "mailto:"+mbox+"@"+stub;
	if(subject != ""){
		mail = mail+"?SUBJECT="+"A-M: "+subject;
	}
	window.location = mail;
	return;
}

// -- IE specific code
function pop(p,s,axis)
{
	// p = menu level
	// s = object id number to be made visible
	// axis = v or h
	way = axis;
	x = p;	// save index
	if(p != 0)
	{
		pop1[x] = document.all["t" + s];
		if(pop1[x])
		{
			// pop the next level
			topall[x] = topall[0];
			rightnav[x] = rightpop[0]-8;
			lowpop[x] = (topall[x] + pop1[x].clientHeight) -4;
			rightpop[x] = rightnav[x] + pop1[x].clientWidth;
			pop1[x].style.left = (rightnav[x]-2)+"px";
			pop1[x].style.top = (topall[x]-4)+"px";
			pop1[x].style.visibility = "visible"; 
		}
		return;
	}
	popclean(s, axis);	// kill all others
	menu = document.all["p" + s];
	if(menu)
	{
  	pop1[x] = document.all["h" + s];
  	if(way == "v")
  	{
  		// vertical popop
		topall[x] = menu.offsetTop+logo.clientHeight + 62;//ertefa az balaye safhe ra moshakhas mikonad,age ziad bashe nemishe roye gozine ha raft,bayad daqiqan roye matn bashe.
  		//alert(menu.offsetLeft);
		rightnav[x] =logo.clientWidth - menu.offsetLeft+pagetop.offsetLeft-177;//faseleye menu az samte chap ra taen mikonad,in fasele ra be jam kardam pahnaye logo va faseleye khali az samte chap , faseleye menu hesab mikonad
  		lownav[x] = topall[x] + menu.clientHeight - 4;
  		lowpop[x] = topall[x] + pop1[x].clientHeight+ 2;
  		rightpop[x] = rightnav[x] + pop1[x].clientWidth;
  		pop1[x].style.top = topall[x];
  		pop1[x].style.left = rightnav[x] ;
  	}
  	else
  	{
  		// horizontal pop-up
  		menus = document.all["s" + s];
  		topall[x] = menu.offsetTop +  menutop.offsetTop + 4;
  		rightnav[x] = menu.clientWidth;
  		lownav[x] = topall[x] + menu.clientHeight - 4;
  		lowpop[x] = topall[x] + pop1[x].clientHeight - 4;
  		rightpop[x] = rightnav[x] + pop1[x].clientWidth;
  		pop1[x].style.top = topall[x] -4;
  		pop1[x].style.left = rightnav[x];
  	}
  	// save the clipping area for mouseover (popdown)
  	pop1[x].style.visibility = "visible";
  	cn = menu.className
  	if((pos = cn.lastIndexOf("-")) != -1)
  	{
  		bcn = cn.substring(0,pos + 1);
  		scn = cn.substring(pos +1);
  		if(scn == 'f')
  		{
  			menu.className = bcn + "o";
  			if(way == 'h') menus.className = bcn + "o";
  		}
  	}
	}
}
function swapout()
{
	h = event.clientX
	if (h == -1) h = 0;
	h = h + document.body.scrollLeft;
	v = event.clientY 
	if (v == -1)
	{
		v = topall;
	}
	else
	{
		v = v + document.body.scrollTop;
	}
	// are we still in area
	for(i = x+1;i > 0; i--)
	{
		if(clip(h,v) == true)
		{
			return true;	// still OK
		}
		// out of one area
		unpop();
		x--;	// decrement index
	}
	return true;
}
function clip(h,v)
{
	if (h < rightpop[x] && h > rightnav[x])
	{
		// left
		if (v > topall[x] && v < lowpop[x])
		{
			return true;
		}
	}
	else
	{
		// alert("h="+h+" rn="+rightnav[x]);
	}
	return false;
}
function unpop()
{
	// out of area
	pop1[x].style.visibility = "hidden";
	if(x) return;	// return if index non-zero
	cn = menu.className
	if((pos = cn.lastIndexOf("-")) != -1)
	{
		bcn = cn.substring(0,pos + 1);
		scn = cn.substring(pos +1);
		if(scn == 'o')
		{
			menu.className = bcn + "f";
			if(way == 'h') menus.className = bcn + "f";
		}
	}
}
function popclean(s, axis)
{
	way = axis;
// ensure that everything except 's' is invisible and 'off'
	for(i=0;i < 10; i++)
	{
		if(i != s)
		{
			o1 = document.all["p" + i];
			if(o1)
			{
  			cn = o1.className
  			if((pos = cn.lastIndexOf("-")) != -1)
  			{
  				bcn = cn.substring(0,pos + 1);
  				scn = cn.substring(pos +1);
  				if(scn == 'o')
  				{
  					o1.className = bcn + "f";
  					if(way =='h')
  					{
  						o3 = document.all["s" + i];
  					 	o3.className = bcn + "f";
  					}
  				}
  			}
  			o2 = document.all["h" + i];
  			o2.style.visibility = "hidden";
			}
		}
	}
}


