﻿function displayperpage(count) {
var paging = Math.ceil(document.getElementById("firstProduct").value/count);
    if(document.getElementById("SubCategory").value == ""){
        document.forms.form_products.action = "products.asp?category_id=" + document.getElementById("category_id").value + "&productPerPages=" + count + "&currentPage="+paging;
	}
	else{
	    document.forms.form_products.action = "products.asp?category_id=" + document.getElementById("category_id").value + "&SubCategory=" + document.getElementById("SubCategory").value + "&productPerPages=" + count + "&currentPage="+paging;
	}
	document.forms.form_products.submit();
}
function displaypage(page) {
        if(document.getElementById("SubCategory").value == ""){
		    document.forms.form_products.action = "products.asp?category_id=" + document.getElementById("category_id").value + "&productPerPages=" + document.getElementById("productPerPages").value + "&currentPage="+page;
		}
		else{
		    document.forms.form_products.action = "products.asp?category_id=" + document.getElementById("category_id").value + "&SubCategory=" + document.getElementById("SubCategory").value + "&productPerPages=" + document.getElementById("productPerPages").value + "&currentPage="+page;
		}
		document.forms.form_products.submit();
}