/* Copyright (c) 2007 Affno (Pvt) Ltd, . All rights reserved.

 This software is the confidential and proprietary information of        
 Affno  ("Confidential Information").  You shall not disclose such 
 Confidential Information and shall use it only in accordance with
 the terms of the license agreement you entered into with Affno.

Module Name		: MOBWEB1
File Name		: menu.js
Description		: Mobitel hover menu 
Created By		: Bjorn de Lima
Created Date	: 12-April-2007 (originally for ODLWEB1)
Modified By		: 
Modified Date	: 
Version			: 1.00.000

*/



var currentMenu = null;
var menuHideTimer = null;
var showTime = 300; // ms

function showMenu(str,obj){	
if (str!=currentMenu){
	//$E('.selectMenu').style.visibility = 'none';
	hideMenu();
	resetTimer();
	var off = 16;
	var pos = Array();
	pos = findPos(obj);
	obj2 = document.getElementById(str);
	obj2.style.display = "block";
	
	var inv = new Fx.Style(str, 'opacity').set(0); 
	var fx = new Fx.Styles(str,{duration:100,transition: Fx.Transitions.linear} ); 
	fx.start({
			 'opacity' : [0,1]
			 });
	obj2.style.left = parseInt(pos[0]-5)+"px";
	obj2.style.top = parseInt(pos[1]+off)+"px";
	currentMenu = str;
	}
	else{
		resetTimer();
		}
}

function showIt(obj){
	//alert('s');
	obj.style.display = 'block';
	}
	
function hideMenu(){	

	if (currentMenu){
	obj = document.getElementById(currentMenu);
	obj.style.display = "none";
	currentMenu="";
	//if ($E('.selectMenu')){
	//$E('.selectMenu').style.display = 'block';
	//}
	//var inv = new Fx.Style(currentMenu, 'padding-top').set(0); 
	
}
	
	}	

function startTimer(){
	menuHideTimer = setTimeout("hideMenu()", showTime);
	}
	
function resetTimer(){
	if (menuHideTimer){
		clearTimeout(menuHideTimer);
	}
	menuHideTimer = null;	
	}
	
