function Numero(string){
	num=string.substring(0,(string.length-2));
	num=Number(num);
	return num;
}
	

function MFXrunMenu(myName,newspeed){
	ieStep=0;
	thereS=false;
	thereC=false;
	if(newspeed>0){mySpeed=newspeed;}
	first=myName;
	if(whichOpen==-1&&!running&&MFXmain[myName]&&!(whichOpen==myName)){
		running=true;
		if(NN){myLayer[myName+1].height=0;
			   myLayer[myName+1].visibility=VISIBLE;
		}
		if(IE){myLayer[myName+1].clip= "rect(" + ("auto") +" "+ ("auto") +" "+ (0) +" "+ ("auto") +")";
			   myLayer[myName+1].visibility=VISIBLE;
		}
		MFXopenMenuS(myName);
		MFXopenMenuC(myName);
	}
	if(whichOpen>=0&&!running&&!(whichOpen==myName)){
		running=true;
		second=whichOpen;
		ieStep1=myHeight[second+1];
		thereCS=false;thereCC=false;
		MFXcloseMenuS(second);MFXcloseMenuC(second);
	}
	if(whichOpen>=0&&!running&&whichOpen==myName&&closes){
		running=true;
		second=whichOpen;
		ieStep1=myHeight[second+1];
		thereCS=false;thereCC=false;
		MFXcloseMenuS(second);MFXcloseMenuC(second);
	}
}

function MFXstopCloseS(myName){
	running=false;
	thereCS=true;
	if(closes&&first==whichOpen){
		whichOpen=-1;
	}
	else{
		whichOpen=-1;
		MFXrunMenu(first);
	}
	myLayer[myName+1].visibility=HIDDEN;
}

function MFXstopOpenS(myName){
	running=false;
	thereS=true;
	if(IE){myLayer[myName+1].clip= "rect(" + ("auto") +" "+ ("auto") +" "+ ("auto") +" "+ ("auto") +")";}
	whichOpen=myName;
}

function MFXopenMenuS(myName){
	myStep=mySpeed;
	if(NN&&!thereS&&!(first==lastMain)){
		if((Numero(myLayer[first+2].top)+myStep)>mySlide[first+1]){
			myStep=mySlide[first+1]-Numero(myLayer[first+2].top);
		}
		for(i=first+2; i<myLayer.length; i+=2){
			myLayer[i].top=Numero(myLayer[i].top)+myStep;
		}
		if(Numero(myLayer[first+2].top)==mySlide[first+1]){
			MFXstopOpenS(first)
		}
		if(running)setTimeout('MFXopenMenuS(first)',20);
	}
	if(IE&&!thereS&&!(first==lastMain)){
		if(myLayer[first+2].pixelTop+myStep>mySlide[first+1]){
			myStep=mySlide[first+1]-myLayer[first+2].pixelTop;
		}
		for(i=first+2; i<myLayer.length; i+=2){
			myLayer[i].pixelTop+=myStep;
		}
		if(myLayer[first+2].pixelTop==mySlide[first+1]){
			MFXstopOpenS(first)
		}
		if(running)setTimeout('MFXopenMenuS(first)',20);
	}
}

function MFXopenMenuC(myName){
	myStep=mySpeed;
	if(NN&&!thereC){
		if ((Numero(myLayer[first+1].height)+myStep)>myHeight[first+1]){
			myLayer[first+1].height=myHeight[first+1]
		}
		if(Numero(myLayer[first+1].height)==myHeight[first+1]){
			thereC=true;
			whichOpen=first;
			MFXstopOpenS(first)
		}else{
			myLayer[first+1].height=Numero(myLayer[first+1].height)+myStep;
		}
		if(running)setTimeout('MFXopenMenuC(first)',20);
	}
	if(IE&&!thereC){
		ieStep+=myStep;
		myLayer[myName+1].clip= "rect(" + ("auto") +" "+ ("auto") +" "+ (ieStep) +" "+ ("auto") +")";
		if(ieStep>=myHeight[first+1]){
			thereC=true;
			whichOpen=first;
			MFXstopOpenS(first)
		}
		if(running)setTimeout('MFXopenMenuC(first)',20);
	}
}

