//Browser Support Code
    var ajaxRequest;  // The variable that makes Ajax possible!
    var showdiv;
	var loadgallery;
    function createXMLHttpRequest(){
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	}
	// Create a function that will receive data sent from the server
	function dothis(){
	    if (ajaxRequest.readyState==4){	// หาก Property readyState มีค่าเท่ากับ 4 คือ เสร็จสิ้นการทำงานโดยสมบูรณ์
			if (ajaxRequest.status==200){	// หากproterty status มีค่าเท่ากับ 200 หมายถึง ตกลง ถ้าเป็น 400 คือ ค้นหาไม่พบ
				document.getElementById(showdiv).innerHTML = ajaxRequest.responseText;	// ตอบข้อความกลับจาก Server
			}else{
				document.getElementById(showdiv).innerHTML = ajaxRequest.responseText;	 // หาก ค้นหาไม่พบ ให้แสดง ข้อความ statusText
			}
		}else{
			document.getElementById(showdiv).innerHTML="<table width=\"100%\" height=\"100%\"><tr><td valign=\"center\" align=\"center\" style=\"padding:15px 0px 0px 0px;\">loading...</td></tr></table>";
		}
	}
	function requestajax(page,divid,parameter){
		showdiv = divid;
	    createXMLHttpRequest();
	    ajaxRequest.onreadystatechange = dothis;
	    ajaxRequest.open("GET", page + "?newrequest=" + Number(new Date) + parameter, true); 
	    ajaxRequest.send(null); 
	}