


	
var IE = document.all?true:false;
if (!IE) document.captureEvents(Event.MOUSEMOVE)
document.onmousemove = getMouseXY;
var tempX = 0;
var tempY = 0;
function getMouseXY(e){
	if (IE) { // grab the x-y pos.s if browser is IE
		tempX = event.clientX + document.body.scrollLeft;
		tempY = event.clientY + document.body.scrollTop;
	}
	else { // grab the x-y pos.s if browser is NS
		tempX = e.pageX;
		tempY = e.pageY;
	}
}	
	
	
	
	
	$(function(){
		$("#dialog").bgiframe();
	});
	
	//ต้องอยู่ ไล์เดียวกัน
	//var frm_test = '<form action="?" method="post"><input type="text" name="test"><input type="submit" name="btsubmit"></form>';
	
	
	function Popup_close(){
		
		$("#dialog").hide("slow");

	}
	
	function Popup(msg){
	$("#dcon").html(msg);
	var windowWidth = document.documentElement.clientWidth;
	var windowHeight = document.documentElement.clientHeight;
	var popupHeight = $("#dialog").height();
	var popupWidth = $("#dialog").width();
	//centering
	
	$("#dialog").css({
		"position": "absolute",
		//"top": windowHeight / 2 - popupHeight / 2+50,
		//"left": windowWidth / 2 - popupWidth / 2+50,
		"top": tempY+5,
		"left": tempX+5,
		"padding":"5px 5px 5px 5px"
	});
//	$("#dialog").draggable();
	$("#dialog").show("slow");

	//only need force for IE6
}
function call_ajax(file,fun){
		 $.ajax({

   url: file,
   cache: false,
   success: function(msg){
     fun(msg);
   }
 });

	
		}
		
		
		
function mainmenu(){
$(" #nav ul ").css({display: "none"}); // Opera Fix
$(" #nav li").hover(function(){
		$(this).find('ul:first').css({visibility: "visible",display: "none"}).show(400);
		},function(){
		$(this).find('ul:first').css({visibility: "hidden"});
		});
}

 
 
 $(document).ready(function(){					
	mainmenu();
});		
	