function MFXcloseMenuS(myName){
	myStep=mySpeed;
	if(NN&&!thereCS&&!(second==lastMain)){
		if((Numero(myLayer[second+2].top)-myStep)<myTop[second+2]){
			myStep=Numero(myLayer[second+2].top)-myTop[second+2];
		}	
		for(i=second+2; i<myLayer.length; i+=2){
			myLayer[i].top=Numero(myLayer[i].top)-myStep;
		}
		if(Numero(myLayer[second+2].top)==myTop[second+2]){
			MFXstopCloseS(second);
		}
		if(running)setTimeout('MFXcloseMenuS(second)',20);
	}
	if(IE&&!thereCS&&!(second==lastMain)){
		if(myLayer[second+2].pixelTop-myStep<myTop[second+2]){
			myStep=myLayer[second+2].pixelTop-myTop[second+2];
		}
		for(i=second+2; i<myLayer.length; i+=2){
			myLayer[i].pixelTop-=myStep;
		}
		if(myLayer[second+2].pixelTop==myTop[second+2]){
			MFXstopCloseS(second);
		}
		if(running)setTimeout('MFXcloseMenuS(second)',20);
	}
}

function MFXcloseMenuC(myName){
	myStep=-mySpeed;
	ieStep1-=mySpeed;
	if(NN&&!thereCC){
		a=Numero(myLayer[second+1].bottom)+myStep;
		if (a<0){
			myLayer[second+1].bottom=0;	
		}
		if(Numero(myLayer[second+1].bottom)==0){
			thereCC=true;
			if(second==lastMain){
				MFXstopCloseS(second);
			}	
		}else{
			myLayer[second+1].bottom=Numero(myLayer[second+1])-myStep;
		}
		if(running)setTimeout('MFXcloseMenuC(second)',20);
	}
	if(IE&&!thereCC){
		if(ieStep1<=0){
			myLayer[myName+1].clip= "rect(" + ("auto") +" "+ ("auto") +" "+ (0) +" "+ ("auto") +")";
			thereCC=true;
			if(second==lastMain)MFXstopCloseS(second);
		}else{
			myLayer[myName+1].clip= "rect(" + ("auto") +" "+ ("auto") +" "+ (ieStep1) +" "+ ("auto") +")";
		}
		if(running)setTimeout('MFXcloseMenuC(second)',20);
	}
}
function MM_swapImgRestore() { //v3.0
	var i,x,a=document.MM_sr; 
	for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) 
		x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
	var d=document; 
	if(d.images){ 
		if(!d.MM_p) d.MM_p=new Array();
		var i,j=d.MM_p.length,a=MM_preloadImages.arguments; 
		for(i=0; i<a.length; i++)
		if (a[i].indexOf("#")!=0){ 
			d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];
		}
	}
}
function MM_findObj(n, d) { //v4.0
	var p,i,x;  
	if(!d) 
		d=document; 
	if((p=n.indexOf("?"))>0&&parent.frames.length) {
		d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);
	}
	if(!(x=d[n])&&d.all) 
		x=d.all[n]; 
	for (i=0;!x&&i<d.forms.length;i++) 
		x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++)
		x=MM_findObj(n,d.layers[i].document);
	if(!x && document.getElementById) 
		x=document.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
	var i,j=0,x,a=MM_swapImage.arguments; 
	document.MM_sr=new Array; 
	for(i=0;i<(a.length-2);i+=3)
	if ((x=MM_findObj(a[i]))!=null){
		document.MM_sr[j++]=x; 
		if(!x.oSrc) 
			x.oSrc=x.src; 
		x.src=a[i+2];
	}
}
function MM_openBrWindow(theURL,winName,features, myWidth, myHeight, isCenter) { //v3.0
	if(window.screen)if(isCenter)if(isCenter=="true"){
		var myLeft = (screen.width-myWidth)/2;
		var myTop = (screen.height-myHeight)/2;
		features+=(features!='')?',':'';
		features+=',left='+myLeft+',top='+myTop;
	}
	return window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight);
}