﻿/**
 * Phương thức xử lý cho paging khi option CurrentMode là Editbox hay Combobx.
 */

var pagingeditbox = function(url, maxPage, inputInValid)
{    
    $("#paging-mode-editbox").keypress(function(evt) {		
        if(evt.keyCode == 13)
        {
	        var value = $("#paging-mode-editbox").val();
	        							    	
	        if(1 <= value && value <= maxPage)
	        {    		        
                document.location = $.format(url, '.' + value + '.html');
	        }
	        else 
	        {
		        alert(inputInValid);
	        }
        }
    });
}

var pagingcombobox = function(url)
{    
    $("#paging-mode-combobox").change(function(evt){
        document.location = evt.target.options[evt.target.selectedIndex].value;
    });    
}