/*function page(pageno, pagecount,currenttype,currentpage) {
        $("#page").empty();
        if (pageno > 1) {
            var c = pageno - 1;
            $("#page").append("<a onclick='page(" + c + "," + pagecount + ",\""+currenttype+"\",\""+currentpage+"\")'>...</a> ");
        }
        for (var i = pageno; i < pageno + pagecount; i++) {

            $("#page").append("<a href="+currentpage+"?ws=GetItemMaster&producttype="+currenttype+"&pagesize=9&pageno="+i+"> "+i+"</a> ");

        }
        if (pagecount > pageno + 10) {
            var b = pageno + 1;
            $("#page").append("<a onclick='page(" + b + "," + pagecount + ",\""+currenttype+"\",\""+currentpage+"\")'>...</a> ");
        }    
    }
*/
/*
<input type="hidden" value="{/data/webservice1/request/queryString/producttype}" id="ptype"/>   pruduct type
<input type="hidden" value="{$current/@path}" id="currentpage"/>  current page url
<input type="hidden" value="{$page1/pageno}" id="currentpageno"/> current page no.
<input type="hidden" value="{$page1/pagecount}" id="pagecount"/>  total page no.
*/
/*pageno ÆðÊ¼í“ pagecount ¿‚í“”µ currentpageno®”Ç°í“´a*/
function page(pageno, pagecount,currentpageno,getproduct) {
        $("#ProductPagination").empty();
		//alert(pageno);
		if(pagecount<2||pagecount=='')
		{	return;}
		var criteriaid=getType();
		var j=0;
        if (pageno > 1) {			
			j=parseInt(pageno)-1;
			var currentpageno1=parseInt(currentpageno)-1;
            var c = j;
            $("#ProductPagination").append("<a  href='#' class='prev' onclick='page(" + c + "," + pagecount + ",\""+currentpageno1+"\",\"true\")'>Previous</a>");
			if(pagecount<6)
			{	j=0;}
			if(pageno>pagecount-5&&pagecount>5)
			{
				j=pagecount-5;
			}
			
		}        		
		else
			$("#ProductPagination").append("<a class='prev'>Previous</a>");		
        for (i = j+1; i < j + 5+1&&i<=pagecount; i++) {
			//var currentpageno1=parseInt(currentpageno)+1;
			if(i!=currentpageno)
            {	
				
				$("#ProductPagination").append("<a href='#' onclick='productshow(\""+typeid+"\",\""+criteriaid+"\",\""+lang+"\",\""+imgpath+"\","+i+",\"true\")'>"+i+"</a>");
			}
			else
			{	
				$("#ProductPagination").append(" <span class='current'>"+i+"</span> ");
				if(getproduct=='true')
					productshow(typeid,criteriaid,lang,imgpath,currentpageno,'false');
				
			}
        }
        if (pagecount > j + 5) {
            var b = pageno +1;
			var currentpageno1=parseInt(currentpageno)+1;
            $("#ProductPagination").append("<a class='next' href='#' onclick='page(" + b + "," + pagecount + ",\""+currentpageno1+"\",\"true\")'>Next</a>");
        }
		else	
		{	if(currentpageno<pagecount)
			{	
				var b = pageno +1;
				var currentpageno1=parseInt(currentpageno)+1;
				$("#ProductPagination").append("<a class='next' href='#' onclick='page(" + b + "," + pagecount + ",\""+currentpageno1+"\",\"true\")'>Next</a>");				
			}
			else
				$("#ProductPagination").append("<a class='next'>Next</a>");
		}
    }
	
	
	
	
	
	
	
	
	
	
	
	
	
	
