// JavaScript Document




// SHOW AND HIDE SUBMENU...
var RollIt = {
    timeout : null,
    showPopup : function(popup){
        clearTimeout(this.timeout);
        if($(popup).style.display == 'none'){
            this.timeout = setTimeout(function(){new Effect.Appear(popup, {duration:.3, fps:40})},400);
        }
    },
	
    hidePopup : function(popup){
        if($(popup).style.display == 'none'){
            clearTimeout(this.timeout);
        }else{
            this.timeout = setTimeout(function(){new Effect.BlindUp(popup, {duration:.2, fps:40})},100);
        }
    }    
}

// END SHOW AND HIDE SUBMENU...





 function handleEvent(e, popup) {
	 
	 
	 
        //var oTextbox = document.getElementById("txt1");
        //oTextbox.value += "\n    at (" + oEvent.screenX + "," + oEvent.screenY + ") on the screen";
		//alert(oEvent.screenX + " -- " + oEvent.screenY); 
	
		
		//alert(x_pos + " x --- y " + y_pos);	

		
		var posx = 0;
		var posy = 0;
		if (!e) var e = window.event;
		if (e.pageX || e.pageY) 	{
			posx = e.pageX;
			posy = e.pageY;
		}
		else if (e.clientX || e.clientY) 	{
			posx = e.clientX + document.body.scrollLeft
				+ document.documentElement.scrollLeft; 
				
			posy = e.clientY + document.body.scrollTop
				+ document.documentElement.scrollTop;
		}
		
		
		 posx = parseInt(posx) + parseInt('10');
		 posy = parseInt(posy) - parseInt('60');
		
		
		// posx and posy contain the mouse position relative to the document
		// Do something with this information
		
		
		//document.getElementById(popup).style.Position = "absolute";
		document.getElementById(popup).style.left = posx + "px";
		document.getElementById(popup).style.top = posy + "px";
	
		
		RollIt.showPopup(popup);
		
    }







function popup(popup,x,y) {
	
	var x_pos = parseInt(x) + parseInt('23');
	var y_pos = parseInt(y) - parseInt('37'); 
	
	//alert(x_pos + " --- " + y);	
	
	document.getElementById(popup).style.Position = "absolute";
	document.getElementById(popup).style.left = x_pos + "px"; 
	document.getElementById(popup).style.top = y_pos + "px";
	

	RollIt.showPopup(popup);
	

}


function popupOut(popup) {
	
	
	RollIt.hidePopup(popup);

}




