
function showit(which){
menuobj.style.visibility='visible';	
clear_delayhide()
thecontent=(which==-1)? "" : submenu[which]
	for(a=0; a<6; a++){
		var aid = "aid"+ a;
		// if mouseovered menu is not active then hover
		if (a == which && document.getElementById(aid).className == 'Active'){
		document.getElementById(aid).className = "Active"
		}
		else if (a == which && document.getElementById(aid).className == 'hov'){
		document.getElementById(aid).className = 'Active'
		}
		else if (a == which && document.getElementById(aid).className == 'act'){
		document.getElementById(aid).className = 'Active'
		}
		else if (a == which && document.getElementById(aid).className == ''){
		document.getElementById(aid).className = 'hov'
		}
		else if(a !== which && document.getElementById(aid).className == 'Active'){
		document.getElementById(aid).className = 'act'
		}
		else if (a !== which && document.getElementById(aid).className == 'hov'){
		document.getElementById(aid).className = ''
		}		
		else if (a !== which && document.getElementById(aid).className == 'act'){
		document.getElementById(aid).className = 'act'
		}	
		else{
		document.getElementById(aid).className = ''
		}	
	}	
	

	if (document.getElementById||document.all) 
	menuobj.innerHTML=thecontent;
	else if (document.layers){
	menuobj.document.write(thecontent)
	menuobj.document.close()
	}
}

function resetit(e,i){
	if (document.all&&!menuobj.contains(e.toElement)){
	delayhide=setTimeout("showit("+i+")",delay_hide);
		for(a=0; a<6; a++){
			index = "aid"+a; 
			if (a!=i){
				document.getElementById(index).className='';
			}
			else{
				document.getElementById(index).className='Active';
			}
		}	
	}
	else if (document.getElementById&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget)){
	delayhide = setTimeout("showit("+i+")",delay_hide);
		for(a=0; a<6; a++){
			index = "aid"+a; 
			if (a!=i){
				document.getElementById(index).className='';
			}
			else{
				document.getElementById(index).className='Active';
			}
		}	
	
	
	}
}


function clear_delayhide(){ if (window.delayhide)clearTimeout(delayhide)}

function contains_ns6(a,b) { while (b.parentNode) if ((b = b.parentNode) == a) return true; return false; }

function activemenu(aid){ document.getElementById(aid).className = "Active"}

function clearQRTab(e){
	if (document.all&&!menuobj.contains(e.toElement)){
	menuobj.style.visibility='hidden'
	//delayhide=setTimeout("showit(0)",delay_hide);
	for(a=1; a<6; a++){	index = "aid"+a; document.getElementById(index).className=''; 	}		
	}
	else if (document.getElementById&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget)){
	menuobj.style.visibility='hidden'
//	delayhide = setTimeout("showit(0)",delay_hide);
	for(a=1; a<6; a++){	index = "aid"+a; document.getElementById(index).className=''; 	}		

	}


//	for(a=0; a<6; a++){	index = "aid"+a; document.getElementById(index).className=''; 	}		
	
}

function showita(which){
menuobj.style.visibility='visible';	
clear_delayhide()
thecontent=(which==-1)? "" : submenu[which]



		for(a=1; a<6; a++){
		var aid = "aid"+ a;
		// if mouseovered menu is not active then hover
		if (a == which && document.getElementById(aid).className == 'Active'){
		document.getElementById(aid).className = "Active"
		}
		else if (a == which && document.getElementById(aid).className == ''){
		document.getElementById(aid).className = 'hov'
		}
		else if(a !== which && document.getElementById(aid).className == 'Active'){
		document.getElementById(aid).className = 'act'
		}
		else if (a !== which && document.getElementById(aid).className == 'hov'){
		document.getElementById(aid).className = ''
		}		
		else if (a !== which && document.getElementById(aid).className == 'act'){
		document.getElementById(aid).className = 'act'
		}	
		else{
		document.getElementById(aid).className = ''
		}	
	}	
	

	if (document.getElementById||document.all) 
	menuobj.innerHTML=thecontent;
	else if (document.layers){
	menuobj.document.write(thecontent)
	menuobj.document.close()
	}
}


