﻿		var posxyL = 0; posxyT = 0
		var ajaxboxdiv = "";   // "sele_div"; // change this accrodingly
		var inpboxheight = 24;
		var menutimeoutId="";
		var ObjbyMouse = ""
		var color_default = "white";
		var color_selected = "white";	
		var bkcolor = "#CC0000";	   // on Hover
		var animT="";
			
			function menux(objdiv, menumatter, ajaxDivBlock, innerDiv){  
				if  (ObjbyMouse != "") { colory('D'); }  // for last selected object
				ObjbyMouse = objdiv; 
				ajaxboxdiv = ajaxDivBlock;
				findmenuPos();
				document.getElementById(innerDiv).innerHTML = document.getElementById(menumatter).innerHTML;
				showmenudiv();
			}			
			
			function findmenuPos() {
				var curleft = 0; curtop = 0;
				Obj4Pos = document.getElementById(ObjbyMouse);
				if (Obj4Pos.offsetParent) {
					curleft = Obj4Pos.offsetLeft
					curtop = Obj4Pos.offsetTop
					while (Obj4Pos = Obj4Pos.offsetParent) {
						curleft += Obj4Pos.offsetLeft
						curtop += Obj4Pos.offsetTop
					}
				}
				posxyT = curtop;
				posxyL = curleft;
			}
			
			function hidemenudiv(){
				if (ajaxboxdiv != ""){
					if  (ObjbyMouse != "") { colory('D'); }  // for last selected object
					document.getElementById(ajaxboxdiv).style.visibility = "hidden";
					document.getElementById(ajaxboxdiv).style.height = "1px";
					document.getElementById(ajaxboxdiv).style.width = "1px";				
					document.getElementById(ajaxboxdiv).style.overflow = "hidden";
					document.getElementById(ajaxboxdiv).style.overflowX = "hidden";	 // hidden
					document.getElementById(ajaxboxdiv).style.overflowY = "hidden";				
				}			
			} 

			function showmenudiv(){
				document.getElementById(ajaxboxdiv).style.top = posxyT + inpboxheight + 'px'; //tempY;
				document.getElementById(ajaxboxdiv).style.left = posxyL + 2 + 'px'; //tempX;
				document.getElementById(ajaxboxdiv).style.width = "auto"; //200 + "px";
				document.getElementById(ajaxboxdiv).style.height = "auto";	
				document.getElementById(ajaxboxdiv).style.visibility = "visible";
				document.getElementById(ajaxboxdiv).style.overflowX = "visible";	 // hidden
				document.getElementById(ajaxboxdiv).style.overflowY = "visible";
				colory('N');
				if (menutimeoutId) { clearTimeout(menutimeoutId); }
				menutimeoutId = setTimeout("hidemenudiv()", 7000);
			}			

			function menuReset(timeTT){
				if (menutimeoutId) { clearTimeout(menutimeoutId); }
				if(timeTT){
					menutimeoutId = setTimeout("hidemenudiv()", timeTT);			
				}
			}
			
			function colory(thisORnext){    // for last selected object
				if  (thisORnext == "D") {
					colorX = color_default;
					bkgcolorX = "";
				} else {
					colorX = color_selected;
					bkgcolorX = bkcolor;
				}
				document.getElementById(ObjbyMouse).style.color = colorX;
				document.getElementById(ObjbyMouse).style.borderColor = colorX;
				document.getElementById(ObjbyMouse).style.backgroundColor = bkgcolorX;
 
			}


/*			function animH(hh){
				if (animT) { clearTimeout(animT); }
				document.getElementById(ajaxboxdiv).style.height = hh + "px";
			} */