function findObj(n, d) { 
    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&&id.layers.length;i++) 
        x=findObj(n,d.layers[i].document); 
    
    return x; 
} 

function showmenu(main,menuid) { 
    obj1=findObj(main); 
    obj2=findObj(menuid); 
    if (obj1.style) 
        obj2=obj2.style; 
    obj2.top=document.all.menu.offsetTop+20; 
    obj2.left=obj1.offsetLeft+8; 
    obj2.visibility='visible'; 
} 
  
function hidemenu(main,menuid){ 
    obj2=findObj(menuid); 
    if (obj1.style) 
        obj2=obj2.style; 

    obj2.visibility='hidden'; 
} 

function doColor(item) { 
    item.bgColor = '#323232'; 
} 

function undoColor(item) { 
    item.bgColor = '#252525'; 
}

var lastobj = null;
function showHide(ids){
	var obj = document.all("item" + ids);
	if(obj){
		if(obj.style.display=='none')
			obj.style.display='';
		else
			obj.style.display='none';
	}
}

function checkRange(obj){
	var toObj = event.toElement;
	if(toObj&&toObj.childmenu==obj.id)return;
	while(toObj){
		if(toObj==obj)
			return
		toObj = toObj.parentElement;
	};
	showHide(null)
}
function checkRangeA(obj){
	var toObj = event.toElement;
	while(toObj){
		if(toObj==document.all(obj.childmenu))
			return;
		toObj = toObj.parentElement;
	}
	showHide(null);
}





var lastobj = null;
function showdiv(obj){
	var oldobj = obj;
	if(!obj){
		if(lastobj)lastobj.style.display = 'none';
		return;
	}
	
	var divname = obj.childmenu
	var obj = document.all(divname);
	if(obj){
		if(lastobj)	lastobj.style.display = 'none';
		obj.style.display = '';
		lastobj = obj;
	}
}

function checkRange1(obj){
	var toObj = event.toElement;
	if(toObj&&toObj.childmenu==obj.id)return;
	while(toObj){
		if(toObj==obj)
			return
		toObj = toObj.parentElement;
	};
	showdiv(null)
}
function checkRange1A(obj){
	var toObj = event.toElement;
	while(toObj){
		if(toObj==document.all(obj.childmenu))
			return;
		toObj = toObj.parentElement;
	}
	showdiv(null);
}