Hello

I have a javascript pagination script, and it has dropdown, like when select 8, it shows 8 box, when select 16 it shows 16, what I want is to add an option called "view all" so when I select view all it loads all, but I cant find the way to do it as the code has been written by other developer and he is not in contact.

Here is the code sample:

Code:
//Change Results Per Page Start
  if(changeresults == "Y")
  {
    if(resultsdropdown == "Y")
	{
	  var secondstep = startingresultsperpage * 2;
      var thirdstep = startingresultsperpage * 3;

      if(arrLength > resultsperpage)
      {
	    $(".SortPagingLinksResults").append("<b>Products Per Page:&nbsp;</b>");
		
		if(arrLength > thirdstep)
	    {
		  $(".SortPagingLinksResults").append("<select onChange=\"javascript:change(1,'"+sort+"',this.value);\"><option value=\""+startingresultsperpage+"\">"+startingresultsperpage+"</option><option value=\""+secondstep+"\">"+secondstep+"</option><option value=\""+thirdstep+"\">"+thirdstep+"</option><option onchange=\"javascript:change(0,'"+sort+"',"+resultsperpage+");\">View All</option></select>");
		}
		else if(arrLength > secondstep)
	    {
		  $(".SortPagingLinksResults").append("<select onChange=\"javascript:change(1,'"+sort+"',this.value);\"><option value=\""+startingresultsperpage+"\">"+startingresultsperpage+"</option><option value=\""+secondstep+"\">"+secondstep+"</option><option onchange=\"javascript:change(0,'"+sort+"',"+resultsperpage+");\">View All</option></select>");
		}
		else{}
		
	    if(resultsperpage == startingresultsperpage)
	    { 
		  //$(".SortPagingLinksResults select:eq(0) option:eq(0)").attr("selected", "selected");
		  $(".SortPagingLinksResults select option:eq(0)").attr("selected", "selected");
		  $(".SortPagingLinksResults:eq(1) select option:eq(0)").attr("selected", "selected");
	    }
	    else if(resultsperpage == secondstep)
	    {
	      //$(".SortPagingLinksResults select:eq(0) option:eq(1)").attr("selected", "selected");
		  $(".SortPagingLinksResults select option:eq(1)").attr("selected", "selected");
		  $(".SortPagingLinksResults:eq(1) select option:eq(1)").attr("selected", "selected");
	    }
	    else
	    {
  	      //$(".SortPagingLinksResults select:eq(0) option:eq(2)").attr("selected", "selected");
		  $(".SortPagingLinksResults select option:eq(2)").attr("selected", "selected");
		  $(".SortPagingLinksResults:eq(1) select option:eq(2)").attr("selected", "selected");
	    }
      }
	}
	else
	{
      var secondstep = startingresultsperpage * 2;
      var thirdstep = startingresultsperpage * 3;

      if(arrLength > resultsperpage)
      {
	    $(".SortPagingLinksResults").append("<b>Products Per Page:&nbsp;</b>");
	    if(resultsperpage == startingresultsperpage)
	    { 
	      $(".SortPagingLinksResults").append("<div class=\"selNum\">"+resultsperpage+"</div>");
	      if(arrLength > secondstep)
	      {
		    $(".SortPagingLinksResults").append("&nbsp;|&nbsp;<a href=\"#pagetop\" onclick=\"javascript:change(1,'"+sort+"',"+secondstep+");\">"+secondstep+"</a>");
	      }
	      if(arrLength > thirdstep)
	      {
		    $(".SortPagingLinksResults").append("&nbsp;|&nbsp;<a href=\"#pagetop\" onclick=\"javascript:change(1,'"+sort+"',"+thirdstep+");\">"+thirdstep+"</a>");
	      }
	    }
	    else if(resultsperpage == secondstep)
	    {
	      $(".SortPagingLinksResults").append("<a href=\"#pagetop\" onclick=\"javascript:change(1,'"+sort+"',"+startingresultsperpage+");\">"+startingresultsperpage+"</a>");
	      $(".SortPagingLinksResults").append("&nbsp;|&nbsp;<div class=\"selNum\">"+secondstep+"</div>");
	      if(arrLength > thirdstep)
	      {
		    $(".SortPagingLinksResults").append("&nbsp;|&nbsp;<a href=\"#pagetop\" onclick=\"javascript:change(1,'"+sort+"',"+thirdstep+");\">"+thirdstep+"</a>");
	      }
	    }
	    else
	    {
  	      $(".SortPagingLinksResults").append("<a href=\"#pagetop\" onclick=\"javascript:change(1,'"+sort+"',"+startingresultsperpage+");\">"+startingresultsperpage+"</a>");
	      $(".SortPagingLinksResults").append("&nbsp;|&nbsp;<a href=\"#pagetop\" onclick=\"javascript:change(1,'"+sort+"',"+secondstep+");\">"+secondstep+"</a>");
	      $(".SortPagingLinksResults").append("&nbsp;|&nbsp;<div class=\"selNum\">"+thirdstep+"<div>");
	    }
      }
	}
  }
  //Change Results Per Page End