// JavaScript Document
		function gotoPage(processurl, page){
			//$("#curpage").val() = page;
			$("#listTable").hide();
            $("#loadingTable").show();
            $.post(processurl,
                {activeAjax: 1, curpage: page, numresult: $("#numresult").val(), order: $("#order").val()},
                function(data){
                    $("#listTable").html(data);
                    $("#loadingTable").hide();
					$("#listTable").show();
                }
            );
        };	
		
		function CheckShowhome(processurl, ID, CheckID){
			
			//$("#curpage").val() = page;
			$("#listTable").hide();
            $("#loadingTable").show();
            $.post(processurl,
                {activeAjax: 1, curpage: $("#curpage").val(), numresult: $("#numresult").val(), order: $("#order").val(), ID: ID, CheckID:CheckID},
                function(data){
                    $("#listTable").html(data);
                    $("#loadingTable").hide();
					$("#listTable").show();
                }
            );
        };	
		
		function changersearch(){
			var ulr = "";
			ulr = $("#urlpost").val();
				$('#catIDsearch').attr("disabled", true); 
			$.post(ulr, { choiceType: $("#choiceType").val(),searchKey : $("#searchKey").val(),catIDsearch : $("#catIDsearch").val() },
				function(data){
				    $('#boxsearch1').html(data);
					$('#catIDsearch').attr("disabled", false); 
		
				},"JSON");
		}
		
		function delItems(processurl, delStr){
			if (delStr == undefined)
			{
				calculatechon();
				delStr = document.getElementById("chon").value;
			}
			if (delStr == "") {
				return false;
			}
			if(!confirm("THÔNG BÁO: \n\tBẠN CÓ CHẮC CHẮN XÓA KHÔNG?"))
			{
				return false;
			}		
			//$("#curpage").val() = page;
			$("#listTable").hide();
            $("#loadingTable").show();
            $.post(processurl,
                {activeAjax: 1, curpage: $("#curpage").val(), numresult: $("#numresult").val(), order: $("#order").val(), dlStr: delStr},
                function(data){
                    $("#listTable").html(data);
                    $("#loadingTable").hide();
					$("#listTable").show();
                }
            );
        };
		
		function reloadPage(processurl){
			$("#listTable").hide();
            $("#loadingTable").show();
            $.post(processurl,
                {activeAjax: 1, cur_pos: 0, numresult: $("#numresult").val(), order: $("#order").val()},
                function(data){			
                   $("#listTable").html(data);
                    $("#loadingTable").hide();
				$("#listTable").show();
					
                }
            );
		}
		
		function reloadPage3(processurl){
			$("#listTable").hide();
            $("#loadingTable").show();
            $.post(processurl,
                {activeAjax: 1, cur_pos: 0, numresult: $("#numresult").val(), order: $("#order").val(), travelID: $("#order_travelID").val(), catID: $("#catID").val()},
                function(data){			
                   $("#listTable").html(data);
                    $("#loadingTable").hide();
				$("#listTable").show();
					
                }
            );
		}
		function reloadPage2(processurl){
			BASIC_SetCookie('listTable',document.getElementById("listTable").clientHeight);
			var c = document.getElementById("listTable").clientHeight
			$("#listTable").hide();
            $("#loadingTable").show();
            $.post(processurl,	
                {activeAjax: 1, cur_pos: 0, numresult: $("#numresult").val(), order: $("#order").val()},
                function(data){
                    $("#listTable").html(data);
                    $("#loadingTable").hide();
					d = (c + 300);
					e = d.toString();
					$("#listTable").show();
					document.getElementById("listTable").style.height =  e+"px";
					alert(document.getElementById("listTable").clientHeight);
					$("#listTable").Style.height = $("#listTable").clientHeight+"px";
					document.getElementById("listTable").style.height = document.getElementById("listTable").clientHeight+"px";
					//alert(document.getElementById("listTable").clientHeight);
					BASIC_SetCookie('listTable',0);
                }
            );
		}
		function changercity(tab){
			var ulr = "";
			if($('#urlpost').val() != ''){
				ulr = $('#urlpost').val();
			}else{
				ulr = "index.php"
				}

			$('#getq').attr("disabled", true); 
		var cbopickup = $('#cbopickup').val();
		var cbodropoff = $('#cbodropoff').val();
		
		var valid = $("input[@name='car']:checked").val();
		
			$.post(ulr, { cbopickup: cbopickup,cbodropoff : cbodropoff,tab: tab,carID : valid,isDate: $('#isDate').val(),isMonth: $('#isMonth').val(),isYear: $('#isYear').val(),cboTransfer: $('#cboTransfer').val(),datepicker : $('#datepicker').val(),cboHour : $('#cboHour').val(),cboMin : $('#cboMin').val(),activeAjax : 1},
				function(data){
	$('#getq').attr("disabled", false); 
				    $('#contentsearch1').html(data);
					 $('#tab').val(0);
				},"JSON");
		
		}
		function changercity2(tab){
			var ulr = "";
			if($('#urlpost').val() != ''){
				ulr = $('#urlpost').val();
			}else{
				ulr = "index.php"
				}
	  	
		$('#getq').attr("disabled", true); 
		var cbopickup = $('#cbopickup2').val();
		var cbodropoff = $('#cbodropoff2').val();
		var valid = $("input[@name='car2']:checked").val();
			$.post(ulr, { cbopickup2: cbopickup,cbodropoff2 : cbodropoff,tab: tab,carID2 : valid,isDate2 : $('#isDate2').val(),isMonth2 : $('#isMonth2').val(),isYear2 : $('#isYear2').val(),cboTransfer2 : $('#cboTransfer2').val(),datepicker2 : $('#datepicker2').val() ,cboHour2 : $('#cboHour2').val(),cboMin2 : $('#cboMin2').val(),activeAjax : 1},
				function(data){
	$('#getq').attr("disabled", false); 
				    $('#contentsearch1').html(data);
					$('#tab').val(1);
				},"JSON");
		
		}
		function checkgetq(){
				var cbopickup = $('#cbopickup').val();
				var cbodropoff = $('#cbodropoff').val();
				var datepicker = $('#datepicker').val();
				var valid = $("input[@name='car']:checked").val();
				if(cbopickup == ''){
					alert("choice pick up");
					return false;
				}else if(cbodropoff == ''){
					alert("choice drop off");
					return false;
				}else if(datepicker == ''){
					alert("choice date");
					return false;
				}else if(valid == 0){
					alert("choice car");
					return false;
				}else{
					document.searhcar.submit();
				}
		}
		function checkgetq2(){
				var cbopickup = $('#cbopickup2').val();
				var cbodropoff = $('#cbodropoff2').val();
				var datepicker = $('#datepicker2').val();
				var valid = $("input[@name='car2']:checked").val();
				if(cbopickup == ''){
					alert("choice pick up");
					return false;
				}else if(cbodropoff == ''){
					alert("choice drop off");
					return false;
				}else if(datepicker == ''){
					alert("choice date");
					return false;
				}else if(valid == 0){
					alert("choice car");
					return false;
				}else{
					document.searhcar.submit();
				}
		}
		function setAction(processurl){
			if (confirm("Bạn có thật sự muốn thay đổi không?")){
				$("#listTable").hide();
				$("#loadingTable").show();
				$.post(processurl,
					{activeAjax: 1, cur_pos: 0, numresult: $("#numresult").val(), order: $("#order").val()},
					function(data){
						alert("Mọi thay đổi đã được cập nhật");
						$("#listTable").html(data);
						$("#loadingTable").hide();
						$("#listTable").show();
					}
				);
			}
		}		
